Mercurial > emacs
comparison lisp/bs.el @ 78954:fad130192ad9
(bs-string-show-normally, bs-sort-functions, bs--get-file-name):
Fix typos in docstrings.
(bs-buffer-sort-function, bs-mouse-select-other-frame, bs-visits-non-file,
bs-sort-buffer-interns-are-last, bs-show): Doc fixes.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Wed, 03 Oct 2007 16:43:10 +0000 |
parents | e1da8e0b5ae2 |
children | 3ae0d15a80ab |
comparison
equal
deleted
inserted
replaced
78953:a7ae1e6c7680 | 78954:fad130192ad9 |
---|---|
240 "Function for specifying buffers which must be shown. | 240 "Function for specifying buffers which must be shown. |
241 The function gets one argument - the buffer to test.") | 241 The function gets one argument - the buffer to test.") |
242 | 242 |
243 (defvar bs-buffer-sort-function nil | 243 (defvar bs-buffer-sort-function nil |
244 "Sort function to sort the buffers that appear in Buffer Selection Menu. | 244 "Sort function to sort the buffers that appear in Buffer Selection Menu. |
245 The function gets two arguments - the buffers to compare.") | 245 The function gets two arguments - the buffers to compare. |
246 It must return non-nil if the first buffer should sort before the second.") | |
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. |
249 The column for buffer names has dynamic width. The width depends on | 250 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 |
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-appearance |
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 an unmarked buffer." |
339 :group 'bs-appearance | 340 :group 'bs-appearance |
340 :type 'string) | 341 :type 'string) |
341 | 342 |
342 (defvar bs--name-entry-length 20 | 343 (defvar bs--name-entry-length 20 |
343 "Maximum length of all displayed buffer names. | 344 "Maximum length of all displayed buffer names. |
389 ("by mode" bs--sort-by-mode "Mode" region) | 390 ("by mode" bs--sort-by-mode "Mode" region) |
390 ("by filename" bs--sort-by-filename "File" region) | 391 ("by filename" bs--sort-by-filename "File" region) |
391 ("by nothing" nil nil nil)) | 392 ("by nothing" nil nil nil)) |
392 "*List of all possible sorting aspects for Buffer Selection Menu. | 393 "*List of all possible sorting aspects for Buffer Selection Menu. |
393 You can add a new entry with a call to `bs-define-sort-function'. | 394 You can add a new entry with a call to `bs-define-sort-function'. |
394 Each element is a list of four elements (NAME FUNCTION REGEXP-FOR-SORTING FACE) | 395 Each element is a list of four elements (NAME FUNCTION REGEXP-FOR-SORTING FACE). |
395 NAME specifies the sort order defined by function FUNCTION. | 396 NAME specifies the sort order defined by function FUNCTION. |
396 FUNCTION nil means don't sort the buffer list. Otherwise the functions | 397 FUNCTION nil means don't sort the buffer list. Otherwise the function |
397 must have two parameters - the buffers to compare. | 398 must have two parameters - the buffers to compare. |
398 REGEXP-FOR-SORTING is a regular expression which describes the | 399 REGEXP-FOR-SORTING is a regular expression which describes the |
399 column title to highlight. | 400 column title to highlight. |
400 FACE is a face used to fontify the sorted column title. A value of nil means | 401 FACE is a face used to fontify the sorted column title. A value of nil means |
401 don't highlight." | 402 don't highlight." |
775 (switch-to-buffer-other-frame buffer))) | 776 (switch-to-buffer-other-frame buffer))) |
776 | 777 |
777 (defun bs-mouse-select-other-frame (event) | 778 (defun bs-mouse-select-other-frame (event) |
778 "Select selected line's buffer in new created frame. | 779 "Select selected line's buffer in new created frame. |
779 Leave Buffer Selection Menu. | 780 Leave Buffer Selection Menu. |
780 EVENT: a mouse click EVENT." | 781 EVENT: a mouse click event." |
781 (interactive "e") | 782 (interactive "e") |
782 (mouse-set-point event) | 783 (mouse-set-point event) |
783 (bs-select-other-frame)) | 784 (bs-select-other-frame)) |
784 | 785 |
785 (defun bs-mouse-select (event) | 786 (defun bs-mouse-select (event) |
1017 (if (eq (line-end-position) (point-max)) | 1018 (if (eq (line-end-position) (point-max)) |
1018 (goto-line (1+ bs-header-lines-length)) | 1019 (goto-line (1+ bs-header-lines-length)) |
1019 (forward-line 1))) | 1020 (forward-line 1))) |
1020 | 1021 |
1021 (defun bs-visits-non-file (buffer) | 1022 (defun bs-visits-non-file (buffer) |
1022 "Return t or nil whether BUFFER visits no file. | 1023 "Return whether BUFFER visits no file. |
1023 A value of t means BUFFER belongs to no file. | 1024 A value of t means BUFFER belongs to no file. |
1024 A value of nil means BUFFER belongs to a file." | 1025 A value of nil means BUFFER belongs to a file." |
1025 (not (buffer-file-name buffer))) | 1026 (not (buffer-file-name buffer))) |
1026 | 1027 |
1027 (defun bs-sort-buffer-interns-are-last (b1 b2) | 1028 (defun bs-sort-buffer-interns-are-last (b1 b2) |
1028 "Function for sorting internal buffers B1 and B2 at the end of all buffers." | 1029 "Function for sorting internal buffers at the end of all buffers." |
1029 (string-match "^\\*" (buffer-name b2))) | 1030 (string-match "^\\*" (buffer-name b2))) |
1030 | 1031 |
1031 ;; ---------------------------------------------------------------------- | 1032 ;; ---------------------------------------------------------------------- |
1032 ;; Configurations: | 1033 ;; Configurations: |
1033 ;; ---------------------------------------------------------------------- | 1034 ;; ---------------------------------------------------------------------- |
1333 "Return string for column 'File' in Buffer Selection Menu. | 1334 "Return string for column 'File' in Buffer Selection Menu. |
1334 This is the variable `buffer-file-name' of current buffer. | 1335 This is the variable `buffer-file-name' of current buffer. |
1335 If current mode is `dired-mode' or `shell-mode' it returns the | 1336 If current mode is `dired-mode' or `shell-mode' it returns the |
1336 default directory. | 1337 default directory. |
1337 START-BUFFER is the buffer where we started buffer selection. | 1338 START-BUFFER is the buffer where we started buffer selection. |
1338 ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu." | 1339 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." |
1339 (propertize (if (member major-mode '(shell-mode dired-mode)) | 1340 (propertize (if (member major-mode '(shell-mode dired-mode)) |
1340 default-directory | 1341 default-directory |
1341 (or buffer-file-name "")) | 1342 (or buffer-file-name "")) |
1342 'mouse-face 'highlight | 1343 'mouse-face 'highlight |
1343 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame")) | 1344 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame")) |
1467 ;;;###autoload | 1468 ;;;###autoload |
1468 (defun bs-show (arg) | 1469 (defun bs-show (arg) |
1469 "Make a menu of buffers so you can manipulate buffers or the buffer list. | 1470 "Make a menu of buffers so you can manipulate buffers or the buffer list. |
1470 \\<bs-mode-map> | 1471 \\<bs-mode-map> |
1471 There are many key commands similar to `Buffer-menu-mode' for | 1472 There are many key commands similar to `Buffer-menu-mode' for |
1472 manipulating buffer list and buffers itself. | 1473 manipulating the buffer list and the buffers themselves. |
1473 User can move with [up] or [down], select a buffer | 1474 User can move with [up] or [down], select a buffer |
1474 by \\[bs-select] or [SPC]\n | 1475 by \\[bs-select] or [SPC]\n |
1475 Type \\[bs-kill] to leave Buffer Selection Menu without a selection. | 1476 Type \\[bs-kill] to leave Buffer Selection Menu without a selection. |
1476 Type \\[bs-help] after invocation to get help on commands available. | 1477 Type \\[bs-help] after invocation to get help on commands available. |
1477 With prefix argument ARG show a different buffer list. Function | 1478 With prefix argument ARG show a different buffer list. Function |