emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master bbbced0: Make lisp-do-defun do the right thing with


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master bbbced0: Make lisp-do-defun do the right thing with trailing comments
Date: Thu, 3 Oct 2019 12:07:22 -0400 (EDT)

branch: master
commit bbbced061fbd335da162fbeb023476765b2d9f55
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    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).
---
 lisp/progmodes/inf-lisp.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 3476a7f..dafb89a 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'
  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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]