diff options
| author | Gerd Moellmann | 2000-11-30 13:09:23 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-11-30 13:09:23 +0000 |
| commit | 9d8397d270fbfb02135a47bef4034eac12b35da5 (patch) | |
| tree | de8422e093e52f07540c1221476110a5c99c9c08 | |
| parent | c069a9d325a3d63a33ba7be59c061168c60075d0 (diff) | |
| download | emacs-9d8397d270fbfb02135a47bef4034eac12b35da5.tar.gz emacs-9d8397d270fbfb02135a47bef4034eac12b35da5.zip | |
Undo mistaken change of 2000-11-28. Update copyright.
| -rw-r--r-- | lisp/bs.el | 90 |
1 files changed, 47 insertions, 43 deletions
diff --git a/lisp/bs.el b/lisp/bs.el index 4b0c80ba9e9..3d4468d7da4 100644 --- a/lisp/bs.el +++ b/lisp/bs.el | |||
| @@ -65,7 +65,7 @@ | |||
| 65 | ;; The package bs combines the advantages of the Emacs functions | 65 | ;; The package bs combines the advantages of the Emacs functions |
| 66 | ;; `list-buffers' and `electric-buffer-list'. | 66 | ;; `list-buffers' and `electric-buffer-list'. |
| 67 | ;; | 67 | ;; |
| 68 | ;; Additional features for Buffer Selection Menu: | 68 | ;; Additioal features for Buffer Selection Menu: |
| 69 | ;; - configurable list of buffers (show only files etc.). | 69 | ;; - configurable list of buffers (show only files etc.). |
| 70 | ;; - comfortable way to change displayed subset of all buffers. | 70 | ;; - comfortable way to change displayed subset of all buffers. |
| 71 | ;; - show sorted list of buffers. | 71 | ;; - show sorted list of buffers. |
| @@ -141,8 +141,8 @@ | |||
| 141 | :link '(url-link "http://home.netsurf.de/olaf.sylvester/emacs") | 141 | :link '(url-link "http://home.netsurf.de/olaf.sylvester/emacs") |
| 142 | :group 'convenience) | 142 | :group 'convenience) |
| 143 | 143 | ||
| 144 | (defgroup bs-appearance nil | 144 | (defgroup bs-appearence nil |
| 145 | "Buffer Selection appearance: Appearance of bs buffer menu." | 145 | "Buffer Selection appearence: Appearence of bs buffer menu." |
| 146 | :group 'bs) | 146 | :group 'bs) |
| 147 | 147 | ||
| 148 | (defcustom bs-attributes-list | 148 | (defcustom bs-attributes-list |
| @@ -169,19 +169,20 @@ MAXIMUM-LENGTH : maximum width of column (number or name of function) | |||
| 169 | ALIGNMENT : alignment of column: (`left' `right' `middle') | 169 | ALIGNMENT : alignment of column: (`left' `right' `middle') |
| 170 | FUN-OR-STRING : Name of a function for calculating the value or | 170 | FUN-OR-STRING : Name of a function for calculating the value or |
| 171 | a string for a constant value. | 171 | a string for a constant value. |
| 172 | The function gets as parameter the buffer where we have started | 172 | The function gets as parameter the buffer we have started |
| 173 | buffer selection and the list of all buffers to show. The function must | 173 | buffer selection and the list of all buffers to show. The function must |
| 174 | return a string representing the column's value." | 174 | return a string representing the columns value." |
| 175 | :group 'bs-appearance | 175 | :group 'bs-appearence |
| 176 | :type '(repeat sexp)) | 176 | :type '(repeat sexp)) |
| 177 | 177 | ||
| 178 | (defvar bs--running-in-xemacs (string-match "XEmacs" (emacs-version)) | 178 | (defvar bs--running-in-xemacs (string-match "XEmacs" (emacs-version)) |
| 179 | "Non-nil when running under XEmacs.") | 179 | "Non-nil when running under XEmacs.") |
| 180 | 180 | ||
| 181 | |||
| 181 | (defun bs--make-header-match-string () | 182 | (defun bs--make-header-match-string () |
| 182 | "Return a regexp matching the first line of a Buffer Selection Menu buffer." | 183 | "Return a regexp matching the first line of a Buffer Selection Menu buffer." |
| 183 | (let ((res "^\\(") | 184 | (let ((res "^\\(") |
| 184 | (ele bs-attributes-list)) | 185 | (ele bs-attributes-list)) |
| 185 | (while ele | 186 | (while ele |
| 186 | (setq res (concat res (car (car ele)) " *")) | 187 | (setq res (concat res (car (car ele)) " *")) |
| 187 | (setq ele (cdr ele))) | 188 | (setq ele (cdr ele))) |
| @@ -189,7 +190,7 @@ return a string representing the column's value." | |||
| 189 | 190 | ||
| 190 | ;;; Font-Lock-Settings | 191 | ;;; Font-Lock-Settings |
| 191 | (defvar bs-mode-font-lock-keywords | 192 | (defvar bs-mode-font-lock-keywords |
| 192 | (list ;; header in font-lock-type-face | 193 | (list;; header in font-lock-type-face |
| 193 | (list (bs--make-header-match-string) | 194 | (list (bs--make-header-match-string) |
| 194 | '(1 font-lock-type-face append) '(1 'bold append)) | 195 | '(1 font-lock-type-face append) '(1 'bold append)) |
| 195 | ;; Buffername embedded by * | 196 | ;; Buffername embedded by * |
| @@ -207,7 +208,7 @@ return a string representing the column's value." | |||
| 207 | 208 | ||
| 208 | (defcustom bs-max-window-height 20 | 209 | (defcustom bs-max-window-height 20 |
| 209 | "*Maximal window height of Buffer Selection Menu." | 210 | "*Maximal window height of Buffer Selection Menu." |
| 210 | :group 'bs-appearance | 211 | :group 'bs-appearence |
| 211 | :type 'integer) | 212 | :type 'integer) |
| 212 | 213 | ||
| 213 | (defvar bs-dont-show-regexp nil | 214 | (defvar bs-dont-show-regexp nil |
| @@ -242,7 +243,7 @@ The function gets one argument - the buffer to test.") | |||
| 242 | 243 | ||
| 243 | (defvar bs-buffer-sort-function nil | 244 | (defvar bs-buffer-sort-function nil |
| 244 | "Sort function to sort the buffers that appear in Buffer Selection Menu. | 245 | "Sort function to sort the buffers that appear in Buffer Selection Menu. |
| 245 | The function gets two arguments - the buffers to compare.") | 246 | The functions gets two arguments - the buffers to compare.") |
| 246 | 247 | ||
| 247 | (defcustom bs-maximal-buffer-name-column 45 | 248 | (defcustom bs-maximal-buffer-name-column 45 |
| 248 | "*Maximum column width for buffer names. | 249 | "*Maximum column width for buffer names. |
| @@ -250,7 +251,7 @@ The column for buffer names has dynamic width. The width depends on | |||
| 250 | maximal and minimal length of names of buffers to show. The maximal | 251 | maximal and minimal length of names of buffers to show. The maximal |
| 251 | width is bounded by `bs-maximal-buffer-name-column'. | 252 | width is bounded by `bs-maximal-buffer-name-column'. |
| 252 | See also `bs-minimal-buffer-name-column'." | 253 | See also `bs-minimal-buffer-name-column'." |
| 253 | :group 'bs-appearance | 254 | :group 'bs-appearence |
| 254 | :type 'integer) | 255 | :type 'integer) |
| 255 | 256 | ||
| 256 | (defcustom bs-minimal-buffer-name-column 15 | 257 | (defcustom bs-minimal-buffer-name-column 15 |
| @@ -259,7 +260,7 @@ The column for buffer names has dynamic width. The width depends on | |||
| 259 | maximal and minimal length of names of buffers to show. The minimal | 260 | maximal and minimal length of names of buffers to show. The minimal |
| 260 | width is bounded by `bs-minimal-buffer-name-column'. | 261 | width is bounded by `bs-minimal-buffer-name-column'. |
| 261 | See also `bs-maximal-buffer-name-column'." | 262 | See also `bs-maximal-buffer-name-column'." |
| 262 | :group 'bs-appearance | 263 | :group 'bs-appearence |
| 263 | :type 'integer) | 264 | :type 'integer) |
| 264 | 265 | ||
| 265 | (defconst bs-header-lines-length 2 | 266 | (defconst bs-header-lines-length 2 |
| @@ -268,22 +269,22 @@ See also `bs-maximal-buffer-name-column'." | |||
| 268 | (defcustom bs-configurations | 269 | (defcustom bs-configurations |
| 269 | '(("all" nil nil nil nil nil) | 270 | '(("all" nil nil nil nil nil) |
| 270 | ("files" nil nil nil bs-visits-non-file bs-sort-buffer-interns-are-last) | 271 | ("files" nil nil nil bs-visits-non-file bs-sort-buffer-interns-are-last) |
| 271 | ("files-and-scratch" "^\\*scratch\\*$" nil nil bs-visits-non-file | 272 | ("files-and-scratch" "^\\*scratch\\*" nil nil bs-visits-non-file |
| 272 | bs-sort-buffer-interns-are-last) | 273 | bs-sort-buffer-interns-are-last) |
| 273 | ("all-intern-last" nil nil nil nil bs-sort-buffer-interns-are-last)) | 274 | ("all-intern-last" nil nil nil nil bs-sort-buffer-interns-are-last)) |
| 274 | "*List of all configurations you can use in the Buffer Selection Menu. | 275 | "*List of all configurations you can use in the Buffer Selection Menu. |
| 275 | A configuration describes which buffers appear in Buffer Selection Menu | 276 | A configuration describes which buffers appear in Buffer Selection Menu |
| 276 | and also the order of buffers. A configuration is a list with | 277 | and describes the order of buffers. A configuration is a list with |
| 277 | six elements. The first element is a string and describes the configuration. | 278 | six elements. The first element is a string and describes the configuration. |
| 278 | The following five elements represent the values for Buffer Selection Menu | 279 | The following five elements represent the values for Buffer Selection Menu |
| 279 | configuration variables `bs-must-show-regexp', `bs-must-show-function', | 280 | configurations variables `bs-dont-show-regexp', `bs-dont-show-function', |
| 280 | `bs-dont-show-regexp', `bs-dont-show-function' and `bs-buffer-sort-function'. | 281 | `bs-must-show-regexp', `bs-must-show-function' and `bs-buffer-sort-function'. |
| 281 | By setting these variables you define a configuration." | 282 | By setting these variables you define a configuration." |
| 282 | :group 'bs-appearance | 283 | :group 'bs-appearence |
| 283 | :type '(repeat sexp)) | 284 | :type '(repeat sexp)) |
| 284 | 285 | ||
| 285 | (defcustom bs-default-configuration "files" | 286 | (defcustom bs-default-configuration "files" |
| 286 | "*Name of default configuration used by the Buffer Selection Menu. | 287 | "*Name of default configuration used by in the Buffer Selection Menu. |
| 287 | \\<bs-mode-map> | 288 | \\<bs-mode-map> |
| 288 | Will be changed using key \\[bs-select-next-configuration]. | 289 | Will be changed using key \\[bs-select-next-configuration]. |
| 289 | Must be a string used in `bs-configurations' for naming a configuration." | 290 | Must be a string used in `bs-configurations' for naming a configuration." |
| @@ -299,7 +300,7 @@ Must be a string used in `bs-configurations' for naming a configuration." | |||
| 299 | 300 | ||
| 300 | (defvar bs-current-configuration bs-default-configuration | 301 | (defvar bs-current-configuration bs-default-configuration |
| 301 | "Name of current configuration. | 302 | "Name of current configuration. |
| 302 | Must be a string used in `bs-configurations' for naming a configuration.") | 303 | Must be a string found in `bs-configurations' for naming a configuration.") |
| 303 | 304 | ||
| 304 | (defcustom bs-cycle-configuration-name nil | 305 | (defcustom bs-cycle-configuration-name nil |
| 305 | "*Name of configuration used when cycling through the buffer list. | 306 | "*Name of configuration used when cycling through the buffer list. |
| @@ -311,32 +312,32 @@ Must be a string used in `bs-configurations' for naming a configuration." | |||
| 311 | 312 | ||
| 312 | (defcustom bs-string-show-always "+" | 313 | (defcustom bs-string-show-always "+" |
| 313 | "*String added in column 1 indicating a buffer will always be shown." | 314 | "*String added in column 1 indicating a buffer will always be shown." |
| 314 | :group 'bs-appearance | 315 | :group 'bs-appearence |
| 315 | :type 'string) | 316 | :type 'string) |
| 316 | 317 | ||
| 317 | (defcustom bs-string-show-never "-" | 318 | (defcustom bs-string-show-never "-" |
| 318 | "*String added in column 1 indicating a buffer will never be shown." | 319 | "*String added in column 1 indicating a buffer will never be shown." |
| 319 | :group 'bs-appearance | 320 | :group 'bs-appearence |
| 320 | :type 'string) | 321 | :type 'string) |
| 321 | 322 | ||
| 322 | (defcustom bs-string-current "." | 323 | (defcustom bs-string-current "." |
| 323 | "*String added in column 1 indicating the current buffer." | 324 | "*String added in column 1 indicating the current buffer." |
| 324 | :group 'bs-appearance | 325 | :group 'bs-appearence |
| 325 | :type 'string) | 326 | :type 'string) |
| 326 | 327 | ||
| 327 | (defcustom bs-string-current-marked "#" | 328 | (defcustom bs-string-current-marked "#" |
| 328 | "*String added in column 1 indicating the current buffer when it is marked." | 329 | "*String added in column 1 indicating the current buffer when it is marked." |
| 329 | :group 'bs-appearance | 330 | :group 'bs-appearence |
| 330 | :type 'string) | 331 | :type 'string) |
| 331 | 332 | ||
| 332 | (defcustom bs-string-marked ">" | 333 | (defcustom bs-string-marked ">" |
| 333 | "*String added in column 1 indicating a marked buffer." | 334 | "*String added in column 1 indicating a marked buffer." |
| 334 | :group 'bs-appearance | 335 | :group 'bs-appearence |
| 335 | :type 'string) | 336 | :type 'string) |
| 336 | 337 | ||
| 337 | (defcustom bs-string-show-normally " " | 338 | (defcustom bs-string-show-normally " " |
| 338 | "*String added in column 1 indicating a unmarked buffer." | 339 | "*String added in column 1 indicating a unmarked buffer." |
| 339 | :group 'bs-appearance | 340 | :group 'bs-appearence |
| 340 | :type 'string) | 341 | :type 'string) |
| 341 | 342 | ||
| 342 | (defvar bs--name-entry-length 20 | 343 | (defvar bs--name-entry-length 20 |
| @@ -344,13 +345,13 @@ Must be a string used in `bs-configurations' for naming a configuration." | |||
| 344 | Used internally, only.") | 345 | Used internally, only.") |
| 345 | 346 | ||
| 346 | ;; ---------------------------------------------------------------------- | 347 | ;; ---------------------------------------------------------------------- |
| 347 | ;; Internal globals | 348 | ;; Intern globals |
| 348 | ;; ---------------------------------------------------------------------- | 349 | ;; ---------------------------------------------------------------------- |
| 349 | 350 | ||
| 350 | (defvar bs-buffer-show-mark nil | 351 | (defvar bs-buffer-show-mark nil |
| 351 | "Flag for the current mode for showing this buffer. | 352 | "Flag for the current mode for showing this buffer. |
| 352 | A value of nil means buffer will be shown depending on the current | 353 | A value of nil means buffer will be shown depending on the current on |
| 353 | configuration. | 354 | current configuration. |
| 354 | A value of `never' means to never show the buffer. | 355 | A value of `never' means to never show the buffer. |
| 355 | A value of `always' means to show buffer regardless of the configuration.") | 356 | A value of `always' means to show buffer regardless of the configuration.") |
| 356 | 357 | ||
| @@ -361,6 +362,7 @@ A value of `always' means to show buffer regardless of the configuration.") | |||
| 361 | (make-face 'region) | 362 | (make-face 'region) |
| 362 | (set-face-background 'region "gray75")) | 363 | (set-face-background 'region "gray75")) |
| 363 | 364 | ||
| 365 | |||
| 364 | (defun bs--sort-by-name (b1 b2) | 366 | (defun bs--sort-by-name (b1 b2) |
| 365 | "Compare buffers B1 and B2 by buffer name." | 367 | "Compare buffers B1 and B2 by buffer name." |
| 366 | (string< (buffer-name b1) | 368 | (string< (buffer-name b1) |
| @@ -526,7 +528,7 @@ Used internally, only.") | |||
| 526 | 528 | ||
| 527 | (defun bs-buffer-list (&optional list sort-description) | 529 | (defun bs-buffer-list (&optional list sort-description) |
| 528 | "Return a list of buffers to be shown. | 530 | "Return a list of buffers to be shown. |
| 529 | LIST is a list of buffers to test for appearance in Buffer Selection Menu. | 531 | LIST is a list of buffers to test for appearence in Buffer Selection Menu. |
| 530 | The result list depends on the global variables `bs-dont-show-regexp', | 532 | The result list depends on the global variables `bs-dont-show-regexp', |
| 531 | `bs-must-show-regexp', `bs-dont-show-function', `bs-must-show-function' | 533 | `bs-must-show-regexp', `bs-dont-show-function', `bs-must-show-function' |
| 532 | and `bs-buffer-sort-function'. | 534 | and `bs-buffer-sort-function'. |
| @@ -650,10 +652,10 @@ apply selected configuration. | |||
| 650 | \\[bs-select-next-configuration] -- select and apply next \ | 652 | \\[bs-select-next-configuration] -- select and apply next \ |
| 651 | available Buffer Selection Menu configuration. | 653 | available Buffer Selection Menu configuration. |
| 652 | \\[bs-kill] -- leave Buffer Selection Menu without a selection. | 654 | \\[bs-kill] -- leave Buffer Selection Menu without a selection. |
| 653 | \\[bs-toggle-current-to-show] -- toggle status of appearance. | 655 | \\[bs-toggle-current-to-show] -- toggle status of appearence . |
| 654 | \\[bs-set-current-buffer-to-show-always] -- mark current line's buffer \ | 656 | \\[bs-set-current-buffer-to-show-always] -- mark current line's buffer \ |
| 655 | to show always. | 657 | to show always. |
| 656 | \\[bs-visit-tags-table] -- call `visit-tags-table' on current line's buffer. | 658 | \\[bs-visit-tags-table] -- call `visit-tags-table' on current line'w buffer. |
| 657 | \\[bs-help] -- display this help text." | 659 | \\[bs-help] -- display this help text." |
| 658 | (interactive) | 660 | (interactive) |
| 659 | (kill-all-local-variables) | 661 | (kill-all-local-variables) |
| @@ -715,7 +717,7 @@ Return nil if there is no such buffer." | |||
| 715 | 717 | ||
| 716 | (defun bs--current-buffer () | 718 | (defun bs--current-buffer () |
| 717 | "Return buffer on current line. | 719 | "Return buffer on current line. |
| 718 | Raise an error if not on a buffer line." | 720 | Raise an error if not an a buffer line." |
| 719 | (beginning-of-line) | 721 | (beginning-of-line) |
| 720 | (let ((line (+ (- bs-header-lines-length) | 722 | (let ((line (+ (- bs-header-lines-length) |
| 721 | (count-lines 1 (point))))) | 723 | (count-lines 1 (point))))) |
| @@ -982,7 +984,7 @@ Default is `bs--current-sort-function'." | |||
| 982 | 984 | ||
| 983 | (defun bs-toggle-readonly () | 985 | (defun bs-toggle-readonly () |
| 984 | "Toggle read-only status for buffer on current line. | 986 | "Toggle read-only status for buffer on current line. |
| 985 | Uses function `vc-toggle-read-only'." | 987 | Uses Function `vc-toggle-read-only'." |
| 986 | (interactive) | 988 | (interactive) |
| 987 | (let ((buffer (bs--current-buffer))) | 989 | (let ((buffer (bs--current-buffer))) |
| 988 | (save-excursion | 990 | (save-excursion |
| @@ -1047,7 +1049,7 @@ A value of nil means BUFFER belongs to a file." | |||
| 1047 | (not (buffer-file-name buffer))) | 1049 | (not (buffer-file-name buffer))) |
| 1048 | 1050 | ||
| 1049 | (defun bs-sort-buffer-interns-are-last (b1 b2) | 1051 | (defun bs-sort-buffer-interns-are-last (b1 b2) |
| 1050 | "Function for sorting internal buffers B1 and B2 at the end of all buffers." | 1052 | "Function for sorting intern buffers B1 and B2 at the end of all buffers." |
| 1051 | (string-match "^\\*" (buffer-name b2))) | 1053 | (string-match "^\\*" (buffer-name b2))) |
| 1052 | 1054 | ||
| 1053 | ;; ---------------------------------------------------------------------- | 1055 | ;; ---------------------------------------------------------------------- |
| @@ -1068,7 +1070,7 @@ These variables are `bs-dont-show-regexp', `bs-must-show-regexp', | |||
| 1068 | (defun bs-config--only-files () | 1070 | (defun bs-config--only-files () |
| 1069 | "Define a configuration for showing only buffers visiting a file." | 1071 | "Define a configuration for showing only buffers visiting a file." |
| 1070 | (bs-config-clear) | 1072 | (bs-config-clear) |
| 1071 | (setq ;; I want to see *-buffers at the end | 1073 | (setq;; I want to see *-buffers at the end |
| 1072 | bs-buffer-sort-function 'bs-sort-buffer-interns-are-last | 1074 | bs-buffer-sort-function 'bs-sort-buffer-interns-are-last |
| 1073 | ;; Don't show files who don't belong to a file | 1075 | ;; Don't show files who don't belong to a file |
| 1074 | bs-dont-show-function 'bs-visits-non-file)) | 1076 | bs-dont-show-function 'bs-visits-non-file)) |
| @@ -1076,12 +1078,12 @@ These variables are `bs-dont-show-regexp', `bs-must-show-regexp', | |||
| 1076 | (defun bs-config--files-and-scratch () | 1078 | (defun bs-config--files-and-scratch () |
| 1077 | "Define a configuration for showing buffer *scratch* and file buffers." | 1079 | "Define a configuration for showing buffer *scratch* and file buffers." |
| 1078 | (bs-config-clear) | 1080 | (bs-config-clear) |
| 1079 | (setq ;; I want to see *-buffers at the end | 1081 | (setq;; I want to see *-buffers at the end |
| 1080 | bs-buffer-sort-function 'bs-sort-buffer-interns-are-last | 1082 | bs-buffer-sort-function 'bs-sort-buffer-interns-are-last |
| 1081 | ;; Don't show files who don't belong to a file | 1083 | ;; Don't show files who don't belong to a file |
| 1082 | bs-dont-show-function 'bs-visits-non-file | 1084 | bs-dont-show-function 'bs-visits-non-file |
| 1083 | ;; Show *scratch* buffer. | 1085 | ;; Show *scratch* buffer. |
| 1084 | bs-must-show-regexp "^\\*scratch\\*$")) | 1086 | bs-must-show-regexp "^\\*scratch\\*")) |
| 1085 | 1087 | ||
| 1086 | (defun bs-config--all () | 1088 | (defun bs-config--all () |
| 1087 | "Define a configuration for showing all buffers. | 1089 | "Define a configuration for showing all buffers. |
| @@ -1090,7 +1092,7 @@ Reset all according variables by `bs-config-clear'." | |||
| 1090 | 1092 | ||
| 1091 | (defun bs-config--all-intern-last () | 1093 | (defun bs-config--all-intern-last () |
| 1092 | "Define a configuration for showing all buffers. | 1094 | "Define a configuration for showing all buffers. |
| 1093 | Internal buffers appear at end of all buffers." | 1095 | Intern buffers appear at end of all buffers." |
| 1094 | (bs-config-clear) | 1096 | (bs-config-clear) |
| 1095 | ;; I want to see *-buffers at the end | 1097 | ;; I want to see *-buffers at the end |
| 1096 | (setq bs-buffer-sort-function 'bs-sort-buffer-interns-are-last)) | 1098 | (setq bs-buffer-sort-function 'bs-sort-buffer-interns-are-last)) |
| @@ -1152,7 +1154,7 @@ will be used." | |||
| 1152 | (setq bs-default-configuration bs-current-configuration) | 1154 | (setq bs-default-configuration bs-current-configuration) |
| 1153 | (bs--redisplay t) | 1155 | (bs--redisplay t) |
| 1154 | (bs--set-window-height) | 1156 | (bs--set-window-height) |
| 1155 | (bs-message-without-log "Selected configuration: %s" (car config)))) | 1157 | (bs-message-without-log "Selected config: %s" (car config)))) |
| 1156 | 1158 | ||
| 1157 | (defun bs-show-in-buffer (list) | 1159 | (defun bs-show-in-buffer (list) |
| 1158 | "Display buffer list LIST in buffer *buffer-selection*. | 1160 | "Display buffer list LIST in buffer *buffer-selection*. |
| @@ -1217,7 +1219,7 @@ All arguments ARGS are transfered to function `message'." | |||
| 1217 | (apply 'message args))) | 1219 | (apply 'message args))) |
| 1218 | 1220 | ||
| 1219 | (defvar bs--cycle-list nil | 1221 | (defvar bs--cycle-list nil |
| 1220 | "Current buffer list used for cycling.") | 1222 | "Currentyl buffer list used for cycling.") |
| 1221 | 1223 | ||
| 1222 | ;;;###autoload | 1224 | ;;;###autoload |
| 1223 | (defun bs-cycle-next () | 1225 | (defun bs-cycle-next () |
| @@ -1298,7 +1300,7 @@ ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu. | |||
| 1298 | The result string is one of `bs-string-current', `bs-string-current-marked', | 1300 | The result string is one of `bs-string-current', `bs-string-current-marked', |
| 1299 | `bs-string-marked', `bs-string-show-normally', `bs-string-show-never', or | 1301 | `bs-string-marked', `bs-string-show-normally', `bs-string-show-never', or |
| 1300 | `bs-string-show-always'." | 1302 | `bs-string-show-always'." |
| 1301 | (cond ;; current buffer is the buffer we started buffer selection. | 1303 | (cond;; current buffer is the buffer we started buffer selection. |
| 1302 | ((eq (current-buffer) start-buffer) | 1304 | ((eq (current-buffer) start-buffer) |
| 1303 | (if (memq (current-buffer) bs--marked-buffers) | 1305 | (if (memq (current-buffer) bs--marked-buffers) |
| 1304 | bs-string-current-marked ; buffer is marked | 1306 | bs-string-current-marked ; buffer is marked |
| @@ -1347,6 +1349,7 @@ ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu." | |||
| 1347 | (make-string (- bs--name-entry-length (length name)) ? )) | 1349 | (make-string (- bs--name-entry-length (length name)) ? )) |
| 1348 | name))) | 1350 | name))) |
| 1349 | 1351 | ||
| 1352 | |||
| 1350 | (defun bs--get-mode-name (start-buffer all-buffers) | 1353 | (defun bs--get-mode-name (start-buffer all-buffers) |
| 1351 | "Return the name of mode of current buffer for Buffer Selection Menu. | 1354 | "Return the name of mode of current buffer for Buffer Selection Menu. |
| 1352 | START-BUFFER is the buffer where we started buffer selection. | 1355 | START-BUFFER is the buffer where we started buffer selection. |
| @@ -1367,6 +1370,7 @@ ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu." | |||
| 1367 | (put-text-property 0 (length string) 'mouse-face 'highlight string) | 1370 | (put-text-property 0 (length string) 'mouse-face 'highlight string) |
| 1368 | string)) | 1371 | string)) |
| 1369 | 1372 | ||
| 1373 | |||
| 1370 | (defun bs--insert-one-entry (buffer) | 1374 | (defun bs--insert-one-entry (buffer) |
| 1371 | "Generate one entry for buffer BUFFER in Buffer Selection Menu. | 1375 | "Generate one entry for buffer BUFFER in Buffer Selection Menu. |
| 1372 | It goes over all columns described in `bs-attributes-list' | 1376 | It goes over all columns described in `bs-attributes-list' |
| @@ -1432,7 +1436,7 @@ ALIGN is one of the symbols `left', `middle', or `right'." | |||
| 1432 | ""))) | 1436 | ""))) |
| 1433 | 1437 | ||
| 1434 | (defun bs--show-with-configuration (name &optional arg) | 1438 | (defun bs--show-with-configuration (name &optional arg) |
| 1435 | "Display buffer list of configuration with name NAME. | 1439 | "Display buffer list of configuration with NAME name. |
| 1436 | Set configuration NAME and determine window for Buffer Selection Menu. | 1440 | Set configuration NAME and determine window for Buffer Selection Menu. |
| 1437 | Unless current buffer is buffer *buffer-selection* we have to save | 1441 | Unless current buffer is buffer *buffer-selection* we have to save |
| 1438 | the buffer we started Buffer Selection Menu and the current window | 1442 | the buffer we started Buffer Selection Menu and the current window |
| @@ -1466,7 +1470,7 @@ for buffer selection." | |||
| 1466 | If PREFIX-ARG is nil return `bs-default-configuration'. | 1470 | If PREFIX-ARG is nil return `bs-default-configuration'. |
| 1467 | If PREFIX-ARG is an integer return PREFIX-ARG element of `bs-configurations'. | 1471 | If PREFIX-ARG is an integer return PREFIX-ARG element of `bs-configurations'. |
| 1468 | Otherwise return `bs-alternative-configuration'." | 1472 | Otherwise return `bs-alternative-configuration'." |
| 1469 | (cond ;; usually activation | 1473 | (cond;; usually activation |
| 1470 | ((null prefix-arg) | 1474 | ((null prefix-arg) |
| 1471 | bs-default-configuration) | 1475 | bs-default-configuration) |
| 1472 | ;; call with integer as prefix argument | 1476 | ;; call with integer as prefix argument |