Allow hide-ifdef-guts to work in buffers not visiting files

* lisp/progmodes/hideif.el (hide-ifdef-guts): Allow working in
buffers not visiting files (bug#47279).

Copyright-paperwork-exempt: yes
This commit is contained in:
Zhiwei Chen 2021-03-21 08:09:14 +01:00 committed by Lars Ingebrigtsen
parent e9e691093a
commit 3cbf92323c

View file

@ -1743,10 +1743,10 @@ first arg will be `hif-etc'."
(defun hide-ifdef-guts ()
"Does most of the work of `hide-ifdefs'.
It does not do the work that's pointless to redo on a recursive entry."
;; (message "hide-ifdef-guts")
(save-excursion
(let* ((case-fold-search t) ; Ignore case for `hide-ifdef-header-regexp'
(expand-header (and hide-ifdef-expand-reinclusion-protection
(buffer-file-name)
(string-match hide-ifdef-header-regexp
(buffer-file-name))
(zerop hif-recurse-level)))