From unknown Mon Aug 18 08:52:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#7752 <7752@debbugs.gnu.org> To: bug#7752 <7752@debbugs.gnu.org> Subject: Status: 24.0.50; [PATCH] Add completing-read-function Reply-To: bug#7752 <7752@debbugs.gnu.org> Date: Mon, 18 Aug 2025 15:52:22 +0000 retitle 7752 24.0.50; [PATCH] Add completing-read-function reassign 7752 emacs submitter 7752 Leo severity 7752 wishlist tag 7752 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 28 18:37:00 2010 Received: (at submit) by debbugs.gnu.org; 28 Dec 2010 23:37:00 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PXj6B-0007Yq-4I for submit@debbugs.gnu.org; Tue, 28 Dec 2010 18:36:59 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PXj68-0007Yc-M2 for submit@debbugs.gnu.org; Tue, 28 Dec 2010 18:36:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PXjCh-00082m-0H for submit@debbugs.gnu.org; Tue, 28 Dec 2010 18:43:48 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL, T_TVD_MIME_NO_HEADERS autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:37079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PXjCg-00082i-SH for submit@debbugs.gnu.org; Tue, 28 Dec 2010 18:43:42 -0500 Received: from [140.186.70.92] (port=38314 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PXjCb-0001Xx-FD for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2010 18:43:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PXjCW-00081a-25 for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2010 18:43:37 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:55695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PXjCV-00081N-Kd for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2010 18:43:31 -0500 Received: by wwb17 with SMTP id 17so9985760wwb.30 for ; Tue, 28 Dec 2010 15:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:x-debbugs-cc :date:message-id:mime-version:content-type; bh=irqAkXq7VY4tLWwRCcBAP/EzeNJJLKM2tetzOSxG9bk=; b=QaEpnMukhSaaVmHza4busAFL+6DUu6UChkm1OK1lNTr3hTAU2wC3l4n3osmQxfEMmX u0NPPWSsAyqnePqsVAEZhQSyEN+eUzzLmvjqGIzk76gT6ne2nuVN5055FHR+PU85Xurx v5oyaa7Ee7Ly/IksnQRPsGj/TrvH7YrQJtXQw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:x-debbugs-cc:date:message-id:mime-version :content-type; b=uFDjrmG6KxRpy8eYy1YHNjw5l5Jd0AT9QW7xIGcTt1b/2psJXNJ1kJ4KYtqwWNwO1o YDTKlx0UOivvWTYrmjGMBXjHrqId4E0OOU0rBkFJ1h72JsYk4pzoCAWFy64f8yZAu+0J AnyNXT4otKZBafF8gmtKzlXgedcbGyouiHCgc= Received: by 10.227.127.199 with SMTP id h7mr8446585wbs.35.1293579809354; Tue, 28 Dec 2010 15:43:29 -0800 (PST) Received: from Victoria.local (cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com [86.9.122.85]) by mx.google.com with ESMTPS id 11sm9667454wbi.0.2010.12.28.15.43.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 28 Dec 2010 15:43:28 -0800 (PST) From: Leo To: bug-gnu-emacs@gnu.org Subject: 24.0.50; [PATCH] Add completing-read-function X-Debbugs-CC: Stefan Monnier , "Drew Adams" Date: Tue, 28 Dec 2010 23:43:25 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.7 (-----) --=-=-= The attached patch (against 24) adds completing-read-function for customising the behaviour of completing-read. See also the discussion in emacs-devel: http://thread.gmane.org/gmane.emacs.devel/134000 (I am in the process of setting up an Emacs bzr repo and familiarising myself with bzr. I expect to be able to commit this myself in the beginning of February.) Leo --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-New-variable-completing-read-function.patch Content-Description: 0001-New-variable-completing-read-function.patch >From 6370abee847415199be3bb86503af408c160b2b9 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 28 Dec 2010 23:30:48 +0000 Subject: [PATCH] New variable completing-read-function that can be used to customize completing-read. --- lisp/ChangeLog | 5 +++++ lisp/ido.el | 8 ++++---- src/ChangeLog | 6 ++++++ src/minibuf.c | 33 ++++++++++++++++++++++++++++++++- 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f9443cf..a778f94 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-12-28 Leo + + * ido.el (ido-read-internal): Fix. + (ido-completing-read): Fix compatibility with completing-read. + 2010-12-28 Chong Yidong * tool-bar.el (tool-bar-setup): Remove :enable conditions, which diff --git a/lisp/ido.el b/lisp/ido.el index 84ae931..ff38ae7 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1984,7 +1984,7 @@ If INITIAL is non-nil, it specifies the initial input string." (setq ido-exit nil) (setq ido-final-text (catch 'ido - (completing-read + (completing-read-default (ido-make-prompt item prompt) '(("dummy" . 1)) nil nil ; table predicate require-match (prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents @@ -4741,13 +4741,13 @@ See `read-directory-name' for additional parameters." (concat ido-current-directory filename))))) ;;;###autoload -(defun ido-completing-read (prompt choices &optional predicate require-match initial-input hist def) +(defun ido-completing-read (prompt choices &optional predicate require-match initial-input hist def inherit-input-method) "Ido replacement for the built-in `completing-read'. Read a string in the minibuffer with ido-style completion. PROMPT is a string to prompt with; normally it ends in a colon and a space. CHOICES is a list of strings which are the possible completions. -PREDICATE is currently ignored; it is included to be compatible - with `completing-read'. +PREDICATE and INHERIT-INPUT-METHOD is currently ignored; it is included + to be compatible with `completing-read'. If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless the input is (or completes to) an element of CHOICES or is null. If the input is null, `ido-completing-read' returns DEF, or an empty diff --git a/src/ChangeLog b/src/ChangeLog index 96e697a..02c60a2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-12-28 Leo + + * minibuf.c (completing-read-function): New variable. + (completing-read-default): Rename from completing-read. + (completing-read): Call completing-read-function. + 2010-12-28 Andreas Schwab * xterm.h (x_alloc_lighter_color_for_widget): Restore declaration. diff --git a/src/minibuf.c b/src/minibuf.c index 0f3def6..ee6b56b 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -130,6 +130,7 @@ Lisp_Object Vminibuffer_completion_table, Qminibuffer_completion_table; Lisp_Object Vminibuffer_completion_predicate, Qminibuffer_completion_predicate; Lisp_Object Vminibuffer_completion_confirm, Qminibuffer_completion_confirm; Lisp_Object Vminibuffer_completing_file_name; +Lisp_Object Qcompleting_read_default, Vcompleting_read_function; Lisp_Object Quser_variable_p; @@ -1726,7 +1727,27 @@ If INHERIT-INPUT-METHOD is non-nil, the minibuffer inherits the current input method and the setting of `enable-multibyte-characters'. Completion ignores case if the ambient value of - `completion-ignore-case' is non-nil. */) + `completion-ignore-case' is non-nil. + +See also `completing-read-function'. */) + (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method) +{ + Lisp_Object args[9]; + args[0] = Vcompleting_read_function; + args[1] = prompt; + args[2] = collection; + args[3] = predicate; + args[4] = require_match; + args[5] = initial_input; + args[6] = hist; + args[7] = def; + args[8] = inherit_input_method; + return Ffuncall (9, args); +} + +DEFUN ("completing-read-default", Fcompleting_read_default, Scompleting_read_default, 2, 8, 0, + doc: /* Default method for reading from the minibuffer with completion. +See `completing-read' for the meaning of the arguments. */) (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method) { Lisp_Object val, histvar, histpos, position; @@ -2024,6 +2045,9 @@ syms_of_minibuf (void) minibuf_save_list = Qnil; staticpro (&minibuf_save_list); + Qcompleting_read_default = intern_c_string ("completing-read-default"); + staticpro (&Qcompleting_read_default); + Qcompletion_ignore_case = intern_c_string ("completion-ignore-case"); staticpro (&Qcompletion_ignore_case); @@ -2163,6 +2187,12 @@ If the value is `confirm-after-completion', the user may exit with an doc: /* Non-nil means completing file names. */); Vminibuffer_completing_file_name = Qnil; + DEFVAR_LISP ("completing-read-function", + &Vcompleting_read_function, + doc: /* The function called by `completing-read' to do the work. +It should accept the same arguments as `completing-read'. */); + Vcompleting_read_function = Qcompleting_read_default; + DEFVAR_LISP ("minibuffer-help-form", &Vminibuffer_help_form, doc: /* Value that `help-form' takes on inside the minibuffer. */); Vminibuffer_help_form = Qnil; @@ -2238,5 +2268,6 @@ properties. */); defsubr (&Stest_completion); defsubr (&Sassoc_string); defsubr (&Scompleting_read); + defsubr (&Scompleting_read_default); } -- 1.7.3.4 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 28 21:48:02 2010 Received: (at 7752) by debbugs.gnu.org; 29 Dec 2010 02:48:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PXm53-00035M-Ty for submit@debbugs.gnu.org; Tue, 28 Dec 2010 21:48:02 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PXm51-000357-UV for 7752@debbugs.gnu.org; Tue, 28 Dec 2010 21:48:00 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEANIxGk1FpZcL/2dsb2JhbACkMXS/FIVKBIRljhs X-IronPort-AV: E=Sophos;i="4.60,242,1291611600"; d="scan'208";a="86664126" Received: from 69-165-151-11.dsl.teksavvy.com (HELO pastel.home) ([69.165.151.11]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 28 Dec 2010 21:54:51 -0500 Received: by pastel.home (Postfix, from userid 20848) id 628FE58AC9; Tue, 28 Dec 2010 21:54:51 -0500 (EST) From: Stefan Monnier To: Leo Subject: Re: bug#7752: 24.0.50; [PATCH] Add completing-read-function Message-ID: References: Date: Tue, 28 Dec 2010 21:54:51 -0500 In-Reply-To: (Leo's message of "Tue, 28 Dec 2010 23:43:25 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 7752 Cc: 7752@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > The attached patch (against 24) adds completing-read-function for > customising the behaviour of completing-read. See also the discussion in > emacs-devel: http://thread.gmane.org/gmane.emacs.devel/134000 Looks good. > (I am in the process of setting up an Emacs bzr repo and familiarising > myself with bzr. I expect to be able to commit this myself in the > beginning of February.) Hopefully, it'll take you less time than that to commit your first patch. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 21 11:09:16 2011 Received: (at 7752-done) by debbugs.gnu.org; 21 Mar 2011 15:09:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1gjL-0001A7-WC for submit@debbugs.gnu.org; Mon, 21 Mar 2011 11:09:16 -0400 Received: from mail-pw0-f44.google.com ([209.85.160.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1gjK-00019e-3Q for 7752-done@debbugs.gnu.org; Mon, 21 Mar 2011 11:09:14 -0400 Received: by pwi5 with SMTP id 5so789001pwi.3 for <7752-done@debbugs.gnu.org>; Mon, 21 Mar 2011 08:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=zJrQMC2S8lADBz1JFsb4x/eQ9kWUzz5q3HJDi8aR/Cc=; b=bBG9E5IIghhcqKHBtshHhBQ7yE2rezwJzpu0rBey1RAN8IZotBpRGXXHzrBZ3MtlOW oG5tkYhYTXhCv+QEIgWaj+ZihunzsrN4kY8PiaSudewIQQCDO8FF2FhFLmXoeP79Ugpm wILof9avowsAVMEvio8Vd6nStBXnfREQVYZHo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; b=KC1OEY6uYVYY42boCelnXfYEYRTQVx/A2/NONt3c5yz4n5dz/bURO8/yiY+01DDrix T9M7MF1s1oA3ak9z6ZV3VicMOJoUBCrayLxeOpWZXTZV4k6jivp7GLLCNRgRx5aAJ5Yq BFg16iEZVXjmwTFrTYyUc6tOohK5Z7XnMqnyU= Received: by 10.142.63.6 with SMTP id l6mr3242986wfa.178.1300720148262; Mon, 21 Mar 2011 08:09:08 -0700 (PDT) Received: from localhost (th041135.ip.tsinghua.edu.cn [59.66.41.135]) by mx.google.com with ESMTPS id 25sm7401224wfb.22.2011.03.21.08.09.04 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Mar 2011 08:09:05 -0700 (PDT) From: Leo To: 7752-done@debbugs.gnu.org Subject: Re: bug#7752: 24.0.50; [PATCH] Add completing-read-function References: Date: Mon, 21 Mar 2011 23:08:55 +0800 In-Reply-To: (Leo's message of "Tue, 28 Dec 2010 23:43:25 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (Mac OS X 10.6.6) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 7752-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) Version: 24.1. From unknown Mon Aug 18 08:52:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 19 Apr 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator