diff options
| author | John Paul Wallington | 2003-01-24 04:54:17 +0000 |
|---|---|---|
| committer | John Paul Wallington | 2003-01-24 04:54:17 +0000 |
| commit | 4e4a724c11389875ad6842f3a37febd0081f7307 (patch) | |
| tree | 4bcf3a7e7b65984cd8b46adcddcc41931f03417c /lisp | |
| parent | 2a026b0452500dff9772640365ff9a91510939ba (diff) | |
| download | emacs-4e4a724c11389875ad6842f3a37febd0081f7307.tar.gz emacs-4e4a724c11389875ad6842f3a37febd0081f7307.zip | |
* ibuffer.el (ibuffer-window-list): Remove.
(ibuffer-confirm-operation-on): Use `window-list' instead.
(ibuffer-load-hook): New customizable variable.
(toplevel): Run it.
(ibuffer-customize): New command.
(ibuffer-mode-map): Bind it.
(ibuffer-mode-map): Add menu seperator in View>Sort menu.
(ibuffer-mode): Tidy.
(ibuffer-fontification-alist, ibuffer-always-show-last-buffer)
(ibuffer-default-directory, ibuffer-default-sorting-mode)
(ibuffer-maybe-show-predicates, ibuffer-hook, ibuffer-mode-hook)
(ibuffer-map-lines): Doc fixes.
Update mail address.
* ibuf-ext.el (ibuffer-copy-filename-as-kill): C-u means relative
filenames. Use `kill-new'.
Update mail address.
* ibuf-macs.el
Update mail address.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 18 | ||||
| -rw-r--r-- | lisp/ibuf-ext.el | 76 | ||||
| -rw-r--r-- | lisp/ibuf-macs.el | 2 | ||||
| -rw-r--r-- | lisp/ibuffer.el | 259 |
4 files changed, 191 insertions, 164 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6dd1382975c..b52548f4c92 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2003-01-24 John Paul Wallington <jpw@gnu.org> | ||
| 2 | |||
| 3 | * ibuffer.el (ibuffer-window-list): Remove. | ||
| 4 | (ibuffer-confirm-operation-on): Use `window-list' instead. | ||
| 5 | (ibuffer-load-hook): New customizable variable. | ||
| 6 | (toplevel): Run it. | ||
| 7 | (ibuffer-customize): New command. | ||
| 8 | (ibuffer-mode-map): Bind it. | ||
| 9 | (ibuffer-mode-map): Add menu seperator in View>Sort menu. | ||
| 10 | (ibuffer-mode): Tidy. | ||
| 11 | (ibuffer-fontification-alist, ibuffer-always-show-last-buffer) | ||
| 12 | (ibuffer-default-directory, ibuffer-default-sorting-mode) | ||
| 13 | (ibuffer-maybe-show-predicates, ibuffer-hook, ibuffer-mode-hook) | ||
| 14 | (ibuffer-map-lines): Doc fixes. | ||
| 15 | |||
| 16 | * ibuf-ext.el (ibuffer-copy-filename-as-kill): C-u means relative | ||
| 17 | filenames. Use `kill-new'. | ||
| 18 | |||
| 1 | 2003-01-23 Dave Love <fx@gnu.org> | 19 | 2003-01-23 Dave Love <fx@gnu.org> |
| 2 | 20 | ||
| 3 | * abbrev.el (write-abbrev-file): Simplify, and put a coding cookie | 21 | * abbrev.el (write-abbrev-file): Simplify, and put a coding cookie |
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index c568f2c3fe7..b1f312d376c 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | ;;; ibuf-ext.el --- extensions for ibuffer | 1 | ;;; ibuf-ext.el --- extensions for ibuffer |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Colin Walters <walters@verbum.org> | 5 | ;; Author: Colin Walters <walters@verbum.org> |
| 6 | ;; Maintainer: John Paul Wallington <jpw@shootybangbang.com> | 6 | ;; Maintainer: John Paul Wallington <jpw@gnu.org> |
| 7 | ;; Created: 2 Dec 2001 | 7 | ;; Created: 2 Dec 2001 |
| 8 | ;; Keywords: buffer, convenience | 8 | ;; Keywords: buffer, convenience |
| 9 | 9 | ||
| @@ -62,7 +62,7 @@ | |||
| 62 | (let ((hip-crowd nil) | 62 | (let ((hip-crowd nil) |
| 63 | (lamers nil)) | 63 | (lamers nil)) |
| 64 | (dolist (ibuffer-split-list-elt ibuffer-split-list-elts) | 64 | (dolist (ibuffer-split-list-elt ibuffer-split-list-elts) |
| 65 | (if (funcall ibuffer-split-list-fn ibuffer-split-list-elt) | 65 | (if (funcall ibuffer-split-list-fn ibuffer-split-list-elt) |
| 66 | (push ibuffer-split-list-elt hip-crowd) | 66 | (push ibuffer-split-list-elt hip-crowd) |
| 67 | (push ibuffer-split-list-elt lamers))) | 67 | (push ibuffer-split-list-elt lamers))) |
| 68 | ;; Too bad Emacs Lisp doesn't have multiple values. | 68 | ;; Too bad Emacs Lisp doesn't have multiple values. |
| @@ -103,13 +103,13 @@ Do not set this variable directly! Use the function | |||
| 103 | ((or (mode . message-mode) | 103 | ((or (mode . message-mode) |
| 104 | (mode . mail-mode) | 104 | (mode . mail-mode) |
| 105 | (mode . gnus-group-mode) | 105 | (mode . gnus-group-mode) |
| 106 | (mode . gnus-summary-mode) | 106 | (mode . gnus-summary-mode) |
| 107 | (mode . gnus-article-mode)))) | 107 | (mode . gnus-article-mode)))) |
| 108 | ("programming" | 108 | ("programming" |
| 109 | ((or (mode . emacs-lisp-mode) | 109 | ((or (mode . emacs-lisp-mode) |
| 110 | (mode . cperl-mode) | 110 | (mode . cperl-mode) |
| 111 | (mode . c-mode) | 111 | (mode . c-mode) |
| 112 | (mode . java-mode) | 112 | (mode . java-mode) |
| 113 | (mode . idl-mode) | 113 | (mode . idl-mode) |
| 114 | (mode . lisp-mode))))) | 114 | (mode . lisp-mode))))) |
| 115 | 115 | ||
| @@ -156,7 +156,7 @@ to this variable." | |||
| 156 | :group 'ibuffer) | 156 | :group 'ibuffer) |
| 157 | 157 | ||
| 158 | (defvar ibuffer-cached-filter-formats nil) | 158 | (defvar ibuffer-cached-filter-formats nil) |
| 159 | (defvar ibuffer-compiled-filter-formats nil) | 159 | (defvar ibuffer-compiled-filter-formats nil) |
| 160 | 160 | ||
| 161 | (defvar ibuffer-filter-groups nil | 161 | (defvar ibuffer-filter-groups nil |
| 162 | "A list like ((\"NAME\" ((SYMBOL . QUALIFIER) ...) ...) which groups buffers. | 162 | "A list like ((\"NAME\" ((SYMBOL . QUALIFIER) ...) ...) which groups buffers. |
| @@ -216,7 +216,7 @@ Currently, this only applies to `ibuffer-saved-filters' and | |||
| 216 | (not | 216 | (not |
| 217 | (ibuffer-buf-matches-predicates buf ibuffer-maybe-show-predicates))) | 217 | (ibuffer-buf-matches-predicates buf ibuffer-maybe-show-predicates))) |
| 218 | (or ibuffer-view-ibuffer | 218 | (or ibuffer-view-ibuffer |
| 219 | (and ibuffer-buf | 219 | (and ibuffer-buf |
| 220 | (not (eq ibuffer-buf buf)))) | 220 | (not (eq ibuffer-buf buf)))) |
| 221 | (or | 221 | (or |
| 222 | (ibuffer-included-in-filters-p buf ibuffer-filtering-qualifiers) | 222 | (ibuffer-included-in-filters-p buf ibuffer-filtering-qualifiers) |
| @@ -268,7 +268,7 @@ With numeric ARG, enable auto-update if and only if ARG is positive." | |||
| 268 | (if (assq 'mode ibuffer-filtering-qualifiers) | 268 | (if (assq 'mode ibuffer-filtering-qualifiers) |
| 269 | (setq ibuffer-filtering-qualifiers | 269 | (setq ibuffer-filtering-qualifiers |
| 270 | (ibuffer-delete-alist 'mode ibuffer-filtering-qualifiers)) | 270 | (ibuffer-delete-alist 'mode ibuffer-filtering-qualifiers)) |
| 271 | (ibuffer-push-filter (cons 'mode | 271 | (ibuffer-push-filter (cons 'mode |
| 272 | (with-current-buffer buf | 272 | (with-current-buffer buf |
| 273 | major-mode))))) | 273 | major-mode))))) |
| 274 | (ibuffer-update nil t)) | 274 | (ibuffer-update nil t)) |
| @@ -284,10 +284,10 @@ With numeric ARG, enable auto-update if and only if ARG is positive." | |||
| 284 | ;;;###autoload | 284 | ;;;###autoload |
| 285 | (defun ibuffer-toggle-filter-group () | 285 | (defun ibuffer-toggle-filter-group () |
| 286 | "Toggle the display status of the filter group on this line." | 286 | "Toggle the display status of the filter group on this line." |
| 287 | (interactive) | 287 | (interactive) |
| 288 | (ibuffer-toggle-filter-group-1 (point))) | 288 | (ibuffer-toggle-filter-group-1 (point))) |
| 289 | 289 | ||
| 290 | (defun ibuffer-toggle-filter-group-1 (posn) | 290 | (defun ibuffer-toggle-filter-group-1 (posn) |
| 291 | (let ((name (get-text-property posn 'ibuffer-filter-group-name))) | 291 | (let ((name (get-text-property posn 'ibuffer-filter-group-name))) |
| 292 | (unless (stringp name) | 292 | (unless (stringp name) |
| 293 | (error "No filtering group name present")) | 293 | (error "No filtering group name present")) |
| @@ -700,7 +700,7 @@ See also `ibuffer-kill-filter-group'." | |||
| 700 | (ibuffer-update nil t)) | 700 | (ibuffer-update nil t)) |
| 701 | 701 | ||
| 702 | ;;;###autoload | 702 | ;;;###autoload |
| 703 | (defun ibuffer-save-filter-groups (name groups) | 703 | (defun ibuffer-save-filter-groups (name groups) |
| 704 | "Save all active filter groups GROUPS as NAME. | 704 | "Save all active filter groups GROUPS as NAME. |
| 705 | They are added to `ibuffer-saved-filter-groups'. Interactively, | 705 | They are added to `ibuffer-saved-filter-groups'. Interactively, |
| 706 | prompt for NAME, and use the current filters." | 706 | prompt for NAME, and use the current filters." |
| @@ -776,7 +776,7 @@ be a complex filter like (OR [name: foo] [mode: bar-mode]), will be | |||
| 776 | turned into two separate filters [name: foo] and [mode: bar-mode]." | 776 | turned into two separate filters [name: foo] and [mode: bar-mode]." |
| 777 | (interactive) | 777 | (interactive) |
| 778 | (when (null ibuffer-filtering-qualifiers) | 778 | (when (null ibuffer-filtering-qualifiers) |
| 779 | (error "No filters in effect")) | 779 | (error "No filters in effect")) |
| 780 | (let ((lim (pop ibuffer-filtering-qualifiers))) | 780 | (let ((lim (pop ibuffer-filtering-qualifiers))) |
| 781 | (case (car lim) | 781 | (case (car lim) |
| 782 | (or | 782 | (or |
| @@ -949,22 +949,22 @@ The list returned will be of the form (\"MODE-NAME\" . MODE-SYMBOL)." | |||
| 949 | (modes) | 949 | (modes) |
| 950 | (this-mode)) | 950 | (this-mode)) |
| 951 | (while bufs | 951 | (while bufs |
| 952 | (setq this-mode | 952 | (setq this-mode |
| 953 | (with-current-buffer | 953 | (with-current-buffer |
| 954 | (car bufs) | 954 | (car bufs) |
| 955 | major-mode) | 955 | major-mode) |
| 956 | bufs (cdr bufs)) | 956 | bufs (cdr bufs)) |
| 957 | (add-to-list | 957 | (add-to-list |
| 958 | 'modes | 958 | 'modes |
| 959 | `(,(symbol-name this-mode) . | 959 | `(,(symbol-name this-mode) . |
| 960 | ,this-mode))) | 960 | ,this-mode))) |
| 961 | modes)) | 961 | modes)) |
| 962 | 962 | ||
| 963 | 963 | ||
| 964 | ;;; Extra operation definitions | 964 | ;;; Extra operation definitions |
| 965 | 965 | ||
| 966 | ;;;###autoload (autoload 'ibuffer-filter-by-mode "ibuf-ext.el") | 966 | ;;;###autoload (autoload 'ibuffer-filter-by-mode "ibuf-ext.el") |
| 967 | (define-ibuffer-filter mode | 967 | (define-ibuffer-filter mode |
| 968 | "Toggle current view to buffers with major mode QUALIFIER." | 968 | "Toggle current view to buffers with major mode QUALIFIER." |
| 969 | (:description "major mode" | 969 | (:description "major mode" |
| 970 | :reader | 970 | :reader |
| @@ -982,14 +982,14 @@ The list returned will be of the form (\"MODE-NAME\" . MODE-SYMBOL)." | |||
| 982 | (eq qualifier (with-current-buffer buf major-mode))) | 982 | (eq qualifier (with-current-buffer buf major-mode))) |
| 983 | 983 | ||
| 984 | ;;;###autoload (autoload 'ibuffer-filter-by-used-mode "ibuf-ext.el") | 984 | ;;;###autoload (autoload 'ibuffer-filter-by-used-mode "ibuf-ext.el") |
| 985 | (define-ibuffer-filter used-mode | 985 | (define-ibuffer-filter used-mode |
| 986 | "Toggle current view to buffers with major mode QUALIFIER. | 986 | "Toggle current view to buffers with major mode QUALIFIER. |
| 987 | Called interactively, this function allows selection of modes | 987 | Called interactively, this function allows selection of modes |
| 988 | currently used by buffers." | 988 | currently used by buffers." |
| 989 | (:description "major mode in use" | 989 | (:description "major mode in use" |
| 990 | :reader | 990 | :reader |
| 991 | (intern | 991 | (intern |
| 992 | (completing-read "Filter by major mode: " | 992 | (completing-read "Filter by major mode: " |
| 993 | (ibuffer-list-buffer-modes) | 993 | (ibuffer-list-buffer-modes) |
| 994 | nil | 994 | nil |
| 995 | t | 995 | t |
| @@ -1001,7 +1001,7 @@ currently used by buffers." | |||
| 1001 | (eq qualifier (with-current-buffer buf major-mode))) | 1001 | (eq qualifier (with-current-buffer buf major-mode))) |
| 1002 | 1002 | ||
| 1003 | ;;;###autoload (autoload 'ibuffer-filter-by-name "ibuf-ext.el") | 1003 | ;;;###autoload (autoload 'ibuffer-filter-by-name "ibuf-ext.el") |
| 1004 | (define-ibuffer-filter name | 1004 | (define-ibuffer-filter name |
| 1005 | "Toggle current view to buffers with name matching QUALIFIER." | 1005 | "Toggle current view to buffers with name matching QUALIFIER." |
| 1006 | (:description "buffer name" | 1006 | (:description "buffer name" |
| 1007 | :reader (read-from-minibuffer "Filter by name (regexp): ")) | 1007 | :reader (read-from-minibuffer "Filter by name (regexp): ")) |
| @@ -1016,7 +1016,7 @@ currently used by buffers." | |||
| 1016 | (string-match qualifier it))) | 1016 | (string-match qualifier it))) |
| 1017 | 1017 | ||
| 1018 | ;;;###autoload (autoload 'ibuffer-filter-by-size-gt "ibuf-ext.el") | 1018 | ;;;###autoload (autoload 'ibuffer-filter-by-size-gt "ibuf-ext.el") |
| 1019 | (define-ibuffer-filter size-gt | 1019 | (define-ibuffer-filter size-gt |
| 1020 | "Toggle current view to buffers with size greater than QUALIFIER." | 1020 | "Toggle current view to buffers with size greater than QUALIFIER." |
| 1021 | (:description "size greater than" | 1021 | (:description "size greater than" |
| 1022 | :reader | 1022 | :reader |
| @@ -1025,7 +1025,7 @@ currently used by buffers." | |||
| 1025 | qualifier)) | 1025 | qualifier)) |
| 1026 | 1026 | ||
| 1027 | ;;;###autoload (autoload 'ibuffer-filter-by-size-lt "ibuf-ext.el") | 1027 | ;;;###autoload (autoload 'ibuffer-filter-by-size-lt "ibuf-ext.el") |
| 1028 | (define-ibuffer-filter size-lt | 1028 | (define-ibuffer-filter size-lt |
| 1029 | "Toggle current view to buffers with size less than QUALIFIER." | 1029 | "Toggle current view to buffers with size less than QUALIFIER." |
| 1030 | (:description "size less than" | 1030 | (:description "size less than" |
| 1031 | :reader | 1031 | :reader |
| @@ -1248,24 +1248,24 @@ This requires the external program \"diff\" to be in your `exec-path'." | |||
| 1248 | ;;;###autoload | 1248 | ;;;###autoload |
| 1249 | (defun ibuffer-copy-filename-as-kill (&optional arg) | 1249 | (defun ibuffer-copy-filename-as-kill (&optional arg) |
| 1250 | "Copy filenames of marked buffers into the kill ring. | 1250 | "Copy filenames of marked buffers into the kill ring. |
| 1251 | |||
| 1251 | The names are separated by a space. | 1252 | The names are separated by a space. |
| 1252 | If a buffer has no filename, it is ignored. | 1253 | If a buffer has no filename, it is ignored. |
| 1253 | With a zero prefix arg, use the complete pathname of each marked file. | ||
| 1254 | 1254 | ||
| 1255 | You can then feed the file name(s) to other commands with C-y. | 1255 | With no prefix arg, use the filename sans its directory of each marked file. |
| 1256 | With a zero prefix arg, use the complete filename of each marked file. | ||
| 1257 | With \\[universal-argument], use the filename of each marked file relative | ||
| 1258 | to `ibuffer-default-directory' iff non-nil, otherwise `default-directory'. | ||
| 1256 | 1259 | ||
| 1257 | [ This docstring shamelessly stolen from the | 1260 | You can then feed the file name(s) to other commands with \\[yank]." |
| 1258 | `dired-copy-filename-as-kill' in \"dired-x\". ]" | 1261 | (interactive "p") |
| 1259 | ;; Add to docstring later: | 1262 | (if (zerop (ibuffer-count-marked-lines)) |
| 1260 | ;; With C-u, use the relative pathname of each marked file. | ||
| 1261 | (interactive "P") | ||
| 1262 | (if (= (ibuffer-count-marked-lines) 0) | ||
| 1263 | (message "No buffers marked; use 'm' to mark a buffer") | 1263 | (message "No buffers marked; use 'm' to mark a buffer") |
| 1264 | (let ((ibuffer-copy-filename-as-kill-result "") | 1264 | (let ((ibuffer-copy-filename-as-kill-result "") |
| 1265 | (type (cond ((eql arg 0) | 1265 | (type (cond ((zerop arg) |
| 1266 | 'full) | 1266 | 'full) |
| 1267 | ;; ((eql arg 4) | 1267 | ((= arg 4) |
| 1268 | ;; 'relative) | 1268 | 'relative) |
| 1269 | (t | 1269 | (t |
| 1270 | 'name)))) | 1270 | 'name)))) |
| 1271 | (ibuffer-map-marked-lines | 1271 | (ibuffer-map-marked-lines |
| @@ -1277,11 +1277,15 @@ You can then feed the file name(s) to other commands with C-y. | |||
| 1277 | (case type | 1277 | (case type |
| 1278 | (full | 1278 | (full |
| 1279 | name) | 1279 | name) |
| 1280 | (relative | ||
| 1281 | (file-relative-name | ||
| 1282 | name (or ibuffer-default-directory | ||
| 1283 | default-directory))) | ||
| 1280 | (t | 1284 | (t |
| 1281 | (file-name-nondirectory name))) | 1285 | (file-name-nondirectory name))) |
| 1282 | "")) | 1286 | "")) |
| 1283 | " ")))) | 1287 | " ")))) |
| 1284 | (push ibuffer-copy-filename-as-kill-result kill-ring)))) | 1288 | (kill-new ibuffer-copy-filename-as-kill-result)))) |
| 1285 | 1289 | ||
| 1286 | (defun ibuffer-mark-on-buffer (func &optional ibuffer-mark-on-buffer-mark group) | 1290 | (defun ibuffer-mark-on-buffer (func &optional ibuffer-mark-on-buffer-mark group) |
| 1287 | (let ((count | 1291 | (let ((count |
diff --git a/lisp/ibuf-macs.el b/lisp/ibuf-macs.el index c5a510b0da3..03ef2404f4e 100644 --- a/lisp/ibuf-macs.el +++ b/lisp/ibuf-macs.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Colin Walters <walters@verbum.org> | 5 | ;; Author: Colin Walters <walters@verbum.org> |
| 6 | ;; Maintainer: John Paul Wallington <jpw@shootybangbang.com> | 6 | ;; Maintainer: John Paul Wallington <jpw@gnu.org> |
| 7 | ;; Created: 6 Dec 2001 | 7 | ;; Created: 6 Dec 2001 |
| 8 | ;; Keywords: buffer, convenience | 8 | ;; Keywords: buffer, convenience |
| 9 | 9 | ||
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 0fa9207bf54..9fa551e3718 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Colin Walters <walters@verbum.org> | 5 | ;; Author: Colin Walters <walters@verbum.org> |
| 6 | ;; Maintainer: John Paul Wallington <jpw@shootybangbang.com> | 6 | ;; Maintainer: John Paul Wallington <jpw@gnu.org> |
| 7 | ;; Created: 8 Sep 2000 | 7 | ;; Created: 8 Sep 2000 |
| 8 | ;; Keywords: buffer, convenience | 8 | ;; Keywords: buffer, convenience |
| 9 | 9 | ||
| @@ -39,16 +39,6 @@ | |||
| 39 | 39 | ||
| 40 | (require 'font-lock) | 40 | (require 'font-lock) |
| 41 | 41 | ||
| 42 | ;;; Compatibility | ||
| 43 | (eval-and-compile | ||
| 44 | (if (fboundp 'window-list) | ||
| 45 | (defun ibuffer-window-list () | ||
| 46 | (window-list nil 'nomini)) | ||
| 47 | (defun ibuffer-window-list () | ||
| 48 | (let ((ibuffer-window-list-result nil)) | ||
| 49 | (walk-windows #'(lambda (win) (push win ibuffer-window-list-result)) 'nomini) | ||
| 50 | (nreverse ibuffer-window-list-result))))) | ||
| 51 | |||
| 52 | (defgroup ibuffer nil | 42 | (defgroup ibuffer nil |
| 53 | "An advanced replacement for `buffer-menu'. | 43 | "An advanced replacement for `buffer-menu'. |
| 54 | 44 | ||
| @@ -148,7 +138,7 @@ buffer, and FACE is the face to use for fontification. If the FORM | |||
| 148 | evaluates to non-nil, then FACE will be put on the buffer name. The | 138 | evaluates to non-nil, then FACE will be put on the buffer name. The |
| 149 | element with the highest PRIORITY takes precedence. | 139 | element with the highest PRIORITY takes precedence. |
| 150 | 140 | ||
| 151 | If you change this variable, you must kill the ibuffer buffer and | 141 | If you change this variable, you must kill the Ibuffer buffer and |
| 152 | recreate it for the change to take effect." | 142 | recreate it for the change to take effect." |
| 153 | :type '(repeat | 143 | :type '(repeat |
| 154 | (list (integer :tag "Priority") | 144 | (list (integer :tag "Priority") |
| @@ -180,8 +170,8 @@ recreate it for the change to take effect." | |||
| 180 | (defcustom ibuffer-default-sorting-mode 'recency | 170 | (defcustom ibuffer-default-sorting-mode 'recency |
| 181 | "The criteria by which to sort the buffers. | 171 | "The criteria by which to sort the buffers. |
| 182 | 172 | ||
| 183 | Note that this variable is local to each ibuffer buffer. Thus, you | 173 | Note that this variable is local to each Ibuffer buffer. Thus, you |
| 184 | can have multiple ibuffer buffers open, each with a different sorted | 174 | can have multiple Ibuffer buffers open, each with a different sorted |
| 185 | view of the buffers." | 175 | view of the buffers." |
| 186 | :type '(choice (const :tag "Last view time" :value recency) | 176 | :type '(choice (const :tag "Last view time" :value recency) |
| 187 | (const :tag "Lexicographic" :value alphabetic) | 177 | (const :tag "Lexicographic" :value alphabetic) |
| @@ -211,7 +201,9 @@ This variable is deprecated; use the :elide argument of | |||
| 211 | (defcustom ibuffer-maybe-show-predicates `(,(lambda (buf) | 201 | (defcustom ibuffer-maybe-show-predicates `(,(lambda (buf) |
| 212 | (and (string-match "^ " (buffer-name buf)) | 202 | (and (string-match "^ " (buffer-name buf)) |
| 213 | (null buffer-file-name)))) | 203 | (null buffer-file-name)))) |
| 214 | "A list of predicates (a regexp or function) for buffers to display conditionally. | 204 | "A list of predicates for buffers to display conditionally. |
| 205 | |||
| 206 | A predicate can be a regexp or a function. | ||
| 215 | If a regexp, then it will be matched against the buffer's name. | 207 | If a regexp, then it will be matched against the buffer's name. |
| 216 | If a function, it will be called with the buffer as an argument, and | 208 | If a function, it will be called with the buffer as an argument, and |
| 217 | should return non-nil if this buffer should be shown. | 209 | should return non-nil if this buffer should be shown. |
| @@ -263,8 +255,8 @@ state, size, etc." | |||
| 263 | :group 'ibuffer) | 255 | :group 'ibuffer) |
| 264 | 256 | ||
| 265 | (defcustom ibuffer-always-show-last-buffer nil | 257 | (defcustom ibuffer-always-show-last-buffer nil |
| 266 | "If non-nil, always display the previous buffer. This variable | 258 | "If non-nil, always display the previous buffer. |
| 267 | takes precedence over filtering, and even | 259 | This variable takes precedence over filtering, and even |
| 268 | `ibuffer-never-show-predicates'." | 260 | `ibuffer-never-show-predicates'." |
| 269 | :type '(choice (const :tag "Always" :value t) | 261 | :type '(choice (const :tag "Always" :value t) |
| 270 | (const :tag "Never" :value nil) | 262 | (const :tag "Never" :value nil) |
| @@ -277,7 +269,7 @@ takes precedence over filtering, and even | |||
| 277 | :group 'ibuffer) | 269 | :group 'ibuffer) |
| 278 | 270 | ||
| 279 | (defcustom ibuffer-default-directory nil | 271 | (defcustom ibuffer-default-directory nil |
| 280 | "The default directory to use for a new ibuffer buffer. | 272 | "The default directory to use for a new Ibuffer buffer. |
| 281 | If nil, inherit the directory of the buffer in which `ibuffer' was | 273 | If nil, inherit the directory of the buffer in which `ibuffer' was |
| 282 | called. Otherwise, this variable should be a string naming a | 274 | called. Otherwise, this variable should be a string naming a |
| 283 | directory, like `default-directory'." | 275 | directory, like `default-directory'." |
| @@ -285,24 +277,29 @@ directory, like `default-directory'." | |||
| 285 | string) | 277 | string) |
| 286 | :group 'ibuffer) | 278 | :group 'ibuffer) |
| 287 | 279 | ||
| 288 | (defcustom ibuffer-help-buffer-modes '(help-mode apropos-mode | 280 | (defcustom ibuffer-help-buffer-modes |
| 289 | Info-mode Info-edit-mode) | 281 | '(help-mode apropos-mode Info-mode Info-edit-mode) |
| 290 | "List of \"Help\" major modes." | 282 | "List of \"Help\" major modes." |
| 291 | :type '(repeat function) | 283 | :type '(repeat function) |
| 292 | :group 'ibuffer) | 284 | :group 'ibuffer) |
| 293 | 285 | ||
| 294 | (defcustom ibuffer-hook nil | 286 | (defcustom ibuffer-hook nil |
| 295 | "Hooks run when `ibuffer' is called." | 287 | "Hook run when `ibuffer' is called." |
| 296 | :type 'hook | 288 | :type 'hook |
| 297 | :group 'ibuffer) | 289 | :group 'ibuffer) |
| 298 | (defvaralias 'ibuffer-hooks 'ibuffer-hook) | 290 | (defvaralias 'ibuffer-hooks 'ibuffer-hook) |
| 299 | 291 | ||
| 300 | (defcustom ibuffer-mode-hook nil | 292 | (defcustom ibuffer-mode-hook nil |
| 301 | "Hooks run upon entry into `ibuffer-mode'." | 293 | "Hook run upon entry into `ibuffer-mode'." |
| 302 | :type 'hook | 294 | :type 'hook |
| 303 | :group 'ibuffer) | 295 | :group 'ibuffer) |
| 304 | (defvaralias 'ibuffer-mode-hooks 'ibuffer-mode-hook) | 296 | (defvaralias 'ibuffer-mode-hooks 'ibuffer-mode-hook) |
| 305 | 297 | ||
| 298 | (defcustom ibuffer-load-hook nil | ||
| 299 | "Hook run when Ibuffer is loaded." | ||
| 300 | :type 'hook | ||
| 301 | :group 'ibuffer) | ||
| 302 | |||
| 306 | (defcustom ibuffer-marked-face 'font-lock-warning-face | 303 | (defcustom ibuffer-marked-face 'font-lock-warning-face |
| 307 | "Face used for displaying marked buffers." | 304 | "Face used for displaying marked buffers." |
| 308 | :type 'face | 305 | :type 'face |
| @@ -331,6 +328,7 @@ directory, like `default-directory'." | |||
| 331 | (regexp :tag "To"))) | 328 | (regexp :tag "To"))) |
| 332 | :group 'ibuffer) | 329 | :group 'ibuffer) |
| 333 | 330 | ||
| 331 | |||
| 334 | (defvar ibuffer-mode-map nil) | 332 | (defvar ibuffer-mode-map nil) |
| 335 | (defvar ibuffer-mode-operate-map nil) | 333 | (defvar ibuffer-mode-operate-map nil) |
| 336 | (defvar ibuffer-mode-groups-popup nil) | 334 | (defvar ibuffer-mode-groups-popup nil) |
| @@ -509,6 +507,8 @@ directory, like `default-directory'." | |||
| 509 | (define-key-after map [menu-bar view sort do-sort-by-recency] | 507 | (define-key-after map [menu-bar view sort do-sort-by-recency] |
| 510 | '(menu-item "Sort by view time" ibuffer-do-sort-by-recency | 508 | '(menu-item "Sort by view time" ibuffer-do-sort-by-recency |
| 511 | :help "Sort by the last time the buffer was displayed")) | 509 | :help "Sort by the last time the buffer was displayed")) |
| 510 | (define-key-after map [menu-bar view sort dashes] | ||
| 511 | '("--")) | ||
| 512 | (define-key-after map [menu-bar view sort invert-sorting] | 512 | (define-key-after map [menu-bar view sort invert-sorting] |
| 513 | '(menu-item "Reverse sorting order" ibuffer-invert-sorting)) | 513 | '(menu-item "Reverse sorting order" ibuffer-invert-sorting)) |
| 514 | (define-key-after map [menu-bar view sort toggle-sorting-mode] | 514 | (define-key-after map [menu-bar view sort toggle-sorting-mode] |
| @@ -558,7 +558,7 @@ directory, like `default-directory'." | |||
| 558 | (cdr ibuffer-filtering-qualifiers)))) | 558 | (cdr ibuffer-filtering-qualifiers)))) |
| 559 | (define-key-after map [menu-bar view filter save-filters] | 559 | (define-key-after map [menu-bar view filter save-filters] |
| 560 | '(menu-item "Save current filters permanently..." ibuffer-save-filters | 560 | '(menu-item "Save current filters permanently..." ibuffer-save-filters |
| 561 | :enable (and (featurep 'ibuf-ext) ibuffer-filtering-qualifiers) | 561 | :enable (and (featurep 'ibuf-ext) ibuffer-filtering-qualifiers) |
| 562 | :help "Use a mnemnonic name to store current filter stack")) | 562 | :help "Use a mnemnonic name to store current filter stack")) |
| 563 | (define-key-after map [menu-bar view filter switch-to-saved-filters] | 563 | (define-key-after map [menu-bar view filter switch-to-saved-filters] |
| 564 | '(menu-item "Restore permanently saved filters..." ibuffer-switch-to-saved-filters | 564 | '(menu-item "Restore permanently saved filters..." ibuffer-switch-to-saved-filters |
| @@ -581,7 +581,7 @@ directory, like `default-directory'." | |||
| 581 | :enable (and (featurep 'ibuf-ext) ibuffer-filtering-qualifiers))) | 581 | :enable (and (featurep 'ibuf-ext) ibuffer-filtering-qualifiers))) |
| 582 | (define-key-after groups-map [forward-filter-group] | 582 | (define-key-after groups-map [forward-filter-group] |
| 583 | '(menu-item "Move point to the next filter group" | 583 | '(menu-item "Move point to the next filter group" |
| 584 | ibuffer-forward-filter-group)) | 584 | ibuffer-forward-filter-group)) |
| 585 | (define-key-after groups-map [backward-filter-group] | 585 | (define-key-after groups-map [backward-filter-group] |
| 586 | '(menu-item "Move point to the previous filter group" | 586 | '(menu-item "Move point to the previous filter group" |
| 587 | ibuffer-backward-filter-group)) | 587 | ibuffer-backward-filter-group)) |
| @@ -618,7 +618,7 @@ directory, like `default-directory'." | |||
| 618 | '(menu-item "Restore permanently saved filters..." | 618 | '(menu-item "Restore permanently saved filters..." |
| 619 | ibuffer-switch-to-saved-filter-groups | 619 | ibuffer-switch-to-saved-filter-groups |
| 620 | :enable (and (featurep 'ibuf-ext) ibuffer-saved-filter-groups) | 620 | :enable (and (featurep 'ibuf-ext) ibuffer-saved-filter-groups) |
| 621 | :help "Replace current filters with a saved stack")) | 621 | :help "Replace current filters with a saved stack")) |
| 622 | (define-key-after groups-map [delete-saved-filter-groups] | 622 | (define-key-after groups-map [delete-saved-filter-groups] |
| 623 | '(menu-item "Delete permanently saved filter groups..." | 623 | '(menu-item "Delete permanently saved filter groups..." |
| 624 | ibuffer-delete-saved-filter-groups | 624 | ibuffer-delete-saved-filter-groups |
| @@ -639,8 +639,7 @@ directory, like `default-directory'." | |||
| 639 | '(menu-item "Toggle Auto Mode" ibuffer-auto-mode | 639 | '(menu-item "Toggle Auto Mode" ibuffer-auto-mode |
| 640 | :help "Attempt to automatically update the Ibuffer buffer")) | 640 | :help "Attempt to automatically update the Ibuffer buffer")) |
| 641 | (define-key-after map [menu-bar view customize] | 641 | (define-key-after map [menu-bar view customize] |
| 642 | '(menu-item "Customize Ibuffer" (lambda () (interactive) | 642 | '(menu-item "Customize Ibuffer" ibuffer-customize |
| 643 | (customize-group 'ibuffer)) | ||
| 644 | :help "Use Custom to customize Ibuffer")) | 643 | :help "Use Custom to customize Ibuffer")) |
| 645 | 644 | ||
| 646 | (define-key-after map [menu-bar mark] | 645 | (define-key-after map [menu-bar mark] |
| @@ -751,14 +750,14 @@ directory, like `default-directory'." | |||
| 751 | ibuffer-mode-groups-popup (copy-keymap groups-map)))) | 750 | ibuffer-mode-groups-popup (copy-keymap groups-map)))) |
| 752 | 751 | ||
| 753 | (define-key ibuffer-mode-groups-popup [kill-filter-group] | 752 | (define-key ibuffer-mode-groups-popup [kill-filter-group] |
| 754 | '(menu-item "Kill filter group" | 753 | '(menu-item "Kill filter group" |
| 755 | ibuffer-kill-line | 754 | ibuffer-kill-line |
| 756 | :enable (and (featurep 'ibuf-ext) ibuffer-filter-groups))) | 755 | :enable (and (featurep 'ibuf-ext) ibuffer-filter-groups))) |
| 757 | (define-key ibuffer-mode-groups-popup [yank-filter-group] | 756 | (define-key ibuffer-mode-groups-popup [yank-filter-group] |
| 758 | '(menu-item "Yank last killed filter group" | 757 | '(menu-item "Yank last killed filter group" |
| 759 | ibuffer-yank | 758 | ibuffer-yank |
| 760 | :enable (and (featurep 'ibuf-ext) ibuffer-filter-group-kill-ring))) | 759 | :enable (and (featurep 'ibuf-ext) ibuffer-filter-group-kill-ring))) |
| 761 | 760 | ||
| 762 | (defvar ibuffer-name-map nil) | 761 | (defvar ibuffer-name-map nil) |
| 763 | (unless ibuffer-name-map | 762 | (unless ibuffer-name-map |
| 764 | (let ((map (make-sparse-keymap))) | 763 | (let ((map (make-sparse-keymap))) |
| @@ -875,13 +874,13 @@ width and the longest string in LIST." | |||
| 875 | (popup-menu ibuffer-mode-groups-popup)) | 874 | (popup-menu ibuffer-mode-groups-popup)) |
| 876 | (let ((inhibit-read-only t)) | 875 | (let ((inhibit-read-only t)) |
| 877 | (ibuffer-save-marks | 876 | (ibuffer-save-marks |
| 878 | ;; hm. we could probably do this in a better fashion | 877 | ;; hm. we could probably do this in a better fashion |
| 879 | (ibuffer-unmark-all ?\r) | 878 | (ibuffer-unmark-all ?\r) |
| 880 | (save-excursion | 879 | (save-excursion |
| 881 | (goto-char eventpt) | 880 | (goto-char eventpt) |
| 882 | (ibuffer-set-mark ibuffer-marked-char)) | 881 | (ibuffer-set-mark ibuffer-marked-char)) |
| 883 | (save-excursion | 882 | (save-excursion |
| 884 | (popup-menu ibuffer-mode-operate-map))))) | 883 | (popup-menu ibuffer-mode-operate-map))))) |
| 885 | (setq buffer-read-only t) | 884 | (setq buffer-read-only t) |
| 886 | (if (= eventpt (point)) | 885 | (if (= eventpt (point)) |
| 887 | (goto-char origpt))))) | 886 | (goto-char origpt))))) |
| @@ -895,6 +894,11 @@ width and the longest string in LIST." | |||
| 895 | (forward-line direction) | 894 | (forward-line direction) |
| 896 | (beginning-of-line))) | 895 | (beginning-of-line))) |
| 897 | 896 | ||
| 897 | (defun ibuffer-customize () | ||
| 898 | "Begin customizing Ibuffer interactively." | ||
| 899 | (interactive) | ||
| 900 | (customize-group 'ibuffer)) | ||
| 901 | |||
| 898 | (defun ibuffer-backward-line (&optional arg skip-group-names) | 902 | (defun ibuffer-backward-line (&optional arg skip-group-names) |
| 899 | "Move backwards ARG lines, wrapping around the list if necessary." | 903 | "Move backwards ARG lines, wrapping around the list if necessary." |
| 900 | (interactive "P") | 904 | (interactive "P") |
| @@ -1030,11 +1034,11 @@ a new window in the current frame, splitting vertically." | |||
| 1030 | (> (length marked-bufs) 3) | 1034 | (> (length marked-bufs) 3) |
| 1031 | (not (y-or-n-p (format "Really create a new frame for %s buffers? " | 1035 | (not (y-or-n-p (format "Really create a new frame for %s buffers? " |
| 1032 | (length marked-bufs))))) | 1036 | (length marked-bufs))))) |
| 1033 | (set-buffer-modified-p nil) | 1037 | (set-buffer-modified-p nil) |
| 1034 | (delete-other-windows) | 1038 | (delete-other-windows) |
| 1035 | (switch-to-buffer (pop marked-bufs)) | 1039 | (switch-to-buffer (pop marked-bufs)) |
| 1036 | (let ((height (/ (1- (if (eq type 'horizontally) (frame-width) | 1040 | (let ((height (/ (1- (if (eq type 'horizontally) (frame-width) |
| 1037 | (frame-height))) | 1041 | (frame-height))) |
| 1038 | (1+ (length marked-bufs))))) | 1042 | (1+ (length marked-bufs))))) |
| 1039 | (mapcar (if (eq type 'other-frame) | 1043 | (mapcar (if (eq type 'other-frame) |
| 1040 | #'(lambda (buf) | 1044 | #'(lambda (buf) |
| @@ -1073,7 +1077,7 @@ a new window in the current frame, splitting vertically." | |||
| 1073 | (ibuffer-columnize-and-insert-list names) | 1077 | (ibuffer-columnize-and-insert-list names) |
| 1074 | (goto-char (point-min)) | 1078 | (goto-char (point-min)) |
| 1075 | (setq buffer-read-only t)) | 1079 | (setq buffer-read-only t)) |
| 1076 | (let ((lastwin (car (last (ibuffer-window-list))))) | 1080 | (let ((lastwin (car (last (window-list nil 'nomini))))) |
| 1077 | ;; Now attempt to display the buffer... | 1081 | ;; Now attempt to display the buffer... |
| 1078 | (save-window-excursion | 1082 | (save-window-excursion |
| 1079 | (select-window lastwin) | 1083 | (select-window lastwin) |
| @@ -1090,11 +1094,11 @@ a new window in the current frame, splitting vertically." | |||
| 1090 | ;; Handle a failure | 1094 | ;; Handle a failure |
| 1091 | (if (or (> (incf attempts) 4) | 1095 | (if (or (> (incf attempts) 4) |
| 1092 | (and (stringp (cadr err)) | 1096 | (and (stringp (cadr err)) |
| 1093 | ;; This definitely falls in the ghetto hack category... | 1097 | ;; This definitely falls in the |
| 1098 | ;; ghetto hack category... | ||
| 1094 | (not (string-match "too small" (cadr err))))) | 1099 | (not (string-match "too small" (cadr err))))) |
| 1095 | (apply #'signal err) | 1100 | (apply #'signal err) |
| 1096 | (enlarge-window 3)))))) | 1101 | (enlarge-window 3)))))) |
| 1097 | ;; This part doesn't work correctly sometimes under XEmacs. | ||
| 1098 | (select-window (next-window)) | 1102 | (select-window (next-window)) |
| 1099 | (switch-to-buffer buf) | 1103 | (switch-to-buffer buf) |
| 1100 | (unwind-protect | 1104 | (unwind-protect |
| @@ -1111,7 +1115,7 @@ a new window in the current frame, splitting vertically." | |||
| 1111 | (defun ibuffer-buffer-names-with-mark (mark) | 1115 | (defun ibuffer-buffer-names-with-mark (mark) |
| 1112 | (let ((ibuffer-buffer-names-with-mark-result nil)) | 1116 | (let ((ibuffer-buffer-names-with-mark-result nil)) |
| 1113 | (ibuffer-map-lines-nomodify | 1117 | (ibuffer-map-lines-nomodify |
| 1114 | #'(lambda (buf mk) | 1118 | #'(lambda (buf mk) |
| 1115 | (when (char-equal mark mk) | 1119 | (when (char-equal mark mk) |
| 1116 | (push (buffer-name buf) | 1120 | (push (buffer-name buf) |
| 1117 | ibuffer-buffer-names-with-mark-result)))) | 1121 | ibuffer-buffer-names-with-mark-result)))) |
| @@ -1267,7 +1271,7 @@ If point is on a group name, this function operates on that group." | |||
| 1267 | (progn | 1271 | (progn |
| 1268 | (require 'ibuf-ext) | 1272 | (require 'ibuf-ext) |
| 1269 | (ibuffer-mark-on-buffer #'identity mark it)) | 1273 | (ibuffer-mark-on-buffer #'identity mark it)) |
| 1270 | (ibuffer-forward-line 0 t) | 1274 | (ibuffer-forward-line 0 t) |
| 1271 | (let ((inhibit-read-only t)) | 1275 | (let ((inhibit-read-only t)) |
| 1272 | (while (> arg 0) | 1276 | (while (> arg 0) |
| 1273 | (ibuffer-set-mark mark) | 1277 | (ibuffer-set-mark mark) |
| @@ -1338,29 +1342,29 @@ If point is on a group name, this function operates on that group." | |||
| 1338 | (defun ibuffer-current-format (&optional uncompiledp) | 1342 | (defun ibuffer-current-format (&optional uncompiledp) |
| 1339 | (or ibuffer-current-format | 1343 | (or ibuffer-current-format |
| 1340 | (setq ibuffer-current-format 0)) | 1344 | (setq ibuffer-current-format 0)) |
| 1341 | (nth ibuffer-current-format (ibuffer-current-formats uncompiledp))) | 1345 | (nth ibuffer-current-format (ibuffer-current-formats uncompiledp))) |
| 1342 | 1346 | ||
| 1343 | (defun ibuffer-expand-format-entry (form) | 1347 | (defun ibuffer-expand-format-entry (form) |
| 1344 | (if (or (consp form) | 1348 | (if (or (consp form) |
| 1345 | (symbolp form)) | 1349 | (symbolp form)) |
| 1346 | (let ((sym (intern (concat "ibuffer-make-column-" | 1350 | (let ((sym (intern (concat "ibuffer-make-column-" |
| 1347 | (symbol-name (if (consp form) | 1351 | (symbol-name (if (consp form) |
| 1348 | (car form) | 1352 | (car form) |
| 1349 | form)))))) | 1353 | form)))))) |
| 1350 | (unless (or (fboundp sym) | 1354 | (unless (or (fboundp sym) |
| 1351 | (assq sym ibuffer-inline-columns)) | 1355 | (assq sym ibuffer-inline-columns)) |
| 1352 | (error "Unknown column %s in ibuffer-formats" form)) | 1356 | (error "Unknown column %s in ibuffer-formats" form)) |
| 1353 | (let (min max align elide) | 1357 | (let (min max align elide) |
| 1354 | (if (consp form) | 1358 | (if (consp form) |
| 1355 | (setq min (or (nth 1 form) 0) | 1359 | (setq min (or (nth 1 form) 0) |
| 1356 | max (or (nth 2 form) -1) | 1360 | max (or (nth 2 form) -1) |
| 1357 | align (or (nth 3 form) :left) | 1361 | align (or (nth 3 form) :left) |
| 1358 | elide (or (nth 4 form) nil)) | 1362 | elide (or (nth 4 form) nil)) |
| 1359 | (setq min 0 | 1363 | (setq min 0 |
| 1360 | max -1 | 1364 | max -1 |
| 1361 | align :left | 1365 | align :left |
| 1362 | elide nil)) | 1366 | elide nil)) |
| 1363 | (list sym min max align elide))) | 1367 | (list sym min max align elide))) |
| 1364 | form)) | 1368 | form)) |
| 1365 | 1369 | ||
| 1366 | (defun ibuffer-compile-make-eliding-form (strvar elide from-end-p) | 1370 | (defun ibuffer-compile-make-eliding-form (strvar elide from-end-p) |
| @@ -1462,19 +1466,19 @@ If point is on a group name, this function operates on that group." | |||
| 1462 | ;; into our generated code. Otherwise, we just | 1466 | ;; into our generated code. Otherwise, we just |
| 1463 | ;; generate a call to the column function. | 1467 | ;; generate a call to the column function. |
| 1464 | (ibuffer-aif (assq sym ibuffer-inline-columns) | 1468 | (ibuffer-aif (assq sym ibuffer-inline-columns) |
| 1465 | (nth 1 it) | 1469 | (nth 1 it) |
| 1466 | `(,sym buffer mark))) | 1470 | `(,sym buffer mark))) |
| 1467 | ;; You're not expected to understand this. Hell, I | 1471 | ;; You're not expected to understand this. Hell, I |
| 1468 | ;; don't even understand it, and I wrote it five | 1472 | ;; don't even understand it, and I wrote it five |
| 1469 | ;; minutes ago. | 1473 | ;; minutes ago. |
| 1470 | (insertgenfn (ibuffer-aif (get sym 'ibuffer-column-summarizer) | 1474 | (insertgenfn (ibuffer-aif (get sym 'ibuffer-column-summarizer) |
| 1471 | ;; I really, really wish Emacs Lisp had closures. | 1475 | ;; I really, really wish Emacs Lisp had closures. |
| 1472 | (lambda (arg sym) | 1476 | (lambda (arg sym) |
| 1473 | `(insert | 1477 | `(insert |
| 1474 | (let ((ret ,arg)) | 1478 | (let ((ret ,arg)) |
| 1475 | (put ',sym 'ibuffer-column-summary | 1479 | (put ',sym 'ibuffer-column-summary |
| 1476 | (cons ret (get ',sym 'ibuffer-column-summary))) | 1480 | (cons ret (get ',sym 'ibuffer-column-summary))) |
| 1477 | ret))) | 1481 | ret))) |
| 1478 | (lambda (arg sym) | 1482 | (lambda (arg sym) |
| 1479 | `(insert ,arg)))) | 1483 | `(insert ,arg)))) |
| 1480 | (mincompform `(< strlen ,(if (integerp min) | 1484 | (mincompform `(< strlen ,(if (integerp min) |
| @@ -1483,40 +1487,40 @@ If point is on a group name, this function operates on that group." | |||
| 1483 | (maxcompform `(> strlen ,(if (integerp max) | 1487 | (maxcompform `(> strlen ,(if (integerp max) |
| 1484 | max | 1488 | max |
| 1485 | 'max)))) | 1489 | 'max)))) |
| 1486 | (if (or min-used max-used) | 1490 | (if (or min-used max-used) |
| 1487 | ;; The complex case, where we have to limit the | 1491 | ;; The complex case, where we have to limit the |
| 1488 | ;; form to a maximum or minimum size. | 1492 | ;; form to a maximum or minimum size. |
| 1489 | (progn | 1493 | (progn |
| 1490 | (when (and min-used (not (integerp min))) | 1494 | (when (and min-used (not (integerp min))) |
| 1491 | (push `(min ,min) letbindings)) | 1495 | (push `(min ,min) letbindings)) |
| 1492 | (when (and max-used (not (integerp max))) | 1496 | (when (and max-used (not (integerp max))) |
| 1493 | (push `(max ,max) letbindings)) | 1497 | (push `(max ,max) letbindings)) |
| 1494 | (push | 1498 | (push |
| 1495 | (if (and min-used max-used) | 1499 | (if (and min-used max-used) |
| 1496 | `(if ,mincompform | 1500 | `(if ,mincompform |
| 1497 | ,minform | 1501 | ,minform |
| 1498 | (if ,maxcompform | 1502 | (if ,maxcompform |
| 1499 | ,maxform)) | 1503 | ,maxform)) |
| 1500 | (if min-used | 1504 | (if min-used |
| 1501 | `(when ,mincompform | 1505 | `(when ,mincompform |
| 1502 | ,minform) | 1506 | ,minform) |
| 1503 | `(when ,maxcompform | 1507 | `(when ,maxcompform |
| 1504 | ,maxform))) | 1508 | ,maxform))) |
| 1505 | outforms) | 1509 | outforms) |
| 1506 | (push (append | 1510 | (push (append |
| 1507 | `(setq str ,callform) | 1511 | `(setq str ,callform) |
| 1508 | (when strlen-used | 1512 | (when strlen-used |
| 1509 | `(strlen (length str)))) | 1513 | `(strlen (length str)))) |
| 1510 | outforms) | 1514 | outforms) |
| 1511 | (setq outforms | 1515 | (setq outforms |
| 1512 | (append outforms (list (funcall insertgenfn 'str sym))))) | 1516 | (append outforms (list (funcall insertgenfn 'str sym))))) |
| 1513 | ;; The simple case; just insert the string. | 1517 | ;; The simple case; just insert the string. |
| 1514 | (push (funcall insertgenfn callform sym) outforms)) | 1518 | (push (funcall insertgenfn callform sym) outforms)) |
| 1515 | ;; Finally, return a `let' form which binds the | 1519 | ;; Finally, return a `let' form which binds the |
| 1516 | ;; variables in `letbindings', and contains all the | 1520 | ;; variables in `letbindings', and contains all the |
| 1517 | ;; code in `outforms'. | 1521 | ;; code in `outforms'. |
| 1518 | `(let ,letbindings | 1522 | `(let ,letbindings |
| 1519 | ,@outforms))))) | 1523 | ,@outforms))))) |
| 1520 | result)) | 1524 | result)) |
| 1521 | (setq result | 1525 | (setq result |
| 1522 | ;; We don't want to unconditionally load the byte-compiler. | 1526 | ;; We don't want to unconditionally load the byte-compiler. |
| @@ -1547,7 +1551,7 @@ If point is on a group name, this function operates on that group." | |||
| 1547 | "Recompile `ibuffer-formats'." | 1551 | "Recompile `ibuffer-formats'." |
| 1548 | (interactive) | 1552 | (interactive) |
| 1549 | (setq ibuffer-compiled-formats | 1553 | (setq ibuffer-compiled-formats |
| 1550 | (mapcar #'ibuffer-compile-format ibuffer-formats)) | 1554 | (mapcar #'ibuffer-compile-format ibuffer-formats)) |
| 1551 | (when (boundp 'ibuffer-filter-format-alist) | 1555 | (when (boundp 'ibuffer-filter-format-alist) |
| 1552 | (setq ibuffer-compiled-filter-formats | 1556 | (setq ibuffer-compiled-filter-formats |
| 1553 | (mapcar #'(lambda (entry) | 1557 | (mapcar #'(lambda (entry) |
| @@ -1607,8 +1611,8 @@ If point is on a group name, this function operates on that group." | |||
| 1607 | (define-ibuffer-column name (:inline t | 1611 | (define-ibuffer-column name (:inline t |
| 1608 | :props | 1612 | :props |
| 1609 | ('mouse-face 'highlight 'keymap ibuffer-name-map | 1613 | ('mouse-face 'highlight 'keymap ibuffer-name-map |
| 1610 | 'ibuffer-name-column t | 1614 | 'ibuffer-name-column t |
| 1611 | 'help-echo "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer")) | 1615 | 'help-echo "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer")) |
| 1612 | (propertize (buffer-name) 'font-lock-face (ibuffer-buffer-name-face buffer mark))) | 1616 | (propertize (buffer-name) 'font-lock-face (ibuffer-buffer-name-face buffer mark))) |
| 1613 | 1617 | ||
| 1614 | (define-ibuffer-column size (:inline t) | 1618 | (define-ibuffer-column size (:inline t) |
| @@ -1617,7 +1621,7 @@ If point is on a group name, this function operates on that group." | |||
| 1617 | (define-ibuffer-column mode (:inline t | 1621 | (define-ibuffer-column mode (:inline t |
| 1618 | :props | 1622 | :props |
| 1619 | ('mouse-face 'highlight | 1623 | ('mouse-face 'highlight |
| 1620 | 'keymap ibuffer-mode-name-map | 1624 | 'keymap ibuffer-mode-name-map |
| 1621 | 'help-echo "mouse-2: filter by this mode")) | 1625 | 'help-echo "mouse-2: filter by this mode")) |
| 1622 | (format "%s" mode-name)) | 1626 | (format "%s" mode-name)) |
| 1623 | 1627 | ||
| @@ -1709,8 +1713,8 @@ Don't set the ibuffer modification flag iff NOMODIFY is non-nil. | |||
| 1709 | If optional argument GROUP is non-nil, then only call FUNCTION on | 1713 | If optional argument GROUP is non-nil, then only call FUNCTION on |
| 1710 | buffers in filtering group GROUP. | 1714 | buffers in filtering group GROUP. |
| 1711 | 1715 | ||
| 1712 | FUNCTION is called with four arguments: the buffer object itself, the | 1716 | FUNCTION is called with two arguments: |
| 1713 | current mark symbol, and the beginning and ending line positions." | 1717 | the buffer object itself and the current mark symbol." |
| 1714 | (assert (eq major-mode 'ibuffer-mode)) | 1718 | (assert (eq major-mode 'ibuffer-mode)) |
| 1715 | (ibuffer-forward-line 0) | 1719 | (ibuffer-forward-line 0) |
| 1716 | (let* ((orig-target-line (1+ (count-lines (save-excursion | 1720 | (let* ((orig-target-line (1+ (count-lines (save-excursion |
| @@ -1725,7 +1729,7 @@ current mark symbol, and the beginning and ending line positions." | |||
| 1725 | (progn | 1729 | (progn |
| 1726 | (setq buffer-read-only nil) | 1730 | (setq buffer-read-only nil) |
| 1727 | (goto-char (point-min)) | 1731 | (goto-char (point-min)) |
| 1728 | (ibuffer-forward-line 0 t) | 1732 | (ibuffer-forward-line 0 t) |
| 1729 | (while (and (not (eobp)) | 1733 | (while (and (not (eobp)) |
| 1730 | (not (get-text-property (point) 'ibuffer-summary)) | 1734 | (not (get-text-property (point) 'ibuffer-summary)) |
| 1731 | (progn | 1735 | (progn |
| @@ -1755,7 +1759,7 @@ current mark symbol, and the beginning and ending line positions." | |||
| 1755 | (1+ (line-end-position))) | 1759 | (1+ (line-end-position))) |
| 1756 | (incf ibuffer-map-lines-count) | 1760 | (incf ibuffer-map-lines-count) |
| 1757 | (when (< ibuffer-map-lines-total | 1761 | (when (< ibuffer-map-lines-total |
| 1758 | orig-target-line) | 1762 | orig-target-line) |
| 1759 | (decf target-line-offset))) | 1763 | (decf target-line-offset))) |
| 1760 | (t | 1764 | (t |
| 1761 | (incf ibuffer-map-lines-count) | 1765 | (incf ibuffer-map-lines-count) |
| @@ -1824,11 +1828,11 @@ the value of point at the beginning of the line for that buffer." | |||
| 1824 | (when | 1828 | (when |
| 1825 | ;; This takes precedence over anything else | 1829 | ;; This takes precedence over anything else |
| 1826 | (or (and ibuffer-always-show-last-buffer | 1830 | (or (and ibuffer-always-show-last-buffer |
| 1827 | (eq last buf)) | 1831 | (eq last buf)) |
| 1828 | (funcall (if ext-loaded | 1832 | (funcall (if ext-loaded |
| 1829 | #'ibuffer-ext-visible-p | 1833 | #'ibuffer-ext-visible-p |
| 1830 | #'ibuffer-visible-p) | 1834 | #'ibuffer-visible-p) |
| 1831 | buf all ibuffer-buf)) | 1835 | buf all ibuffer-buf)) |
| 1832 | e))) | 1836 | e))) |
| 1833 | bmarklist)))) | 1837 | bmarklist)))) |
| 1834 | 1838 | ||
| @@ -1837,7 +1841,7 @@ the value of point at the beginning of the line for that buffer." | |||
| 1837 | (not | 1841 | (not |
| 1838 | (ibuffer-buf-matches-predicates buf ibuffer-maybe-show-predicates))) | 1842 | (ibuffer-buf-matches-predicates buf ibuffer-maybe-show-predicates))) |
| 1839 | (or ibuffer-view-ibuffer | 1843 | (or ibuffer-view-ibuffer |
| 1840 | (and ibuffer-buf | 1844 | (and ibuffer-buf |
| 1841 | (not (eq ibuffer-buf buf)))))) | 1845 | (not (eq ibuffer-buf buf)))))) |
| 1842 | 1846 | ||
| 1843 | ;; This function is a special case; it's not defined by | 1847 | ;; This function is a special case; it's not defined by |
| @@ -1889,7 +1893,7 @@ the value of point at the beginning of the line for that buffer." | |||
| 1889 | (min (cadr element)) | 1893 | (min (cadr element)) |
| 1890 | ;; (max (caddr element)) | 1894 | ;; (max (caddr element)) |
| 1891 | (align (cadddr element))) | 1895 | (align (cadddr element))) |
| 1892 | ;; Ignore a negative min when we're inserting the title | 1896 | ;; Ignore a negative min when we're inserting the title |
| 1893 | (when (minusp min) | 1897 | (when (minusp min) |
| 1894 | (setq min (- min))) | 1898 | (setq min (- min))) |
| 1895 | (let* ((name (or (get sym 'ibuffer-column-name) | 1899 | (let* ((name (or (get sym 'ibuffer-column-name) |
| @@ -2000,7 +2004,7 @@ If optional arg SILENT is non-nil, do not display progress messages." | |||
| 2000 | (defun ibuffer-update (arg &optional silent) | 2004 | (defun ibuffer-update (arg &optional silent) |
| 2001 | "Regenerate the list of all buffers. | 2005 | "Regenerate the list of all buffers. |
| 2002 | Display buffers whose name matches one of `ibuffer-maybe-show-predicates' | 2006 | Display buffers whose name matches one of `ibuffer-maybe-show-predicates' |
| 2003 | iff arg ARG is non-nil. | 2007 | iff arg ARG is non-nil. |
| 2004 | 2008 | ||
| 2005 | If optional arg SILENT is non-nil, do not display progress messages." | 2009 | If optional arg SILENT is non-nil, do not display progress messages." |
| 2006 | (interactive "P") | 2010 | (interactive "P") |
| @@ -2407,7 +2411,6 @@ will be inserted before the group at point." | |||
| 2407 | (set (make-local-variable 'ibuffer-cached-eliding-string) nil) | 2411 | (set (make-local-variable 'ibuffer-cached-eliding-string) nil) |
| 2408 | (set (make-local-variable 'ibuffer-cached-elide-long-columns) nil) | 2412 | (set (make-local-variable 'ibuffer-cached-elide-long-columns) nil) |
| 2409 | (set (make-local-variable 'ibuffer-current-format) nil) | 2413 | (set (make-local-variable 'ibuffer-current-format) nil) |
| 2410 | (set (make-local-variable 'ibuffer-did-modifiction) nil) | ||
| 2411 | (set (make-local-variable 'ibuffer-delete-window-on-quit) nil) | 2414 | (set (make-local-variable 'ibuffer-delete-window-on-quit) nil) |
| 2412 | (set (make-local-variable 'ibuffer-did-modification) nil) | 2415 | (set (make-local-variable 'ibuffer-did-modification) nil) |
| 2413 | (set (make-local-variable 'ibuffer-tmp-hide-regexps) nil) | 2416 | (set (make-local-variable 'ibuffer-tmp-hide-regexps) nil) |
| @@ -2424,6 +2427,8 @@ will be inserted before the group at point." | |||
| 2424 | 2427 | ||
| 2425 | (provide 'ibuffer) | 2428 | (provide 'ibuffer) |
| 2426 | 2429 | ||
| 2430 | (run-hooks 'ibuffer-load-hook) | ||
| 2431 | |||
| 2427 | ;; Local Variables: | 2432 | ;; Local Variables: |
| 2428 | ;; coding: iso-8859-1 | 2433 | ;; coding: iso-8859-1 |
| 2429 | ;; End: | 2434 | ;; End: |