aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2016-07-07 18:51:00 +0200
committerMichael Albinus2016-07-07 18:51:00 +0200
commit0e8d3445a73bc190b0203b2571999ea5f5116ef2 (patch)
tree30b90eb0a835380576516d726021a00b76d88051
parent7f8e742833e058fa41c273ff35351b02b6e8d42b (diff)
parent44517b21abc4c243cdc7df264c629d592d9fb4cf (diff)
downloademacs-0e8d3445a73bc190b0203b2571999ea5f5116ef2.tar.gz
emacs-0e8d3445a73bc190b0203b2571999ea5f5116ef2.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
-rw-r--r--etc/NEWS9
-rw-r--r--lisp/ibuf-ext.el18
-rw-r--r--lisp/ibuffer.el33
3 files changed, 58 insertions, 2 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 87ffb437d91..deb18895555 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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
203all locked buffers; bound to '% L'.
204
205---
206*** A new option 'ibuffer-locked-char' to indicate
207locked 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
203all buffers without asking confirmation; bound to 212all 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.
1489When 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 ae22bd76f2b..d67f95f8454 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -71,7 +71,8 @@ and filter displayed buffers by various criteria."
71 :version "22.1" 71 :version "22.1"
72 :group 'convenience) 72 :group 'convenience)
73 73
74(defcustom ibuffer-formats '((mark modified read-only " " (name 18 18 :left :elide) 74(defcustom ibuffer-formats '((mark modified read-only locked
75 " " (name 18 18 :left :elide)
75 " " (size 9 -1 :right) 76 " " (size 9 -1 :right)
76 " " (mode 16 16 :left :elide) " " filename-and-process) 77 " " (mode 16 16 :left :elide) " " filename-and-process)
77 (mark " " (name 16 -1) " " filename)) 78 (mark " " (name 16 -1) " " filename))
@@ -137,6 +138,7 @@ value for this variable would be
137 138
138Using \\[ibuffer-switch-format], you can rotate the display between 139Using \\[ibuffer-switch-format], you can rotate the display between
139the specified formats in the list." 140the specified formats in the list."
141 :version "25.2"
140 :type '(repeat sexp) 142 :type '(repeat sexp)
141 :group 'ibuffer) 143 :group 'ibuffer)
142 144
@@ -158,7 +160,8 @@ elisp byte-compiler."
158 (null buffer-file-name)) 160 (null buffer-file-name))
159 italic) 161 italic)
160 (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face) 162 (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face)
161 (35 (derived-mode-p 'dired-mode) font-lock-function-name-face)) 163 (35 (derived-mode-p 'dired-mode) font-lock-function-name-face)
164 (40 (and (boundp 'emacs-lock-mode) emacs-lock-mode) ibuffer-locked-buffer))
162 "An alist describing how to fontify buffers. 165 "An alist describing how to fontify buffers.
163Each element should be of the form (PRIORITY FORM FACE), where 166Each element should be of the form (PRIORITY FORM FACE), where
164PRIORITY is an integer, FORM is an arbitrary form to evaluate in the 167PRIORITY is an integer, FORM is an arbitrary form to evaluate in the
@@ -280,6 +283,12 @@ Note that this specialized filtering occurs before real filtering."
280 :type 'character 283 :type 'character
281 :group 'ibuffer) 284 :group 'ibuffer)
282 285
286(defcustom ibuffer-locked-char ?L
287 "The character to display for locked buffers."
288 :version "25.2"
289 :type 'character
290 :group 'ibuffer)
291
283(defcustom ibuffer-deletion-char ?D 292(defcustom ibuffer-deletion-char ?D
284 "The character to display for buffers marked for deletion." 293 "The character to display for buffers marked for deletion."
285 :type 'character 294 :type 'character
@@ -547,6 +556,7 @@ directory, like `default-directory'."
547 (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp) 556 (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp)
548 (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp) 557 (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp)
549 (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)
550 560
551 (define-key map (kbd "C-t") 'ibuffer-visit-tags-table) 561 (define-key map (kbd "C-t") 'ibuffer-visit-tags-table)
552 562
@@ -773,6 +783,9 @@ directory, like `default-directory'."
773 '(menu-item "Mark by content (regexp)..." 783 '(menu-item "Mark by content (regexp)..."
774 ibuffer-mark-by-content-regexp 784 ibuffer-mark-by-content-regexp
775 :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"))
776 789
777 map)) 790 map))
778 791
@@ -1725,6 +1738,15 @@ If point is on a group name, this function operates on that group."
1725 1738
1726(defvar ibuffer-inline-columns nil) 1739(defvar ibuffer-inline-columns nil)
1727 1740
1741(defface ibuffer-locked-buffer
1742 '((((background dark)) (:foreground "RosyBrown"))
1743 (t (:foreground "brown4")))
1744 "*Face used for locked buffers in Ibuffer."
1745 :version "25.2"
1746 :group 'ibuffer
1747 :group 'font-lock-highlighting-faces)
1748(defvar ibuffer-locked-buffer 'ibuffer-locked-buffer)
1749
1728(define-ibuffer-column mark (:name " " :inline t) 1750(define-ibuffer-column mark (:name " " :inline t)
1729 (string mark)) 1751 (string mark))
1730 1752
@@ -1733,6 +1755,12 @@ If point is on a group name, this function operates on that group."
1733 (string ibuffer-read-only-char) 1755 (string ibuffer-read-only-char)
1734 " ")) 1756 " "))
1735 1757
1758(define-ibuffer-column locked
1759 (:name "L" :inline t :props ('font-lock-face 'ibuffer-locked-buffer))
1760 (if (and (boundp 'emacs-lock-mode) emacs-lock-mode)
1761 (string ibuffer-locked-char)
1762 " "))
1763
1736(define-ibuffer-column modified (:name "M" :inline t) 1764(define-ibuffer-column modified (:name "M" :inline t)
1737 (if (buffer-modified-p) 1765 (if (buffer-modified-p)
1738 (string ibuffer-modified-char) 1766 (string ibuffer-modified-char)
@@ -2452,6 +2480,7 @@ Marking commands:
2452 `\\[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.
2453 `\\[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.
2454 `\\[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.
2455 2484
2456Filtering commands: 2485Filtering commands:
2457 2486