Closed ndw closed 3 years ago
I should have said, this is an Emacs 27.1 that I compiled myself on MacOS.
Thanks for the report. I'm not too familiar with byte compilation and I don't quite understand why the byte compiled code would fail. If you comment out the faulty line, compilation is ok?
It compiles just fine, that's an error I get when the compiled code runs. For the moment, I've just deleted nano-layout.elc
.
From the error, the faulty line is around L44. Can you check if you comment it ?
If I comment out that line (and the set-display-table-slot
below it, for good measure), the error does not occur. I can't tell what other effect this might have though. I'm not sure what that code is supposed to accomplish.
This line replaces the default continuation character ($) with a nicer glyph (…) . No idea why byte compiling it poses a problem. Maybe you can test this line with emacs -q
and check if the problem persists. In such case, you would need to report the problem to emacs+bug.
Could this have to do with the font? Not sure how the bytecode compilation process works (or how fonts are handled, I'm new to emacs), but the error went away when I installed Fira Code
(I had neither Fira Code
nor Roboto
installed in my system)
That might be an explanation yes if the compiled code doesn't do all the checks on the availability of fonts.
Hi I'm facing the same error even when I have both the fonts installed on my system, and I commented out the lines and checked too, the error persists. Any insight?
Do you mean that you get the same behavior with/without faulty line when compiling?
I noticed that I didn't have Fira Code installed and wondered if that was it. It wasn't. I've now got both Fira Code and Roboto Mono installed and I'm still getting the same error. Emacs 27.1.91 built by me in March on MacOS.
I poked at it a bit more without any luck. I did observe the following, however: nano-layout
contains a reference to 'nano-face-faded
:
(defface fallback '((t :family "Fira Code"
:inherit 'nano-face-faded)) "Fallback")
(set-display-table-slot standard-display-table 'truncation
(make-glyph-code ?… 'fallback))
FWIW, that face isn't defined until 'nano-faces
is loaded. But my random attempt to load the faces before loading layout didn't have any effect.
Good point. Can you try to remove the inherit part (or replace with default) and check if this solves the problem?
While I'm no closer to understanding what the problem is, I've managed to completely separate it from NΛNO. Put the following lines in testdt.el
:
(message "Hello")
(describe-display-table standard-display-table)
(message (format "%s" (char-table-p standard-display-table)))
(message "Goodbye")
Start emacs: emacs -q -l testdt.el
You'll get this in the *Message*
buffer:
For information about GNU Emacs and the GNU system, type C-h C-a.
Hello
Type C-x 1 to delete the help window.
t
Goodbye
And this in the *Help*
buffer:
Truncation glyph: nil
Wrap glyph: nil
Escape glyph: nil
Ctrl glyph: nil
Selective display glyph sequence: nil
Vertical window border glyph: nil
Character display glyph sequences:
Now byte compile the file and start emacs: emacs -q -l testdt.elc
You'll get an the wrong-type-argument error and the *Messages*
buffer will contain:
For information about GNU Emacs and the GNU system, type C-h C-a.
Hello
display-table-slot: Wrong type argument: char-table-p, nil
The *Help*
buffer will contain:
Truncation glyph:
So there's something wrong with attempting to access the standard-display-table
from byte compiled code.
I've no clue what to do next with this information. I'm not on the Emacas developers list anymore, maybe it's time to send it there?
I think you can directly file a bug from inside emacs (M-x report-emacs-bug
) with your explanation.
Done.
If I byte compile Nano, I get the following error when loading
nano-layout
:I'm running this in a test home directory (
HOME=/Users/ndw/testemacs emacs
) with this init file:The
nano-emacs
directory is just what I cloned from GitHub, with the files byte compiled. I have no trouble loadingnano-layout
if I delete the.elc
file.