GNU bug report logs - #67361
29.1; MH-E: creating a new folder can sometimes fail with a Lisp error

Previous Next

Package: emacs;

Reported by: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>

Date: Wed, 22 Nov 2023 08:26:03 UTC

Severity: normal

Found in version 29.1

Done: Bill Wohler <wohler <at> newt.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67361 in the body.
You can then email your comments to 67361 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#67361; Package emacs. (Wed, 22 Nov 2023 08:26:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 22 Nov 2023 08:26:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>
To: bug-gnu-emacs <at> gnu.org
Cc: cks.emacsbugs-01 <at> cs.toronto.edu
Subject: 29.1; MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Tue, 21 Nov 2023 20:45:11 -0500
Under some conditions, creating a new (N)MH folder in MH-E can fail with
a Lisp error of 'Wrong type argument: stringp, nil'. This happens if for
some reason you have loaded/required mh-speed.el but have not created a
speedbar.

Reproduction in 'emacs -Q', assuming you have NMH set up:

* enter MH-E with M-x mh-rmail
* widen to your entire inbox so you have something to refile, 'F r'.
* require mh-speed: M-: (require 'mh-soeed)
* select a message and refile with 'o'. When asked for the target
  folder, enter one that doesn't exist, say '+anewtestfolder'. Say y to
  have this folder created.
* the refile will abort with the minibuffer message showing 'Wrong type
  argument: stringp, nil'

The full *Messages* buffer contents are (for my test, with a slightly
different folder path):
	Folder +misc/anewtestfolder does not exist.  Create it? (y or n) y
	Creating +misc/anewtestfolder
	mh-prompt-for-folder: Wrong type argument: stringp, nil

I believe the root cause of this problem is that mh-prompt-for-folder
calls mh-speed-add-folder if 'mh-speed-folder-map is bound:
	(when (boundp 'mh-speed-folder-map)
	  (mh-speed-add-folder folder-name))

However, mh-speed-add-folder requires that speedbar-buffer exists, as it
starts with:
	(with-current-buffer speedbar-buffer
	  ....)

In edebug, it is this with-current-buffer call that appears to fail and
produce the error message when called with no speedbar displayed and
speedbar-buffer nil.

Requiring or loading mh-speed without a speedbuffer displayed is
probably unusual, but I need to do it in order to customize some aspects
of my MH-E speedbar interface.

NOTE: I have reproduced this in 'emacs -Q', but this bug report is filed
from within my regular Emacs and MH-E environment, with multiple third
party packages and load-file shadowing and so on. You can ignore those
parts of this report.

In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33,
 cairo version 1.16.0) of 2023-10-30 built on comps3
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Ubuntu 22.04.3 LTS

Configured using:
 'configure --prefix /u/cks/lib/x64-linux/emacs-29.1 --without-gsettings
 --with-x --with-x-toolkit=gtk3 --with-json --with-tree-sitter
 --with-native-compilation=aot'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ JPEG JSON LCMS2
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LC_COLLATE: C
  value of $LC_CTYPE: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  smartparens-mode: t
  global-corfu-mode: t
  corfu-mode: t
  marginalia-mode: t
  vertico-mouse-mode: t
  vertico-multiform-mode: t
  vertico-mode: t
  which-key-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  backward-forward-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/u/cks/.emacs.d/elpa/transient-20231121.1154/transient hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/transient
/u/cks/.emacs.d/elpa/use-package-20230426.2324/use-package-core hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/use-package/use-package-core
/u/cks/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/use-package/use-package-diminish
/u/cks/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/use-package/bind-key
/u/cks/.emacs.d/elpa/use-package-20230426.2324/use-package-lint hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/use-package/use-package-lint
/u/cks/.emacs.d/elpa/use-package-20230426.2324/use-package-jump hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/use-package/use-package-jump
/u/cks/.emacs.d/elpa/use-package-20230426.2324/use-package hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/use-package/use-package
/u/cks/.emacs.d/elpa/use-package-20230426.2324/use-package-delight hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/use-package/use-package-delight
/u/cks/.emacs.d/elpa/use-package-20230426.2324/use-package-bind-key hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/use-package/use-package-bind-key
/u/cks/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/use-package/use-package-ensure
/u/cks/.emacs.d/elpa/project-0.10.0/project hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/progmodes/project
/u/cks/.emacs.d/elpa/seq-2.24/seq hides /u/cks/lib/x64-linux/emacs-29.1/share/emacs/29.1/lisp/emacs-lisp/seq

Features:
(shadow mh-identity mh-letter emacsbug orderless project consult
bookmark textsec uni-scripts idna-mapping ucs-normalize uni-confusable
textsec-check shr-color color mule-util qp mm-archive mail-extr mh-seq
mh-inc hl-line mh-tool-bar flyspell ispell mh-xface mh-cks mh-cks-speed
mh-speed speedbar ezimage dframe gnus-icalendar org-capture org-refile
org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src
ob-comint org-pcomplete pcomplete comint ansi-osc ring org-list
org-footnote org-faces org-entities noutline outline ob-emacs-lisp
ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys
oc org-loaddefs org-version org-compat org-macs format-spec icalendar
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs mh-utils mh-mime
mh-acros mh-show gnus-cite gnus-art mm-uu mml2015 gnus-sum shr
pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start
gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 nnoo
parse-time iso8601 gnus-spec gnus-int message yank-media dired
dired-loaddefs rfc822 mailabbrev gmm-utils mailheader gnus-win
gnus-range gnus nnheader range wid-edit mh-comp sendmail mail-utils
mh-gnus mml mm-view mml-smime mml-sec epa derived epg rfc6068 epg-config
smime gnutls puny dig mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mh-folder which-func imenu
gnus-util text-property-search time-date mh-scan mh-e mh-buffers
mh-loaddefs goto-addr comp comp-cstr warnings icons smartparens advice
loadhist thingatpt .emacs corfu marginalia vertico-mouse
vertico-multiform vertico compat which-key flycheck ansi-color find-func
rx dash backward-forward edmacro kmacro cl-extra help-mode pp diminish
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core finder-inf
company-autoloads consult-flycheck-autoloads consult-flyspell-autoloads
consult-lsp-autoloads corfu-autoloads embark-consult-autoloads
consult-autoloads embark-autoloads evil-autoloads
expand-region-autoloads flycheck-golangci-lint-autoloads
flycheck-autoloads fold-this-autoloads go-mode-autoloads
goto-chg-autoloads lsp-ui-autoloads lsp-mode-autoloads magit-autoloads
pcase git-commit-autoloads magit-section-autoloads marginalia-autoloads
orderless-autoloads project-autoloads markdown-mode-autoloads
f-autoloads rust-mode-autoloads smartparens-autoloads
transient-autoloads try-autoloads vertico-autoloads vundo-autoloads
which-key-autoloads with-editor-autoloads info compat-autoloads
seq-autoloads yaml-mode-autoloads package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 712854 301161)
 (symbols 48 33375 30)
 (strings 32 182335 53947)
 (string-bytes 1 5543861)
 (vectors 16 81476)
 (vector-slots 8 1411017 522310)
 (floats 8 495 1417)
 (intervals 56 4586 1703)
 (buffers 984 24))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67361; Package emacs. (Wed, 22 Nov 2023 14:43:03 GMT) Full text and rfc822 format available.

