mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-17 10:27:41 +00:00
* progmodes/hideshow.el (hs-hide-block-at-point): Don't move point
to the end of the line when locating the block (Bug#700).
This commit is contained in:
parent
3e2fa35354
commit
d44d05e807
2 changed files with 15 additions and 11 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2009-07-06 Chong Yidong <cyd@stupidchicken.com>
|
||||
|
||||
* 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 <michael.albinus@gmx.de>
|
||||
|
||||
* net/tramp.el (tramp-handle-write-region): Flush file properties
|
||||
|
|
|
|||
|
|
@ -565,29 +565,28 @@ and then further adjusted to be at the end of the line."
|
|||
(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)
|
||||
(point)))
|
||||
ov)
|
||||
(when (and (< p (point)) (> (count-lines p q) 1))
|
||||
(cond ((and hs-allow-nesting (setq ov (hs-overlay-at p)))
|
||||
(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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue