GNU bug report logs - #12221
24.2; shell completion can not handle multiple candidates

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Sat, 18 Aug 2012 02:37:02 UTC

Severity: normal

Found in version 24.1

Fixed in version 24.2

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

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 12221 in the body.
You can then email your comments to 12221 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 monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#12221; Package emacs. (Sat, 18 Aug 2012 02:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Sat, 18 Aug 2012 02:37:03 GMT) Full text and rfc822 format available.

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

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2; shell completion can not handle multiple candidates
Date: Sat, 18 Aug 2012 10:31:04 +0800
1. Emacs -q
2. (setq completion-cycle-threshold 3)
3. M-x shell
4. fu <tab>

In OSX, the last step completes to `fuser' ignoring `funzip'. The
completion cannot cycle because of the extra ' ' inserted which
demonstrates one of the failures of completion-at-point as reported in
http://debbugs.gnu.org/11906.

Leo




Merged 12092 12221. Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 16 Sep 2012 03:28:02 GMT) Full text and rfc822 format available.

Disconnected #12221 from all other report(s). Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 17 Sep 2012 14:49:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12221; Package emacs. (Wed, 03 Oct 2012 05:51:01 GMT) Full text and rfc822 format available.

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

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#12221: 24.2;
	shell completion can not handle multiple candidates
Date: Wed, 03 Oct 2012 13:49:05 +0800
On 2012-08-18 10:31 +0800, Leo wrote:
> 1. Emacs -q
> 2. (setq completion-cycle-threshold 3)
> 3. M-x shell
> 4. fu <tab>
>
> In OSX, the last step completes to `fuser' ignoring `funzip'. The
> completion cannot cycle because of the extra ' ' inserted which
> demonstrates one of the failures of completion-at-point as reported in
> http://debbugs.gnu.org/11906.

And of course when this is broken, M-! (shell-command) breaks as well. I
wonder if there is any plan in fixing up completion-at-point for 24.3.
This thing has been implanted in so many places in emacs that when it
breaks it hurts badly!

Regards,
Leo





Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Fri, 19 Oct 2012 21:13:01 GMT) Full text and rfc822 format available.

Notification sent to Leo <sdl.web <at> gmail.com>:
bug acknowledged by developer. (Fri, 19 Oct 2012 21:13:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 12221-done <at> debbugs.gnu.org
Subject: 24.2; shell completion can not handle multiple candidates
Date: Fri, 19 Oct 2012 17:11:13 -0400
I've installed the patch below which I believe fixes the bug, finally.


        Stefan


=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2012-10-19 09:28:50 +0000
+++ lisp/ChangeLog	2012-10-19 18:58:27 +0000
@@ -1,3 +1,8 @@
+2012-10-19  Stefan Monnier  <monnier <at> iro.umontreal.ca>
+
+	* minibuffer.el (minibuffer-force-complete): Make the next completion use
+	the same completion-field (bug <at> 12221).
+
 2012-10-19  Martin Rudalics  <rudalics <at> gmx.at>
 
 	* emacs-lisp/debug.el (debug): Record height of debugger window

=== modified file 'lisp/minibuffer.el'
--- lisp/minibuffer.el	2012-10-18 03:30:04 +0000
+++ lisp/minibuffer.el	2012-10-19 18:40:12 +0000
@@ -1134,7 +1134,23 @@
       ;; through the previous possible completions.
       (let ((last (last all)))
         (setcdr last (cons (car all) (cdr last)))
-        (completion--cache-all-sorted-completions (cdr all)))))))
+        (completion--cache-all-sorted-completions (cdr all)))
+      ;; Make sure repeated uses cycle, even though completion--done might
+      ;; have added a space or something that moved us outside of the field.
+      ;; (bug#12221).
+      (let* ((table minibuffer-completion-table)
+             (pred minibuffer-completion-predicate)
+             (extra-prop completion-extra-properties)
+             (cmd
+              (lambda () "Cycle through the possible completions."
+                (interactive)
+                (let ((completion-extra-properties extra-prop))
+                  (completion-in-region start (point) table pred)))))
+        (set-temporary-overlay-map
+         (let ((map (make-sparse-keymap)))
+           (define-key map [remap completion-at-point] cmd)
+           (define-key map (vector last-command-event) cmd)
+           map)))))))
 
 (defvar minibuffer-confirm-exit-commands
   '(completion-at-point minibuffer-complete
@@ -1557,7 +1573,6 @@
   (let* ((exit-fun (plist-get completion-extra-properties :exit-function))
          (pre-msg (and exit-fun (current-message))))
     (cl-assert (memq finished '(exact sole finished unknown)))
-    ;; FIXME: exit-fun should receive `finished' as a parameter.
     (when exit-fun
       (when (eq finished 'unknown)
         (setq finished




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 17 Nov 2012 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 160 days ago.

Previous Next


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