unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23695: 25.0.94; todo-mode breaks minibuffer-complete-word
@ 2016-06-05  9:18 Stephen Berman
  2016-06-10  9:28 ` Stephen Berman
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Berman @ 2016-06-05  9:18 UTC (permalink / raw)
  To: 23695

0. emacs -Q
1. Sanity check: Typing e.g. `C-h f url- SPC' should pop up a
   *Completions* buffer showing functions beginning with "url-", since
   SPC in the minibuffer is bound to minibuffer-complete-word.
2. C-g to exit the minibuffer, then, if you have no files made by
   todo-mode (i.e. no directory ~/.emacs.d/todo), type `M-x todo-show
   RET RET RET RET RET' (accepting defaults) to create a todo file with
   a category and an entry.
3. Type `q' to quit todo-mode (optional) and redo step 1.
=> Upon typing SPC this time, instead of getting the *Completions*
   buffer, a space is inserted in the minibuffer after "url-".

If at step 2 you already have one or more todo-files, then invoking a
number of todo-mode commands, e.g. `j' to jump to another category or
`C a' to add a new category, will likewise globally change the effect of
all subsequent uses of SPC in the minibuffer.

The patch below fixes this.  I request approval to push this fix to
emacs-25, since without it, todo-mode-specific behavior changes the
minibuffer behavior in rest of Emacs.  Also, the fix is certainly safe,
since it replaces naively implemented functionality by canonical code to
temporarily change a minibuffer key binding.  (Since I normally don't
use SPC for minibuffer completion but just TAB, I only discovered this
bug yesterday, when I was trying and failed to reproduce bug#23670 in a
session in which I had already used the broken todo-mode function.)

diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 8e75258..f0d4bc5 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -5750,8 +5750,9 @@ todo-read-category
 against categories in that file; otherwise complete against all
 categories from `todo-category-completions-files'."
   ;; Allow SPC to insert spaces, for adding new category names.
-  (let ((map minibuffer-local-completion-map))
-    (define-key map " " nil)
+  (let ((minibuffer-local-completion-map
+         (copy-keymap minibuffer-local-completion-map)))
+    (define-key minibuffer-local-completion-map " " 'self-insert-command)
     (let* ((add (eq match-type 'add))
 	   (archive (eq match-type 'archive))
 	   (file0 (when (and file (> (length todo-files) 1))


In GNU Emacs 25.0.94.8 (x86_64-suse-linux-gnu, GTK+ Version 3.14.15)
 of 2016-06-05 built on rosalinde
Repository revision: a5d05f447008c4a99d1b00f0af642b4a5ce4cbce
Windowing system distributor 'The X.Org Foundation', version 11.0.11601000
System Description:	openSUSE 13.2 (Harlequin) (x86_64)

Configured using:
 'configure --with-xwidgets 'CFLAGS=-Og -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY
GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XWIDGETS

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#23695: 25.0.94; todo-mode breaks minibuffer-complete-word
  2016-06-05  9:18 bug#23695: 25.0.94; todo-mode breaks minibuffer-complete-word Stephen Berman
@ 2016-06-10  9:28 ` Stephen Berman
  2016-06-10 10:18   ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Berman @ 2016-06-10  9:28 UTC (permalink / raw)
  To: 23695

On Sun, 05 Jun 2016 11:18:46 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:

