Subject: 30.1; Show-font breaks `insert-file-contents-literally'

From: Zhengyi Fu <[email-masked]>
Date: Thu, 10 Jul 2025 20:12:48 +0800

The package `show-font' adds a file name handler to
`file-name-handler-alist', which causes an error when trying to insert
the raw contents of an TTF file into a buffer with
`insert-file-contents-literally'.

;;;###autoload
(add-to-list 'file-name-handler-alist (cons "\\.\\(ttf\\|otf\\)\\'" #'show-font-handler))

Currently I use the following advice to workaround this behavior, but I
think it's better to fix this either in show-font or in Emacs core.

(define-advice insert-file-contents-literally
    (:around (&rest args) inhibit-show-font)
  (let ((inhibit-file-name-handlers
	 (append '(show-font-handler)
		 (and (eq inhibit-file-name-operation 'insert-file-contents)
		      inhibit-file-name-handlers)))
	(inhibit-file-name-operation 'insert-file-contents))
    (apply args)))