emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Oleg Sivokon <olegsivokon@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Bug: TBLFM regexp doesn't account for possible white space after the pipe [8.2.2 (release_8.2.2-188-gc57372 @ /home/wvxvw/Projects/org-mode/lisp/)]
Date: Fri, 08 May 2015 00:35:18 +0300	[thread overview]
Message-ID: <87vbg42hrd.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 839 bytes --]


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

When evaluating a formula, the regular expression used to locate the
formula will miss, if there is a white space after the rightmost pipe in
the last row, i.e.

|1|*
#+tblfm: vsum($1)

asterisk is where the extra space character appears.  Attached is my
attempt at patching it.

Best,

Oleg


Emacs  : GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.12)
 of 2015-05-03 on wvxvvw-laptop
Package: Org-mode version 8.2.2 (release_8.2.2-188-gc57372 @ /home/wvxvw/Projects/org-mode/lisp/)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Account for space after last column in tblfm regex --]
[-- Type: text/x-patch, Size: 893 bytes --]

From b91aeaf01f8f4a11f55cc60bbfd9c75e64d73554 Mon Sep 17 00:00:00 2001
From: wvxvw <olegsivokon@gmail.com>
Date: Fri, 8 May 2015 00:09:21 +0300
Subject: [PATCH] TBLFM regex account for white space after last column.

---
 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 a644008..3ca0e76 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -56,7 +56,7 @@ This can be used to add additional functionality after the table is sent
 to the receiver position, otherwise, if table is not sent, the functions
 are not run.")
 
-(defvar org-table-TBLFM-begin-regexp "|\n[ \t]*#\\+TBLFM: ")
+(defvar org-table-TBLFM-begin-regexp "|\s-*\n[ \t]*#\\+TBLFM: ")
 
 (defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
   "Non-nil means use the optimized table editor version for `orgtbl-mode'.
-- 
2.1.0


             reply	other threads:[~2015-05-07 21:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07 21:35 Oleg Sivokon [this message]
2015-05-08  8:52 ` Bug: TBLFM regexp doesn't account for possible white space after the pipe [8.2.2 (release_8.2.2-188-gc57372 @ /home/wvxvw/Projects/org-mode/lisp/)] Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbg42hrd.fsf@gmail.com \
    --to=olegsivokon@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).