From unknown Sat Sep 20 03:14:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Jul 2023 17:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64584 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 64584@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168918157120264 (code B ref -1); Wed, 12 Jul 2023 17:07:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jul 2023 17:06:11 +0000 Received: from localhost ([127.0.0.1]:52864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJdI2-0005Gl-S9 for submit@debbugs.gnu.org; Wed, 12 Jul 2023 13:06:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:53620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJdI1-0005Ge-7s for submit@debbugs.gnu.org; Wed, 12 Jul 2023 13:06:09 -0400 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 1qJdHz-0001sP-35 for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2023 13:06:07 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJdHt-0007Mk-Mb for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2023 13:06:05 -0400 Received: by mail-pl1-x641.google.com with SMTP id d9443c01a7336-1b8baa836a5so53263995ad.1 for ; Wed, 12 Jul 2023 10:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689181558; x=1691773558; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=jzkZNsgyE56i1IPgXez+YbDkaW09uC5nYbu3+0i/poU=; b=LHGKgIe444gBJFkXOd7Qzti7M8kqo64uru+a7lBvy5/G4++VC0ex/DN+5lTHoE0eEF mrPVlYmminOT7lc5ljO/zbHXwa1lYnj2p0Y9TQMJyWwYLxcFuHU891UUSxD6W0JAFP5u /RLbfuCmK1Xgo6c+eicsxlpDVQxRdaHprNXT15fcZ+tZ7Mz6G73r/+8HO6hA7twOdQan qAs1PMl3ocOSmjAjMK2rgm6e5TzgzP275vHLzNd8iY4HkWlhMNv8Irl0aXzwp6fUkwTR uPrkHVsbbrqIYOLMmca8SWTr+JfPdvEwKJ2MZ2fDWkUyjKlxW6T1oc3vRzdnm3620tFh YFqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689181558; x=1691773558; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jzkZNsgyE56i1IPgXez+YbDkaW09uC5nYbu3+0i/poU=; b=YVbzzdbFQqssEDEDkyU6ZPtemB/9xrf+5nGjOnj+Cqbozv2uSqlv3gj2AZNENhdYPl hklMBBpZoMA/LePKyNGNIFzsEKeGV7XxMcQY+w0b075j6NJCore45+31b/kIpWXKNXF8 6KtJ/CNHzjuoxczx3Kv5EIHj/WTwYFlHnfqOD4Jw2Cl9ZB3Q45ri9TYTotM+O683eLRv 6mGIaH8Zz+YBlEu12HrSwHfjDuCXZYjhLhw6gczEcj+VubVJ/IoEeZr9gwiQe9EDqo7Y 7kl3/CzDh+ogfGzcomQfPaDyqcr3bTFKP6Kdl9qhf4Omf5wl6LTqDI6FdR6dtQSoBvaX UhRQ== X-Gm-Message-State: ABy/qLYC5RbhpprK0V60oXW835dxj7od2Hhrc6wxbFYGcmqRgMCG29IT 0ODtum+pElNXNszU8Shgc85zcXWd2B6Kzw== X-Google-Smtp-Source: APBJJlGrqRb+KNcfBWuMGljyj2VbMYGCg5QGDGBYATGa7QM73CwmIDhW2+Ok1G1nkMsnzUttw4knlg== X-Received: by 2002:a17:902:f7d2:b0:1b6:9fec:8134 with SMTP id h18-20020a170902f7d200b001b69fec8134mr17066562plw.46.1689181557775; Wed, 12 Jul 2023 10:05:57 -0700 (PDT) Received: from localhost ([49.205.82.241]) by smtp.gmail.com with ESMTPSA id ik25-20020a170902ab1900b001b54a88e4a6sm4305602plb.51.2023.07.12.10.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 10:05:57 -0700 (PDT) From: Visuwesh Date: Wed, 12 Jul 2023 22:35:35 +0530 Message-ID: <87y1jloyao.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::641; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x641.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) In a skeleton template, it is not possible to pass `str' as an argument to some functions. To reproduce: 1. emacs -Q 2. Evaluate the following skeletons: (define-skeleton test-skeleton "" (file-relative-name (read-file-name "P: ")) (shell-quote-argument str)) (define-skeleton test-skeleton-2 "" (file-relative-name (read-file-name "P: ")) (identity str)) 3. M-x test-skeleton RET RET -- witness it signal an error 4. M-x test-skeleton-2 RET RET -- witness it insert "./" I was able to reduce the problem down to the follwing sexp by edebbuging skeleton-internal-1 (specifically the last `t' case in the cond signals the error): (dlet ((str `(setq str "test")) (e `(shell-quote-argument str))) (eval e)) In GNU Emacs 29.0.91 (build 11, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2023-07-12 built on astatine Repository revision: 17c7915ab947ebeec6ea5ad3eb4cad1f24d5d4fc Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12101007 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure --with-sound=alsa --with-x-toolkit=lucid --with-json --without-xaw3d --without-gconf --without-libsystemd --without-cairo' Configured features: ACL DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XFT XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LC_MONETARY: ta_IN.UTF-8 value of $LC_NUMERIC: ta_IN.UTF-8 value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort help-mode emacsbug mail-extr message sendmail mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader cl-loaddefs cl-lib skeleton rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 41879 11878) (symbols 48 5521 1) (strings 32 14721 2050) (string-bytes 1 393181) (vectors 16 10382) (vector-slots 8 158438 14259) (floats 8 44 14) (intervals 56 314 11) (buffers 976 13)) From unknown Sat Sep 20 03:14:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Sep 2023 13:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64584 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Visuwesh Cc: 64584@debbugs.gnu.org Received: via spool by 64584-submit@debbugs.gnu.org id=B64584.169444033820613 (code B ref 64584); Mon, 11 Sep 2023 13:53:02 +0000 Received: (at 64584) by debbugs.gnu.org; 11 Sep 2023 13:52:18 +0000 Received: from localhost ([127.0.0.1]:52398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfhKr-0005MP-QN for submit@debbugs.gnu.org; Mon, 11 Sep 2023 09:52:18 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfhKo-0005M5-DJ for 64584@debbugs.gnu.org; Mon, 11 Sep 2023 09:52:16 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9EC604419C6; Mon, 11 Sep 2023 09:52:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694440322; bh=Rsy47dFMKwaFTBlOSgNEEjsZj6mbKf3+TaQGauKhCfk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=IfdlUVoMBnkUHSdrClXbrtZ1ZzEEnmgnkhdZrAZaiX1do771CCov/5MooBVTeJDuw WOrhVlSNdaOwzzVHtYXpvqh3Ba93hL0rYvh7vMSoy6j0DXhF/D1fZwlH1tZ1a4z8xA 380+vr0WkRzq2BZL1ne4ugxj/v5oc1MB4uQJ+hlTIoHwpfalC3GHHVP7yy/AvZCeBC AIaXW/KCX37fVGQfBjWTWi1AqHcyNNV6V1Z6Q6E6ckzeun1S2/sZMOzbFinmpEEH6E Ki16C98zxNTsu4p2ujeVwbuC3nGFizAkFSOK3L+Byy80z12VcJ3H6M4bDvkGRMA6dI I5OoXpHYsrmMQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3E2F24419E6; Mon, 11 Sep 2023 09:52:02 -0400 (EDT) Received: from pastel (unknown [104.247.229.91]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1ED561204A2; Mon, 11 Sep 2023 09:52:02 -0400 (EDT) From: Stefan Monnier In-Reply-To: <87y1jloyao.fsf@gmail.com> (Visuwesh's message of "Wed, 12 Jul 2023 22:35:35 +0530") Message-ID: References: <87y1jloyao.fsf@gmail.com> Date: Mon, 11 Sep 2023 09:52:00 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.022 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. > (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. Stefan From unknown Sat Sep 20 03:14:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Sep 2023 15:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64584 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 64584@debbugs.gnu.org Received: via spool by 64584-submit@debbugs.gnu.org id=B64584.169444565931605 (code B ref 64584); Mon, 11 Sep 2023 15:21:01 +0000 Received: (at 64584) by debbugs.gnu.org; 11 Sep 2023 15:20:59 +0000 Received: from localhost ([127.0.0.1]:54429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfiih-0008Dh-GG for submit@debbugs.gnu.org; Mon, 11 Sep 2023 11:20:59 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:44053) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfiif-0008DV-Vf for 64584@debbugs.gnu.org; Mon, 11 Sep 2023 11:20:58 -0400 Received: by mail-pl1-x644.google.com with SMTP id d9443c01a7336-1c3bd829b86so7040245ad.0 for <64584@debbugs.gnu.org>; Mon, 11 Sep 2023 08:20:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694445648; x=1695050448; 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=JIm9mbskoHRIujoukcvrHB46+LSW1iEMJ0nO9uqojyg=; b=OPo01VJ4CJxe/UCmtkB5uuMa1jDgVvC0DSjXPmMWFpoiesDsoeCtNZDnpqBWegcfP6 hd8lVbUi/akZCB4bQR8AV0jPeBMGnUn373mQQQs9aH1uMl+OOC9pdyiDfxfNGAHfE41S ytq3AB1dsCyIxHp1guRwcf6dLR5XFis8ek+x0xuaqfwZ8t+56+GWmA8wgWANdRqpe7Dy Wa6gpj/k9BmgXssNd9MSSuVU6KCIm6zMbFw4sIYyOJhwi98mLCL5DqAlnEKdEMlRmyMB UoO9uiU+TuJUaiNgQYHikLhKlbKOWeA2hWyfwANePd5BjxbgYt0wAPjqUhGqM7otpH3s KRlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694445648; x=1695050448; 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=JIm9mbskoHRIujoukcvrHB46+LSW1iEMJ0nO9uqojyg=; b=h5iExp1w4iwgyFhJQT3UhwB0bPx5saGnocd4Zffw1gkpkmu9VwZXmToxTve+gBNNCt rhZsc+qyqvOJdKpMXQKmkI8hO6XWJBD0enGgbNrXwmlff+VQPa5CsoVnXKjEPdCaGCD5 i/wSZNxYBP9dN3ahlcQez66Pn2W3IifVLEkqi56HzNmWCvxgIogPtyIDIdtla6YAsWnF WY2ToN9um7D9e/dKTMU6ElBgUT+T0AjtWdySCQNbtmYMWCDH93gf4LyU9RnL2rFfpoyQ YJUpe4pGIVzDguHYH430ow3M3qufUcLajaBtvstYF+rwcB8uGXn9qT7wdT0beiZYyJyK TUGA== X-Gm-Message-State: AOJu0YySMllcRdvSO9VZFVmIHbsCSalMCdBuINXh5jMKe4fnU3FerPYU ROwDl3sa6HpgxIB1WwrfJ/0= X-Google-Smtp-Source: AGHT+IEzdXls/sozocL6WAQ8kLJtoDmrbb7rQxmrCqpCXbulpwvOTqR8hqpG+NowVgVRJ7YOvlXrUg== X-Received: by 2002:a17:902:f7c9:b0:1c0:e87e:52ab with SMTP id h9-20020a170902f7c900b001c0e87e52abmr7590735plw.35.1694445646778; Mon, 11 Sep 2023 08:20:46 -0700 (PDT) Received: from localhost ([118.185.152.162]) by smtp.gmail.com with ESMTPSA id b15-20020a170902d50f00b001b8a85489a3sm6562996plg.262.2023.09.11.08.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 08:20:46 -0700 (PDT) From: Visuwesh In-Reply-To: (Stefan Monnier's message of "Mon, 11 Sep 2023 09:52:00 -0400") References: <87y1jloyao.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Mon, 11 Sep 2023 20:50:43 +0530 Message-ID: <87fs3klos4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [ Sorry about mangling the bug address, and thanks for fixing it, and replying. ] [=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: >> 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 From unknown Sat Sep 20 03:14:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions 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 X-GNU-PR-Keywords: To: Visuwesh Cc: 64584@debbugs.gnu.org Received: via spool by 64584-submit@debbugs.gnu.org id=B64584.16944704294568 (code B ref 64584); Mon, 11 Sep 2023 22:14:01 +0000 Received: (at 64584) by debbugs.gnu.org; 11 Sep 2023 22:13:49 +0000 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 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 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== 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) 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) From: Stefan Monnier In-Reply-To: <87fs3klos4.fsf@gmail.com> (Visuwesh's message of "Mon, 11 Sep 2023 20:50:43 +0530") Message-ID: References: <87y1jloyao.fsf@gmail.com> <87fs3klos4.fsf@gmail.com> Date: Mon, 11 Sep 2023 18:12:28 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.101 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> 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 From unknown Sat Sep 20 03:14:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Sep 2023 02:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64584 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 64584@debbugs.gnu.org Received: via spool by 64584-submit@debbugs.gnu.org id=B64584.169448620616213 (code B ref 64584); Tue, 12 Sep 2023 02:37:01 +0000 Received: (at 64584) by debbugs.gnu.org; 12 Sep 2023 02:36:46 +0000 Received: from localhost ([127.0.0.1]:55540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qftGg-0004DR-1T for submit@debbugs.gnu.org; Mon, 11 Sep 2023 22:36:46 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:48290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qftGZ-0004D9-Sf for 64584@debbugs.gnu.org; Mon, 11 Sep 2023 22:36:44 -0400 Received: by mail-pl1-x642.google.com with SMTP id d9443c01a7336-1c0c6d4d650so43143045ad.0 for <64584@debbugs.gnu.org>; Mon, 11 Sep 2023 19:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694486189; x=1695090989; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UFexwUmtLP7+cbkqiwuagcnjPryfFeWCLMksrwTT9/E=; b=E7FmZwNLhA4EbSBaUDLFdVq50uWT+Awu8qjzoeMGl4STZTU6l3PiZFdk3vhyeEeb08 icIvr1XOCvSUXBSojKMfF5xILGRXFpkyhxr6PqqKfE0xo67au/hmEUqZ1j/Luc1MXhvY ONsOqwu/hdZxF8Wh57GSuXnBGWEY7MnKv2RQI/1TeQHlzLqj787lWcCCT8XquBmHSoKY j0i+Hq00IwP/UgQgzDuQ7yk6LRYZXpRHsq/2qb28IZOd8d/DvXgSLbIjffH4LK7ZqVwE vfO+HyZ5jG4nTSuC8+rCfW97Uvlwc6mCPWFaOMzeNzHMnXodFl00J+DnEC2Ha117edee 9STw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694486189; x=1695090989; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=UFexwUmtLP7+cbkqiwuagcnjPryfFeWCLMksrwTT9/E=; b=dtliRwgn4/qr8KALdC3DVqe8VNAFO4kxpuM9KImJopS8QLeFShtQJdiDv3oOaAbTDp XSSJ/9uB6HTJbQLbj9aerJca8EekItwq0udNttklykFBYmFPRBpX/ckZQoY5G1uhGqE7 e8tgY8LBQj7J+toW9LQSwMMAjSZ5mbUYT97VbBojIv8mWpsGcsu1vFafcjB1Hch+Uh7v 1c3/7jBCQ5Ndyintm/YOLXGjaQqj96u2IVo2Kj1yMv3RxCAqYsjmljxQTChVNH48OhE5 JNXkTpAgZui7N/l9mpS6T5nhayLeu98v4+y+Iz0pVAwaoCFl0anVVezvaskXEnvjkVKb +DhQ== X-Gm-Message-State: AOJu0YxZJYBjMr/9FXyAo63Esd+BQny0jAe08RlGmiAZKST/tfbhjjqG Dp1r6Jt2FKBXYpP9aroBpzs= X-Google-Smtp-Source: AGHT+IGKncI/T59X63WtEMvlhIbfL9g7TzGrMydSlY9fcXYF3vnchRGTnWhychBZcS8t83vDfhMruw== X-Received: by 2002:a17:903:445:b0:1bb:dbec:40ba with SMTP id iw5-20020a170903044500b001bbdbec40bamr11193061plb.16.1694486189135; Mon, 11 Sep 2023 19:36:29 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id ja10-20020a170902efca00b001b9da8b4eb7sm7144420plb.35.2023.09.11.19.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 19:36:28 -0700 (PDT) From: Visuwesh In-Reply-To: (Stefan Monnier's message of "Mon, 11 Sep 2023 18:12:28 -0400") References: <87y1jloyao.fsf@gmail.com> <87fs3klos4.fsf@gmail.com> Date: Tue, 12 Sep 2023 08:06:25 +0530 Message-ID: <87bke8kthy.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=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: >>> 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. Yes, of course. I end up having to do something like the let form below (defun vz/read-relative-filename (&optional prompt dir) (let ((file (read-file-name (or prompt "Filname: ") dir ""))) (if (equal file "") "" (file-relative-name file default-directory)))) (define-skeleton imagemagick-collage-images "Collage/montage multiple images using imagemagick." nil "montage " ((let ((file (vz/read-relative-filename "Image: "))) (if (equal file "") "" (shell-quote-argument file))) str " ") "-geometry 00 " "-tile " (skeleton-read "How many columns (horizontal)? ") "x" (skeleton-read "How many rows (vertical)? ") (shell-quote-argument (vz/read-relative-filename "Out: "))) I was hoping I could avoid doing this. I wanted to ask you why the eval form used by skeleton errors but now I realise that str is a list when it is eval'ed in the example I gave in the OP; I was thinking of eval as some kind of macroexpansion instead. I disturbed you all for nothing, sorry. I can do (define-skeleton test "" (read-file-name "p: ") (shell-quote-argument (eval str))) instead and that works without the error. I do wonder if the eval can be avoided but this bug can be closed regardless. >> 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. >> 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 Thanks for your patience and help. From unknown Sat Sep 20 03:14:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Sep 2023 03:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64584 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Visuwesh Cc: 64584@debbugs.gnu.org Received: via spool by 64584-submit@debbugs.gnu.org id=B64584.169448797719277 (code B ref 64584); Tue, 12 Sep 2023 03:07:01 +0000 Received: (at 64584) by debbugs.gnu.org; 12 Sep 2023 03:06:17 +0000 Received: from localhost ([127.0.0.1]:55562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qftjF-00050r-7v for submit@debbugs.gnu.org; Mon, 11 Sep 2023 23:06:17 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2771) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qftjC-00050d-Lp for 64584@debbugs.gnu.org; Mon, 11 Sep 2023 23:06:15 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 590488071E; Mon, 11 Sep 2023 23:06:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694487963; bh=PBXXMGiy6j6UhIX8+/2sD6Bx9eUEUj47aPUYIZoraXc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=UsAky8A3GzS7Kx7tuh/v+TEjK4yM4mAk+vQ/1HUxuZ9Uggf0FJMiOL4Gc0FsQlmx8 ACaF3YtAALmrgMJGKipvprxx6KnAPjmdXUZHafb7bYP4i72fWOCo3cdIYY9gKl057s n+S44XfKnqLK/8BOmze34I6i8onIWNNQw9lIeZFEMHRtONA91UKYtpcr4YolQXhg3w JoHZLZXxKyMrn52Wc+sgutTtrYnPYXNCO6hkgvK3L7cL5lGKVoMw+EGAu/5G8XQYWK Rjg0Q+XnumiHL67OYrPbV08RBZ2BTaBko2VqAG/ZQBJXTovCYRTO5yIIastbZFa5Is Itez6V3JPtHMg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0A38280283; Mon, 11 Sep 2023 23:06:03 -0400 (EDT) Received: from pastel (unknown [104.247.229.91]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D3B2912022A; Mon, 11 Sep 2023 23:06:02 -0400 (EDT) From: Stefan Monnier In-Reply-To: <87bke8kthy.fsf@gmail.com> (Visuwesh's message of "Tue, 12 Sep 2023 08:06:25 +0530") Message-ID: References: <87y1jloyao.fsf@gmail.com> <87fs3klos4.fsf@gmail.com> <87bke8kthy.fsf@gmail.com> Date: Mon, 11 Sep 2023 23:06:02 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.157 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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 From unknown Sat Sep 20 03:14:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions 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 X-GNU-PR-Keywords: To: Stefan Monnier Cc: 64584@debbugs.gnu.org Received: via spool by 64584-submit@debbugs.gnu.org id=B64584.169452147611919 (code B ref 64584); Tue, 12 Sep 2023 12:25:02 +0000 Received: (at 64584) by debbugs.gnu.org; 12 Sep 2023 12:24:36 +0000 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 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 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) 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) From: Visuwesh In-Reply-To: (Stefan Monnier's message of "Mon, 11 Sep 2023 23:06:02 -0400") References: <87y1jloyao.fsf@gmail.com> <87fs3klos4.fsf@gmail.com> <87bke8kthy.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Tue, 12 Sep 2023 17:54:12 +0530 Message-ID: <87y1hbk2ab.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=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. From unknown Sat Sep 20 03:14:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Sep 2023 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64584 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Visuwesh Cc: 64584@debbugs.gnu.org Received: via spool by 64584-submit@debbugs.gnu.org id=B64584.169452410616447 (code B ref 64584); Tue, 12 Sep 2023 13:09:02 +0000 Received: (at 64584) by debbugs.gnu.org; 12 Sep 2023 13:08:26 +0000 Received: from localhost ([127.0.0.1]:56464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg37x-0004HC-Rg for submit@debbugs.gnu.org; Tue, 12 Sep 2023 09:08:26 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg37u-0004Gx-8W for 64584@debbugs.gnu.org; Tue, 12 Sep 2023 09:08:24 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id EF74580762; Tue, 12 Sep 2023 09:08:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694524090; bh=TH0UjUDpSKVapUQ8VvYzbE5JvnjFKGzOyaZFMzXzTMg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=XpA0ZCzSSm8LBFWCDZAidxl3Kceo+k9CjLZkJ7398rGUpADVNlaswaMmn3mSWTzfm BowhQO4Tn7kWqMIiPvXj33+Jt0zr/i30O/ufYcA/KqLbnQcz5GBbty1jypu4amWz8W yAQy3MKCDr0iacHgjX3MqNNytEBztBhKK1QjQDVl5fkFOHX2bZHap+hLEaKimHCWWr j6ZFr+XOixTxY/Q1wIxEpb3FHgq50zEcInPDG0zsBEqjW9+ZDFMcpCR5+bEBuKZeHF nszLbkY3bVWbtnI+DwV9taBMS1kAd8XeRsjma6FnJISeTdjkJ7G6EA5fuEv31Hk+G3 ddZU/o085pxbQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B825F804F6; Tue, 12 Sep 2023 09:08:10 -0400 (EDT) Received: from pastel (unknown [104.247.229.91]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 972681203DD; Tue, 12 Sep 2023 09:08:10 -0400 (EDT) From: Stefan Monnier In-Reply-To: <87y1hbk2ab.fsf@gmail.com> (Visuwesh's message of "Tue, 12 Sep 2023 17:54:12 +0530") Message-ID: References: <87y1jloyao.fsf@gmail.com> <87fs3klos4.fsf@gmail.com> <87bke8kthy.fsf@gmail.com> <87y1hbk2ab.fsf@gmail.com> Date: Tue, 12 Sep 2023 09:08:09 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.146 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Yes, but here it basically does nothing unfortunately. I am not sure if > > 'str > > should have the side effect of setting that variable. The above skeleton expression means "eval the variable `str` and throw away the result". The only effect it can have is to signal an error if the variable `str` is not bound. > (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))) FWIW, this style of macro is usually called "anaphoric macro" and the convention is to use the identifier `it` rather than `str` in them. It would help avoid a confusion between skeleton's `str` and your macro's variable. [ And, yes, arguably, `define-skeleton` could be considered as an anaphoric macro as well which should use `it` instead of `str`, bringing back the confusion :-) ] Stefan From unknown Sat Sep 20 03:14:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Sep 2023 14:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64584 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 64584@debbugs.gnu.org Received: via spool by 64584-submit@debbugs.gnu.org id=B64584.169453027631485 (code B ref 64584); Tue, 12 Sep 2023 14:52:02 +0000 Received: (at 64584) by debbugs.gnu.org; 12 Sep 2023 14:51:16 +0000 Received: from localhost ([127.0.0.1]:59779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg4jT-0008Bk-VE for submit@debbugs.gnu.org; Tue, 12 Sep 2023 10:51:16 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:61882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg4jS-0008BS-B2; Tue, 12 Sep 2023 10:51:15 -0400 Received: by mail-pl1-x642.google.com with SMTP id d9443c01a7336-1c34c9cc9b9so40680035ad.3; Tue, 12 Sep 2023 07:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694530263; x=1695135063; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:references :message-id:date:in-reply-to:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=xVlQb+KPIyDOhZ5wltFqLcMHo7RkAZRdc06VcJUeqtE=; b=hHM+OlgA+bGPwzwKbA3liIY7qwJ+0/LmMxGZhRrFokuHzzWMQhqFU9zIkgY/Ia9XvF itrHLPJMXgByRhDK6YjlF5hN9pqrs2yXHmVZdRoncTo9awgmdXLVXoednjapisBonjE8 KwLGvOxDs4lPgFkOOzNYyBh0jdUflXyp2jQSB2y3xqgsFmNQI2bux44kJng6mja55kX1 Ydqx4CqenZlEHr70+PAj62URA73dC0BnzzElmplpZiyWshXUNu6tLamI+nsWWJ7nV4lj lNxhV020940kpXysENS0ORA351GsS2iorsedFbRvBPIv0opUQVDiGsjjj1jiyUM+Utjj KH/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694530263; x=1695135063; h=content-transfer-encoding:mime-version:user-agent:references :message-id:date:in-reply-to:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xVlQb+KPIyDOhZ5wltFqLcMHo7RkAZRdc06VcJUeqtE=; b=Yh0K1mBZoyqpH0aXGBZQ5wdCVKLd8GPEMW3egMaHJi/Z7MbmPyaPuW1EzwoKS870fv PAVG06bgHQ126M14mA7N9pC1YcetS6ODqMFWgBXKIflzwGxTPPo6aju7S8Pr4x9G7hrw RuCn7YgxpVYFj1yUr4sbz6XFOlGGJ1eoHBAKf1zT5SrSVwtczZaf6nm9m5/JwT1xQuv1 dLzMNGB+KVCiuc0ika+MQTqJBnurGabnm46cfKruX7Rf5M2aZqFzclOyKmbdW3xm6GYV LH/04IoD/O6HxCTi9fjqnSZk6ntQxMaL233/7+1EIPy4riM4+dvFETM7gpKJQvnsFch8 AXrQ== X-Gm-Message-State: AOJu0YzKsT+qB2CwjYD8omnm5uzKmpE1v/NzdwBmBxoeliGzimKduSep g3D2mldOdlSQc03zr7l/i9Q= X-Google-Smtp-Source: AGHT+IHRiiiNV3/VozObwbWmfObrWfowq4mQ0Heb+3adaLa/adHllq+XM7NbPLEoS1v0LuWhj2nxKw== X-Received: by 2002:a17:902:dac6:b0:1c3:523b:557a with SMTP id q6-20020a170902dac600b001c3523b557amr12669386plx.4.1694530263530; Tue, 12 Sep 2023 07:51:03 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id c17-20020a170903235100b001b9d335223csm8591063plh.26.2023.09.12.07.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 07:51:03 -0700 (PDT) From: Visuwesh In-Reply-To: (Stefan Monnier's message of "Tue, 12 Sep 2023 09:08:09 -0400") Date: Tue, 12 Sep 2023 20:20:56 +0530 Message-ID: <87ttrzjvhr.fsf@gmail.com> References: <87y1jloyao.fsf@gmail.com> <87fs3klos4.fsf@gmail.com> <87bke8kthy.fsf@gmail.com> <87y1hbk2ab.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=E0=AE=9A=E0=AF=86=E0=AE=B5=E0=AF=8D=E0=AE=B5=E0=AE=BE=E0=AE=AF=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 12, 2023] Stefan Monnier wrote: >> Yes, but here it basically does nothing unfortunately. I am not sure if >> >> 'str >> >> should have the side effect of setting that variable. > > The above skeleton expression means "eval the variable `str` and throw > away the result". The only effect it can have is to signal an error if > the variable `str` is not bound. Ah yes, of course. I am still thinking in vague terms of macroexpansion which is leading to all the misunderstandings. >> (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))) > > FWIW, this style of macro is usually called "anaphoric macro" and the > convention is to use the identifier `it` rather than `str` in them. > It would help avoid a confusion between skeleton's `str` and your > macro's variable. Oh yes, I called `it' first but changed it `str' "in anger". So far, I haven't been in the need of using both vz/snippet-when's `str' and skeleton's `str' so I will let the sleeping dogs lie. > [ And, yes, arguably, `define-skeleton` could be considered as an > anaphoric macro as well which should use `it` instead of `str`, > bringing back the confusion :-) ] I guess it wasn't chosen because there are other variables too (like help, v1, v2, etc.). I cannot think of any improvements to the documentation since the spawn of this bug report is rooted in a lack of understanding of how skeleton works. There is nothing to fix here except my understanding so I'm closing the bug report with this. Thank you again for your time, Stefan. From unknown Sat Sep 20 03:14:03 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Visuwesh Subject: bug#64584: closed (Re: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions) Message-ID: References: <87ttrzjvhr.fsf@gmail.com> <87y1jloyao.fsf@gmail.com> X-Gnu-PR-Message: they-closed 64584 X-Gnu-PR-Package: emacs Reply-To: 64584@debbugs.gnu.org Date: Tue, 12 Sep 2023 14:52:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1694530323-31558-1" This is a multi-part message in MIME format... ------------=_1694530323-31558-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 64584@debbugs.gnu.org. --=20 64584: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D64584 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1694530323-31558-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 64584-done) by debbugs.gnu.org; 12 Sep 2023 14:51:16 +0000 Received: from localhost ([127.0.0.1]:59781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg4jU-0008Bm-By for submit@debbugs.gnu.org; Tue, 12 Sep 2023 10:51:16 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:61882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg4jS-0008BS-B2; Tue, 12 Sep 2023 10:51:15 -0400 Received: by mail-pl1-x642.google.com with SMTP id d9443c01a7336-1c34c9cc9b9so40680035ad.3; Tue, 12 Sep 2023 07:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694530263; x=1695135063; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:references :message-id:date:in-reply-to:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=xVlQb+KPIyDOhZ5wltFqLcMHo7RkAZRdc06VcJUeqtE=; b=hHM+OlgA+bGPwzwKbA3liIY7qwJ+0/LmMxGZhRrFokuHzzWMQhqFU9zIkgY/Ia9XvF itrHLPJMXgByRhDK6YjlF5hN9pqrs2yXHmVZdRoncTo9awgmdXLVXoednjapisBonjE8 KwLGvOxDs4lPgFkOOzNYyBh0jdUflXyp2jQSB2y3xqgsFmNQI2bux44kJng6mja55kX1 Ydqx4CqenZlEHr70+PAj62URA73dC0BnzzElmplpZiyWshXUNu6tLamI+nsWWJ7nV4lj lNxhV020940kpXysENS0ORA351GsS2iorsedFbRvBPIv0opUQVDiGsjjj1jiyUM+Utjj KH/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694530263; x=1695135063; h=content-transfer-encoding:mime-version:user-agent:references :message-id:date:in-reply-to:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xVlQb+KPIyDOhZ5wltFqLcMHo7RkAZRdc06VcJUeqtE=; b=Yh0K1mBZoyqpH0aXGBZQ5wdCVKLd8GPEMW3egMaHJi/Z7MbmPyaPuW1EzwoKS870fv PAVG06bgHQ126M14mA7N9pC1YcetS6ODqMFWgBXKIflzwGxTPPo6aju7S8Pr4x9G7hrw RuCn7YgxpVYFj1yUr4sbz6XFOlGGJ1eoHBAKf1zT5SrSVwtczZaf6nm9m5/JwT1xQuv1 dLzMNGB+KVCiuc0ika+MQTqJBnurGabnm46cfKruX7Rf5M2aZqFzclOyKmbdW3xm6GYV LH/04IoD/O6HxCTi9fjqnSZk6ntQxMaL233/7+1EIPy4riM4+dvFETM7gpKJQvnsFch8 AXrQ== X-Gm-Message-State: AOJu0YzKsT+qB2CwjYD8omnm5uzKmpE1v/NzdwBmBxoeliGzimKduSep g3D2mldOdlSQc03zr7l/i9Q= X-Google-Smtp-Source: AGHT+IHRiiiNV3/VozObwbWmfObrWfowq4mQ0Heb+3adaLa/adHllq+XM7NbPLEoS1v0LuWhj2nxKw== X-Received: by 2002:a17:902:dac6:b0:1c3:523b:557a with SMTP id q6-20020a170902dac600b001c3523b557amr12669386plx.4.1694530263530; Tue, 12 Sep 2023 07:51:03 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id c17-20020a170903235100b001b9d335223csm8591063plh.26.2023.09.12.07.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 07:51:03 -0700 (PDT) From: Visuwesh To: Stefan Monnier Subject: Re: bug#64584: 29.0.91; skeleton: cannot pass `str' as argument to some functions In-Reply-To: (Stefan Monnier's message of "Tue, 12 Sep 2023 09:08:09 -0400") Date: Tue, 12 Sep 2023 20:20:56 +0530 Message-ID: <87ttrzjvhr.fsf@gmail.com> References: <87y1jloyao.fsf@gmail.com> <87fs3klos4.fsf@gmail.com> <87bke8kthy.fsf@gmail.com> <87y1hbk2ab.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64584-done Cc: 64584@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=E0=AE=9A=E0=AF=86=E0=AE=B5=E0=AF=8D=E0=AE=B5=E0=AE=BE=E0=AE=AF=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 12, 2023] Stefan Monnier wrote: >> Yes, but here it basically does nothing unfortunately. I am not sure if >> >> 'str >> >> should have the side effect of setting that variable. > > The above skeleton expression means "eval the variable `str` and throw > away the result". The only effect it can have is to signal an error if > the variable `str` is not bound. Ah yes, of course. I am still thinking in vague terms of macroexpansion which is leading to all the misunderstandings. >> (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))) > > FWIW, this style of macro is usually called "anaphoric macro" and the > convention is to use the identifier `it` rather than `str` in them. > It would help avoid a confusion between skeleton's `str` and your > macro's variable. Oh yes, I called `it' first but changed it `str' "in anger". So far, I haven't been in the need of using both vz/snippet-when's `str' and skeleton's `str' so I will let the sleeping dogs lie. > [ And, yes, arguably, `define-skeleton` could be considered as an > anaphoric macro as well which should use `it` instead of `str`, > bringing back the confusion :-) ] I guess it wasn't chosen because there are other variables too (like help, v1, v2, etc.). I cannot think of any improvements to the documentation since the spawn of this bug report is rooted in a lack of understanding of how skeleton works. There is nothing to fix here except my understanding so I'm closing the bug report with this. Thank you again for your time, Stefan. ------------=_1694530323-31558-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 12 Jul 2023 17:06:11 +0000 Received: from localhost ([127.0.0.1]:52864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJdI2-0005Gl-S9 for submit@debbugs.gnu.org; Wed, 12 Jul 2023 13:06:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:53620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJdI1-0005Ge-7s for submit@debbugs.gnu.org; Wed, 12 Jul 2023 13:06:09 -0400 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 1qJdHz-0001sP-35 for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2023 13:06:07 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJdHt-0007Mk-Mb for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2023 13:06:05 -0400 Received: by mail-pl1-x641.google.com with SMTP id d9443c01a7336-1b8baa836a5so53263995ad.1 for ; Wed, 12 Jul 2023 10:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689181558; x=1691773558; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=jzkZNsgyE56i1IPgXez+YbDkaW09uC5nYbu3+0i/poU=; b=LHGKgIe444gBJFkXOd7Qzti7M8kqo64uru+a7lBvy5/G4++VC0ex/DN+5lTHoE0eEF mrPVlYmminOT7lc5ljO/zbHXwa1lYnj2p0Y9TQMJyWwYLxcFuHU891UUSxD6W0JAFP5u /RLbfuCmK1Xgo6c+eicsxlpDVQxRdaHprNXT15fcZ+tZ7Mz6G73r/+8HO6hA7twOdQan qAs1PMl3ocOSmjAjMK2rgm6e5TzgzP275vHLzNd8iY4HkWlhMNv8Irl0aXzwp6fUkwTR uPrkHVsbbrqIYOLMmca8SWTr+JfPdvEwKJ2MZ2fDWkUyjKlxW6T1oc3vRzdnm3620tFh YFqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689181558; x=1691773558; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jzkZNsgyE56i1IPgXez+YbDkaW09uC5nYbu3+0i/poU=; b=YVbzzdbFQqssEDEDkyU6ZPtemB/9xrf+5nGjOnj+Cqbozv2uSqlv3gj2AZNENhdYPl hklMBBpZoMA/LePKyNGNIFzsEKeGV7XxMcQY+w0b075j6NJCore45+31b/kIpWXKNXF8 6KtJ/CNHzjuoxczx3Kv5EIHj/WTwYFlHnfqOD4Jw2Cl9ZB3Q45ri9TYTotM+O683eLRv 6mGIaH8Zz+YBlEu12HrSwHfjDuCXZYjhLhw6gczEcj+VubVJ/IoEeZr9gwiQe9EDqo7Y 7kl3/CzDh+ogfGzcomQfPaDyqcr3bTFKP6Kdl9qhf4Omf5wl6LTqDI6FdR6dtQSoBvaX UhRQ== X-Gm-Message-State: ABy/qLYC5RbhpprK0V60oXW835dxj7od2Hhrc6wxbFYGcmqRgMCG29IT 0ODtum+pElNXNszU8Shgc85zcXWd2B6Kzw== X-Google-Smtp-Source: APBJJlGrqRb+KNcfBWuMGljyj2VbMYGCg5QGDGBYATGa7QM73CwmIDhW2+Ok1G1nkMsnzUttw4knlg== X-Received: by 2002:a17:902:f7d2:b0:1b6:9fec:8134 with SMTP id h18-20020a170902f7d200b001b69fec8134mr17066562plw.46.1689181557775; Wed, 12 Jul 2023 10:05:57 -0700 (PDT) Received: from localhost ([49.205.82.241]) by smtp.gmail.com with ESMTPSA id ik25-20020a170902ab1900b001b54a88e4a6sm4305602plb.51.2023.07.12.10.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 10:05:57 -0700 (PDT) From: Visuwesh To: bug-gnu-emacs@gnu.org Subject: 29.0.91; skeleton: cannot pass `str' as argument to some functions Date: Wed, 12 Jul 2023 22:35:35 +0530 Message-ID: <87y1jloyao.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::641; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x641.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) In a skeleton template, it is not possible to pass `str' as an argument to some functions. To reproduce: 1. emacs -Q 2. Evaluate the following skeletons: (define-skeleton test-skeleton "" (file-relative-name (read-file-name "P: ")) (shell-quote-argument str)) (define-skeleton test-skeleton-2 "" (file-relative-name (read-file-name "P: ")) (identity str)) 3. M-x test-skeleton RET RET -- witness it signal an error 4. M-x test-skeleton-2 RET RET -- witness it insert "./" I was able to reduce the problem down to the follwing sexp by edebbuging skeleton-internal-1 (specifically the last `t' case in the cond signals the error): (dlet ((str `(setq str "test")) (e `(shell-quote-argument str))) (eval e)) In GNU Emacs 29.0.91 (build 11, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2023-07-12 built on astatine Repository revision: 17c7915ab947ebeec6ea5ad3eb4cad1f24d5d4fc Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12101007 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure --with-sound=alsa --with-x-toolkit=lucid --with-json --without-xaw3d --without-gconf --without-libsystemd --without-cairo' Configured features: ACL DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XFT XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LC_MONETARY: ta_IN.UTF-8 value of $LC_NUMERIC: ta_IN.UTF-8 value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort help-mode emacsbug mail-extr message sendmail mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader cl-loaddefs cl-lib skeleton rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 41879 11878) (symbols 48 5521 1) (strings 32 14721 2050) (string-bytes 1 393181) (vectors 16 10382) (vector-slots 8 158438 14259) (floats 8 44 14) (intervals 56 314 11) (buffers 976 13)) ------------=_1694530323-31558-1--