mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-04 03:13:24 +00:00
Improve 'define-ibuffer-op' macro (bug#76222)
* lisp/ibuf-macs.el (define-ibuffer-op): Change defun to defalias and place it before the macro-local lets. * lisp/ibuffer.el: (ibuffer-do-toggle-lock): Remove declare-function. (ibuffer-do-toggle-read-only): Remove declare-function. (ibuffer-do-save): Remove declare-function. (ibuffer-do-delete): Remove declare-function. (ibuffer-do-toggle-modified): Remove declare-function. (ibuffer-do-kill-on-deletion-marks): Remove declare-function.
This commit is contained in:
parent
7ae069b676
commit
5d75c6e44d
2 changed files with 51 additions and 60 deletions
|
@ -218,12 +218,10 @@ buffer object.
|
|||
(let ((opstring-sym (make-symbol "opstring"))
|
||||
(active-opstring-sym (make-symbol "active-opstring")))
|
||||
`(progn
|
||||
(let ((,opstring-sym ,opstring)
|
||||
(,active-opstring-sym ,active-opstring))
|
||||
(defun ,(intern (concat (if (string-match "^ibuffer-do" (symbol-name op))
|
||||
(defalias ',(intern (concat (if (string-match "^ibuffer-do" (symbol-name op))
|
||||
"" "ibuffer-do-")
|
||||
(symbol-name op)))
|
||||
,args
|
||||
(lambda ,args
|
||||
,(if (stringp documentation)
|
||||
documentation
|
||||
(format "%s marked buffers." (if (functionp active-opstring)
|
||||
|
@ -234,6 +232,8 @@ buffer object.
|
|||
'(interactive))
|
||||
(cl-assert (derived-mode-p 'ibuffer-mode))
|
||||
(setq ibuffer-did-modification nil)
|
||||
(let ((,opstring-sym ,opstring)
|
||||
(,active-opstring-sym ,active-opstring))
|
||||
(let ((marked-names (,(pcase mark
|
||||
(:deletion
|
||||
'ibuffer-deletion-marked-buffer-names)
|
||||
|
@ -299,7 +299,7 @@ buffer object.
|
|||
marked-names)
|
||||
,body)
|
||||
body))))
|
||||
:autoload-end))))
|
||||
:autoload-end)))))
|
||||
|
||||
;;;###autoload
|
||||
(cl-defmacro define-ibuffer-filter (name documentation
|
||||
|
|
|
@ -372,15 +372,6 @@ directory, like `default-directory'."
|
|||
(regexp :tag "From")
|
||||
(regexp :tag "To"))))
|
||||
|
||||
;; These declarations are here to avoid byte-compiler warnings about
|
||||
;; functions defined later via 'define-ibuffer-op'.
|
||||
(declare-function ibuffer-do-toggle-lock "ibuffer.el")
|
||||
(declare-function ibuffer-do-toggle-read-only "ibuffer.el")
|
||||
(declare-function ibuffer-do-save "ibuffer.el")
|
||||
(declare-function ibuffer-do-delete "ibuffer.el")
|
||||
(declare-function ibuffer-do-toggle-modified "ibuffer.el")
|
||||
(declare-function ibuffer-do-kill-on-deletion-marks "ibuffer.el")
|
||||
|
||||
(defvar-keymap ibuffer--filter-map
|
||||
"RET" #'ibuffer-filter-by-mode
|
||||
"SPC" #'ibuffer-filter-chosen-by-completion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue