all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#12221: 24.2; shell completion can not handle multiple candidates
@ 2012-08-18  2:31 Leo
  2012-10-03  5:49 ` Leo
  2012-10-19 21:11 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: Leo @ 2012-08-18  2:31 UTC (permalink / raw)
  To: 12221

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





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

* bug#12221: 24.2; shell completion can not handle multiple candidates
  2012-08-18  2:31 bug#12221: 24.2; shell completion can not handle multiple candidates Leo
@ 2012-10-03  5:49 ` Leo
  2012-10-19 21:11 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Leo @ 2012-10-03  5:49 UTC (permalink / raw)
  To: 12221

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






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

* bug#12221: 24.2; shell completion can not handle multiple candidates
  2012-08-18  2:31 bug#12221: 24.2; shell completion can not handle multiple candidates Leo
  2012-10-03  5:49 ` Leo
@ 2012-10-19 21:11 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2012-10-19 21:11 UTC (permalink / raw)
  To: 12221-done

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@iro.umontreal.ca>
+
+	* minibuffer.el (minibuffer-force-complete): Make the next completion use
+	the same completion-field (bug@12221).
+
 2012-10-19  Martin Rudalics  <rudalics@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





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

end of thread, other threads:[~2012-10-19 21:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-18  2:31 bug#12221: 24.2; shell completion can not handle multiple candidates Leo
2012-10-03  5:49 ` Leo
2012-10-19 21:11 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.