Преглед изворни кода

Tables: Allow #+TABNAME to be indented

Carsten Dominik пре 16 година
родитељ
комит
9a6261df78
3 измењених фајлова са 20 додато и 8 уклоњено
  1. 8 0
      lisp/ChangeLog
  2. 5 3
      lisp/org-table.el
  3. 7 5
      lisp/org.el

+ 8 - 0
lisp/ChangeLog

@@ -1,3 +1,11 @@
+2009-07-02  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-table.el (org-table-get-remote-range): Find #+TBLNAME also
+	when indented.
+
+	* org.el (org-fontify-meta-lines-and-blocks): Make #+TBLNAME
+	highlight also when indented.
+
 2009-07-01  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-footnote.el (org-footnote-renumber-fn:N): New command.

+ 5 - 3
lisp/org-table.el

@@ -4184,11 +4184,13 @@ list of the fields in the rectangle ."
 	  (save-excursion
 	    (goto-char (point-min))
 	    (if (re-search-forward
-		 (concat "^#\\+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)
-		    buffer (marker-buffer id-loc)
+	      (setq id-loc (org-id-find name-or-id 'marker))
+	      (unless (and id-loc (markerp id-loc))
+		(error "Can't find remote table \"%s\"" name-or-id))
+	      (setq buffer (marker-buffer id-loc)
 		    loc (marker-position id-loc))
 	      (move-marker id-loc nil)))
 	  (switch-to-buffer buffer)

+ 7 - 5
lisp/org.el

@@ -4236,7 +4236,7 @@ will be prompted for."
 	     beg (match-end 0)
 	     '(font-lock-fontified t face org-meta-line))
 	    t)
-	   ((or (member dc1 '("caption:" "label:" "orgtbl:" "tblfm:"))
+	   ((or (member dc1 '("caption:" "label:" "orgtbl:" "tblfm:" "tblname:"))
 		(and (match-end 4) (equal dc3 "attr")))
 	    (add-text-properties
 	     beg (match-end 0)
@@ -8714,16 +8714,18 @@ This function can be used in a hook."
 ;;;; Completion
 
 (defconst org-additional-option-like-keywords
-  '("BEGIN_HTML" "BEGIN_LaTeX" "END_HTML" "END_LaTeX"
-    "ORGTBL" "HTML:" "LaTeX:" "BEGIN:" "END:" "TBLFM"
-    "LATEX_HEADER:"
+  '("BEGIN_HTML"  "END_HTML"  "HTML:" "ATTR_HTML" 
+    "BEGIN_DocBook"  "END_DocBook"  "DocBook:" "ATTR_DocBook" 
+    "BEGIN_LaTeX" "END_LaTeX" "LaTeX:" "LATEX_HEADER:"  "ATTR_LaTeX"
+    "BEGIN:" "END:"
+    "ORGTBL" "TBLFM:" "TBLNAME:"
     "BEGIN_EXAMPLE" "END_EXAMPLE"
     "BEGIN_QUOTE" "END_QUOTE"
     "BEGIN_VERSE" "END_VERSE"
     "BEGIN_CENTER" "END_CENTER"
     "BEGIN_SRC" "END_SRC"
     "CATEGORY" "COLUMNS"
-    "CAPTION" "LABEL" "ATTR_HTML" "ATTR_LaTeX"))
+    "CAPTION" "LABEL"))
 
 (defcustom org-structure-template-alist
   '(