mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-26 07:33:47 +00:00
* 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.
This commit is contained in:
parent
2a026b0452
commit
4e4a724c11
@ -1,3 +1,21 @@
|
||||
2003-01-24 John Paul Wallington <jpw@gnu.org>
|
||||
|
||||
* 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.
|
||||
|
||||
* ibuf-ext.el (ibuffer-copy-filename-as-kill): C-u means relative
|
||||
filenames. Use `kill-new'.
|
||||
|
||||
2003-01-23 Dave Love <fx@gnu.org>
|
||||
|
||||
* abbrev.el (write-abbrev-file): Simplify, and put a coding cookie
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;; ibuf-ext.el --- extensions for ibuffer
|
||||
;;; ibuf-ext.el --- extensions for ibuffer
|
||||
|
||||
;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Colin Walters <walters@verbum.org>
|
||||
;; Maintainer: John Paul Wallington <jpw@shootybangbang.com>
|
||||
;; Maintainer: John Paul Wallington <jpw@gnu.org>
|
||||
;; Created: 2 Dec 2001
|
||||
;; Keywords: buffer, convenience
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
(let ((hip-crowd nil)
|
||||
(lamers nil))
|
||||
(dolist (ibuffer-split-list-elt ibuffer-split-list-elts)
|
||||
(if (funcall ibuffer-split-list-fn ibuffer-split-list-elt)
|
||||
(if (funcall ibuffer-split-list-fn ibuffer-split-list-elt)
|
||||
(push ibuffer-split-list-elt hip-crowd)
|
||||
(push ibuffer-split-list-elt lamers)))
|
||||
;; Too bad Emacs Lisp doesn't have multiple values.
|
||||
@ -103,13 +103,13 @@ Do not set this variable directly! Use the function
|
||||
((or (mode . message-mode)
|
||||
(mode . mail-mode)
|
||||
(mode . gnus-group-mode)
|
||||
(mode . gnus-summary-mode)
|
||||
(mode . gnus-summary-mode)
|
||||
(mode . gnus-article-mode))))
|
||||
("programming"
|
||||
((or (mode . emacs-lisp-mode)
|
||||
(mode . cperl-mode)
|
||||
(mode . c-mode)
|
||||
(mode . java-mode)
|
||||
(mode . java-mode)
|
||||
(mode . idl-mode)
|
||||
(mode . lisp-mode)))))
|
||||
|
||||
@ -156,7 +156,7 @@ to this variable."
|
||||
:group 'ibuffer)
|
||||
|
||||
(defvar ibuffer-cached-filter-formats nil)
|
||||
(defvar ibuffer-compiled-filter-formats nil)
|
||||
(defvar ibuffer-compiled-filter-formats nil)
|
||||
|
||||
(defvar ibuffer-filter-groups nil
|
||||
"A list like ((\"NAME\" ((SYMBOL . QUALIFIER) ...) ...) which groups buffers.
|
||||
@ -216,7 +216,7 @@ Currently, this only applies to `ibuffer-saved-filters' and
|
||||
(not
|
||||
(ibuffer-buf-matches-predicates buf ibuffer-maybe-show-predicates)))
|
||||
(or ibuffer-view-ibuffer
|
||||
(and ibuffer-buf
|
||||
(and ibuffer-buf
|
||||
(not (eq ibuffer-buf buf))))
|
||||
(or
|
||||
(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."
|
||||
(if (assq 'mode ibuffer-filtering-qualifiers)
|
||||
(setq ibuffer-filtering-qualifiers
|
||||
(ibuffer-delete-alist 'mode ibuffer-filtering-qualifiers))
|
||||
(ibuffer-push-filter (cons 'mode
|
||||
(ibuffer-push-filter (cons 'mode
|
||||
(with-current-buffer buf
|
||||
major-mode)))))
|
||||
(ibuffer-update nil t))
|
||||
@ -284,10 +284,10 @@ With numeric ARG, enable auto-update if and only if ARG is positive."
|
||||
;;;###autoload
|
||||
(defun ibuffer-toggle-filter-group ()
|
||||
"Toggle the display status of the filter group on this line."
|
||||
(interactive)
|
||||
(interactive)
|
||||
(ibuffer-toggle-filter-group-1 (point)))
|
||||
|
||||
(defun ibuffer-toggle-filter-group-1 (posn)
|
||||
(defun ibuffer-toggle-filter-group-1 (posn)
|
||||
(let ((name (get-text-property posn 'ibuffer-filter-group-name)))
|
||||
(unless (stringp name)
|
||||
(error "No filtering group name present"))
|
||||
@ -700,7 +700,7 @@ See also `ibuffer-kill-filter-group'."
|
||||
(ibuffer-update nil t))
|
||||
|
||||
;;;###autoload
|
||||
(defun ibuffer-save-filter-groups (name groups)
|
||||
(defun ibuffer-save-filter-groups (name groups)
|
||||
"Save all active filter groups GROUPS as NAME.
|
||||
They are added to `ibuffer-saved-filter-groups'. Interactively,
|
||||
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
|
||||
turned into two separate filters [name: foo] and [mode: bar-mode]."
|
||||
(interactive)
|
||||
(when (null ibuffer-filtering-qualifiers)
|
||||
(error "No filters in effect"))
|
||||
(error "No filters in effect"))
|
||||
(let ((lim (pop ibuffer-filtering-qualifiers)))
|
||||
(case (car lim)
|
||||
(or
|
||||
@ -949,22 +949,22 @@ The list returned will be of the form (\"MODE-NAME\" . MODE-SYMBOL)."
|
||||
(modes)
|
||||
(this-mode))
|
||||
(while bufs
|
||||
(setq this-mode
|
||||
(with-current-buffer
|
||||
(setq this-mode
|
||||
(with-current-buffer
|
||||
(car bufs)
|
||||
major-mode)
|
||||
bufs (cdr bufs))
|
||||
(add-to-list
|
||||
(add-to-list
|
||||
'modes
|
||||
`(,(symbol-name this-mode) .
|
||||
`(,(symbol-name this-mode) .
|
||||
,this-mode)))
|
||||
modes))
|
||||
modes))
|
||||
|
||||
|
||||
;;; Extra operation definitions
|
||||
|
||||
;;;###autoload (autoload 'ibuffer-filter-by-mode "ibuf-ext.el")
|
||||
(define-ibuffer-filter mode
|
||||
(define-ibuffer-filter mode
|
||||
"Toggle current view to buffers with major mode QUALIFIER."
|
||||
(:description "major mode"
|
||||
:reader
|
||||
@ -982,14 +982,14 @@ The list returned will be of the form (\"MODE-NAME\" . MODE-SYMBOL)."
|
||||
(eq qualifier (with-current-buffer buf major-mode)))
|
||||
|
||||
;;;###autoload (autoload 'ibuffer-filter-by-used-mode "ibuf-ext.el")
|
||||
(define-ibuffer-filter used-mode
|
||||
(define-ibuffer-filter used-mode
|
||||
"Toggle current view to buffers with major mode QUALIFIER.
|
||||
Called interactively, this function allows selection of modes
|
||||
currently used by buffers."
|
||||
(:description "major mode in use"
|
||||
:reader
|
||||
(intern
|
||||
(completing-read "Filter by major mode: "
|
||||
(intern
|
||||
(completing-read "Filter by major mode: "
|
||||
(ibuffer-list-buffer-modes)
|
||||
nil
|
||||
t
|
||||
@ -1001,7 +1001,7 @@ currently used by buffers."
|
||||
(eq qualifier (with-current-buffer buf major-mode)))
|
||||
|
||||
;;;###autoload (autoload 'ibuffer-filter-by-name "ibuf-ext.el")
|
||||
(define-ibuffer-filter name
|
||||
(define-ibuffer-filter name
|
||||
"Toggle current view to buffers with name matching QUALIFIER."
|
||||
(:description "buffer name"
|
||||
:reader (read-from-minibuffer "Filter by name (regexp): "))
|
||||
@ -1016,7 +1016,7 @@ currently used by buffers."
|
||||
(string-match qualifier it)))
|
||||
|
||||
;;;###autoload (autoload 'ibuffer-filter-by-size-gt "ibuf-ext.el")
|
||||
(define-ibuffer-filter size-gt
|
||||
(define-ibuffer-filter size-gt
|
||||
"Toggle current view to buffers with size greater than QUALIFIER."
|
||||
(:description "size greater than"
|
||||
:reader
|
||||
@ -1025,7 +1025,7 @@ currently used by buffers."
|
||||
qualifier))
|
||||
|
||||
;;;###autoload (autoload 'ibuffer-filter-by-size-lt "ibuf-ext.el")
|
||||
(define-ibuffer-filter size-lt
|
||||
(define-ibuffer-filter size-lt
|
||||
"Toggle current view to buffers with size less than QUALIFIER."
|
||||
(:description "size less than"
|
||||
:reader
|
||||
@ -1248,24 +1248,24 @@ This requires the external program \"diff\" to be in your `exec-path'."
|
||||
;;;###autoload
|
||||
(defun ibuffer-copy-filename-as-kill (&optional arg)
|
||||
"Copy filenames of marked buffers into the kill ring.
|
||||
|
||||
The names are separated by a space.
|
||||
If a buffer has no filename, it is ignored.
|
||||
With a zero prefix arg, use the complete pathname of each marked file.
|
||||
|
||||
You can then feed the file name(s) to other commands with C-y.
|
||||
With no prefix arg, use the filename sans its directory of each marked file.
|
||||
With a zero prefix arg, use the complete filename of each marked file.
|
||||
With \\[universal-argument], use the filename of each marked file relative
|
||||
to `ibuffer-default-directory' iff non-nil, otherwise `default-directory'.
|
||||
|
||||
[ This docstring shamelessly stolen from the
|
||||
`dired-copy-filename-as-kill' in \"dired-x\". ]"
|
||||
;; Add to docstring later:
|
||||
;; With C-u, use the relative pathname of each marked file.
|
||||
(interactive "P")
|
||||
(if (= (ibuffer-count-marked-lines) 0)
|
||||
You can then feed the file name(s) to other commands with \\[yank]."
|
||||
(interactive "p")
|
||||
(if (zerop (ibuffer-count-marked-lines))
|
||||
(message "No buffers marked; use 'm' to mark a buffer")
|
||||
(let ((ibuffer-copy-filename-as-kill-result "")
|
||||
(type (cond ((eql arg 0)
|
||||
(type (cond ((zerop arg)
|
||||
'full)
|
||||
;; ((eql arg 4)
|
||||
;; 'relative)
|
||||
((= arg 4)
|
||||
'relative)
|
||||
(t
|
||||
'name))))
|
||||
(ibuffer-map-marked-lines
|
||||
@ -1277,11 +1277,15 @@ You can then feed the file name(s) to other commands with C-y.
|
||||
(case type
|
||||
(full
|
||||
name)
|
||||
(relative
|
||||
(file-relative-name
|
||||
name (or ibuffer-default-directory
|
||||
default-directory)))
|
||||
(t
|
||||
(file-name-nondirectory name)))
|
||||
""))
|
||||
" "))))
|
||||
(push ibuffer-copy-filename-as-kill-result kill-ring))))
|
||||
(kill-new ibuffer-copy-filename-as-kill-result))))
|
||||
|
||||
(defun ibuffer-mark-on-buffer (func &optional ibuffer-mark-on-buffer-mark group)
|
||||
(let ((count
|
||||
|
@ -3,7 +3,7 @@
|
||||
;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Colin Walters <walters@verbum.org>
|
||||
;; Maintainer: John Paul Wallington <jpw@shootybangbang.com>
|
||||
;; Maintainer: John Paul Wallington <jpw@gnu.org>
|
||||
;; Created: 6 Dec 2001
|
||||
;; Keywords: buffer, convenience
|
||||
|
||||
|
259
lisp/ibuffer.el
259
lisp/ibuffer.el
@ -3,7 +3,7 @@
|
||||
;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Colin Walters <walters@verbum.org>
|
||||
;; Maintainer: John Paul Wallington <jpw@shootybangbang.com>
|
||||
;; Maintainer: John Paul Wallington <jpw@gnu.org>
|
||||
;; Created: 8 Sep 2000
|
||||
;; Keywords: buffer, convenience
|
||||
|
||||
@ -39,16 +39,6 @@
|
||||
|
||||
(require 'font-lock)
|
||||
|
||||
;;; Compatibility
|
||||
(eval-and-compile
|
||||
(if (fboundp 'window-list)
|
||||
(defun ibuffer-window-list ()
|
||||
(window-list nil 'nomini))
|
||||
(defun ibuffer-window-list ()
|
||||
(let ((ibuffer-window-list-result nil))
|
||||
(walk-windows #'(lambda (win) (push win ibuffer-window-list-result)) 'nomini)
|
||||
(nreverse ibuffer-window-list-result)))))
|
||||
|
||||
(defgroup ibuffer nil
|
||||
"An advanced replacement for `buffer-menu'.
|
||||
|
||||
@ -148,7 +138,7 @@ buffer, and FACE is the face to use for fontification. If the FORM
|
||||
evaluates to non-nil, then FACE will be put on the buffer name. The
|
||||
element with the highest PRIORITY takes precedence.
|
||||
|
||||
If you change this variable, you must kill the ibuffer buffer and
|
||||
If you change this variable, you must kill the Ibuffer buffer and
|
||||
recreate it for the change to take effect."
|
||||
:type '(repeat
|
||||
(list (integer :tag "Priority")
|
||||
@ -180,8 +170,8 @@ recreate it for the change to take effect."
|
||||
(defcustom ibuffer-default-sorting-mode 'recency
|
||||
"The criteria by which to sort the buffers.
|
||||
|
||||
Note that this variable is local to each ibuffer buffer. Thus, you
|
||||
can have multiple ibuffer buffers open, each with a different sorted
|
||||
Note that this variable is local to each Ibuffer buffer. Thus, you
|
||||
can have multiple Ibuffer buffers open, each with a different sorted
|
||||
view of the buffers."
|
||||
:type '(choice (const :tag "Last view time" :value recency)
|
||||
(const :tag "Lexicographic" :value alphabetic)
|
||||
@ -211,7 +201,9 @@ This variable is deprecated; use the :elide argument of
|
||||
(defcustom ibuffer-maybe-show-predicates `(,(lambda (buf)
|
||||
(and (string-match "^ " (buffer-name buf))
|
||||
(null buffer-file-name))))
|
||||
"A list of predicates (a regexp or function) for buffers to display conditionally.
|
||||
"A list of predicates for buffers to display conditionally.
|
||||
|
||||
A predicate can be a regexp or a function.
|
||||
If a regexp, then it will be matched against the buffer's name.
|
||||
If a function, it will be called with the buffer as an argument, and
|
||||
should return non-nil if this buffer should be shown.
|
||||
@ -263,8 +255,8 @@ state, size, etc."
|
||||
:group 'ibuffer)
|
||||
|
||||
(defcustom ibuffer-always-show-last-buffer nil
|
||||
"If non-nil, always display the previous buffer. This variable
|
||||
takes precedence over filtering, and even
|
||||
"If non-nil, always display the previous buffer.
|
||||
This variable takes precedence over filtering, and even
|
||||
`ibuffer-never-show-predicates'."
|
||||
:type '(choice (const :tag "Always" :value t)
|
||||
(const :tag "Never" :value nil)
|
||||
@ -277,7 +269,7 @@ takes precedence over filtering, and even
|
||||
:group 'ibuffer)
|
||||
|
||||
(defcustom ibuffer-default-directory nil
|
||||
"The default directory to use for a new ibuffer buffer.
|
||||
"The default directory to use for a new Ibuffer buffer.
|
||||
If nil, inherit the directory of the buffer in which `ibuffer' was
|
||||
called. Otherwise, this variable should be a string naming a
|
||||
directory, like `default-directory'."
|
||||
@ -285,24 +277,29 @@ directory, like `default-directory'."
|
||||
string)
|
||||
:group 'ibuffer)
|
||||
|
||||
(defcustom ibuffer-help-buffer-modes '(help-mode apropos-mode
|
||||
Info-mode Info-edit-mode)
|
||||
(defcustom ibuffer-help-buffer-modes
|
||||
'(help-mode apropos-mode Info-mode Info-edit-mode)
|
||||
"List of \"Help\" major modes."
|
||||
:type '(repeat function)
|
||||
:group 'ibuffer)
|
||||
|
||||
(defcustom ibuffer-hook nil
|
||||
"Hooks run when `ibuffer' is called."
|
||||
"Hook run when `ibuffer' is called."
|
||||
:type 'hook
|
||||
:group 'ibuffer)
|
||||
(defvaralias 'ibuffer-hooks 'ibuffer-hook)
|
||||
|
||||
(defcustom ibuffer-mode-hook nil
|
||||
"Hooks run upon entry into `ibuffer-mode'."
|
||||
"Hook run upon entry into `ibuffer-mode'."
|
||||
:type 'hook
|
||||
:group 'ibuffer)
|
||||
(defvaralias 'ibuffer-mode-hooks 'ibuffer-mode-hook)
|
||||
|
||||
(defcustom ibuffer-load-hook nil
|
||||
"Hook run when Ibuffer is loaded."
|
||||
:type 'hook
|
||||
:group 'ibuffer)
|
||||
|
||||
(defcustom ibuffer-marked-face 'font-lock-warning-face
|
||||
"Face used for displaying marked buffers."
|
||||
:type 'face
|
||||
@ -331,6 +328,7 @@ directory, like `default-directory'."
|
||||
(regexp :tag "To")))
|
||||
:group 'ibuffer)
|
||||
|
||||
|
||||
(defvar ibuffer-mode-map nil)
|
||||
(defvar ibuffer-mode-operate-map nil)
|
||||
(defvar ibuffer-mode-groups-popup nil)
|
||||
@ -509,6 +507,8 @@ directory, like `default-directory'."
|
||||
(define-key-after map [menu-bar view sort do-sort-by-recency]
|
||||
'(menu-item "Sort by view time" ibuffer-do-sort-by-recency
|
||||
:help "Sort by the last time the buffer was displayed"))
|
||||
(define-key-after map [menu-bar view sort dashes]
|
||||
'("--"))
|
||||
(define-key-after map [menu-bar view sort invert-sorting]
|
||||
'(menu-item "Reverse sorting order" ibuffer-invert-sorting))
|
||||
(define-key-after map [menu-bar view sort toggle-sorting-mode]
|
||||
@ -558,7 +558,7 @@ directory, like `default-directory'."
|
||||
(cdr ibuffer-filtering-qualifiers))))
|
||||
(define-key-after map [menu-bar view filter save-filters]
|
||||
'(menu-item "Save current filters permanently..." ibuffer-save-filters
|
||||
:enable (and (featurep 'ibuf-ext) ibuffer-filtering-qualifiers)
|
||||
:enable (and (featurep 'ibuf-ext) ibuffer-filtering-qualifiers)
|
||||
:help "Use a mnemnonic name to store current filter stack"))
|
||||
(define-key-after map [menu-bar view filter switch-to-saved-filters]
|
||||
'(menu-item "Restore permanently saved filters..." ibuffer-switch-to-saved-filters
|
||||
@ -581,7 +581,7 @@ directory, like `default-directory'."
|
||||
:enable (and (featurep 'ibuf-ext) ibuffer-filtering-qualifiers)))
|
||||
(define-key-after groups-map [forward-filter-group]
|
||||
'(menu-item "Move point to the next filter group"
|
||||
ibuffer-forward-filter-group))
|
||||
ibuffer-forward-filter-group))
|
||||
(define-key-after groups-map [backward-filter-group]
|
||||
'(menu-item "Move point to the previous filter group"
|
||||
ibuffer-backward-filter-group))
|
||||
@ -618,7 +618,7 @@ directory, like `default-directory'."
|
||||
'(menu-item "Restore permanently saved filters..."
|
||||
ibuffer-switch-to-saved-filter-groups
|
||||
:enable (and (featurep 'ibuf-ext) ibuffer-saved-filter-groups)
|
||||
:help "Replace current filters with a saved stack"))
|
||||
:help "Replace current filters with a saved stack"))
|
||||
(define-key-after groups-map [delete-saved-filter-groups]
|
||||
'(menu-item "Delete permanently saved filter groups..."
|
||||
ibuffer-delete-saved-filter-groups
|
||||
@ -639,8 +639,7 @@ directory, like `default-directory'."
|
||||
'(menu-item "Toggle Auto Mode" ibuffer-auto-mode
|
||||
:help "Attempt to automatically update the Ibuffer buffer"))
|
||||
(define-key-after map [menu-bar view customize]
|
||||
'(menu-item "Customize Ibuffer" (lambda () (interactive)
|
||||
(customize-group 'ibuffer))
|
||||
'(menu-item "Customize Ibuffer" ibuffer-customize
|
||||
:help "Use Custom to customize Ibuffer"))
|
||||
|
||||
(define-key-after map [menu-bar mark]
|
||||
@ -751,14 +750,14 @@ directory, like `default-directory'."
|
||||
ibuffer-mode-groups-popup (copy-keymap groups-map))))
|
||||
|
||||
(define-key ibuffer-mode-groups-popup [kill-filter-group]
|
||||
'(menu-item "Kill filter group"
|
||||
ibuffer-kill-line
|
||||
:enable (and (featurep 'ibuf-ext) ibuffer-filter-groups)))
|
||||
'(menu-item "Kill filter group"
|
||||
ibuffer-kill-line
|
||||
:enable (and (featurep 'ibuf-ext) ibuffer-filter-groups)))
|
||||
(define-key ibuffer-mode-groups-popup [yank-filter-group]
|
||||
'(menu-item "Yank last killed filter group"
|
||||
ibuffer-yank
|
||||
:enable (and (featurep 'ibuf-ext) ibuffer-filter-group-kill-ring)))
|
||||
|
||||
'(menu-item "Yank last killed filter group"
|
||||
ibuffer-yank
|
||||
:enable (and (featurep 'ibuf-ext) ibuffer-filter-group-kill-ring)))
|
||||
|
||||
(defvar ibuffer-name-map nil)
|
||||
(unless ibuffer-name-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
@ -875,13 +874,13 @@ width and the longest string in LIST."
|
||||
(popup-menu ibuffer-mode-groups-popup))
|
||||
(let ((inhibit-read-only t))
|
||||
(ibuffer-save-marks
|
||||
;; hm. we could probably do this in a better fashion
|
||||
(ibuffer-unmark-all ?\r)
|
||||
(save-excursion
|
||||
(goto-char eventpt)
|
||||
(ibuffer-set-mark ibuffer-marked-char))
|
||||
(save-excursion
|
||||
(popup-menu ibuffer-mode-operate-map)))))
|
||||
;; hm. we could probably do this in a better fashion
|
||||
(ibuffer-unmark-all ?\r)
|
||||
(save-excursion
|
||||
(goto-char eventpt)
|
||||
(ibuffer-set-mark ibuffer-marked-char))
|
||||
(save-excursion
|
||||
(popup-menu ibuffer-mode-operate-map)))))
|
||||
(setq buffer-read-only t)
|
||||
(if (= eventpt (point))
|
||||
(goto-char origpt)))))
|
||||
@ -895,6 +894,11 @@ width and the longest string in LIST."
|
||||
(forward-line direction)
|
||||
(beginning-of-line)))
|
||||
|
||||
(defun ibuffer-customize ()
|
||||
"Begin customizing Ibuffer interactively."
|
||||
(interactive)
|
||||
(customize-group 'ibuffer))
|
||||
|
||||
(defun ibuffer-backward-line (&optional arg skip-group-names)
|
||||
"Move backwards ARG lines, wrapping around the list if necessary."
|
||||
(interactive "P")
|
||||
@ -1030,11 +1034,11 @@ a new window in the current frame, splitting vertically."
|
||||
(> (length marked-bufs) 3)
|
||||
(not (y-or-n-p (format "Really create a new frame for %s buffers? "
|
||||
(length marked-bufs)))))
|
||||
(set-buffer-modified-p nil)
|
||||
(set-buffer-modified-p nil)
|
||||
(delete-other-windows)
|
||||
(switch-to-buffer (pop marked-bufs))
|
||||
(let ((height (/ (1- (if (eq type 'horizontally) (frame-width)
|
||||
(frame-height)))
|
||||
(frame-height)))
|
||||
(1+ (length marked-bufs)))))
|
||||
(mapcar (if (eq type 'other-frame)
|
||||
#'(lambda (buf)
|
||||
@ -1073,7 +1077,7 @@ a new window in the current frame, splitting vertically."
|
||||
(ibuffer-columnize-and-insert-list names)
|
||||
(goto-char (point-min))
|
||||
(setq buffer-read-only t))
|
||||
(let ((lastwin (car (last (ibuffer-window-list)))))
|
||||
(let ((lastwin (car (last (window-list nil 'nomini)))))
|
||||
;; Now attempt to display the buffer...
|
||||
(save-window-excursion
|
||||
(select-window lastwin)
|
||||
@ -1090,11 +1094,11 @@ a new window in the current frame, splitting vertically."
|
||||
;; Handle a failure
|
||||
(if (or (> (incf attempts) 4)
|
||||
(and (stringp (cadr err))
|
||||
;; This definitely falls in the ghetto hack category...
|
||||
;; This definitely falls in the
|
||||
;; ghetto hack category...
|
||||
(not (string-match "too small" (cadr err)))))
|
||||
(apply #'signal err)
|
||||
(enlarge-window 3))))))
|
||||
;; This part doesn't work correctly sometimes under XEmacs.
|
||||
(select-window (next-window))
|
||||
(switch-to-buffer buf)
|
||||
(unwind-protect
|
||||
@ -1111,7 +1115,7 @@ a new window in the current frame, splitting vertically."
|
||||
(defun ibuffer-buffer-names-with-mark (mark)
|
||||
(let ((ibuffer-buffer-names-with-mark-result nil))
|
||||
(ibuffer-map-lines-nomodify
|
||||
#'(lambda (buf mk)
|
||||
#'(lambda (buf mk)
|
||||
(when (char-equal mark mk)
|
||||
(push (buffer-name buf)
|
||||
ibuffer-buffer-names-with-mark-result))))
|
||||
@ -1267,7 +1271,7 @@ If point is on a group name, this function operates on that group."
|
||||
(progn
|
||||
(require 'ibuf-ext)
|
||||
(ibuffer-mark-on-buffer #'identity mark it))
|
||||
(ibuffer-forward-line 0 t)
|
||||
(ibuffer-forward-line 0 t)
|
||||
(let ((inhibit-read-only t))
|
||||
(while (> arg 0)
|
||||
(ibuffer-set-mark mark)
|
||||
@ -1338,29 +1342,29 @@ If point is on a group name, this function operates on that group."
|
||||
(defun ibuffer-current-format (&optional uncompiledp)
|
||||
(or ibuffer-current-format
|
||||
(setq ibuffer-current-format 0))
|
||||
(nth ibuffer-current-format (ibuffer-current-formats uncompiledp)))
|
||||
(nth ibuffer-current-format (ibuffer-current-formats uncompiledp)))
|
||||
|
||||
(defun ibuffer-expand-format-entry (form)
|
||||
(if (or (consp form)
|
||||
(symbolp form))
|
||||
(let ((sym (intern (concat "ibuffer-make-column-"
|
||||
(symbol-name (if (consp form)
|
||||
(car form)
|
||||
form))))))
|
||||
(unless (or (fboundp sym)
|
||||
(assq sym ibuffer-inline-columns))
|
||||
(error "Unknown column %s in ibuffer-formats" form))
|
||||
(let (min max align elide)
|
||||
(if (consp form)
|
||||
(setq min (or (nth 1 form) 0)
|
||||
max (or (nth 2 form) -1)
|
||||
align (or (nth 3 form) :left)
|
||||
elide (or (nth 4 form) nil))
|
||||
(setq min 0
|
||||
max -1
|
||||
align :left
|
||||
elide nil))
|
||||
(list sym min max align elide)))
|
||||
(let ((sym (intern (concat "ibuffer-make-column-"
|
||||
(symbol-name (if (consp form)
|
||||
(car form)
|
||||
form))))))
|
||||
(unless (or (fboundp sym)
|
||||
(assq sym ibuffer-inline-columns))
|
||||
(error "Unknown column %s in ibuffer-formats" form))
|
||||
(let (min max align elide)
|
||||
(if (consp form)
|
||||
(setq min (or (nth 1 form) 0)
|
||||
max (or (nth 2 form) -1)
|
||||
align (or (nth 3 form) :left)
|
||||
elide (or (nth 4 form) nil))
|
||||
(setq min 0
|
||||
max -1
|
||||
align :left
|
||||
elide nil))
|
||||
(list sym min max align elide)))
|
||||
form))
|
||||
|
||||
(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."
|
||||
;; into our generated code. Otherwise, we just
|
||||
;; generate a call to the column function.
|
||||
(ibuffer-aif (assq sym ibuffer-inline-columns)
|
||||
(nth 1 it)
|
||||
`(,sym buffer mark)))
|
||||
(nth 1 it)
|
||||
`(,sym buffer mark)))
|
||||
;; You're not expected to understand this. Hell, I
|
||||
;; don't even understand it, and I wrote it five
|
||||
;; minutes ago.
|
||||
(insertgenfn (ibuffer-aif (get sym 'ibuffer-column-summarizer)
|
||||
;; I really, really wish Emacs Lisp had closures.
|
||||
(lambda (arg sym)
|
||||
`(insert
|
||||
(let ((ret ,arg))
|
||||
(put ',sym 'ibuffer-column-summary
|
||||
(cons ret (get ',sym 'ibuffer-column-summary)))
|
||||
ret)))
|
||||
;; I really, really wish Emacs Lisp had closures.
|
||||
(lambda (arg sym)
|
||||
`(insert
|
||||
(let ((ret ,arg))
|
||||
(put ',sym 'ibuffer-column-summary
|
||||
(cons ret (get ',sym 'ibuffer-column-summary)))
|
||||
ret)))
|
||||
(lambda (arg sym)
|
||||
`(insert ,arg))))
|
||||
(mincompform `(< strlen ,(if (integerp min)
|
||||
@ -1483,40 +1487,40 @@ If point is on a group name, this function operates on that group."
|
||||
(maxcompform `(> strlen ,(if (integerp max)
|
||||
max
|
||||
'max))))
|
||||
(if (or min-used max-used)
|
||||
;; The complex case, where we have to limit the
|
||||
;; form to a maximum or minimum size.
|
||||
(progn
|
||||
(when (and min-used (not (integerp min)))
|
||||
(push `(min ,min) letbindings))
|
||||
(when (and max-used (not (integerp max)))
|
||||
(push `(max ,max) letbindings))
|
||||
(push
|
||||
(if (and min-used max-used)
|
||||
`(if ,mincompform
|
||||
,minform
|
||||
(if ,maxcompform
|
||||
,maxform))
|
||||
(if min-used
|
||||
`(when ,mincompform
|
||||
,minform)
|
||||
`(when ,maxcompform
|
||||
,maxform)))
|
||||
outforms)
|
||||
(push (append
|
||||
`(setq str ,callform)
|
||||
(when strlen-used
|
||||
`(strlen (length str))))
|
||||
outforms)
|
||||
(setq outforms
|
||||
(append outforms (list (funcall insertgenfn 'str sym)))))
|
||||
;; The simple case; just insert the string.
|
||||
(push (funcall insertgenfn callform sym) outforms))
|
||||
;; Finally, return a `let' form which binds the
|
||||
;; variables in `letbindings', and contains all the
|
||||
;; code in `outforms'.
|
||||
`(let ,letbindings
|
||||
,@outforms)))))
|
||||
(if (or min-used max-used)
|
||||
;; The complex case, where we have to limit the
|
||||
;; form to a maximum or minimum size.
|
||||
(progn
|
||||
(when (and min-used (not (integerp min)))
|
||||
(push `(min ,min) letbindings))
|
||||
(when (and max-used (not (integerp max)))
|
||||
(push `(max ,max) letbindings))
|
||||
(push
|
||||
(if (and min-used max-used)
|
||||
`(if ,mincompform
|
||||
,minform
|
||||
(if ,maxcompform
|
||||
,maxform))
|
||||
(if min-used
|
||||
`(when ,mincompform
|
||||
,minform)
|
||||
`(when ,maxcompform
|
||||
,maxform)))
|
||||
outforms)
|
||||
(push (append
|
||||
`(setq str ,callform)
|
||||
(when strlen-used
|
||||
`(strlen (length str))))
|
||||
outforms)
|
||||
(setq outforms
|
||||
(append outforms (list (funcall insertgenfn 'str sym)))))
|
||||
;; The simple case; just insert the string.
|
||||
(push (funcall insertgenfn callform sym) outforms))
|
||||
;; Finally, return a `let' form which binds the
|
||||
;; variables in `letbindings', and contains all the
|
||||
;; code in `outforms'.
|
||||
`(let ,letbindings
|
||||
,@outforms)))))
|
||||
result))
|
||||
(setq result
|
||||
;; 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."
|
||||
"Recompile `ibuffer-formats'."
|
||||
(interactive)
|
||||
(setq ibuffer-compiled-formats
|
||||
(mapcar #'ibuffer-compile-format ibuffer-formats))
|
||||
(mapcar #'ibuffer-compile-format ibuffer-formats))
|
||||
(when (boundp 'ibuffer-filter-format-alist)
|
||||
(setq ibuffer-compiled-filter-formats
|
||||
(mapcar #'(lambda (entry)
|
||||
@ -1607,8 +1611,8 @@ If point is on a group name, this function operates on that group."
|
||||
(define-ibuffer-column name (:inline t
|
||||
:props
|
||||
('mouse-face 'highlight 'keymap ibuffer-name-map
|
||||
'ibuffer-name-column t
|
||||
'help-echo "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer"))
|
||||
'ibuffer-name-column t
|
||||
'help-echo "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer"))
|
||||
(propertize (buffer-name) 'font-lock-face (ibuffer-buffer-name-face buffer mark)))
|
||||
|
||||
(define-ibuffer-column size (:inline t)
|
||||
@ -1617,7 +1621,7 @@ If point is on a group name, this function operates on that group."
|
||||
(define-ibuffer-column mode (:inline t
|
||||
:props
|
||||
('mouse-face 'highlight
|
||||
'keymap ibuffer-mode-name-map
|
||||
'keymap ibuffer-mode-name-map
|
||||
'help-echo "mouse-2: filter by this mode"))
|
||||
(format "%s" mode-name))
|
||||
|
||||
@ -1709,8 +1713,8 @@ Don't set the ibuffer modification flag iff NOMODIFY is non-nil.
|
||||
If optional argument GROUP is non-nil, then only call FUNCTION on
|
||||
buffers in filtering group GROUP.
|
||||
|
||||
FUNCTION is called with four arguments: the buffer object itself, the
|
||||
current mark symbol, and the beginning and ending line positions."
|
||||
FUNCTION is called with two arguments:
|
||||
the buffer object itself and the current mark symbol."
|
||||
(assert (eq major-mode 'ibuffer-mode))
|
||||
(ibuffer-forward-line 0)
|
||||
(let* ((orig-target-line (1+ (count-lines (save-excursion
|
||||
@ -1725,7 +1729,7 @@ current mark symbol, and the beginning and ending line positions."
|
||||
(progn
|
||||
(setq buffer-read-only nil)
|
||||
(goto-char (point-min))
|
||||
(ibuffer-forward-line 0 t)
|
||||
(ibuffer-forward-line 0 t)
|
||||
(while (and (not (eobp))
|
||||
(not (get-text-property (point) 'ibuffer-summary))
|
||||
(progn
|
||||
@ -1755,7 +1759,7 @@ current mark symbol, and the beginning and ending line positions."
|
||||
(1+ (line-end-position)))
|
||||
(incf ibuffer-map-lines-count)
|
||||
(when (< ibuffer-map-lines-total
|
||||
orig-target-line)
|
||||
orig-target-line)
|
||||
(decf target-line-offset)))
|
||||
(t
|
||||
(incf ibuffer-map-lines-count)
|
||||
@ -1824,11 +1828,11 @@ the value of point at the beginning of the line for that buffer."
|
||||
(when
|
||||
;; This takes precedence over anything else
|
||||
(or (and ibuffer-always-show-last-buffer
|
||||
(eq last buf))
|
||||
(funcall (if ext-loaded
|
||||
#'ibuffer-ext-visible-p
|
||||
#'ibuffer-visible-p)
|
||||
buf all ibuffer-buf))
|
||||
(eq last buf))
|
||||
(funcall (if ext-loaded
|
||||
#'ibuffer-ext-visible-p
|
||||
#'ibuffer-visible-p)
|
||||
buf all ibuffer-buf))
|
||||
e)))
|
||||
bmarklist))))
|
||||
|
||||
@ -1837,7 +1841,7 @@ the value of point at the beginning of the line for that buffer."
|
||||
(not
|
||||
(ibuffer-buf-matches-predicates buf ibuffer-maybe-show-predicates)))
|
||||
(or ibuffer-view-ibuffer
|
||||
(and ibuffer-buf
|
||||
(and ibuffer-buf
|
||||
(not (eq ibuffer-buf buf))))))
|
||||
|
||||
;; 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."
|
||||
(min (cadr element))
|
||||
;; (max (caddr element))
|
||||
(align (cadddr element)))
|
||||
;; Ignore a negative min when we're inserting the title
|
||||
;; Ignore a negative min when we're inserting the title
|
||||
(when (minusp min)
|
||||
(setq min (- min)))
|
||||
(let* ((name (or (get sym 'ibuffer-column-name)
|
||||
@ -2000,7 +2004,7 @@ If optional arg SILENT is non-nil, do not display progress messages."
|
||||
(defun ibuffer-update (arg &optional silent)
|
||||
"Regenerate the list of all buffers.
|
||||
Display buffers whose name matches one of `ibuffer-maybe-show-predicates'
|
||||
iff arg ARG is non-nil.
|
||||
iff arg ARG is non-nil.
|
||||
|
||||
If optional arg SILENT is non-nil, do not display progress messages."
|
||||
(interactive "P")
|
||||
@ -2407,7 +2411,6 @@ will be inserted before the group at point."
|
||||
(set (make-local-variable 'ibuffer-cached-eliding-string) nil)
|
||||
(set (make-local-variable 'ibuffer-cached-elide-long-columns) nil)
|
||||
(set (make-local-variable 'ibuffer-current-format) nil)
|
||||
(set (make-local-variable 'ibuffer-did-modifiction) nil)
|
||||
(set (make-local-variable 'ibuffer-delete-window-on-quit) nil)
|
||||
(set (make-local-variable 'ibuffer-did-modification) nil)
|
||||
(set (make-local-variable 'ibuffer-tmp-hide-regexps) nil)
|
||||
@ -2424,6 +2427,8 @@ will be inserted before the group at point."
|
||||
|
||||
(provide 'ibuffer)
|
||||
|
||||
(run-hooks 'ibuffer-load-hook)
|
||||
|
||||
;; Local Variables:
|
||||
;; coding: iso-8859-1
|
||||
;; End:
|
||||
|
Loading…
Reference in New Issue
Block a user