* [bug] Can't find remote table when name is downcased
@ 2012-04-02 13:54 Sebastien Vauban
2012-04-02 15:05 ` Bastien
0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2012-04-02 13:54 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hello,
The error
if: Can't find remote table "onsite"
is reported if the table name is in downcase (as in the following example).
Everything is OK when table name is in uppercase.
--8<---------------cut here---------------start------------->8---
* On site
#+tblname: onsite
| | Date | Persons |
|---+------------------+---------|
| | [2012-04-03 Tue] | 1 |
| | [2012-04-04 Wed] | 1 |
|---+------------------+---------|
| | Total | 2 |
| ^ | | Total |
#+TBLFM: $Total=vsum(@-I..-II)
* Remote reference
| Days on site | 2 | j |
#+TBLFM: @1$2=remote(onsite,$Total)::
--8<---------------cut here---------------end--------------->8---
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [bug] Can't find remote table when name is downcased
2012-04-02 13:54 [bug] Can't find remote table when name is downcased Sebastien Vauban
@ 2012-04-02 15:05 ` Bastien
2012-04-02 15:36 ` Sebastien Vauban
0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2012-04-02 15:05 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 257 bytes --]
Hi Sébastien,
"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:
> The error
>
> if: Can't find remote table "onsite"
>
> is reported if the table name is in downcase (as in the following
> example).
Can you try this patch and report?
Thanks!
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-tbl-line-downcase.patch --]
[-- Type: text/x-patch, Size: 514 bytes --]
diff --git a/lisp/org-table.el b/lisp/org-table.el
index ae12cee..19367b5 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -3826,7 +3826,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
"Local variable used by `orgtbl-mode'.")
(defconst orgtbl-line-start-regexp
- "[ \t]*\\(|\\|#\\+\\(TBLFM\\|ORGTBL\\|TBLNAME\\):\\)"
+ "[ \t]*\\(|\\|#\\+\\(tblfm\\|orgtbl\\|tblname\\):\\)"
"Matches a line belonging to an orgtbl.")
(defconst orgtbl-extra-font-lock-keywords
[-- Attachment #3: Type: text/plain, Size: 14 bytes --]
--
Bastien
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [bug] Can't find remote table when name is downcased
2012-04-02 15:05 ` Bastien
@ 2012-04-02 15:36 ` Sebastien Vauban
2012-04-02 15:49 ` Bastien
0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2012-04-02 15:36 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Bastien,
Bastien wrote:
> "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>
>> The error
>>
>> if: Can't find remote table "onsite"
>>
>> is reported if the table name is in downcase (as in the following
>> example).
>
> Can you try this patch and report?
1. Applied the patch manually.
2. Restarted Emacs (to be sure, as it is a defconst).
3. Tested.
But, no, it does not work on the provided example: remote table is still
not found.
4. Upcased `tblname'
5. Re-tested. Table is well found.
So, the patch did not change the apparent behavior...
BTW, when "finding ID locations" (launched because the remote table was not
found in the buffer itself), 2 errors are reported in Worg files:
- Duplicate ID "mid:i929ov%24dpe%241%40dough%2Egmane%2Eorg", also in file c:/home/sva/src/worg/org-issues.org
- Duplicate ID "mid:4C90E885%2E7010409%40sift%2Einfo", also in file c:/home/sva/src/worg/org-issues.org
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [bug] Can't find remote table when name is downcased
2012-04-02 15:36 ` Sebastien Vauban
@ 2012-04-02 15:49 ` Bastien
2012-04-02 21:01 ` Sebastien Vauban
0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2012-04-02 15:49 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]
Hi Sébastien,
"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:
> Bastien wrote:
>> "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:
>>
>>> The error
>>>
>>> if: Can't find remote table "onsite"
>>>
>>> is reported if the table name is in downcase (as in the following
>>> example).
>>
>> Can you try this patch and report?
>
> 1. Applied the patch manually.
> 2. Restarted Emacs (to be sure, as it is a defconst).
> 3. Tested.
>
> But, no, it does not work on the provided example: remote table is still
> not found.
Please test this new patch.
I won't apply this before we sort out the conventions around using
downcase/uppercase keywords, as Ilya stated a while ago.
Thanks,
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-tbl-line-downcase2.patch --]
[-- Type: text/x-patch, Size: 963 bytes --]
diff --git a/lisp/ob.el b/lisp/ob.el
index 726245c..49ce76a 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -439,3 +439,3 @@ specific header arguments as well.")
-(defvar org-babel-data-names '("TBLNAME" "RESULTS" "NAME"))
+(defvar org-babel-data-names '("tblname" "results" "name"))
diff --git a/lisp/org-table.el b/lisp/org-table.el
index ae12cee..4bf025b 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -3828,3 +3828,3 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
(defconst orgtbl-line-start-regexp
- "[ \t]*\\(|\\|#\\+\\(TBLFM\\|ORGTBL\\|TBLNAME\\):\\)"
+ "[ \t]*\\(|\\|#\\+\\(tblfm\\|orgtbl\\|tblname\\):\\)"
"Matches a line belonging to an orgtbl.")
@@ -4734,3 +4734,3 @@ list of the fields in the rectangle ."
(if (re-search-forward
- (concat "^[ \t]*#\\+TBLNAME:[ \t]*" (regexp-quote name-or-id) "[ \t]*$")
+ (concat "^[ \t]*#\\+tblname:[ \t]*" (regexp-quote name-or-id) "[ \t]*$")
nil t)
[-- Attachment #3: Type: text/plain, Size: 14 bytes --]
--
Bastien
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [bug] Can't find remote table when name is downcased
2012-04-02 15:49 ` Bastien
@ 2012-04-02 21:01 ` Sebastien Vauban
2012-04-03 12:41 ` Sebastien Vauban
0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2012-04-02 21:01 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Bastien,
Bastien wrote:
> "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>> Bastien wrote:
>>> "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>>>
>>>> The error
>>>>
>>>> if: Can't find remote table "onsite"
>>>>
>>>> is reported if the table name is in downcase (as in the following
>>>> example).
>>
>> 1. Applied the patch manually.
>> 2. Restarted Emacs (to be sure, as it is a defconst).
>> 3. Tested.
>>
>> But, no, it does not work on the provided example: remote table is still
>> not found.
>
> Please test this new patch.
I confirm that the problem is solved. Thank you!
> I won't apply this before we sort out the conventions around using
> downcase/uppercase keywords, as Ilya stated a while ago.
I don't understand your last point. From what you said on
http://thread.gmane.org/gmane.emacs.orgmode/50916/focus=50956, I imagine
you're talking of the formatting in the manual.
But why not allowing all types of cases (at least: all uppercase and all
downcase) inside Org itself?
Anyway, thanks for the fix...
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [bug] Can't find remote table when name is downcased
2012-04-02 21:01 ` Sebastien Vauban
@ 2012-04-03 12:41 ` Sebastien Vauban
2012-04-21 13:40 ` Bastien
0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2012-04-03 12:41 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Bastien,
"Sebastien Vauban" wrote:
>> Please test this new patch.
>
> I confirm that the problem is solved. Thank you!
But I must report that it does not work anymore with uppercases...
>> I won't apply this before we sort out the conventions around using
>> downcase/uppercase keywords, as Ilya stated a while ago.
>
> I don't understand your last point. From what you said on
> http://thread.gmane.org/gmane.emacs.orgmode/50916/focus=50956, I imagine
> you're talking of the formatting in the manual.
>
> But why not allowing all types of cases (at least: all uppercase and all
> downcase) inside Org itself?
Why can't we allow both versions? (at least, outside of the manual)
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [bug] Can't find remote table when name is downcased
2012-04-03 12:41 ` Sebastien Vauban
@ 2012-04-21 13:40 ` Bastien
0 siblings, 0 replies; 7+ messages in thread
From: Bastien @ 2012-04-21 13:40 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 245 bytes --]
Hi Sébastien,
can you test the attached patch?
It takes care of matching #+tblname/#+name/#+tblfm along
with #+TBLNAME/#+NAME/#+TBLFM.
Please test it heavily -- I'm sure you have some secret
stuff in your config to make it fail :)
Thanks,
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Match-name-tblname-tblfm-along-with-uppercase-twins.patch --]
[-- Type: text/x-patch, Size: 16137 bytes --]
From 4e107031ad81b368e407f0815132294024f43610 Mon Sep 17 00:00:00 2001
From: Bastien Guerry <bzg@altern.org>
Date: Sat, 21 Apr 2012 15:36:04 +0200
Subject: [PATCH] Match #+name/#+tblname/#+tblfm along with uppercase twins.
* org.el: Use (case-fold-search t).
(org-edit-special, org-ctrl-c-ctrl-c): Ditto.
* org-table.el:
(org-table-store-formulas, org-table-get-stored-formulas)
(org-table-fix-formulas, org-table-edit-formulas)
(org-old-auto-fill-inhibit-regexp, orgtbl-ctrl-c-ctrl-c)
(orgtbl-toggle-comment, org-table-get-remote-range): Ditto.
* org-footnote.el:
(org-footnote-goto-local-insertion-point): Ditto.
* org-exp.el: Ditto.
* org-colview.el:
(org-dblock-write:columnview, org-dblock-write:columnview):
Ditto.
* org-colview-xemacs.el:
(org-dblock-write:columnview): Ditto.
* org-clock.el (org-clocktable-write-default): Ditto.
* org-capture.el (org-capture-place-table-line): Ditto.
* ob.el (org-babel-data-names, org-babel-goto-named-src-block)
(org-babel-src-block-names)
(org-babel-where-is-src-block-result, org-babel-result-end)
(org-babel-where-is-src-block-head)
(org-babel-find-named-result, org-babel-result-names): Ditto.
---
lisp/ob.el | 37 ++++++++++++++++++++-----------------
lisp/org-capture.el | 4 ++--
lisp/org-clock.el | 3 ++-
lisp/org-colview-xemacs.el | 3 ++-
lisp/org-colview.el | 3 ++-
lisp/org-exp.el | 3 ++-
| 2 +-
lisp/org-table.el | 29 +++++++++++++++--------------
lisp/org.el | 10 ++++++----
9 files changed, 52 insertions(+), 42 deletions(-)
diff --git a/lisp/ob.el b/lisp/ob.el
index 160c63a..4332110 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -439,7 +439,7 @@ specific header arguments as well.")
'((:session . "none") (:results . "replace") (:exports . "results"))
"Default arguments to use when evaluating an inline source block.")
-(defvar org-babel-data-names '("TBLNAME" "RESULTS" "NAME"))
+(defvar org-babel-data-names '("tblname" "results" "name"))
(defvar org-babel-result-regexp
(concat "^[ \t]*#\\+"
@@ -1464,7 +1464,7 @@ to the table for reinsertion to org-mode."
Return the point at the beginning of the current source
block. Specifically at the beginning of the #+BEGIN_SRC line.
If the point is not on a source block then return nil."
- (let ((initial (point)) top bottom)
+ (let ((initial (point)) (case-fold-search t) top bottom)
(or
(save-excursion ;; on a source name line or a #+header line
(beginning-of-line 1)
@@ -1501,6 +1501,7 @@ If the point is not on a source block then return nil."
"Go to a named source-code block."
(interactive
(let ((completion-ignore-case t)
+ (case-fold-search t)
(under-point (thing-at-point 'line)))
(list (org-icompleting-read
"source-block name: " (org-babel-src-block-names) nil t
@@ -1548,7 +1549,7 @@ org-babel-named-src-block-regexp."
"Returns the names of source blocks in FILE or the current buffer."
(save-excursion
(when file (find-file file)) (goto-char (point-min))
- (let (names)
+ (let ((case-fold-search t) names)
(while (re-search-forward org-babel-src-name-w-name-regexp nil t)
(setq names (cons (match-string 3) names)))
names)))
@@ -1571,23 +1572,24 @@ org-babel-named-src-block-regexp."
Return the location of the result named NAME in the current
buffer or nil if no such result exists."
(save-excursion
- (goto-char (or point (point-min)))
- (catch 'is-a-code-block
- (when (re-search-forward
- (concat org-babel-result-regexp
- "[ \t]" (regexp-quote name) "[ \t\n\f\v\r]+") nil t)
- (when (and (string= "name" (downcase (match-string 1)))
- (or (beginning-of-line 1)
- (looking-at org-babel-src-block-regexp)
- (looking-at org-babel-multi-line-header-regexp)))
- (throw 'is-a-code-block (org-babel-find-named-result name (point))))
- (beginning-of-line 0) (point)))))
+ (let ((case-fold-search t))
+ (goto-char (or point (point-min)))
+ (catch 'is-a-code-block
+ (when (re-search-forward
+ (concat org-babel-result-regexp
+ "[ \t]" (regexp-quote name) "[ \t\n\f\v\r]+") nil t)
+ (when (and (string= "name" (downcase (match-string 1)))
+ (or (beginning-of-line 1)
+ (looking-at org-babel-src-block-regexp)
+ (looking-at org-babel-multi-line-header-regexp)))
+ (throw 'is-a-code-block (org-babel-find-named-result name (point))))
+ (beginning-of-line 0) (point))))))
(defun org-babel-result-names (&optional file)
"Returns the names of results in FILE or the current buffer."
(save-excursion
(when file (find-file file)) (goto-char (point-min))
- (let (names)
+ (let ((case-fold-search t) names)
(while (re-search-forward org-babel-result-w-name-regexp nil t)
(setq names (cons (match-string 4) names)))
names)))
@@ -1685,7 +1687,8 @@ source block. Specifically at the beginning of the results line.
If no result exists for this block then create a results line
following the source block."
(save-excursion
- (let* ((on-lob-line (save-excursion
+ (let* ((case-fold-search t)
+ (on-lob-line (save-excursion
(beginning-of-line 1)
(looking-at org-babel-lob-one-liner-regexp)))
(inlinep (when (org-babel-get-inline-src-block-matches)
@@ -2008,7 +2011,7 @@ code ---- the results are extracted in the syntax of the source
((org-at-item-p) (let* ((struct (org-list-struct))
(prvs (org-list-prevs-alist struct)))
(org-list-get-list-end (point-at-bol) struct prvs)))
- ((looking-at "^\\([ \t]*\\):RESULTS:")
+ ((let ((case-fold-search t)) (looking-at "^\\([ \t]*\\):results:"))
(progn (re-search-forward (concat "^" (match-string 1) ":END:"))
(forward-char 1) (point)))
(t
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index f0afc70..109a5c2 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1000,9 +1000,9 @@ it. When it is a variable, retrieve the value. Return whatever we get."
(setq beg (1+ (point-at-eol))
end (save-excursion (outline-next-heading) (point)))))
(if (re-search-forward org-table-dataline-regexp end t)
- (let ((b (org-table-begin)) (e (org-table-end)))
+ (let ((b (org-table-begin)) (e (org-table-end)) (case-fold-search t))
(goto-char e)
- (if (looking-at "[ \t]*#\\+TBLFM:")
+ (if (looking-at "[ \t]*#\\+tblfm:")
(forward-line 1))
(narrow-to-region b (point)))
(goto-char end)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 25a36cf..abd75ea 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2199,6 +2199,7 @@ from the dynamic block definition."
(ntcol (max 1 (or (plist-get params :tcolumns) 100)))
(rm-file-column (plist-get params :one-file-with-archives))
(indent (plist-get params :indent))
+ (case-fold-search t)
range-text total-time tbl level hlc formula pcol
file-time entries entry headline
recalc content narrow-cut-p tcol)
@@ -2373,7 +2374,7 @@ from the dynamic block definition."
(t (error "invalid formula in clocktable")))
;; Should we rescue an old formula?
(when (stringp (setq content (plist-get params :content)))
- (when (string-match "^\\([ \t]*#\\+TBLFM:.*\\)" content)
+ (when (string-match "^\\([ \t]*#\\+tblfm:.*\\)" content)
(setq recalc t)
(insert "\n" (match-string 1 (plist-get params :content)))
(beginning-of-line 0))))
diff --git a/lisp/org-colview-xemacs.el b/lisp/org-colview-xemacs.el
index be9a0b2..5a6ffdd 100644
--- a/lisp/org-colview-xemacs.el
+++ b/lisp/org-colview-xemacs.el
@@ -1402,6 +1402,7 @@ PARAMS is a property list of parameters:
(maxlevel (plist-get params :maxlevel))
(content-lines (org-split-string (plist-get params :content) "\n"))
(skip-empty-rows (plist-get params :skip-empty-rows))
+ (case-fold-search t)
tbl id idpos nfields tmp recalc line
id-as-string view-file view-pos)
(when (setq id (plist-get params :id))
@@ -1467,7 +1468,7 @@ PARAMS is a property list of parameters:
(while (setq line (pop content-lines))
(when (string-match "^#" line)
(insert "\n" line)
- (when (string-match "^[ \t]*#\\+TBLFM" line)
+ (when (string-match "^[ \t]*#\\+tblfm" line)
(setq recalc t))))
(if recalc
(progn (goto-char pos) (org-table-recalculate 'all))
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 58fc962..5409701 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1222,6 +1222,7 @@ PARAMS is a property list of parameters:
(maxlevel (plist-get params :maxlevel))
(content-lines (org-split-string (plist-get params :content) "\n"))
(skip-empty-rows (plist-get params :skip-empty-rows))
+ (case-fold-search t)
tbl id idpos nfields tmp recalc line
id-as-string view-file view-pos)
(when (setq id (plist-get params :id))
@@ -1287,7 +1288,7 @@ PARAMS is a property list of parameters:
(while (setq line (pop content-lines))
(when (string-match "^#" line)
(insert "\n" line)
- (when (string-match "^[ \t]*#\\+TBLFM" line)
+ (when (string-match "^[ \t]*#\\+tblfm" line)
(setq recalc t))))
(if recalc
(progn (goto-char pos) (org-table-recalculate 'all))
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 689b92c..5b56a28 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -2011,7 +2011,8 @@ When it is nil, all comments will be removed."
(defun org-export-handle-table-metalines ()
"Remove table specific metalines #+TBLNAME: and #+TBLFM:."
- (let ((re "^[ \t]*#\\+TBL\\(NAME\\|FM\\):\\(.*\n?\\)")
+ (let ((re "^[ \t]*#\\+tbl\\(name\\|fm\\):\\(.*\n?\\)")
+ (case-fold-search t)
pos)
(goto-char (point-min))
(while (or (looking-at re)
--git a/lisp/org-footnote.el b/lisp/org-footnote.el
index eb6059b..b0472f3 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -844,7 +844,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
(beginning-of-line 0)
(while (and (not (bobp)) (= (char-after) ?#))
(beginning-of-line 0))
- (if (looking-at "[ \t]*#\\+TBLFM:") (beginning-of-line 2))
+ (if (let ((case-fold-search t)) (looking-at "[ \t]*#\\+tblfm:")) (beginning-of-line 2))
(end-of-line 1)
(skip-chars-backward "\n\r\t ")
(forward-line))
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 305fd3f..9331391 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -2090,13 +2090,13 @@ When NAMED is non-nil, look for a named equation."
(setq alist (sort alist 'org-table-formula-less-p))
(save-excursion
(goto-char (org-table-end))
- (if (looking-at "\\([ \t]*\n\\)*[ \t]*#\\+TBLFM:\\(.*\n?\\)")
+ (if (looking-at "\\([ \t]*\n\\)*[ \t]*\\(#\\+tblfm:\\)\\(.*\n?\\)")
(progn
;; don't overwrite TBLFM, we might use text properties to store stuff
- (goto-char (match-beginning 2))
- (delete-region (match-beginning 2) (match-end 0)))
+ (goto-char (match-beginning 3))
+ (delete-region (match-beginning 3) (match-end 0)))
(org-indent-line-function)
- (insert "#+TBLFM:"))
+ (insert (match-string 2)))
(insert " "
(mapconcat (lambda (x)
(concat
@@ -2133,10 +2133,10 @@ When NAMED is non-nil, look for a named equation."
(defun org-table-get-stored-formulas (&optional noerror)
"Return an alist with the stored formulas directly after current table."
(interactive)
- (let (scol eq eq-alist strings string seen)
+ (let ((case-fold-search t) scol eq eq-alist strings string seen)
(save-excursion
(goto-char (org-table-end))
- (when (looking-at "\\([ \t]*\n\\)*[ \t]*#\\+TBLFM: *\\(.*\\)")
+ (when (looking-at "\\([ \t]*\n\\)*[ \t]*#\\+tblfm: *\\(.*\\)")
(setq strings (org-split-string (org-match-string-no-properties 2)
" *:: *"))
(while (setq string (pop strings))
@@ -2164,7 +2164,7 @@ KEY is \"@\" or \"$\". REPLACE is an alist of numbers to replace.
For all numbers larger than LIMIT, shift them by DELTA."
(save-excursion
(goto-char (org-table-end))
- (when (looking-at "[ \t]*#\\+TBLFM:")
+ (when (let ((case-fold-search t)) (looking-at "[ \t]*#\\+tblfm:"))
(let ((re (concat key "\\([0-9]+\\)"))
(re2
(when remove
@@ -3144,7 +3144,7 @@ Parameters get priority."
(defun org-table-edit-formulas ()
"Edit the formulas of the current table in a separate buffer."
(interactive)
- (when (save-excursion (beginning-of-line 1) (looking-at "[ \t]*#\\+TBLFM"))
+ (when (save-excursion (beginning-of-line 1) (let ((case-fold-search t)) (looking-at "[ \t]*#\\+TBLFM")))
(beginning-of-line 0))
(unless (org-at-table-p) (error "Not at a table"))
(org-table-get-specials)
@@ -3833,7 +3833,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
"Local variable used by `orgtbl-mode'.")
(defconst orgtbl-line-start-regexp
- "[ \t]*\\(|\\|#\\+\\(TBLFM\\|ORGTBL\\|TBLNAME\\):\\)"
+ "[ \t]*\\(|\\|#\\+\\(tblfm\\|orgtbl\\|tblname\\):\\)"
"Matches a line belonging to an orgtbl.")
(defconst orgtbl-extra-font-lock-keywords
@@ -4081,13 +4081,13 @@ to execute outside of tables."
If it is a table to be sent away to a receiver, do it.
With prefix arg, also recompute table."
(interactive "P")
- (let ((pos (point)) action consts-str consts cst const-str)
+ (let ((case-fold-search t) (pos (point)) action consts-str consts cst const-str)
(save-excursion
(beginning-of-line 1)
(setq action (cond
((looking-at "[ \t]*#\\+ORGTBL:.*\n[ \t]*|") (match-end 0))
((looking-at "[ \t]*|") pos)
- ((looking-at "[ \t]*#\\+TBLFM:") 'recalc))))
+ ((looking-at "[ \t]*#\\+tblfm:") 'recalc))))
(cond
((integerp action)
(goto-char action)
@@ -4342,7 +4342,8 @@ First element has index 0, or I0 if given."
(defun orgtbl-toggle-comment ()
"Comment or uncomment the orgtbl at point."
(interactive)
- (let* ((re1 (concat "^" (regexp-quote comment-start) orgtbl-line-start-regexp))
+ (let* ((case-fold-search t)
+ (re1 (concat "^" (regexp-quote comment-start) orgtbl-line-start-regexp))
(re2 (concat "^" orgtbl-line-start-regexp))
(commented (save-excursion (beginning-of-line 1)
(cond ((looking-at re1) t)
@@ -4720,7 +4721,7 @@ FORM is a field or range descriptor like \"@2$3\" or \"B3\" or
The return value is either a single string for a single field, or a
list of the fields in the rectangle ."
(save-match-data
- (let ((id-loc nil)
+ (let ((case-fold-search t) (id-loc nil)
;; Protect a bunch of variables from being overwritten
;; by the context of the remote table
org-table-column-names org-table-column-name-regexp
@@ -4739,7 +4740,7 @@ list of the fields in the rectangle ."
(save-excursion
(goto-char (point-min))
(if (re-search-forward
- (concat "^[ \t]*#\\+TBLNAME:[ \t]*" (regexp-quote name-or-id) "[ \t]*$")
+ (concat "^[ \t]*#\\+tblname:[ \t]*" (regexp-quote name-or-id) "[ \t]*$")
nil t)
(setq buffer (current-buffer) loc (match-beginning 0))
(setq id-loc (org-id-find name-or-id 'marker))
diff --git a/lisp/org.el b/lisp/org.el
index add28f2..0367f1f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18628,7 +18628,7 @@ When in an #+include line, visit the include file. Otherwise call
((or (org-at-table-p)
(save-excursion
(beginning-of-line 1)
- (looking-at "[ \t]*#\\+TBLFM:")))
+ (let ((case-fold-search )) (looking-at "[ \t]*#\\+tblfm:"))))
(call-interactively 'org-table-edit-formulas))
(t (call-interactively 'ffap))))
@@ -18782,10 +18782,12 @@ This command does many different things, depending on context:
(beginning-of-line 1)
(save-excursion (org-update-dblock)))
((save-excursion
- (beginning-of-line 1)
- (looking-at "[ \t]*#\\+\\([A-Z]+\\)"))
+ (let ((case-fold-search t))
+ (beginning-of-line 1)
+ (looking-at "[ \t]*#\\+\\([a-z]+\\)")))
(cond
- ((equal (match-string 1) "TBLFM")
+ ((or (equal (match-string 1) "TBLFM")
+ (equal (match-string 1) "tblfm"))
;; Recalculate the table before this line
(save-excursion
(beginning-of-line 1)
--
1.7.9.4
[-- Attachment #3: Type: text/plain, Size: 14 bytes --]
--
Bastien
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-04-21 13:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-02 13:54 [bug] Can't find remote table when name is downcased Sebastien Vauban
2012-04-02 15:05 ` Bastien
2012-04-02 15:36 ` Sebastien Vauban
2012-04-02 15:49 ` Bastien
2012-04-02 21:01 ` Sebastien Vauban
2012-04-03 12:41 ` Sebastien Vauban
2012-04-21 13:40 ` 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).