Ver código fonte

Merge branch 'master' of orgmode.org:org-mode

Carsten Dominik 14 anos atrás
pai
commit
e05aa5552d
11 arquivos alterados com 75 adições e 26 exclusões
  1. 25 8
      doc/org.texi
  2. 3 2
      lisp/ob-lisp.el
  3. 3 2
      lisp/org-bibtex.el
  4. 22 3
      lisp/org-clock.el
  5. 9 0
      lisp/org-compat.el
  6. 1 1
      lisp/org-exp.el
  7. 1 0
      lisp/org-footnote.el
  8. 1 3
      lisp/org-id.el
  9. 2 0
      lisp/org-latex.el
  10. 2 1
      lisp/org-table.el
  11. 6 6
      lisp/org.el

+ 25 - 8
doc/org.texi

@@ -5917,6 +5917,9 @@ but you can specify your own function using the @code{:formatter} parameter.
              @r{All are overwritten except if there is an explicit @code{:narrow}}
 :timestamp   @r{A timestamp for the entry, when available.  Look for SCHEDULED,}
              @r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.}
+:properties  @r{List of properties that should be shown in the table.  Each}
+             @r{property will get its own column.}
+:inherit-props @r{When this flag is @code{t}, the values for @code{:properties} will be inherited.}
 :formula     @r{Content of a @code{#+TBLFM} line to be added and evaluated.}
              @r{As a special case, @samp{:formula %} adds a column with % time.}
              @r{If you do not specify a formula here, any existing formula}
@@ -10160,13 +10163,14 @@ All lines between these markers are exported literally
 @subsection Tables in @LaTeX{} export
 @cindex tables, in @LaTeX{} export
 
-For @LaTeX{} export of a table, you can specify a label and a caption
-(@pxref{Images and tables}).  You can also use the @code{ATTR_LaTeX} line to
-request a @code{longtable} environment for the table, so that it may span
-several pages, or to change the default table environment from @code{table}
-to @code{table*} or to change the default inner tabular environment to
-@code{tabularx} or @code{tabulary}.  Finally, you can set the alignment
-string, and (with @code{tabularx} or @code{tabulary}) the width:
+For @LaTeX{} export of a table, you can specify a label, a caption and
+placement options (@pxref{Images and tables}).  You can also use the
+@code{ATTR_LaTeX} line to request a @code{longtable} environment for the
+table, so that it may span several pages, or to change the default table
+environment from @code{table} to @code{table*} or to change the default inner
+tabular environment to @code{tabularx} or @code{tabulary}.  Finally, you can
+set the alignment string, and (with @code{tabularx} or @code{tabulary}) the
+width:
 
 @cindex #+CAPTION
 @cindex #+LABEL
@@ -10207,7 +10211,20 @@ element.  You can use an @code{#+ATTR_LaTeX:} line to specify the various
 options that can be used in the optional argument of the
 @code{\includegraphics} macro.  To modify the placement option of the
 @code{figure} environment, add something like @samp{placement=[h!]} to the
-Attributes.
+Attributes. It is to be noted this option can be used with tables as well.
+The options are passed as the placement option to floating environments like
+@code{figure} or @code{table}. One can pass other compatible options as well.
+For example the @code{#+ATTR_LaTeX:} line below is exported as the
+@code{figure} environment below it.
+
+@cindex #+ATTR_LaTeX
+@example
+#+ATTR_LaTeX: placement=[<options>]\footnotesize
+
+\begin{figure}[<options>]\footnotesize
+...
+\end{figure}
+@end example
 
 If you would like to let text flow around the image, add the word @samp{wrap}
 to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left

+ 3 - 2
lisp/ob-lisp.el

@@ -54,7 +54,7 @@
 			       (format "(%S (quote %S))" (car var) (cdr var)))
 			     vars "\n      ")
 			    ")\n" body ")")
-		  (format "(progn %s)" body)))))
+		  body))))
     (if (or (member "code" result-params)
 	    (member "pp" result-params))
 	(format "(pprint %s)" body)
@@ -73,7 +73,8 @@
 		(read (org-bable-lisp-vector-to-list (cadr result)))
 	      (error (cadr result)))))
       (slime-eval `(swank:eval-and-grab-output
-		    ,(buffer-substring-no-properties (point-min) (point-max)))
+		    ,(format "(progn %s)" (buffer-substring-no-properties
+					   (point-min) (point-max))))
 		  (cdr (assoc :package params)))))
    (org-babel-pick-name (cdr (assoc :colname-names params))
 			(cdr (assoc :colnames params)))

+ 3 - 2
lisp/org-bibtex.el

@@ -114,6 +114,7 @@
   (require 'cl))
 
 (defvar description nil) ; dynamically scoped from org.el
+(defvar org-id-locations)
 
 (declare-function bibtex-beginning-of-entry "bibtex" ())
 (declare-function bibtex-generate-autokey "bibtex" ())
@@ -322,8 +323,8 @@ This variable is relevant only if `org-bibtex-export-tags-as-keywords` is t."
 			      (lambda (kv)
 				(let ((key (car kv)) (val (cdr kv)))
 				  (when (and (string-match org-bibtex-prefix key)
-					     (not (equalp
-						   (concat org-bibtex-prefix "TYPE") key)))
+					     (not (string=
+						   (downcase (concat org-bibtex-prefix "TYPE")) (downcase key))))
 				    (cons (downcase (replace-regexp-in-string
 						     org-bibtex-prefix "" key))
 					  val))))

+ 22 - 3
lisp/org-clock.el

@@ -1,6 +1,6 @@
 ;;; org-clock.el --- The time clocking code for Org-mode
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
@@ -2059,6 +2059,7 @@ from the dynamic block defintion."
 	 (emph (plist-get params :emphasize))
 	 (level-p (plist-get params :level))
 	 (timestamp (plist-get params :timestamp))
+	 (properties (plist-get params :properties))
 	 (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
 	 (rm-file-column (plist-get params :one-file-with-archives))
 	 (indent (plist-get params :indent))
@@ -2122,6 +2123,7 @@ from the dynamic block defintion."
 	 (if multifile "|" "")          ; file column, maybe
 	 (if level-p   "|" "")          ; level column, maybe
 	 (if timestamp "|" "")          ; timestamp column, maybe
+	 (if properties (make-string (length properties) ?|) "")  ;properties columns, maybe
 	 (format "<%d>| |\n" narrow)))  ; headline and time columns
 
       ;; Insert the table header line
@@ -2130,6 +2132,7 @@ from the dynamic block defintion."
        (if multifile (concat (nth 1 lwords) "|") "")  ; file column, maybe
        (if level-p   (concat (nth 2 lwords) "|") "")  ; level column, maybe
        (if timestamp (concat (nth 3 lwords) "|") "")  ; timestamp column, maybe
+       (if properties (concat (mapconcat 'identity properties "|") "|") "") ;properties columns, maybe
        (concat (nth 4 lwords) "|" 
 	       (nth 5 lwords) "|\n"))                 ; headline and time columns
 
@@ -2141,6 +2144,7 @@ from the dynamic block defintion."
 				         ; file column, maybe
        (if level-p   "|"      "")        ; level column, maybe
        (if timestamp "|"      "")        ; timestamp column, maybe
+       (if properties (make-string (length properties) ?|) "")  ;properties columns, maybe
        (concat "*" (nth 7 lwords) "*| ") ; instead of a headline
        "*"
        (org-minutes-to-hh:mm-string (or total-time 0)) ; the time
@@ -2164,6 +2168,7 @@ from the dynamic block defintion."
 		       (file-name-nondirectory (car tbl))
 		       (if level-p   "| " "") ; level column, maybe
 		       (if timestamp "| " "") ; timestamp column, maybe
+		       (if properties (make-string (length properties) ?|) "")  ;properties columns, maybe
 		       (org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
 
 	    ;; Get the list of node entries and iterate over it
@@ -2188,6 +2193,11 @@ from the dynamic block defintion."
 	       (if multifile "|" "")    ; free space for file name column?
 	       (if level-p (format "%d|" (car entry)) "")   ; level, maybe
 	       (if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
+	       (if properties
+		   (concat
+		    (mapconcat
+		     (lambda (p) (or (cdr (assoc p (nth 4 entry))) ""))
+		     properties "|") "|") "")  ;properties columns, maybe
 	       (if indent (org-clocktable-indent-string level) "") ; indentation
 	       hlc headline hlc "|"                                ; headline
 	       (make-string (min (1- ntcol) (or (- level 1))) ?|)
@@ -2342,6 +2352,8 @@ TIME:      The sum of all time spend in this tree, in minutes.  This time
 	 (block (plist-get params :block))
 	 (link (plist-get params :link))
 	 (tags (plist-get params :tags))
+	 (properties (plist-get params :properties))
+	 (inherit-property-p (plist-get params :inherit-props))
 	 (matcher (if tags (cdr (org-make-tags-matcher tags))))
 	 cc range-text st p time level hdl props tsp tbl)
 
@@ -2395,8 +2407,15 @@ TIME:      The sum of all time spend in this tree, in minutes.  This time
 			  (or (cdr (assoc "SCHEDULED" props))
 			      (cdr (assoc "DEADLINE" props))
 			      (cdr (assoc "TIMESTAMP" props))
-			      (cdr (assoc "TIMESTAMP_IA" props)))))
-	      (when (> time 0) (push (list level hdl tsp time) tbl))))))
+			      (cdr (assoc "TIMESTAMP_IA" props))))
+	    props (when properties
+		    (remove nil
+			    (mapcar
+			     (lambda (p)
+			       (when (org-entry-get (point) p inherit-property-p)
+				 (cons p (org-entry-get (point) p inherit-property-p))))
+			     properties))))
+	      (when (> time 0) (push (list level hdl tsp time props) tbl))))))
       (setq tbl (nreverse tbl))
       (list file org-clock-file-total-minutes tbl))))
 

+ 9 - 0
lisp/org-compat.el

@@ -247,6 +247,15 @@ Works on both Emacs and XEmacs."
 	     (> (point) (region-beginning)))
     (exchange-point-and-mark)))
 
+;; Emacs 22 misses `activate-mark'
+(if (fboundp 'activate-mark)
+    (defalias 'org-activate-mark 'activate-mark)
+  (defun org-activate-mark ()
+    (when (mark t)
+      (setq mark-active t)
+      (unless transient-mark-mode
+	(setq transient-mark-mode 'lambda)))))
+
 ;; Invisibility compatibility
 
 (defun org-remove-from-invisibility-spec (arg)

+ 1 - 1
lisp/org-exp.el

@@ -1031,7 +1031,7 @@ Pressing `1' will switch between these two options."
 	  (set-process-sentinel p 'org-export-process-sentinel)
 	  (message "Background process \"%s\": started" p))
       ;; background processing not requested, or not possible
-      (if subtree-p (progn (org-mark-subtree) (activate-mark)))
+      (if subtree-p (progn (org-mark-subtree) (org-activate-mark)))
       (call-interactively (nth 1 ass))
       (when (and bpos (get-buffer-window cbuf))
 	(let ((cw (selected-window)))

+ 1 - 0
lisp/org-footnote.el

@@ -48,6 +48,7 @@
 (declare-function org-end-of-subtree "org"  (&optional invisible-ok to-heading))
 (declare-function org-in-verbatim-emphasis "org" ())
 (declare-function org-inside-latex-macro-p "org" ())
+(declare-function org-id-uuid "org" ())
 (defvar org-odd-levels-only) ;; defined in org.el
 (defvar message-signature-separator) ;; defined in message.el
 

+ 1 - 3
lisp/org-id.el

@@ -151,9 +151,7 @@ This variable is only relevant when `org-id-track-globally' is set."
   :type 'file)
 
 (defvar org-id-locations nil
-  "List of files with IDs in those files.
-Depending on `org-id-use-hash' this can also be a hash table mapping IDs
-to files.")
+  "List of files with IDs in those files.")
 
 (defvar org-id-files nil
   "List of files that contain IDs.")

+ 2 - 0
lisp/org-latex.el

@@ -2443,6 +2443,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 		 (add-text-properties (1- (length footnote-rpl))
 				      (length footnote-rpl)
 				      '(org-protected t) footnote-rpl)
+		 (put-text-property 0 (length footnote-rpl)
+				    'original-indentation 1000 footnote-rpl)
 		 (if (org-on-heading-p)
 		     (setq footnote-rpl
 			   (concat (org-export-latex-protect-string "\\protect")

+ 2 - 1
lisp/org-table.el

@@ -47,6 +47,7 @@
 (defvar orgtbl-mode-menu) ; defined when orgtbl mode get initialized
 (defvar org-export-html-table-tag) ; defined in org-exp.el
 (defvar constants-unit-system)
+(defvar org-table-follow-field-mode)
 
 (defvar orgtbl-after-send-table-hook nil
   "Hook for functions attaching to `C-c C-c', if the table is sent.
@@ -4030,7 +4031,7 @@ overwritten, and the table is not marked as requiring realignment."
 	   (looking-at "[^|\n]*  +|"))
       (let (org-table-may-need-update)
 	(goto-char (1- (match-end 0)))
-	(delete-backward-char 1)
+	(delete-char -1)
 	(goto-char (match-beginning 0))
 	(self-insert-command N))
     (setq org-table-may-need-update t)

+ 6 - 6
lisp/org.el

@@ -13509,6 +13509,11 @@ Being in this list makes sure that they are offered for completion.")
 	  org-property-end-re "\\)\n?")
   "Matches an entire clock drawer.")
 
+(defsubst org-re-property (property)
+  "Return a regexp matching PROPERTY.
+Match group 1 will be set to the value "
+  (concat "^[ \t]*:" (regexp-quote property) ":[ \t]*\\(\\S-.*\\)"))
+
 (defun org-property-action ()
   "Do an action on properties."
   (interactive)
@@ -13976,11 +13981,6 @@ formats in the current buffer."
 
     (sort rtn (lambda (a b) (string< (upcase a) (upcase b))))))
 
-(defsubst org-re-property (property)
-  "Return a regexp matching PROPERTY.
-Match group 1 will be set to the value "
-  (concat "^[ \t]*:" (regexp-quote property) ":[ \t]*\\(\\S-.*\\)"))
-
 (defun org-property-values (key)
   "Return a list of all values of property KEY in the current buffer."
   (save-excursion
@@ -16921,7 +16921,7 @@ overwritten, and the table is not marked as requiring realignment."
      (looking-at "[^|\n]*  |"))
     (let (org-table-may-need-update)
       (goto-char (1- (match-end 0)))
-      (delete-backward-char 1)
+      (delete-char -1)
       (goto-char (match-beginning 0))
       (self-insert-command N)))
    (t