From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Loury Subject: [PATCH] Make the regexp matching the beginning of a table more explicit Date: Wed, 20 Aug 2014 14:48:49 +0200 Message-ID: <87oavfqqby.fsf@konixwork.incubateur.ens-lyon.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK5K9-0005GX-M9 for emacs-orgmode@gnu.org; Wed, 20 Aug 2014 08:49:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK5Jx-0006Gk-Ll for emacs-orgmode@gnu.org; Wed, 20 Aug 2014 08:49:09 -0400 Received: from mail-wg0-x229.google.com ([2a00:1450:400c:c00::229]:57214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK5Jx-0006FM-Fg for emacs-orgmode@gnu.org; Wed, 20 Aug 2014 08:48:57 -0400 Received: by mail-wg0-f41.google.com with SMTP id z12so7789842wgg.12 for ; Wed, 20 Aug 2014 05:48:55 -0700 (PDT) Received: from localhost (162.48.7.109.rev.sfr.net. [109.7.48.162]) by mx.google.com with ESMTPSA id e3sm58418485wjp.4.2014.08.20.05.48.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Aug 2014 05:48:54 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: OrgMode ML --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Make-the-regexp-matching-the-beginning-of-a-table-mo.patch Content-Transfer-Encoding: quoted-printable From=2004fe96d8782719b2ef90afd16c6b3dcfbd9349c6 Mon Sep 17 00:00:00 2001 From: Konubinix 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 tho= se contained into the :tags value (like in :tags "@home|@computer"). This caus= ed 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). =2D-- 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 =2D-- 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)) =2D=09=09=20=20 + (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))) =2D=09 + (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) =2D (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)) =2D-=20 2.0.1 --=-=-= Content-Type: text/plain -- Konubinix GPG Key : 7439106A Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT9JkxAAoJEHXSPO10ORBqP3UH/jhOb7kaNtXMrR+zNi++CvXL Dr1+QmLmV678GMgUQFb7wEdUGGgazgDGQfBhQEiYYqf9Ncy4IqUn5xZn5W44Qpzi qm1JxivmFXrlyL9AcGUMWSr7M/mVCSZnl/j069VkiMhDzNcga7RifDTmiHwT43ST gzT/56WBsX0e/Y/vSVWkDMl5mDRiqdJuW8Qh0NPGv+7rDhYnp3kdwyxk/4j+254l 7bMS+8hAksWbCGIp2TNAnrZAprDkhlQrsqvgj2w/aR+U3gEuJ7MZ2AuG/HWNhxm3 mmhLiwJUcrEEgytEiTuQqhKlGdFAS+zyXQbnnGwqT30rFB1e/FX5/WbKvo5QFlQ= =E90P -----END PGP SIGNATURE----- --==-=-=--