;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:20:33 2007 ;;; from file /home/cyd/emacs/lisp/bs.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`bs.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301\302\303\304\305\306\307\306\310\311\312& \210\300\313\302\314\311\301%\207" [custom-declare-group bs nil "Buffer Selection: Maintaining buffers by buffer menu." :version "21.1" :link (emacs-commentary-link "bs") (url-link "http://www.geekware.de/software/emacs") :group convenience bs-appearance "Buffer Selection appearance: Appearance of bs buffer menu."] 12) #@907 *List specifying the layout of a Buffer Selection Menu buffer. Each entry specifies a column and is a list of the form of: (HEADER MINIMUM-LENGTH MAXIMUM-LENGTH ALIGNMENT FUN-OR-STRING) HEADER : String for header for first line or a function which calculates column title. MINIMUM-LENGTH : Minimum width of column (number or name of function). The function must return a positive integer. MAXIMUM-LENGTH : Maximum width of column (number or name of function) (currently ignored). ALIGNMENT : Alignment of column (`left', `right', `middle'). FUN-OR-STRING : Name of a function for calculating the value or a string for a constant value. The function gets as parameter the buffer where we have started buffer selection and the list of all buffers to show. The function must return a string representing the column's value. (custom-declare-variable 'bs-attributes-list ''(("" 1 1 left bs--get-marked-string) ("M" 1 1 left bs--get-modified-string) ("R" 2 2 left bs--get-readonly-string) ("Buffer" bs--get-name-length 10 left bs--get-name) ("" 1 1 left " ") ("Size" 8 8 right bs--get-size-string) ("" 1 1 left " ") ("Mode" 12 12 right bs--get-mode-name) ("" 2 2 left " ") ("File" 12 12 left bs--get-file-name) ("" 2 2 left " ")) '(#$ . -935) :group 'bs-appearance :type '(repeat sexp)) #@76 Return a regexp matching the first line of a Buffer Selection Menu buffer. (defalias 'bs--make-header-match-string #[nil "\303 \203\n @@\304Q A\211\204\n\305P*\207" [bs-attributes-list ele res "^\\(" " *" "$\\)"] 4 (#$ . 2309)]) #@58 Default font lock expressions for Buffer Selection Menu. (defvar bs-mode-font-lock-keywords (byte-code "\300 \301\302E\303\304\305\306!\203\306\202\307E\310\311F\207" [bs--make-header-match-string (1 font-lock-type-face append) (1 'bold append) "^\\(.*\\*.*\\*.*\\)$" 1 facep font-lock-constant-face font-lock-comment-face ("^..\\(.*Dired by .*\\)$" 1 font-lock-function-name-face) ("^.\\(\\*\\) +[^\\*]" 1 font-lock-comment-face)] 5) (#$ . 2553)) #@50 *Maximal window height of Buffer Selection Menu. (custom-declare-variable 'bs-max-window-height '20 '(#$ . -3011) :group 'bs-appearance :type 'integer) #@151 Regular expression specifying which buffers not to show. A buffer whose name matches this regular expression will not be included in the buffer list. (defvar bs-dont-show-regexp nil (#$ . 3170)) #@355 Regular expression for specifying buffers which must be shown. A buffer whose name matches this regular expression will be included in the buffer list. Note that this variable is temporary: if the configuration is changed it is reset to nil. Use `bs-must-always-show-regexp' to specify buffers that must always be shown regardless of the configuration. (defvar bs-must-show-regexp nil (#$ . 3372)) #@188 *Regular expression for specifying buffers to show always. A buffer whose name matches this regular expression will be shown regardless of current configuration of Buffer Selection Menu. (custom-declare-variable 'bs-must-always-show-regexp 'nil '(#$ . -3778) :group 'bs :type '(choice (const :tag "Nothing at all" nil) regexp)) #@199 Function for specifying buffers not to show. The function gets one argument - the buffer to test. The function must return a value different from nil to ignore the buffer in Buffer Selection Menu. (defvar bs-dont-show-function nil (#$ . 4113)) #@107 Function for specifying buffers which must be shown. The function gets one argument - the buffer to test. (defvar bs-must-show-function nil (#$ . 4365)) #@131 Sort function to sort the buffers that appear in Buffer Selection Menu. The function gets two arguments - the buffers to compare. (defvar bs-buffer-sort-function nil (#$ . 4525)) #@274 *Maximum column width for buffer names. The column for buffer names has dynamic width. The width depends on maximal and minimal length of names of buffers to show. The maximal width is bounded by `bs-maximal-buffer-name-column'. See also `bs-minimal-buffer-name-column'. (custom-declare-variable 'bs-maximal-buffer-name-column '45 '(#$ . -4711) :group 'bs-appearance :type 'integer) #@274 *Minimum column width for buffer names. The column for buffer names has dynamic width. The width depends on maximal and minimal length of names of buffers to show. The minimal width is bounded by `bs-minimal-buffer-name-column'. See also `bs-maximal-buffer-name-column'. (custom-declare-variable 'bs-minimal-buffer-name-column '15 '(#$ . -5103) :group 'bs-appearance :type 'integer) #@55 Number of lines for headers in Buffer Selection Menu. (defconst bs-header-lines-length 2 (#$ . 5494)) #@564 *List of all configurations you can use in the Buffer Selection Menu. A configuration describes which buffers appear in Buffer Selection Menu and also the order of buffers. A configuration is a list with six elements. The first element is a string and describes the configuration. The following five elements represent the values for Buffer Selection Menu configuration variables `bs-must-show-regexp', `bs-must-show-function', `bs-dont-show-regexp', `bs-dont-show-function' and `bs-buffer-sort-function'. By setting these variables you define a configuration. (custom-declare-variable 'bs-configurations ''(("all" nil nil nil nil nil) ("files" nil nil nil bs-visits-non-file bs-sort-buffer-interns-are-last) ("files-and-scratch" "^\\*scratch\\*$" nil nil bs-visits-non-file bs-sort-buffer-interns-are-last) ("all-intern-last" nil nil nil nil bs-sort-buffer-interns-are-last)) '(#$ . -5603) :group 'bs-appearance :type '(repeat sexp)) #@214 *Name of default configuration used by the Buffer Selection Menu. \ Will be changed using key \[bs-select-next-configuration]. Must be a string used in `bs-configurations' for naming a configuration. (custom-declare-variable 'bs-default-configuration '"files" '(#$ . -6547) :group 'bs :type 'string) #@167 *Name of configuration used when calling `bs-show' with \[universal-argument] as prefix key. Must be a string used in `bs-configurations' for naming a configuration. (custom-declare-variable 'bs-alternative-configuration '"all" '(#$ . -6867) :group 'bs :type 'string) #@105 Name of current configuration. Must be a string used in `bs-configurations' for naming a configuration. (defvar bs-current-configuration bs-default-configuration (#$ . 7142)) #@218 *Name of configuration used when cycling through the buffer list. A value of nil means to use current configuration `bs-default-configuration'. Must be a string used in `bs-configurations' for naming a configuration. (custom-declare-variable 'bs-cycle-configuration-name 'nil '(#$ . -7324) :group 'bs :type '(choice (const :tag "like current configuration" nil) string)) #@69 *String added in column 1 indicating a buffer will always be shown. (custom-declare-variable 'bs-string-show-always '"+" '(#$ . -7701) :group 'bs-appearance :type 'string) #@68 *String added in column 1 indicating a buffer will never be shown. (custom-declare-variable 'bs-string-show-never '"-" '(#$ . -7879) :group 'bs-appearance :type 'string) #@58 *String added in column 1 indicating the current buffer. (custom-declare-variable 'bs-string-current '"." '(#$ . -8055) :group 'bs-appearance :type 'string) #@76 *String added in column 1 indicating the current buffer when it is marked. (custom-declare-variable 'bs-string-current-marked '"#" '(#$ . -8218) :group 'bs-appearance :type 'string) #@55 *String added in column 1 indicating a marked buffer. (custom-declare-variable 'bs-string-marked '">" '(#$ . -8406) :group 'bs-appearance :type 'string) #@57 *String added in column 1 indicating a unmarked buffer. (custom-declare-variable 'bs-string-show-normally '" " '(#$ . -8565) :group 'bs-appearance :type 'string) #@70 Maximum length of all displayed buffer names. Used internally, only. (defvar bs--name-entry-length 20 (#$ . 8733)) #@259 Flag for the current mode for showing this buffer. A value of nil means buffer will be shown depending on the current configuration. A value of `never' means to never show the buffer. A value of `always' means to show buffer regardless of the configuration. (defvar bs-buffer-show-mark nil (#$ . 8855)) (byte-code "\300\301!\210\302\303!\204\304\303!\210\305\303\306\"\210\300\207" [make-variable-buffer-local bs-buffer-show-mark facep region make-face set-face-background "gray75"] 3) #@43 Compare buffers B1 and B2 by buffer name. (defalias 'bs--sort-by-name #[(b1 b2) "\302!\302 !\231\207" [b1 b2 buffer-name] 3 (#$ . 9349)]) #@41 Compare buffers B1 and B2 by file name. (defalias 'bs--sort-by-filename #[(b1 b2) "\302!\206\303\302 !\206\303\231\207" [b1 b2 buffer-file-name ""] 3 (#$ . 9494)]) #@41 Compare buffers B1 and B2 by mode name. (defalias 'bs--sort-by-mode #[(b1 b2) "\212q\210\303\304 \"\nq\210\303\304 \"\231)\207" [b1 mode-name b2 format "%s"] 4 (#$ . 9669)]) #@43 Compare buffers B1 and B2 by buffer size. (defalias 'bs--sort-by-size #[(b1 b2) "\212q\210\302 q\210\302 W)\207" [b1 b2 buffer-size] 2 (#$ . 9850)]) #@580 *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) NAME specifies the sort order defined by function FUNCTION. FUNCTION nil means don't sort the buffer list. Otherwise the functions must have two parameters - the buffers to compare. REGEXP-FOR-SORTING is a regular expression which describes the column title to highlight. FACE is a face used to fontify the sorted column title. A value of nil means don't highlight. (custom-declare-variable 'bs-sort-functions ''(("by name" bs--sort-by-name "Buffer" region) ("by size" bs--sort-by-size "Size" region) ("by mode" bs--sort-by-mode "Mode" region) ("by filename" bs--sort-by-filename "File" region) ("by nothing" nil nil nil)) '(#$ . -10008) :group 'bs :type '(repeat sexp)) #@509 Define a new function for buffer sorting in Buffer Selection Menu. NAME specifies the sort order defined by function FUN. A value of nil for FUN means don't sort the buffer list. Otherwise the functions must have two parameters - the buffers to compare. REGEXP-FOR-SORTING is a regular expression which describes the column title to highlight. FACE is a face used to fontify the sorted column title. A value of nil means don't highlight. The new sort aspect will be inserted into list `bs-sort-functions'. (defalias 'bs-define-sort-function #[(name fun &optional regexp-for-sorting face) "\306 \"\211\203\n \f E\241\202 \f F B\211)\207" [name bs-sort-functions tupel fun regexp-for-sorting face assoc] 5 (#$ . 10899)]) #@109 Description of the current function for sorting the buffer list. This is an element of `bs-sort-functions'. (defvar bs--current-sort-function nil (#$ . 11635)) #@171 *Name of default sort behavior. Must be "by nothing" or a string used in `bs-sort-functions' for naming a sort behavior. Default is "by nothing" which means no sorting. (custom-declare-variable 'bs-default-sort-name '"by nothing" '(#$ . -11802) :group 'bs :type 'string :set #[(var-name value) " L\210\304 \n\"\211\207" [var-name value bs-sort-functions bs--current-sort-function assoc] 3]) #@73 The buffer in which the user started the current Buffer Selection Menu. (defvar bs--buffer-coming-from nil (#$ . 12202)) #@191 Flag whether showing all buffers regardless of current configuration. Non-nil means to show all buffers. Otherwise show buffers defined by current configuration `bs-current-configuration'. (defvar bs--show-all nil (#$ . 12330)) #@61 Window configuration before starting Buffer Selection Menu. (defvar bs--window-config-coming-from nil (#$ . 12565)) (make-variable-frame-local 'bs--window-config-coming-from) #@155 Regular expression specifying which buffers never to show. A buffer whose name matches this regular expression will never be included in the buffer list. (defvar bs--intern-show-never "^ \\|\\*buffer-selection\\*" (#$ . 12747)) #@72 List of buffers shown in Buffer Selection Menu. Used internally, only. (defvar bs-current-list nil (#$ . 12981)) #@52 Currently marked buffers in Buffer Selection Menu. (defvar bs--marked-buffers nil (#$ . 13100)) #@22 Keymap of `bs-mode'. (defvar bs-mode-map (byte-code "\302 \303\304\305#\210\303\306\305#\210\303\307\310#\210\303\311\312#\210\303\313\314#\210\303\315\314#\210\303\316\317#\210\320\211\321X\203D\303\322 !\323#\210 T\211\2020)\303\324\325#\210\303\326\325#\210\303\327\330#\210\303\331\332#\210\303\333\334#\210\303\335\334#\210\303\336\337#\210\303\340\341#\210\303\342\337#\210\303\343\341#\210\303\344\305#\210\303\345\346#\210\303\347\350#\210\303\351\352#\210\303\353\354#\210\303\355\356#\210\303\357\360#\210\303\361\356#\210\303\362\363#\210\303\364\365#\210\303\366\367#\210\303\370\371#\210\303\372\371#\210\303\373\374#\210\303\375\374#\210\303\376\377#\210\303\201@\201A#\210\303\201B\201C#\210\303\201D\201E#\210\303\201F\201G#\210\303\201H\201I#\210\303\201J\201K#\210\303\201L\201M#\210\303\201N\201O#\210\303\201P\201Q#\210)\207" [map key make-sparse-keymap define-key " " bs-select "f" "v" bs-view "!" bs-select-in-one-window [mouse-2] bs-mouse-select [button2] "F" bs-select-other-frame 49 57 char-to-string digit-argument "-" negative-argument "-" "o" bs-select-other-window "" bs-tmp-select-other-window [mouse-3] bs-mouse-select-other-frame [button3] [up] bs-up "n" bs-down "p" [down] " " "b" bs-bury-buffer "s" bs-save "S" bs-show-sorted "a" bs-toggle-show-all "d" bs-delete "" bs-delete-backward "k" "g" bs-refresh "C" bs-set-configuration-and-refresh "c" bs-select-next-configuration "q" bs-kill "" "" bs-abort "" "%" bs-toggle-readonly "~" bs-clear-modified "M" bs-toggle-current-to-show "+" bs-set-current-buffer-to-show-always "t" bs-visit-tags-table "m" bs-mark-current "u" bs-unmark-current ">" scroll-right "<" scroll-left "?" bs-help] 5) (#$ . 13202)) #@421 Return a list of buffers to be shown. LIST is a list of buffers to test for appearance in Buffer Selection Menu. The result list depends on the global variables `bs-dont-show-regexp', `bs-must-show-regexp', `bs-dont-show-function', `bs-must-show-function' and `bs-buffer-sort-function'. If SORT-DESCRIPTION isn't nil the list will be sorted by a special function. SORT-DESCRIPTION is an element of `bs-sort-functions'. (defalias 'bs-buffer-list #[(&optional list sort-description) "\206 \n\206\f\306 \307\n\203\237\310\n@!\311 \f\"\205(\311\f\"\2037\311\f\"\206A\205A\311\f\"\205M\n@!\205Y\n@!\312\313\n@\"\211\314=\204\222\204t\315=\204\227\204\227\204\222\204\222\204\222\204\227\204\227\n@ B\nA.\202\316 !\203\273\317!\203\273 >\204\273 B\203\320A@\203\320\320 A@\"\211\202\323\321 !)\207" [sort-description bs--current-sort-function list result buffername bs--intern-show-never buffer-list nil buffer-name string-match buffer-local-value bs-buffer-show-mark always never reverse buffer-live-p sort bs-buffer-sort int-show-never bs-dont-show-regexp ext-show-never bs-must-always-show-regexp bs-must-show-regexp extern-must-show bs-dont-show-function extern-show-never-from-fun bs-must-show-function extern-must-show-from-fun show-flag bs--show-all bs--buffer-coming-from] 4 (#$ . 14966)]) #@69 Sort buffers in BUFFER-LIST according to `bs-buffer-sort-function'. (defalias 'bs-buffer-sort #[(buffer-list) "\203 \302 \"\207 \207" [bs-buffer-sort-function buffer-list sort] 3 (#$ . 16362)]) #@158 Redisplay whole Buffer Selection Menu. If KEEP-LINE-P is non-nil the point will stay on current line. SORT-DESCRIPTION is an element of `bs-sort-functions'. (defalias 'bs--redisplay #[(&optional keep-line-p sort-description) "\303\304`\"T\305\306\307 \"!\210\n\203\310!\210\311 )\207" [line sort-description keep-line-p count-lines 1 bs-show-in-buffer bs-buffer-list nil goto-line beginning-of-line] 4 (#$ . 16566)]) #@148 Goto line which represents the current buffer; actually the line which begins with character in `bs-string-current' or `bs-string-current-marked'. (defalias 'bs--goto-current-buffer #[nil "\304\305!\306\305 !R\307\212eb\210\310 \307\311#\203`S)\n\205\"\nb*\207" [bs-string-current bs-string-current-marked point regexp "^" regexp-quote "\\|^" nil search-forward-regexp t] 5 (#$ . 16994)]) #@65 Return a string describing the current `bs-mode' configuration. (defalias 'bs--current-config-message #[nil "\203\302\207\303\304 \"\207" [bs--show-all bs-current-configuration "Show all buffers." format "Show buffer by configuration %S"] 3 (#$ . 17396)]) #@1824 Major mode for editing a subset of Emacs' buffers. \ Aside from two header lines each line describes one buffer. Move to a line representing the buffer you want to edit and select buffer by \[bs-select] or SPC. Abort buffer list with \[bs-kill]. There are many key commands similar to `Buffer-menu-mode' for manipulating the buffer list and buffers. For faster navigation each digit key is a digit argument. \[bs-select] or SPACE -- select current line's buffer and other marked buffers. \[bs-toggle-show-all] -- toggle between all buffers and a special subset. \[bs-select-other-window] -- select current line's buffer in other window. \[bs-tmp-select-other-window] -- make another window display that buffer and remain in Buffer Selection Menu. \[bs-mouse-select] -- select current line's buffer and other marked buffers. \[bs-save] -- save current line's buffer immediately. \[bs-delete] -- kill current line's buffer immediately. \[bs-toggle-readonly] -- toggle read-only status of current line's buffer. \[bs-clear-modified] -- clear modified-flag on that buffer. \[bs-mark-current] -- mark current line's buffer to be displayed. \[bs-unmark-current] -- unmark current line's buffer to be displayed. \[bs-show-sorted] -- display buffer list sorted by next sort aspect. \[bs-set-configuration-and-refresh] -- ask user for a configuration and apply selected configuration. \[bs-select-next-configuration] -- select and apply next available Buffer Selection Menu configuration. \[bs-kill] -- leave Buffer Selection Menu without a selection. \[bs-toggle-current-to-show] -- toggle status of appearance. \[bs-set-current-buffer-to-show-always] -- mark current line's buffer to show always. \[bs-visit-tags-table] -- call `visit-tags-table' on current line's buffer. \[bs-help] -- display this help text. (defalias 'bs-mode #[nil "\306 \210\307!\210\310\305!\210\310\311!\210\312 \210\313\314\315\211\316\317 \320\321!\207" [bs-mode-map major-mode mode-name buffer-read-only truncate-lines font-lock-defaults kill-all-local-variables use-local-map make-local-variable font-lock-verbose buffer-disable-undo bs-mode "Buffer-Selection-Menu" t (bs-mode-font-lock-keywords t) nil run-mode-hooks bs-mode-hook] 3 (#$ . 17663) nil]) #@52 Restore window configuration on the current frame. (defalias 'bs--restore-window-config #[nil "\205 \301!\210\302\211\207" [bs--window-config-coming-from set-window-configuration nil] 2 (#$ . 19919)]) #@54 Let buffer disappear and reset window-configuration. (defalias 'bs-kill #[nil "\300p!\210\301 \207" [bury-buffer bs--restore-window-config] 2 (#$ . 20130) nil]) #@59 Ding and leave Buffer Selection Menu without a selection. (defalias 'bs-abort #[nil "\300 \210\301 \207" [ding bs-kill] 1 (#$ . 20297) nil]) #@101 Ask user for a configuration and apply selected configuration. Refresh whole Buffer Selection Menu. (defalias 'bs-set-configuration-and-refresh #[nil "\300\301!\210\302\303!\207" [call-interactively bs-set-configuration bs--redisplay t] 2 (#$ . 20445) nil]) #@38 Refresh whole Buffer Selection Menu. (defalias 'bs-refresh #[nil "\300\301!\207" [bs--redisplay t] 2 (#$ . 20709) nil]) #@75 Change the height of the selected window to suit the current buffer list. (defalias 'bs--set-window-height #[nil "\301\302!?\205\f\303\304 \"\207" [bs-max-window-height one-window-p t fit-window-to-buffer selected-window] 3 (#$ . 20835)]) #@72 Return buffer on current line. Raise an error if not on a buffer line. (defalias 'bs--current-buffer #[nil "\303 \210[\304\305`\"\\\211\306W\203\307\310!\210 \n8)\207" [bs-header-lines-length line bs-current-list beginning-of-line count-lines 1 0 error "You are on a header row"] 5 (#$ . 21082)]) #@61 Update the entry on current line for Buffer Selection Menu. (defalias 'bs--update-current-line #[nil "\302 \303\304 \210`\305 |\210\306 !\210\304 *\207" [inhibit-read-only buffer bs--current-buffer t beginning-of-line line-end-position bs--insert-one-entry] 2 (#$ . 21389)]) #@71 View current line's buffer in View mode. Leave Buffer Selection Menu. (defalias 'bs-view #[nil "\300\301 !\207" [view-buffer bs--current-buffer] 2 (#$ . 21672) nil]) #@303 Select current line's buffer and other marked buffers. If there are no marked buffers the window configuration before starting Buffer Selectin Menu will be restored. If there are marked buffers each marked buffer and the current line's buffer will be selected in a window. Leave Buffer Selection Menu. (defalias 'bs-select #[nil "\304 \305p!\210\306 \210\307!\210 \205C\310 \"\311 S\nGT\245\312 \210\307!\210\n\203?\313\314 \"\210\315\316!\210\307\n@!\210\nA\211\204*\315\316!*)\207" [buffer bs--marked-buffers all height bs--current-buffer bury-buffer bs--restore-window-config switch-to-buffer delq frame-height delete-other-windows split-window nil other-window 1] 4 (#$ . 21845) nil]) #@251 Select current line's buffer by `switch-to-buffer-other-window'. The window configuration before starting Buffer Selectin Menu will be restored unless there is no other window. In this case a new window will be created. Leave Buffer Selection Menu. (defalias 'bs-select-other-window #[nil "\301 \302p!\210\303 \210\304!)\207" [buffer bs--current-buffer bury-buffer bs--restore-window-config switch-to-buffer-other-window] 2 (#$ . 22551) nil]) #@87 Make the other window select this line's buffer. The current window remains selected. (defalias 'bs-tmp-select-other-window #[nil "\301 \302\303\")\207" [buffer bs--current-buffer display-buffer t] 3 (#$ . 23003) nil]) #@81 Select current line's buffer in new created frame. Leave Buffer Selection Menu. (defalias 'bs-select-other-frame #[nil "\301 \302p!\210\303 \210\304!)\207" [buffer bs--current-buffer bury-buffer bs--restore-window-config switch-to-buffer-other-frame] 2 (#$ . 23230) nil]) #@110 Select selected line's buffer in new created frame. Leave Buffer Selection Menu. EVENT: a mouse click EVENT. (defalias 'bs-mouse-select-other-frame #[(event) "\301!\210\302 \207" [event mouse-set-point bs-select-other-frame] 2 (#$ . 23511) "e"]) #@67 Select buffer on mouse click EVENT. Select buffer by `bs-select'. (defalias 'bs-mouse-select #[(event) "\301!\210\302 \207" [event mouse-set-point bs-select] 2 (#$ . 23764) "e"]) #@99 Select current line's buffer in one window and delete other windows. Leave Buffer Selection Menu. (defalias 'bs-select-in-one-window #[nil "\300 \210\301 \207" [bs-select delete-other-windows] 1 (#$ . 23950) nil]) #@30 Bury buffer on current line. (defalias 'bs-bury-buffer #[nil "\300\301 !\210\302\303!\207" [bury-buffer bs--current-buffer bs--redisplay t] 2 (#$ . 24170) nil]) #@30 Save buffer on current line. (defalias 'bs-save #[nil "\301 \212q\210\302 \210)\303 )\207" [buffer bs--current-buffer save-buffer bs--update-current-line] 1 (#$ . 24337) nil]) #@74 Visit the tags table in the buffer on this line. See `visit-tags-table'. (defalias 'bs-visit-tags-table #[nil "\301\302 !\211\203\303!\202\304\305!)\207" [file buffer-file-name bs--current-buffer visit-tags-table error "Specified buffer has no file"] 3 (#$ . 24521) nil]) #@59 Toggle status of showing flag for buffer in current line. (defalias 'bs-toggle-current-to-show #[nil "\303 \304\212 q\210\n\204\305\202\n\305=\203\306\202\304\211)\307 \210\310 \210\311!*\207" [res buffer bs-buffer-show-mark bs--current-buffer nil never always bs--update-current-line bs--set-window-height bs--show-config-message] 3 (#$ . 24805) nil]) #@200 Toggle status of buffer on line to `always shown'. NOT-TO-SHOW-P: prefix argument. With no prefix argument the buffer on current line is marked to show always. Otherwise it is marked to show never. (defalias 'bs-set-current-buffer-to-show-always #[(&optional not-to-show-p) "\203\301 \207\302\303 \304\"\207" [not-to-show-p bs-set-current-buffer-to-show-never bs--set-toggle-to-show bs--current-buffer always] 3 (#$ . 25178) "P"]) #@51 Toggle status of buffer on line to `never shown'. (defalias 'bs-set-current-buffer-to-show-never #[nil "\300\301 \302\"\207" [bs--set-toggle-to-show bs--current-buffer never] 3 (#$ . 25619) nil]) #@153 Set value `bs-buffer-show-mark' of buffer BUFFER to WHAT. Redisplay current line and display a message describing the status of buffer on current line. (defalias 'bs--set-toggle-to-show #[(buffer what) "rq\210 )\303 \210\304 \210\305 !\207" [buffer what bs-buffer-show-mark bs--update-current-line bs--set-window-height bs--show-config-message] 2 (#$ . 25822)]) #@96 Mark buffers. COUNT is the number of buffers to mark. Move cursor vertically down COUNT lines. (defalias 'bs-mark-current #[(count) "\304V\203\n\305\202 \306\307!\304V\2050\310 \211\203!\n B\311 \210\312 !\210)S\211\202*\207" [count dir buffer bs--marked-buffers 0 1 -1 abs bs--current-buffer bs--update-current-line bs-down] 4 (#$ . 26192) "p"]) #@100 Unmark buffers. COUNT is the number of buffers to unmark. Move cursor vertically down COUNT lines. (defalias 'bs-unmark-current #[(count) "\304V\203\n\305\202 \306\307!\304V\2051\310 \211\203\"\311\n \"\312 \210\313 !\210)S\211\202*\207" [count dir buffer bs--marked-buffers 0 1 -1 abs bs--current-buffer delq bs--update-current-line bs-down] 4 (#$ . 26561) "p"]) #@100 Show message indicating the new showing status WHAT. WHAT is a value of nil, `never', or `always'. (defalias 'bs--show-config-message #[(what) "\301\204 \302\202\303=\203\304\202\305!\207" [what bs-message-without-log "Buffer will be shown normally." never "Mark buffer to never be shown." "Mark buffer to show always."] 3 (#$ . 26947)]) #@30 Kill buffer on current line. (defalias 'bs-delete #[nil "\303 \304\305 !\204\306\307!\210\310 \n\"\311 \210`\212\312\210m\203$`\202&`T)|\210m\2038\313\314!\210\311 \210\315\316!\210\317 *\207" [inhibit-read-only current bs-current-list bs--current-buffer t kill-buffer error "Buffer was not deleted" delq beginning-of-line nil backward-delete-char 1 recenter -1 bs--set-window-height] 3 (#$ . 27300) nil]) #@56 Like `bs-delete' but go to buffer in front of current. (defalias 'bs-delete-backward #[nil "\212\301\210m)\302 \210?\205\303\304!)\207" [on-last-line-p nil bs-delete bs-up 1] 2 (#$ . 27721) nil]) #@41 Show buffer list sorted by buffer name. (defalias 'bs-show-sorted #[nil "\302@ \"\303 \210\304 \210\305\306@\"\207" [bs--current-sort-function bs-sort-functions bs-next-config-aux bs--redisplay bs--goto-current-buffer bs-message-without-log "Sorted %s"] 3 (#$ . 27928) nil]) #@160 Set text properties for the sort described by SORT-DESCRIPTION. SORT-DESCRIPTION is an element of `bs-sort-functions'. Default is `bs--current-sort-function'. (defalias 'bs-apply-sort-faces #[(&optional sort-description) "\206 \212eb\210\3038\205+\304\3038\305\306#\205+\306\307\310\224\310\225\311\3128\206)\313$)*\207" [sort-description bs--current-sort-function inhibit-read-only 2 search-forward-regexp nil t put-text-property 0 face 3 region] 6 (#$ . 28213)]) #@68 Toggle show all buffers / show buffers with current configuration. (defalias 'bs-toggle-show-all #[nil "?\301 \210\302 \210\303\304\305 \"\207" [bs--show-all bs--redisplay bs--goto-current-buffer bs-message-without-log "%s" bs--current-config-message] 3 (#$ . 28695) nil]) #@90 Toggle read-only status for buffer on current line. Uses function `vc-toggle-read-only'. (defalias 'bs-toggle-readonly #[nil "\301 \212q\210\302 \210)\303 )\207" [buffer bs--current-buffer vc-toggle-read-only bs--update-current-line] 1 (#$ . 28976) nil]) #@54 Set modified flag for buffer on current line to nil. (defalias 'bs-clear-modified #[nil "\301 \212q\210\302\303!\210*\304 \207" [buffer bs--current-buffer set-buffer-modified-p nil bs--update-current-line] 2 (#$ . 29239) nil]) #@52 Call COUNT times function FUN with arguments ARGS. (defalias 'bs--nth-wrapper #[(count fun &rest args) "\206\303\211\304V\205\305 \n\"\210S\211\202\207" [count fun args 1 0 apply] 4 (#$ . 29474)]) #@63 Move cursor vertically up ARG lines in Buffer Selection Menu. (defalias 'bs-up #[(arg) "\203\247\203\301W\203\302[\303\"\207\302\304\"\207" [arg 0 bs--nth-wrapper bs--down bs--up] 3 (#$ . 29687) "p"]) #@79 Move cursor vertically up one line. If on top of buffer list go to last line. (defalias 'bs--up #[nil "\301\302`\"V\203\f\303y\207db\210\304 \210\305\303!\207" [bs-header-lines-length count-lines 1 -1 beginning-of-line recenter] 3 (#$ . 29905)]) #@65 Move cursor vertically down ARG lines in Buffer Selection Menu. (defalias 'bs-down #[(arg) "\203\247\203\301W\203\302[\303\"\207\302\304\"\207" [arg 0 bs--nth-wrapper bs--up bs--down] 3 (#$ . 30159) "p"]) #@82 Move cursor vertically down one line. If at end of buffer list go to first line. (defalias 'bs--down #[nil "\301 d=\203\f\302T!\207\303y\207" [bs-header-lines-length line-end-position goto-line 1] 2 (#$ . 30381)]) #@141 Return t or nil 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. (defalias 'bs-visits-non-file #[(buffer) "\301!?\207" [buffer buffer-file-name] 2 (#$ . 30604)]) #@76 Function for sorting internal buffers B1 and B2 at the end of all buffers. (defalias 'bs-sort-buffer-interns-are-last #[(b1 b2) "\301\302\303!\"\207" [b2 string-match "^\\*" buffer-name] 4 (#$ . 30848)]) #@199 *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'. (defalias 'bs-config-clear #[nil "\305\211\305\211\305\211\207" [bs-dont-show-regexp bs-must-show-regexp bs-dont-show-function bs-must-show-function bs-buffer-sort-function nil] 3 (#$ . -31060)]) #@66 Define a configuration for showing only buffers visiting a file. (defalias 'bs-config--only-files #[nil "\302 \210\303\304\211\207" [bs-buffer-sort-function bs-dont-show-function bs-config-clear bs-sort-buffer-interns-are-last bs-visits-non-file] 2 (#$ . 31465)]) #@71 Define a configuration for showing buffer *scratch* and file buffers. (defalias 'bs-config--files-and-scratch #[nil "\303 \210\304\305\306\211\207" [bs-buffer-sort-function bs-dont-show-function bs-must-show-regexp bs-config-clear bs-sort-buffer-interns-are-last bs-visits-non-file "^\\*scratch\\*$"] 2 (#$ . 31737)]) #@101 Define a configuration for showing all buffers. Reset all according variables by `bs-config-clear'. (defalias 'bs-config--all #[nil "\300 \207" [bs-config-clear] 1 (#$ . 32065)]) #@96 Define a configuration for showing all buffers. Internal buffers appear at end of all buffers. (defalias 'bs-config--all-intern-last #[nil "\301 \210\302\211\207" [bs-buffer-sort-function bs-config-clear bs-sort-buffer-interns-are-last] 2 (#$ . 32250)]) #@167 Set configuration to the one saved under string NAME in `bs-configurations'. When called interactively ask user for a configuration and apply selected configuration. (defalias 'bs-set-configuration #[(name) "\306 \"\211\2031\n<\203+\nA@\307\n8\310\n8\311\n8\312\n8\211\2028\nA \2028\313 \210\314\315\")\207" [name bs-configurations list bs-current-configuration bs-must-show-regexp bs-must-show-function assoc 2 3 4 5 ding bs-message-without-log "No bs-configuration named %S." bs-dont-show-regexp bs-dont-show-function bs-buffer-sort-function] 4 (#$ . 32512) (list (completing-read "Use configuration: " bs-configurations nil t))]) #@21 Help for `bs-show'. (defalias 'bs-help #[nil "\300\301!\207" [describe-function bs-mode] 2 (#$ . 33168) nil]) #@98 Get the next assoc after START-NAME in list LIST. Will return the first if START-NAME is at end. (defalias 'bs-next-config-aux #[(start-name list) "\211G\305\211\203# \204# @@\f\230\203\n GZ A\211\204 T\211\n=\2031@\2024 8+\207" [list pos length assocs start-name nil] 4 (#$ . 33284)]) #@73 Return next configuration with respect to configuration with name NAME. (defalias 'bs-next-config #[(name) "\302 \"\207" [name bs-configurations bs-next-config-aux] 3 (#$ . 33593)]) #@150 Apply next configuration START-NAME and refresh buffer list. If START-NAME is nil the current configuration `bs-current-configuration' will be used. (defalias 'bs-select-next-configuration #[(&optional start-name) "\304\206 !\305\n@!\210 \306\307!\210\310 \210\311\312\n@\")\207" [start-name bs-current-configuration config bs-default-configuration bs-next-config bs-set-configuration bs--redisplay t bs--set-window-height bs-message-without-log "Selected configuration: %s"] 3 (#$ . 33783) nil]) #@241 Display buffer list LIST in buffer *buffer-selection*. Select buffer *buffer-selection* and display buffers according to current configuration `bs-current-configuration'. Set window height, fontify buffer and move point to current buffer. (defalias 'bs-show-in-buffer #[(list) "\306\307\310!!\210\311 \210\312\313\314\315\316\317 \"B\" \f]^\320 \210\321 \210\203>\322@!\210\323c\210A\211\204/\324\325!\210\326 \210\327 \210\330 \210\331 \210\332\333!,\207" [list bs-current-list inhibit-read-only map-fun max-length-of-names bs-maximal-buffer-name-column switch-to-buffer get-buffer-create "*buffer-selection*" bs-mode t #[(entry) "\301!G\207" [entry buffer-name] 2] apply max 0 mapcar erase-buffer bs--show-header bs--insert-one-entry "\n" delete-backward-char 1 bs--set-window-height bs--goto-current-buffer font-lock-fontify-buffer bs-apply-sort-faces set-buffer-modified-p nil bs-minimal-buffer-name-column name-entry-length bs--name-entry-length] 7 (#$ . 34292)]) #@304 Return next buffer and buffer list for buffer cycling in BUFFER-LIST. Ignore sorting when SORTING-P is nil. If BUFFER-LIST is nil the result of `bs-buffer-list' will be used as buffer list. The result is a cons of normally the second element of BUFFER-LIST and the buffer list used for buffer cycling. (defalias 'bs-next-buffer #[(&optional buffer-list sorting-p) "\205 \n\206\f\303 \211A@\206 @\206p *B\207" [sorting-p bs--current-sort-function buffer-list bs-buffer-list] 3 (#$ . 35290)]) #@293 Return previous buffer and buffer list for buffer cycling in BUFFER-LIST. Ignore sorting when SORTING-P is nil. If BUFFER-LIST is nil the result of `bs-buffer-list' will be used as buffer list. The result is a cons of last element of BUFFER-LIST and the buffer list used for buffer cycling. (defalias 'bs-previous-buffer #[(&optional buffer-list sorting-p) "\205 \n\206\f\303 \304 !@\206p *B\207" [sorting-p bs--current-sort-function buffer-list bs-buffer-list last] 2 (#$ . 35799)]) #@111 Like `message' but don't log it on the message log. All arguments ARGS are transferred to function `message'. (defalias 'bs-message-without-log #[(&rest args) "\302\303\304 \")\207" [message-log-max args nil apply message] 3 (#$ . 36299)]) #@39 Current buffer list used for cycling. (defvar bs--cycle-list nil (#$ . 36546)) #@156 Select next buffer defined by buffer cycling. The buffers taking part in buffer cycling are defined by buffer configuration `bs-cycle-configuration-name'. (defalias 'bs-cycle-next #[nil "p \n \306\307\206!\210\306\211\310\311=\204+\312=\205-!\211@A\313A@C\"\314 \210\315!\210\316\317A\206U\320\". \207" [bs-dont-show-regexp bs-must-show-regexp bs-dont-show-function bs-must-show-function bs--show-all bs--buffer-coming-from nil bs-set-configuration bs-next-buffer bs-cycle-next bs-cycle-previous append bury-buffer switch-to-buffer bs-message-without-log "Next buffers: %s" "this buffer" bs-cycle-configuration-name bs-default-configuration bs--current-sort-function bs-buffer-sort-function last-command bs--cycle-list tupel next cycle-list] 7 (#$ . 36632) nil]) #@160 Select previous buffer defined by buffer cycling. The buffers taking part in buffer cycling are defined by buffer configuration `bs-cycle-configuration-name'. (defalias 'bs-cycle-previous #[nil "p \n \306\307\206!\210\306\211\310\311=\204+\312=\205-!\211@A\313\314!\315\211!A!\"\316!\210\317\320\315A!\206X\321\". \207" [bs-dont-show-regexp bs-must-show-regexp bs-dont-show-function bs-must-show-function bs--show-all bs--buffer-coming-from nil bs-set-configuration bs-previous-buffer bs-cycle-next bs-cycle-previous append last reverse switch-to-buffer bs-message-without-log "Previous buffers: %s" "this buffer" bs-cycle-configuration-name bs-default-configuration bs--current-sort-function bs-buffer-sort-function last-command bs--cycle-list tupel prev-buffer cycle-list] 7 (#$ . 37446) nil]) #@119 Apply function FUN with arguments ARGS. Return result of evaluation. Will return FUN if FUN is a number or a string. (defalias 'bs--get-value #[(fun &optional args) "\247\203\207;\203\207\302 \"\207" [fun args apply] 3 (#$ . 38293)]) #@375 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. 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'. (defalias 'bs--get-marked-string #[(start-buffer all-buffers) "p=\203p >\203\n\207 \207p >\203\f\207 \204\207 \306=\203(\207 \207" [start-buffer bs--marked-buffers bs-string-current-marked bs-string-current bs-string-marked bs-buffer-show-mark never bs-string-show-normally bs-string-show-never bs-string-show-always] 2 (#$ . 38544)]) #@201 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. (defalias 'bs--get-modified-string #[(start-buffer all-buffers) "\300 \203\301\207\302\207" [buffer-modified-p "*" " "] 1 (#$ . 39275)]) #@202 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. (defalias 'bs--get-readonly-string #[(start-buffer all-buffers) "\203\301\207\302\207" [buffer-read-only "%" " "] 1 (#$ . 39621)]) #@193 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. (defalias 'bs--get-size-string #[(start-buffer all-buffers) "\300\301 !\207" [int-to-string buffer-size] 2 (#$ . 39963)]) #@273 Return name of current buffer for Buffer Selection Menu. 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. (defalias 'bs--get-name #[(start-buffer all-buffers) "\300\301 \302\303\304\305%\207" [propertize buffer-name help-echo "mouse-2: select this buffer, mouse-3: select in other frame" mouse-face highlight] 6 (#$ . 40284)]) #@202 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. (defalias 'bs--get-mode-name #[(start-buffer all-buffers) "\207" [mode-name] 1 (#$ . 40784)]) #@332 Return string for column 'File' in Buffer Selection Menu. This is the variable `buffer-file-name' of current buffer. 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. (defalias 'bs--get-file-name #[(start-buffer all-buffers) "\303\304\235\203 \202\n\206\305\306\307\310\311%\207" [major-mode default-directory buffer-file-name propertize (shell-mode dired-mode) "" mouse-face highlight help-echo "mouse-2: select this buffer, mouse-3: select in other frame"] 6 (#$ . 41087)]) #@223 Generate one entry for buffer BUFFER in Buffer Selection Menu. It goes over all columns described in `bs-attributes-list' and evaluates corresponding string. Inserts string in current buffer; normally *buffer-selection*. (defalias 'bs--insert-one-entry #[(buffer) "\306\307\310 \nD!\212 \203bq\210\311 @A@!\312 @8\313 @8\314\211\311 \"\315\fZ#PGV\203ZGZ- A\211\204)c\210,\207" [bs-attributes-list bs--buffer-coming-from bs-current-list apply-args to-much columns "" 0 append bs--get-value 3 4 nil bs--format-aux string buffer new-string val fun align min] 7 (#$ . 41741)]) #@126 Generate a string with STRING with alignment ALIGN and length LEN. ALIGN is one of the symbols `left', `middle', or `right'. (defalias 'bs--format-aux #[(string align len) "G\n ]\304\211\305 \306=\203\307\202\310\n# \311=\203*\312\n Z\313\245\314\"P\202+\"*\207" [string width len align format "%%%s%ds" right "" "-" middle make-string 2 32] 5 (#$ . 42376)]) #@60 Insert header for Buffer Selection Menu in current buffer. (defalias 'bs--show-header #[nil "\300\301\302 \"\207" [mapcar #[(string) "\301\261\207" [string "\n"] 2] bs--create-header] 3 (#$ . 42752)]) #@42 Return value of `bs--name-entry-length'. (defalias 'bs--get-name-length #[nil "\207" [bs--name-entry-length] 1 (#$ . 42961)]) #@77 Return all header lines used in Buffer Selection Menu as a list of strings. (defalias 'bs--create-header #[nil "\301\302\303#\301\304\303#D\207" [bs-attributes-list mapconcat #[(column) "\301\302@!\3038\302A@!#\207" [column bs--format-aux bs--get-value 3] 5] "" #[(column) "\302@!G\303\304 \305\"\3068\302A@!#)\207" [column length bs--get-value bs--format-aux make-string 45 3] 5]] 5 (#$ . 43094)]) #@566 Display buffer list of configuration with name NAME. Set configuration NAME and determine window for Buffer Selection Menu. Unless current buffer is buffer *buffer-selection* we have to save the buffer we started Buffer Selection Menu and the current window configuration to restore buffer and window configuration after a selection. If there is already a window displaying *buffer-selection* select this window for Buffer Selection Menu. Otherwise open a new window. The optional argument ARG is the prefix argument when calling a function for buffer selection. (defalias 'bs--show-with-configuration #[(name &optional arg) "\306!\210 \206 \n\307 \310\230\204p\311 \312\313!\f\203%\314\f!\210\202>\315\316\317\320 BC\"\210\321\322 !\323V\203>\324 \210\325\326!\210\327 !\210\330\331\332 \"+\207" [name bs--show-all arg bs--buffer-coming-from active-window liste bs-set-configuration buffer-name "*buffer-selection*" bs-buffer-list get-window-with-predicate #[(w) "\301\302!!\303\230\207" [w buffer-name window-buffer "*buffer-selection*"] 3] select-window modify-frame-parameters nil bs--window-config-coming-from current-window-configuration window-height selected-window 7 split-window-vertically other-window 1 bs-show-in-buffer bs-message-without-log "%s" bs--current-config-message] 4 (#$ . 43509)]) #@256 Convert prefix argument PREFIX-ARG to a name of a buffer configuration. If PREFIX-ARG is nil return `bs-default-configuration'. If PREFIX-ARG is an integer return PREFIX-ARG element of `bs-configurations'. Otherwise return `bs-alternative-configuration'. (defalias 'bs--configuration-name-for-prefix-arg #[(prefix-arg) "\204 \207\250\203 \304W\203\nGX\203S\n8@\207 \207 \207" [prefix-arg bs-default-configuration bs-configurations bs-alternative-configuration 0] 2 (#$ . 44836)]) #@54 Customization of group bs for Buffer Selection Menu. (defalias 'bs-customize #[nil "\300\301!\207" [customize-group "bs"] 2 (#$ . 45334) nil]) #@566 Make a menu of buffers so you can manipulate buffers or the buffer list. \ There are many key commands similar to `Buffer-menu-mode' for manipulating buffer list and buffers itself. User can move with [up] or [down], select a buffer by \[bs-select] or [SPC] Type \[bs-kill] to leave Buffer Selection Menu without a selection. Type \[bs-help] after invocation to get help on commands available. With prefix argument ARG show a different buffer list. Function `bs--configuration-name-for-prefix-arg' determine accordingly name of buffer configuration. (defalias 'bs-show #[(arg) "\302\303\304 !!\207" [bs--marked-buffers arg nil bs--show-with-configuration bs--configuration-name-for-prefix-arg] 3 (#$ . 45484) "P"]) (provide 'bs)