diff options
author | Tino Calancha <tino.calancha@gmail.com> | 2016-12-07 22:25:11 +0900 |
---|---|---|
committer | Tino Calancha <tino.calancha@gmail.com> | 2016-12-07 22:25:11 +0900 |
commit | bb90c250ad9b62befb0bbdff88ba65f6f580c334 (patch) | |
tree | bf4994cc7db620617230fe3988b7abe2d2858768 /lisp/ibuffer.el | |
parent | e41e89d128764c5a2205665ab70b3449c3014abf (diff) | |
download | emacs-bb90c250ad9b62befb0bbdff88ba65f6f580c334.tar.gz |
ibuffer-unmark-all: simplify code
* lisp/ibuffer.el (ibuffer-map-deletion-lines): Delete it.
(ibuffer-unmark-all): Simplify code.
Diffstat (limited to 'lisp/ibuffer.el')
-rw-r--r-- | lisp/ibuffer.el | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index ef1ef4b8aeb..c7cc9dcc4ea 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1265,9 +1265,6 @@ a new window in the current frame, splitting vertically." (lambda (_buf mark) (eq mark ibuffer-deletion-char)))) -(defsubst ibuffer-map-deletion-lines (func) - (ibuffer-map-on-mark ibuffer-deletion-char func)) - (defsubst ibuffer-assert-ibuffer-mode () (cl-assert (derived-mode-p 'ibuffer-mode))) @@ -1341,29 +1338,12 @@ Otherwise, toggle read only status." (interactive "cRemove marks (RET means all):") (if (= (ibuffer-count-marked-lines t) 0) (message "No buffers marked; use 'm' to mark a buffer") - (cond - ((eq mark ibuffer-marked-char) - (ibuffer-map-marked-lines - (lambda (_buf _mark) - (ibuffer-set-mark-1 ?\s) - t))) - ((eq mark ibuffer-deletion-char) - (ibuffer-map-deletion-lines - (lambda (_buf _mark) - (ibuffer-set-mark-1 ?\s) - t))) - ((not (eq mark ?\r)) - (ibuffer-map-lines - (lambda (_buf cmark) - (when (eq cmark mark) - (ibuffer-set-mark-1 ?\s)) - t))) - (t - (ibuffer-map-lines - (lambda (_buf mark) - (when (not (eq mark ?\s)) - (ibuffer-set-mark-1 ?\s)) - t))))) + (let ((fn (lambda (_buf mk) + (unless (eq mk ?\s) + (ibuffer-set-mark-1 ?\s)) t))) + (if (eq mark ?\r) + (ibuffer-map-lines fn) + (ibuffer-map-on-mark mark fn)))) (ibuffer-redisplay t)) (defun ibuffer-unmark-all-marks () |