From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#41412: bug#41424: 26.1; default-directory in *Completions* buffer Date: Mon, 09 May 2022 13:00:13 +0200 Message-ID: <87y1zb7yyq.fsf_-_@gnus.org> References: <87pnay7azg.fsf@penguin> <87k0s4wwbl.fsf@gnus.org> <87a6szv6c0.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40347"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Omar =?UTF-8?Q?Antol=C3=ADn?= Camarena , 41424@debbugs.gnu.org, 41412@debbugs.gnu.org, Stefan Kangas To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 09 13:18:09 2022 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 1no1Oz-000AIj-Jm for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 13:18:09 +0200 Original-Received: from localhost ([::1]:52872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no1Ov-0008Bq-S4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 07:18:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no18m-0007H4-3q for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 07:01:25 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34227) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1no18Q-0007NL-6q for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 07:01:23 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1no18Q-0007nF-5X for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 07:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 May 2022 11:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41412 X-GNU-PR-Package: emacs Original-Received: via spool by 41412-submit@debbugs.gnu.org id=B41412.165209402929880 (code B ref 41412); Mon, 09 May 2022 11:01:02 +0000 Original-Received: (at 41412) by debbugs.gnu.org; 9 May 2022 11:00:29 +0000 Original-Received: from localhost ([127.0.0.1]:56351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no17t-0007lr-7Z for submit@debbugs.gnu.org; Mon, 09 May 2022 07:00:29 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:40776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no17q-0007lN-UN; Mon, 09 May 2022 07:00:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CUuBrwpv+IjSwQWt94tjRs4VjLxFCGDEWoQYZ6xNh1c=; b=ZuB5G1nHTYQ507irr41xV1RL/m BJONnsCldD+eT6uDOw8GrJ5y093zqey1trl96Y8RwJMGIRmQltNwTB1a4W1oemOVgu+FMKs9gS4pm 7Frhec7VNwviFbiSdHl6BQMDRk+Z/gXEpp70Un8/B+b5prmrf7kne44elY+jvBUOkeqY=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1no17f-0004w0-Ql; Mon, 09 May 2022 13:00:18 +0200 X-Now-Playing: Grace Jones's _Living My Life_: "The Apple Stretching" In-Reply-To: (Stefan Monnier's message of "Sat, 23 Jan 2021 17:00:00 -0500") 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" Xref: news.gmane.io gmane.emacs.bugs:231720 Archived-At: Stefan Monnier writes: > I think the correct thing to do is to look at the `(cdr (last completions))` > where `completions` is what `completion-all-completions` returned. > That gives what used to be called `completion-base-size`. The call sequence here seems to be somewhat convoluted, so I'm not sure how to get at that. But wouldn't just doing the following simple patch fix the issue without regressing anything? diff --git a/lisp/simple.el b/lisp/simple.el index 861d9eefde..65b2a482e2 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9495,9 +9495,11 @@ completion-setup-function ;; - With fancy completion styles, the code below will not always ;; find the right base directory. (if minibuffer-completing-file-name - (file-name-as-directory - (expand-file-name - (buffer-substring (minibuffer-prompt-end) (point))))))) + (let ((file (expand-file-name + (buffer-substring (minibuffer-prompt-end) (point))))) + (if (file-directory-p file) + (file-name-as-directory file) + (file-name-directory file)))))) (with-current-buffer standard-output (let ((base-position completion-base-position) (base-affixes completion-base-affixes) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no