GNU bug report logs - #78990
30.1; Show-font breaks `insert-file-contents-literally'

Previous Next

Package: emacs;

Reported by: Zhengyi Fu <i <at> fuzy.me>

Date: Thu, 10 Jul 2025 12:14:02 UTC

Severity: normal

Found in version 30.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zhengyi Fu <i <at> fuzy.me>
To: bug-gnu-emacs <at> gnu.org
Cc: info <at> protesilaos.com
Subject: 30.1; Show-font breaks `insert-file-contents-literally'
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)))





This bug report was last modified 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.