commit fa734d07ab9dd00ad29d68668ed25247c9000aef (HEAD, refs/remotes/origin/master) Author: Tassilo Horn Date: Sat Mar 21 08:52:34 2015 +0100 Handle setf methods in elisp font-locking. * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Also recognize (cl-)defmethod with (setf method) name. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 025941f..1cfefaa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-21 Tassilo Horn + + * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Also + recognize (cl-)defmethod with (setf method) name. + 2015-03-20 Tassilo Horn * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Fix diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index a3bb1a7..9c41945 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -249,7 +249,7 @@ (eieio-tdefs '("defclass")) (eieio-kw '("with-slots")) ;; Common-Lisp constructs supported by cl-lib. - (cl-lib-fdefs '("defmacro" "defsubst" "defun")) + (cl-lib-fdefs '("defmacro" "defsubst" "defun" "defmethod")) (cl-lib-tdefs '("defstruct" "deftype")) (cl-lib-kw '("progv" "eval-when" "case" "ecase" "typecase" "etypecase" "ccase" "ctypecase" "loop" "do" "do*" @@ -321,16 +321,19 @@ (,(concat "(" el-defs-re "\\_>" ;; Any whitespace and defined object. "[ \t']*" - ;; With cl-defstruct, the name may follow a paren, - ;; e.g. (cl-defstruct (foo-struct opts)...). - "\\(([ \t']*\\)?\\(\\(?:\\sw\\|\\s_\\)+\\)?") + "\\(([ \t']*\\)?" ;; An opening paren. + "\\(\\(setf\\)[ \t]+\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+\\)?") (1 font-lock-keyword-face) (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) (cond ((eq type 'var) font-lock-variable-name-face) ((eq type 'type) font-lock-type-face) ;; If match-string 2 is non-nil, we encountered a - ;; form like (defalias (intern (concat s "-p"))). - ((not (match-string 2)) font-lock-function-name-face))) + ;; form like (defalias (intern (concat s "-p"))), + ;; unless match-string 4 is also there. Then its a + ;; defmethod with (setf foo) as name. + ((or (not (match-string 2)) ;; Normal defun. + (and (match-string 2) ;; Setf method. + (match-string 4))) font-lock-function-name-face))) nil t)) ;; Emacs Lisp autoload cookies. Supports the slightly different ;; forms used by mh-e, calendar, etc. @@ -349,7 +352,7 @@ (cond ((eq type 'var) font-lock-variable-name-face) ((eq type 'type) font-lock-type-face) ((or (not (match-string 2)) ;; Normal defun. - (and (match-string 2) ;; Setf-expander. + (and (match-string 2) ;; Setf function. (match-string 4))) font-lock-function-name-face))) nil t))) "Subdued level highlighting for Lisp modes.") commit 73b8237c19200e7d8d3739b99ef1e4dc86f51873 Author: Tassilo Horn Date: Fri Mar 20 23:35:22 2015 +0100 Fix CL function name font-lock bug. * emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-1): Fix false positive in function name font-locking. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 85e62be..025941f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Fix false positive in function name font-locking. + (lisp-cl-font-lock-keywords-1): Ditto. 2015-03-20 Stefan Monnier diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d8901ac..a3bb1a7 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -341,13 +341,16 @@ `( ;; Definitions. (,(concat "(" cl-defs-re "\\_>" ;; Any whitespace and defined object. - "[ \t'\(]*" - "\\(setf[ \t]+\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+\\)?") + "[ \t']*" + "\\(([ \t']*\\)?" ;; An opening paren. + "\\(\\(setf\\)[ \t]+\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+\\)?") (1 font-lock-keyword-face) - (2 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) + (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) (cond ((eq type 'var) font-lock-variable-name-face) ((eq type 'type) font-lock-type-face) - (t font-lock-function-name-face))) + ((or (not (match-string 2)) ;; Normal defun. + (and (match-string 2) ;; Setf-expander. + (match-string 4))) font-lock-function-name-face))) nil t))) "Subdued level highlighting for Lisp modes.") commit c9998fcbf40c533004533dee96f2eb67349d55ae Author: Tassilo Horn Date: Fri Mar 20 23:09:06 2015 +0100 Fix elisp function name font-lock bug. * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Fix false positive in function name font-locking. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ee4e021..85e62be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-20 Tassilo Horn + + * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Fix + false positive in function name font-locking. + 2015-03-20 Stefan Monnier * emacs-lisp/cl-macs.el (cl-defsubst): Ignore false-positive diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 6b30773..d8901ac 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -320,14 +320,18 @@ `( ;; Definitions. (,(concat "(" el-defs-re "\\_>" ;; Any whitespace and defined object. - "[ \t'\(]*" - "\\(\\(?:\\sw\\|\\s_\\)+\\)?") + "[ \t']*" + ;; With cl-defstruct, the name may follow a paren, + ;; e.g. (cl-defstruct (foo-struct opts)...). + "\\(([ \t']*\\)?\\(\\(?:\\sw\\|\\s_\\)+\\)?") (1 font-lock-keyword-face) - (2 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) - (cond ((eq type 'var) font-lock-variable-name-face) - ((eq type 'type) font-lock-type-face) - (t font-lock-function-name-face))) - nil t)) + (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) + (cond ((eq type 'var) font-lock-variable-name-face) + ((eq type 'type) font-lock-type-face) + ;; If match-string 2 is non-nil, we encountered a + ;; form like (defalias (intern (concat s "-p"))). + ((not (match-string 2)) font-lock-function-name-face))) + nil t)) ;; Emacs Lisp autoload cookies. Supports the slightly different ;; forms used by mh-e, calendar, etc. ("^;;;###\\([-a-z]*autoload\\)" 1 font-lock-warning-face prepend)) commit 4cd31cf01964059ab29f735c7856c65631c46c28 Author: Stefan Monnier Date: Fri Mar 20 16:29:21 2015 -0400 (cl-defsubst): Ignore false-positive occurrences of args via &cl-defs Fixes: debbugs:20149 * lisp/emacs-lisp/cl-macs.el (cl-defsubst): Ignore false-positive occurrences of args via &cl-defs. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cecec46..ee4e021 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-20 Stefan Monnier + + * emacs-lisp/cl-macs.el (cl-defsubst): Ignore false-positive + occurrences of args via &cl-defs (bug#20149). + 2015-03-20 Alan Mackenzie Fix debbugs#20146 diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index d386678..75c6a56 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2446,10 +2446,11 @@ The function's arguments should be treated as immutable. \(fn NAME ARGLIST [DOCSTRING] BODY...)" (declare (debug cl-defun) (indent 2)) (let* ((argns (cl--arglist-args args)) + (real-args (if (eq '&cl-defs (car args)) (cddr args) args)) (p argns) ;; (pbody (cons 'progn body)) ) - (while (and p (eq (cl--expr-contains args (car p)) 1)) (pop p)) + (while (and p (eq (cl--expr-contains real-args (car p)) 1)) (pop p)) `(progn ,(if p nil ; give up if defaults refer to earlier args `(cl-define-compiler-macro ,name commit 932d0fdb4fb217adb4e894b595c2294abc4fef3e Author: Alan Mackenzie Date: Fri Mar 20 15:39:37 2015 +0000 Fix debbugs#20146 * font-lock.el (font-lock-extend-jit-lock-region-after-change): Return the calculated values, as per spec. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ac99cd5..cecec46 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2015-03-20 Alan Mackenzie + + Fix debbugs#20146 + + * font-lock.el (font-lock-extend-jit-lock-region-after-change): + Return the calculated values, as per spec. + 2015-03-20 Dmitry Gutov * progmodes/ruby-mode.el (ruby-font-lock-keywords): Move `at_exit' diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 6ec6c9f..1838a0f 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1325,11 +1325,13 @@ This function does 2 things: (when (memq 'font-lock-extend-region-wholelines font-lock-extend-region-functions) (goto-char beg) - (setq jit-lock-start (min jit-lock-start (line-beginning-position))) + (setq beg (min jit-lock-start (line-beginning-position))) (goto-char end) - (setq jit-lock-end + (setq end (max jit-lock-end - (if (bolp) (point) (line-beginning-position 2)))))))) + (if (bolp) (point) (line-beginning-position 2))))) + (setq jit-lock-start beg + jit-lock-end end)))) (defun font-lock-fontify-block (&optional arg) "Fontify some lines the way `font-lock-fontify-buffer' would. commit 1fcc552ac27503c502a9a6e6cf06268e6018db51 Author: Eric Abrahamsen Date: Fri Mar 20 10:49:41 2015 +0000 lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 7e962f7..63a2826 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,10 @@ 2015-03-19 Eric Abrahamsen + * registry.el (registry-prune): Allow registry to reach full size + before pruning. + +2015-03-19 Eric Abrahamsen + * registry.el (registry-collect-prune-candidates): Fix call to cl-subseq. diff --git a/lisp/gnus/registry.el b/lisp/gnus/registry.el index 6ee1c31..e0f944a 100644 --- a/lisp/gnus/registry.el +++ b/lisp/gnus/registry.el @@ -345,7 +345,7 @@ Returns the number of deleted entries." (* (oref db :max-size) (oref db :prune-factor)))) candidates) - (if (> size target-size) + (if (> size (oref db :max-size)) (progn (setq candidates (registry-collect-prune-candidates commit b8ea3aa9dbcc17c0a38214aebdc7cb2b579c34ff Author: Eric Abrahamsen Date: Fri Mar 20 10:49:06 2015 +0000 lisp/gnus/registry.el (registry-collect-prune-candidates): Fix call to cl-subseq diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 64124bc..7e962f7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2015-03-19 Eric Abrahamsen + + * registry.el (registry-collect-prune-candidates): Fix call to + cl-subseq. + 2015-03-11 Stefan Monnier * gnus-registry.el (gnus-registry-handle-action) diff --git a/lisp/gnus/registry.el b/lisp/gnus/registry.el index 1c83b93..6ee1c31 100644 --- a/lisp/gnus/registry.el +++ b/lisp/gnus/registry.el @@ -371,7 +371,7 @@ entries first and return candidates from beginning of list." ;; list of entry keys. (when sortfunc (setq candidates (sort candidates sortfunc))) - (delq nil (cl-subseq (mapcar #'car candidates) 0 limit)))) + (cl-subseq (mapcar #'car candidates) 0 (min limit (length candidates))))) (provide 'registry) ;;; registry.el ends here