diff options
| author | Thien-Thi Nguyen | 2005-09-14 00:16:25 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 2005-09-14 00:16:25 +0000 |
| commit | 2bbf184223d79952d8da0a8586a5848fd8d9ec05 (patch) | |
| tree | 737a9e4d8c61efe23fdeed5086744201909097bb | |
| parent | 6ff5b06482f68c8d4c94427c245f15d82c04a3c3 (diff) | |
| download | emacs-2bbf184223d79952d8da0a8586a5848fd8d9ec05.tar.gz emacs-2bbf184223d79952d8da0a8586a5848fd8d9ec05.zip | |
Comment munging; nfc.
| -rw-r--r-- | lisp/progmodes/hideshow.el | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 8f08311ceae..ac62fd00f30 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | ;;; hideshow.el --- minor mode cmds to selectively display code/comment blocks | 1 | ;;; hideshow.el --- minor mode cmds to selectively display code/comment blocks |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 | 3 | ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 |
| 4 | ;; 2004, 2005 Free Software Foundation | 4 | ;; 2004, 2005 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Thien-Thi Nguyen <ttn@gnu.org> | 6 | ;; Author: Thien-Thi Nguyen <ttn@gnu.org> |
| 7 | ;; Dan Nicolaescu <dann@ics.uci.edu> | 7 | ;; Dan Nicolaescu <dann@ics.uci.edu> |
| 8 | ;; Keywords: C C++ java lisp tools editing comments blocks hiding outlines | 8 | ;; Keywords: C C++ java lisp tools editing comments blocks hiding outlines |
| 9 | ;; Maintainer-Version: 5.58.2.4 | 9 | ;; Maintainer-Version: |
| 10 | ;; Time-of-Day-Author-Most-Likely-to-be-Recalcitrant: early morning | 10 | ;; Time-of-Day-Author-Most-Likely-to-be-Recalcitrant: early morning |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | 12 | ;; This file is part of GNU Emacs. |
| @@ -208,11 +208,11 @@ | |||
| 208 | ;; Thanks go to the following people for valuable ideas, code and | 208 | ;; Thanks go to the following people for valuable ideas, code and |
| 209 | ;; bug reports. | 209 | ;; bug reports. |
| 210 | ;; | 210 | ;; |
| 211 | ;; Dean Andrews, Alf-Ivar Holm, Holger Bauer, Christoph Conrad, Dave | 211 | ;; Dean Andrews, Alf-Ivar Holm, Holger Bauer, Christoph Conrad, Dave Love, |
| 212 | ;; Love, Dirk Herrmann, Gael Marziou, Jan Djarv, Guillaume Leray, | 212 | ;; Dirk Herrmann, Gael Marziou, Jan Djarv, Guillaume Leray, Moody Ahmad, |
| 213 | ;; Moody Ahmad, Preston F. Crow, Lars Lindberg, Reto Zimmermann, | 213 | ;; Preston F. Crow, Lars Lindberg, Reto Zimmermann, Keith Sheffield, |
| 214 | ;; Keith Sheffield, Chew Meng Kuan, Tony Lam, Pete Ware, François | 214 | ;; Chew Meng Kuan, Tony Lam, Pete Ware, François Pinard, Stefan Monnier, |
| 215 | ;; Pinard, Stefan Monnier, Joseph Eydelnant, Michael Ernst | 215 | ;; Joseph Eydelnant, Michael Ernst, Peter Heslin |
| 216 | ;; | 216 | ;; |
| 217 | ;; Special thanks go to Dan Nicolaescu, who reimplemented hideshow using | 217 | ;; Special thanks go to Dan Nicolaescu, who reimplemented hideshow using |
| 218 | ;; overlays (rather than selective display), added isearch magic, folded | 218 | ;; overlays (rather than selective display), added isearch magic, folded |
| @@ -587,7 +587,8 @@ as cdr." | |||
| 587 | (while (and (< (point) q) | 587 | (while (and (< (point) q) |
| 588 | (> (point) p) | 588 | (> (point) p) |
| 589 | (not (looking-at hs-c-start-regexp))) | 589 | (not (looking-at hs-c-start-regexp))) |
| 590 | (setq p (point)) ;; use this to avoid an infinite cycle | 590 | ;; avoid an infinite cycle |
| 591 | (setq p (point)) | ||
| 591 | (forward-comment 1) | 592 | (forward-comment 1) |
| 592 | (skip-chars-forward " \t\n\f")) | 593 | (skip-chars-forward " \t\n\f")) |
| 593 | (when (or (not (looking-at hs-c-start-regexp)) | 594 | (when (or (not (looking-at hs-c-start-regexp)) |
| @@ -746,7 +747,7 @@ If `hs-hide-comments-when-hiding-all' is non-nil, also hide the comments." | |||
| 746 | (funcall hs-hide-all-non-comment-function) | 747 | (funcall hs-hide-all-non-comment-function) |
| 747 | (hs-hide-block-at-point t))) | 748 | (hs-hide-block-at-point t))) |
| 748 | ;; found a comment, probably | 749 | ;; found a comment, probably |
| 749 | (let ((c-reg (hs-inside-comment-p))) ; blech! | 750 | (let ((c-reg (hs-inside-comment-p))) |
| 750 | (when (and c-reg (car c-reg)) | 751 | (when (and c-reg (car c-reg)) |
| 751 | (if (> (count-lines (car c-reg) (nth 1 c-reg)) 1) | 752 | (if (> (count-lines (car c-reg) (nth 1 c-reg)) 1) |
| 752 | (hs-hide-block-at-point t c-reg) | 753 | (hs-hide-block-at-point t c-reg) |
| @@ -812,7 +813,8 @@ See documentation for functions `hs-hide-block' and `run-hooks'." | |||
| 812 | (setq p (car c-reg) | 813 | (setq p (car c-reg) |
| 813 | q (cadr c-reg)))) | 814 | q (cadr c-reg)))) |
| 814 | ((and (hs-find-block-beginning) | 815 | ((and (hs-find-block-beginning) |
| 815 | (looking-at hs-block-start-regexp)) ; fresh match-data, ugh | 816 | ;; ugh, fresh match-data |
| 817 | (looking-at hs-block-start-regexp)) | ||
| 816 | (setq p (point) | 818 | (setq p (point) |
| 817 | q (progn (hs-forward-sexp (hs-match-data t) 1) (point))))) | 819 | q (progn (hs-forward-sexp (hs-match-data t) 1) (point))))) |
| 818 | (when (and p q) | 820 | (when (and p q) |