summaryrefslogtreecommitdiff
path: root/lisp/newcomment.el
diff options
context:
space:
mode:
authorZachary Kanfer <zkanfer@gmail.com>2015-09-01 03:11:50 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-09-01 03:13:05 +0100
commit4a703c73305211c780307e3654969ac1a20fb229 (patch)
tree059eca0d4385cf0ad752b2cdaff2a99774bcb52a /lisp/newcomment.el
parent9004011ec0876d74209814417f939a348e107d61 (diff)
downloademacs-4a703c73305211c780307e3654969ac1a20fb229.tar.gz
* 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)
Diffstat (limited to 'lisp/newcomment.el')
-rw-r--r--lisp/newcomment.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 037d2945447..60f35c834b3 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