mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-19 11:27:34 +00:00
Make lisp-do-defun do the right thing with trailing comments
* lisp/progmodes/inf-lisp.el (lisp-do-defun): Avoid including trailing comments in the region (bug#7974).
This commit is contained in:
parent
3ad9e5133e
commit
bbbced061f
1 changed files with 5 additions and 2 deletions
|
|
@ -345,8 +345,11 @@ The actually processing is done by `do-string' and `do-region'
|
|||
which determine whether the code is compiled before evaluation.
|
||||
DEFVAR forms reset the variables to the init values."
|
||||
(save-excursion
|
||||
(end-of-defun)
|
||||
(skip-chars-backward " \t\n\r\f") ; Makes allegro happy
|
||||
;; Find the end of the defun this way to avoid having the region
|
||||
;; possibly end with a comment (it there'a a comment after the
|
||||
;; final parenthesis).
|
||||
(beginning-of-defun)
|
||||
(forward-sexp)
|
||||
(let ((end (point)) (case-fold-search t))
|
||||
(beginning-of-defun)
|
||||
(if (looking-at "(defvar")
|
||||
|
|
|
|||
Loading…
Reference in a new issue