Message #8 received at 67361 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>,
 Bill Wohler <wohler <at> newt.com>
Cc: 67361 <at> debbugs.gnu.org, cks.emacsbugs-01 <at> cs.toronto.edu
Subject: Re: bug#67361: 29.1;
 MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Wed, 22 Nov 2023 16:41:51 +0200
> Cc: cks.emacsbugs-01 <at> cs.toronto.edu
> From: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>
> Date: Tue, 21 Nov 2023 20:45:11 -0500
> 
> Under some conditions, creating a new (N)MH folder in MH-E can fail with
> a Lisp error of 'Wrong type argument: stringp, nil'. This happens if for
> some reason you have loaded/required mh-speed.el but have not created a
> speedbar.
> 
> Reproduction in 'emacs -Q', assuming you have NMH set up:
> 
> * enter MH-E with M-x mh-rmail
> * widen to your entire inbox so you have something to refile, 'F r'.
> * require mh-speed: M-: (require 'mh-soeed)
> * select a message and refile with 'o'. When asked for the target
>   folder, enter one that doesn't exist, say '+anewtestfolder'. Say y to
>   have this folder created.
> * the refile will abort with the minibuffer message showing 'Wrong type
>   argument: stringp, nil'
> 
> The full *Messages* buffer contents are (for my test, with a slightly
> different folder path):
> 	Folder +misc/anewtestfolder does not exist.  Create it? (y or n) y
> 	Creating +misc/anewtestfolder
> 	mh-prompt-for-folder: Wrong type argument: stringp, nil
> 
> I believe the root cause of this problem is that mh-prompt-for-folder
> calls mh-speed-add-folder if 'mh-speed-folder-map is bound:
> 	(when (boundp 'mh-speed-folder-map)
> 	  (mh-speed-add-folder folder-name))
> 
> However, mh-speed-add-folder requires that speedbar-buffer exists, as it
> starts with:
> 	(with-current-buffer speedbar-buffer
> 	  ....)
> 
> In edebug, it is this with-current-buffer call that appears to fail and
> produce the error message when called with no speedbar displayed and
> speedbar-buffer nil.
> 
> Requiring or loading mh-speed without a speedbuffer displayed is
> probably unusual, but I need to do it in order to customize some aspects
> of my MH-E speedbar interface.
> 
> NOTE: I have reproduced this in 'emacs -Q', but this bug report is filed
> from within my regular Emacs and MH-E environment, with multiple third
> party packages and load-file shadowing and so on. You can ignore those
> parts of this report.

Adding Bill.

I'm not sure if it is better to report MH-E-related bugs here or
submit the reports to https://sourceforge.net/p/mh-e/bugs/.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67361; Package emacs. (Wed, 22 Nov 2023 16:32:02 GMT) Full text and rfc822 format available.

Message #11 received at 67361 <at> debbugs.gnu.org (full text, mbox):

From: Mike Kupfer <kupfer <at> rawbw.com>
To: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>
Cc: 67361 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Bill Wohler <wohler <at> newt.com>
Subject: Re: bug#67361: 29.1;
 MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Wed, 22 Nov 2023 08:30:55 -0800
> > From: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>
> > Date: Tue, 21 Nov 2023 20:45:11 -0500
> > 
> > Under some conditions, creating a new (N)MH folder in MH-E can fail with
> > a Lisp error of 'Wrong type argument: stringp, nil'. This happens if for
> > some reason you have loaded/required mh-speed.el but have not created a
> > speedbar.

This sounds familiar.  I don't use the speedbar, but I sometimes hit
this issue and find that (boundp 'mh-speed-folder-map) returns t.  I
thought there was an open bug for this already, but I'm not finding it.
I'll look some more over the holiday weekend.

mike




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67361; Package emacs. (Sat, 25 Nov 2023 02:33:01 GMT) Full text and rfc822 format available.

Message #14 received at 67361 <at> debbugs.gnu.org (full text, mbox):

From: Mike Kupfer <kupfer <at> rawbw.com>
To: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>,
 Bill Wohler <wohler <at> newt.com>
Cc: 67361 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#67361: 29.1;
 MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Fri, 24 Nov 2023 18:31:55 -0800
Mike Kupfer wrote:

> > > From: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>
> > > Date: Tue, 21 Nov 2023 20:45:11 -0500
> > > 
> > > Under some conditions, creating a new (N)MH folder in MH-E can fail with
> > > a Lisp error of 'Wrong type argument: stringp, nil'. This happens if for
> > > some reason you have loaded/required mh-speed.el but have not created a
> > > speedbar.
> 
> This sounds familiar.  I don't use the speedbar, but I sometimes hit
> this issue and find that (boundp 'mh-speed-folder-map) returns t.  I
> thought there was an open bug for this already, but I'm not finding it.
> I'll look some more over the holiday weekend.

I'm sure I've run into this problem in the past, but I can't find any
record of it.  Not in debbugs.gnu.org, not in the SourceForge bug
tracker, not in my email archives.  Hmph.

Still, I agree with Chris's root cause analysis:

> I believe the root cause of this problem is that mh-prompt-for-folder
> calls mh-speed-add-folder if 'mh-speed-folder-map is bound:
> 	(when (boundp 'mh-speed-folder-map)
> 	  (mh-speed-add-folder folder-name))
> 
> However, mh-speed-add-folder requires that speedbar-buffer exists, as it
> starts with:
> 	(with-current-buffer speedbar-buffer
> 	  ....)

The same issue appears in 2 other places:

  - mh-kill-folder, calling mh-speed-invalidate-map
  - mh-index-new-folder, calling mh-speed-add-folder

I'm not entirely sure how I have ended up with mh-speed-folder-map bound
in the past.  It might be from trying to get the help information for
something that's defined in mh-speed.el--that seems to cause mh-speed to
be loaded, which causes mh-speed-folder-map to be initialized.

Using mh-speed-folder-map as the test for whether the speedbar is active
seems broken to me.  Unfortunately, I don't use the speedbar, and I
don't understand the MH-E speedbar code all that well.  So I'm not sure
what the right test is.  There's a function mh-speed-flists-active-p,
but its docstring says

  "Check if speedbar is running with message counts enabled."

Bill, is there a mode where the speedbar is running *without* message
counts enabled?  Or can we just replace 

    (when (boundp 'mh-speed-folder-map)

with

    (if (mh-speed-flists-active-p)

?

mike




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67361; Package emacs. (Sat, 25 Nov 2023 03:58:02 GMT) Full text and rfc822 format available.

Message #17 received at 67361 <at> debbugs.gnu.org (full text, mbox):

From: Mike Kupfer <kupfer <at> rawbw.com>
To: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>,
 Bill Wohler <wohler <at> newt.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 67361 <at> debbugs.gnu.org
Subject: Re: bug#67361: 29.1;
 MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Fri, 24 Nov 2023 19:56:59 -0800
Chris Siebenmann wrote:

> I believe that if the speedbar is active (which I believe is when
> speedbar-buffer is non-nil) and you're in MH-E, the speedbar will be
> showing your MH folder hierarchy instead of anything else. But I'm not
> 100% sure of this.

I've lightly tested the patch below and not seen any problems.  What do
you guys think about it?

mike

diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -108,7 +108,7 @@
             (window-config mh-previous-window-config))
         (mh-set-folder-modified-p t)    ; lock folder to kill it
         (mh-exec-cmd-daemon "rmf" 'mh-rmf-daemon folder)
-        (when (boundp 'mh-speed-folder-map)
+        (when (and (boundp 'speedbar-buffer) speedbar-buffer)
           (mh-speed-invalidate-map folder))
         (mh-remove-from-sub-folders-cache folder)
         (mh-set-folder-modified-p nil)  ; so kill-buffer doesn't complain
diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
--- a/lisp/mh-e/mh-search.el
+++ b/lisp/mh-e/mh-search.el
@@ -1569,7 +1569,7 @@
     (save-excursion (mh-exec-cmd-quiet nil "rmf" chosen-name))
     (mh-exec-cmd-quiet nil "folder" "-create" "-fast" chosen-name)
     (mh-remove-from-sub-folders-cache chosen-name)
-    (when (boundp 'mh-speed-folder-map)
+    (when (and (boundp 'speedbar-buffer) speedbar-buffer)
       (mh-speed-add-folder chosen-name))
     chosen-name))
 
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -795,7 +795,7 @@
              (message "Creating %s" folder-name)
              (mh-exec-cmd-error nil "folder" folder-name)
              (mh-remove-from-sub-folders-cache folder-name)
-             (when (boundp 'mh-speed-folder-map)
+             (when (and (boundp 'speedbar-buffer) speedbar-buffer)
                (mh-speed-add-folder folder-name))
              (message "Creating %s...done" folder-name))
             (new-file-flag




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67361; Package emacs. (Sat, 25 Nov 2023 08:18:04 GMT) Full text and rfc822 format available.

Message #20 received at 67361 <at> debbugs.gnu.org (full text, mbox):

From: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>
To: Mike Kupfer <kupfer <at> rawbw.com>
Cc: 67361 <at> debbugs.gnu.org, Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>,
 Eli Zaretskii <eliz <at> gnu.org>, Bill Wohler <wohler <at> newt.com>
Subject: Re: bug#67361: 29.1;
 MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Fri, 24 Nov 2023 22:18:16 -0500
> Using mh-speed-folder-map as the test for whether the speedbar is active
> seems broken to me.  Unfortunately, I don't use the speedbar, and I
> don't understand the MH-E speedbar code all that well.  So I'm not sure
> what the right test is.  There's a function mh-speed-flists-active-p,
> but its docstring says
>
>   "Check if speedbar is running with message counts enabled."
>
> Bill, is there a mode where the speedbar is running *without* message
> counts enabled?  Or can we just replace 
>
>     (when (boundp 'mh-speed-folder-map)
>
> with
>
>     (if (mh-speed-flists-active-p)
>
> ?

I believe there is such a mode. If you set mh-speed-update-interval to 0
and invoke the speedbar, you get a display of your MH folders but
without any message counts, because MH-E isn't periodically running
flists to find them out. You might sensibly use the speedbar this way if
all of your email is put into +inbox (so nothing else will ever have
unread messages and the counts of read messages are broadly
uninteresting to you) and you use the speedbar as a handy way of
navigating and visualizing a complex folder hierarchy.

I believe that if the speedbar is active (which I believe is when
speedbar-buffer is non-nil) and you're in MH-E, the speedbar will be
showing your MH folder hierarchy instead of anything else. But I'm not
100% sure of this. The code in mh-speed certainly seems to expect to
find MH's content in the speedbar buffer without further checks that I
can see.

	- cks




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67361; Package emacs. (Sat, 30 Dec 2023 23:35:02 GMT) Full text and rfc822 format available.

Message #23 received at 67361 <at> debbugs.gnu.org (full text, mbox):

From: Bill Wohler <wohler <at> newt.com>
To: Mike Kupfer <kupfer <at> rawbw.com>
Cc: 67361 <at> debbugs.gnu.org, Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#67361: 29.1;
 MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Sat, 30 Dec 2023 15:33:54 -0800
Chris, you are correct. Even if you start up the speedbar before
starting MH-E, MH-E will then update the old speedbar view with an MH
view when a MH-E folder becomes active.

Mike, if you've been running this patch without problems, I'd say commit
it and resolve this issue. Testing for an existing speedbar-buffer seems
like a stronger test than mh-speed-folder-map. I just applied the patch
and hasn't broken anything thus far. I even used the speedbar :-).

Mike Kupfer <kupfer <at> rawbw.com> wrote:

> Chris Siebenmann wrote:
> 
> > I believe that if the speedbar is active (which I believe is when
> > speedbar-buffer is non-nil) and you're in MH-E, the speedbar will be
> > showing your MH folder hierarchy instead of anything else. But I'm not
> > 100% sure of this.
> 
> I've lightly tested the patch below and not seen any problems.  What do
> you guys think about it?
> 
> mike
> 
> diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
> --- a/lisp/mh-e/mh-funcs.el
> +++ b/lisp/mh-e/mh-funcs.el
> @@ -108,7 +108,7 @@
>              (window-config mh-previous-window-config))
>          (mh-set-folder-modified-p t)    ; lock folder to kill it
>          (mh-exec-cmd-daemon "rmf" 'mh-rmf-daemon folder)
> -        (when (boundp 'mh-speed-folder-map)
> +        (when (and (boundp 'speedbar-buffer) speedbar-buffer)
>            (mh-speed-invalidate-map folder))
>          (mh-remove-from-sub-folders-cache folder)
>          (mh-set-folder-modified-p nil)  ; so kill-buffer doesn't complain
> diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
> --- a/lisp/mh-e/mh-search.el
> +++ b/lisp/mh-e/mh-search.el
> @@ -1569,7 +1569,7 @@
>      (save-excursion (mh-exec-cmd-quiet nil "rmf" chosen-name))
>      (mh-exec-cmd-quiet nil "folder" "-create" "-fast" chosen-name)
>      (mh-remove-from-sub-folders-cache chosen-name)
> -    (when (boundp 'mh-speed-folder-map)
> +    (when (and (boundp 'speedbar-buffer) speedbar-buffer)
>        (mh-speed-add-folder chosen-name))
>      chosen-name))
>  
> diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
> --- a/lisp/mh-e/mh-utils.el
> +++ b/lisp/mh-e/mh-utils.el
> @@ -795,7 +795,7 @@
>               (message "Creating %s" folder-name)
>               (mh-exec-cmd-error nil "folder" folder-name)
>               (mh-remove-from-sub-folders-cache folder-name)
> -             (when (boundp 'mh-speed-folder-map)
> +             (when (and (boundp 'speedbar-buffer) speedbar-buffer)
>                 (mh-speed-add-folder folder-name))
>               (message "Creating %s...done" folder-name))
>              (new-file-flag
> 

-- 
Bill Wohler <wohler <at> newt.com> aka <Bill.Wohler <at> nasa.gov>
http://www.newt.com/wohler/, GnuPG ID:610BD9AD




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67361; Package emacs. (Sun, 31 Dec 2023 16:51:02 GMT) Full text and rfc822 format available.

Message #26 received at 67361 <at> debbugs.gnu.org (full text, mbox):

From: Bill Wohler <wohler <at> newt.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67361 <at> debbugs.gnu.org, Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>,
 Mike Kupfer <kupfer <at> rawbw.com>
Subject: Re: bug#67361: 29.1;
 MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Sun, 31 Dec 2023 08:49:57 -0800
Eli,

Would you prefer if I applied Mike's patch to the emacs-29 branch or
master?

> diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
> --- a/lisp/mh-e/mh-funcs.el
> +++ b/lisp/mh-e/mh-funcs.el
> @@ -108,7 +108,7 @@
>              (window-config mh-previous-window-config))
>          (mh-set-folder-modified-p t)    ; lock folder to kill it
>          (mh-exec-cmd-daemon "rmf" 'mh-rmf-daemon folder)
> -        (when (boundp 'mh-speed-folder-map)
> +        (when (and (boundp 'speedbar-buffer) speedbar-buffer)
>            (mh-speed-invalidate-map folder))
>          (mh-remove-from-sub-folders-cache folder)
>          (mh-set-folder-modified-p nil)  ; so kill-buffer doesn't complain
> diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
> --- a/lisp/mh-e/mh-search.el
> +++ b/lisp/mh-e/mh-search.el
> @@ -1569,7 +1569,7 @@
>      (save-excursion (mh-exec-cmd-quiet nil "rmf" chosen-name))
>      (mh-exec-cmd-quiet nil "folder" "-create" "-fast" chosen-name)
>      (mh-remove-from-sub-folders-cache chosen-name)
> -    (when (boundp 'mh-speed-folder-map)
> +    (when (and (boundp 'speedbar-buffer) speedbar-buffer)
>        (mh-speed-add-folder chosen-name))
>      chosen-name))
>  
> diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
> --- a/lisp/mh-e/mh-utils.el
> +++ b/lisp/mh-e/mh-utils.el
> @@ -795,7 +795,7 @@
>               (message "Creating %s" folder-name)
>               (mh-exec-cmd-error nil "folder" folder-name)
>               (mh-remove-from-sub-folders-cache folder-name)
> -             (when (boundp 'mh-speed-folder-map)
> +             (when (and (boundp 'speedbar-buffer) speedbar-buffer)
>                 (mh-speed-add-folder folder-name))
>               (message "Creating %s...done" folder-name))
>              (new-file-flag
> 

-- 
Bill Wohler <wohler <at> newt.com> aka <Bill.Wohler <at> nasa.gov>
http://www.newt.com/wohler/, GnuPG ID:610BD9AD




Reply sent to Bill Wohler <wohler <at> newt.com>:
You have taken responsibility. (Tue, 16 Jan 2024 01:36:02 GMT) Full text and rfc822 format available.

Notification sent to Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>:
bug acknowledged by developer. (Tue, 16 Jan 2024 01:36:02 GMT) Full text and rfc822 format available.

Message #31 received at 67361-done <at> debbugs.gnu.org (full text, mbox):

From: Bill Wohler <wohler <at> newt.com>
To: Mike Kupfer <kupfer <at> rawbw.com>
Cc: 67361-done <at> debbugs.gnu.org,
 Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#67361: 29.1;
 MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Mon, 15 Jan 2024 17:34:45 -0800
Version 30.0.50

Thanks for your patch, Mike.

I did not receive approval to commit this patch to the release branch,
so I committed your patch to master and closed the bug.

Bill Wohler <wohler <at> newt.com> wrote:

> Eli,
> 
> Would you prefer if I applied Mike's patch to the emacs-29 branch or
> master?
> 
> > diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
> > --- a/lisp/mh-e/mh-funcs.el
> > +++ b/lisp/mh-e/mh-funcs.el
> > @@ -108,7 +108,7 @@
> >              (window-config mh-previous-window-config))
> >          (mh-set-folder-modified-p t)    ; lock folder to kill it
> >          (mh-exec-cmd-daemon "rmf" 'mh-rmf-daemon folder)
> > -        (when (boundp 'mh-speed-folder-map)
> > +        (when (and (boundp 'speedbar-buffer) speedbar-buffer)
> >            (mh-speed-invalidate-map folder))
> >          (mh-remove-from-sub-folders-cache folder)
> >          (mh-set-folder-modified-p nil)  ; so kill-buffer doesn't complain
> > diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
> > --- a/lisp/mh-e/mh-search.el
> > +++ b/lisp/mh-e/mh-search.el
> > @@ -1569,7 +1569,7 @@
> >      (save-excursion (mh-exec-cmd-quiet nil "rmf" chosen-name))
> >      (mh-exec-cmd-quiet nil "folder" "-create" "-fast" chosen-name)
> >      (mh-remove-from-sub-folders-cache chosen-name)
> > -    (when (boundp 'mh-speed-folder-map)
> > +    (when (and (boundp 'speedbar-buffer) speedbar-buffer)
> >        (mh-speed-add-folder chosen-name))
> >      chosen-name))
> >  
> > diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
> > --- a/lisp/mh-e/mh-utils.el
> > +++ b/lisp/mh-e/mh-utils.el
> > @@ -795,7 +795,7 @@
> >               (message "Creating %s" folder-name)
> >               (mh-exec-cmd-error nil "folder" folder-name)
> >               (mh-remove-from-sub-folders-cache folder-name)
> > -             (when (boundp 'mh-speed-folder-map)
> > +             (when (and (boundp 'speedbar-buffer) speedbar-buffer)
> >                 (mh-speed-add-folder folder-name))
> >               (message "Creating %s...done" folder-name))
> >              (new-file-flag
> > 
> 
> -- 
> Bill Wohler <wohler <at> newt.com> aka <Bill.Wohler <at> nasa.gov>
> http://www.newt.com/wohler/, GnuPG ID:610BD9AD

-- 
Bill Wohler <wohler <at> newt.com> aka <Bill.Wohler <at> nasa.gov>
http://www.newt.com/wohler/, GnuPG ID:610BD9AD




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67361; Package emacs. (Tue, 16 Jan 2024 12:25:02 GMT) Full text and rfc822 format available.

Message #34 received at 67361 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Bill Wohler <wohler <at> newt.com>
Cc: 67361 <at> debbugs.gnu.org, cks.emacsbugs-01 <at> cs.toronto.edu, kupfer <at> rawbw.com
Subject: Re: bug#67361: 29.1;
 MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Tue, 16 Jan 2024 14:24:38 +0200
> cc: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>,
>     67361-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
> From: Bill Wohler <wohler <at> newt.com>
> Comments: In-reply-to Bill Wohler <wohler <at> newt.com>
>    message dated "Sun, 31 Dec 2023 08:49:57 -0800."
> Date: Mon, 15 Jan 2024 17:34:45 -0800
> 
> Version 30.0.50
> 
> Thanks for your patch, Mike.
> 
> I did not receive approval to commit this patch to the release branch,
> so I committed your patch to master and closed the bug.

Apologies, I somehow missed your request.

This is okay for emacs-29, so I've now cherry-picked it to the release
branch.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67361; Package emacs. (Wed, 17 Jan 2024 16:48:02 GMT) Full text and rfc822 format available.

Message #37 received at 67361 <at> debbugs.gnu.org (full text, mbox):

From: Bill Wohler <wohler <at> newt.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67361 <at> debbugs.gnu.org, cks.emacsbugs-01 <at> cs.toronto.edu, kupfer <at> rawbw.com
Subject: Re: bug#67361: 29.1;
 MH-E: creating a new folder can sometimes fail with a Lisp error
Date: Wed, 17 Jan 2024 08:47:28 -0800
OK, thanks!

Eli Zaretskii <eliz <at> gnu.org> wrote:

> > cc: Chris Siebenmann <cks.emacsbugs-01 <at> cs.toronto.edu>,
> >     67361-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
> > From: Bill Wohler <wohler <at> newt.com>
> > Comments: In-reply-to Bill Wohler <wohler <at> newt.com>
> >    message dated "Sun, 31 Dec 2023 08:49:57 -0800."
> > Date: Mon, 15 Jan 2024 17:34:45 -0800
> > 
> > Version 30.0.50
> > 
> > Thanks for your patch, Mike.
> > 
> > I did not receive approval to commit this patch to the release branch,
> > so I committed your patch to master and closed the bug.
> 
> Apologies, I somehow missed your request.
> 
> This is okay for emacs-29, so I've now cherry-picked it to the release
> branch.
> 
> Thanks.
> 

-- 
Bill Wohler <wohler <at> newt.com> aka <Bill.Wohler <at> nasa.gov>
http://www.newt.com/wohler/, GnuPG ID:610BD9AD




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 15 Feb 2024 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 111 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.