;ELC ;;; compiled by rms@mole.gnu.ai.mit.edu on Sun Mar 3 04:30:15 1996 ;;; from file /home/fsf/rms/e19/lisp/hideshow.el ;;; emacs version 19.30.91.2. ;;; 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 "`hideshow.el' was compiled for Emacs 19.29 or later")) #@621 *Symbol representing how "unbalanced parentheses" should be handled. This error is usually signaled by `hs-show-block'. One of four values: `top-level', `next-line', `signal' or `ignore'. Default is `top-level'. - `top-level' -- Show top-level block containing the currently troublesome block. - `next-line' -- Use the fact that, for an already hidden block, its end will be on the next line. Attempt to show this block. - `signal' -- Pass the error through, stopping execution. - `ignore' -- Ignore the error, continuing execution. Values other than these four will be interpreted as `signal'. (defvar hs-unbalance-handler-method (quote top-level) (#$ . -475)) #@717 *Alist of the form (MODE START-RE END-RE FORWARD-SEXP-FUNC). If present, hideshow will use these values for the start and end regexps, respectively. Since Algol-ish languages do not have single-character block delimiters, the function `forward-sexp' which is used by hideshow doesn't work. In this case, if a similar function is provided, you can register it and have hideshow use it instead of `forward-sexp'. To add more values, use (pushnew '(new-mode st-re end-re function-name) hs-special-modes-alist :test 'equal) For example: (pushnew '(simula-mode "begin" "end" simula-next-statement) hs-special-modes-alist :test 'equal) Note that the regexps should not contain leading or trailing whitespace. (defvar hs-special-modes-alist (quote ((c-mode "{" "}") (c++-mode "{" "}"))) (#$ . -1169)) #@64 *Hooks called at the end of `hs-hide-all' and `hs-hide-block'. (defvar hs-hide-hook nil (#$ . -1982)) #@128 *Hooks called at the end of commands to show text. These commands include `hs-show-all', `hs-show-block' and `hs-show-region'. (defvar hs-show-hook nil (#$ . -2091)) #@66 *Prefix key to use for hideshow commands in hideshow minor mode. (defvar hs-minor-mode-prefix "" (#$ . -2263)) #@125 Non-nil if using hideshow mode as a minor mode of some other mode. Use the command `hs-minor-mode' to toggle this variable. (defvar hs-minor-mode nil (#$ . 2382)) #@35 Mode map for hideshow minor mode. (defvar hs-minor-mode-map nil (#$ . 2551)) #@49 Menu bar for hideshow minor mode (Xemacs only). (defvar hs-menu-bar nil (#$ . 2634)) #@137 Regexp for beginning of comments. Buffer-local. Differs from mode-specific comment regexps in that surrounding whitespace is stripped. (defvar hs-c-start-regexp nil (#$ . 2726)) #@69 Regexp for end of comments. Buffer-local. See `hs-c-start-regexp'. (defvar hs-c-end-regexp nil (#$ . 2911)) #@47 Regexp for beginning of block. Buffer-local. (defvar hs-block-start-regexp nil (#$ . 3026)) #@41 Regexp for end of block. Buffer-local. (defvar hs-block-end-regexp nil (#$ . 3125)) #@312 Function used to do a forward-sexp. Should change for Algol-ish modes. For single-character block delimiters -- ie, the syntax table regexp for the character is either `(' or `)' -- `hs-forward-sexp-func' would just be `forward-sexp'. For other modes such as simula, a more specialized function is necessary. (defvar hs-forward-sexp-func (quote forward-sexp) (#$ . 3217)) #@44 Used to support both FSF Emacs and Xemacs. (defvar hs-emacs-type (quote fsf) (#$ . 3597)) #@169 Hides or shows lines from FROM to TO, according to FLAG. If FLAG is `?\n' (the newline character) then show the text; if FLAG is `?\^M' (control-M) then hide the text. (defalias 'hs-flag-region #[(from to flag) " ĎUʂ%+" [buffer-modified-p nil buffer-read-only modp ((set-buffer-modified-p modp)) subst-char-in-region from to flag 10 13 t] 6 (#$ . 3694)]) #@74 Hide block iff on block beginning, optional END means reposition at end. (defalias 'hs-hide-block-at-point #[(&optional end) " !5` !`y\n`W)\n \"V)\n`# 2 3\nb*" [looking-at hs-block-start-regexp p hs-forward-sexp-func 1 q -1 nil count-lines hs-flag-region 13 end] 4 (#$ . 4079)]) #@75 Show block iff on block beginning. Optional END means reposition at end. (defalias 'hs-show-block-at-point #[(&optional end) " !\"`ŏ\n# `T \nb*" [looking-at hs-block-start-regexp p error (byte-code "!`" [hs-forward-sexp-func 1] 2) ((error (byte-code "=`=%iU `Pd$`=5y`` @ A\"" [hs-unbalance-handler-method ignore top-level 0 beginning-of-defun p re-search-forward "^" hs-block-start-regexp t 2 next-line signal error] 5))) q hs-flag-region 10 end] 4 (#$ . 4391)]) #@69 Warn if `selective-display' or `selective-display-ellipses' is nil. (defalias 'hs-safety-is-job-n #[nil "\n\f P GU? \"!)" ["" str selective-display "selective-display nil " selective-display-ellipses "selective-display-ellipses nil" 0 message "warning: %s" sit-for 2] 3 (#$ . 4926)]) #@189 Returns non-nil if point is inside a comment, otherwise nil. Actually, for multi-line-able comments, returns a list containing the buffer position of the start and the end of the comment. (defalias 'hs-inside-comment-p #[nil "` Ę%y\n#!\n#?)G\fd#`!d#`GZ\nWGƔ D+" [nil q p comment-end "" found 0 re-search-forward hs-c-start-regexp t search-forward "\"" hs-c-end-regexp 1 forward-comment -1 comment-start] 5 (#$ . 5239)]) #@51 Setup variables for new buffers where applicable. (defalias 'hs-grok-mode-type #[nil "!d!d !\f\"\fljSO\nȘ(ɂ+\n!\n\n\"=\nǕO\n\"A@L8V8`׉)" [boundp comment-start comment-end regexp-quote hs-c-start-regexp string-match " +$" 0 "" "\n" hs-c-end-regexp "^ +" nil assoc major-mode hs-special-modes-alist lookup "\\s(" hs-block-start-regexp 2 "\\s)" hs-block-end-regexp 3 forward-sexp hs-forward-sexp-func] 4 (#$ . 5708)]) #@71 Repositions point at block-start. Return point, or nil if top-level. (defalias 'hs-find-block-beginning #[nil "`\n\fŰ6e#6˔*˔̕b !=b+" [nil "\\(" hs-block-start-regexp "\\)\\|\\(" hs-block-end-regexp "\\)" both-regexps here done re-search-backward t 1 2 hs-forward-sexp-func -1] 8 (#$ . 6192)]) #@65 Executes optional BODY iff variable `hs-minor-mode' is non-nil. (defalias 'hs-life-goes-on '(macro . #[(&rest body) " BE" [if hs-minor-mode progn body] 4 (#$ . 6541)])) #@192 Hides all top-level blocks, displaying only first and last lines. It moves point to the beginning of the line, and it runs the normal hook `hs-hide-hook'. See documentation for `run-hooks'. (defalias 'hs-hide-all #[nil "M!ed#ebP !d#>Ŕb! T \"* )y!!" [hs-minor-mode message "hiding all blocks ..." hs-flag-region 10 0 "^" hs-block-start-regexp top-level-re count forward-comment buffer-size re-search-forward t hs-hide-block-at-point "hiding ... %d" hs-safety-is-job-n "hiding all blocks ... done" run-hooks hs-hide-hook] 4 (#$ . 6721) nil]) #@132 Shows all top-level blocks. This does not change point; it runs the normal hook `hs-show-hook'. See documentation for `run-hooks'. (defalias 'hs-show-all #[nil "!ed#!!" [hs-minor-mode message "showing all blocks ..." hs-flag-region 10 "showing all blocks ... done" run-hooks hs-show-hook] 4 (#$ . 7321) nil]) #@287 Selects a block and hides it. With prefix arg, reposition at end. Block is defined as a sexp for lispish modes, mode-specific otherwise. Comments are blocks, too. Upon completion, point is at repositioned and the normal hook `hs-hide-hook' is run. See documentation for `run-hooks'. (defalias 'hs-hide-block #[(&optional end) "h P Ę!g\n@\nA@\"W)!g\nA@by\n@`# C\nA@E\n@b !g!\\ g ! !)" [hs-minor-mode hs-inside-comment-p c-reg comment-end "" message "can't hide a single-line comment" count-lines 2 "not enough comment lines to hide" -1 hs-flag-region 13 end hs-safety-is-job-n run-hooks hs-hide-hook looking-at hs-block-start-regexp hs-find-block-beginning hs-hide-block-at-point] 5 (#$ . 7653) "P"]) #@206 Selects a block and shows it. With prefix arg, reposition at end. Upon completion, point is repositioned and the normal hook `hs-show-hook' is run. See documentation for `hs-hide-block' and `run-hooks'. (defalias 'hs-show-block #[(&optional end) "I 1 Ę!H\n@\nA@# +\nA@-\n@bH != H ! !)" [hs-minor-mode hs-inside-comment-p c-reg comment-end "" message "already looking at the entire comment" hs-flag-region 10 end looking-at hs-block-start-regexp hs-find-block-beginning hs-show-block-at-point hs-safety-is-job-n run-hooks hs-show-hook] 5 (#$ . 8421) "P"]) #@279 Shows all lines from BEG to END, without doing any block analysis. Note:` hs-show-region' is intended for use when when `hs-show-block' signals `unbalanced parentheses' and so is an emergency measure only. You may become very confused if you use this command indiscriminately. (defalias 'hs-show-region #[(beg end) "\n # !" [hs-minor-mode hs-flag-region beg end 10 hs-safety-is-job-n run-hooks hs-show-hook] 4 (#$ . 9026) "r"]) #@510 Toggle hideshow minor mode. With ARG, turn hideshow minor mode on if ARG is positive, off otherwise. When hideshow minor mode is on, the menu bar is augmented with hideshow commands and the hideshow commands are enabled. The variables `selective-display' and `selective-display-ellipses' are set to t. Last, the normal hook `hs-minor-mode-hook' is run; see the doc for `run-hooks'. Turning hideshow minor mode off reverts the menu bar and the variables to default values and disables the hideshow commands. (defalias 'hs-minor-mode #[(&optional arg) " ?!V7\f=*!! @ A#  !\f=F \"!!!" [arg hs-minor-mode prefix-numeric-value 0 hs-emacs-type lucid set-buffer-menubar copy-sequence current-menubar add-menu nil hs-menu-bar t selective-display selective-display-ellipses hs-grok-mode-type run-hooks hs-minor-mode-hook delete kill-local-variable] 5 (#$ . 9474) "P"]) (byte-code "\n\" Â\f S =% S!B######cBBrC\"!!!!!!######!" [string-match "xemacs\\|lucid" emacs-version lucid fsf hs-emacs-type hs-minor-mode-map make-sparse-keymap ("hideshow" ["Hide Block" hs-hide-block t] ["Show Block" hs-show-block t] ["Hide All" hs-hide-all t] ["Show All" hs-show-all t] ["Show Region" hs-show-region t]) hs-menu-bar define-key [menu-bar hideshow] "hideshow" [menu-bar hideshow hs-show-region] ("Show Region" . hs-show-region) [menu-bar hideshow hs-show-all] ("Show All" . hs-show-all) [menu-bar hideshow hs-hide-all] ("Hide All" . hs-hide-all) [menu-bar hideshow hs-show-block] ("Show Block" . hs-show-block) [menu-bar hideshow hs-hide-block] ("Hide Block" . hs-hide-block) hs-minor-mode minor-mode-map-alist minor-mode-alist append (hs-minor-mode " hs") make-variable-buffer-local hs-c-start-regexp hs-c-end-regexp hs-block-start-regexp hs-block-end-regexp hs-forward-sexp-func put permanent-local t provide hideshow] 6)