all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Daniel Mendler <mail@daniel-mendler.de>,
	Eli Zaretskii <eliz@gnu.org>,
	60464@debbugs.gnu.org, Jim Porter <jporterbugs@gmail.com>
Subject: bug#60464: 29.0.60; Regression - pcomplete-arg fails with argument 'last
Date: Sun, 01 Jan 2023 19:13:18 +0000	[thread overview]
Message-ID: <226b32f79f028016490a@heytings.org> (raw)
In-Reply-To: <jwv358um7ei.fsf-monnier+emacs@gnu.org>


>>                    (_      (- pcomplete-index (or index 0))))
>>                  (or offset 0))
>>                pcomplete-args)))
>> -    (if (stringp arg)
>> +    (if (or (stringp arg)
>> +            (eq index 'last))
>>          arg
>>        (propertize
>> -       (buffer-substring (pcomplete-begin index offset)
>> -                         (pcomplete-begin (1- (or index 0)) offset))
>> +       (car (split-string (pcomplete-actual-arg index offset)))
>>         'pcomplete-arg-value arg))))
>
> I'm not sure what specific problem this is trying to solve (is it the 
> choice of the "index" or is it the precise buffer positions of the 
> bounds)?
>

I admit I don't understand your question.  It tries to use 
pcomplete-actual-arg, which uses buffer-substring, to get the text 
representation of the argument.  It's not guaranteed to work in all cases, 
though, because it simply assumes that arguments are separated by spaces. 
But it should be "good enough".

The (eq index 'last) means that when index is 'last we return the 
argument, even when it is not a string (or more precisely: when it is a 
list of strings, and the code assumes that a non-string arg is a list of 
string), because that's in fact what the caller expects (or at least 
that's what Eshell expects) in that case: that list is displayed in 
*Completions*.






  parent reply	other threads:[~2023-01-01 19:13 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-01 10:47 bug#60464: 29.0.60; Regression - pcomplete-arg fails with argument 'last Daniel Mendler
2023-01-01 11:16 ` Gregory Heytings
2023-01-01 11:21   ` Daniel Mendler
2023-01-01 11:35     ` Gregory Heytings
2023-01-01 11:53       ` Daniel Mendler
2023-01-01 12:04         ` Gregory Heytings
2023-01-01 16:59           ` Gregory Heytings
2023-01-01 17:18             ` Daniel Mendler
2023-01-01 17:28               ` Gregory Heytings
2023-01-01 17:34                 ` Daniel Mendler
2023-01-01 17:45                   ` Gregory Heytings
2023-01-01 18:02                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-01 18:26                     ` Daniel Mendler
2023-01-01 17:47             ` Eli Zaretskii
2023-01-01 18:29               ` Gregory Heytings
2023-01-01 20:01                 ` Eli Zaretskii
2023-01-01 17:57             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-01 18:19               ` Gregory Heytings
2023-01-01 18:38                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-01 18:42                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-01 19:13                   ` Gregory Heytings [this message]
2023-01-04  5:51             ` Jim Porter
2023-01-04 13:48               ` Gregory Heytings
2023-01-04 14:25                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-04 14:35                   ` Daniel Mendler
2023-01-04 14:46                     ` Gregory Heytings
2023-01-04 15:14                       ` Daniel Mendler
2023-01-04 15:18                         ` Eli Zaretskii
2023-01-04 15:22                           ` Daniel Mendler
2023-01-04 15:39                         ` Gregory Heytings
2023-01-04 15:48                           ` Daniel Mendler
2023-01-04 15:56                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-04 16:08                             ` Gregory Heytings
2023-01-14 21:27                               ` Gregory Heytings
2023-01-04 18:49                             ` Jim Porter
2023-01-04 18:41                       ` Jim Porter
2023-01-04 14:36                   ` Gregory Heytings
2023-01-04 15:19                     ` Daniel Mendler
2023-01-04 14:50                 ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=226b32f79f028016490a@heytings.org \
    --to=gregory@heytings.org \
    --cc=60464@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jporterbugs@gmail.com \
    --cc=mail@daniel-mendler.de \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.