Fix tests for active region in hideif.el

* 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'.
This commit is contained in:
Eli Zaretskii 2016-01-16 09:55:00 +02:00
parent 05df6662ef
commit 39afa422ad

View file

@ -1591,7 +1591,7 @@ not be expanded."
'(nil nil))) '(nil nil)))
(let ((case-fold-search nil)) (let ((case-fold-search nil))
(save-excursion (save-excursion
(unless mark-active (unless (use-region-p)
(setq rstart nil rend nil) (setq rstart nil rend nil)
(beginning-of-line) (beginning-of-line)
(when (and (re-search-forward hif-macro-expr-prefix-regexp nil t) (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." With optional prefix argument ARG, also hide the #ifdefs themselves."
(interactive "P\nr") (interactive "P\nr")
(let ((hide-ifdef-lines arg)) (let ((hide-ifdef-lines arg))
(if mark-active (if (use-region-p)
(let ((hif-recurse-level (1+ hif-recurse-level))) (let ((hif-recurse-level (1+ hif-recurse-level)))
(hif-recurse-on start end t) (hif-recurse-on start end t)
(setq mark-active nil)) (setq mark-active nil))