[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/bs.el,v
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/bs.el,v |
Date: |
Tue, 09 Oct 2007 08:53:02 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Miles Bader <miles> 07/10/09 08:52:58
Index: lisp/bs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/bs.el,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- lisp/bs.el 26 Jul 2007 05:26:18 -0000 1.34
+++ lisp/bs.el 9 Oct 2007 08:52:45 -0000 1.35
@@ -131,8 +131,6 @@
;;; Code:
-(defvar font-lock-verbose)
-
;; ----------------------------------------------------------------------
;; Globals for customization
;; ----------------------------------------------------------------------
@@ -244,7 +242,8 @@
(defvar bs-buffer-sort-function nil
"Sort function to sort the buffers that appear in Buffer Selection Menu.
-The function gets two arguments - the buffers to compare.")
+The function gets two arguments - the buffers to compare.
+It must return non-nil if the first buffer should sort before the second.")
(defcustom bs-maximal-buffer-name-column 45
"*Maximum column width for buffer names.
@@ -337,7 +336,7 @@
:type 'string)
(defcustom bs-string-show-normally " "
- "*String added in column 1 indicating a unmarked buffer."
+ "*String added in column 1 indicating an unmarked buffer."
:group 'bs-appearance
:type 'string)
@@ -393,9 +392,9 @@
("by nothing" nil nil nil))
"*List of all possible sorting aspects for Buffer Selection Menu.
You can add a new entry with a call to `bs-define-sort-function'.
-Each element is a list of four elements (NAME FUNCTION REGEXP-FOR-SORTING FACE)
+Each element is a list of four elements (NAME FUNCTION REGEXP-FOR-SORTING
FACE).
NAME specifies the sort order defined by function FUNCTION.
-FUNCTION nil means don't sort the buffer list. Otherwise the functions
+FUNCTION nil means don't sort the buffer list. Otherwise the function
must have two parameters - the buffers to compare.
REGEXP-FOR-SORTING is a regular expression which describes the
column title to highlight.
@@ -653,11 +652,14 @@
(use-local-map bs-mode-map)
(make-local-variable 'font-lock-defaults)
(make-local-variable 'font-lock-verbose)
+ (make-local-variable 'font-lock-global-modes)
(buffer-disable-undo)
(setq major-mode 'bs-mode
mode-name "Buffer-Selection-Menu"
buffer-read-only t
truncate-lines t
+ show-trailing-whitespace nil
+ font-lock-global-modes '(not bs-mode)
font-lock-defaults '(bs-mode-font-lock-keywords t)
font-lock-verbose nil)
(run-mode-hooks 'bs-mode-hook))
@@ -669,7 +671,7 @@
(setq bs--window-config-coming-from nil)))
(defun bs-kill ()
- "Let buffer disappear and reset window-configuration."
+ "Let buffer disappear and reset window configuration."
(interactive)
(bury-buffer (current-buffer))
(bs--restore-window-config))
@@ -778,7 +780,7 @@
(defun bs-mouse-select-other-frame (event)
"Select selected line's buffer in new created frame.
Leave Buffer Selection Menu.
-EVENT: a mouse click EVENT."
+EVENT: a mouse click event."
(interactive "e")
(mouse-set-point event)
(bs-select-other-frame))
@@ -929,7 +931,7 @@
(bs-up 1))))
(defun bs-show-sorted ()
- "Show buffer list sorted by buffer name."
+ "Show buffer list sorted by next sort aspect."
(interactive)
(setq bs--current-sort-function
(bs-next-config-aux (car bs--current-sort-function)
@@ -1020,13 +1022,13 @@
(forward-line 1)))
(defun bs-visits-non-file (buffer)
- "Return t or nil whether BUFFER visits no file.
+ "Return whether BUFFER visits no file.
A value of t means BUFFER belongs to no file.
A value of nil means BUFFER belongs to a file."
(not (buffer-file-name buffer)))
(defun bs-sort-buffer-interns-are-last (b1 b2)
- "Function for sorting internal buffers B1 and B2 at the end of all buffers."
+ "Function for sorting internal buffers at the end of all buffers."
(string-match "^\\*" (buffer-name b2)))
;; ----------------------------------------------------------------------
@@ -1034,7 +1036,7 @@
;; ----------------------------------------------------------------------
(defun bs-config-clear ()
- "*Reset all variables which specify a configuration.
+ "Reset all variables which specify a configuration.
These variables are `bs-dont-show-regexp', `bs-must-show-regexp',
`bs-dont-show-function', `bs-must-show-function' and
`bs-buffer-sort-function'."
@@ -1274,7 +1276,7 @@
(defun bs--get-marked-string (start-buffer all-buffers)
"Return a string which describes whether current buffer is marked.
START-BUFFER is the buffer where we started buffer selection.
-ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu.
+ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu.
The result string is one of `bs-string-current', `bs-string-current-marked',
`bs-string-marked', `bs-string-show-normally', `bs-string-show-never', or
`bs-string-show-always'."
@@ -1299,19 +1301,19 @@
(defun bs--get-modified-string (start-buffer all-buffers)
"Return a string which describes whether current buffer is modified.
START-BUFFER is the buffer where we started buffer selection.
-ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu."
+ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
(if (buffer-modified-p) "*" " "))
(defun bs--get-readonly-string (start-buffer all-buffers)
"Return a string which describes whether current buffer is read only.
START-BUFFER is the buffer where we started buffer selection.
-ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu."
+ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
(if buffer-read-only "%" " "))
(defun bs--get-size-string (start-buffer all-buffers)
"Return a string which describes the size of current buffer.
START-BUFFER is the buffer where we started buffer selection.
-ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu."
+ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
(int-to-string (buffer-size)))
(defun bs--get-name (start-buffer all-buffers)
@@ -1319,7 +1321,7 @@
The name of current buffer gets additional text properties
for mouse highlighting.
START-BUFFER is the buffer where we started buffer selection.
-ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu."
+ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
(propertize (buffer-name)
'help-echo "mouse-2: select this buffer, mouse-3: select in
other frame"
'mouse-face 'highlight))
@@ -1327,7 +1329,7 @@
(defun bs--get-mode-name (start-buffer all-buffers)
"Return the name of mode of current buffer for Buffer Selection Menu.
START-BUFFER is the buffer where we started buffer selection.
-ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu."
+ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
mode-name)
(defun bs--get-file-name (start-buffer all-buffers)
@@ -1336,7 +1338,7 @@
If current mode is `dired-mode' or `shell-mode' it returns the
default directory.
START-BUFFER is the buffer where we started buffer selection.
-ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu."
+ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
(propertize (if (member major-mode '(shell-mode dired-mode))
default-directory
(or buffer-file-name ""))
@@ -1372,7 +1374,7 @@
string))
(defun bs--format-aux (string align len)
- "Generate a string with STRING with alignment ALIGN and length LEN.
+ "Pad STRING to length LEN with alignment ALIGN.
ALIGN is one of the symbols `left', `middle', or `right'."
(let* ((width (length string))
(len (max len width)))
@@ -1383,9 +1385,8 @@
(defun bs--show-header ()
"Insert header for Buffer Selection Menu in current buffer."
- (mapcar '(lambda (string)
- (insert string "\n"))
- (bs--create-header)))
+ (dolist (string (bs--create-header))
+ (insert string "\n")))
(defun bs--get-name-length ()
"Return value of `bs--name-entry-length'."
@@ -1471,7 +1472,7 @@
"Make a menu of buffers so you can manipulate buffers or the buffer list.
\\<bs-mode-map>
There are many key commands similar to `Buffer-menu-mode' for
-manipulating buffer list and buffers itself.
+manipulating the buffer list and the buffers themselves.
User can move with [up] or [down], select a buffer
by \\[bs-select] or [SPC]\n
Type \\[bs-kill] to leave Buffer Selection Menu without a selection.
- [Emacs-diffs] Changes to emacs/lisp/bs.el,v,
Miles Bader <=
- [Emacs-diffs] Changes to emacs/lisp/bs.el,v, Juanma Barranquero, 2007/10/11
- [Emacs-diffs] Changes to emacs/lisp/bs.el,v, Juanma Barranquero, 2007/10/16
- [Emacs-diffs] Changes to emacs/lisp/bs.el,v, Miles Bader, 2007/10/19
- [Emacs-diffs] Changes to emacs/lisp/bs.el,v, Miles Bader, 2007/10/27