;ELC ;;; compiled by rms@psilocin.gnu.ai.mit.edu on Thu Aug 8 20:21:48 1996 ;;; from file /home/fsf/rms/e19/lisp/imenu.el ;;; emacs version 19.32.3. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`imenu.el' was compiled for Emacs 19.29 or later")) #@56 *Non-nil means Imenu should always rescan the buffers. (defvar imenu-auto-rescan nil (#$ . -469)) #@87 * auto-rescan is disabled in buffers larger than this. This variable is buffer-local. (defvar imenu-auto-rescan-maxout 60000 (#$ . -573)) #@287 *Set this to non-nil for displaying the index in a completion buffer. Non-nil means always display the index in a completion buffer. Nil means display the index as a mouse menu when the mouse was used to invoke `imenu'. `never' means never automatically display a listing of any kind. (defvar imenu-always-use-completion-buffer-p nil (#$ . -718)) #@501 *The function to use for sorting the index mouse-menu. Affects only the mouse index menu. Set this to nil if you don't want any sorting (faster). The items in the menu are then presented in the order they were found in the buffer. Set it to `imenu--sort-by-name' if you want alphabetic sorting. The function should take two arguments and return T if the first element should come before the second. The arguments are cons cells; (NAME . POSITION). Look at `imenu--sort-by-name' for an example. (defvar imenu-sort-function nil (#$ . -1073)) #@57 *Maximum number of elements in an mouse menu for Imenu. (defvar imenu-max-items 25 (#$ . -1625)) #@231 *Progress message during the index scanning of the buffer. If non-nil, user gets a message during the scanning of the buffer Relevant only if the mode-specific function that creates the buffer index use `imenu-progress-message'. (defvar imenu-scanning-message "Scanning buffer for index (%3d%%)" (#$ . -1729)) #@140 *The replacement string for spaces in index names. Used when presenting the index in a completion-buffer to make the names work as tokens. (defvar imenu-space-replacement "^" (#$ . -2047)) #@150 *The separator between index names of different levels. Used for making mouse-menu titles and for flattening nested indexes with name concatenation. (defvar imenu-level-separator ":" (#$ . -2243)) #@1065 The regex pattern to use for creating a buffer index. If non-nil this pattern is passed to `imenu-create-index-with-pattern' to create a buffer index. It is an alist with elements that look like this: (MENU-TITLE REGEXP INDEX). MENU-TITLE is a string used as the title for the submenu or nil if the entries are not nested. REGEXP is a regexp that should match a construct in the buffer that is to be displayed in the menu; i.e., function or variable definitions, etc. It contains a substring which is the name to appear in the menu. See the info section on Regexps for more information. INDEX points to the substring in REGEXP that contains the name (of the function, variable or type) that is to appear in the menu. For emacs-lisp-mode for example PATTERN would look like: '((nil "^\\s-*(def\\(un\\|subst\\|macro\\|advice\\)\\s-+\\([-A-Za-z0-9+]+\\)" 2) ("*Vars*" "^\\s-*(def\\(var\\|const\\)\\s-+\\([-A-Za-z0-9+]+\\)" 2) ("*Types*" "^\\s-*(def\\(type\\|struct\\|class\\|ine-condition\\)\\s-+\\([-A-Za-z0-9+]+\\)" 2)) The variable is buffer-local. (defvar imenu-generic-expression nil (#$ . 2448)) (make-variable-buffer-local (quote imenu-generic-expression)) #@370 The function to use for creating a buffer index. It should be a function that takes no arguments and returns an index of the current buffer as an alist. The elements in the alist look like: (INDEX-NAME . INDEX-POSITION). You may also nest index list like (INDEX-NAME . INDEX-ALIST). This function is called within a `save-excursion'. The variable is buffer-local. (defvar imenu-create-index-function (quote imenu-default-create-index-function) (#$ . 3631)) (make-variable-buffer-local (quote imenu-create-index-function)) #@374 Function for finding the next index position. If `imenu-create-index-function' is set to `imenu-default-create-index-function', then you must set this variable to a function that will find the next index, looking backwards in the file. The function should leave point at the place to be connected to the index and it should return nil when it doesn't find another index. (defvar imenu-prev-index-position-function (quote beginning-of-defun) (#$ . 4165)) (make-variable-buffer-local (quote imenu-prev-index-position-function)) #@138 Function for extracting the index name. This function is called after the function pointed out by `imenu-prev-index-position-function'. (defvar imenu-extract-index-name-function nil (#$ . 4700)) (make-variable-buffer-local (quote imenu-extract-index-name-function)) (defalias 'imenu-progress-message '(macro . #[(prevpos &optional relpos reverse) "\f\f\fDDC\fȂ#\fEE\fBBEEEE" [and imenu-scanning-message let pos relpos imenu--relative-position reverse if t > + 5 prevpos progn (message imenu-scanning-message pos) setq (pos)] 11])) (defalias 'imenu-example--name-and-position #[nil "!` `  Ɠ \f{ ,B" [forward-sexp -1 make-marker marker end beg nil] 3]) (defalias 'imenu-example--lisp-extract-index-name #[nil " Ž!Ǐ*" [match-data match-data ((store-match-data match-data)) looking-at "(def" nil (byte-code "!!`!` {*" [down-list 1 forward-sexp 2 -1 end beg] 4) ((error))] 3]) (defalias 'imenu-example--create-lisp-index #[nil "db \") B! \\VA\") Ў!!!e! \fB!w! B!!`SfU!!! B! \nB)* \")\f\fB B B B\n\nB B -" [nil prev-pos index-unknown-alist index-type-alist index-var-alist index-alist imenu-scanning-message 0 pos message beginning-of-defun imenu--relative-position t 5 match-data match-data ((store-match-data match-data)) looking-at "(def" down-list 1 "def\\(var\\|const\\)" forward-sexp 2 imenu-example--name-and-position "def\\(un\\|subst\\|macro\\|advice\\)" "def\\(type\\|struct\\|class\\|ine-condition\\)" 41 -1 100 "Variables" "Types" "Syntax-unknown"] 6]) (byte-code "!ÉŰB" [boundp imenu-example--function-name-regexp-c "^[a-zA-Z0-9]+[ ]?" "\\([a-zA-Z0-9_*]+[ ]+\\)?" "\\([*&]+[ ]*\\)?" "\\([a-zA-Z0-9_*]+\\)[ ]*(" current-load-list] 5) (defalias 'imenu-example--create-c-index #[(&optional regexp) "eb\f\f\")  ʎ\f( #e\fI!\n\\VH\f\")!`\"bg) = B *\fw\f\") +" [nil char prev-pos index-alist imenu-scanning-message 0 pos message match-data match-data ((store-match-data match-data)) re-search-forward regexp imenu-example--function-name-regexp-c t imenu--relative-position 5 backward-up-list 1 scan-sexps 59 imenu-example--name-and-position 100] 5]) (byte-code "\nB!\nB!!\nB!!0\nBŇ" [("*Rescan*" . -99) imenu--rescan-item current-load-list boundp imenu--index-alist nil make-variable-buffer-local imenu--last-menubar-index-alist imenu--history-list] 2) (defalias 'imenu--sort-by-name #[(item1 item2) "@ @" [item1 item2] 2]) (defalias 'imenu--relative-position #[(&optional reverse) "`  \nZ V\nS ť]&\nS_ ]*" [buffer-size total pos reverse 50000 100 1] 3]) (defalias 'imenu--split #[(list n) ".A@\fB TU \f B \f7\f B ," [list nil 0 i sublist result remain n] 5]) (defalias 'imenu--split-menu #[(menulist title) "G V\f \"\")B\fB" [menulist imenu-max-items 0 count title mapcar #[(menu) "\n T#\fB" [format "(%s-%d)" title count menu] 5] imenu--split] 6]) (defalias 'imenu--split-submenus #[(alist) "\n\"" [mapcar #[(elt) ":@;A<A@\"" [elt imenu--split-menu] 3] alist] 3]) (defalias 'imenu--make-index-alist #[(&optional noerror) "   V\f )$ $!+C B" [imenu--index-alist imenu-auto-rescan buffer-size imenu-auto-rescan-maxout imenu-create-index-function noerror error "No items suitable for an index found in this buffer" nil imenu--rescan-item] 2]) (defalias 'imenu--cleanup #[(&optional alist) " \"ć" [alist imenu--index-alist mapcar #[(item) " A! A‰ A: A!" [markerp item nil imenu--cleanup] 3] t] 3]) (defalias 'imenu--create-keymap-2 #[(alist counter &optional commands) "\f\")" [nil map mapcar #[(item) "A<\nT@@FA\n\\#\"-DDF0B@@)BB" [item append counter keymap imenu--create-keymap-2 10 commands lambda nil (interactive) imenu--menubar-select quote (nil) t end] 6] alist] 3]) (defalias 'imenu--create-keymap-1 #[(title alist &optional commands) "\nD\f#\"" [append keymap title imenu--create-keymap-2 alist 0 commands] 6]) #@65 Check whether the string STR is contained in multi-level ALIST. (defalias 'imenu--in-alist #[(str alist) " = @A A\f@ (\f\n\n<\n\n\"\n ," [nil res tail head elt alist str imenu--in-alist] 5 (#$ . 9005)]) #@223 *Wrapper for index searching functions. Moves point to end of buffer and then repeatedly calls `imenu-prev-index-position-function' and `imenu-extract-index-name-function'. Their results are gathered into an index alist. (defalias 'imenu-default-create-index-function #[nil " !w\n!wÉdb)  \" ) `K! \\VJ \" )\n )\f;)\f`BB)s  \" )+!\"" [fboundp imenu-prev-index-position-function imenu-extract-index-name-function nil name prev-pos index-alist imenu-scanning-message 0 pos message imenu--relative-position t 5 100 imenu-generic-expression imenu--generic-function error "The mode \"%s\" does not take full advantage of imenu.el yet." mode-name] 4 (#$ . -9258)]) (defalias 'imenu--replace-spaces #[(name replacement) "\n#" [mapconcat #[(ch) " \" !" [char-equal ch 32 replacement char-to-string] 3] name ""] 4]) (defalias 'imenu--flatten-index-alist #[(index-alist &optional concat-names prefix) "\n\"" [mapcan #[(item) "@A \f\f Q \n!#\n+\nBC0\n\"+" [item name pos concat-names prefix imenu-level-separator new-prefix markerp imenu--flatten-index-alist] 3] index-alist] 3]) #@1184 Return an index of the current buffer as an alist. PATTERN is an alist with elements that look like this: (MENU-TITLE REGEXP INDEX). MENU-TITLE is a string used as the title for the submenu or nil if the entries are not nested. REGEXP is a regexp that should match a construct in the buffer that is to be displayed in the menu; i.e., function or variable definitions, etc. It contains a substring which is the name to appear in the menu. See the info section on Regexps for more information. INDEX points to the substring in REGEXP that contains the name (of the function, variable or type) that is to appear in the menu. For emacs-lisp-mode for example PATTERN would look like: '((nil "^\\s-*(def\\(un\\|subst\\|macro\\|advice\\)\\s-+\\([-A-Za-z0-9]+\\)" 2) ("*Vars*" "^\\s-*(def\\(var\\|const\\)\\s-+\\([-A-Za-z0-9]+\\)" 2) ("*Types*" "^\\s-*(def\\(type\\|struct\\|class\\|ine-condition\\)\\s-+\\([-A-Za-z0-9]+\\)" 2))' Returns an index of the current buffer as an alist. The elements in the alist look like: (INDEX-NAME . INDEX-POSITION). They may also be nested index lists like (INDEX-NAME . INDEX-ALIST) depending on pattern. (imenu--generic-function PATTERN). (defalias 'imenu--generic-function #[(patterns) "C #Q \n db\f+\f\") Ҏ #j\fY!\\VX\f\")\n͔b \")1*\f\f\")  \"\"-" [dummy nil "\\(" mapconcat #[(pattern) "A@" [pattern] 1] patterns "\\)\\|\\(" "\\)" prev-pos global-regexp found index-alist imenu-scanning-message 0 pos message match-data match-data ((store-match-data match-data)) re-search-backward t imenu--relative-position 5 mapcar #[(pat) "@A@AA@\f?I\n!I \"B\n \f\"> B\fB\f@\nAB,+" [pat index regexp menu-title found looking-at end beg t buffer-substring-no-properties --arg1--52602 assoc index-alist nil G52600] 4] 100 main-element delq] 8 (#$ . 10469)]) #@129 Let the user select from INDEX-ALIST in a completion buffer with PROMPT. Returns t for rescan and otherwise a position number. (defalias 'imenu--completion-buffer #[(index-alist &optional prompt) " \"=$\n\f&'΋;1T@>̂T\f\"A