diff options
| author | Juanma Barranquero | 2007-10-11 16:10:26 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2007-10-11 16:10:26 +0000 |
| commit | 3d5aef76947d9f329fd39be39c2f871dc28dd651 (patch) | |
| tree | a2a963fe6fc566f8ad6946a988b8f777b3b8fe9b /lisp/bs.el | |
| parent | 0a0ca7f11fe17ee09259e07bed63e5c193997463 (diff) | |
| download | emacs-3d5aef76947d9f329fd39be39c2f871dc28dd651.tar.gz emacs-3d5aef76947d9f329fd39be39c2f871dc28dd651.zip | |
(bs--mark-unmark): New function.
(bs-mark-current, bs-unmark-current): Use it.
Diffstat (limited to 'lisp/bs.el')
| -rw-r--r-- | lisp/bs.el | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/lisp/bs.el b/lisp/bs.el index 4d13c97c2fd..6390bd2dd81 100644 --- a/lisp/bs.el +++ b/lisp/bs.el | |||
| @@ -864,35 +864,32 @@ the status of buffer on current line." | |||
| 864 | (bs--set-window-height) | 864 | (bs--set-window-height) |
| 865 | (bs--show-config-message what)) | 865 | (bs--show-config-message what)) |
| 866 | 866 | ||
| 867 | (defun bs--mark-unmark (count fun) | ||
| 868 | "Call FUN on COUNT consecutive buffers of *buffer-selection*." | ||
| 869 | (let ((dir (if (> count 0) 1 -1))) | ||
| 870 | (dotimes (i (abs count)) | ||
| 871 | (let ((buffer (bs--current-buffer))) | ||
| 872 | (when buffer (funcall fun buffer)) | ||
| 873 | (bs--update-current-line) | ||
| 874 | (bs-down dir))))) | ||
| 875 | |||
| 867 | (defun bs-mark-current (count) | 876 | (defun bs-mark-current (count) |
| 868 | "Mark buffers. | 877 | "Mark buffers. |
| 869 | COUNT is the number of buffers to mark. | 878 | COUNT is the number of buffers to mark. |
| 870 | Move cursor vertically down COUNT lines." | 879 | Move cursor vertically down COUNT lines." |
| 871 | (interactive "p") | 880 | (interactive "p") |
| 872 | (let ((dir (if (> count 0) 1 -1)) | 881 | (bs--mark-unmark count |
| 873 | (count (abs count))) | 882 | (lambda (buf) |
| 874 | (while (> count 0) | 883 | (add-to-list 'bs--marked-buffers buf)))) |
| 875 | (let ((buffer (bs--current-buffer))) | ||
| 876 | (if buffer | ||
| 877 | (setq bs--marked-buffers (cons buffer bs--marked-buffers))) | ||
| 878 | (bs--update-current-line) | ||
| 879 | (bs-down dir)) | ||
| 880 | (setq count (1- count))))) | ||
| 881 | 884 | ||
| 882 | (defun bs-unmark-current (count) | 885 | (defun bs-unmark-current (count) |
| 883 | "Unmark buffers. | 886 | "Unmark buffers. |
| 884 | COUNT is the number of buffers to unmark. | 887 | COUNT is the number of buffers to unmark. |
| 885 | Move cursor vertically down COUNT lines." | 888 | Move cursor vertically down COUNT lines." |
| 886 | (interactive "p") | 889 | (interactive "p") |
| 887 | (let ((dir (if (> count 0) 1 -1)) | 890 | (bs--mark-unmark count |
| 888 | (count (abs count))) | 891 | (lambda (buf) |
| 889 | (while (> count 0) | 892 | (setq bs--marked-buffers (delq buf bs--marked-buffers))))) |
| 890 | (let ((buffer (bs--current-buffer))) | ||
| 891 | (if buffer | ||
| 892 | (setq bs--marked-buffers (delq buffer bs--marked-buffers))) | ||
| 893 | (bs--update-current-line) | ||
| 894 | (bs-down dir)) | ||
| 895 | (setq count (1- count))))) | ||
| 896 | 893 | ||
| 897 | (defun bs--show-config-message (what) | 894 | (defun bs--show-config-message (what) |
| 898 | "Show message indicating the new showing status WHAT. | 895 | "Show message indicating the new showing status WHAT. |