Mercurial > emacs
comparison lisp/progmodes/hideshow.el @ 105189:7669aca277d5
* progmodes/hideshow.el (hs-show-block): Run `hs-show-hook'. (Bug#4548)
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 25 Sep 2009 00:32:21 +0000 |
parents | ea67ac46d172 |
children | b78ceb253d15 |
comparison
equal
deleted
inserted
replaced
105188:d59e748dff99 | 105189:7669aca277d5 |
---|---|
369 ["Hide Level" hs-hide-level | 369 ["Hide Level" hs-hide-level |
370 :help "Hide all block at levels below the current block"] | 370 :help "Hide all block at levels below the current block"] |
371 ["Toggle Hiding" hs-toggle-hiding | 371 ["Toggle Hiding" hs-toggle-hiding |
372 :help "Toggle the hiding state of the current block"] | 372 :help "Toggle the hiding state of the current block"] |
373 "----" | 373 "----" |
374 ["Hide comments when hiding all" | 374 ["Hide comments when hiding all" |
375 (setq hs-hide-comments-when-hiding-all | 375 (setq hs-hide-comments-when-hiding-all |
376 (not hs-hide-comments-when-hiding-all)) | 376 (not hs-hide-comments-when-hiding-all)) |
377 :help "If t also hide comment blocks when doing `hs-hide-all'" | 377 :help "If t also hide comment blocks when doing `hs-hide-all'" |
378 :style toggle :selected hs-hide-comments-when-hiding-all] | 378 :style toggle :selected hs-hide-comments-when-hiding-all] |
379 ("Reveal on isearch" | 379 ("Reveal on isearch" |
867 (looking-at hs-block-start-regexp)) | 867 (looking-at hs-block-start-regexp)) |
868 (setq p (point) | 868 (setq p (point) |
869 q (progn (hs-forward-sexp (match-data t) 1) (point))))) | 869 q (progn (hs-forward-sexp (match-data t) 1) (point))))) |
870 (when (and p q) | 870 (when (and p q) |
871 (hs-discard-overlays p q) | 871 (hs-discard-overlays p q) |
872 (goto-char (if end q (1+ p))))) | 872 (goto-char (if end q (1+ p)))))) |
873 (run-hooks 'hs-show-hook)))) | 873 (run-hooks 'hs-show-hook))) |
874 | 874 |
875 (defun hs-hide-level (arg) | 875 (defun hs-hide-level (arg) |
876 "Hide all blocks ARG levels below this block. | 876 "Hide all blocks ARG levels below this block. |
877 The hook `hs-hide-hook' is run; see `run-hooks'." | 877 The hook `hs-hide-hook' is run; see `run-hooks'." |
878 (interactive "p") | 878 (interactive "p") |
917 (when (> (count-lines beg end) 1) | 917 (when (> (count-lines beg end) 1) |
918 (hs-hide-comment-region beg end))))))) | 918 (hs-hide-comment-region beg end))))))) |
919 | 919 |
920 ;;;###autoload | 920 ;;;###autoload |
921 (define-minor-mode hs-minor-mode | 921 (define-minor-mode hs-minor-mode |
922 "Minor mode to selectively hide/show code and comment blocks. | 922 "Minor mode to selectively hide/show code and comment blocks. |
923 When hideshow minor mode is on, the menu bar is augmented with hideshow | 923 When hideshow minor mode is on, the menu bar is augmented with hideshow |
924 commands and the hideshow commands are enabled. | 924 commands and the hideshow commands are enabled. |
925 The value '(hs . t) is added to `buffer-invisibility-spec'. | 925 The value '(hs . t) is added to `buffer-invisibility-spec'. |
926 | 926 |
927 The main commands are: `hs-hide-all', `hs-show-all', `hs-hide-block', | 927 The main commands are: `hs-hide-all', `hs-show-all', `hs-hide-block', |
933 | 933 |
934 Lastly, the normal hook `hs-minor-mode-hook' is run using `run-hooks'. | 934 Lastly, the normal hook `hs-minor-mode-hook' is run using `run-hooks'. |
935 | 935 |
936 Key bindings: | 936 Key bindings: |
937 \\{hs-minor-mode-map}" | 937 \\{hs-minor-mode-map}" |
938 :group 'hideshow | 938 :group 'hideshow |
939 :lighter " hs" | 939 :lighter " hs" |
940 :keymap hs-minor-mode-map | 940 :keymap hs-minor-mode-map |
941 (setq hs-headline nil) | 941 (setq hs-headline nil) |
942 (if hs-minor-mode | 942 (if hs-minor-mode |
943 (progn | 943 (progn |