Mercurial > emacs
comparison lisp/bs.el @ 85170:000327e80fc2
(bs--mark-unmark): New function.
(bs-mark-current, bs-unmark-current): Use it.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 11 Oct 2007 16:09:34 +0000 |
parents | 467771c10c11 |
children | f885ff424d69 d38543a1c0f9 |
comparison
equal
deleted
inserted
replaced
85169:708abc311fa6 | 85170:000327e80fc2 |
---|---|
862 (with-current-buffer buffer (setq bs-buffer-show-mark what)) | 862 (with-current-buffer buffer (setq bs-buffer-show-mark what)) |
863 (bs--update-current-line) | 863 (bs--update-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. |
899 WHAT is a value of nil, `never', or `always'." | 896 WHAT is a value of nil, `never', or `always'." |
900 (bs-message-without-log (cond ((null what) | 897 (bs-message-without-log (cond ((null what) |