emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master 57350fb 3/5: Better sexp uncommenting


From: Artur Malabarba
Subject: [elpa] master 57350fb 3/5: Better sexp uncommenting
Date: Fri, 25 Sep 2015 23:08:15 +0000

branch: master
commit 57350fb0ef82ccfbd8ab772e7d938472729dfd84
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    Better sexp uncommenting
---
 sotlisp.el |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/sotlisp.el b/sotlisp.el
index 5bba0ca..bb2e8a1 100644
--- a/sotlisp.el
+++ b/sotlisp.el
@@ -620,17 +620,21 @@ With a prefix argument, defines a `defvar' instead of a 
`defcustom'."
                                     (line-beginning-position)
                                     t)
                 (ignore-errors
-                  (while (looking-at-p comment-start-skip)
-                    (forward-char -1)))
+                  (while (looking-at comment-start-skip)
+                    (forward-char -1))
+                  (unless (looking-at "[\n\r[:blank]]")
+                    (forward-char 1)))
                 (point-marker))))
     (unless (= beg end)
       (uncomment-region beg end)
       (goto-char p)
       ;; Indentify the "top-level" sexp inside the comment.
-      (while (and (ignore-errors (backward-up-list) t)
-                  (>= (point) beg))
-        (skip-chars-backward (rx (syntax expression-prefix)))
-        (setq p (point-marker)))
+      (ignore-errors
+        (while (>= (point) beg)
+          (backward-prefix-chars)
+          (skip-chars-backward "\r\n[:blank:]")
+          (setq p (point-marker))
+          (backward-up-list)))
       ;; Re-comment everything before it. 
       (ignore-errors
         (comment-region beg p))



reply via email to

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