unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Omar Antolín Camarena" <omar@matem.unam.mx>,
	41424@debbugs.gnu.org, 41412@debbugs.gnu.org,
	"Stefan Kangas" <stefankangas@gmail.com>
Subject: bug#41424: bug#41412: 27.0.90; Value of default directory in completions buffer
Date: Sat, 23 Jan 2021 19:47:11 +0100	[thread overview]
Message-ID: <87a6szv6c0.fsf@gnus.org> (raw)
In-Reply-To: <jwvr1mcsied.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 22 Jan 2021 17:50:18 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I think that sounds likely.  The patch that introduced this code is
>> below, and it indeed changes the `file-name-directory' to
>> `file-name-as-directory' (among other things).
>
> But it also changed a fair bit around it.  And the `substring` is quite different.
> When I look at the history of this code,
> 30c7e54299fc81cd3122a17ef130ab69e9855f99 looks wrong.  In order not to
> change the behavior, I suspect it should have been:
>
>     (buffer-substring (minibuffer-prompt-end)
>                       (+ (minibuffer-prompt-end) (or completion-base-size 0))))))))
>
> and then 326fdb9ec05ab5e4aec0c7064272bb3d223e9875 looks wrong again
> since it presumes that `completion-base-size` is nil whereas it usually
> isn't/wasn't when completing files.

Aha.  But then what would the correct fix now?  I haven't tried the
proposed change (i.e., just change to `file-name-directory'), but it
sounds logical to me.  That is, if the user has typed "~/foo/bar/zo"
then use "~/foo/bar" as the default directory.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2021-01-23 18:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 17:49 bug#41424: 26.1; default-directory in *Completions* buffer Omar Antolín Camarena
2021-01-22 20:28 ` bug#41424: bug#41412: 27.0.90; Value of default directory in completions buffer Lars Ingebrigtsen
2021-01-22 22:50   ` Stefan Monnier
2021-01-23 18:47     ` Lars Ingebrigtsen [this message]
2021-01-23 22:00       ` bug#41424: " Stefan Monnier
2022-05-09 11:00         ` bug#41412: bug#41424: 26.1; default-directory in *Completions* buffer Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6szv6c0.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=41412@debbugs.gnu.org \
    --cc=41424@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=omar@matem.unam.mx \
    --cc=stefankangas@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).