From: Daniel Colascione <dancol@dancol.org>
To: 16226@debbugs.gnu.org
Subject: bug#16226: [patch] icomplete can't display completions on initial display
Date: Mon, 23 Dec 2013 07:47:09 -0800 [thread overview]
Message-ID: <52B85AFD.1010604@dancol.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 132 bytes --]
This patch allows icomplete to work a bit more like iswitchb and show a
list of completions when first entering a completion task.
[-- Attachment #2: compl.patch --]
[-- Type: text/x-patch, Size: 2108 bytes --]
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2013-12-23 15:01:32 +0000
+++ lisp/ChangeLog 2013-12-23 15:42:53 +0000
@@ -1,6 +1,11 @@
2013-12-23 Daniel Colascione <dancol@dancol.org>
* icomplete.el: Move `provide' to end of file.
+ (icomplete-show-matches-on-no-input): New customizable variable.
+ (icomplete-minibuffer-setup): Call `icomplete-exhibit' on setup if
+ we have something to show.
+ (icomplete-exhibit): Compute completions even if we have no user
+ input.
2013-12-23 Teodor Zlatanov <tzz@lifelogs.com>
=== modified file 'lisp/icomplete.el'
--- lisp/icomplete.el 2013-12-23 15:01:32 +0000
+++ lisp/icomplete.el 2013-12-23 15:32:57 +0000
@@ -79,6 +79,12 @@
:version "24.4"
:group 'icomplete)
+(defcustom icomplete-show-matches-on-no-input t
+ "When non-nil, show completions when first prompting for input."
+ :type 'boolean
+ :version "24.4"
+ :group 'icomplete)
+
(defface icomplete-first-match '((t :weight bold))
"Face used by icomplete for highlighting first match."
:version "24.4"
@@ -256,7 +262,9 @@
(current-local-map)))
(add-hook 'pre-command-hook #'icomplete-pre-command-hook nil t)
(add-hook 'post-command-hook #'icomplete-post-command-hook nil t)
- (run-hooks 'icomplete-minibuffer-setup-hook)))
+ (run-hooks 'icomplete-minibuffer-setup-hook)
+ (when icomplete-show-matches-on-no-input
+ (icomplete-exhibit))))
(defvar icomplete--in-region-buffer nil)
@@ -304,8 +312,9 @@
(save-excursion
(goto-char (point-max))
; Insert the match-status information:
- (if (and (> (icomplete--field-end) (icomplete--field-beg))
- buffer-undo-list ; Wait for some user input.
+ (if (and (or (> (icomplete--field-end) (icomplete--field-beg))
+ (and icomplete-show-matches-on-no-input
+ (= (icomplete--field-end) (icomplete--field-beg))))
(or
;; Don't bother with delay after certain number of chars:
(> (- (point) (icomplete--field-beg))
next reply other threads:[~2013-12-23 15:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-23 15:47 Daniel Colascione [this message]
2013-12-24 3:32 ` bug#16226: [patch] icomplete can't display completions on initial display Stefan Monnier
2013-12-24 3:53 ` Daniel Colascione
2013-12-24 14:45 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52B85AFD.1010604@dancol.org \
--to=dancol@dancol.org \
--cc=16226@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.