[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Skipping unexec via a big .elc file

From: Eli Zaretskii
Subject: Re: Skipping unexec via a big .elc file
Date: Sat, 11 Mar 2017 14:27:11 +0200

> From: Ken Raeburn <address@hidden>
> Date: Mon, 6 Mar 2017 03:46:17 -0500
> Cc: address@hidden
> On Mar 4, 2017, at 09:23, Eli Zaretskii <address@hidden> wrote:
> >>> Also, it looks like the logic in startup.el that should bypass certain
> >>> stuff under -Q isn't working, because I see my abbrevs being loaded
> >>> even though I invoked "emacs -Q".  Thoughts?
> >> 
> >> Strange… this is also working for me.  At least, settings from my .emacs 
> >> aren’t being applied, when I use “emacs -Q”.
> > 
> > This problem is still there.  It has nothing to do with loading
> > ~/.emacs, though: startup.el always loads your ~/.emacs.d/abbrev_defs,
> > if that file exists.  I'm not sure why it loads that file, but I
> > verified that the master version does that as well.
> Odd, seems like -Q should skip that, with the rest of the user’s 
> initializations.

Maybe so, but this code has been there since about forever, and the
documentation of -Q doesn't say user's abbrevs are bypassed, only
under -batch.  In any case, it's a separate problem.

> > So the issue here is not that the file is loaded, but how it is
> > processed.  I only noticed this because my abbrev_defs file uses a
> > function that is only defined in my .emacs.  So "emacs -Q" on the
> > raeburn-startup branch barfs because that function is not known.
> > Strangely, "emacs -Q" on the master branch doesn't signal an error,
> > and I don't even see Fsignal called if I set a breakpoint there.  I
> > don't (yet) understand why the different behavior.
> > 
> > If you insert into your abbrev_defs file something that references a
> > function which is not defined, do you see the same problem as I do?
> I added a line:
>   (missing-function)
> in between some define-abbrev-table invocations, and “emacs -Q” on master 
> (2-3 weeks old) and raeburn-startup both complain about it for me.

I debugged this some more: this has nothing to do with unknown
functions, you just need to have global abbrevs in the abbrev_defs
file, for example:

  (define-abbrev-table 'global-abbrev-table
      ("abbout" "about" nil 0)
      ("abotu" "about" nil 0)))

The problem seems to be that global-abbrev-table is not an abbrev
table where startup.el calls quietly-read-abbrev-file (abbrev-table-p
returns nil for it).  If I make this change:

diff --git a/lisp/startup.el b/lisp/startup.el
index 4a04f9c..7f55962 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1263,6 +1263,8 @@ command-line
        ;; If the user has a file of abbrevs, read it (unless -batch).
+       (or (abbrev-table-p global-abbrev-table)
+           (setq global-abbrev-table (make-abbrev-table)))
        (when (and (not noninteractive)
                   (file-exists-p abbrev-file-name)
                   (file-readable-p abbrev-file-name))

then "emacs -Q" starts up normally.  Can you reproduce this?

global-abbrev-table is defined in abbrev.el like this:

  (defvar global-abbrev-table (make-abbrev-table)
    "The abbrev table whose abbrevs affect all buffers.
  Each buffer may also have a local abbrev table.
  If it does, the local table overrides the global one
  for any particular abbrev defined in both.")

So I think the issue could be that this defvar somehow doesn't end up
in dumped.elc as an abbrev table under the new build procedure.  Does that make 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]