Discussion:
Bug#1099027: dictionaries-common: Silence Emacs load messages in files from dictionaries-common
Add Reply
Farblos
2025-02-27 12:40:01 UTC
Reply
Permalink
Package: dictionaries-common
Version: 1.30.5
Severity: wishlist
X-Debbugs-Cc: ***@vodafonemail.de

Dear Maintainer,

thanks for so quickly fixing my previous issue #1098337, much
appreciated! Here is another one with rather low severity,
related to bug #979982. Which unfortunately waits for a
resolution for quite some time already.

Anyway, when calling Emacs in batch mode, like this:

[~]$ emacs --batch --eval '(message "foobarbaz")'
Loading /etc/emacs/site-start.d/00debian.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50bbdb3.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
foobarbaz
[~]$ emacs -q --batch --eval '(message "foobarbaz")'
Loading /etc/emacs/site-start.d/00debian.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50bbdb3.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
foobarbaz

the Debian Elisp is rather noisy. While the first couple of
messages is related to bug #979982, the last three ones could be
fixed in dictionaries-common.

Like in the following two patches:

------------------------- snip -------------------------
--- 50dictionaries-common.el.orig 2021-02-22 19:03:21.000000000 +0100
+++ 50dictionaries-common.el 2025-02-27 13:29:14.814316733 +0100
@@ -32,12 +32,12 @@
(symbol-name debian-emacs-flavor)
"/site-lisp/dictionaries-common/debian-ispell.el"))
(if (getenv "DPKG_RUNNING_VERSION")
(message "Info: Skip debian-el loading if run under dpkg control.")
(let ((coding-system-for-read 'raw-text)) ;; Read these as data streams
- (load "debian-ispell" t)
- (load debian-dict-entries t)))
+ (load "debian-ispell" t t)
+ (load debian-dict-entries t t)))
(message "Info: Package dictionaries-common removed but not purged."))))

;;; Previous code for loading ispell.el and refreshing spell-checking
;;; pulldown menus has been removed from this file since it should no
;;; longer be needed.
------------------------- snip -------------------------

------------------------- snip -------------------------
--- debian-ispell.el.orig 2025-02-19 21:32:13.000000000 +0100
+++ debian-ispell.el 2025-02-27 13:29:34.654291299 +0100
@@ -307,11 +307,11 @@
;; ---------------------------------------------------------------------------
;; Load the file containing the default value for debian-ispell-dictionary
;; ---------------------------------------------------------------------------

(if (file-exists-p "/var/cache/dictionaries-common/emacsen-ispell-default.el")
- (load "/var/cache/dictionaries-common/emacsen-ispell-default.el"))
+ (load "/var/cache/dictionaries-common/emacsen-ispell-default.el" nil t))

;;; ----------------

(defvar debian-aspell-dictionary
nil
------------------------- snip -------------------------

Thanks!


-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.12-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dictionaries-common depends on:
ii debconf [debconf-2.0] 1.5.89
ii emacsen-common 3.0.5
ii libtext-iconv-perl 1.7-8+b4

dictionaries-common recommends no packages.

Versions of packages dictionaries-common suggests:
ii aspell 0.60.8.1-4
ii ispell 3.4.06-1
ii wamerican [wordlist] 2020.12.07-3
ii wngerman [wordlist] 20161207-14

-- debconf information excluded
Farblos
2025-02-28 20:50:01 UTC
Reply
Permalink
Hi Augustin,

thanks for your quick fix, again. Only I have a couple of
minor and not-so minor nits with respect to its
implementation, namely the newly introduced variable
`ispell-load-nomessage':

1. Personally and honestly, I don't think that a new variable
would be necessary here. As the doc string for function
`load' explains, its NOMESSAGE argument can always be
overridden by setting `force-load-message'. And I somewhat
doubt that a user really would like to have per-package
granularity for these (rather pesky) load messages.

2. Again rather personally, I don't think that it's necessary
to make this dependent on `noninteractive'. Just using
unconditional t for NOMESSAGE for all calls should be fine.
The main Debian hook in startup.el does the same, BTW:

(if (load "debian-startup" t t nil)
(debian-startup debian-emacs-flavor))

But these are my rather personal opinion and you can freely
ignore them. However, the name of your variable is asking for
trouble, since you somewhat violate the Emacs "namespacing
etiquette" by which only "ispell.el" would ever be allowed to
introduce new symbols with prefix "ispell-". So:

3. If you would like to keep that variable, you should consider
renaming it to `debian-ispell-load-nomessage'

Finally, one more suggestion that is rather unrelated: You
use this code:

(let ((ispell-default-file "/var/cache/dictionaries-common/emacsen-ispell-default.el"))
(if (file-exists-p ispell-default-file)
(load ispell-default-file nil ispell-load-nomessage)))

to conditionally load that default file (again using a symbol
prefixed by "ispell-", but since it's let-bound, it's probably
OK). In my opinion you should be able to simplify that to

(load "/var/cache/dictionaries-common/emacsen-ispell-default.el"
t ispell-load-nomessage)

using t as NOERROR argument for `load'.

(I have tried signing up for Debian Salsa, hoping I could
provide feedback through the GitLab there, but I am not sure
whether me signing up is approved by the Salsa maintainers...)

Thanks again, regards

Jens
Agustin Martin
2025-03-02 12:30:01 UTC
Reply
Permalink
Post by Farblos
Hi Augustin,
thanks for your quick fix, again. Only I have a couple of
minor and not-so minor nits with respect to its
implementation, namely the newly introduced variable
Thanks, variable renamed to `debian-ispell-load-nomessage' and
"emacsen-ispell-default.el" simplified.
Post by Farblos
1. Personally and honestly, I don't think that a new variable
would be necessary here. As the doc string for function
`load' explains, its NOMESSAGE argument can always be
overridden by setting `force-load-message'. And I somewhat
doubt that a user really would like to have per-package
granularity for these (rather pesky) load messages.
2. Again rather personally, I don't think that it's necessary
to make this dependent on `noninteractive'. Just using
unconditional t for NOMESSAGE for all calls should be fine.
(if (load "debian-startup" t t nil)
(debian-startup debian-emacs-flavor))
I prefer to keep having this behavior to have a place where more info is
available. This code is supposed to run under both Emacs and XEmacs and
`force-load-message' seems not available for XEmacs. I also thought of
early-init.el with debian-dict-common-debug enabled and
`debian-ispell-load-nomessage' set as not it, but that is not always loaded
and seems not available for XEmacs.
Post by Farblos
(I have tried signing up for Debian Salsa, hoping I could
provide feedback through the GitLab there, but I am not sure
whether me signing up is approved by the Salsa maintainers...)
I personally prefer the BTS for bug related interactions, but that is a
personal choice.

Thanks again for your feedback.
--
Agustin
Farblos
2025-03-02 14:20:01 UTC
Reply
Permalink
Post by Agustin Martin
I prefer to keep having this behavior to have a place where more info is
available. This code is supposed to run under both Emacs and XEmacs and
`force-load-message' seems not available for XEmacs. I also thought of
early-init.el with debian-dict-common-debug enabled and
`debian-ispell-load-nomessage' set as not it, but that is not always loaded
and seems not available for XEmacs.
Right you are, I forgot that there is more than just GNU Emacs ...

Thanks

Jens

Loading...