From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#64656: 29.0.91; Doc of minibuffer histories and completing-read - automatic addition of completions to DEFAULT list Date: Fri, 20 Oct 2023 16:48:08 +0000 Message-ID: References: <83y1jga0nr.fsf@gnu.org> <83o7kb9a40.fsf@gnu.org> <86bkg84de3.fsf@mail.linkov.net> <86jzrhlrub.fsf_-_@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32467"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , "64656@debbugs.gnu.org" <64656@debbugs.gnu.org> To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 20 18:49:58 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtshB-0008A3-TR for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Oct 2023 18:49:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtsgq-0003r3-MF; Fri, 20 Oct 2023 12:49:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtsgp-0003qv-32 for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2023 12:49:35 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtsgo-0004mG-Qa for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2023 12:49:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtshF-000619-VF for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2023 12:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Oct 2023 16:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64656 X-GNU-PR-Package: emacs Original-Received: via spool by 64656-submit@debbugs.gnu.org id=B64656.169782054623034 (code B ref 64656); Fri, 20 Oct 2023 16:50:01 +0000 Original-Received: (at 64656) by debbugs.gnu.org; 20 Oct 2023 16:49:06 +0000 Original-Received: from localhost ([127.0.0.1]:41366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtsgL-0005zP-Nf for submit@debbugs.gnu.org; Fri, 20 Oct 2023 12:49:06 -0400 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:19394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtsgI-0005yn-50 for 64656@debbugs.gnu.org; Fri, 20 Oct 2023 12:49:03 -0400 Original-Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KD84kZ031431; Fri, 20 Oct 2023 16:48:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=Ke0nsaln27ZGEpQsf21J0rwFn5lSWi0U1CcNfFjEHAM=; b=obofFYbbrVOHLwqpZJ7aC7lXJyENHqzG89PYRwvChOro0Eg97hNEJgUnV0GtHBUjFpF3 vT4PyIqyY6Xnt21ZtEmpQHz47x3WNv1j6hp7NMJnIhB9O1NWWaM2BufgmDI7+MLCUHop n20MfXQNWKn9GmXpyr9jSX4TCjd8+LqzAhGDVuM4CIBbDBJpUCG4Jq3pGYFiCByTKmpC eKbunDonFkNXxL+r4eMep9l8JFasoOX42ELJSbR/kvGjA8G3J/0nOSnfyGFuqhoa4Zdm to/Ccrpht9VF+05A3YbcL7NTAxiFT5nDhJMzsjzJHQ/L5Lr1U2LGUSvttPCiR10vpieZ GQ== Original-Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tubwdj8a7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 16:48:33 +0000 Original-Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39KGKjiB013866; Fri, 20 Oct 2023 16:48:32 GMT Original-Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tubwfh7hn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 16:48:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i474UMtgwD1jOvLLLP8SW95wJirWWFdlDx0LvlJURoKiGVqhvp19LtQ7HZG+5IIK0R+8jc/QuMWusGN4NRFH1BJHLh2b3A9Zflm0kh6LYbfoJx+RmrNrz9fLnLFnGDWe471VHpeSm8/nsxtUT2uY/+6Z65qwAoDHhOCV8FBUq7GUNKPmrz/+h62pRf/Ct65YZYT/hipw+iC9Z3R2nMOoHJL/NdEL1/qF/81QnfZZVANfj72xOZZ6frcGbSRg8UlMKF93Z6v7+No/lhdqLMpLgBSAw4f53aj58UKR4tvIWUi888FB1Iq2Xa+mjEERXVU3LHDqleDdzSv6wezQvVhpRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ke0nsaln27ZGEpQsf21J0rwFn5lSWi0U1CcNfFjEHAM=; b=T1r09vUN3vIgcvWj/8wH+N9/BKdHBNNY5PsddXZA3TWM+kgWlmQVmec8DcmQEt4LUscDFCO/3+yC/qxBd/Z/e6Fz96M6kOdV2wa3R+cQ7iNCk31HVDsDRwWdlTvqmfkd6Wc5mlCQuJyTZo5lDd5HBKbTEOoQvRUZ+BrXQVFkJXRowa5vU/WDQUFKdGMYKTq3IjfXTqeQalIZwIRtFphZrSLEb5rVDKcWdl73zl4fu9o68YHDKLfyh7JkQRYpcw9wI0rbzYuIcUq7yuDRAJptFhx73JfFIki7maBPVVCk1kVtDPGAI3+UMx3d8HUt+gBQj/j06uGtWhYWLRhINX9Mcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ke0nsaln27ZGEpQsf21J0rwFn5lSWi0U1CcNfFjEHAM=; b=DeMHCUWkEBhXqLIQFQqnmvghPtO6Z5m5vR8huvo7sky/s8EjefF4VNP4OlotKNOOhXu1sGx5nJ6/Ywcje1iwo5ZjZCIEQtO5aTw6RLay1TLwi+UIBpKM4pxBH69fyh7SmTKMAZFmjXZl6H67hDn/I3PPFo/j9lSBXMUsh3rTab0= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by CH3PR10MB6902.namprd10.prod.outlook.com (2603:10b6:610:14e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Fri, 20 Oct 2023 16:48:08 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::adae:506b:e9a0:529f]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::adae:506b:e9a0:529f%6]) with mapi id 15.20.6907.025; Fri, 20 Oct 2023 16:48:08 +0000 Thread-Topic: [External] : Re: bug#64656: 29.0.91; Doc of minibuffer histories and completing-read - automatic addition of completions to DEFAULT list Thread-Index: AQHaAyJwsZvz9bg+LUOIV3PrWo7AMbBS4H7g In-Reply-To: <86jzrhlrub.fsf_-_@mail.linkov.net> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|CH3PR10MB6902:EE_ x-ms-office365-filtering-correlation-id: 50409dfc-eb4e-49bb-107b-08dbd18c568a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tXGnLq7h6tTDVaxyEZtkbqgChOBHoCoeD9KdP6X2hz5/mVPf8mNpFE33k+/gHbHo1bNbPJ3/skGi1EktzI+f0/Js7/tLhPWowhqac9KJmMZ0UVQO7mxcXku/nbpz+RTKDlHlcd/g3zIieg1aozWnohnOhruhj2gDWo0U7eiHceVuT/ayZjkpHMH9OLfFqKq1LhHNr7kfgWK+wTRDV/M/kdD8N/sGGyCdVYZ8pMHxsxFvJxLI2Vnok4r4dEM66tsJYhlRGzGdeG5/hNM3HWTUQfDTM6y/AlaUFQ/znYl5ZUzhFMsvIKbDhQ25JEHwpOZRaSZonrkZBBymMFSObEjASuujmDrVfKwUv7AF9gDHSLmwQRoe46pGx+gtBo+TsLI34p79LSevXqd/IjcNg5f+S7sEW9aaIYC6q7Lzstxv86aMQIAbrlCf1Tciu5AI2wGp43UnjE/Zyc1/5Cy/7DGEnAOPx4JBOGgym9fVqx2piaVlnuugeOb6psQ0V0jdLVKZszp1Wvl464Kyr0VL8jweFX9GIgDn/k6yUBqhou8qt7wFfwDaizX7jlJTezEZ3ywkPJML7/gha2BIG2xhcJR8XDIGHOqn+2oCZAFcjTEFCf82wfW/Zge1VZY6kBEgxie9 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(346002)(376002)(39860400002)(366004)(396003)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(38070700009)(55016003)(6506007)(38100700002)(86362001)(7696005)(52536014)(83380400001)(2906002)(122000001)(26005)(9686003)(5660300002)(4326008)(478600001)(316002)(71200400001)(41300700001)(44832011)(33656002)(66946007)(64756008)(66446008)(54906003)(66556008)(66476007)(76116006)(8676002)(6916009)(8936002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: zE3ZLaHu9n1R0qNfqDMxO0DtwmGy1T/z5EwEE160COAcyU2rRvDJsmwdr1byaa1By+7FXtLvz8+zVLi6LVDTl9V/7TgIebAwYN6Tq6pWRUKDsC0rl18+vPVzN6Qe5qvIApL7Ngs/yQ0DQmLC/U0CTiCNe7AJ1G/y2h0sqrYQyNnllsJoEzBDoyPEchunviuaIZJCDIZd+7R/VoYN5hwppsRL5Oq6V5S8PRLRXWRmyhyo2YqBJiEP4zYVpYmh2U4IHZOGMPtCNPkRyDlhzY6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/vL3ANz/StKUw38YUF1UDX88vvT+tRDCRK4fupo3gKx3tgXVHuuDfWFJTCiumrX2OTMIQeQ9U/9ZPc2rmpJA24/7RBUML46BuSzte7EOIsA04pkRLrFQOB3Fw/qzOJINUr3H//JaYQzp+CO2el8SS7/C9hdiC4tQKvlRt5Ez6C7YhYzEAKTi4VdiUax29oW+BmiUc16FMFuQGezbbZ5qCZkEAL02ZvozffNxNPlchmTQBBJWDySkwJX9vqzrQfU+C9ZL3zlZq+liA6yfzf2IW+8TI5R8M17NXjJYvsf1NpHeAWOiYlHRGHk1WY8730ncthZRJK6moUcO KTSc/sirPoDAwn2MlvEfJM6UWaxC2+Z6lX+Bc2Onh9YY27DKxtKJE/PmA9rqo1jJqfhzAf0ZQLDF8j9zai X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50409dfc-eb4e-49bb-107b-08dbd18c568a X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Oct 2023 16:48:08.0095 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6tbP89mL3lU3Sc0CBs+MPPr4GOFYAl2W+4TG6vjHcPkiNgqKk1GxxCTc2604Yabk4cPp7XUS8RhBYlN0MKaTZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB6902 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200141 X-Proofpoint-ORIG-GUID: O2a_2x9pVBXmttgo926fnEWvrhzwsAN2 X-Proofpoint-GUID: O2a_2x9pVBXmttgo926fnEWvrhzwsAN2 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272805 Archived-At: > >> > Try this: > >> > `C-h v org TAB' > >> > `M-n' > >> > `M-n' > >> > ... > >> > >> Why candidates are inserted in a random order? > >> It would make sense to insert them in the same > >> order as they are sorted in the *Completions* buffer. > > > > That's one reasonable possibility. > > It's not the only one. > So currently there are three different sorting orders > used by default: > 1. 'TAB' uses the alphabetical order; > 1. 'M-p' uses the historical order; > 2. 'M-n' is unsorted and follows the order of the caller. No, `M-n' is just like `M-p' for previous inputs. And for DEFAULTS it's in the order of DEFAULTS - which has nothing to do with the set of initial completion candidates or their order. The misfeature that introduced all of the problems you're considering now was to stuff all of the _completion_ candidates (the completion domain) into the `M-n' (and thus `M-p') queue. That was a huge mistake, IMHO. > > The fact is that the candidates are in > > a useless order, particularly when the > > completion table is just obarray or an > > unsorted, filtered subset of obarray. >=20 > This means that the caller should take care about > sorting completions is a meaningful order. > But then a new metadata type similar to > 'display-sort-function' should be added > such as 'minibuffer-default-sort-function' > that might be a hassle. No, just revert the misfeature of adding the completion domain to the `M-n' queue. End of story - no problem. > (defun minibuffer-default-add-completions () > "Return a list of all completions without the default value. > This function is used to add all elements of the completion table to > the end of the list of defaults just after the default value." Just get rid of that function altogether. Pull this misfeature out of Emacs; it never should have been added (and IIRC that was done without any discussion?). > > Why are all candidates inserted into the > > `M-n' queue at all? And why no ability > > to filter them or sort them - during > > completion (i.e., taking the current > > completion state into account). >=20 > Because 'M-n' is not completion. Precisely! Minibuffer input, and its history and its defaults, is not related to the COLLECTION used for completing. Lax completion doesn't even require that your minibuffer input be any COLLECTION element. Completion candidates have no business being automatically injected into the `M-n'/`M-p' queue. That's for DEFAULTS and HISTORY. Arg DEFAULTS has a raison d'etre; it's not the same as arg COLLECTION. You're going farther down that dead-end rabbit hole now. Back out and plug that misdirected hole.