From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions Date: Tue, 12 Sep 2023 17:54:12 +0530 Message-ID: <87y1hbk2ab.fsf@gmail.com> References: <87y1jloyao.fsf@gmail.com> <87fs3klos4.fsf@gmail.com> <87bke8kthy.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28871"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 64584@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 12 14:25: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 1qg2S6-0007Mk-SE for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Sep 2023 14:25:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qg2Rw-0002bI-JO; Tue, 12 Sep 2023 08:25:00 -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 1qg2Ru-0002aR-JQ for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 08:24: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 1qg2Ru-0001VT-Bw for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 08:24:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qg2Ry-000384-Kx for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 08:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Sep 2023 12:25:02 +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.169452147611919 (code B ref 64584); Tue, 12 Sep 2023 12:25:02 +0000 Original-Received: (at 64584) by debbugs.gnu.org; 12 Sep 2023 12:24:36 +0000 Original-Received: from localhost ([127.0.0.1]:56404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg2RX-000366-Jp for submit@debbugs.gnu.org; Tue, 12 Sep 2023 08:24:35 -0400 Original-Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:44245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg2RT-00035M-0D for 64584@debbugs.gnu.org; Tue, 12 Sep 2023 08:24:33 -0400 Original-Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-68fb5bd8f02so2078115b3a.0 for <64584@debbugs.gnu.org>; Tue, 12 Sep 2023 05:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694521460; x=1695126260; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ntcR79jS3DTFoZ8phZI7gOB+TqLVGaDf+LoSYjcN+a0=; b=RUs9OlHU1T3QOUNTrHY+8wG2di6h5l0cvtvERmR6rhPfWniwyDRJRBxbjJZOrynHtR nZqNx4/wftgO7m8qIOMZ0ZGNRTnRNLchamjcDDEO4Z1jrRZ/tccIvAsvLqNeJ/hBTi0L ktFovCxiaWeP2GSfO+h/m1F5JlOrm6NM7gNbiB0PcHwF7R/75+Lja1whQ5n3bpkOcGq6 LuCbbpU4nXsu4US80ZLv3bc4BfzQUKwGQfhN1k4PknbRRR0pppLJErPqeJBHHwRQ9mub I5Pggw8ur2sxQmUcFUshux8KEApZr8uYxVCXAeXXBcxY2HoVak+0yh32LpaldQqcQ7Hz zk7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694521460; x=1695126260; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ntcR79jS3DTFoZ8phZI7gOB+TqLVGaDf+LoSYjcN+a0=; b=b5n/pGOtuek7Ew7nCZlMPKfX+P70WFBVn/X0/J42gW8UK60S9ioUchQfOl43ImXcf3 wbMnEQB5dgbjMCOzLi5+qveISnxVccjBnwfLPaUVeRGiBX2v7TEPAIiNBnBFHc6NQd+t ETXolULhDc/1WozepeidcKHMLlT/QCGw7E801owsfYRA0otVDig3yEx95B/vP2RVViZJ 6CjzLTZ/alkafU+/JTh/sY+s57/I2wV9M0Bnt2i+iFdxXEN7XAjbclEsKL03Jp9qKgoG WOqQ3+IYqqTbcQ/ob0UV/vv63W24/M17jO7P7i5d5+nxSKimsVhYzundePW4iZnVqmqL NeYQ== X-Gm-Message-State: AOJu0YxcY/dVH+eLDbGU8TCPQVRBip1vWQeBczzm9ciCavrE/+UXmtcI UgLfNMR0dJjWfH20MNJWURI= X-Google-Smtp-Source: AGHT+IF0W409LXcJNCDj87WpuY2RzpsIi1Z7luUSvcvzXTElnaaWAoDINXQFGr6yKXTtIAyWr4d8gQ== X-Received: by 2002:a05:6a00:24c6:b0:68a:553a:c0da with SMTP id d6-20020a056a0024c600b0068a553ac0damr11871617pfv.24.1694521460333; Tue, 12 Sep 2023 05:24:20 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id bq25-20020a056a000e1900b006889511ab14sm1365530pfb.37.2023.09.12.05.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 05:24:19 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 11 Sep 2023 23:06:02 -0400") 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:270159 Archived-At: [=E0=AE=A4=E0=AE=BF=E0=AE=99=E0=AF=8D=E0=AE=95=E0=AE=B3=E0=AF=8D =E0=AE=9A= =E0=AF=86=E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0= =AF=8D 11, 2023] Stefan Monnier wrote: >>>> 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. Yes, but here it basically does nothing unfortunately. I am not sure if 'str should have the side effect of setting that variable. >>>> 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. Unfortunately, I don't really remember what motivated me to end up with such a skeleton. I usually have the problems I face written as a comment but this time I didn't. Looking at the skeletons I have, ISTM that I want the skeleton to "end" whenever I give the empty string as the value for `str'. In fact, I have a macro defined (defmacro vz/snippet-when (form &rest body) "Evaluate BODY if FORM returns non-nil or non-empty string." (declare (indent 1) (debug (form body))) `(let ((str ,form)) (if (and str (equal str "")) "" ,@body))) and have skeleton bodies such as (define-skeleton imagemagick-collage-images "Collage/montage multiple images using imagemagick." nil "montage " ((vz/snippet-when (vz/snippet-read-relative-filename "Image: ") (shell-quote-argument str)) str " ") "-geometry +0+0 " "-tile " (skeleton-read "How many columns (horizontal)? ") "x" (skeleton-read "How many rows (vertical)? ") (shell-quote-argument (vz/snippet-read-relative-filename "Out: "))) using it.