[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 4a703c7: * lisp/newcomment.el (comment-dwim): Use `
From: |
Artur Malabarba |
Subject: |
[Emacs-diffs] master 4a703c7: * lisp/newcomment.el (comment-dwim): Use `use-region-p' |
Date: |
Tue, 01 Sep 2015 02:15:11 +0000 |
branch: master
commit 4a703c73305211c780307e3654969ac1a20fb229
Author: Zachary Kanfer <address@hidden>
Commit: Artur Malabarba <address@hidden>
* lisp/newcomment.el (comment-dwim): Use `use-region-p'
When the region is active, but is empty (length 0), act as though
the region was not active; that is, put a comment at the end of
the line. (Bug#21119)
---
lisp/newcomment.el | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 037d294..60f35c8 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -1266,7 +1266,7 @@ Else, call `comment-indent'.
You can configure `comment-style' to change the way regions are commented."
(interactive "*P")
(comment-normalize-vars)
- (if (and mark-active transient-mark-mode)
+ (if (use-region-p)
(comment-or-uncomment-region (region-beginning) (region-end) arg)
(if (save-excursion (beginning-of-line) (not (looking-at "\\s-*$")))
;; FIXME: If there's no comment to kill on this line and ARG is
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 4a703c7: * lisp/newcomment.el (comment-dwim): Use `use-region-p',
Artur Malabarba <=