Subject: bug#31107: closed (Re: bug#31107: 26.0.91; insert-file-contents-literally's doc indicates insert-file-contents runs find-file-hook, but it seems untrue)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 09 Apr 2018 14:56:02 +0000

Your bug report

#31107: 26.0.91; insert-file-contents-literally's doc indicates insert-file-contents runs find-file-hook, but it seems untrue

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
31107: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31107
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#31107: 26.0.91; insert-file-contents-literally's doc indicates insert-file-contents runs find-file-hook, but it seems untrue
From: Eli Zaretskii <[email-masked]>
To: [email-masked]
Date: Mon, 09 Apr 2018 17:55:37 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Closing.

Subject: 26.0.91; insert-file-contents-literally's doc indicates insert-file-contents runs find-file-hook, but it seems untrue
From: Xu Chunyang <[email-masked]>
To: [email-masked]
Date: Mon, 09 Apr 2018 16:23:11 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

'C-h S insert-file-contents-literally' indicates 'insert-file-contents'
runs 'find-file-hook'

    -- Function: insert-file-contents-literally filename &optional visit
             beg end replace
        This function works like ‘insert-file-contents’ except that it does
        not run ‘find-file-hook’, 

However, 'insert-file-contents' doesn't run 'find-file-hook'. I test
using the following

    (add-hook 'find-file-hook
              (defun foo ()
                (message-box "Visiting %s" buffer-file-truename)))
    
    (insert-file-contents "/etc/shells")

'foo' is not called by 'insert-file-contents', though 'find-file' runs
the hook as expected.

    (find-file "/etc/shells")