GNU bug report logs - #64584
29.0.91; skeleton: cannot pass `str' as argument to some functions

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Wed, 12 Jul 2023 17:07:01 UTC

Severity: normal

Found in version 29.0.91

Done: Visuwesh <visuweshm <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 64584 <at> debbugs.gnu.org
Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions
Date: Mon, 11 Sep 2023 18:12:28 -0400
>> 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.  :-(

Of course, it changes the behavior of your skeleton.
I assumed that your *real* skeleton does something else anyway, so
I showed what kind of change might help.

To do what your above skeleton does, you simply can't use `str`.
You need something like:

    (define-skeleton test-skeleton ""
      nil
      (shell-quote-argument (file-relative-name (read-file-name "P: "))))

instead.

> 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 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.


        Stefan





This bug report was last modified 1 year and 344 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.