From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions Date: Mon, 11 Sep 2023 18:12:28 -0400 Message-ID: References: <87y1jloyao.fsf@gmail.com> <87fs3klos4.fsf@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21655"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 64584@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 12 00:14:11 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qfpAY-0005Su-A3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Sep 2023 00:14:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfpAN-0002uU-Gj; Mon, 11 Sep 2023 18:13:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfpAM-0002uH-2r for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 18:13:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfpAL-0000Jt-Rq for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 18:13:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qfpAP-0001C9-Pp for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 18:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Sep 2023 22:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64584 X-GNU-PR-Package: emacs Original-Received: via spool by 64584-submit@debbugs.gnu.org id=B64584.16944704294568 (code B ref 64584); Mon, 11 Sep 2023 22:14:01 +0000 Original-Received: (at 64584) by debbugs.gnu.org; 11 Sep 2023 22:13:49 +0000 Original-Received: from localhost ([127.0.0.1]:55047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfpAD-0001Bc-4b for submit@debbugs.gnu.org; Mon, 11 Sep 2023 18:13:49 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:14093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfpAB-0001BO-1i for 64584@debbugs.gnu.org; Mon, 11 Sep 2023 18:13:47 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id CA8138071E; Mon, 11 Sep 2023 18:13:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694470415; bh=bDYie0zgBOsj9+pLOaIPWV/AzdJHnUUBZICKh450vc4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pNeHp+jb+5XKO+lT9PdylH0mzPVWLTRNMs8cSqZf/WLQRTa3qEGCibcpCpdPfGDyT qtTxt82Eq1kjXmoxNcEm9Yc8vtiExVRq8lMs6YyxyBMZNed+uMascGnXktwY+AVKPT zs8UalE+3DaRZ1LH2lHsio5jTwTXuVaWofe5MmZ2ACBoBqRK6a8LzGdVh1ibI7HMCT oISJLlBLjwigCbAwUfl/TmK3xF2Q/CKQixcxehaHPjvgODbR36GT9wVCXFCS3QPAGm /CIDyEyRTORrRaniWuxwIUq5UleopzTrV0LL8tijETAW4MGMKIKZwinZ3nB9pGNWsH fwx81/YddU9kA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9010E803E0; Mon, 11 Sep 2023 18:13:35 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7F39B12030B; Mon, 11 Sep 2023 18:13:35 -0400 (EDT) In-Reply-To: <87fs3klos4.fsf@gmail.com> (Visuwesh's message of "Mon, 11 Sep 2023 20:50:43 +0530") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270092 Archived-At: >> 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