unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Visuwesh <visuweshm@gmail.com>
Cc: 64584@debbugs.gnu.org
Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions
Date: Mon, 11 Sep 2023 23:06:02 -0400	[thread overview]
Message-ID: <jwva5ts5c5l.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87bke8kthy.fsf@gmail.com> (Visuwesh's message of "Tue, 12 Sep 2023 08:06:25 +0530")

> I can do
>
>     (define-skeleton test
>       ""
>       (read-file-name "p: ")
>       (shell-quote-argument (eval str)))

Eww... please don't!  This relies on an internal detail about how `str`
is implemented.

>>> AFAIU, using 'str should prevent the insertion of the value but that
>>> signals the same error.
>> Sorry, I don't know what you mean by that.
> I meant this part in skeleton-insert's docstring
>
>     Quoted Lisp expressions are evaluated for their side-effects.

Ah, I see.  Yes, using

    'str

should basically have no effect.

>>> I tried (progn str (shell-quote-argument str))
>>> instead but the same error again.
>> Of course: any use `str` within an actual expression (as opposed to
>> using it as a skeleton element) will work reliably only if that occurs
>> after a use of `str` as a skeleton element.
> Thanks for your patience and help.

We should try and improve the docs to clarify this confusing situation.
If you have suggestions for how/where we could make changes that would
have effectively discouraged you from trying to use `str` in that way,
I'd be happy to hear them.


        Stefan






  reply	other threads:[~2023-09-12  3:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 17:05 bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions Visuwesh
2023-09-11 13:52 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-11 15:20   ` Visuwesh
2023-09-11 22:12     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-12  2:36       ` Visuwesh
2023-09-12  3:06         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-09-12 12:24           ` Visuwesh
2023-09-12 13:08             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-12 14:50               ` Visuwesh

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=jwva5ts5c5l.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=64584@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=visuweshm@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).