]> git.eshelyaron.com Git - emacs.git/commitdiff
(hs-hide-comment-region): Use line-end-position.
authorThien-Thi Nguyen <ttn@gnuvola.org>
Fri, 22 Jun 2007 08:15:02 +0000 (08:15 +0000)
committerThien-Thi Nguyen <ttn@gnuvola.org>
Fri, 22 Jun 2007 08:15:02 +0000 (08:15 +0000)
(hs-hide-block-at-point, hs-show-block): Likewise.

lisp/ChangeLog
lisp/progmodes/hideshow.el

index a38e26710f0c813ab923b5d5c90963057c120a40..5a7b81d40d1afcb69c6d69372b4369fa56e505c7 100644 (file)
@@ -4,6 +4,9 @@
        (next-error, next-error-internal): Recenter if specified,
        immediately prior to running `next-error-hook'.
 
+       * progmodes/hideshow.el (hs-show-block): Use line-end-position.
+       (hs-hide-block-at-point, hs-hide-comment-region): Likewise.
+
 2007-06-22  Jay Belanger  <jay.p.belanger@gmail.com>
 
        * calc/calc-comb.el (math-small-factorial-table): New variable.
index d94f6acf8e1b6d0a82c8c23e99340bfca51324f5..f39fb477c9e1ecda79fabad18c3702b34a941a69 100644 (file)
@@ -508,8 +508,8 @@ Original match data is restored upon return."
 (defun hs-hide-comment-region (beg end &optional repos-end)
   "Hide a region from BEG to END, marking it as a comment.
 Optional arg REPOS-END means reposition at end."
-  (let ((beg-eol (progn (goto-char beg) (end-of-line) (point)))
-        (end-eol (progn (goto-char end) (end-of-line) (point))))
+  (let ((beg-eol (progn (goto-char beg) (line-end-position)))
+        (end-eol (progn (goto-char end) (line-end-position))))
     (hs-discard-overlays beg-eol end-eol)
     (hs-make-overlay beg-eol end-eol 'comment beg end))
   (goto-char (if repos-end end beg)))
@@ -536,8 +536,7 @@ and then further adjusted to be at the end of the line."
                                         'identity)
                                     pure-p))
                 ;; whatever the adjustment, we move to eol
-                (end-of-line)
-                (point)))
+                (line-end-position)))
              (q
               ;; `q' is the point at the end of the block
               (progn (hs-forward-sexp mdata 1)
@@ -806,7 +805,7 @@ See documentation for functions `hs-hide-block' and `run-hooks'."
   (hs-life-goes-on
    (or
     ;; first see if we have something at the end of the line
-    (let ((ov (hs-overlay-at (save-excursion (end-of-line) (point))))
+    (let ((ov (hs-overlay-at (line-end-position)))
           (here (point)))
       (when ov
         (goto-char