Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 104313. ------------------------------------------------------------ revno: 104313 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-05-21 18:18:49 -0700 message: Further tweak previous files.el change. * lisp/files.el (hack-local-variables): In the MODE-ONLY case, try to ignore minor modes. diff: === modified file 'lisp/files.el' --- lisp/files.el 2011-05-22 00:34:41 +0000 +++ lisp/files.el 2011-05-22 01:18:49 +0000 @@ -3147,7 +3147,9 @@ (defun hack-local-variables (&optional mode-only) "Parse and put into effect this buffer's local variables spec. If MODE-ONLY is non-nil, all we do is check whether a \"mode:\" -is specified, and return the corresponding mode symbol, or nil." +is specified, and return the corresponding mode symbol, or nil. +In this case, we try to ignore minor-modes, and only return a +major-mode." (let ((enable-local-variables (and local-enable-local-variables enable-local-variables)) result) @@ -3226,17 +3228,20 @@ (let* ((str (buffer-substring beg (point))) (var (let ((read-circle nil)) (read str))) - val) + val val2) ;; Read the variable value. (skip-chars-forward "^:") (forward-char 1) (let ((read-circle nil)) (setq val (read (current-buffer)))) (if mode-only - (if (eq var 'mode) - (setq result - (intern (concat (symbol-name val) - "-mode")))) + (and (eq var 'mode) + ;; Specifying minor-modes via mode: is + ;; deprecated, but try to reject them anyway. + (not (string-match + "-minor\\'" + (setq val2 (symbol-name val)))) + (setq result (intern (concat val2 "-mode")))) (unless (eq var 'coding) (condition-case nil (push (cons (if (eq var 'eval) ------------------------------------------------------------ revno: 104312 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-05-21 17:34:41 -0700 message: Tweak previous files.el change. * lisp/files.el (hack-local-variables-prop-line) (hack-local-variables): In the MODE-ONLY case, return the full mode symbol, including "-mode". diff: === modified file 'lisp/files.el' --- lisp/files.el 2011-05-22 00:04:49 +0000 +++ lisp/files.el 2011-05-22 00:34:41 +0000 @@ -3049,7 +3049,7 @@ ((looking-at "[ \t]*\\([^ \t\n\r:;]+\\)\\([ \t]*-\\*-\\)") ;; Simple form: "-*- MODENAME -*-". (if mode-only - (intern (match-string 1)))) + (intern (concat (match-string 1) "-mode")))) (t ;; Hairy form: '-*-' [ ':' ';' ]* '-*-' ;; (last ";" is optional). @@ -3077,7 +3077,8 @@ (keyname (downcase (symbol-name key)))) (if mode-only (and (equal keyname "mode") - (setq result val)) + (setq result + (intern (concat (symbol-name val) "-mode")))) (or (equal keyname "coding") (condition-case nil (push (cons (if (eq key 'eval) @@ -3233,7 +3234,9 @@ (setq val (read (current-buffer)))) (if mode-only (if (eq var 'mode) - (setq result val)) + (setq result + (intern (concat (symbol-name val) + "-mode")))) (unless (eq var 'coding) (condition-case nil (push (cons (if (eq var 'eval) ------------------------------------------------------------ revno: 104311 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-05-21 17:04:49 -0700 message: More small hack-local-variables tweaks for MODE-ONLY case. * lisp/files.el (hack-local-variables-prop-line): Small simplifications. (hack-local-variables, hack-local-variables-prop-line): If MODE-ONLY, return the mode, rather than just `t'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-21 23:18:22 +0000 +++ lisp/ChangeLog 2011-05-22 00:04:49 +0000 @@ -1,3 +1,9 @@ +2011-05-22 Glenn Morris + + * files.el (hack-local-variables-prop-line): Small simplifications. + (hack-local-variables, hack-local-variables-prop-line): + If MODE-ONLY, return the mode, rather than just `t'. + 2011-05-21 Stefan Monnier * progmodes/grep.el (grep-mode): Fix last change (bug#8684). === modified file 'lisp/files.el' --- lisp/files.el 2011-05-21 22:33:12 +0000 +++ lisp/files.el 2011-05-22 00:04:49 +0000 @@ -3032,63 +3032,61 @@ (defun hack-local-variables-prop-line (&optional mode-only) "Return local variables specified in the -*- line. -Ignore any specification for `mode:' and `coding:'; -`set-auto-mode' should already have handled `mode:', -`set-auto-coding' should already have handled `coding:'. +Returns an alist of elements (VAR . VAL), where VAR is a variable +and VAL is the specified value. Ignores any specification for +`mode:' and `coding:' (which should have already been handled +by `set-auto-mode' and `set-auto-coding', respectively). +Throws an error if the -*- line is malformed. -If MODE-ONLY is non-nil, all we do is check whether the major -mode is specified, returning t if it is specified. Otherwise, -return an alist of elements (VAR . VAL), where VAR is a variable -and VAL is the specified value." +If MODE-ONLY is non-nil, just returns the symbol specifying the +mode, if there is one, otherwise nil." (save-excursion (goto-char (point-min)) (let ((end (set-auto-mode-1)) - result mode-specified) - ;; Parse the -*- line into the RESULT alist. - ;; Also set MODE-SPECIFIED if we see a spec or `mode'. + result) (cond ((not end) nil) ((looking-at "[ \t]*\\([^ \t\n\r:;]+\\)\\([ \t]*-\\*-\\)") - ;; Simple form: "-*- MODENAME -*-". Already handled. - (setq mode-specified t) - nil) + ;; Simple form: "-*- MODENAME -*-". + (if mode-only + (intern (match-string 1)))) (t ;; Hairy form: '-*-' [ ':' ';' ]* '-*-' ;; (last ";" is optional). - (while (and (< (point) end) - (or (not mode-only) - (not mode-specified))) + ;; If MODE-ONLY, just check for `mode'. + ;; Otherwise, parse the -*- line into the RESULT alist. + (while (and (or (not mode-only) + (not result)) + (< (point) end)) (or (looking-at "[ \t]*\\([^ \t\n:]+\\)[ \t]*:[ \t]*") (error "Malformed -*- line")) (goto-char (match-end 0)) ;; There used to be a downcase here, ;; but the manual didn't say so, ;; and people want to set var names that aren't all lc. - (let ((key (intern (match-string 1))) - (val (save-restriction - (narrow-to-region (point) end) - (let ((read-circle nil)) - (read (current-buffer)))))) - ;; It is traditional to ignore - ;; case when checking for `mode' in set-auto-mode, - ;; so we must do that here as well. - ;; That is inconsistent, but we're stuck with it. - ;; The same can be said for `coding' in set-auto-coding. - (or (and (equal (downcase (symbol-name key)) "mode") - (setq mode-specified t)) - mode-only - (equal (downcase (symbol-name key)) "coding") - (condition-case nil - (push (cons (if (eq key 'eval) - 'eval - (indirect-variable key)) - val) result) - (error nil))) - (skip-chars-forward " \t;"))))) - - (if mode-only - mode-specified - result)))) + (let* ((key (intern (match-string 1))) + (val (save-restriction + (narrow-to-region (point) end) + (let ((read-circle nil)) + (read (current-buffer))))) + ;; It is traditional to ignore + ;; case when checking for `mode' in set-auto-mode, + ;; so we must do that here as well. + ;; That is inconsistent, but we're stuck with it. + ;; The same can be said for `coding' in set-auto-coding. + (keyname (downcase (symbol-name key)))) + (if mode-only + (and (equal keyname "mode") + (setq result val)) + (or (equal keyname "coding") + (condition-case nil + (push (cons (if (eq key 'eval) + 'eval + (indirect-variable key)) + val) result) + (error nil)))) + (skip-chars-forward " \t;"))) + result))))) (defun hack-local-variables-filter (variables dir-name) "Filter local variable settings, querying the user if necessary. @@ -3147,8 +3145,8 @@ (defun hack-local-variables (&optional mode-only) "Parse and put into effect this buffer's local variables spec. -If MODE-ONLY is non-nil, all we do is check whether the major mode -is specified, returning t if it is specified." +If MODE-ONLY is non-nil, all we do is check whether a \"mode:\" +is specified, and return the corresponding mode symbol, or nil." (let ((enable-local-variables (and local-enable-local-variables enable-local-variables)) result) @@ -3235,7 +3233,7 @@ (setq val (read (current-buffer)))) (if mode-only (if (eq var 'mode) - (setq result t)) + (setq result val)) (unless (eq var 'coding) (condition-case nil (push (cons (if (eq var 'eval) ------------------------------------------------------------ revno: 104310 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8684 committer: Stefan Monnier branch nick: trunk timestamp: Sat 2011-05-21 20:18:22 -0300 message: * lisp/progmodes/grep.el (grep-mode): Fix last change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-21 22:33:12 +0000 +++ lisp/ChangeLog 2011-05-21 23:18:22 +0000 @@ -1,3 +1,7 @@ +2011-05-21 Stefan Monnier + + * progmodes/grep.el (grep-mode): Fix last change (bug#8684). + 2011-05-21 Glenn Morris * files.el (hack-local-variables-prop-line, hack-local-variables): === modified file 'lisp/progmodes/grep.el' --- lisp/progmodes/grep.el 2011-05-17 18:14:30 +0000 +++ lisp/progmodes/grep.el 2011-05-21 23:18:22 +0000 @@ -698,7 +698,9 @@ grep-hit-face) (set (make-local-variable 'compilation-error-regexp-alist) grep-regexp-alist) - (set (make-local-variable 'compilation-directory-matcher) nil) + ;; compilation-directory-matcher can't be nil, so we set it to a regexp that + ;; can never match. + (set (make-local-variable 'compilation-directory-matcher) "\\`a\\`") (set (make-local-variable 'compilation-process-setup-function) 'grep-process-setup) (set (make-local-variable 'compilation-disable-input) t) ------------------------------------------------------------ revno: 104309 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-05-21 15:33:12 -0700 message: Small files.el hack-local changes for mode-only case. * lisp/files.el (hack-local-variables-prop-line, hack-local-variables): If only interested in the mode, don't bother doing the other stuff. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-21 02:09:49 +0000 +++ lisp/ChangeLog 2011-05-21 22:33:12 +0000 @@ -1,5 +1,8 @@ 2011-05-21 Glenn Morris + * files.el (hack-local-variables-prop-line, hack-local-variables): + If only interested in the mode, don't bother doing the other stuff. + * image-mode.el (image-after-revert-hook): Redraw all frames on which the image is visible. (Bug#8567) === modified file 'lisp/files.el' --- lisp/files.el 2011-05-20 00:51:46 +0000 +++ lisp/files.el 2011-05-21 22:33:12 +0000 @@ -3055,7 +3055,9 @@ (t ;; Hairy form: '-*-' [ ':' ';' ]* '-*-' ;; (last ";" is optional). - (while (< (point) end) + (while (and (< (point) end) + (or (not mode-only) + (not mode-specified))) (or (looking-at "[ \t]*\\([^ \t\n:]+\\)[ \t]*:[ \t]*") (error "Malformed -*- line")) (goto-char (match-end 0)) @@ -3074,6 +3076,7 @@ ;; The same can be said for `coding' in set-auto-coding. (or (and (equal (downcase (symbol-name key)) "mode") (setq mode-specified t)) + mode-only (equal (downcase (symbol-name key)) "coding") (condition-case nil (push (cons (if (eq key 'eval) @@ -3154,88 +3157,93 @@ (report-errors "Directory-local variables error: %s" (hack-dir-local-variables))) (when (or mode-only enable-local-variables) - (setq result (hack-local-variables-prop-line mode-only)) - ;; Look for "Local variables:" line in last page. - (save-excursion - (goto-char (point-max)) - (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) - 'move) - (when (let ((case-fold-search t)) - (search-forward "Local Variables:" nil t)) - (skip-chars-forward " \t") - ;; suffix is what comes after "local variables:" in its line. - ;; prefix is what comes before "local variables:" in its line. - (let ((suffix - (concat - (regexp-quote (buffer-substring (point) - (line-end-position))) - "$")) - (prefix - (concat "^" (regexp-quote - (buffer-substring (line-beginning-position) - (match-beginning 0))))) - beg) - - (forward-line 1) - (let ((startpos (point)) - endpos - (thisbuf (current-buffer))) - (save-excursion - (unless (let ((case-fold-search t)) - (re-search-forward - (concat prefix "[ \t]*End:[ \t]*" suffix) - nil t)) - ;; This used to be an error, but really all it means is - ;; that this may simply not be a local-variables section, - ;; so just ignore it. - (message "Local variables list is not properly terminated")) - (beginning-of-line) - (setq endpos (point))) - - (with-temp-buffer - (insert-buffer-substring thisbuf startpos endpos) - (goto-char (point-min)) - (subst-char-in-region (point) (point-max) ?\^m ?\n) - (while (not (eobp)) - ;; Discard the prefix. - (if (looking-at prefix) - (delete-region (point) (match-end 0)) - (error "Local variables entry is missing the prefix")) - (end-of-line) - ;; Discard the suffix. - (if (looking-back suffix) - (delete-region (match-beginning 0) (point)) - (error "Local variables entry is missing the suffix")) - (forward-line 1)) - (goto-char (point-min)) - - (while (not (eobp)) - ;; Find the variable name; strip whitespace. - (skip-chars-forward " \t") - (setq beg (point)) - (skip-chars-forward "^:\n") - (if (eolp) (error "Missing colon in local variables entry")) - (skip-chars-backward " \t") - (let* ((str (buffer-substring beg (point))) - (var (let ((read-circle nil)) - (read str))) - val) - ;; Read the variable value. - (skip-chars-forward "^:") - (forward-char 1) - (let ((read-circle nil)) - (setq val (read (current-buffer)))) - (if mode-only - (if (eq var 'mode) - (setq result t)) - (unless (eq var 'coding) - (condition-case nil - (push (cons (if (eq var 'eval) - 'eval - (indirect-variable var)) - val) result) - (error nil))))) - (forward-line 1)))))))) + ;; If MODE-ONLY is non-nil, and the prop line specifies a mode, + ;; then we're done, and have no need to scan further. + (unless (and (setq result (hack-local-variables-prop-line mode-only)) + mode-only) + ;; Look for "Local variables:" line in last page. + (save-excursion + (goto-char (point-max)) + (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) + 'move) + (when (let ((case-fold-search t)) + (search-forward "Local Variables:" nil t)) + (skip-chars-forward " \t") + ;; suffix is what comes after "local variables:" in its line. + ;; prefix is what comes before "local variables:" in its line. + (let ((suffix + (concat + (regexp-quote (buffer-substring (point) + (line-end-position))) + "$")) + (prefix + (concat "^" (regexp-quote + (buffer-substring (line-beginning-position) + (match-beginning 0))))) + beg) + + (forward-line 1) + (let ((startpos (point)) + endpos + (thisbuf (current-buffer))) + (save-excursion + (unless (let ((case-fold-search t)) + (re-search-forward + (concat prefix "[ \t]*End:[ \t]*" suffix) + nil t)) + ;; This used to be an error, but really all it means is + ;; that this may simply not be a local-variables section, + ;; so just ignore it. + (message "Local variables list is not properly terminated")) + (beginning-of-line) + (setq endpos (point))) + + (with-temp-buffer + (insert-buffer-substring thisbuf startpos endpos) + (goto-char (point-min)) + (subst-char-in-region (point) (point-max) ?\^m ?\n) + (while (not (eobp)) + ;; Discard the prefix. + (if (looking-at prefix) + (delete-region (point) (match-end 0)) + (error "Local variables entry is missing the prefix")) + (end-of-line) + ;; Discard the suffix. + (if (looking-back suffix) + (delete-region (match-beginning 0) (point)) + (error "Local variables entry is missing the suffix")) + (forward-line 1)) + (goto-char (point-min)) + + (while (and (not (eobp)) + (or (not mode-only) + (not result))) + ;; Find the variable name; strip whitespace. + (skip-chars-forward " \t") + (setq beg (point)) + (skip-chars-forward "^:\n") + (if (eolp) (error "Missing colon in local variables entry")) + (skip-chars-backward " \t") + (let* ((str (buffer-substring beg (point))) + (var (let ((read-circle nil)) + (read str))) + val) + ;; Read the variable value. + (skip-chars-forward "^:") + (forward-char 1) + (let ((read-circle nil)) + (setq val (read (current-buffer)))) + (if mode-only + (if (eq var 'mode) + (setq result t)) + (unless (eq var 'coding) + (condition-case nil + (push (cons (if (eq var 'eval) + 'eval + (indirect-variable var)) + val) result) + (error nil))))) + (forward-line 1))))))))) ;; Now we've read all the local variables. ;; If MODE-ONLY is non-nil, return whether the mode was specified. (cond (mode-only result) ------------------------------------------------------------ revno: 104308 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-05-21 14:19:30 -0700 message: * admin/bzrmerge.el (bzrmerge-resolve): Suppress prompts about file-locals. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2011-04-10 16:33:22 +0000 +++ admin/ChangeLog 2011-05-21 21:19:30 +0000 @@ -1,3 +1,7 @@ +2011-05-21 Glenn Morris + + * bzrmerge.el (bzrmerge-resolve): Suppress prompts about file-locals. + 2011-03-07 Chong Yidong * Version 23.3 released. === modified file 'admin/bzrmerge.el' --- admin/bzrmerge.el 2011-02-23 03:50:04 +0000 +++ admin/bzrmerge.el 2011-05-21 21:19:30 +0000 @@ -146,7 +146,8 @@ (unless (file-exists-p file) (error "Bzrmerge-resolve: Can't find %s" file)) (with-demoted-errors (let ((exists (find-buffer-visiting file))) - (with-current-buffer (find-file-noselect file) + (with-current-buffer (let ((enable-local-variables :safe)) + (find-file-noselect file)) (if (buffer-modified-p) (error "Unsaved changes in %s" (current-buffer))) (save-excursion ------------------------------------------------------------ revno: 104307 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-05-21 06:19:46 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/dired.el' --- lisp/dired.el 2011-04-20 10:23:12 +0000 +++ lisp/dired.el 2011-05-21 10:19:46 +0000 @@ -3629,7 +3629,7 @@ ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "e34e1bbdb701078d52466c319d8e0cda") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "7efcfe4f9e0913ae4a87be014010c27f") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ ------------------------------------------------------------ revno: 104306 committer: Andreas Schwab branch nick: emacs timestamp: Sat 2011-05-21 11:53:32 +0200 message: * Makefile.in (AUTOMAKE_INPUTS): Add $(srcdir)/lib/gnulib.mk. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-20 09:54:04 +0000 +++ ChangeLog 2011-05-21 09:53:32 +0000 @@ -1,3 +1,7 @@ +2011-05-21 Andreas Schwab + + * Makefile.in (AUTOMAKE_INPUTS): Add $(srcdir)/lib/gnulib.mk. + 2011-05-20 Eli Zaretskii * .bzrignore: Add lib/stdio.in-h, lib/stdbool.h, and lib/stdint.h. === modified file 'Makefile.in' --- Makefile.in 2011-05-12 07:24:14 +0000 +++ Makefile.in 2011-05-21 09:53:32 +0000 @@ -422,7 +422,7 @@ $(srcdir)/aclocal.m4: $(ACLOCAL_INPUTS) cd $(srcdir) && aclocal -I m4 -AUTOMAKE_INPUTS = @MAINT@ $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am +AUTOMAKE_INPUTS = @MAINT@ $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am $(srcdir)/lib/gnulib.mk $(srcdir)/lib/Makefile.in: $(AUTOMAKE_INPUTS) cd $(srcdir) && automake --gnu -a -c lib/Makefile am--refresh: $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/src/config.in ------------------------------------------------------------ revno: 104305 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-05-20 19:27:00 -0700 message: * lib-src/etags.c: Fix typo in previous comment change. diff: === modified file 'lib-src/etags.c' --- lib-src/etags.c 2011-05-21 02:08:21 +0000 +++ lib-src/etags.c 2011-05-21 02:27:00 +0000 @@ -93,7 +93,7 @@ #ifdef HAVE_CONFIG_H # include - /* This is probably not necessary any more. On some systms, config.h + /* This is probably not necessary any more. On some systems, config.h used to define static as nothing for the sake of unexec. We don't want that here since we don't use unexec. None of these systems are supported any more, but the idea is still mentioned in