[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#46373: 28.0.50; "Not in most nested minibuffer" error when selecting
From: |
Alan Mackenzie |
Subject: |
bug#46373: 28.0.50; "Not in most nested minibuffer" error when selecting date in calendar |
Date: |
Mon, 8 Feb 2021 12:17:15 +0000 |
Hello, Lars and Sébastien.
On Mon, Feb 08, 2021 at 07:50:52 +0100, Lars Ingebrigtsen wrote:
> Sébastien Le Callonnec <sebastien@weblogism.com> writes:
> > Debugger entered--Lisp error: (error "Not in most nested minibuffer")
> > signal(error ("Not in most nested minibuffer"))
> [...]
> > Here are the steps to reproduce the issue following `emacs -Q`:
> > M-: (setq debug-on-error t) RET
> > C-x C-f /tmp/example.org RET
> > C-c .
> > Click on date in calendar
> > git bisect indicates commit c7c154bb5756e0ae71d342c5d8aabf725877f186
> > is the first bad commit
> An even simpler method to reproduce:
> `M-x org-time-stamp RET'
> then mouse-click on one of the dates in the calendar buffer.
Sorry about the misunderstanding. I'd neglected the case when
exit-minibuffer is called from Lisp code rather than from a keybinding.
Please try out the following patch, which I think fixes this bug:
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 185d355ba7..b60775d457 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -2393,7 +2393,7 @@ Minibuffer Commands
@deffn Command exit-minibuffer
This command exits the active minibuffer. It is normally bound to
keys in minibuffer local keymaps. The command throws an error if the
-current buffer is not the active minibuffer.
+current buffer is a minibuffer, but not the active minibuffer.
@end deffn
@deffn Command self-insert-and-exit
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 03cc70c0d4..a899a943d4 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2116,13 +2116,15 @@ minibuffer-hide-completions
(defun exit-minibuffer ()
"Terminate this minibuffer argument."
(interactive)
+ (when (or
+ (innermost-minibuffer-p)
+ (not (minibufferp)))
;; If the command that uses this has made modifications in the minibuffer,
;; we don't want them to cause deactivation of the mark in the original
;; buffer.
;; A better solution would be to make deactivate-mark buffer-local
;; (or to turn it into a list of buffers, ...), but in the mean time,
;; this should do the trick in most cases.
- (when (innermost-minibuffer-p)
(setq deactivate-mark nil)
(throw 'exit nil))
(error "%s" "Not in most nested minibuffer"))
> I've added Alan to the CCs since c7c154bb5 is his change.
Thanks!
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no
--
Alan Mackenzie (Nuremberg, Germany).