diff options
| author | Lawrence Mitchell | 2012-02-17 10:44:32 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2012-02-17 10:44:32 -0500 |
| commit | eb864a71bd9a3ecf02dc994dcefd561aca0fdd4d (patch) | |
| tree | 99cc5a3229c8e6379e03ed5f703a50b0fbfae64d /lisp/newcomment.el | |
| parent | 7b926f3f3db5d9a22260209547fb3e60df919ecf (diff) | |
| download | emacs-eb864a71bd9a3ecf02dc994dcefd561aca0fdd4d.tar.gz emacs-eb864a71bd9a3ecf02dc994dcefd561aca0fdd4d.zip | |
* lisp/newcomment.el (uncomment-region-default): Don't leave extra space
when an arg is provided.
Fixes: debbugs:8150
Diffstat (limited to 'lisp/newcomment.el')
| -rw-r--r-- | lisp/newcomment.el | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index e2be4829a9b..16282af6409 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el | |||
| @@ -872,14 +872,15 @@ comment markers." | |||
| 872 | (when (and sre (looking-at (concat "\\s-*\n\\s-*" srei))) | 872 | (when (and sre (looking-at (concat "\\s-*\n\\s-*" srei))) |
| 873 | (goto-char (match-end 0))) | 873 | (goto-char (match-end 0))) |
| 874 | (if (null arg) (delete-region (point-min) (point)) | 874 | (if (null arg) (delete-region (point-min) (point)) |
| 875 | (skip-syntax-backward " ") | 875 | (let* ((opoint (point-marker)) |
| 876 | (delete-char (- numarg)) | 876 | (nchar (skip-syntax-backward " "))) |
| 877 | (unless (or (bobp) | 877 | (delete-char (- numarg)) |
| 878 | (save-excursion (goto-char (point-min)) | 878 | (unless (and (not (bobp)) |
| 879 | (looking-at comment-start-skip))) | 879 | (save-excursion (goto-char (point-min)) |
| 880 | ;; If there's something left but it doesn't look like | 880 | (looking-at comment-start-skip))) |
| 881 | ;; a comment-start any more, just remove it. | 881 | ;; If there's something left but it doesn't look like |
| 882 | (delete-region (point-min) (point)))) | 882 | ;; a comment-start any more, just remove it. |
| 883 | (delete-region (point-min) opoint)))) | ||
| 883 | 884 | ||
| 884 | ;; Remove the end-comment (and leading padding and such). | 885 | ;; Remove the end-comment (and leading padding and such). |
| 885 | (goto-char (point-max)) (comment-enter-backward) | 886 | (goto-char (point-max)) (comment-enter-backward) |