> 0. emacs -Q
> 1. Sanity check: Typing e.g. `C-h f url- SPC' should pop up a
>    *Completions* buffer showing functions beginning with "url-", since
>    SPC in the minibuffer is bound to minibuffer-complete-word.
> 2. C-g to exit the minibuffer, then, if you have no files made by
>    todo-mode (i.e. no directory ~/.emacs.d/todo), type `M-x todo-show
>    RET RET RET RET RET' (accepting defaults) to create a todo file with
>    a category and an entry.
> 3. Type `q' to quit todo-mode (optional) and redo step 1.
> => Upon typing SPC this time, instead of getting the *Completions*
>    buffer, a space is inserted in the minibuffer after "url-".
>
> If at step 2 you already have one or more todo-files, then invoking a
> number of todo-mode commands, e.g. `j' to jump to another category or
> `C a' to add a new category, will likewise globally change the effect of
> all subsequent uses of SPC in the minibuffer.
>
> The patch below fixes this.  I request approval to push this fix to
> emacs-25, since without it, todo-mode-specific behavior changes the
> minibuffer behavior in rest of Emacs.  Also, the fix is certainly safe,
> since it replaces naively implemented functionality by canonical code to
> temporarily change a minibuffer key binding.

Ping!  Any objections to pushing this fix to emacs-25?

Steve Berman





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23695: 25.0.94; todo-mode breaks minibuffer-complete-word
  2016-06-10  9:28 ` Stephen Berman
@ 2016-06-10 10:18   ` Eli Zaretskii
  2016-06-10 10:36     ` Stephen Berman
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-06-10 10:18 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 23695

> From: Stephen Berman <stephen.berman@gmx.net>
> Date: Fri, 10 Jun 2016 11:28:14 +0200
> 
> On Sun, 05 Jun 2016 11:18:46 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:
> 
> > 0. emacs -Q
> > 1. Sanity check: Typing e.g. `C-h f url- SPC' should pop up a
> >    *Completions* buffer showing functions beginning with "url-", since
> >    SPC in the minibuffer is bound to minibuffer-complete-word.
> > 2. C-g to exit the minibuffer, then, if you have no files made by
> >    todo-mode (i.e. no directory ~/.emacs.d/todo), type `M-x todo-show
> >    RET RET RET RET RET' (accepting defaults) to create a todo file with
> >    a category and an entry.
> > 3. Type `q' to quit todo-mode (optional) and redo step 1.
> > => Upon typing SPC this time, instead of getting the *Completions*
> >    buffer, a space is inserted in the minibuffer after "url-".
> >
> > If at step 2 you already have one or more todo-files, then invoking a
> > number of todo-mode commands, e.g. `j' to jump to another category or
> > `C a' to add a new category, will likewise globally change the effect of
> > all subsequent uses of SPC in the minibuffer.
> >
> > The patch below fixes this.  I request approval to push this fix to
> > emacs-25, since without it, todo-mode-specific behavior changes the
> > minibuffer behavior in rest of Emacs.  Also, the fix is certainly safe,
> > since it replaces naively implemented functionality by canonical code to
> > temporarily change a minibuffer key binding.
> 
> Ping!  Any objections to pushing this fix to emacs-25?

We've lived with this for the last 2 years, how come it's so urgent
now?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23695: 25.0.94; todo-mode breaks minibuffer-complete-word
  2016-06-10 10:18   ` Eli Zaretskii
@ 2016-06-10 10:36     ` Stephen Berman
  2016-06-14 17:05       ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Berman @ 2016-06-10 10:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 23695

On Fri, 10 Jun 2016 13:18:48 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Date: Fri, 10 Jun 2016 11:28:14 +0200
>> 
>> On Sun, 05 Jun 2016 11:18:46 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:
>> 
>> > 0. emacs -Q
>> > 1. Sanity check: Typing e.g. `C-h f url- SPC' should pop up a
>> >    *Completions* buffer showing functions beginning with "url-", since
>> >    SPC in the minibuffer is bound to minibuffer-complete-word.
>> > 2. C-g to exit the minibuffer, then, if you have no files made by
>> >    todo-mode (i.e. no directory ~/.emacs.d/todo), type `M-x todo-show
>> >    RET RET RET RET RET' (accepting defaults) to create a todo file with
>> >    a category and an entry.
>> > 3. Type `q' to quit todo-mode (optional) and redo step 1.
>> > => Upon typing SPC this time, instead of getting the *Completions*
>> >    buffer, a space is inserted in the minibuffer after "url-".
>> >
>> > If at step 2 you already have one or more todo-files, then invoking a
>> > number of todo-mode commands, e.g. `j' to jump to another category or
>> > `C a' to add a new category, will likewise globally change the effect of
>> > all subsequent uses of SPC in the minibuffer.
>> >
>> > The patch below fixes this.  I request approval to push this fix to
>> > emacs-25, since without it, todo-mode-specific behavior changes the
>> > minibuffer behavior in rest of Emacs.  Also, the fix is certainly safe,
>> > since it replaces naively implemented functionality by canonical code to
>> > temporarily change a minibuffer key binding.
>> 
>> Ping!  Any objections to pushing this fix to emacs-25?
>
> We've lived with this for the last 2 years, how come it's so urgent
> now?

