Commit 77a2bb53 authored by Thien-Thi Nguyen's avatar Thien-Thi Nguyen
Browse files

(hs-hide-comment-region): Use line-end-position.

(hs-hide-block-at-point, hs-show-block): Likewise.
parent dce39ca8
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
(next-error, next-error-internal): Recenter if specified, (next-error, next-error-internal): Recenter if specified,
immediately prior to running `next-error-hook'. 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> 2007-06-22 Jay Belanger <jay.p.belanger@gmail.com>
* calc/calc-comb.el (math-small-factorial-table): New variable. * calc/calc-comb.el (math-small-factorial-table): New variable.
......
...@@ -508,8 +508,8 @@ Original match data is restored upon return." ...@@ -508,8 +508,8 @@ Original match data is restored upon return."
(defun hs-hide-comment-region (beg end &optional repos-end) (defun hs-hide-comment-region (beg end &optional repos-end)
"Hide a region from BEG to END, marking it as a comment. "Hide a region from BEG to END, marking it as a comment.
Optional arg REPOS-END means reposition at end." Optional arg REPOS-END means reposition at end."
(let ((beg-eol (progn (goto-char beg) (end-of-line) (point))) (let ((beg-eol (progn (goto-char beg) (line-end-position)))
(end-eol (progn (goto-char end) (end-of-line) (point)))) (end-eol (progn (goto-char end) (line-end-position))))
(hs-discard-overlays beg-eol end-eol) (hs-discard-overlays beg-eol end-eol)
(hs-make-overlay beg-eol end-eol 'comment beg end)) (hs-make-overlay beg-eol end-eol 'comment beg end))
(goto-char (if repos-end end beg))) (goto-char (if repos-end end beg)))
...@@ -536,8 +536,7 @@ and then further adjusted to be at the end of the line." ...@@ -536,8 +536,7 @@ and then further adjusted to be at the end of the line."
'identity) 'identity)
pure-p)) pure-p))
;; whatever the adjustment, we move to eol ;; whatever the adjustment, we move to eol
(end-of-line) (line-end-position)))
(point)))
(q (q
;; `q' is the point at the end of the block ;; `q' is the point at the end of the block
(progn (hs-forward-sexp mdata 1) (progn (hs-forward-sexp mdata 1)
...@@ -806,7 +805,7 @@ See documentation for functions `hs-hide-block' and `run-hooks'." ...@@ -806,7 +805,7 @@ See documentation for functions `hs-hide-block' and `run-hooks'."
(hs-life-goes-on (hs-life-goes-on
(or (or
;; first see if we have something at the end of the line ;; 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))) (here (point)))
(when ov (when ov
(goto-char (goto-char
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment