Browse Source

Tables: Document use of C-c RET add hline and then move below it.

Carsten Dominik 16 years ago
parent
commit
e2371c542b
5 changed files with 20 additions and 1 deletions
  1. 6 0
      doc/ChangeLog
  2. 7 1
      doc/org.texi
  3. 1 0
      doc/orgcard.tex
  4. 3 0
      lisp/org-macs.el
  5. 3 0
      lisp/org-table.el

+ 6 - 0
doc/ChangeLog

@@ -1,3 +1,9 @@
+2009-01-21  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* orgcard.tex: Document `C-c RET' in tables.
+
+	* org.texi (Built-in table editor): Document `C-c RET' in tables.
+
 2009-01-20  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.texi (Math symbols, Quoting LaTeX code): Mention that simple

+ 7 - 1
doc/org.texi

@@ -1537,7 +1537,8 @@ create the above table, you would only type
 @end example
 
 @noindent and then press @key{TAB} to align the table and start filling in
-fields.
+fields.  Even faster would be to type @code{|Name|Phone|Age} followed by
+@kbd{C-c @key{RET}}.
 
 When typing text into a field, Org treats @key{DEL},
 @key{Backspace}, and all character keys in a special way, so that
@@ -1619,6 +1620,11 @@ created below the current one.
 Insert a horizontal line below current row. With a prefix argument, the line
 is created above the current line.
 @c
+@kindex C-c @key{RET}
+@item C-c @key{RET}
+Insert a horizontal line below current row. and mode the cursor into the row
+below that line.
+@c
 @kindex C-c ^
 @item C-c ^
 Sort the table lines in the region.  The position of point indicates the

+ 1 - 0
doc/orgcard.tex

@@ -375,6 +375,7 @@ Outside of tables, the same keys may have other functionality.
 \key{kill the current row or horizontal line}{M-S-UP}
 \key{insert new row above the current row}{M-S-DOWN}
 \key{insert hline below (\kbd{C-u} : above) current row}{C-c -}
+\key{insert hline and move to line below it}{C-c RET}
 \key{sort lines in region}{C-c \^{}}
 
 {\bf Regions}

+ 3 - 0
lisp/org-macs.el

@@ -195,6 +195,9 @@ we turn off invisibility temporarily.  Use this in a `let' form."
     ;; works also in narrowed buffer, because we start at 1, not point-min
     (+ (if (bolp) 1 0) (count-lines 1 (point)))))
 
+(defsubst org-current-line-string (&optional to-here)
+  (buffer-substring (point-at-bol) (if to-here (point) (point-at-eol))))
+
 (defsubst org-pos-in-match-range (pos n)
   (and (match-beginning n)
        (<= (match-beginning n) pos)

+ 3 - 0
lisp/org-table.el

@@ -1222,6 +1222,9 @@ With prefix ABOVE, insert above the current line."
   (interactive "P")
   (if (not (org-at-table-p))
       (error "Not at a table"))
+  (when (eobp) (insert "\n") (backward-character 1))
+  (if (not (string-match "|[ \t]*$" (org-current-line-string)))
+      (org-table-align))  
   (let ((line (org-table-clean-line
 	       (buffer-substring (point-at-bol) (point-at-eol))))
 	(col (current-column)))