aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-08-09 02:43:50 +0000
committerChong Yidong2009-08-09 02:43:50 +0000
commit1c292fc7de79735fdea7f6df03a6b2ce7100b285 (patch)
treee56ff349ee31dc3d025f5a177c50f6e71d3aa0dc
parent2db0ae07bce8513db2975836d6e20bfdee9c5f1c (diff)
downloademacs-1c292fc7de79735fdea7f6df03a6b2ce7100b285.tar.gz
emacs-1c292fc7de79735fdea7f6df03a6b2ce7100b285.zip
* progmodes/hideshow.el (hs-special-modes-alist): Don't use
hs-c-like-adjust-block-beginning. (hs-hide-block-at-point): Stop hiding at the beginning of hs-block-end-regexp (Bug#700).
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/progmodes/hideshow.el36
2 files changed, 26 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 58a607bc505..2b0dab0028c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12009-08-09 Chong Yidong <cyd@stupidchicken.com>
2
3 * progmodes/hideshow.el (hs-special-modes-alist): Don't use
4 hs-c-like-adjust-block-beginning.
5 (hs-hide-block-at-point): Stop hiding at the beginning of
6 hs-block-end-regexp (Bug#700).
7
12009-08-09 Dmitry Dzhus <dima@sphinx.net.ru> 82009-08-09 Dmitry Dzhus <dima@sphinx.net.ru>
2 9
3 * progmodes/gdb-mi.el (gdb-gud-context-call): Does not need to be 10 * progmodes/gdb-mi.el (gdb-gud-context-call): Does not need to be
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 7e4da68ec38..bf2792dada0 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -267,10 +267,10 @@ This has effect only if `search-invisible' is set to `open'."
267 267
268;;;###autoload 268;;;###autoload
269(defvar hs-special-modes-alist 269(defvar hs-special-modes-alist
270 '((c-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) 270 '((c-mode "{" "}" "/[*/]" nil nil)
271 (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) 271 (c++-mode "{" "}" "/[*/]" nil nil)
272 (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) 272 (bibtex-mode ("@\\S(*\\(\\s(\\)" 1))
273 (java-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning)) 273 (java-mode "{" "}" "/[*/]" nil nil))
274 "*Alist for initializing the hideshow variables for different modes. 274 "*Alist for initializing the hideshow variables for different modes.
275Each element has the form 275Each element has the form
276 (MODE START END COMMENT-START FORWARD-SEXP-FUNC ADJUST-BEG-FUNC). 276 (MODE START END COMMENT-START FORWARD-SEXP-FUNC ADJUST-BEG-FUNC).
@@ -567,20 +567,21 @@ and then further adjusted to be at the end of the line."
567 (let* ((mdata (match-data t)) 567 (let* ((mdata (match-data t))
568 (header-beg (match-beginning 0)) 568 (header-beg (match-beginning 0))
569 (header-end (match-end 0)) 569 (header-end (match-end 0))
570 (p 570 p q ov)
571 ;; `p' is the point at the end of the block beginning, 571 ;; `p' is the point at the end of the block beginning, which
572 ;; which may need to be adjusted 572 ;; may need to be adjusted
573 (save-excursion 573 (save-excursion
574 (if hs-adjust-block-beginning 574 (if hs-adjust-block-beginning
575 (goto-char (funcall hs-adjust-block-beginning 575 (goto-char (funcall hs-adjust-block-beginning
576 header-end)) 576 header-end))
577 (goto-char header-beg)))) 577 (goto-char header-end))
578 (q 578 (setq p (line-end-position)))
579 ;; `q' is the point at the end of the block 579 ;; `q' is the point at the end of the block
580 (progn (hs-forward-sexp mdata 1) 580 (hs-forward-sexp mdata 1)
581 (point))) 581 (setq q (if (looking-back hs-block-end-regexp)
582 ov) 582 (match-beginning 0)
583 (when (and (< p (point)) (> (count-lines p q) 1)) 583 (point)))
584 (when (and (< p q) (> (count-lines p q) 1))
584 (cond ((and hs-allow-nesting (setq ov (hs-overlay-at p))) 585 (cond ((and hs-allow-nesting (setq ov (hs-overlay-at p)))
585 (delete-overlay ov)) 586 (delete-overlay ov))
586 ((not hs-allow-nesting) 587 ((not hs-allow-nesting)
@@ -751,6 +752,7 @@ and `case-fold-search' are both t."
751 (end-of-line) 752 (end-of-line)
752 (hs-overlay-at (point)))) 753 (hs-overlay-at (point))))
753 754
755;; This function is not used anymore (Bug#700).
754(defun hs-c-like-adjust-block-beginning (initial) 756(defun hs-c-like-adjust-block-beginning (initial)
755 "Adjust INITIAL, the buffer position after `hs-block-start-regexp'. 757 "Adjust INITIAL, the buffer position after `hs-block-start-regexp'.
756Actually, point is never moved; a new position is returned that is 758Actually, point is never moved; a new position is returned that is