comparison lisp/bs.el @ 78972:3ae0d15a80ab

(bs--get-marked-string, bs--get-modified-string, bs--get-readonly-string, bs--get-size-string, bs--get-name, bs--get-mode-name, bs-mode): Fix typos in docstrings. (bs--format-aux): Doc fix.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 05 Oct 2007 09:48:35 +0000
parents fad130192ad9
children 467771c10c11
comparison
equal deleted inserted replaced
78971:d775ea2ff9d8 78972:3ae0d15a80ab
617 (defun bs-mode () 617 (defun bs-mode ()
618 "Major mode for editing a subset of Emacs' buffers. 618 "Major mode for editing a subset of Emacs' buffers.
619 \\<bs-mode-map> 619 \\<bs-mode-map>
620 Aside from two header lines each line describes one buffer. 620 Aside from two header lines each line describes one buffer.
621 Move to a line representing the buffer you want to edit and select 621 Move to a line representing the buffer you want to edit and select
622 buffer by \\[bs-select] or SPC. Abort buffer list with \\[bs-kill]. 622 buffer by \\[bs-select] or SPC. Abort buffer list with \\[bs-kill].
623 There are many key commands similar to `Buffer-menu-mode' for 623 There are many key commands similar to `Buffer-menu-mode' for
624 manipulating the buffer list and buffers. 624 manipulating the buffer list and buffers.
625 For faster navigation each digit key is a digit argument. 625 For faster navigation each digit key is a digit argument.
626 626
627 \\[bs-select] or SPACE -- select current line's buffer and other marked buffers. 627 \\[bs-select] or SPACE -- select current line's buffer and other marked buffers.
1272 (t (apply fun args)))) 1272 (t (apply fun args))))
1273 1273
1274 (defun bs--get-marked-string (start-buffer all-buffers) 1274 (defun bs--get-marked-string (start-buffer all-buffers)
1275 "Return a string which describes whether current buffer is marked. 1275 "Return a string which describes whether current buffer is marked.
1276 START-BUFFER is the buffer where we started buffer selection. 1276 START-BUFFER is the buffer where we started buffer selection.
1277 ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu. 1277 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu.
1278 The result string is one of `bs-string-current', `bs-string-current-marked', 1278 The result string is one of `bs-string-current', `bs-string-current-marked',
1279 `bs-string-marked', `bs-string-show-normally', `bs-string-show-never', or 1279 `bs-string-marked', `bs-string-show-normally', `bs-string-show-never', or
1280 `bs-string-show-always'." 1280 `bs-string-show-always'."
1281 (cond ;; current buffer is the buffer we started buffer selection. 1281 (cond ;; current buffer is the buffer we started buffer selection.
1282 ((eq (current-buffer) start-buffer) 1282 ((eq (current-buffer) start-buffer)
1297 bs-string-show-always))) 1297 bs-string-show-always)))
1298 1298
1299 (defun bs--get-modified-string (start-buffer all-buffers) 1299 (defun bs--get-modified-string (start-buffer all-buffers)
1300 "Return a string which describes whether current buffer is modified. 1300 "Return a string which describes whether current buffer is modified.
1301 START-BUFFER is the buffer where we started buffer selection. 1301 START-BUFFER is the buffer where we started buffer selection.
1302 ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu." 1302 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
1303 (if (buffer-modified-p) "*" " ")) 1303 (if (buffer-modified-p) "*" " "))
1304 1304
1305 (defun bs--get-readonly-string (start-buffer all-buffers) 1305 (defun bs--get-readonly-string (start-buffer all-buffers)
1306 "Return a string which describes whether current buffer is read only. 1306 "Return a string which describes whether current buffer is read only.
1307 START-BUFFER is the buffer where we started buffer selection. 1307 START-BUFFER is the buffer where we started buffer selection.
1308 ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu." 1308 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
1309 (if buffer-read-only "%" " ")) 1309 (if buffer-read-only "%" " "))
1310 1310
1311 (defun bs--get-size-string (start-buffer all-buffers) 1311 (defun bs--get-size-string (start-buffer all-buffers)
1312 "Return a string which describes the size of current buffer. 1312 "Return a string which describes the size of current buffer.
1313 START-BUFFER is the buffer where we started buffer selection. 1313 START-BUFFER is the buffer where we started buffer selection.
1314 ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu." 1314 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
1315 (int-to-string (buffer-size))) 1315 (int-to-string (buffer-size)))
1316 1316
1317 (defun bs--get-name (start-buffer all-buffers) 1317 (defun bs--get-name (start-buffer all-buffers)
1318 "Return name of current buffer for Buffer Selection Menu. 1318 "Return name of current buffer for Buffer Selection Menu.
1319 The name of current buffer gets additional text properties 1319 The name of current buffer gets additional text properties
1320 for mouse highlighting. 1320 for mouse highlighting.
1321 START-BUFFER is the buffer where we started buffer selection. 1321 START-BUFFER is the buffer where we started buffer selection.
1322 ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu." 1322 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
1323 (propertize (buffer-name) 1323 (propertize (buffer-name)
1324 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame" 1324 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame"
1325 'mouse-face 'highlight)) 1325 'mouse-face 'highlight))
1326 1326
1327 (defun bs--get-mode-name (start-buffer all-buffers) 1327 (defun bs--get-mode-name (start-buffer all-buffers)
1328 "Return the name of mode of current buffer for Buffer Selection Menu. 1328 "Return the name of mode of current buffer for Buffer Selection Menu.
1329 START-BUFFER is the buffer where we started buffer selection. 1329 START-BUFFER is the buffer where we started buffer selection.
1330 ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu." 1330 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
1331 mode-name) 1331 mode-name)
1332 1332
1333 (defun bs--get-file-name (start-buffer all-buffers) 1333 (defun bs--get-file-name (start-buffer all-buffers)
1334 "Return string for column 'File' in Buffer Selection Menu. 1334 "Return string for column 'File' in Buffer Selection Menu.
1335 This is the variable `buffer-file-name' of current buffer. 1335 This is the variable `buffer-file-name' of current buffer.
1370 (setq columns (cdr columns)))) 1370 (setq columns (cdr columns))))
1371 (insert string) 1371 (insert string)
1372 string)) 1372 string))
1373 1373
1374 (defun bs--format-aux (string align len) 1374 (defun bs--format-aux (string align len)
1375 "Generate a string with STRING with alignment ALIGN and length LEN. 1375 "Pad STRING to length LEN with alignment ALIGN.
1376 ALIGN is one of the symbols `left', `middle', or `right'." 1376 ALIGN is one of the symbols `left', `middle', or `right'."
1377 (let* ((width (length string)) 1377 (let* ((width (length string))
1378 (len (max len width))) 1378 (len (max len width)))
1379 (format (format "%%%s%ds" (if (eq align 'right) "" "-") len) 1379 (format (format "%%%s%ds" (if (eq align 'right) "" "-") len)
1380 (if (eq align 'middle) 1380 (if (eq align 'middle)