• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/progmodes/

Lines Matching +defs:minor +defs:mode +defs:alist

1 ;;; hideshow.el --- minor mode cmds to selectively display code/comment blocks
46 ;; Blocks are defined per mode. In c-mode, c++-mode and java-mode, they
51 ;; The command `M-x hs-minor-mode' toggles the minor mode or sets it
52 ;; (similar to other minor modes).
61 ;; (add-hook 'X-mode-hook ; other modes similarly
62 ;; (lambda () (hs-minor-mode 1)))
65 ;; hideshow minor mode by typing `M-x hs-minor-mode'. After hideshow is
66 ;; activated or deactivated, `hs-minor-mode-hook' is run w/ `run-hooks'.
111 ;; in the mode line by modifying the variable `mode-line-format'. For
112 ;; example, the following code prepends this info to the mode line:
114 ;; (unless (memq 'hs-headline mode-line-format)
115 ;; (setq mode-line-format
116 ;; (append '("-" hs-headline) mode-line-format)))
118 ;; See documentation for `mode-line-format' for more info.
131 ;; and comment definitions by examining the buffer's major mode. If
134 ;; variable `hs-special-modes-alist'. Packages that use hideshow should
137 ;; (add-to-list 'hs-special-modes-alist '(my-mode "{{" "}}" ...))
141 ;; `hs-special-modes-alist' for more info on the entry format.
163 ;; `M-x hs-minor-mode' twice (that is, deactivate then re-activate
171 ;; buffer and switches `normal-mode' on. In the case where you have
172 ;; `hs-hide-initial-comment-block' in `hs-minor-mode-hook', the hiding of
174 ;; to be only in `normal-mode'), so there are unbalanced "(" and ")".
176 ;; The workaround is to clear `hs-minor-mode-hook' when byte-compiling:
181 ;; (let ((hs-minor-mode-hook nil))
241 "Minor mode for hiding and showing program and comment blocks."
250 (defcustom hs-minor-mode-hook nil
251 "*Hook called when hideshow minor mode is activated or deactivated."
273 (defvar hs-special-modes-alist
274 '((c-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning)
275 (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning)
276 (bibtex-mode ("^@\\S(*\\(\\s(\\)" 1))
277 (java-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning))
283 and comments, respectively for major mode MODE.
293 see the `hs-special-modes-alist' entry for `bibtex-mode'.
344 (defvar hs-minor-mode nil
345 "Non-nil if using hideshow mode as a minor mode of some other mode.
346 Use the command `hs-minor-mode' to toggle or set this variable.")
348 (defvar hs-minor-mode-map nil
349 "Keymap for hideshow minor mode.")
351 (defvar hs-minor-mode-menu nil
352 "Menu for hideshow minor mode.")
356 Differs from mode-specific comment regexps in that
400 You can display this in the mode line by adding the symbol `hs-headline'
401 to the variable `mode-line-format'. For example,
403 (unless (memq 'hs-headline mode-line-format)
404 (setq mode-line-format
405 (append '(\"-\" hs-headline) mode-line-format)))
407 Note that `mode-line-format' is buffer-local.")
488 (force-mode-line-update)
612 (defun hs-grok-mode-type ()
614 If `hs-special-modes-alist' has information associated with the
615 current buffer's major mode, use that.
621 (let* ((lookup (assoc major-mode hs-special-modes-alist))
640 (setq hs-minor-mode nil)
641 (error "%s Mode doesn't support Hideshow Minor Mode" mode-name)))
682 "Evaluate BODY forms iff variable `hs-minor-mode' is non-nil.
685 `(when hs-minor-mode
881 (defun hs-minor-mode (&optional arg)
882 "Toggle hideshow minor mode.
883 With ARG, turn hideshow minor mode on if ARG is positive, off otherwise.
884 When hideshow minor mode is on, the menu bar is augmented with hideshow
892 Turning hideshow minor mode off reverts the menu bar and the
895 Lastly, the normal hook `hs-minor-mode-hook' is run using `run-hooks'.
898 \\{hs-minor-mode-map}"
902 hs-minor-mode (if (null arg)
903 (not hs-minor-mode)
905 (if hs-minor-mode
907 (hs-grok-mode-type)
908 ;; Turn off this mode if we change major modes.
909 (add-hook 'change-major-mode-hook
912 (easy-menu-add hs-minor-mode-menu)
915 (easy-menu-remove hs-minor-mode-menu)
918 (let ((hs-minor-mode t))
920 (run-hooks 'hs-minor-mode-hook))
924 "Unconditionally turn off `hs-minor-mode'."
925 (hs-minor-mode -1))
931 (unless hs-minor-mode-map
932 (setq hs-minor-mode-map (make-sparse-keymap))
933 (easy-menu-define hs-minor-mode-menu
934 hs-minor-mode-map
935 "Menu used when hideshow minor mode is active."
942 (define-key hs-minor-mode-map (aref ent 2) (aref ent 1))
944 ;; These bindings roughly imitate those used by Outline mode.
956 (add-to-list 'minor-mode-map-alist (cons 'hs-minor-mode hs-minor-mode-map))
957 (add-to-list 'minor-mode-alist '(hs-minor-mode " hs") t)
960 (dolist (var '(hs-minor-mode