diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 32 | ||||
-rw-r--r-- | lisp/emacs-lisp/debug.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/ert.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/rmc.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 25 |
5 files changed, 46 insertions, 21 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 40eda1e0d65..e313af24975 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -193,20 +193,34 @@ The name is made by appending a number to PREFIX, default \"T\"." (&or lambda-doc cl-declarations)) (def-edebug-spec cl-lambda-list - (([&rest arg] + (([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] - [&optional ["&rest" arg]] + [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] - ))) + . [&or arg nil]))) (def-edebug-spec cl-&optional-arg - (&or (arg &optional def-form arg) arg)) + (&or (cl-lambda-arg &optional def-form arg) arg)) (def-edebug-spec cl-&key-arg - (&or ([&or (symbolp arg) arg] &optional def-form arg) arg)) + (&or ([&or (symbolp cl-lambda-arg) arg] &optional def-form arg) arg)) + +(def-edebug-spec cl-lambda-arg + (&or arg cl-lambda-list1)) + +(def-edebug-spec cl-lambda-list1 + (([&optional ["&whole" arg]] ;; only allowed at lower levels + [&rest cl-lambda-arg] + [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] + [&optional ["&rest" cl-lambda-arg]] + [&optional ["&key" cl-&key-arg &rest cl-&key-arg + &optional "&allow-other-keys"]] + [&optional ["&aux" &rest + &or (symbolp &optional def-form) symbolp]] + . [&or arg nil]))) (def-edebug-spec cl-type-spec sexp) @@ -336,8 +350,8 @@ The full form of a Common Lisp function argument list is [&key (([KEYWORD] VAR) [INITFORM [SVAR]])... [&allow-other-keys]] [&aux (VAR [INITFORM])...]) -VAR maybe be replaced recursively with an argument list for -destructing, `&whole' is supported within these sublists. If +VAR may be replaced recursively with an argument list for +destructuring, `&whole' is supported within these sublists. If SVAR, INITFORM, and KEYWORD are all omitted, then `(VAR)' may be written simply `VAR'. See the Info node `(cl)Argument Lists' for more details. @@ -430,8 +444,8 @@ The full form of a Common Lisp macro argument list is [&aux (VAR [INITFORM])...] [&environment VAR]) -VAR maybe be replaced recursively with an argument list for -destructing, `&whole' is supported within these sublists. If +VAR may be replaced recursively with an argument list for +destructuring, `&whole' is supported within these sublists. If SVAR, INITFORM, and KEYWORD are all omitted, then `(VAR)' may be written simply `VAR'. See the Info node `(cl)Argument Lists' for more details. diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 192333252a1..53b8db81321 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -253,7 +253,9 @@ first will be printed into the backtrace buffer." ;; Unshow debugger-buffer. (quit-restore-window debugger-window debugger-bury-or-kill) ;; Restore current buffer (Bug#12502). - (set-buffer debugger-old-buffer)))) + (set-buffer debugger-old-buffer))) + ;; Forget debugger window, it won't be back (Bug#17882). + (setq debugger-previous-window nil)) ;; Restore previous state of debugger-buffer in case we were ;; in a recursive invocation of the debugger, otherwise just ;; erase the buffer and put it into fundamental mode. diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 83acbacb883..3a3979e81f0 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1625,7 +1625,7 @@ default (if any)." (defun ert-find-test-other-window (test-name) "Find, in another window, the definition of TEST-NAME." (interactive (list (ert-read-test-name-at-point "Find test definition: "))) - (find-function-do-it test-name 'ert-deftest 'switch-to-buffer-other-window)) + (find-function-do-it test-name 'ert--test 'switch-to-buffer-other-window)) (defun ert-delete-test (test-name) "Make the test TEST-NAME unbound. @@ -2594,7 +2594,7 @@ To be used in the ERT results buffer." ;;; Actions on load/unload. -(add-to-list 'find-function-regexp-alist '(ert-deftest . ert--find-test-regexp)) +(add-to-list 'find-function-regexp-alist '(ert--test . ert--find-test-regexp)) (add-to-list 'minor-mode-alist '(ert--current-run-stats (:eval (ert--tests-running-mode-line-indicator)))) diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 57bc6d9b591..0be6971992c 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el @@ -17,7 +17,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. +;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. ;;; Commentary: diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index d1d7c0a8042..73ddadfb805 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -193,10 +193,10 @@ Populated by `tabulated-list-init-header'.") ;; is displayed. (if (not display-line-numbers) 0 - (let ((cbuf-window (get-buffer-window (current-buffer)))) + (let ((cbuf-window (get-buffer-window (current-buffer) t))) (if (window-live-p cbuf-window) (with-selected-window cbuf-window - (+ (line-number-display-width) 2)) + (line-number-display-width 'columns)) 4)))) (defun tabulated-list-init-header () @@ -329,8 +329,6 @@ Check the current row, the previous one and the next row." (string-width (if (stringp nt) nt (car nt))))) tabulated-list--near-rows))) -(defvar tabulated-list-entry-lnum-width nil) - (defun tabulated-list-print (&optional remember-pos update) "Populate the current Tabulated List mode buffer. This sorts the `tabulated-list-entries' list if sorting is @@ -373,7 +371,6 @@ changing `tabulated-list-sort-key'." (unless tabulated-list-use-header-line (tabulated-list-print-fake-header))) ;; Finally, print the resulting list. - (setq tabulated-list-entry-lnum-width (tabulated-list-line-number-width)) (while entries (let* ((elt (car entries)) (tabulated-list--near-rows @@ -428,9 +425,8 @@ of column descriptors." (x (max tabulated-list-padding 0)) (ncols (length tabulated-list-format)) (inhibit-read-only t)) - (setq x (+ x tabulated-list-entry-lnum-width)) (if (> tabulated-list-padding 0) - (insert (make-string (- x tabulated-list-entry-lnum-width) ?\s))) + (insert (make-string x ?\s))) (let ((tabulated-list--near-rows ; Bind it if not bound yet (Bug#25506). (or (bound-and-true-p tabulated-list--near-rows) (list (or (tabulated-list-get-entry (point-at-bol 0)) @@ -601,6 +597,14 @@ With a numeric prefix argument N, sort the Nth column." (tabulated-list-init-header) (tabulated-list-print t))) +(defvar tabulated-list--current-lnum-width nil) +(defun tabulated-list-watch-line-number-width (_window) + (if display-line-numbers + (let ((lnum-width (tabulated-list-line-number-width))) + (when (not (= tabulated-list--current-lnum-width lnum-width)) + (setq-local tabulated-list--current-lnum-width lnum-width) + (tabulated-list-revert))))) + ;;; The mode definition: (define-derived-mode tabulated-list-mode special-mode "Tabulated" @@ -645,7 +649,12 @@ as the ewoc pretty-printer." ;; column of the first entry happens to begin with a R2L letter. (setq bidi-paragraph-direction 'left-to-right) ;; This is for if/when they turn on display-line-numbers - (add-hook 'display-line-numbers-mode-hook #'tabulated-list-revert nil t)) + (add-hook 'display-line-numbers-mode-hook #'tabulated-list-revert nil t) + ;; This is for if/when they customize the line-number face or when + ;; the line-number width needs to change due to scrolling. + (setq-local tabulated-list--current-lnum-width 0) + (add-hook 'pre-redisplay-functions + #'tabulated-list-watch-line-number-width nil t)) (put 'tabulated-list-mode 'mode-class 'special) |