unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Visuwesh <visuweshm@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
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 20:50:43 +0530	[thread overview]
Message-ID: <87fs3klos4.fsf@gmail.com> (raw)
In-Reply-To: <jwvledc6ct7.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 11 Sep 2023 09:52:00 -0400")

[ Sorry about mangling the bug address, and thanks for fixing it, and
  replying.  ]

[திங்கள் செப்டம்பர் 11, 2023] Stefan Monnier wrote:

>> In a skeleton template, it is not possible to pass `str' as an argument
>> to some functions.
>
> It is, but only after it appeared "naked" in the skeleton.
>
> `skeleton-insert` says:
>
> 	str	first time: read a string according to INTERACTOR
> 		then: insert previously read string once more
>
> which indeed doesn't explicitly tell you tht you're doing something
> wrong, but it does imply that `str` doesn't just hold a string, or at
> least not initially.

Thanks, that explains the confusing part of the docstring.  However,
there's still a problem as...

>>     (define-skeleton test-skeleton ""
>>       (file-relative-name (read-file-name "P: "))
>>       (shell-quote-argument str))
>
> It should work if you can change your skeleton to something like:
>
>     (define-skeleton test-skeleton ""
>       (file-relative-name (read-file-name "P: "))
>       str
>       (shell-quote-argument str))
>
> where that first use of `str` will convert it from something that "read
> a string according to INTERACTOR" to the actual string.

... this inserts the directory twice.  :-(
AFAIU, using 'str should prevent the insertion of the value but that
signals the same error.  I tried (progn str (shell-quote-argument str))
instead but the same error again.

>
>         Stefan





  reply	other threads:[~2023-09-11 15:20 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 [this message]
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
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=87fs3klos4.fsf@gmail.com \
    --to=visuweshm@gmail.com \
    --cc=64584@debbugs.gnu.org \
    --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 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).