From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2FUGDV6HomUrLwEAkFu2QA (envelope-from ) for ; Sat, 13 Jan 2024 13:51:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id eKwzB16HomUCqAAA62LTzQ (envelope-from ) for ; Sat, 13 Jan 2024 13:51:42 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=GUQBTSri; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705150302; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=G35J6imjhrJvSYiXsunNdoMaMwAB7EEs2LRRAd7MDFg=; b=u3G8+SqxqYGE8NPcLlPprJrPGS/O7F4nwxAkJ2SRy0sMNLPG2RyVOY/8FHtzaBAbLJwyS9 kr6Vb+Mgl6qV3fFSYaeh3nOxbDklA+OoGAdAfrSklP++aFl38FNw6vQB4QpkZqJcyxWq3t PII+tLrDXNyzYz2wXkLF1p1u662lvCrnE/v3LCpbpwuwbbATv3ePmuCUGvuDNQqMTQ/fjj jbi5ThbXFTx6wb0p8kahIXKHXGZ+E0ZK10g6cAJB81Zl7TH7hGd23Ngqv9h9D8E5yyZ0sO xMqVTWzc2tcB5rujwto3i21l835CdPy6BloH7gtS4HyZWOK0VzxgSv2IaoFYJg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=GUQBTSri; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705150302; a=rsa-sha256; cv=none; b=dYbIL+TcLXCCBm8QvmgIztO5J7/VyNm8y566HPeNgpB7m9b1JSeTX/V4qE6yIfYI2T1eg0 8on7L9NN/+6TkpUnIaGwMTvJgKhL3kjx/DlVs8BV3OHaNNESXox/xzWCJQcO7EMYbIrLCX X2AZbtpJNLwUz9XvKvwh8n0d1cEj0lgZOUibN5CGDP1vTxeo5YTEr6rTXdrmoxPgYjq1KC eS+v0cVva0iL1SHWL7v6QJzMY/znICWBWyy7XiwKcq5R8PjmcurAf2pbmz2Nmch441K9rr 3qrjji05hMLoS0KselbvsTpuzKeZYaQHHHysNOjL+BZ9wN7RhHR4UgAB+/a8mw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AA26A3F973 for ; Sat, 13 Jan 2024 13:51:41 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOdTM-0000jE-06; Sat, 13 Jan 2024 07:50:48 -0500 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 1rOdTF-0000ih-MM for emacs-orgmode@gnu.org; Sat, 13 Jan 2024 07:50:43 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOdTD-0000HZ-7F for emacs-orgmode@gnu.org; Sat, 13 Jan 2024 07:50:41 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 717DF240101 for ; Sat, 13 Jan 2024 13:50:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705150236; bh=uiWstWaKeg36bWePpjRpDNVdh+wieIfRhgX6he3OXp4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=GUQBTSriR+Ukls5mrdhPFM0S3lQmF+WniufwDSi9R+MgFh25oKdzzQnCswYCWvqcN q1EdJjM57ILJ1xi3EEI1qKoAsC/QH4FzVLWkaGOyJ5RP/p2PtsB/ZLBJ1aO8DkcK5C p1QBuhc/eOwAW7jV8s4UmByJhra00FaaIP0OJcYTlY/58VQKZP24R9+D+VyZM7QU/X MbVTPWQsGXNBTlDZ0uMAoNK7wlJHJp5VRvVsV13JzV4cJka1gBJAtQZrSH9Yd61+eB vL2tMFSCzVriq6EUmeJPmfYuVXbR2TMOGjSG4OBMpeivlusGcZGnY5xUeqY0ldJCDQ 5FNOIzCwYHcSA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TBytg5gxdz6txD; Sat, 13 Jan 2024 13:50:35 +0100 (CET) From: Ihor Radchenko To: Nick Dokos Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-table-eval-formula mishandles semicolons in formulas [9.7-pre (release_9.6.14-1019-g5092ec @ /home/nick/src/emacs/org/org-mode/lisp/)] In-Reply-To: <87sf32ceid.fsf@pierrot.dokosmarshall.org> References: <87sf32ceid.fsf@pierrot.dokosmarshall.org> Date: Sat, 13 Jan 2024 12:53:48 +0000 Message-ID: <87ply5v1gj.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.08 X-Migadu-Queue-Id: AA26A3F973 X-Spam-Score: -9.08 X-Migadu-Scanner: mx11.migadu.com X-TUID: NudfX86y9etq Nick Dokos writes: > `org-table-eval-formula' interprets *any* semicolon in a formula as the > beginning of a format specifier. So if the formula contains a literal > semicolon that is not a format specifier > > #+TBLFM: $3='(concat "COMMENT ON public.layout_forms." $1 " IS " (rc-sq $2) ";") > > The problem is that `org-table-eval-formula' decides that the semicolon > is the beginning of a format specifier very early in the function and > splits off the "specifier" from the rest of the formula, leading to > errors when the truncated formula is evaluated later. Confirmed. Important. > ThHere is a semi-reasonable workaround in that the regexp matches the > *last* semicolon, so we can add a semicolon at the end of the formula, > specifying an empty format, but the formula is not truncated any longer. > If it is decided that the code must not be changed, then maybe the > workaround could be added to the documentation (perhaps as a footnote to > section "Emacs Lisp forms as formulas"). > > This was reported by user `vfclists' on Emacs SE: > https://emacs.stackexchange.com/questions/80062/is-it-because-this-org-table-formula-contains-double-quotes-it-doesnt-work We should eventually fix this bug. I do not think that we should add workarounds into the manual. The problem is that org-table.el code is fragile. A proper fix would require rewriting formula parsing code to something more reliable. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at