unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 65891@debbugs.gnu.org
Subject: bug#65891: 29.0.91; Could the error msg be better for this?
Date: Tue, 12 Sep 2023 15:26:07 +0000	[thread overview]
Message-ID: <SJ0PR10MB54889BEA67D15C120E7C9295F3F1A@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)

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	other threads:[~2023-09-12 15:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 15:26 Drew Adams [this message]
2023-09-12 15:48 ` bug#65891: 29.0.91; Could the error msg be better for this? Andreas Schwab
2023-09-12 17:11   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB54889BEA67D15C120E7C9295F3F1A@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=65891@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).