GNU bug report logs - #50946
Emacs-28: Inadequate coding in hack-elisp-shorthands

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Fri, 1 Oct 2021 17:12:02 UTC

Severity: normal

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 50946 <at> debbugs.gnu.org
Subject: bug#50946: insert-file-contents can corrupt buffers.  [Was: bug#50946: Emacs-28: Inadequate coding in hack-elisp-shorthands]
Date: Sun, 03 Oct 2021 18:56:05 +0300
> From: João Távora <joaotavora <at> gmail.com>
> Cc:  50946 <at> debbugs.gnu.org
> Date: Sun, 03 Oct 2021 16:34:19 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > João, why didn't you simply insert
> >
> >   (alist-get 'elisp-shorthands (hack-local-variables--find-variables))
> >
> > in load-with-code-conversion, immediately after it calls
> > insert-file-contents?  Are there any problems with that, and if so,
> > what are they?
> 
> There shouldn't be any big problems.  As I said, I think that is
> cleaner.  However, doing it "from the outside" is safer (except for
> these insert-file-contents bugs/edge cases, which frankly escape me).
> 
> Your suggestion has a very minor problem, that you're doing this stuff
> in lisp/international/mule.el, which slightly icky.

Why "icky"?  The whole load-with-code-conversion stuff is defined
there, so that's a natural place for any things that need to be done
during loading, IMO.

> A bigger problem is that hack-local-variables--find-variables isn't
> defined at that point and the function will then be used to load
> lisp/files.el itself (which happens to be where h-l-v--f-v is defined).

You are talking about loadup?  We can easily condition the call by
that function's being fboundp, no?  Preloaded files, at least those
loaded before file.el, should not use shorthands, so bypassing the
call should not produce any problems.  Am I missing something?

> (BTW this is after the agreed renaming to read-symbol-shorthands, which
> I just pushed)

OK, thanks.




This bug report was last modified 3 years and 235 days ago.

Previous Next


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