emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog progmodes/hideshow.el


From: Chong Yidong
Subject: [Emacs-diffs] emacs/lisp ChangeLog progmodes/hideshow.el
Date: Sun, 09 Aug 2009 02:43:56 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/08/09 02:43:55

Modified files:
        lisp           : ChangeLog 
        lisp/progmodes : hideshow.el 

Log message:
        * 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).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15911&r2=1.15912
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/hideshow.el?cvsroot=emacs&r1=1.78&r2=1.79

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15911
retrieving revision 1.15912
diff -u -b -r1.15911 -r1.15912
--- ChangeLog   9 Aug 2009 00:17:01 -0000       1.15911
+++ ChangeLog   9 Aug 2009 02:43:50 -0000       1.15912
@@ -1,3 +1,10 @@
+2009-08-09  Chong Yidong  <address@hidden>
+
+       * 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).
+
 2009-08-09  Dmitry Dzhus  <address@hidden>
 
        * progmodes/gdb-mi.el (gdb-gud-context-call): Does not need to be

Index: progmodes/hideshow.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/hideshow.el,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -b -r1.78 -r1.79
--- progmodes/hideshow.el       6 Jul 2009 14:16:56 -0000       1.78
+++ progmodes/hideshow.el       9 Aug 2009 02:43:55 -0000       1.79
@@ -267,10 +267,10 @@
 
 ;;;###autoload
 (defvar hs-special-modes-alist
-  '((c-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning)
-    (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning)
+  '((c-mode "{" "}" "/[*/]" nil nil)
+    (c++-mode "{" "}" "/[*/]" nil nil)
     (bibtex-mode ("@\\S(*\\(\\s(\\)" 1))
-    (java-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning))
+    (java-mode "{" "}" "/[*/]" nil nil))
   "*Alist for initializing the hideshow variables for different modes.
 Each element has the form
   (MODE START END COMMENT-START FORWARD-SEXP-FUNC ADJUST-BEG-FUNC).
@@ -567,20 +567,21 @@
       (let* ((mdata (match-data t))
             (header-beg (match-beginning 0))
              (header-end (match-end 0))
-             (p
-              ;; `p' is the point at the end of the block beginning,
-              ;; which may need to be adjusted
+            p q ov)
+       ;; `p' is the point at the end of the block beginning, which
+       ;; may need to be adjusted
               (save-excursion
                (if hs-adjust-block-beginning
                    (goto-char (funcall hs-adjust-block-beginning
                                        header-end))
-                 (goto-char header-beg))))
-             (q
+           (goto-char header-end))
+         (setq p (line-end-position)))
               ;; `q' is the point at the end of the block
-              (progn (hs-forward-sexp mdata 1)
+       (hs-forward-sexp mdata 1)
+       (setq q (if (looking-back hs-block-end-regexp)
+                   (match-beginning 0)
                     (point)))
-            ov)
-        (when (and (< p (point)) (> (count-lines p q) 1))
+        (when (and (< p q) (> (count-lines p q) 1))
           (cond ((and hs-allow-nesting (setq ov (hs-overlay-at p)))
                  (delete-overlay ov))
                 ((not hs-allow-nesting)
@@ -751,6 +752,7 @@
     (end-of-line)
     (hs-overlay-at (point))))
 
+;; This function is not used anymore (Bug#700).
 (defun hs-c-like-adjust-block-beginning (initial)
   "Adjust INITIAL, the buffer position after `hs-block-start-regexp'.
 Actually, point is never moved; a new position is returned that is




reply via email to

[Prev in Thread] Current Thread [Next in Thread]