summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog46
-rw-r--r--lisp/dired-aux.el19
-rw-r--r--lisp/dired.el2
-rw-r--r--lisp/emacs-lisp/bytecomp.el4
-rw-r--r--lisp/emacs-lisp/macroexp.el10
-rw-r--r--lisp/files.el260
-rw-r--r--lisp/image-mode.el3
-rw-r--r--lisp/nxml/rng-xsd.el2
-rw-r--r--lisp/progmodes/grep.el4
-rw-r--r--lisp/vc/diff-mode.el9
-rw-r--r--lisp/vc/vc-dir.el1
-rw-r--r--lisp/wid-edit.el6
12 files changed, 223 insertions, 143 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 05a7d63bb3d..506348601ee 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,49 @@
+2011-05-22 Yuanle Song <sylecn@gmail.com>
+
+ * nxml/rng-xsd.el (rng-xsd-check-pattern): Use case-sensitive
+ matching (Bug#8516).
+
+2011-01-22 Jari Aalto <jari.aalto@cante.net>
+
+ * vc/vc-dir.el (vc-default-dir-printer): Give edited tag a
+ different face (Bug#8178).
+
+2011-05-22 Chong Yidong <cyd@stupidchicken.com>
+
+ * vc/diff-mode.el (diff-changed): Don't use terminal specs for
+ defface (Bug#8144).
+
+2011-05-22 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/macroexp.el (macroexpand-all-1): Convert ' to #' for
+ funcall as well (bug#8712). Warn when performing those conversions.
+ * emacs-lisp/bytecomp.el (byte-compile-form): Fix error report.
+
+ * progmodes/grep.el (grep-mode): Fix it for good (bug#8684)!
+
+2011-05-22 Glenn Morris <rgm@gnu.org>
+
+ * 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 <monnier@iro.umontreal.ca>
+
+ * progmodes/grep.el (grep-mode): Fix last change (bug#8684).
+
+2011-05-21 Glenn Morris <rgm@gnu.org>
+
+ * 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)
+
+ * dired-aux.el (dired-touch-initial): Just use current-time. (Bug#6887)
+
+ * wid-edit.el (widget-checklist-match-inline):
+ Fix 2011-04-19 change. (Bug#8649)
+
2011-05-20 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/checkdoc.el (checkdoc-sentencespace-region-engine):
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 059a635cded..8e4b3b5c6a6 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -229,14 +229,17 @@ List has a form of (file-name full-file-name (attribute-list))."
(defun dired-touch-initial (files)
"Create initial input value for `touch' command."
- (let (initial)
- (while files
- (let ((current (nth 5 (file-attributes (car files)))))
- (if (and initial (not (equal initial current)))
- (setq initial (current-time) files nil)
- (setq initial current))
- (setq files (cdr files))))
- (format-time-string "%Y%m%d%H%M.%S" initial)))
+ ;; Nobody can explain what this version is supposed to do. (Bug#6887)
+ ;; Also, the manual says it uses "the present time".
+ ;;; (let (initial)
+ ;;; (while files
+ ;;; (let ((current (nth 5 (file-attributes (car files)))))
+ ;;; (if (and initial (not (equal initial current)))
+ ;;; (setq initial (current-time) files nil)
+ ;;; (setq initial current))
+ ;;; (setq files (cdr files))))
+ ;;; (format-time-string "%Y%m%d%H%M.%S" initial)))
+ (format-time-string "%Y%m%d%H%M.%S" (current-time)))
(defun dired-do-chxxx (attribute-name program op-symbol arg)
;; Change file attributes (mode, group, owner, timestamp) of marked files and
diff --git a/lisp/dired.el b/lisp/dired.el
index c581597494c..48cdc2a2e26 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3629,7 +3629,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
;;;;;; 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" "\
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index e7f2115a848..49b39b6a1f9 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2892,8 +2892,8 @@ If FORM is a lambda or a macro, byte-compile it as a function."
That command is designed for interactive use only" fn))
(if (and (fboundp (car form))
(eq (car-safe (symbol-function (car form))) 'macro))
- (byte-compile-report-error
- (format "Forgot to expand macro %s" (car form))))
+ (byte-compile-log-warning
+ (format "Forgot to expand macro %s" (car form)) nil :error))
(if (and handler
;; Make sure that function exists. This is important
;; for CL compiler macros since the symbol may be
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index f0a075ace37..ccfdf2e0551 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -169,14 +169,22 @@ Assumes the caller has bound `macroexpand-all-environment'."
;; here, so that any code that cares about the difference will
;; see the same transformation.
;; First arg is a function:
- (`(,(and fun (or `apply `mapcar `mapatoms `mapconcat `mapc))
+ (`(,(and fun (or `funcall `apply `mapcar `mapatoms `mapconcat `mapc))
',(and f `(lambda . ,_)) . ,args)
+ (byte-compile-log-warning
+ (format "%s quoted with ' rather than with #'"
+ (list 'lambda (nth 1 f) '...))
+ t)
;; We don't use `maybe-cons' since there's clearly a change.
(cons fun
(cons (macroexpand-all-1 (list 'function f))
(macroexpand-all-forms args))))
;; Second arg is a function:
(`(,(and fun (or `sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args)
+ (byte-compile-log-warning
+ (format "%s quoted with ' rather than with #'"
+ (list 'lambda (nth 1 f) '...))
+ t)
;; We don't use `maybe-cons' since there's clearly a change.
(cons fun
(cons (macroexpand-all-1 arg1)
diff --git a/lisp/files.el b/lisp/files.el
index 200b9b1d303..24a0e0a5b62 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3032,60 +3032,62 @@ n -- to ignore the local variables list.")
(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:'.
-
-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."
+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, 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 (concat (match-string 1) "-mode"))))
(t
;; Hairy form: '-*-' [ <variable> ':' <value> ';' ]* '-*-'
;; (last ";" is optional).
- (while (< (point) end)
+ ;; 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))
- (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
+ (intern (concat (symbol-name val) "-mode"))))
+ (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.
@@ -3144,8 +3146,10 @@ DIR-NAME is the name of the associated directory. Otherwise it is nil."
(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.
+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)
@@ -3154,88 +3158,98 @@ is specified, returning t if it is specified."
(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 val2)
+ ;; Read the variable value.
+ (skip-chars-forward "^:")
+ (forward-char 1)
+ (let ((read-circle nil))
+ (setq val (read (current-buffer))))
+ (if mode-only
+ (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)
+ '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)
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 17f006e81a1..f4eb5eeaf45 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -532,7 +532,8 @@ the image by calling `image-mode'."
(when (image-get-display-property)
(image-toggle-display-text)
;; Update image display.
- (redraw-frame (selected-frame))
+ (mapc (lambda (window) (redraw-frame (window-frame window)))
+ (get-buffer-window-list (current-buffer) 'nomini 'visible))
(image-toggle-display-image)))
diff --git a/lisp/nxml/rng-xsd.el b/lisp/nxml/rng-xsd.el
index 266f8daac9e..b481039fdab 100644
--- a/lisp/nxml/rng-xsd.el
+++ b/lisp/nxml/rng-xsd.el
@@ -238,7 +238,7 @@ must be equal."
obj)))
(defun rng-xsd-check-pattern (str regexp convert &rest args)
- (and (string-match regexp str)
+ (and (let ((case-fold-search nil)) (string-match regexp str))
(apply convert (cons str args))))
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 3b819a149b2..db8e82193b3 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -698,7 +698,9 @@ This function is called from `compilation-filter-hook'."
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)
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 56ebe868a2d..392973e08fe 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -295,9 +295,14 @@ try to refine the current hunk, as well."
(defvar diff-added-face 'diff-added)
(defface diff-changed
- '((((type tty pc) (class color) (background light))
+ ;; We normally apply a `shadow'-based face on the `diff-context'
+ ;; face, and keep `diff-changed' the default.
+ '((((class color grayscale) (min-colors 88)))
+ ;; If the terminal lacks sufficient colors for shadowing,
+ ;; highlight changed lines explicitly.
+ (((class color) (background light))
:foreground "magenta" :weight bold :slant italic)
- (((type tty pc) (class color) (background dark))
+ (((class color) (background dark))
:foreground "yellow" :weight bold :slant italic))
"`diff-mode' face used to highlight changed lines."
:group 'diff-mode)
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 01b6f2fc26e..5f3a9a21b59 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1238,6 +1238,7 @@ These are the commands available for use in the file status buffer:
(format "%-20s" state)
'face (cond ((eq state 'up-to-date) 'font-lock-builtin-face)
((memq state '(missing conflict)) 'font-lock-warning-face)
+ ((eq state 'edited) 'font-lock-constant-face)
(t 'font-lock-variable-name-face))
'mouse-face 'highlight)
" "
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 31cc8ad9ca9..7b7813db94b 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -2283,9 +2283,9 @@ If the item is checked, CHOSEN is a cons whose cdr is the value."
(while vals
(let ((answer (widget-checklist-match-up args vals)))
(cond (answer
- (let ((vals (widget-match-inline answer vals)))
- (setq found (append found (car vals))
- vals (cdr vals)
+ (let ((vals2 (widget-match-inline answer vals)))
+ (setq found (append found (car vals2))
+ vals (cdr vals2)
args (delq answer args))))
(greedy
(setq rest (append rest (list (car vals)))