]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow hide-ifdef-guts to work in buffers not visiting files
authorZhiwei Chen <chenzhiwei03@kuaishou.com>
Sun, 21 Mar 2021 07:09:14 +0000 (08:09 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 21 Mar 2021 07:17:41 +0000 (08:17 +0100)
* lisp/progmodes/hideif.el (hide-ifdef-guts): Allow working in
buffers not visiting files (bug#47279).

Copyright-paperwork-exempt: yes

lisp/progmodes/hideif.el

index 923f85fd4dd5d7c247f8d99af5f8fd6c8239abfb..6f1a8781b491e593126722c85a6250c2b610cdb1 100644 (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)))