?
Current Path : /usr/share/emacs/24.3/lisp/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : //usr/share/emacs/24.3/lisp/msb.elc |
;ELC ;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:06:26 2024 ;;; from file /builddir/build/BUILD/emacs-24.3/lisp/msb.el ;;; in Emacs version 24.3.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defconst msb--few-menus '(((and (boundp 'server-buffer-clients) server-buffer-clients 'multi) 3030 "Clients (%d)") ((and msb-display-invisible-buffers-p (msb-invisible-buffer-p) 'multi) 3090 "Invisible buffers (%d)") ((eq major-mode 'dired-mode) 2010 "Dired (%d)" msb-dired-item-handler msb-sort-by-directory) ((eq major-mode 'Man-mode) 4090 "Manuals (%d)") ((eq major-mode 'w3-mode) 4020 "WWW (%d)") ((or (memq major-mode '(rmail-mode rmail-edit-mode vm-summary-mode vm-mode mail-mode)) (memq major-mode '(mh-letter-mode mh-show-mode mh-folder-mode)) (memq major-mode '(gnus-summary-mode message-mode gnus-group-mode gnus-article-mode score-mode gnus-browse-killed-mode))) 4010 "Mail (%d)") ((not buffer-file-name) 4099 "Buffers (%d)") ('no-multi 1099 "Files (%d)"))) (defconst msb--very-many-menus '(((and (boundp 'server-buffer-clients) server-buffer-clients 'multi) 1010 "Clients (%d)") ((and (boundp 'vc-mode) vc-mode 'multi) 1020 "Version Control (%d)") ((and buffer-file-name (buffer-modified-p) 'multi) 1030 "Changed files (%d)") ((and (get-buffer-process (current-buffer)) 'multi) 1040 "Processes (%d)") ((and msb-display-invisible-buffers-p (msb-invisible-buffer-p) 'multi) 1090 "Invisible buffers (%d)") ((eq major-mode 'dired-mode) 2010 "Dired (%d)" msb-dired-item-handler msb-sort-by-directory) ((eq major-mode 'Man-mode) 5030 "Manuals (%d)") ((eq major-mode 'w3-mode) 5020 "WWW (%d)") ((or (memq major-mode '(rmail-mode rmail-edit-mode vm-summary-mode vm-mode mail-mode)) (memq major-mode '(mh-letter-mode mh-show-mode mh-folder-mode)) (memq major-mode '(gnus-summary-mode message-mode gnus-group-mode gnus-article-mode score-mode gnus-browse-killed-mode))) 5010 "Mail (%d)") ((and (not buffer-file-name) 'no-multi) 5099 "Other non-file buffers (%d)") ((and (string-match "/\\.[^/]*$" buffer-file-name) 'multi) 3090 "Hidden Files (%d)") ((memq major-mode '(c-mode c++-mode)) 3010 "C/C++ Files (%d)") ((eq major-mode 'emacs-lisp-mode) 3020 "Elisp Files (%d)") ((eq major-mode 'latex-mode) 3030 "LaTeX Files (%d)") ('no-multi 3099 "Other files (%d)"))) (custom-declare-group 'msb nil "Customizable buffer-selection with multiple menus." :prefix "msb-" :group 'mouse) #@44 Set the value of custom variables for msb. (defalias 'msb-custom-set #[(symbol value) " L\210\303\304!\205 \n\205 \305\306!\207" [symbol value msb-mode featurep msb msb-menu-bar-update-buffers t] 2 (#$ . 2726)]) (byte-code "\302\303\300\304\305\306\307\310\311\312\257\307\310\313\312 \257\314BBB\315\316\317\320& \210\302\321\322\323\305\324\315\316\317\320\325\326&\210\302\327\330\331\305\332\315\316\317\320& \207" [msb--very-many-menus msb--few-menus custom-declare-variable msb-menu-cond "List of criteria for splitting the mouse buffer menu.\nThe elements in the list should be of this type:\n (CONDITION MENU-SORT-KEY MENU-TITLE ITEM-HANDLING-FN ITEM-SORT-FN).\n\nWhen making the split, the buffers are tested one by one against the\nCONDITION, just like a Lisp cond: When hitting a true condition, the\nother criteria are *not* tested and the buffer name will appear in the\nmenu with the menu-title corresponding to the true condition.\n\nIf the condition returns the symbol `multi', then the buffer will be\nadded to this menu *and* tested for other menus too. If it returns\n`no-multi', then the buffer will only be added if it hasn't been added\nto any other menu.\n\nDuring this test, the buffer in question is the current buffer, and\nthe test is surrounded by calls to `save-excursion' and\n`save-match-data'.\n\nThe categories are sorted by MENU-SORT-KEY. Smaller keys are on top.\nA value of nil means don't display this menu.\n\nMENU-TITLE is really a format. If you add %d in it, the %d is\nreplaced with the number of items in that menu.\n\nITEM-HANDLING-FN is optional. If it is supplied and is a function,\nthen it is used for displaying the items in that particular buffer\nmenu, otherwise the function pointed out by\n`msb-item-handling-function' is used.\n\nITEM-SORT-FN is also optional.\nIf it is not supplied, the function pointed out by\n`msb-item-sort-function' is used.\nIf it is nil, then no sort takes place and the buffers are presented\nin least-recently-used order.\nIf it is t, then no sort takes place and the buffers are presented in\nmost-recently-used order.\nIf it is supplied and non-nil and not t than it is used for sorting\nthe items in that particular buffer menu.\n\nNote1: There should always be a `catch-all' as last element, in this\nlist. That is an element like (t TITLE ITEM-HANDLING-FUNCTION).\nNote2: A buffer menu appears only if it has at least one buffer in it.\nNote3: If you have a CONDITION that can't be evaluated you will get an\nerror every time you do \\[msb]." :type choice const :tag "long" :value "short" ((sexp :tag "user")) :set msb-custom-set :group msb msb-modes-key 4000 "The sort key for files sorted by mode." integer :version "20.3" msb-separator-diff 100 "Non-nil means use separators.\nThe separators will appear between all menus that have a sorting key\nthat differs by this value or more." (choice integer (const nil))] 12) #@45 The sort key for files sorted by directory. (defvar msb-files-by-directory-sort-key 0 (#$ . 5651)) (byte-code "\300\301\302\303\304\305\306\307\310\311& \210\300\312\313\314\304\315\306\307\310\311& \210\300\316\317\320\304\315\306\307\310\311& \210\300\321\302\322\304\315\306\307\310\311& \210\300\323\324\325\304\326\306\307\310\311& \207" [custom-declare-variable msb-max-menu-items 15 "The maximum number of items in a menu.\nIf this variable is set to 15 for instance, then the submenu will be\nsplit up in minor parts, 15 items each. A value of nil means no limit." :type (choice integer (const nil)) :set msb-custom-set :group msb msb-max-file-menu-items 10 "The maximum number of items from different directories.\n\nWhen the menu is of type `file by directory', this is the maximum\nnumber of buffers that are clumped together from different\ndirectories.\n\nSet this to 1 if you want one menu per directory instead of clumping\nthem together.\n\nIf the value is not a number, then the value 10 is used." integer msb-most-recently-used-sort-key -1010 "Where should the menu with the most recently used buffers be placed?" msb-display-most-recently-used "How many buffers should be in the most-recently-used menu.\nNo buffers at all if less than 1 or nil (or any non-number)." msb-most-recently-used-title "Most recently used (%d)" "The title for the most-recently-used menu." string] 10) #@74 Function that specifies how many pixels to shift the top menu leftwards. (defvar msb-horizontal-shift-function #[nil "\300\207" [0] 1] (#$ . 7056)) #@142 Show invisible buffers or not. Non-nil means that the buffer menu should include buffers that have names that starts with a space character. (custom-declare-variable 'msb-display-invisible-buffers-p nil '(#$ . 7211) :type 'boolean :set 'msb-custom-set :group 'msb) #@500 The appearance of a buffer menu. The default function to call for handling the appearance of a menu item. It should take two arguments, BUFFER and MAX-BUFFER-NAME-LENGTH, where the latter is the max length of all buffer names. The function should return the string to use in the menu. When the function is called, BUFFER is the current buffer. This function is called for items in the variable `msb-menu-cond' that have nil as ITEM-HANDLING-FUNCTION. See `msb-menu-cond' for more information. (defvar msb-item-handling-function 'msb-item-handler (#$ . 7483)) (byte-code "\302\303\304\305\306\307\310\311\312\313& \210\302\314\315\316\306\317\310\311\312\313& \210\320\321\322\315#\210\323\315\211\203F @\321N\203? \322N\204? \324\322\321N#\210 A\211\204( *\325\321\322\326#\210\302\322\315\327\306\330\310\311\312\313& \207" [prop --dolist-tail-- custom-declare-variable msb-item-sort-function 'msb-sort-by-name "The order of items in a buffer menu.\n\nThe default function to call for handling the order of items in a menu\nitem. This function is called like a sort function. The items look\nlike (ITEM-NAME . BUFFER).\n\nITEM-NAME is the name of the item that will appear in the menu.\nBUFFER is the buffer, this is not necessarily the current buffer.\n\nSet this to nil or t if you don't want any sorting (faster)." :type (choice (const msb-sort-by-name) (const :tag "Newest first" t) (const :tag "Oldest first" nil)) :set msb-custom-set :group msb msb-files-by-directory nil "Non-nil means that files should be sorted by directory.\nThis is instead of the groups in `msb-menu-cond'." boolean defvaralias msb-after-load-hooks msb-after-load-hook (saved-value saved-variable-comment) put make-obsolete-variable "24.1" "Hook run after the msb package has been loaded." hook] 11) (defvar msb--last-buffer-menu nil) (defvar msb--error nil) #@265 Create one string item, concerning BUFFER, for the buffer menu. The item looks like: *% <buffer-name> The `*' appears only if the buffer is marked as modified. The `%' appears only if the buffer is read-only. Optional second argument MAXBUF is completely ignored. (defalias 'msb-item-handler #[(buffer &optional maxbuf) "\304 \305 \203 \306\202\f \307\203 \310\202 \307\311\312\n $+\207" [buffer-read-only read-only modified name buffer-name buffer-modified-p "*" " " "%" format "%s%s %s"] 5 (#$ . 9346)]) (defalias 'msb--dired-directory #[nil ";\203 \301\302!!\207:\203 \301\302@!!\207\303\304\305 \"\207" [dired-directory abbreviate-file-name expand-file-name error "Unknown type of `dired-directory' in buffer %s" buffer-name] 3]) #@273 Create one string item, concerning a dired BUFFER, for the buffer menu. The item looks like: *% <buffer-name> The `*' appears only if the buffer is marked as modified. The `%' appears only if the buffer is read-only. Optional second argument MAXBUF is completely ignored. (defalias 'msb-dired-item-handler #[(buffer &optional maxbuf) "\304 \305 \203 \306\202\f \307\203 \310\202 \307\311\312\n $+\207" [buffer-read-only read-only modified name msb--dired-directory buffer-modified-p "*" " " "%" format "%s%s %s"] 5 (#$ . 10101)]) #@257 Create one string item for the buffer menu. The item looks like: <buffer-name> *%# <file-name> The `*' appears only if the buffer is marked as modified. The `%' appears only if the buffer is read-only. The `#' appears only version control file (SCCS/RCS). (defalias 'msb-alon-item-handler #[(buffer maxbuf) "\305\211\306\"\307 !\310 \203 \311\202 \312\n\203 \313\202 \312\314\303!\203) \203) \315\202* \312\f\206/ \316&\207" [maxbuf buffer buffer-read-only vc-mode buffer-file-name format "%%%ds %%s%%s%%s %%s" buffer-name buffer-modified-p "*" " " "%" boundp "#" ""] 7 (#$ . 10646)]) #@92 Sort the items ITEM1 and ITEM2 by their `buffer-name'. An item looks like (NAME . BUFFER). (defalias 'msb-sort-by-name #[(item1 item2) "\302A!\302 A!\231\207" [item1 item2 buffer-name] 3 (#$ . 11246)]) #@103 Sort the items ITEM1 and ITEM2 by directory name. Made for dired. An item look like (NAME . BUFFER). (defalias 'msb-sort-by-directory #[(item1 item2) "rAq\210\302 )r Aq\210\302 )\231\207" [item1 item2 msb--dired-directory] 2 (#$ . 11456)]) #@278 Pop up several menus of buffers for selection with the mouse. This command switches buffers in the window that you clicked on, and selects that window. See the function `mouse-select-buffer' and the variable `msb-menu-cond' for more information about how the menus are split. (defalias 'msb #[(event) "\306 \307!\211@)\310\311!\204 \312!\210\313\314\315\"?\316!\211\203, \317 !\210\2020 \312\f!\210)\n\203A \320\321!>\203A \322 \210+\310\207" [event position early-release window old-window buffer selected-window event-start nil framep select-window sit-for 0.1 t mouse-select-buffer switch-to-buffer down event-modifiers discard-input last-input-event] 4 (#$ . 11705) "e"]) #@130 Return t if optional BUFFER is an "invisible" buffer. If the argument is left out or nil, then the current buffer is considered. (defalias 'msb-invisible-buffer-p #[(&optional buffer) "\301!G\302V\205 \301!\302H\303=\207" [buffer buffer-name 0 32] 2 (#$ . 12402)]) #@48 Strip one hierarchy level from the end of DIR. (defalias 'msb--strip-dir #[(dir) "\301\302!!\207" [dir file-name-directory directory-file-name] 3 (#$ . 12676)]) (defalias 'msb--init-file-alist #[(list) "\304\305\306\307\310\"\"\311\"\312\211\305\306\307\313 \"\"\nBC\244+\207" [list buffer-alist buffers dir sort apply nconc mapcar #[(buffer) "\302\303!!\211\205 \304 !BC)\207" [buffer file-name expand-file-name buffer-file-name msb--strip-dir] 4] #[(item1 item2) "@ @\231\207" [item1 item2] 2] nil #[(item) " @\232\203 A\nB\304\207\205 \nB @ AC\205# C)\207" [dir item buffers result nil] 2]] 6]) #@44 Format a suitable title for the menu item. (defalias 'msb--format-title #[(top-found-p dir number-of-items) "\303\203 \304\202\n \305\306 !\n#\207" [top-found-p dir number-of-items format "%s... (%d)" "%s (%d)" abbreviate-file-name] 4 (#$ . 13303)]) #@70 Choose file-menu with respect to directory for every buffer in LIST. (defalias 'msb--choose-file-menu #[(list) "\306!\307\n\247\203 \n\202 \310\307\211\211\211\211\211\211\211@A@A\311!\203Y\307\307@\203\223 \fGX\203\223 @G GY\203\223 \312 \313\307@\313 G&\314=\203\223 \314\315\fA\"A\211@\202S \fGV\203\314 @\316@AG#ABB\307@A@A\202U\203\335 \314 \fB \317 !A \232\203\360 \203U GGY\203\312\313\307 \313G&\314=\204, GGW\203U\312 \313\307\313 G&\314=\203U\316@AG#ABB\307@A@A+\202? \203r\316@AG#ABB\307\237.\n\207" [list msb--choose-file-menu-arg-list msb-max-file-menu-items old-dir buffers dir msb--init-file-alist nil 10 copy-sequence compare-strings 0 t append msb--format-title msb--strip-dir rest first last-dir top-found-p max-clumped-together final-list buffer-alist msb--choose-file-menu-list item tmp-rest found-p completion-ignore-case] 11 (#$ . 13561)]) #@221 Create a vector from an element MENU-COND-ELT of `msb-menu-cond'. This takes the form: [BUFFER-LIST-VARIABLE CONDITION MENU-SORT-KEY MENU-TITLE ITEM-HANDLER SORTER] See `msb-menu-cond' for a description of its elements. (defalias 'msb--create-function-info #[(menu-cond-elt) "\306\307! G\310V\205 \310 8\211\203 \311\n!\203 \n\202 G\312V\203, \312 8\202- \311!\204B \203B \313=\203G \202H G\310W\203U \314\315!\210 G\310V\203h \311\n!\204h \316\317\nC\"\210 G\312V\203\211 \203\211 \311!\204\211 \313=\204\211 \316\317C\"\210\320L\210\321 @ A@\322 8\f&-\207" [list-symbol menu-cond-elt tmp-ih msb-item-handling-function item-handler msb-item-sort-function make-symbol "-msb-buffer-list" 3 fboundp 4 t error "Wrong format of msb-menu-cond" signal invalid-function nil vector 2 tmp-s sorter] 8 (#$ . 14630)]) (defalias 'msb--collect #[(function-info-vector) "\306\211\211\307\306\211 T\211\fGW\203M \f H\310\311H!\211\203C \n\312=\2034 \204C \n\313=\203<