diff options
| author | Eli Zaretskii | 2016-01-16 09:55:00 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-01-16 09:55:00 +0200 |
| commit | 39afa422ad0b3cef00292e260d424b7cd589b90d (patch) | |
| tree | c6f31d28c02f41bf419970d178dfe0b37c901937 | |
| parent | 05df6662ef229fdbaa2b6f4430f39f95eaa7a65a (diff) | |
| download | emacs-39afa422ad0b3cef00292e260d424b7cd589b90d.tar.gz emacs-39afa422ad0b3cef00292e260d424b7cd589b90d.zip | |
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'.
| -rw-r--r-- | lisp/progmodes/hideif.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index a75a322b335..8a87eb9770a 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el | |||
| @@ -1591,7 +1591,7 @@ not be expanded." | |||
| 1591 | '(nil nil))) | 1591 | '(nil nil))) |
| 1592 | (let ((case-fold-search nil)) | 1592 | (let ((case-fold-search nil)) |
| 1593 | (save-excursion | 1593 | (save-excursion |
| 1594 | (unless mark-active | 1594 | (unless (use-region-p) |
| 1595 | (setq rstart nil rend nil) | 1595 | (setq rstart nil rend nil) |
| 1596 | (beginning-of-line) | 1596 | (beginning-of-line) |
| 1597 | (when (and (re-search-forward hif-macro-expr-prefix-regexp nil t) | 1597 | (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." | |||
| 1922 | With optional prefix argument ARG, also hide the #ifdefs themselves." | 1922 | With optional prefix argument ARG, also hide the #ifdefs themselves." |
| 1923 | (interactive "P\nr") | 1923 | (interactive "P\nr") |
| 1924 | (let ((hide-ifdef-lines arg)) | 1924 | (let ((hide-ifdef-lines arg)) |
| 1925 | (if mark-active | 1925 | (if (use-region-p) |
| 1926 | (let ((hif-recurse-level (1+ hif-recurse-level))) | 1926 | (let ((hif-recurse-level (1+ hif-recurse-level))) |
| 1927 | (hif-recurse-on start end t) | 1927 | (hif-recurse-on start end t) |
| 1928 | (setq mark-active nil)) | 1928 | (setq mark-active nil)) |