It's no more urgent now than it was two years ago, it's just that I only
discovered it now.  And again, the bug not only affects todo-mode but
completion throughout Emacs.  Admittedly, the intersection of those who
regularly use both todo-mode and minibuffer-complete-word is probably
very small (possibly empty), but still, why release with a known bug
when the fix is obvious and obviously safe?  Or do you think it isn't?

Steve Berman





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23695: 25.0.94; todo-mode breaks minibuffer-complete-word
  2016-06-10 10:36     ` Stephen Berman
@ 2016-06-14 17:05       ` Eli Zaretskii
  2016-06-14 21:46         ` Stephen Berman
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-06-14 17:05 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 23695

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: 23695@debbugs.gnu.org
> Date: Fri, 10 Jun 2016 12:36:20 +0200
> 
> >> Ping!  Any objections to pushing this fix to emacs-25?
> >
> > We've lived with this for the last 2 years, how come it's so urgent
> > now?
> 
> It's no more urgent now than it was two years ago, it's just that I only
> discovered it now.  And again, the bug not only affects todo-mode but
> completion throughout Emacs.  Admittedly, the intersection of those who
> regularly use both todo-mode and minibuffer-complete-word is probably
> very small (possibly empty), but still, why release with a known bug
> when the fix is obvious and obviously safe?  Or do you think it isn't?

OK, please go ahead and push to emacs-25.

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23695: 25.0.94; todo-mode breaks minibuffer-complete-word
  2016-06-14 17:05       ` Eli Zaretskii
@ 2016-06-14 21:46         ` Stephen Berman
  2016-06-29  9:52           ` Stephen Berman
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Berman @ 2016-06-14 21:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 23695

On Tue, 14 Jun 2016 20:05:43 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: 23695@debbugs.gnu.org
>> Date: Fri, 10 Jun 2016 12:36:20 +0200
>> 
>> >> Ping!  Any objections to pushing this fix to emacs-25?
>> >
>> > We've lived with this for the last 2 years, how come it's so urgent
>> > now?
>> 
>> It's no more urgent now than it was two years ago, it's just that I only
>> discovered it now.  And again, the bug not only affects todo-mode but
>> completion throughout Emacs.  Admittedly, the intersection of those who
>> regularly use both todo-mode and minibuffer-complete-word is probably
>> very small (possibly empty), but still, why release with a known bug
>> when the fix is obvious and obviously safe?  Or do you think it isn't?
>
> OK, please go ahead and push to emacs-25.

Done in commit d7084f2.

Steve Berman





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23695: 25.0.94; todo-mode breaks minibuffer-complete-word
  2016-06-14 21:46         ` Stephen Berman
@ 2016-06-29  9:52           ` Stephen Berman
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Berman @ 2016-06-29  9:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 23695-done

On Tue, 14 Jun 2016 23:46:06 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:

> On Tue, 14 Jun 2016 20:05:43 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
>>
>> OK, please go ahead and push to emacs-25.
>
> Done in commit d7084f2.

Now closing the bug (forgot to when I pushed the fix).

Steve Berman





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-29  9:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-05  9:18 bug#23695: 25.0.94; todo-mode breaks minibuffer-complete-word Stephen Berman
2016-06-10  9:28 ` Stephen Berman
2016-06-10 10:18   ` Eli Zaretskii
2016-06-10 10:36     ` Stephen Berman
2016-06-14 17:05       ` Eli Zaretskii
2016-06-14 21:46         ` Stephen Berman
2016-06-29  9:52           ` Stephen Berman

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).