diff options
| author | Tino Calancha | 2016-07-08 01:34:35 +0900 |
|---|---|---|
| committer | Tino Calancha | 2016-07-08 01:34:35 +0900 |
| commit | 44517b21abc4c243cdc7df264c629d592d9fb4cf (patch) | |
| tree | 85212e1836c7cd715b639db2ae6c4963f8fb8e1f | |
| parent | 9d70e4da7402e5a89db6a1b175b917cd3fb37e36 (diff) | |
| download | emacs-44517b21abc4c243cdc7df264c629d592d9fb4cf.tar.gz emacs-44517b21abc4c243cdc7df264c629d592d9fb4cf.zip | |
Ibuffer: Mark locked buffers
* lisp/ibuf-ext.el (ibuffer-locked-buffer-p): New defun.
(ibuffer-mark-by-locked): New command.
(ibuffer-mode-map): Bind it to '% L'; update menus.
(ibuffer-mode): Update mode doc.
;* etc/NEWS: Add NEWS entry for these changes and previous two commits.
| -rw-r--r-- | etc/NEWS | 9 | ||||
| -rw-r--r-- | lisp/ibuf-ext.el | 18 | ||||
| -rw-r--r-- | lisp/ibuffer.el | 5 |
3 files changed, 32 insertions, 0 deletions
| @@ -199,6 +199,15 @@ same as in modes where the character is not whitespace. | |||
| 199 | ** Ibuffer | 199 | ** Ibuffer |
| 200 | 200 | ||
| 201 | --- | 201 | --- |
| 202 | *** A new command 'ibuffer-mark-by-locked' to mark | ||
| 203 | all locked buffers; bound to '% L'. | ||
| 204 | |||
| 205 | --- | ||
| 206 | *** A new option 'ibuffer-locked-char' to indicate | ||
| 207 | locked buffers; Ibuffer shows a new column displaying | ||
| 208 | 'ibuffer-locked-char' for locked buffers. | ||
| 209 | |||
| 210 | --- | ||
| 202 | *** A new command 'ibuffer-unmark-all-marks' to unmark | 211 | *** A new command 'ibuffer-unmark-all-marks' to unmark |
| 203 | all buffers without asking confirmation; bound to | 212 | all buffers without asking confirmation; bound to |
| 204 | 'U'; 'ibuffer-do-replace-regexp' bound to 'r'. | 213 | 'U'; 'ibuffer-do-replace-regexp' bound to 'r'. |
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 72fa8628a1f..2444dac5805 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el | |||
| @@ -1484,6 +1484,24 @@ You can then feed the file name(s) to other commands with \\[yank]." | |||
| 1484 | #'(lambda (buf) | 1484 | #'(lambda (buf) |
| 1485 | (string-match regexp (buffer-name buf))))) | 1485 | (string-match regexp (buffer-name buf))))) |
| 1486 | 1486 | ||
| 1487 | (defun ibuffer-locked-buffer-p (&optional buf) | ||
| 1488 | "Return non-nil if BUF is locked. | ||
| 1489 | When BUF nil, default to the buffer at current line." | ||
| 1490 | (let ((_buffer (or buf (ibuffer-current-buffer))) | ||
| 1491 | char) | ||
| 1492 | (when _buffer | ||
| 1493 | (with-current-buffer _buffer | ||
| 1494 | (and (boundp 'emacs-lock-mode) emacs-lock-mode))))) | ||
| 1495 | |||
| 1496 | ;;;###autoload | ||
| 1497 | (defun ibuffer-mark-by-locked () | ||
| 1498 | "Mark all locked buffers." | ||
| 1499 | (interactive) | ||
| 1500 | (when (featurep 'emacs-lock) | ||
| 1501 | (ibuffer-mark-on-buffer | ||
| 1502 | (lambda (buf) | ||
| 1503 | (ibuffer-locked-buffer-p buf))))) | ||
| 1504 | |||
| 1487 | ;;;###autoload | 1505 | ;;;###autoload |
| 1488 | (defun ibuffer-mark-by-mode-regexp (regexp) | 1506 | (defun ibuffer-mark-by-mode-regexp (regexp) |
| 1489 | "Mark all buffers whose major mode matches REGEXP." | 1507 | "Mark all buffers whose major mode matches REGEXP." |
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index ff1eb8b2dda..d67f95f8454 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -556,6 +556,7 @@ directory, like `default-directory'." | |||
| 556 | (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp) | 556 | (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp) |
| 557 | (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp) | 557 | (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp) |
| 558 | (define-key map (kbd "% g") 'ibuffer-mark-by-content-regexp) | 558 | (define-key map (kbd "% g") 'ibuffer-mark-by-content-regexp) |
| 559 | (define-key map (kbd "% L") 'ibuffer-mark-by-locked) | ||
| 559 | 560 | ||
| 560 | (define-key map (kbd "C-t") 'ibuffer-visit-tags-table) | 561 | (define-key map (kbd "C-t") 'ibuffer-visit-tags-table) |
| 561 | 562 | ||
| @@ -782,6 +783,9 @@ directory, like `default-directory'." | |||
| 782 | '(menu-item "Mark by content (regexp)..." | 783 | '(menu-item "Mark by content (regexp)..." |
| 783 | ibuffer-mark-by-content-regexp | 784 | ibuffer-mark-by-content-regexp |
| 784 | :help "Mark buffers whose content matches a regexp")) | 785 | :help "Mark buffers whose content matches a regexp")) |
| 786 | (define-key-after map [menu-bar mark mark-by-locked] | ||
| 787 | '(menu-item "Mark by locked buffers..." ibuffer-mark-by-locked | ||
| 788 | :help "Mark all locked buffers")) | ||
| 785 | 789 | ||
| 786 | map)) | 790 | map)) |
| 787 | 791 | ||
| @@ -2476,6 +2480,7 @@ Marking commands: | |||
| 2476 | `\\[ibuffer-mark-by-mode-regexp]' - Mark buffers by their major mode, using a regexp. | 2480 | `\\[ibuffer-mark-by-mode-regexp]' - Mark buffers by their major mode, using a regexp. |
| 2477 | `\\[ibuffer-mark-by-file-name-regexp]' - Mark buffers by their filename, using a regexp. | 2481 | `\\[ibuffer-mark-by-file-name-regexp]' - Mark buffers by their filename, using a regexp. |
| 2478 | `\\[ibuffer-mark-by-content-regexp]' - Mark buffers by their content, using a regexp. | 2482 | `\\[ibuffer-mark-by-content-regexp]' - Mark buffers by their content, using a regexp. |
| 2483 | `\\[ibuffer-mark-by-locked]' - Mark all locked buffers. | ||
| 2479 | 2484 | ||
| 2480 | Filtering commands: | 2485 | Filtering commands: |
| 2481 | 2486 | ||