aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-10-03 18:07:12 +0200
committerLars Ingebrigtsen2019-10-03 18:07:12 +0200
commitbbbced061fbd335da162fbeb023476765b2d9f55 (patch)
treeceda292b88f237496e665df62f7ed53b9096b165
parent3ad9e5133e7c9895c41bb31b2209d2c1f8fe3239 (diff)
downloademacs-bbbced061fbd335da162fbeb023476765b2d9f55.tar.gz
emacs-bbbced061fbd335da162fbeb023476765b2d9f55.zip
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).
-rw-r--r--lisp/progmodes/inf-lisp.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 3476a7f635b..dafb89a5b65 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -345,8 +345,11 @@ The actually processing is done by `do-string' and `do-region'
345 which determine whether the code is compiled before evaluation. 345 which determine whether the code is compiled before evaluation.
346DEFVAR forms reset the variables to the init values." 346DEFVAR forms reset the variables to the init values."
347 (save-excursion 347 (save-excursion
348 (end-of-defun) 348 ;; Find the end of the defun this way to avoid having the region
349 (skip-chars-backward " \t\n\r\f") ; Makes allegro happy 349 ;; possibly end with a comment (it there'a a comment after the
350 ;; final parenthesis).
351 (beginning-of-defun)
352 (forward-sexp)
350 (let ((end (point)) (case-fold-search t)) 353 (let ((end (point)) (case-fold-search t))
351 (beginning-of-defun) 354 (beginning-of-defun)
352 (if (looking-at "(defvar") 355 (if (looking-at "(defvar")