]> code.delx.au - gnu-emacs/commitdiff
Fix tests for active region in hideif.el
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Jan 2016 07:55:00 +0000 (09:55 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Jan 2016 07:55:00 +0000 (09:55 +0200)
* lisp/progmodes/hideif.el (hif-evaluate-macro, hide-ifdef-block): Use
'use-region-p' to test whether to operate on region, instead of
testing 'mark-active'.

lisp/progmodes/hideif.el

index a75a322b3355db5372c4086764c14266e67644b3..8a87eb9770ac1dcf42382496b2ea12d4634b4d69 100644 (file)
@@ -1591,7 +1591,7 @@ not be expanded."
      '(nil nil)))
   (let ((case-fold-search nil))
     (save-excursion
-      (unless mark-active
+      (unless (use-region-p)
         (setq rstart nil rend nil)
         (beginning-of-line)
         (when (and (re-search-forward hif-macro-expr-prefix-regexp nil t)
@@ -1922,7 +1922,7 @@ Return as (TOP . BOTTOM) the extent of ifdef block."
 With optional prefix argument ARG, also hide the #ifdefs themselves."
   (interactive "P\nr")
   (let ((hide-ifdef-lines arg))
-    (if mark-active
+    (if (use-region-p)
         (let ((hif-recurse-level (1+ hif-recurse-level)))
           (hif-recurse-on start end t)
           (setq mark-active nil))