Now on revision 107537. ------------------------------------------------------------ revno: 107537 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-03-08 22:21:49 -0500 message: Another dir-locals iteration * lisp/files.el (dir-locals-find-file): Don't check result is regular, readable. (dir-locals-read-from-file): Demote errors. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-08 18:21:07 +0000 +++ lisp/ChangeLog 2012-03-09 03:21:49 +0000 @@ -1,3 +1,9 @@ +2012-03-09 Glenn Morris + + * files.el (dir-locals-find-file): + Don't check result is regular, readable. + (dir-locals-read-from-file): Demote errors. + 2012-03-08 Eli Zaretskii * international/quail.el (quail-insert-kbd-layout): Insert === modified file 'lisp/files.el' --- lisp/files.el 2012-03-08 06:06:28 +0000 +++ lisp/files.el 2012-03-09 03:21:49 +0000 @@ -3574,13 +3574,14 @@ (dir-elt nil)) ;; `locate-dominating-file' may have abbreviated the name. (and locals-file - (setq locals-file (expand-file-name dir-locals-file-name locals-file)) - ;; FIXME? is it right to silently ignore an unreadable file? - ;; Maybe we'd want to keep searching in that case. - ;; That is a locate-dominating-file issue. - (or (not (file-readable-p locals-file)) - (not (file-regular-p locals-file))) - (setq locals-file nil)) + (setq locals-file (expand-file-name dir-locals-file-name locals-file))) + ;; Let dir-locals-read-from-file inform us via demoted-errors + ;; about unreadable files, etc. + ;; Maybe we'd want to keep searching though - that is + ;; a locate-dominating-file issue. +;;; (or (not (file-readable-p locals-file)) +;;; (not (file-regular-p locals-file))) +;;; (setq locals-file nil)) ;; Find the best cached value in `dir-locals-directory-cache'. (dolist (elt dir-locals-directory-cache) (when (and (eq t (compare-strings file nil (length (car elt)) @@ -3622,15 +3623,19 @@ The new class name is the same as the directory in which FILE is found. Returns the new class name." (with-temp-buffer - (insert-file-contents file) - (let* ((dir-name (file-name-directory file)) - (class-name (intern dir-name)) - (variables (let ((read-circle nil)) - (read (current-buffer))))) - (dir-locals-set-class-variables class-name variables) - (dir-locals-set-directory-class dir-name class-name - (nth 5 (file-attributes file))) - class-name))) + ;; Errors reading the file are not very informative. + ;; Eg just "Error: (end-of-file)" does not give any clue that the + ;; problem is related to dir-locals. + (with-demoted-errors + (insert-file-contents file) + (let* ((dir-name (file-name-directory file)) + (class-name (intern dir-name)) + (variables (let ((read-circle nil)) + (read (current-buffer))))) + (dir-locals-set-class-variables class-name variables) + (dir-locals-set-directory-class dir-name class-name + (nth 5 (file-attributes file))) + class-name)))) (defun hack-dir-local-variables () "Read per-directory local variables for the current buffer. ------------------------------------------------------------ revno: 107536 fixes bug(s): http://debbugs.gnu.org/10954 committer: Jan D. branch nick: trunk timestamp: Thu 2012-03-08 19:49:13 +0100 message: * gtkutil.c (x_wm_set_size_hint): Use one row in call to FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than zero. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-03 04:18:09 +0000 +++ src/ChangeLog 2012-03-08 18:49:13 +0000 @@ -1,3 +1,9 @@ +2012-03-08 Jan Djärv + + * gtkutil.c (x_wm_set_size_hint): Use one row in call to + FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than + zero (Bug#10954). + 2012-03-03 Glenn Morris * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes. === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-02-13 22:46:43 +0000 +++ src/gtkutil.c 2012-03-08 18:49:13 +0000 @@ -1304,10 +1304,13 @@ hint_flags |= GDK_HINT_BASE_SIZE; base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0) + FRAME_TOOLBAR_WIDTH (f); - base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0) + /* Use one row here so base_height does not become zero. + Gtk+ and/or Unity on Ubuntu 12.04 can't handle it. */ + base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); check_frame_size (f, &min_rows, &min_cols); + if (min_rows > 0) --min_rows; /* We used one row in base_height = ... 1); */ size_hints.base_width = base_width; size_hints.base_height = base_height; ------------------------------------------------------------ revno: 107535 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2012-03-08 20:21:07 +0200 message: Prevent bidi reordering of rows and keys in the quail layout display. lisp/international/quail.el (quail-insert-kbd-layout): Insert invisible LRM characters before each character in a keyboard layout cell, to prevent their reordering by bidi display engine. For details, see the discussion in http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00085.html. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-08 11:32:57 +0000 +++ lisp/ChangeLog 2012-03-08 18:21:07 +0000 @@ -1,3 +1,11 @@ +2012-03-08 Eli Zaretskii + + * international/quail.el (quail-insert-kbd-layout): Insert + invisible LRM characters before each character in a keyboard + layout cell, to prevent their reordering by bidi display engine. + For details, see the discussion in + http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00085.html. + 2012-03-08 Alan Mackenzie * progmodes/cc-cmds.el (c-mark-function): Make it leave a mark at === modified file 'lisp/international/quail.el' --- lisp/international/quail.el 2012-03-07 18:48:07 +0000 +++ lisp/international/quail.el 2012-03-08 18:21:07 +0000 @@ -833,7 +833,15 @@ (insert bar) (if (= (if (stringp lower) (string-width lower) (char-width lower)) 1) (insert " ")) - (insert lower upper) + ;; Insert invisible LRM characters to force each keyboard row + ;; be rendered left to right, and also to prevent reordering of + ;; individual characters within each cell. See + ;; http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00085.html + ;; for the reasons. + (insert (propertize (string ?\x200e) 'invisible t)) + (insert lower) + (insert (propertize (string ?\x200e) 'invisible t)) + (insert upper) (if (= (if (stringp upper) (string-width upper) (char-width upper)) 1) (insert " ")) (setq i (+ i 2)) @@ -849,20 +857,21 @@ ;;(delete-region pos (point))) (let ((from1 100) (to1 0) from2 to2) (while (not (eobp)) - (if (looking-at "[| ]*$") + (if (looking-at "[| \u200e]*$") ;; The entire row is blank. (delete-region (point) (match-end 0)) ;; Delete blank key columns at the head. - (if (looking-at " *\\(| \\)+") + (if (looking-at " *\\(| \u200e \u200e \\)+") (subst-char-in-region (point) (match-end 0) ?| ? )) ;; Delete blank key columns at the tail. - (if (re-search-forward "\\( |\\)+$" (line-end-position) t) + (if (re-search-forward "\\( \u200e \u200e |\\)+$" + (line-end-position) t) (delete-region (match-beginning 0) (point))) (beginning-of-line)) ;; Calculate the start and end columns of a horizontal line. (if (eolp) (setq from2 from1 to2 to1) - (skip-chars-forward " ") + (skip-chars-forward " \u200e") (setq from2 (current-column)) (end-of-line) (setq to2 (current-column)) ------------------------------------------------------------ revno: 107534 committer: Alan Mackenzie branch nick: trunk timestamp: Thu 2012-03-08 11:32:57 +0000 message: Make c-mark-defun extend region when repeated, and leave a mark. Fixes bugs #5525, #10906. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-08 08:22:16 +0000 +++ lisp/ChangeLog 2012-03-08 11:32:57 +0000 @@ -1,3 +1,10 @@ +2012-03-08 Alan Mackenzie + + * progmodes/cc-cmds.el (c-mark-function): Make it leave a mark at + the starting position; make it extend the marked region when + invoked repeatedly - all under appropriate circumstances. + Fixes bugs #5525, #10906. + 2012-03-08 Glenn Morris * files.el (locate-dominating-file, dir-locals-find-file): === modified file 'lisp/progmodes/cc-cmds.el' --- lisp/progmodes/cc-cmds.el 2012-01-19 07:21:25 +0000 +++ lisp/progmodes/cc-cmds.el 2012-03-08 11:32:57 +0000 @@ -1958,7 +1958,12 @@ (defun c-mark-function () "Put mark at end of the current top-level declaration or macro, point at beginning. -If point is not inside any then the closest following one is chosen. +If point is not inside any then the closest following one is +chosen. Each successive call of this command extends the marked +region by one function. + +A mark is left where the command started, unless the region is already active +\(in Transient Mark mode). As opposed to \\[c-beginning-of-defun] and \\[c-end-of-defun], this function does not require the declaration to contain a brace block." @@ -1974,8 +1979,24 @@ (if (not decl-limits) (error "Cannot find any declaration") - (goto-char (car decl-limits)) - (push-mark (cdr decl-limits) nil t)))) + (let* ((extend-region-p + (and (eq this-command 'c-mark-function) + (eq last-command 'c-mark-function))) + (push-mark-p (and (eq this-command 'c-mark-function) + (not extend-region-p) + (not (and transient-mark-mode mark-active))))) + (if push-mark-p (push-mark (point))) + (if extend-region-p + (progn + (exchange-point-and-mark) + (setq decl-limits (c-declaration-limits t)) + (when (not decl-limits) + (exchange-point-and-mark) + (error "Cannot find any declaration")) + (goto-char (cdr decl-limits)) + (exchange-point-and-mark)) + (goto-char (car decl-limits)) + (push-mark (cdr decl-limits) nil t)))))) (defun c-cpp-define-name () "Return the name of the current CPP macro, or NIL if we're not in one." ------------------------------------------------------------ revno: 107533 committer: Michael Albinus branch nick: trunk timestamp: Thu 2012-03-08 09:22:16 +0100 message: Fix my email address. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-08 06:06:28 +0000 +++ lisp/ChangeLog 2012-03-08 08:22:16 +0000 @@ -10,7 +10,7 @@ http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00062.html for the reason. -2012-03-07 Michael Albinus +2012-03-07 Michael Albinus Avoid superfluous registering of signals. (Bug#10807) ------------------------------------------------------------ revno: 107532 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-03-07 22:06:28 -0800 message: Undo r107517 * lisp/files.el (locate-dominating-file, dir-locals-find-file): Undo 2012-03-06 change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-07 18:48:07 +0000 +++ lisp/ChangeLog 2012-03-08 06:06:28 +0000 @@ -1,3 +1,8 @@ +2012-03-08 Glenn Morris + + * files.el (locate-dominating-file, dir-locals-find-file): + Undo 2012-03-06 change. + 2012-03-07 Eli Zaretskii * international/quail.el (quail-help): Force === modified file 'lisp/files.el' --- lisp/files.el 2012-03-06 08:22:42 +0000 +++ lisp/files.el 2012-03-08 06:06:28 +0000 @@ -877,14 +877,13 @@ ;; (setq dir nil)))) ;; nil))) -(defun locate-dominating-file (file name &optional predicate) +(defun locate-dominating-file (file name) "Look up the directory hierarchy from FILE for a file named NAME. Stop at the first parent directory containing a file NAME, and return the directory. Return nil if not found. -Optional argument PREDICATE is a function of one argument, a file. -It should return non-nil if the file is acceptable. The default is -`file-exists-p'; you might, e.g., want to use `file-readable-p' instead." +This function only tests if FILE exists. If you care about whether +it is readable, regular, etc., you should test the result." ;; We used to use the above locate-dominating-files code, but the ;; directory-files call is very costly, so we're much better off doing ;; multiple calls using the code in here. @@ -911,8 +910,11 @@ ;; (setq user (nth 2 (file-attributes file))) ;; (and prev-user (not (equal user prev-user)))) (string-match locate-dominating-stop-dir-regexp file))) - (setq try (funcall (or predicate 'file-exists-p) - (expand-file-name name file))) + ;; FIXME? maybe this function should (optionally?) + ;; use file-readable-p instead. In many cases, an unreadable + ;; FILE is no better than a non-existent one. + ;; See eg dir-locals-find-file. + (setq try (file-exists-p (expand-file-name name file))) (cond (try (setq root file)) ((equal file (setq file (file-name-directory (directory-file-name file)))) @@ -3550,7 +3552,7 @@ "Find the directory-local variables for FILE. This searches upward in the directory tree from FILE. It stops at the first directory that has been registered in -`dir-locals-directory-cache' or contains a readable `dir-locals-file'. +`dir-locals-directory-cache' or contains a `dir-locals-file'. If it finds an entry in the cache, it checks that it is valid. A cache entry with no modification time element (normally, one that has been assigned directly using `dir-locals-set-directory-class', not @@ -3568,15 +3570,17 @@ (if (eq system-type 'ms-dos) (dosified-file-name dir-locals-file) dir-locals-file)) - ;; FIXME? Is it right to silently ignore unreadable files? - (locals-file (locate-dominating-file file dir-locals-file-name - (lambda (file) - (and (file-readable-p file) - (file-regular-p file))))) + (locals-file (locate-dominating-file file dir-locals-file-name)) (dir-elt nil)) ;; `locate-dominating-file' may have abbreviated the name. - (if locals-file - (setq locals-file (expand-file-name dir-locals-file-name locals-file))) + (and locals-file + (setq locals-file (expand-file-name dir-locals-file-name locals-file)) + ;; FIXME? is it right to silently ignore an unreadable file? + ;; Maybe we'd want to keep searching in that case. + ;; That is a locate-dominating-file issue. + (or (not (file-readable-p locals-file)) + (not (file-regular-p locals-file))) + (setq locals-file nil)) ;; Find the best cached value in `dir-locals-directory-cache'. (dolist (elt dir-locals-directory-cache) (when (and (eq t (compare-strings file nil (length (car elt))