Gnus development mailing list
 help / color / mirror / Atom feed
From: Florian Ragwitz <rafl@debian.org>
To: ding@gnus.org
Subject: Re: [PATCH] Introduce gnus-completing-read
Date: Tue, 28 Sep 2010 17:55:29 +0200	[thread overview]
Message-ID: <87wrq5ammm.fsf@tardis.home.perldition.org> (raw)
In-Reply-To: <1285688153-19680-1-git-send-email-julien@danjou.info> (Julien Danjou's message of "Tue, 28 Sep 2010 17:35:53 +0200")

[-- Attachment #1: Type: text/plain, Size: 2390 bytes --]

Julien Danjou <julien@danjou.info> writes:
> Hi there,
>
> As promised yesterday, here's my patch!
>
> It adds `gnus-completion-styles' which set `completion-styles' when calling
> `completing-read'.

I like your idea, and your patch. Thank you.

> It adds `gnus-use-ido' which makes `gnus-completing-read' use
> `ido-completing-read' rather than `completing-read'

I don't like that too much. How about something along the lines of

--8<---------------cut here---------------start------------->8---
(defun pod-completing-read (prompt choices)
  "Use `completing-read' to do a completing read."
  (completing-read prompt choices))

(defun pod-icompleting-read (prompt choices)
  "Use iswitchb to do a completing read."
  (let ((iswitchb-make-buflist-hook
         (lambda ()
           (setq iswitchb-temp-buflist choices))))
    (unwind-protect
        (progn
          (when (not iswitchb-mode)
            (add-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup))
          (iswitchb-read-buffer prompt))
      (when (not iswitchb-mode)
        (remove-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)))))

(defun pod-ido-completing-read (prompt choices)
  "Use ido to do a completing read."
  (ido-completing-read prompt choices))

(defcustom pod-completing-read-function
  #'pod-icompleting-read
  "Ask the user to select a single item from a list.
Used by `pod-link-section', `pod-link-module', and
`pod-link-module-section'."
  :group 'pod-mode
  :type '(radio (function-item
                 :doc "Use Emacs' standard `completing-read' function."
                 pod-completing-read)
                (function-item :doc "Use iswitchb's completing-read function."
                               pod-icompleting-read)
                (function-item :doc "Use ido's completing-read function."
                               pod-ido-completing-read)
                (function)))

(defun pod-do-completing-read (&rest args)
  "Do a completing read with the configured `pod-completing-read-function'."
  (apply pod-completing-read-function args))
--8<---------------cut here---------------end--------------->8---

This is what I did a couple of months back for pod-mode.el. I believe it
makes for nicer customisation. If you like this as well, I'd be happy to
prepare an updated patch using the above, and extending it also support
REQUIRE-MATCH, INITIAL-INPUT, HISTORY, etc.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2010-09-28 15:55 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28 15:35 Julien Danjou
2010-09-28 15:49 ` Eric Abrahamsen
2010-09-28 15:55 ` Florian Ragwitz [this message]
2010-09-28 16:04   ` Julien Danjou
2010-09-28 19:31     ` Florian Ragwitz
2010-09-28 20:47       ` Julien Danjou
2010-09-29 15:19         ` Lars Magne Ingebrigtsen
2010-09-29 21:47           ` Lars Magne Ingebrigtsen
2010-09-30  8:05             ` Julien Danjou
2010-09-30  9:42               ` Robert Pluim
2010-09-30  9:56                 ` Julien Danjou
2010-09-30  6:46           ` Reiner Steib
2010-09-30 10:23             ` Florian Ragwitz
2010-09-30 10:44               ` Lars Magne Ingebrigtsen
2010-09-30 11:33                 ` Florian Ragwitz
2010-09-30 11:36                   ` Lars Magne Ingebrigtsen
2010-09-30 11:42                     ` Florian Ragwitz
2010-09-30 12:20                       ` Julien Danjou
2010-09-30 12:54                         ` Florian Ragwitz
2010-09-30 13:29                           ` Julien Danjou
2010-09-30 16:33                           ` Lars Magne Ingebrigtsen
2010-09-30 16:48                             ` Ted Zlatanov
2010-09-30 16:55                               ` Lars Magne Ingebrigtsen
2010-09-30 17:13                                 ` Ted Zlatanov
2010-09-30 17:22                                   ` Florian Ragwitz
2010-09-30 17:39                                     ` Lars Magne Ingebrigtsen
2010-09-30 17:41                                       ` Florian Ragwitz
2010-09-30 17:49                                         ` Lars Magne Ingebrigtsen
2010-10-01  1:01                                           ` Florian Ragwitz
2010-10-01  9:43                                             ` Lars Magne Ingebrigtsen
2010-10-01 10:13                                               ` Lars Magne Ingebrigtsen
2010-09-30 17:47                                     ` Ted Zlatanov
2010-10-01  9:00                                       ` Julien Danjou
2010-09-30 17:06                               ` Florian Ragwitz
2010-10-01  6:17                           ` Copyright assignments, policies, conventions (was: [PATCH] Introduce gnus-completing-read) Reiner Steib
2010-10-01 13:51                             ` Copyright assignments, policies, conventions Štěpán Němec
2010-09-30 12:13                   ` [PATCH] Introduce gnus-completing-read Štěpán Němec
2010-09-28 15:55 ` Dan Christensen
2010-09-28 16:00   ` Julien Danjou
2010-09-28 16:02     ` Julien Danjou
2010-09-28 20:07 ` Ted Zlatanov
2010-09-28 20:36   ` Julien Danjou
2010-09-28 21:08     ` Ted Zlatanov
2010-10-01 15:57 ` Matt Lundin
2010-10-01 18:21   ` Lars Magne Ingebrigtsen
2010-10-01 23:45     ` Matt Lundin
2010-10-02  2:21       ` Lars Magne Ingebrigtsen
2010-10-02 17:48         ` Matt Lundin

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=87wrq5ammm.fsf@tardis.home.perldition.org \
    --to=rafl@debian.org \
    --cc=ding@gnus.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.
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 NNTP newsgroup(s).