aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorThien-Thi Nguyen2004-12-24 01:57:47 +0000
committerThien-Thi Nguyen2004-12-24 01:57:47 +0000
commit53c403031f0506f5f2e87b4da0e2580eab4049f1 (patch)
treec93df8ad4de1aa8d16f098ccd2e63b8a876a63cb /lisp
parentbd55c35cc18353ce75a4661c3a06e9a7bb88ccf4 (diff)
downloademacs-53c403031f0506f5f2e87b4da0e2580eab4049f1.tar.gz
emacs-53c403031f0506f5f2e87b4da0e2580eab4049f1.zip
Untabify, reindent; nfc.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/hideshow.el90
1 files changed, 45 insertions, 45 deletions
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 2c2797f97f0..3be0efa612a 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -408,8 +408,8 @@ Note that `mode-line-format' is buffer-local.")
408 (let ((ovs (overlays-in from to))) 408 (let ((ovs (overlays-in from to)))
409 (while ovs 409 (while ovs
410 (let ((ov (car ovs))) 410 (let ((ov (car ovs)))
411 (when (overlay-get ov 'hs) 411 (when (overlay-get ov 'hs)
412 (delete-overlay ov))) 412 (delete-overlay ov)))
413 (setq ovs (cdr ovs))))) 413 (setq ovs (cdr ovs)))))
414 414
415(defun hs-isearch-show (ov) 415(defun hs-isearch-show (ov)
@@ -429,16 +429,16 @@ OV is shown.
429This function is meant to be used as the `isearch-open-invisible-temporary' 429This function is meant to be used as the `isearch-open-invisible-temporary'
430property of an overlay." 430property of an overlay."
431 (setq hs-headline 431 (setq hs-headline
432 (if hide-p 432 (if hide-p
433 nil 433 nil
434 (or hs-headline 434 (or hs-headline
435 (let ((start (overlay-start ov))) 435 (let ((start (overlay-start ov)))
436 (buffer-substring 436 (buffer-substring
437 (save-excursion (goto-char start) 437 (save-excursion (goto-char start)
438 (beginning-of-line) 438 (beginning-of-line)
439 (skip-chars-forward " \t") 439 (skip-chars-forward " \t")
440 (point)) 440 (point))
441 start))))) 441 start)))))
442 (force-mode-line-update) 442 (force-mode-line-update)
443 (overlay-put ov 'invisible (and hide-p 'hs))) 443 (overlay-put ov 'invisible (and hide-p 'hs)))
444 444
@@ -460,10 +460,10 @@ on what kind of block is to be hidden."
460 ;; deprecated backward compatibility -- `block'<=>`code' 460 ;; deprecated backward compatibility -- `block'<=>`code'
461 (and (eq 'block hs-isearch-open) 461 (and (eq 'block hs-isearch-open)
462 (eq 'code flag))) 462 (eq 'code flag)))
463 (overlay-put overlay 'isearch-open-invisible 'hs-isearch-show) 463 (overlay-put overlay 'isearch-open-invisible 'hs-isearch-show)
464 (overlay-put overlay 464 (overlay-put overlay
465 'isearch-open-invisible-temporary 465 'isearch-open-invisible-temporary
466 'hs-isearch-show-temporary)) 466 'hs-isearch-show-temporary))
467 overlay)))) 467 overlay))))
468 468
469(defun hs-forward-sexp (match-data arg) 469(defun hs-forward-sexp (match-data arg)
@@ -519,10 +519,10 @@ and then further adjusted to be at the end of the line."
519 519
520(defun hs-safety-is-job-n () 520(defun hs-safety-is-job-n ()
521 "Warn if `buffer-invisibility-spec' does not contain symbol `hs'." 521 "Warn if `buffer-invisibility-spec' does not contain symbol `hs'."
522 (unless (and (listp buffer-invisibility-spec) 522 (unless (and (listp buffer-invisibility-spec)
523 (assq 'hs buffer-invisibility-spec)) 523 (assq 'hs buffer-invisibility-spec))
524 (message "Warning: `buffer-invisibility-spec' does not contain hs!!") 524 (message "Warning: `buffer-invisibility-spec' does not contain hs!!")
525 (sit-for 2))) 525 (sit-for 2)))
526 526
527(defun hs-inside-comment-p () 527(defun hs-inside-comment-p ()
528 "Return non-nil if point is inside a comment, otherwise nil. 528 "Return non-nil if point is inside a comment, otherwise nil.
@@ -566,7 +566,7 @@ as cdr."
566 (while (and (< (point) q) 566 (while (and (< (point) q)
567 (> (point) p) 567 (> (point) p)
568 (not (looking-at hs-c-start-regexp))) 568 (not (looking-at hs-c-start-regexp)))
569 (setq p (point));; use this to avoid an infinite cycle 569 (setq p (point)) ;; use this to avoid an infinite cycle
570 (forward-comment 1) 570 (forward-comment 1)
571 (skip-chars-forward " \t\n\f")) 571 (skip-chars-forward " \t\n\f"))
572 (when (or (not (looking-at hs-c-start-regexp)) 572 (when (or (not (looking-at hs-c-start-regexp))
@@ -646,7 +646,7 @@ Return point, or nil if original point was not in a block."
646 (hs-hide-level-recursive (1- arg) minp maxp) 646 (hs-hide-level-recursive (1- arg) minp maxp)
647 (goto-char (match-beginning hs-block-start-mdata-select)) 647 (goto-char (match-beginning hs-block-start-mdata-select))
648 (hs-hide-block-at-point t))) 648 (hs-hide-block-at-point t)))
649 (hs-safety-is-job-n) 649 (hs-safety-is-job-n)
650 (goto-char maxp)) 650 (goto-char maxp))
651 651
652(defmacro hs-life-goes-on (&rest body) 652(defmacro hs-life-goes-on (&rest body)
@@ -676,8 +676,8 @@ and `case-fold-search' are both t."
676 (let ((overlays (overlays-at (point))) 676 (let ((overlays (overlays-at (point)))
677 (found nil)) 677 (found nil))
678 (while (and (not found) (overlayp (car overlays))) 678 (while (and (not found) (overlayp (car overlays)))
679 (setq found (overlay-get (car overlays) 'hs) 679 (setq found (overlay-get (car overlays) 'hs)
680 overlays (cdr overlays))) 680 overlays (cdr overlays)))
681 found))) 681 found)))
682 682
683(defun hs-c-like-adjust-block-beginning (initial) 683(defun hs-c-like-adjust-block-beginning (initial)
@@ -725,7 +725,7 @@ If `hs-hide-comments-when-hiding-all' is non-nil, also hide the comments."
725 (funcall hs-hide-all-non-comment-function) 725 (funcall hs-hide-all-non-comment-function)
726 (hs-hide-block-at-point t))) 726 (hs-hide-block-at-point t)))
727 ;; found a comment, probably 727 ;; found a comment, probably
728 (let ((c-reg (hs-inside-comment-p))) ; blech! 728 (let ((c-reg (hs-inside-comment-p))) ; blech!
729 (when (and c-reg (car c-reg)) 729 (when (and c-reg (car c-reg))
730 (if (> (count-lines (car c-reg) (nth 1 c-reg)) 1) 730 (if (> (count-lines (car c-reg) (nth 1 c-reg)) 1)
731 (hs-hide-block-at-point t c-reg) 731 (hs-hide-block-at-point t c-reg)
@@ -774,17 +774,17 @@ See documentation for functions `hs-hide-block' and `run-hooks'."
774 ;; first see if we have something at the end of the line 774 ;; first see if we have something at the end of the line
775 (catch 'eol-begins-hidden-region-p 775 (catch 'eol-begins-hidden-region-p
776 (let ((here (point)) 776 (let ((here (point))
777 (ovs (save-excursion (end-of-line) (overlays-at (point))))) 777 (ovs (save-excursion (end-of-line) (overlays-at (point)))))
778 (while ovs 778 (while ovs
779 (let ((ov (car ovs))) 779 (let ((ov (car ovs)))
780 (when (overlay-get ov 'hs) 780 (when (overlay-get ov 'hs)
781 (goto-char 781 (goto-char
782 (cond (end (overlay-end ov)) 782 (cond (end (overlay-end ov))
783 ((eq 'comment (overlay-get ov 'hs)) here) 783 ((eq 'comment (overlay-get ov 'hs)) here)
784 (t (+ (overlay-start ov) (overlay-get ov 'hs-ofs))))) 784 (t (+ (overlay-start ov) (overlay-get ov 'hs-ofs)))))
785 (delete-overlay ov) 785 (delete-overlay ov)
786 (throw 'eol-begins-hidden-region-p t))) 786 (throw 'eol-begins-hidden-region-p t)))
787 (setq ovs (cdr ovs))) 787 (setq ovs (cdr ovs)))
788 nil)) 788 nil))
789 ;; not immediately obvious, look for a suitable block 789 ;; not immediately obvious, look for a suitable block
790 (let ((c-reg (hs-inside-comment-p)) 790 (let ((c-reg (hs-inside-comment-p))
@@ -871,9 +871,9 @@ Key bindings:
871 871
872 (interactive "P") 872 (interactive "P")
873 (setq hs-headline nil 873 (setq hs-headline nil
874 hs-minor-mode (if (null arg) 874 hs-minor-mode (if (null arg)
875 (not hs-minor-mode) 875 (not hs-minor-mode)
876 (> (prefix-numeric-value arg) 0))) 876 (> (prefix-numeric-value arg) 0)))
877 (if hs-minor-mode 877 (if hs-minor-mode
878 (progn 878 (progn
879 (hs-grok-mode-type) 879 (hs-grok-mode-type)
@@ -923,12 +923,12 @@ Key bindings:
923 923
924;; make some variables permanently buffer-local 924;; make some variables permanently buffer-local
925(let ((vars '(hs-minor-mode 925(let ((vars '(hs-minor-mode
926 hs-c-start-regexp 926 hs-c-start-regexp
927 hs-block-start-regexp 927 hs-block-start-regexp
928 hs-block-start-mdata-select 928 hs-block-start-mdata-select
929 hs-block-end-regexp 929 hs-block-end-regexp
930 hs-forward-sexp-func 930 hs-forward-sexp-func
931 hs-adjust-block-beginning))) 931 hs-adjust-block-beginning)))
932 (while vars 932 (while vars
933 (let ((var (car vars))) 933 (let ((var (car vars)))
934 (make-variable-buffer-local var) 934 (make-variable-buffer-local var)