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: Mon, 06 Jul 2009 14:16:57 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/07/06 14:16:57

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

Log message:
        * progmodes/hideshow.el (hs-hide-block-at-point): Don't move point
        to the end of the line when locating the block (Bug#700).

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

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15768
retrieving revision 1.15769
diff -u -b -r1.15768 -r1.15769
--- ChangeLog   6 Jul 2009 13:37:29 -0000       1.15768
+++ ChangeLog   6 Jul 2009 14:16:52 -0000       1.15769
@@ -1,3 +1,8 @@
+2009-07-06  Chong Yidong  <address@hidden>
+
+       * progmodes/hideshow.el (hs-hide-block-at-point): Don't move point
+       to the end of the line when locating the block (Bug#700).
+
 2009-07-06  Michael Albinus  <address@hidden>
 
        * net/tramp.el (tramp-handle-write-region): Flush file properties

Index: progmodes/hideshow.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/hideshow.el,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -b -r1.77 -r1.78
--- progmodes/hideshow.el       5 Jan 2009 03:23:39 -0000       1.77
+++ progmodes/hideshow.el       6 Jul 2009 14:16:56 -0000       1.78
@@ -565,20 +565,19 @@
       (hs-hide-comment-region (car comment-reg) (cadr comment-reg) end)
     (when (looking-at hs-block-start-regexp)
       (let* ((mdata (match-data t))
-             (pure-p (match-end 0))
+            (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
               (save-excursion
-                (goto-char (funcall (or hs-adjust-block-beginning
-                                        'identity)
-                                    pure-p))
-                ;; whatever the adjustment, we move to eol
-                (line-end-position)))
+               (if hs-adjust-block-beginning
+                   (goto-char (funcall hs-adjust-block-beginning
+                                       header-end))
+                 (goto-char header-beg))))
              (q
               ;; `q' is the point at the end of the block
               (progn (hs-forward-sexp mdata 1)
-                     (end-of-line)
                      (point)))
              ov)
         (when (and (< p (point)) (> (count-lines p q) 1))
@@ -586,8 +585,8 @@
                  (delete-overlay ov))
                 ((not hs-allow-nesting)
                  (hs-discard-overlays p q)))
-          (hs-make-overlay p q 'code (- pure-p p)))
-        (goto-char (if end q (min p pure-p)))))))
+          (hs-make-overlay p q 'code (- header-end p)))
+        (goto-char (if end q (min p header-end)))))))
 
 (defun hs-inside-comment-p ()
   "Return non-nil if point is inside a comment, otherwise nil.




reply via email to

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