bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#65891: 29.0.91; Could the error msg be better for this?


From: Drew Adams
Subject: bug#65891: 29.0.91; Could the error msg be better for this?
Date: Tue, 12 Sep 2023 15:26:07 +0000

A user asked on StackOverflow why s?he got an error with this code.
(https://stackoverflow.com/q/77085788/729907)

(add-hook 'org-mode-hook
          #'(lambda () (local-unset-key (kdb "C-j"))))

The problem was the typo: `kdb' instead of `kbd'.

Actually, s?he didn't see the error msg, and was just wondering why
the key `C-j' wasn't getting unset in Org mode.
And the hook function was of course removed after the error was
raised, so the msg was shown only once.

This is the error msg:

 File mode specification error: (void-function kdb)

Could we maybe provide a better error msg here?

I'm guessing that it's flagged as a "file mode specification" error
because it's from a mode hook?  But major modes are not necessarily
about file buffers.  And anyway, "file mode specification" isn't very
clear or helpful, is it?  At least to me it doesn't say anything useful,
so far - but maybe with an explanation it will make sense.

If this is a generic error msg from a hook function that raises an error
then maybe it would be better to just say that a hook function raised an
error, if we can't say which hook function raised an error and we can't
pass along the msg from the error that the hook function raised?

I guess "(void-function kdb)" is the error raised by the hook function
(but it's not really a user-targeted message).  But why introduce the
error with the mysterious (to me) "File specification error"?

In GNU Emacs 29.0.91 (build 2, x86_64-w64-mingw32) of 2023-05-14 built
 on AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19045
System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.3324)

Configured using:
 'configure --with-modules --without-dbus --with-native-compilation
 --without-compress-install --with-tree-sitter CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

(NATIVE_COMP present but libgccjit not available)






reply via email to

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