emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Make the regexp matching the beginning of a table more explicit
@ 2014-08-20 12:48 Samuel Loury
  2014-08-22 13:44 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Samuel Loury @ 2014-08-20 12:48 UTC (permalink / raw)
  To: OrgMode ML


[-- Attachment #1.1: Type: text/plain, Size: 677 bytes --]

Hi,

I would like to provide a very tiny change in the regexp matching a
beginning of table in org-table.el.

Its current value is "^\\(\\*+ \\)\\|[ \t]*|". The second part of the
regexp ("[ \t]*|") indicates that it matches any | character, following
spaces or not. This means that the "[ \t]" is useless.

Actually, it matches my :tags expression in the #+BEGIN: clocktable part
because its value is :tags "@home|@computer".

I think that Carsten Dominik wanted the | character to be matched only
when at the beginning of a line (modulo indentation spaces).

I then added the ^ character in this part of the regexp to make it work
that way.

Please find the patch attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Make-the-regexp-matching-the-beginning-of-a-table-mo.patch --]
[-- Type: text/x-diff, Size: 1878 bytes --]

From 04fe96d8782719b2ef90afd16c6b3dcfbd9349c6 Mon Sep 17 00:00:00 2001
From: Konubinix <konubinix@gmail.com>
Date: Wed, 20 Aug 2014 14:32:47 +0200
Subject: [PATCH] Make the regexp matching the beginning of a table more
 explicit

* org-table.el (org-table-get-remote-range): Make the regexp matching the
beginning of a table more explicit, all | characters were matched, even those
contained into the :tags value (like in :tags "@home|@computer"). This caused
the | character to be interpreted as the beginning of a line. Now, the | is
matched only if it is at the beginning at a line (modulo beginning spaces).
---
 lisp/org-table.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index d1609f9..5654783 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -42,7 +42,7 @@
 		  (string backend &optional body-only ext-plist))
 (declare-function aa2u "ext:ascii-art-to-unicode" ())
 (declare-function calc-eval "calc" (str &optional separator &rest args))
-		  
+
 (defvar orgtbl-mode) ; defined below
 (defvar orgtbl-mode-menu) ; defined when orgtbl mode get initialized
 (defvar constants-unit-system)
@@ -2768,7 +2768,7 @@ not overwrite the stored one."
 	    (user-error "Invalid field specifier \"%s\""
 			(match-string 0 form)))
 	  (setq form (replace-match formrpl t t form)))
-	
+
 	(if lispp
 	    (setq ev (condition-case nil
 			 (eval (eval (read form)))
@@ -5053,7 +5053,7 @@ list of the fields in the rectangle."
 		(widen)
 		(goto-char loc)
 		(forward-char 1)
-		(unless (and (re-search-forward "^\\(\\*+ \\)\\|[ \t]*|" nil t)
+		(unless (and (re-search-forward "^\\(\\*+ \\)\\|^[ \t]*|" nil t)
 			     (not (match-beginning 1)))
 		  (user-error "Cannot find a table at NAME or ID %s" name-or-id))
 		(setq tbeg (point-at-bol))
-- 
2.0.1


[-- Attachment #1.3: Type: text/plain, Size: 99 bytes --]

--
Konubinix
GPG Key    : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A

[-- Attachment #2: Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Make the regexp matching the beginning of a table more explicit
  2014-08-20 12:48 [PATCH] Make the regexp matching the beginning of a table more explicit Samuel Loury
@ 2014-08-22 13:44 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2014-08-22 13:44 UTC (permalink / raw)
  To: Samuel Loury; +Cc: OrgMode ML

Hi Samuel,

Samuel Loury <konubinix@gmail.com> writes:

> I would like to provide a very tiny change in the regexp matching a
> beginning of table in org-table.el.

Applied in master, thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-22 13:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-20 12:48 [PATCH] Make the regexp matching the beginning of a table more explicit Samuel Loury
2014-08-22 13:44 ` Bastien

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).