(end-of-defun): Don't skip to next line after
calling end-of-defun-function if it already moved to BOL.
This commit is contained in:
parent
51584624ee
commit
6bffddf43b
2 changed files with 14 additions and 8 deletions
|
@ -348,9 +348,10 @@ is called as a function to find the defun's end."
|
|||
(beginning-of-defun-raw 1)
|
||||
(while (unless (eobp)
|
||||
(funcall end-of-defun-function)
|
||||
(skip-chars-forward " \t")
|
||||
(if (looking-at "\\s<\\|\n")
|
||||
(forward-line 1))
|
||||
(unless (bolp)
|
||||
(skip-chars-forward " \t")
|
||||
(if (looking-at "\\s<\\|\n")
|
||||
(forward-line 1)))
|
||||
;; If we started after the end of the previous
|
||||
;; function, try again with the next one.
|
||||
(unless (or (> (point) pos)
|
||||
|
@ -370,9 +371,10 @@ is called as a function to find the defun's end."
|
|||
(let ((beg (point))
|
||||
retry-point)
|
||||
(funcall end-of-defun-function)
|
||||
(skip-chars-forward " \t")
|
||||
(if (looking-at "\\s<\\|\n")
|
||||
(forward-line 1))
|
||||
(unless (bolp)
|
||||
(skip-chars-forward " \t")
|
||||
(if (looking-at "\\s<\\|\n")
|
||||
(forward-line 1)))
|
||||
;; If we started from within the function just found,
|
||||
;; try again with the previous one.
|
||||
(unless (or (< (point) pos)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue