From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/72126 Path: news.gmane.org!not-for-mail From: Florian Ragwitz Newsgroups: gmane.emacs.gnus.general Subject: Re: [PATCH] Introduce gnus-completing-read Date: Tue, 28 Sep 2010 17:55:29 +0200 Message-ID: <87wrq5ammm.fsf@tardis.home.perldition.org> References: <1285688153-19680-1-git-send-email-julien@danjou.info> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1285689393 8590 80.91.229.12 (28 Sep 2010 15:56:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 28 Sep 2010 15:56:33 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M20499@lists.math.uh.edu Tue Sep 28 17:56:32 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P0cXg-0004t8-AP for ding-account@gmane.org; Tue, 28 Sep 2010 17:56:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1P0cXf-0003ww-4M; Tue, 28 Sep 2010 10:56:31 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1P0cXd-0003wf-5L for ding@lists.math.uh.edu; Tue, 28 Sep 2010 10:56:29 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1P0cXb-0000KW-Pf for ding@lists.math.uh.edu; Tue, 28 Sep 2010 10:56:29 -0500 Original-Received: from kief.perldition.org ([78.47.20.161]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1P0cXb-0000Nv-00 for ; Tue, 28 Sep 2010 17:56:27 +0200 Original-Received: from p4fd76c8a.dip.t-dialin.net ([79.215.108.138] helo=tardis.home.perldition.org) by kief.perldition.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1P0cXY-0001zo-SC for ding@gnus.org; Tue, 28 Sep 2010 17:56:26 +0200 Original-Received: from rafl by tardis.home.perldition.org with local (Exim 4.72) (envelope-from ) id 1P0cWp-0003BJ-AQ for ding@gnus.org; Tue, 28 Sep 2010 17:55:39 +0200 Mail-Copies-To: never 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") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) X-Spam_score: -3.8 X-Spam_score_int: -37 X-Spam_bar: --- X-Spam_report: Spam detection software, running on the system "kief.perldition.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Julien Danjou writes: > Hi there, > > As promised yesterday, here's my patch! > > It adds `gnus-completion-styles' which set `completion-styles' when calling > `completing-read'. [...] Content analysis details: (-3.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.000 X-Spam-Score: -0.4 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:72126 Archived-At: --=-=-= Content-Type: text/plain Julien Danjou 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. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkyiD/IACgkQdC8qQo5jWl4fxQCfWAh8PhOcEL09vLpVSgyZdTKZ lMoAmQHxePL8QaE8HaGUFucpEjlT61Ye =oA5w -----END PGP SIGNATURE----- --=-=-=--