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


View this message in rfc822 format

From: Zhengyi Fu <i <at> fuzy.me>
To: Protesilaos Stavrou <prot <at> protesilaos.com>
Cc: 78990 <at> debbugs.gnu.org, info <at> protesilaos.com
Subject: bug#78990: 30.1; Show-font breaks `insert-file-contents-literally'
Date: Thu, 10 Jul 2025 20:27:05 +0800
Protesilaos Stavrou <prot <at> protesilaos.com> writes:

> On 2025-07-10 15:12, Zhengyi Fu wrote:
>> 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)))
>
> Do you want to send me a patch for this? I will apply it right
> away. Thank you!

Thank you for your fast reply.

No.  Actually, I don't know how to fix it correctly.




This bug report was last modified 23 days ago.

Previous Next


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