From eb864a71bd9a3ecf02dc994dcefd561aca0fdd4d Mon Sep 17 00:00:00 2001 From: Lawrence Mitchell Date: Fri, 17 Feb 2012 10:44:32 -0500 Subject: [PATCH] * lisp/newcomment.el (uncomment-region-default): Don't leave extra space when an arg is provided. Fixes: debbugs:8150 --- lisp/ChangeLog | 28 +++++++++++++++++----------- lisp/newcomment.el | 17 +++++++++-------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1c164f2d214..3d15010e16d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,12 @@ +2012-02-17 Lawrence Mitchell + Stefan Monnier + + * newcomment.el (uncomment-region-default): Don't leave extra space + when an arg is provided (bug#8150). + 2012-02-17 Teodor Zlatanov - * net/gnutls.el (gnutls-trustfiles): Fixed Cygwin bundle location. + * net/gnutls.el (gnutls-trustfiles): Fix Cygwin bundle location. 2012-02-17 Glenn Morris @@ -327,8 +333,8 @@ 2012-02-07 Alan Mackenzie - * progmodes/cc-engine.el (c-forward-objc-directive): Prevent - looping in "#pragma mark @implementation". + * progmodes/cc-engine.el (c-forward-objc-directive): + Prevent looping in "#pragma mark @implementation". 2012-02-07 Michael Albinus @@ -568,8 +574,8 @@ (Bug#10254). (bibtex-mode): Call bibtex-set-dialect via hack-local-variables-hook. - (bibtex-dialect): Update docstring. Add - safe-local-variable predicate. + (bibtex-dialect): Update docstring. + Add safe-local-variable predicate. (bibtex-entry-alist, bibtex-field-alist): Initialize via bibtex-set-dialect. (bibtex-mode-map): Define menu for each dialect. @@ -610,8 +616,8 @@ 2012-01-28 Phil Hagelberg - * emacs-lisp/package.el (package-install): Run - package-refresh-contents if there is no archive yet (Bug#9798). + * emacs-lisp/package.el (package-install): + Run package-refresh-contents if there is no archive yet (Bug#9798). 2012-01-28 Chong Yidong @@ -788,8 +794,8 @@ 2012-01-19 Martin Rudalics * window.el (window--state-get-1, window-state-get): Do not use - special state value for window-persistent-parameters. Rename - argument IGNORE to WRITABLE. Rewrite doc-string. + special state value for window-persistent-parameters. + Rename argument IGNORE to WRITABLE. Rewrite doc-string. (window--state-put-2): Reset all window parameters to nil before assigning values of persistent parameters. @@ -879,8 +885,8 @@ c-mask-paragraph, pass in `fill-paragraph' rather than `fill-region-as-paragraph'. (This is a reversion of a previous change.) - * progmodes/cc-mode.el (c-basic-common-init): Make - fill-paragraph-handle-comment buffer local and set it to nil. + * progmodes/cc-mode.el (c-basic-common-init): + Make fill-paragraph-handle-comment buffer local and set it to nil. 2012-01-13 Glenn Morris 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." (when (and sre (looking-at (concat "\\s-*\n\\s-*" srei))) (goto-char (match-end 0))) (if (null arg) (delete-region (point-min) (point)) - (skip-syntax-backward " ") - (delete-char (- numarg)) - (unless (or (bobp) - (save-excursion (goto-char (point-min)) - (looking-at comment-start-skip))) - ;; If there's something left but it doesn't look like - ;; a comment-start any more, just remove it. - (delete-region (point-min) (point)))) + (let* ((opoint (point-marker)) + (nchar (skip-syntax-backward " "))) + (delete-char (- numarg)) + (unless (and (not (bobp)) + (save-excursion (goto-char (point-min)) + (looking-at comment-start-skip))) + ;; If there's something left but it doesn't look like + ;; a comment-start any more, just remove it. + (delete-region (point-min) opoint)))) ;; Remove the end-comment (and leading padding and such). (goto-char (point-max)) (comment-enter-backward) -- 2.11.4.GIT