unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tadeus Prastowo <tadeus.prastowo@unitn.it>
To: emacs-devel <emacs-devel@gnu.org>
Cc: John Wiegley <johnw@gnu.org>
Subject: Re: [pcomplete.el (pcomplete-completions-at-point)] Why max?
Date: Tue, 19 Mar 2019 10:55:14 +0100	[thread overview]
Message-ID: <CAN-HRFY-nU30AUeXN8J2w6f6f+Xx3pr2YmUWyzacL9_-VS1Z7A@mail.gmail.com> (raw)
In-Reply-To: <CAN-HRFYUgcpWMiB1NR-CBBhVS9F5+OOh_qdRnmjP9E5VFLFudA@mail.gmail.com>

Hi everyone,

Does John still maintain the pcomplete package?

--
Best regards,
Tadeus

On Sat, Mar 16, 2019 at 11:29 PM Tadeus Prastowo
<tadeus.prastowo@unitn.it> wrote:
>
> Hi John,
>
> I am using Emacs at commit 4633b0e and see a problem that can be
> solved ad-hoc by using `min' instead of `max' in the following code
> within function `pcomplete-completions-at-point' in file
> `lisp/pcomplete.el':
>
>            (beg (max (- (point) (length pcomplete-stub))
>                      (pcomplete-begin)))
>
> What do you think will break if `min' is used instead of `max' to
> repair the following problem seen using `emacs -Q' at the said commit?
>
> M-x shell
> cd /tmp
> mkdir AAAA\ BB\ CCCC
> cd AAAA\ BB<tab>
>
> Autocomplete fails because (pcomplete-begin) returns the position of
> the first letter A but (length pcomplete-stub) is the length of "AAAA
> BB", which gives the position of the second letter A.  The function
> `max', therefore, sets `beg' to the start of the second letter A.
> Consequently, file-name-completion will be asked to complete "AAA BB"
> instead of the correct one "AAAA BB".
>
> Thank you.
>
> --
> Best regards,
> Tadeus



  reply	other threads:[~2019-03-19  9:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-16 22:29 [pcomplete.el (pcomplete-completions-at-point)] Why max? Tadeus Prastowo
2019-03-19  9:55 ` Tadeus Prastowo [this message]
2019-03-19 16:37   ` Stefan Monnier
2019-03-19 16:40     ` Tadeus Prastowo
2019-03-20  2:09 ` Stefan Monnier
2019-03-20 11:00   ` Tadeus Prastowo
2019-03-20 14:00     ` Stefan Monnier
2019-03-20 16:14       ` Tadeus Prastowo
2019-03-20 17:11         ` Stefan Monnier
2019-03-20 17:17           ` Tadeus Prastowo
2019-03-20 23:38           ` John Wiegley

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=CAN-HRFY-nU30AUeXN8J2w6f6f+Xx3pr2YmUWyzacL9_-VS1Z7A@mail.gmail.com \
    --to=tadeus.prastowo@unitn.it \
    --cc=emacs-devel@gnu.org \
    --cc=johnw@gnu.org \
    /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).