From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eBjrAgYCWGEGOwAAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 08:53:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id oBSyOQUCWGFlOQAA1q6Kng (envelope-from ) for ; Sat, 02 Oct 2021 06:53:57 +0000 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 7CCBA28851 for ; Sat, 2 Oct 2021 08:53:57 +0200 (CEST) Received: from localhost ([::1]:57582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWYuC-000277-J2 for larch@yhetil.org; Sat, 02 Oct 2021 02:53:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWYtg-00025s-DJ for emacs-orgmode@gnu.org; Sat, 02 Oct 2021 02:53:24 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:43521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWYtd-0003jS-Oh for emacs-orgmode@gnu.org; Sat, 02 Oct 2021 02:53:24 -0400 Received: by mail-pl1-x636.google.com with SMTP id y1so7688594plk.10 for ; Fri, 01 Oct 2021 23:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=HMVheF+oxzsXeCyYWJOCHlVPD8lrQv/SR5ahAxUeeSE=; b=apdrlzI6jPOyTz41stOPkjC4yyU+9DF8+lxEUcciZs0133kCp8iZ769pvZUnfXd6Pl fcYCPAQnOOXRPxUJJ/yB32fPogIivgZhmji3IosOUlnM25Omwnp36xM3GqW7D//DVyre GxF8Mq0Xya1+SWAeX4GqyG9IXlQL0KYzo8OGf64Kh2tgEdtp1PXpFUm743JGYJ4F7wz5 cNqdSxRMk+yFxOmaVO4AfuiYeuTVKmeA2hPZXOdyJ5+MBQ42xybqv/nuTphjn85WbtRJ +j/AjAksMlGnQidqBnQL9gsrp3SKUQJeYhg0WCGZFyUE/WqCOxJQ/Qm69lA2jlYbD+ZJ xu5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=HMVheF+oxzsXeCyYWJOCHlVPD8lrQv/SR5ahAxUeeSE=; b=qRxmlKaIe4By5MafO4r9bm3vKVOwtReZlefKS3CXqDT2PWZ5jpkqUNNs4QDHfIVHbw x/vc7/iR78wjM45DH3N5a4AeEambcESay7a41KL6sS+TumdjF/JWQ54dP/j6sr0QxkU8 MMieGBTJNV2kVUEdh5QYA6L8IY9KxB1yutsQoLXvvVQbeveBix1aZGE/N9ui1wnIvcTy czsp89HgFC1CoNPnGdAB5sPUGAZq9bamN3RxS66Au4Fs7BO6xKtAMZnygtJlX0giMKR6 0i0Psxnctj9372yJhj8rliFLabIfm1M6VvhCnPRHwC64qtc3K2A8PLLmPlKgNy0ugVky bnZg== X-Gm-Message-State: AOAM533PcZgq44Szpj10u5jmdib4nhB+XY5d0pBLk8gtp18cDgZWkOkt OYLP+vrx+zQrgyVXHZI9s3Q= X-Google-Smtp-Source: ABdhPJwgxm/8iTs9dCh3M0n7hxoPClRhQ7zfLm2PbLdczJo0x1V/aPb7D4ji7StvezYG1SoBaY4MvQ== X-Received: by 2002:a17:90b:1b46:: with SMTP id nv6mr7522801pjb.64.1633157600217; Fri, 01 Oct 2021 23:53:20 -0700 (PDT) Received: from localhost (211-22-147-226.hinet-ip.hinet.net. [211.22.147.226]) by smtp.gmail.com with ESMTPSA id s22sm7967541pfe.76.2021.10.01.23.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 23:53:19 -0700 (PDT) From: Ihor Radchenko To: spectria@mail.com Subject: [PATCH] Bug: Unintended column added to table [9.4.6 (9.4.6-gab9f2a @ /home/user/.emacs.d/elpa/org-9.4.6/)] In-Reply-To: <87lf4mhqfi.fsf@localhost> References: <87lf4mhqfi.fsf@localhost> X-Woof-Patch: t Date: Sat, 02 Oct 2021 14:54:37 +0800 Message-ID: <87v92fyl02.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=yantar92@gmail.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633157637; 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=HMVheF+oxzsXeCyYWJOCHlVPD8lrQv/SR5ahAxUeeSE=; b=HVAq6+eodV+WY2yTNKf7KTp+2U+mQAHeLoJ5qzz+zx0Jw/XQxxloTbbYHRZjn/L+bMkdDw lSY34pvUKNBk8jU6UvOo/pnB0ABI9+Il1S0NLFFXmzBHBPvHm7JpKTqx/Dw7cNxb84hhCi C5awe3rOMv9TWZjBhgMZH2ZG7KNB8mM+7jfoWW+lgN/BnhtfYx9hLH0jLq07i3hBppnPMu riDYPQnUWEc4dQ3SYGAGyI2mnTMluXb8BhnT6mW6ESRF1IPe5ilzBDpyKrPEz6p5hb2bgv WQuBZxaZePnywy48AAFgM/r+JBScrfT24RcW7IQ+7ngCYz8JO9WEsYaFynbnPA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633157637; a=rsa-sha256; cv=none; b=Rit7eGnwy/XpPQj0Ht7HWrkQMcH/e/M+fsb9vxJVTRQZyRH7aH3UUsl0vcam0GPJQV4jU8 FQ/wyw30oSbc+TehTBDQszv7ANU9o/4dn8grdAlSZyC0RBSpK7GPLrLcAAvN06JkUTdq6j dfsB7IZaKdCA4ID7JZbYNkG/9+BWyqIkrB75wsb/LrZqnnbdk9sPod7eROyN2xqC10jDNF Cy6TcJ5kSiX1L9VWL5KbTf6gUtMmkKX+/0t4IbNjKR8GrjOcgm3KEzICzRWJBwYTDFsdSx c406+LqQIMcf+31YCbTsjpRqZz/rXmCxS4g9zhcKQQZwXk+Pd5MipV07K/CTtg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=apdrlzI6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.01 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=apdrlzI6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 7CCBA28851 X-Spam-Score: -2.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: W7GtTHMqeN1q --=-=-= Content-Type: text/plain Ihor Radchenko writes: > spectria@mail.com writes: > >> In a preexisting org table, hitting can add a new, unintended column >> >> Bug: After the 2nd iteration, org adds a unintended new column. Further iteration adds more columns. > > Confirmed > > The problem appears somewhere inside org-table-justify-field-maybe And here is the fix. I am not familiar with org-table codebase, so feedback would be appreciated. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-table.el-Do-not-create-new-field-when-at-EOL-aft.patch >From 36485b234d607be16cc06912dc85b9984a0142af Mon Sep 17 00:00:00 2001 Message-Id: <36485b234d607be16cc06912dc85b9984a0142af.1633157571.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sat, 2 Oct 2021 14:44:30 +0800 Subject: [PATCH] org-table.el: Do not create new field when at EOL after table line * lisp/org-table.el (org-table-justify-field-maybe): Do not treat "|$" as unclosed table field. Fixes https://orgmode.org/list/trinity-2561db57-1561-470b-982f-0d91ddf4f145-1629900012884@3c-app-mailcom-lxa06 --- lisp/org-table.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 89c57fb06..e34872fb4 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -4436,7 +4436,7 @@ (defun org-table-justify-field-maybe (&optional new) (col (org-table-current-column))) (when (> col 0) (skip-chars-backward "^|") - (if (not (looking-at " *\\([^|\n]*?\\) *\\(|\\|$\\)")) + (if (not (looking-at " *\\(?:\\([^|\n]*?\\) *\\(|\\)\\|\\([^|\n]+?\\) *\\($\\)\\)")) (setq org-table-may-need-update t) (let* ((align (nth (1- col) org-table-last-alignment)) (width (nth (1- col) org-table-last-column-widths)) -- 2.32.0 --=-=-=--