diff options
| author | John Paul Wallington | 2002-12-09 23:46:12 +0000 |
|---|---|---|
| committer | John Paul Wallington | 2002-12-09 23:46:12 +0000 |
| commit | 4ba1612761c358928e641522c4f52cb91ffaaf48 (patch) | |
| tree | 18c189dcc9088ba32f80e303299260a8a7d18584 /lisp | |
| parent | d852822674aab5332e2d417fd8d8734e1fa59a92 (diff) | |
| download | emacs-4ba1612761c358928e641522c4f52cb91ffaaf48.tar.gz emacs-4ba1612761c358928e641522c4f52cb91ffaaf48.zip | |
* ibuffer.el (ibuffer-mode): If `show-paren-mode' is enabled,
disable it buffer-locally.
(ibuffer-mouse-popup-menu): Use `=' instead of `eq' to compare
`eventpt' and point.
* ibuf-ext.el (ibuffer-remove-duplicates): New function.
(ibuffer-set-filter-groups-by-mode): Use it instead of
`delete-duplicates' so we don't require cl library at runtime.
(ibuffer-insert-filter-group-before): Don't use `position' so we
don't require cl library at runtime.
* chistory.el (command-history-mode): Add interactive spec.
Improve doc string.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/chistory.el | 6 | ||||
| -rw-r--r-- | lisp/ibuf-ext.el | 32 | ||||
| -rw-r--r-- | lisp/ibuffer.el | 5 |
4 files changed, 50 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 27db4bafca4..9316a030e6c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2002-12-09 John Paul Wallington <jpw@shootybangbang.com> | ||
| 2 | |||
| 3 | * ibuffer.el (ibuffer-mode): If `show-paren-mode' is enabled, | ||
| 4 | disable it buffer-locally. | ||
| 5 | (ibuffer-mouse-popup-menu): Use `=' instead of `eq' to compare | ||
| 6 | `eventpt' and point. | ||
| 7 | |||
| 8 | * ibuf-ext.el (ibuffer-remove-duplicates): New function. | ||
| 9 | (ibuffer-set-filter-groups-by-mode): Use it instead of | ||
| 10 | `delete-duplicates' so we don't require cl library at runtime. | ||
| 11 | (ibuffer-insert-filter-group-before): Don't use `position' so we | ||
| 12 | don't require cl library at runtime. | ||
| 13 | |||
| 14 | * chistory.el (command-history-mode): Add interactive spec. | ||
| 15 | Improve doc string. | ||
| 16 | |||
| 1 | 2002-12-09 Richard M. Stallman <rms@gnu.org> | 17 | 2002-12-09 Richard M. Stallman <rms@gnu.org> |
| 2 | 18 | ||
| 3 | * isearch.el (isearch-no-upper-case-p): \\ only quotes one character. | 19 | * isearch.el (isearch-no-upper-case-p): \\ only quotes one character. |
diff --git a/lisp/chistory.el b/lisp/chistory.el index 56fef3712e0..aae1d728ee7 100644 --- a/lisp/chistory.el +++ b/lisp/chistory.el | |||
| @@ -126,7 +126,11 @@ The buffer is left in Command History mode." | |||
| 126 | (command-history-mode))))) | 126 | (command-history-mode))))) |
| 127 | 127 | ||
| 128 | (defun command-history-mode () | 128 | (defun command-history-mode () |
| 129 | "Major mode for listing and repeating recent commands." | 129 | "Major mode for listing and repeating recent commands. |
| 130 | |||
| 131 | Keybindings: | ||
| 132 | \\{command-history-map}" | ||
| 133 | (interactive) | ||
| 130 | (Command-history-setup) | 134 | (Command-history-setup) |
| 131 | (setq major-mode 'command-history-mode) | 135 | (setq major-mode 'command-history-mode) |
| 132 | (setq mode-name "Command History") | 136 | (setq mode-name "Command History") |
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 19389abf984..c568f2c3fe7 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el | |||
| @@ -47,6 +47,17 @@ | |||
| 47 | (setq alist (delete entry alist))) | 47 | (setq alist (delete entry alist))) |
| 48 | alist)) | 48 | alist)) |
| 49 | 49 | ||
| 50 | ;; borrowed from Gnus | ||
| 51 | (defun ibuffer-remove-duplicates (list) | ||
| 52 | "Return a copy of LIST with duplicate elements removed." | ||
| 53 | (let ((new nil) | ||
| 54 | (tail list)) | ||
| 55 | (while tail | ||
| 56 | (or (member (car tail) new) | ||
| 57 | (setq new (cons (car tail) new))) | ||
| 58 | (setq tail (cdr tail))) | ||
| 59 | (nreverse new))) | ||
| 60 | |||
| 50 | (defun ibuffer-split-list (ibuffer-split-list-fn ibuffer-split-list-elts) | 61 | (defun ibuffer-split-list (ibuffer-split-list-fn ibuffer-split-list-elts) |
| 51 | (let ((hip-crowd nil) | 62 | (let ((hip-crowd nil) |
| 52 | (lamers nil)) | 63 | (lamers nil)) |
| @@ -545,7 +556,7 @@ To evaluate a form without viewing the buffer, see `ibuffer-do-eval'." | |||
| 545 | (mapcar (lambda (mode) | 556 | (mapcar (lambda (mode) |
| 546 | (cons (format "%s" mode) `((mode . ,mode)))) | 557 | (cons (format "%s" mode) `((mode . ,mode)))) |
| 547 | (let ((modes | 558 | (let ((modes |
| 548 | (delete-duplicates | 559 | (ibuffer-remove-duplicates |
| 549 | (mapcar (lambda (buf) (with-current-buffer buf major-mode)) | 560 | (mapcar (lambda (buf) (with-current-buffer buf major-mode)) |
| 550 | (buffer-list))))) | 561 | (buffer-list))))) |
| 551 | (if ibuffer-view-ibuffer | 562 | (if ibuffer-view-ibuffer |
| @@ -646,13 +657,20 @@ See also `ibuffer-kill-filter-group'." | |||
| 646 | #'kill-line arg))) | 657 | #'kill-line arg))) |
| 647 | 658 | ||
| 648 | (defun ibuffer-insert-filter-group-before (newgroup group) | 659 | (defun ibuffer-insert-filter-group-before (newgroup group) |
| 649 | (let ((pos (or (position group (mapcar #'car ibuffer-filter-groups) | 660 | (let* ((found nil) |
| 650 | :test #'equal) | 661 | (pos (let ((groups (mapcar #'car ibuffer-filter-groups)) |
| 651 | (length ibuffer-filter-groups)))) | 662 | (res 0)) |
| 652 | (cond ((<= pos 0) | 663 | (while groups |
| 653 | (push newgroup ibuffer-filter-groups)) | 664 | (if (equal (car groups) group) |
| 654 | ((= pos (length ibuffer-filter-groups)) | 665 | (setq found t |
| 666 | groups nil) | ||
| 667 | (incf res) | ||
| 668 | (setq groups (cdr groups)))) | ||
| 669 | res))) | ||
| 670 | (cond ((not found) | ||
| 655 | (setq ibuffer-filter-groups (nconc ibuffer-filter-groups (list newgroup)))) | 671 | (setq ibuffer-filter-groups (nconc ibuffer-filter-groups (list newgroup)))) |
| 672 | ((zerop pos) | ||
| 673 | (push newgroup ibuffer-filter-groups)) | ||
| 656 | (t | 674 | (t |
| 657 | (let ((cell (nthcdr pos ibuffer-filter-groups))) | 675 | (let ((cell (nthcdr pos ibuffer-filter-groups))) |
| 658 | (setf (cdr cell) (cons (car cell) (cdr cell))) | 676 | (setf (cdr cell) (cons (car cell) (cdr cell))) |
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 3838212b304..0fa9207bf54 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -883,7 +883,7 @@ width and the longest string in LIST." | |||
| 883 | (save-excursion | 883 | (save-excursion |
| 884 | (popup-menu ibuffer-mode-operate-map))))) | 884 | (popup-menu ibuffer-mode-operate-map))))) |
| 885 | (setq buffer-read-only t) | 885 | (setq buffer-read-only t) |
| 886 | (if (eq eventpt (point)) | 886 | (if (= eventpt (point)) |
| 887 | (goto-char origpt))))) | 887 | (goto-char origpt))))) |
| 888 | 888 | ||
| 889 | (defun ibuffer-skip-properties (props direction) | 889 | (defun ibuffer-skip-properties (props direction) |
| @@ -2387,6 +2387,9 @@ will be inserted before the group at point." | |||
| 2387 | ;; This makes things less ugly for Emacs 21 users with a non-nil | 2387 | ;; This makes things less ugly for Emacs 21 users with a non-nil |
| 2388 | ;; `show-trailing-whitespace'. | 2388 | ;; `show-trailing-whitespace'. |
| 2389 | (setq show-trailing-whitespace nil) | 2389 | (setq show-trailing-whitespace nil) |
| 2390 | ;; disable `show-paren-mode' buffer-locally | ||
| 2391 | (if (bound-and-true-p show-paren-mode) | ||
| 2392 | (set (make-local-variable 'show-paren-mode) nil)) | ||
| 2390 | (set (make-local-variable 'revert-buffer-function) | 2393 | (set (make-local-variable 'revert-buffer-function) |
| 2391 | #'ibuffer-update) | 2394 | #'ibuffer-update) |
| 2392 | (set (make-local-variable 'ibuffer-sorting-mode) | 2395 | (set (make-local-variable 'ibuffer-sorting-mode) |