diff options
| author | Thien-Thi Nguyen | 1999-12-29 09:00:35 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 1999-12-29 09:00:35 +0000 |
| commit | 1a8e83dc409c3fde0ee728a90233b145d222c8eb (patch) | |
| tree | 67bfb0898b2a40a8aeedb4081deae396f828d89b | |
| parent | 1c89844b125ac9ffc71a50b41ee6e26cc90fe448 (diff) | |
| download | emacs-1a8e83dc409c3fde0ee728a90233b145d222c8eb.tar.gz emacs-1a8e83dc409c3fde0ee728a90233b145d222c8eb.zip | |
(hs-minor-mode-menu): Fix omission bug; was used but not declared.
(hs-discard-overlays, hs-isearch-show, hs-isearch-show-temporary,
hs-find-block-beginning): Add or modify docstrings.
(hs-isearch-show): Rewrite.
| -rw-r--r-- | lisp/progmodes/hideshow.el | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 6573ab35e68..e5b16c185be 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el | |||
| @@ -29,8 +29,8 @@ | |||
| 29 | 29 | ||
| 30 | ;; * Commands provided | 30 | ;; * Commands provided |
| 31 | ;; | 31 | ;; |
| 32 | ;; This file provides `hs-minor-mode'. When active, eight commands are | 32 | ;; This file provides Hideshow Minor Mode. When active, eight commands |
| 33 | ;; available, implementing block hiding and showing. They (and their | 33 | ;; are available, implementing block hiding and showing. They (and their |
| 34 | ;; keybindings) are: | 34 | ;; keybindings) are: |
| 35 | ;; | 35 | ;; |
| 36 | ;; hs-hide-block C-c h | 36 | ;; hs-hide-block C-c h |
| @@ -254,6 +254,9 @@ Use the command `hs-minor-mode' to toggle or set this variable.") | |||
| 254 | (defvar hs-minor-mode-map nil | 254 | (defvar hs-minor-mode-map nil |
| 255 | "Keymap for hideshow minor mode.") | 255 | "Keymap for hideshow minor mode.") |
| 256 | 256 | ||
| 257 | (defvar hs-minor-mode-menu nil | ||
| 258 | "Menu for hideshow minor mode.") | ||
| 259 | |||
| 257 | (defvar hs-c-start-regexp nil | 260 | (defvar hs-c-start-regexp nil |
| 258 | "Regexp for beginning of comments. | 261 | "Regexp for beginning of comments. |
| 259 | Differs from mode-specific comment regexps in that | 262 | Differs from mode-specific comment regexps in that |
| @@ -340,6 +343,7 @@ Note that `mode-line-format' is buffer-local.") | |||
| 340 | ;; support functions | 343 | ;; support functions |
| 341 | 344 | ||
| 342 | (defun hs-discard-overlays (from to) | 345 | (defun hs-discard-overlays (from to) |
| 346 | "Delete hideshow overlays in region defined by FROM and TO." | ||
| 343 | (when (< to from) | 347 | (when (< to from) |
| 344 | (setq from (prog1 to (setq to from)))) | 348 | (setq from (prog1 to (setq to from)))) |
| 345 | (mapcar (lambda (ov) | 349 | (mapcar (lambda (ov) |
| @@ -348,10 +352,21 @@ Note that `mode-line-format' is buffer-local.") | |||
| 348 | (overlays-in from to))) | 352 | (overlays-in from to))) |
| 349 | 353 | ||
| 350 | (defun hs-isearch-show (ov) | 354 | (defun hs-isearch-show (ov) |
| 355 | "Delete overlay OV, and set `hs-headline' to nil. | ||
| 356 | |||
| 357 | This function is meant to be used as the `isearch-open-invisible' | ||
| 358 | property of an overlay." | ||
| 351 | (setq hs-headline nil) | 359 | (setq hs-headline nil) |
| 352 | (hs-flag-region (overlay-start ov) (overlay-end ov) nil)) | 360 | (delete-overlay ov)) |
| 353 | 361 | ||
| 354 | (defun hs-isearch-show-temporary (ov hide-p) | 362 | (defun hs-isearch-show-temporary (ov hide-p) |
| 363 | "Hide or show overlay OV, and set `hs-headline', all depending on HIDE-P. | ||
| 364 | If HIDE-P is non-nil, `hs-headline' is set to nil and overlay OV is hidden. | ||
| 365 | Otherwise, `hs-headline' is set to the line of text at the head of OV, and | ||
| 366 | OV is shown. | ||
| 367 | |||
| 368 | This function is meant to be used as the `isearch-open-invisible-temporary' | ||
| 369 | property of an overlay." | ||
| 355 | (setq hs-headline | 370 | (setq hs-headline |
| 356 | (if hide-p | 371 | (if hide-p |
| 357 | nil | 372 | nil |
| @@ -531,7 +546,7 @@ function; and adjust-block-beginning function." | |||
| 531 | 546 | ||
| 532 | (defun hs-find-block-beginning () | 547 | (defun hs-find-block-beginning () |
| 533 | "Reposition point at block-start. | 548 | "Reposition point at block-start. |
| 534 | Return point, or nil if top-level." | 549 | Return point, or nil if original point was not in a block." |
| 535 | (let ((done nil) | 550 | (let ((done nil) |
| 536 | (here (point))) | 551 | (here (point))) |
| 537 | ;; look if current line is block start | 552 | ;; look if current line is block start |