diff options
| author | Tino Calancha | 2016-12-07 22:25:11 +0900 |
|---|---|---|
| committer | Tino Calancha | 2016-12-07 22:25:11 +0900 |
| commit | bb90c250ad9b62befb0bbdff88ba65f6f580c334 (patch) | |
| tree | bf4994cc7db620617230fe3988b7abe2d2858768 | |
| parent | e41e89d128764c5a2205665ab70b3449c3014abf (diff) | |
| download | emacs-bb90c250ad9b62befb0bbdff88ba65f6f580c334.tar.gz emacs-bb90c250ad9b62befb0bbdff88ba65f6f580c334.zip | |
ibuffer-unmark-all: simplify code
* lisp/ibuffer.el (ibuffer-map-deletion-lines): Delete it.
(ibuffer-unmark-all): Simplify code.
| -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." | |||
| 1265 | (lambda (_buf mark) | 1265 | (lambda (_buf mark) |
| 1266 | (eq mark ibuffer-deletion-char)))) | 1266 | (eq mark ibuffer-deletion-char)))) |
| 1267 | 1267 | ||
| 1268 | (defsubst ibuffer-map-deletion-lines (func) | ||
| 1269 | (ibuffer-map-on-mark ibuffer-deletion-char func)) | ||
| 1270 | |||
| 1271 | (defsubst ibuffer-assert-ibuffer-mode () | 1268 | (defsubst ibuffer-assert-ibuffer-mode () |
| 1272 | (cl-assert (derived-mode-p 'ibuffer-mode))) | 1269 | (cl-assert (derived-mode-p 'ibuffer-mode))) |
| 1273 | 1270 | ||
| @@ -1341,29 +1338,12 @@ Otherwise, toggle read only status." | |||
| 1341 | (interactive "cRemove marks (RET means all):") | 1338 | (interactive "cRemove marks (RET means all):") |
| 1342 | (if (= (ibuffer-count-marked-lines t) 0) | 1339 | (if (= (ibuffer-count-marked-lines t) 0) |
| 1343 | (message "No buffers marked; use 'm' to mark a buffer") | 1340 | (message "No buffers marked; use 'm' to mark a buffer") |
| 1344 | (cond | 1341 | (let ((fn (lambda (_buf mk) |
| 1345 | ((eq mark ibuffer-marked-char) | 1342 | (unless (eq mk ?\s) |
| 1346 | (ibuffer-map-marked-lines | 1343 | (ibuffer-set-mark-1 ?\s)) t))) |
| 1347 | (lambda (_buf _mark) | 1344 | (if (eq mark ?\r) |
| 1348 | (ibuffer-set-mark-1 ?\s) | 1345 | (ibuffer-map-lines fn) |
| 1349 | t))) | 1346 | (ibuffer-map-on-mark mark fn)))) |
| 1350 | ((eq mark ibuffer-deletion-char) | ||
| 1351 | (ibuffer-map-deletion-lines | ||
| 1352 | (lambda (_buf _mark) | ||
| 1353 | (ibuffer-set-mark-1 ?\s) | ||
| 1354 | t))) | ||
| 1355 | ((not (eq mark ?\r)) | ||
| 1356 | (ibuffer-map-lines | ||
| 1357 | (lambda (_buf cmark) | ||
| 1358 | (when (eq cmark mark) | ||
| 1359 | (ibuffer-set-mark-1 ?\s)) | ||
| 1360 | t))) | ||
| 1361 | (t | ||
| 1362 | (ibuffer-map-lines | ||
| 1363 | (lambda (_buf mark) | ||
| 1364 | (when (not (eq mark ?\s)) | ||
| 1365 | (ibuffer-set-mark-1 ?\s)) | ||
| 1366 | t))))) | ||
| 1367 | (ibuffer-redisplay t)) | 1347 | (ibuffer-redisplay t)) |
| 1368 | 1348 | ||
| 1369 | (defun ibuffer-unmark-all-marks () | 1349 | (defun ibuffer-unmark-all-marks () |