Merge branch 'master' of git://repo.or.cz/org-mode

This commit is contained in:
Dan Davison 2010-07-06 14:28:29 -04:00
commit 8ddb11cfa5
24 changed files with 501 additions and 243 deletions

View File

@ -131,6 +131,7 @@ LISPF = org.el \
ob-sh.el \ ob-sh.el \
ob-R.el \ ob-R.el \
ob-dot.el \ ob-dot.el \
ob-mscgen.el \
ob-latex.el \ ob-latex.el \
ob-python.el \ ob-python.el \
ob-sql.el \ ob-sql.el \

View File

@ -4,7 +4,7 @@
;; Copyright (c) 2010 Free Software Foundation, Inc. ;; Copyright (c) 2010 Free Software Foundation, Inc.
;; ;;
;; Author: Anthony Lander <anthony.lander@gmail.com> ;; Author: Anthony Lander <anthony.lander@gmail.com>
;; Version: 1.0 ;; Version: 1.0.1
;; Keywords: org, mac, hyperlink ;; Keywords: org, mac, hyperlink
;; ;;
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -39,6 +39,7 @@
;; Mail.app - grab links to the selected messages in the message list ;; Mail.app - grab links to the selected messages in the message list
;; AddressBook.app - Grab links to the selected addressbook Cards ;; AddressBook.app - Grab links to the selected addressbook Cards
;; Firefox.app - Grab the url of the frontmost tab in the frontmost window ;; Firefox.app - Grab the url of the frontmost tab in the frontmost window
;; Vimperator/Firefox.app - Grab the url of the frontmost tab in the frontmost window
;; Safari.app - Grab the url of the frontmost tab in the frontmost window ;; Safari.app - Grab the url of the frontmost tab in the frontmost window
;; Google Chrome.app - Grab the url of the frontmost tab in the frontmost window ;; Google Chrome.app - Grab the url of the frontmost tab in the frontmost window
;; Together.app - Grab links to the selected items in the library list ;; Together.app - Grab links to the selected items in the library list
@ -108,6 +109,12 @@ applications and inserting them in org documents"
:group 'org-mac-link-grabber :group 'org-mac-link-grabber
:type 'boolean) :type 'boolean)
(defcustom org-mac-grab-Firefox+Vimperator-p nil
"Enable menu option [v]imperator to grab links from Firefox.app running the Vimperator plugin"
:tag "Grab Vimperator/Firefox.app links"
:group 'org-mac-link-grabber
:type 'boolean)
(defcustom org-mac-grab-Chrome-app-p t (defcustom org-mac-grab-Chrome-app-p t
"Enable menu option [f]irefox to grab links from Google Chrome.app" "Enable menu option [f]irefox to grab links from Google Chrome.app"
:tag "Grab Google Chrome.app links" :tag "Grab Google Chrome.app links"
@ -129,6 +136,7 @@ applications and inserting them in org documents"
("a" "ddressbook" org-mac-addressbook-insert-selected ,org-mac-grab-Addressbook-app-p) ("a" "ddressbook" org-mac-addressbook-insert-selected ,org-mac-grab-Addressbook-app-p)
("s" "afari" org-mac-safari-insert-frontmost-url ,org-mac-grab-Safari-app-p) ("s" "afari" org-mac-safari-insert-frontmost-url ,org-mac-grab-Safari-app-p)
("f" "irefox" org-mac-firefox-insert-frontmost-url ,org-mac-grab-Firefox-app-p) ("f" "irefox" org-mac-firefox-insert-frontmost-url ,org-mac-grab-Firefox-app-p)
("v" "imperator" org-mac-vimperator-insert-frontmost-url ,org-mac-grab-Firefox+Vimperator-p)
("c" "hrome" org-mac-chrome-insert-frontmost-url ,org-mac-grab-Chrome-app-p) ("c" "hrome" org-mac-chrome-insert-frontmost-url ,org-mac-grab-Chrome-app-p)
("t" "ogether" org-mac-together-insert-selected ,org-mac-grab-Together-app-p))) ("t" "ogether" org-mac-together-insert-selected ,org-mac-grab-Together-app-p)))
(menu-string (make-string 0 ?x)) (menu-string (make-string 0 ?x))
@ -231,6 +239,51 @@ applications and inserting them in org documents"
(interactive) (interactive)
(insert (org-mac-firefox-get-frontmost-url))) (insert (org-mac-firefox-get-frontmost-url)))
;; Handle links from Google Firefox.app running the Vimperator extension
;; Grab the frontmost url from Firefox+Vimperator. Same limitations are
;; Firefox
(defun as-mac-vimperator-get-frontmost-url ()
(let ((result (do-applescript
(concat
"set oldClipboard to the clipboard\n"
"set frontmostApplication to path to frontmost application\n"
"tell application \"Firefox\"\n"
" activate\n"
" delay 0.15\n"
" tell application \"System Events\"\n"
" keystroke \"y\"\n"
" end tell\n"
" delay 0.15\n"
" set theUrl to the clipboard\n"
" set the clipboard to oldClipboard\n"
" set theResult to (get theUrl) & \"::split::\" & (get name of window 1)\n"
"end tell\n"
"activate application (frontmostApplication as text)\n"
"set links to {}\n"
"copy theResult to the end of links\n"
"return links as string\n"))))
(replace-regexp-in-string "\s+-\s+Vimperator" "" (car (split-string result "[\r\n]+" t)))))
(defun org-mac-vimperator-get-frontmost-url ()
(interactive)
(message "Applescript: Getting Vimperator url...")
(let* ((url-and-title (as-mac-vimperator-get-frontmost-url))
(split-link (split-string url-and-title "::split::"))
(URL (car split-link))
(description (cadr split-link))
(org-link))
(when (not (string= URL ""))
(setq org-link (org-make-link-string URL description)))
(kill-new org-link)
org-link))
(defun org-mac-vimperator-insert-frontmost-url ()
(interactive)
(insert (org-mac-vimperator-get-frontmost-url)))
;; Handle links from Google Chrome.app ;; Handle links from Google Chrome.app
;; Grab the frontmost url from Google Chrome. Same limitations are ;; Grab the frontmost url from Google Chrome. Same limitations are

View File

@ -3060,7 +3060,7 @@ link and description parts of the link.
Open link at point. This will launch a web browser for URLs (using Open link at point. This will launch a web browser for URLs (using
@command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for
the corresponding links, and execute the command in a shell link. When the the corresponding links, and execute the command in a shell link. When the
cursor is on an internal link, this commands runs the corresponding search. cursor is on an internal link, this command runs the corresponding search.
When the cursor is on a TAG list in a headline, it creates the corresponding When the cursor is on a TAG list in a headline, it creates the corresponding
TAGS view. If the cursor is on a timestamp, it compiles the agenda for that TAGS view. If the cursor is on a timestamp, it compiles the agenda for that
date. Furthermore, it will visit text and remote files in @samp{file:} links date. Furthermore, it will visit text and remote files in @samp{file:} links
@ -11211,13 +11211,14 @@ Code blocks in the following languages are supported.
@item css @tab css @tab ditaa @tab ditaa @item css @tab css @tab ditaa @tab ditaa
@item Graphviz @tab dot @tab Emacs Lisp @tab emacs-lisp @item Graphviz @tab dot @tab Emacs Lisp @tab emacs-lisp
@item gnuplot @tab gnuplot @tab Haskell @tab haskell @item gnuplot @tab gnuplot @tab Haskell @tab haskell
@item Matlab @tab matlab @tab LaTeX @tab latex @item LaTeX @tab latex @tab Matlab @tab matlab
@item Objective Caml @tab ocaml @tab Octave @tab octave @item Mscgen @tab mscgen @tab Objective Caml @tab ocaml
@item OZ @tab oz @tab Perl @tab perl @item Octave @tab octave @tab OZ @tab oz
@item Python @tab python @tab R @tab R @item Perl @tab perl @tab Python @tab python
@item Ruby @tab ruby @tab Sass @tab sass @item R @tab R @tab Ruby @tab ruby
@item GNU Screen @tab screen @tab shell @tab sh @item Sass @tab sass @tab GNU Screen @tab screen
@item SQL @tab sql @tab Sqlite @tab sqlite @item shell @tab sh @tab SQL @tab sql
@item Sqlite @tab sqlite
@end multitable @end multitable
Language specific documentation is available for some languages. If Language specific documentation is available for some languages. If
@ -11411,13 +11412,17 @@ The following header arguments are defined:
@menu @menu
* var:: Pass arguments to code blocks * var:: Pass arguments to code blocks
* results:: Specify the type of results and how they will be collectd and handled * results:: Specify the type of results and how they will
be collectd and handled
* file:: Specify a path for file output * file:: Specify a path for file output
* dir and remote execution:: Specify the default directory for code block execution * dir and remote execution:: Specify the default directory for code block
execution
* exports:: Export code and/or results * exports:: Export code and/or results
* tangle:: Toggle tangling and specify file name * tangle:: Toggle tangling and specify file name
* no-expand:: Turn off variable assignment and noweb expansion during tangling * no-expand:: Turn off variable assignment and noweb
* comments:: Toggle insertion of comments in tangled code files expansion during tangling
* comments:: Toggle insertion of comments in tangled
code files
* session:: Preserve the state of code evaluation * session:: Preserve the state of code evaluation
* noweb:: Toggle expansion of noweb references * noweb:: Toggle expansion of noweb references
* cache:: Avoid re-evaluating unchanged code blocks * cache:: Avoid re-evaluating unchanged code blocks
@ -11425,6 +11430,7 @@ The following header arguments are defined:
* colnames:: Handle column names in tables * colnames:: Handle column names in tables
* rownames:: Handle row names in tables * rownames:: Handle row names in tables
* shebang:: Make tangled files executable * shebang:: Make tangled files executable
* eval:: Limit evaluation of specific code blocks
@end menu @end menu
@node var, results, Specific header arguments, Specific header arguments @node var, results, Specific header arguments, Specific header arguments
@ -12003,7 +12009,7 @@ and is then reapplied to the results.
@end example @end example
@end itemize @end itemize
@node shebang, , rownames, Specific header arguments @node shebang, eval, rownames, Specific header arguments
@subsubsection @code{:shebang} @subsubsection @code{:shebang}
Setting the @code{:shebang} header argument to a string value Setting the @code{:shebang} header argument to a string value
@ -12011,6 +12017,16 @@ Setting the @code{:shebang} header argument to a string value
first line of any tangled file holding the code block, and the file first line of any tangled file holding the code block, and the file
permissions of the tangled file are set to make it executable. permissions of the tangled file are set to make it executable.
@node eval, , shebang, Specific header arguments
@subsubsection @code{:eval}
The @code{:eval} header argument can be used to limit the evaluation of
specific code blocks. @code{:eval} accepts two arguments ``never'' and
``query''. @code{:eval never} will ensure that a code block is never
evaluated, this can be useful for protecting against the evaluation of
dangerous code blocks. @code{:eval query} will require a query for every
execution of a code block regardless of the value of the
@code{org-confirm-babel-evaluate} variable.
@node Results of evaluation, Noweb reference syntax, Header arguments, Working With Source Code @node Results of evaluation, Noweb reference syntax, Header arguments, Working With Source Code
@section Results of evaluation @section Results of evaluation
@cindex code block, results of evaluation @cindex code block, results of evaluation

View File

@ -94,13 +94,10 @@ or `org-babel-execute:c++'."
(cmdline (cdr (assoc :cmdline params))) (cmdline (cdr (assoc :cmdline params)))
(flags (cdr (assoc :flags params))) (flags (cdr (assoc :flags params)))
(full-body (org-babel-C-expand body params)) (full-body (org-babel-C-expand body params))
(error-buf (get-buffer-create "*Org-Babel Error Output*"))
(compile (compile
(progn (progn
(with-temp-file tmp-src-file (insert full-body)) (with-temp-file tmp-src-file (insert full-body))
(with-temp-buffer (org-babel-eval
(org-babel-shell-command-on-region
(point-min) (point-max)
(format "%s -o %s %s %s" (format "%s -o %s %s %s"
(cond (cond
((equal org-babel-c-variant 'c) org-babel-C-compiler) ((equal org-babel-c-variant 'c) org-babel-C-compiler)
@ -108,9 +105,7 @@ or `org-babel-execute:c++'."
tmp-bin-file tmp-bin-file
(mapconcat 'identity (mapconcat 'identity
(if (listp flags) flags (list flags)) " ") (if (listp flags) flags (list flags)) " ")
tmp-src-file) tmp-src-file) ""))))
(current-buffer) 'replace error-buf)))))
(if (= compile 0)
(org-babel-reassemble-table (org-babel-reassemble-table
(org-babel-read (org-babel-read
(org-babel-trim (org-babel-trim
@ -119,13 +114,8 @@ or `org-babel-execute:c++'."
(org-babel-pick-name (org-babel-pick-name
(nth 4 processed-params) (cdr (assoc :colnames params))) (nth 4 processed-params) (cdr (assoc :colnames params)))
(org-babel-pick-name (org-babel-pick-name
(nth 5 processed-params) (cdr (assoc :rownames params)))) (nth 5 processed-params) (cdr (assoc :rownames params))))))
(progn
(with-current-buffer error-buf
(goto-char (point-max))
(insert (concat "\n\n--body--\n" full-body))
(goto-char (point-min)))
(display-buffer error-buf) nil))))
(defun org-babel-C-expand (body params &optional processed-params) (defun org-babel-C-expand (body params &optional processed-params)
"Expand a block of C or C++ code with org-babel according to "Expand a block of C or C++ code with org-babel according to

View File

@ -93,7 +93,7 @@
(defun org-babel-clojure-babel-clojure-cmd () (defun org-babel-clojure-babel-clojure-cmd ()
"Create the command to start clojure according to current settings." "Create the command to start clojure according to current settings."
(if (and (not swank-clojure-binary) (not swank-clojure-classpath)) (if (and (not swank-clojure-binary) (not swank-clojure-classpath))
(error (concat "You must specifiy either a `swank-clojure-binary' " (error "%s" (concat "You must specifiy either a `swank-clojure-binary' "
"or a `swank-clojure-jar-path'")) "or a `swank-clojure-jar-path'"))
(if swank-clojure-binary (if swank-clojure-binary
(if (listp swank-clojure-binary) (if (listp swank-clojure-binary)
@ -269,8 +269,7 @@ repl buffer."
(require 'slime) (require 'swank-clojure) (require 'slime) (require 'swank-clojure)
(let ((raw nil) (let ((raw nil)
(results nil)) (results nil))
(save-window-excursion (with-current-buffer buffer
(set-buffer buffer)
(setq raw (org-babel-clojure-slime-eval-sync body)) (setq raw (org-babel-clojure-slime-eval-sync body))
(setq results (reverse (mapcar #'org-babel-trim raw))) (setq results (reverse (mapcar #'org-babel-trim raw)))
(cond (cond

View File

@ -48,7 +48,7 @@ body inside the protection of `save-window-excursion' and
`(save-excursion `(save-excursion
(save-match-data (save-match-data
(unless (org-babel-comint-buffer-livep ,buffer) (unless (org-babel-comint-buffer-livep ,buffer)
(error (format "buffer %s doesn't exist or has no process" ,buffer))) (error "buffer %s doesn't exist or has no process" ,buffer))
(set-buffer ,buffer) (set-buffer ,buffer)
,@body))) ,@body)))

View File

@ -56,7 +56,7 @@ called by `org-babel-execute-src-block'."
(cmdline (cdr (assoc :cmdline params))) (cmdline (cdr (assoc :cmdline params)))
(in-file (make-temp-file "org-babel-ditaa"))) (in-file (make-temp-file "org-babel-ditaa")))
(unless (file-exists-p org-ditaa-jar-path) (unless (file-exists-p org-ditaa-jar-path)
(error (format "Could not find ditaa.jar at %s" org-ditaa-jar-path))) (error "Could not find ditaa.jar at %s" org-ditaa-jar-path))
(with-temp-file in-file (insert body)) (with-temp-file in-file (insert body))
(message (concat "java -jar " org-ditaa-jar-path " " cmdline " " in-file " " out-file)) (message (concat "java -jar " org-ditaa-jar-path " " cmdline " " in-file " " out-file))
(shell-command (concat "java -jar " org-ditaa-jar-path " " cmdline " " in-file " " out-file)) (shell-command (concat "java -jar " org-ditaa-jar-path " " cmdline " " in-file " " out-file))

View File

@ -40,8 +40,10 @@
;;; Code: ;;; Code:
(require 'ob) (require 'ob)
(require 'ob-eval)
(defvar org-babel-default-header-args:dot '((:results . "file") (:exports . "results")) (defvar org-babel-default-header-args:dot
'((:results . "file") (:exports . "results"))
"Default arguments to use when evaluating a dot source block.") "Default arguments to use when evaluating a dot source block.")
(defun org-babel-expand-body:dot (body params &optional processed-params) (defun org-babel-expand-body:dot (body params &optional processed-params)
@ -57,8 +59,7 @@ called by `org-babel-execute-src-block'."
(cmd (or (cdr (assoc :cmd params)) "dot")) (cmd (or (cdr (assoc :cmd params)) "dot"))
(in-file (make-temp-file "org-babel-dot"))) (in-file (make-temp-file "org-babel-dot")))
(with-temp-file in-file (insert body)) (with-temp-file in-file (insert body))
(message (concat cmd " " in-file " " cmdline " -o " out-file)) (org-babel-eval (concat cmd " " in-file " " cmdline " -o " out-file) "")
(shell-command (concat cmd " " in-file " " cmdline " -o " out-file))
out-file)) out-file))
(defun org-babel-prep-session:dot (session params) (defun org-babel-prep-session:dot (session params)

View File

@ -187,8 +187,7 @@ specifies the value of ERROR-BUFFER."
;; Clear the output buffer, then run the command with ;; Clear the output buffer, then run the command with
;; output there. ;; output there.
(let ((directory default-directory)) (let ((directory default-directory))
(save-current-buffer (with-current-buffer buffer
(set-buffer buffer)
(setq buffer-read-only nil) (setq buffer-read-only nil)
(if (not output-buffer) (if (not output-buffer)
(setq default-directory directory)) (setq default-directory directory))

View File

@ -54,13 +54,12 @@ line. A source block is considered to be a source block function
if the source name is present and is followed by a parenthesized if the source name is present and is followed by a parenthesized
argument list. The parentheses may be empty or contain argument list. The parentheses may be empty or contain
whitespace. An example is the following which generates n random whitespace. An example is the following which generates n random
(uniform) numbers. \(uniform) numbers.
#+source: rand(n) #+source: rand(n)
#+begin_src R #+begin_src R
runif(n) runif(n)
#+end_src #+end_src")
")
(defvar org-babel-function-def-export-indent 4 (defvar org-babel-function-def-export-indent 4
"When exporting a source block function, the block contents "When exporting a source block function, the block contents
@ -99,7 +98,7 @@ none ----- do not display either code or results upon export"
(defun org-babel-exp-inline-src-blocks (start end) (defun org-babel-exp-inline-src-blocks (start end)
"Process inline src blocks between START and END for export. "Process inline src blocks between START and END for export.
See `org-babel-exp-src-blocks' for export options, currently the See `org-babel-exp-src-blocks' for export options, currently the
options and are taken from `org-babel-defualt-inline-header-args'." options and are taken from `org-babel-default-inline-header-args'."
(interactive) (interactive)
(save-excursion (save-excursion
(goto-char start) (goto-char start)

View File

@ -32,7 +32,11 @@
;;; Code: ;;; Code:
(require 'ob) (require 'ob)
(require 'org-latex)
(declare-function org-create-formula-image "org" (string tofile options buffer))
(declare-function org-splice-latex-header "org"
(tpl def-pkg pkg snippets-p &optional extra))
(declare-function org-export-latex-fix-inputenc "org-latex" ())
(add-to-list 'org-babel-tangle-lang-exts '("latex" . "tex")) (add-to-list 'org-babel-tangle-lang-exts '("latex" . "tex"))
@ -51,6 +55,8 @@
body))) (nth 1 (org-babel-process-params params))) body))) (nth 1 (org-babel-process-params params)))
body) body)
(defvar org-format-latex-options)
(defvar org-export-latex-packages-alist)
(defun org-babel-execute:latex (body params) (defun org-babel-execute:latex (body params)
"Execute a block of Latex code with org-babel. This function is "Execute a block of Latex code with org-babel. This function is
called by `org-babel-execute-src-block'." called by `org-babel-execute-src-block'."
@ -74,12 +80,15 @@ called by `org-babel-execute-src-block'."
(when (file-exists-p out-file) (delete-file out-file)) (when (file-exists-p out-file) (delete-file out-file))
(rename-file (org-babel-latex-tex-to-pdf tex-file) out-file)) (rename-file (org-babel-latex-tex-to-pdf tex-file) out-file))
((string-match "\\.\\([^\\.]+\\)$" out-file) ((string-match "\\.\\([^\\.]+\\)$" out-file)
(error (error "can not create %s files, please specify a .png or .pdf file"
(message "can not create %s files, please specify a .png or .pdf file" (match-string 1 out-file))))
(match-string 1 out-file)))))
out-file) out-file)
body)) body))
(defvar org-format-latex-header)
(defvar org-format-latex-header-extra)
(defvar org-export-latex-packages-alist)
(defvar org-export-latex-default-packages-alist)
(defun org-babel-latex-body-to-tex-file (tex-file body &optional height width) (defun org-babel-latex-body-to-tex-file (tex-file body &optional height width)
"Place the contents of BODY into TEX-FILE. Extracted from "Place the contents of BODY into TEX-FILE. Extracted from
`org-create-formula-image' in org.el." `org-create-formula-image' in org.el."
@ -102,6 +111,9 @@ called by `org-babel-execute-src-block'."
"\n\\begin{document}\n" body "\n\\end{document}\n") "\n\\begin{document}\n" body "\n\\end{document}\n")
(org-export-latex-fix-inputenc))) (org-export-latex-fix-inputenc)))
(defvar org-export-pdf-logfiles)
(defvar org-latex-to-pdf-process)
(defvar org-export-pdf-remove-logfiles)
(defun org-babel-latex-tex-to-pdf (tex-file) (defun org-babel-latex-tex-to-pdf (tex-file)
"Generate a pdf according to the contents TEX-FILE. Extracted "Generate a pdf according to the contents TEX-FILE. Extracted
from `org-export-as-pdf' in org-latex.el." from `org-export-as-pdf' in org-latex.el."

90
lisp/ob-mscgen.el Normal file
View File

@ -0,0 +1,90 @@
;;; ob-msc.el --- org-babel functions for mscgen evaluation
;; Copyright (C) 2010 Free Software Foundation, Inc.
;; Author: Juan Pechiar
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org
;; Version: 0.01
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; This software provides EMACS org-babel export support for message
;; sequence charts. The mscgen utility is used for processing the
;; sequence definition, and must therefore be installed in the system.
;;
;; Mscgen is available and documented at
;; http://www.mcternan.me.uk/mscgen/index.html
;;
;; This code is directly inspired by Eric Schulte's ob-dot.el
;;
;; Example:
;;
;; #+begin_src mscgen :file example.png
;; msc {
;; A,B;
;; A -> B [ label = "send message" ];
;; A <- B [ label = "get answer" ];
;; }
;; #+end_src
;;
;; Header for alternative file type:
;;
;; #+begin_src mscgen :file ex2.svg :filetype svg
;; This differs from most standard languages in that
;;
;; 1) there is no such thing as a "session" in mscgen
;; 2) we are generally only going to return results of type "file"
;; 3) we are adding the "file" and "filetype" header arguments
;; 4) there are no variables
;;; Code:
(require 'ob)
(require 'ob-eval)
(defvar org-babel-default-header-args:mscgen
'((:results . "file") (:exports . "results"))
"Default arguments to use when evaluating a mscgen source block.")
(defun org-babel-expand-body:mscgen (body params &optional processed-params)
"Expand BODY according to PARAMS, return the expanded body." body)
(defun org-babel-execute:mscgen (body params)
"Execute a block of Mscgen code with org-babel. This function
is called by `org-babel-execute-src-block'. Default filetype is
png. Modify by setting :filetype parameter to mscgen supported
formats."
(message "executing Mscgen source code block")
(let* ((out-file (or (cdr (assoc :file params)) "output.png" ))
(filetype (or (cdr (assoc :filetype params)) "png" )))
(unless (cdr (assoc :file params))
(error "
ERROR: no output file specified. Add \":file name.png\" to the src header"))
(org-babel-eval (concat "mscgen -T " filetype " -o " out-file) body)
out-file))
(defun org-babel-prep-session:mscgen (session params)
"Prepare SESSION according to PARAMS."
(error "Mscgen does not support sessions"))
(provide 'ob-mscgen)
;; arch-tag: 74695b1e-715f-4b5a-a3a9-d78ee39ba5c8
;;; ob-msc.el ends here

View File

@ -150,8 +150,7 @@ return nil."
;; buffer (marker-buffer id-loc) ;; buffer (marker-buffer id-loc)
;; loc (marker-position id-loc)) ;; loc (marker-position id-loc))
;; (move-marker id-loc nil) ;; (move-marker id-loc nil)
(progn (message (format "reference '%s' not found in this buffer" ref)) (error "reference '%s' not found in this buffer" ref))
(error (format "reference '%s' not found in this buffer" ref))))
(if lob-info (if lob-info
(setq type 'lob) (setq type 'lob)
(while (not (setq type (org-babel-ref-at-ref-p))) (while (not (setq type (org-babel-ref-at-ref-p)))

View File

@ -171,14 +171,18 @@ any confirmation from the user.
Note disabling confirmation may result in accidental evaluation Note disabling confirmation may result in accidental evaluation
of potentially harmful code." of potentially harmful code."
(unless (or (not (if (functionp org-confirm-babel-evaluate) (let* ((eval (cdr (assoc :eval (nth 2 info))))
(query (or (equal eval "query")
(and (functionp org-confirm-babel-evaluate)
(funcall org-confirm-babel-evaluate (funcall org-confirm-babel-evaluate
(nth 0 info) (nth 1 info)) (nth 0 info) (nth 1 info)))
org-confirm-babel-evaluate)) org-confirm-babel-evaluate)))
(yes-or-no-p (when (or (equal eval "never")
(and query
(not (yes-or-no-p
(format "Evaluate this%scode on your system? " (format "Evaluate this%scode on your system? "
(if info (format " %s " (nth 0 info)) " ")))) (if info (format " %s " (nth 0 info)) " "))))))
(error "evaluation aborted"))) (error "evaluation aborted"))))
;;;###autoload ;;;###autoload
(defun org-babel-execute-src-block-maybe () (defun org-babel-execute-src-block-maybe ()
@ -1319,9 +1323,8 @@ block but are passed literally to the \"example-block\"."
(nb-add (buffer-substring index (point))) (nb-add (buffer-substring index (point)))
(goto-char (match-end 0)) (goto-char (match-end 0))
(setq index (point)) (setq index (point))
(nb-add (save-current-buffer (nb-add (with-current-buffer parent-buffer
(set-buffer parent-buffer) (mapconcat ;; interpose PREFIX between every line
(mapconcat ;; interpose `prefix' between every line
#'identity #'identity
(split-string (split-string
(if evaluate (if evaluate
@ -1330,7 +1333,8 @@ block but are passed literally to the \"example-block\"."
(if (stringp raw) raw (format "%S" raw))) (if (stringp raw) raw (format "%S" raw)))
(save-restriction (save-restriction
(widen) (widen)
(let ((point (org-babel-find-named-block source-name))) (let ((point (org-babel-find-named-block
source-name)))
(if point (if point
(save-excursion (save-excursion
(goto-char point) (goto-char point)
@ -1340,10 +1344,11 @@ block but are passed literally to the \"example-block\"."
;; optionally raise an error if named ;; optionally raise an error if named
;; source-block doesn't exist ;; source-block doesn't exist
(if (member lang org-babel-noweb-error-langs) (if (member lang org-babel-noweb-error-langs)
(error (error "%s"
(concat "<<%s>> could not be resolved " (concat
"(see `org-babel-noweb-error-langs')") "<<" source-name ">> "
source-name) "could not be resolved (see "
"`org-babel-noweb-error-langs')"))
""))))) "")))))
"[\n\r]") (concat "\n" prefix))))) "[\n\r]") (concat "\n" prefix)))))
(nb-add (buffer-substring index (point-max))))) (nb-add (buffer-substring index (point-max)))))

View File

@ -7489,11 +7489,12 @@ The prefix arg is passed through to the command if possible."
"Refile to: " "Refile to: "
(marker-buffer (car org-agenda-bulk-marked-entries)) (marker-buffer (car org-agenda-bulk-marked-entries))
org-refile-allow-creating-parent-nodes)) org-refile-allow-creating-parent-nodes))
(if (nth 3 rfloc)
(setcar (nthcdr 3 rfloc) (setcar (nthcdr 3 rfloc)
(move-marker (make-marker) (nth 3 rfloc) (move-marker (make-marker) (nth 3 rfloc)
(or (get-file-buffer (nth 1 rfloc)) (or (get-file-buffer (nth 1 rfloc))
(find-buffer-visiting (nth 1 rfloc)) (find-buffer-visiting (nth 1 rfloc))
(error "This should not happen")))) (error "This should not happen")))))
(setq cmd (list 'org-agenda-refile nil (list 'quote rfloc) t) (setq cmd (list 'org-agenda-refile nil (list 'quote rfloc) t)
redo-at-end t)) redo-at-end t))

View File

@ -387,11 +387,12 @@ the value will be inserted right after the documentclass statement."
org-beamer-header-extra) org-beamer-header-extra)
(goto-char (point-min)) (goto-char (point-min))
(cond (cond
((re-search-forward "^[ \t]*BEAMER-HEADER-EXTRA-HERE[ \t]*$" nil t) ((re-search-forward
"^[ \t]*\\[?BEAMER-HEADER-EXTRA\\(-HERE\\)?\\]?[ \t]*$" nil t)
(replace-match org-beamer-header-extra t t) (replace-match org-beamer-header-extra t t)
(or (bolp) (insert "\n"))) (or (bolp) (insert "\n")))
((re-search-forward "^[ \t]*\\\\documentclass\\>" nil t) ((re-search-forward "^[ \t]*\\\\begin{document}" nil t)
(beginning-of-line 2) (beginning-of-line 1)
(insert org-beamer-header-extra) (insert org-beamer-header-extra)
(or (bolp) (insert "\n")))))) (or (bolp) (insert "\n"))))))

View File

@ -145,7 +145,13 @@ target Specification of where the captured item should be placed.
template The template for creating the capture item. If you leave this template The template for creating the capture item. If you leave this
empty, an appropriate default template will be used. See below empty, an appropriate default template will be used. See below
for more details. for more details. Instead of a string, this may also be one of
(file \"/path/to/template-file\")
(function function-returning-the-template)
in order to get a template from a file, or dynamically
from a function.
The rest of the entry is a property list of additional options. Recognized The rest of the entry is a property list of additional options. Recognized
properties are: properties are:
@ -274,7 +280,14 @@ calendar | %:type %:date"
(list :tag "Function" (list :tag "Function"
(const :format "" function) (const :format "" function)
(sexp :tag " Function"))) (sexp :tag " Function")))
(string :tag "Template (opt) ") (choice :tag "Template"
(string)
(list :tag "File"
(const :format "" file-contents)
(file :tag "Template file"))
(list :tag "Function"
(const :format "" function)
(file :tag "Template function")))
(plist :inline t (plist :inline t
;; Give the most common options as checkboxes ;; Give the most common options as checkboxes
:options (((const :format "%v " :prepend) (const t)) :options (((const :format "%v " :prepend) (const t))
@ -372,6 +385,7 @@ bypassed."
(error "Abort")) (error "Abort"))
(t (t
(org-capture-set-plist entry) (org-capture-set-plist entry)
(org-capture-get-template)
(org-capture-put :original-buffer orig-buf :annotation annotation (org-capture-put :original-buffer orig-buf :annotation annotation
:initial initial) :initial initial)
(org-capture-put :default-time (org-capture-put :default-time
@ -411,6 +425,25 @@ bypassed."
(error (error
"Could not start the clock in this capture buffer"))))))))))) "Could not start the clock in this capture buffer")))))))))))
(defun org-capture-get-template ()
"Get the template from a file or a function if necessary."
(let ((txt (org-capture-get :template)) file)
(cond
((and (listp txt) (eq (car txt) 'file))
(if (file-exists-p
(setq file (expand-file-name (nth 1 txt) org-directory)))
(setq txt (org-file-contents file))
(setq txt (format "* Template file %s not found" (nth 1 txt)))))
((and (listp txt) (eq (car txt) 'function))
(if (fboundp (nth 1 txt))
(setq txt (funcall (nth 1 txt)))
(setq txt (format "* Template function %s not found" (nth 1 txt)))))
((not txt) (setq txt ""))
((stringp txt))
(t (setq txt "* Invalid capture template")))
(org-capture-put :template txt)))
(defun org-capture-finalize () (defun org-capture-finalize ()
"Finalize the capture process." "Finalize the capture process."
(interactive) (interactive)
@ -501,7 +534,9 @@ already gone."
(unless (eq (org-capture-get :type 'local) 'entry) (unless (eq (org-capture-get :type 'local) 'entry)
(error (error
"Refiling from a capture buffer makes only sense for `entry'-type templates")) "Refiling from a capture buffer makes only sense for `entry'-type templates"))
(let ((pos (point)) (base (buffer-base-buffer (current-buffer)))) (let ((pos (point))
(base (buffer-base-buffer (current-buffer)))
(org-refile-for-capture t))
(org-capture-finalize) (org-capture-finalize)
(save-window-excursion (save-window-excursion
(with-current-buffer (or base (current-buffer)) (with-current-buffer (or base (current-buffer))
@ -509,7 +544,16 @@ already gone."
(save-restriction (save-restriction
(widen) (widen)
(goto-char pos) (goto-char pos)
(call-interactively 'org-refile))))))) (call-interactively 'org-refile)
(when (and (boundp 'bookmark-alist)
(assoc "org-capture-last-stored" bookmark-alist))
(if (assoc "org-refile-last-stored" bookmark-alist)
(setcdr (assoc "org-refile-last-stored" bookmark-alist)
(cdr (assoc "org-refile-last-stored" bookmark-alist)))
(push (cons "org-capture-last-stored"
(cdr (assoc "org-refile-last-stored"
bookmark-alist)))
bookmark-alist)))))))))
(defun org-capture-kill () (defun org-capture-kill ()
"Abort the current capture process." "Abort the current capture process."
@ -646,7 +690,8 @@ already gone."
(let* ((txt (org-capture-get :template)) (let* ((txt (org-capture-get :template))
(reversed (org-capture-get :prepend)) (reversed (org-capture-get :prepend))
(target-entry-p (org-capture-get :target-entry-p)) (target-entry-p (org-capture-get :target-entry-p))
level beg end) level beg end file)
(cond (cond
((org-capture-get :exact-position) ((org-capture-get :exact-position)
(goto-char (org-capture-get :exact-position))) (goto-char (org-capture-get :exact-position)))

View File

@ -89,6 +89,30 @@ any other entries, and any resulting duplicates will be removed entirely."
(t specs))) (t specs)))
(put 'org-compatible-face 'lisp-indent-function 1) (put 'org-compatible-face 'lisp-indent-function 1)
(defun org-version-check (version feature level)
(let* ((v1 (mapcar 'string-to-number (split-string version "[.]")))
(v2 (mapcar 'string-to-number (split-string emacs-version "[.]")))
(rmaj (or (nth 0 v1) 99))
(rmin (or (nth 1 v1) 99))
(rbld (or (nth 2 v1) 99))
(maj (or (nth 0 v2) 0))
(min (or (nth 1 v2) 0))
(bld (or (nth 2 v2) 0)))
(if (or (< maj rmaj)
(and (= maj rmaj)
(< min rmin))
(and (= maj rmaj)
(= min rmin)
(< bld rbld)))
(if (eq level :predicate)
;; just return if we have the version
nil
(let ((msg (format "Emacs %s or greater is recommended for %s"
version feature)))
(display-warning 'org msg level)
t))
t)))
;;;; Emacs/XEmacs compatibility ;;;; Emacs/XEmacs compatibility
;; Keys ;; Keys

View File

@ -1,9 +1,9 @@
;;; org-ctags.el - Integrate Emacs "tags" facility with org mode. ;;; org-ctags.el - Integrate Emacs "tags" facility with org mode.
;;; ;;
;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;;; Author: Paul Sexton <eeeickythump@gmail.com> ;; Author: Paul Sexton <eeeickythump@gmail.com>
;;; Version: 1.0 ;; Version: 1.0
;; Keywords: org, wp ;; Keywords: org, wp
;; Version: 6.36trans ;; Version: 6.36trans
@ -23,116 +23,116 @@
;; You should have received a copy of the GNU General Public License ;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; ;;
;;; Synopsis ;; Synopsis
;;; ======== ;; ========
;;; ;;
;;; Allows org-mode to make use of the Emacs `etags' system. Defines tag ;; Allows org-mode to make use of the Emacs `etags' system. Defines tag
;;; destinations in org-mode files as any text between <<double angled ;; destinations in org-mode files as any text between <<double angled
;;; brackets>>. This allows the tags-generation program `exuberant ctags' to ;; brackets>>. This allows the tags-generation program `exuberant ctags' to
;;; parse these files and create tag tables that record where these ;; parse these files and create tag tables that record where these
;;; destinations are found. Plain [[links]] in org mode files which do not have ;; destinations are found. Plain [[links]] in org mode files which do not have
;;; <<matching destinations>> within the same file will then be interpreted as ;; <<matching destinations>> within the same file will then be interpreted as
;;; links to these 'tagged' destinations, allowing seamless navigation between ;; links to these 'tagged' destinations, allowing seamless navigation between
;;; multiple org-mode files. Topics can be created in any org mode file and ;; multiple org-mode files. Topics can be created in any org mode file and
;;; will always be found by plain links from other files. Other file types ;; will always be found by plain links from other files. Other file types
;;; recognised by ctags (source code files, latex files, etc) will also be ;; recognised by ctags (source code files, latex files, etc) will also be
;;; available as destinations for plain links, and similarly, org-mode links ;; available as destinations for plain links, and similarly, org-mode links
;;; will be available as tags from source files. Finally, the function ;; will be available as tags from source files. Finally, the function
;;; `org-ctags-find-tag-interactive' lets you choose any known tag, using ;; `org-ctags-find-tag-interactive' lets you choose any known tag, using
;;; autocompletion, and quickly jump to it. ;; autocompletion, and quickly jump to it.
;;; ;;
;;; Installation ;; Installation
;;; ============ ;; ============
;;; ;;
;;; Install org mode ;; Install org mode
;;; Ensure org-ctags.el is somewhere in your emacs load path. ;; Ensure org-ctags.el is somewhere in your emacs load path.
;;; Download and install Exuberant ctags -- "http://ctags.sourceforge.net/" ;; Download and install Exuberant ctags -- "http://ctags.sourceforge.net/"
;;; Edit your .emacs file (see next section) and load emacs. ;; Edit your .emacs file (see next section) and load emacs.
;;; To put in your init file (.emacs): ;; To put in your init file (.emacs):
;;; ================================== ;; ==================================
;;; ;;
;;; Assuming you already have org mode installed and set up: ;; Assuming you already have org mode installed and set up:
;;; ;;
;;; (setq org-ctags-path-to-ctags "/path/to/ctags/executable") ;; (setq org-ctags-path-to-ctags "/path/to/ctags/executable")
;;; (add-hook 'org-mode-hook ;; (add-hook 'org-mode-hook
;;; (lambda () ;; (lambda ()
;;; (define-key org-mode-map "\C-co" 'org-ctags-find-tag-interactive))) ;; (define-key org-mode-map "\C-co" 'org-ctags-find-tag-interactive)))
;;; ;;
;;; By default, with org-ctags loaded, org will first try and visit the tag ;; By default, with org-ctags loaded, org will first try and visit the tag
;;; with the same name as the link; then, if unsuccessful, ask the user if ;; with the same name as the link; then, if unsuccessful, ask the user if
;;; he/she wants to rebuild the 'TAGS' database and try again; then ask if ;; he/she wants to rebuild the 'TAGS' database and try again; then ask if
;;; the user wishes to append 'tag' as a new toplevel heading at the end of ;; the user wishes to append 'tag' as a new toplevel heading at the end of
;;; the buffer; and finally, defer to org's default behaviour which is to ;; the buffer; and finally, defer to org's default behaviour which is to
;;; search the entire text of the current buffer for 'tag'. ;; search the entire text of the current buffer for 'tag'.
;;; ;;
;;; This behaviour can be modified by changing the value of ;; This behaviour can be modified by changing the value of
;;; ORG-CTAGS-OPEN-LINK-FUNCTIONS. For example I have the following in my ;; ORG-CTAGS-OPEN-LINK-FUNCTIONS. For example I have the following in my
;;; .emacs, which describes the same behaviour as the above paragraph with ;; .emacs, which describes the same behaviour as the above paragraph with
;;; one difference: ;; one difference:
;;; ;;
;;; (setq org-ctags-open-link-functions ;; (setq org-ctags-open-link-functions
;;; '(org-ctags-find-tag ;; '(org-ctags-find-tag
;;; org-ctags-ask-rebuild-tags-file-then-find-tag ;; org-ctags-ask-rebuild-tags-file-then-find-tag
;;; org-ctags-ask-append-topic ;; org-ctags-ask-append-topic
;;; org-ctags-fail-silently)) ; <-- prevents org default behaviour ;; org-ctags-fail-silently)) ; <-- prevents org default behaviour
;;; ;;
;;; ;;
;;; Usage ;; Usage
;;; ===== ;; =====
;;; ;;
;;; When you click on a link "[[foo]]" and org cannot find a matching "<<foo>>" ;; When you click on a link "[[foo]]" and org cannot find a matching "<<foo>>"
;;; in the current buffer, the tags facility will take over. The file TAGS in ;; in the current buffer, the tags facility will take over. The file TAGS in
;;; the active directory is examined to see if the tags facility knows about ;; the active directory is examined to see if the tags facility knows about
;;; "<<foo>>" in any other files. If it does, the matching file will be opened ;; "<<foo>>" in any other files. If it does, the matching file will be opened
;;; and the cursor will jump to the position of "<<foo>>" in that file. ;; and the cursor will jump to the position of "<<foo>>" in that file.
;;; ;;
;;; User-visible functions: ;; User-visible functions:
;;; - `org-ctags-find-tag-interactive': type a tag (plain link) name and visit ;; - `org-ctags-find-tag-interactive': type a tag (plain link) name and visit
;;; it. With autocompletion. Bound to ctrl-O in the above setup. ;; it. With autocompletion. Bound to ctrl-O in the above setup.
;;; - All the etags functions should work. These include: ;; - All the etags functions should work. These include:
;;; ;;
;;; M-. `find-tag' -- finds the tag at point ;; M-. `find-tag' -- finds the tag at point
;;; ;;
;;; C-M-. find-tag based on regular expression ;; C-M-. find-tag based on regular expression
;;; ;;
;;; M-x tags-search RET -- like C-M-. but searches through ENTIRE TEXT ;; M-x tags-search RET -- like C-M-. but searches through ENTIRE TEXT
;;; of ALL the files referenced in the TAGS file. A quick way to ;; of ALL the files referenced in the TAGS file. A quick way to
;;; search through an entire 'project'. ;; search through an entire 'project'.
;;; ;;
;;; M-* "go back" from a tag jump. Like `org-mark-ring-goto'. ;; M-* "go back" from a tag jump. Like `org-mark-ring-goto'.
;;; You may need to bind this key yourself with (eg) ;; You may need to bind this key yourself with (eg)
;;; (global-set-key (kbd "<M-kp-multiply>") 'pop-tag-mark) ;; (global-set-key (kbd "<M-kp-multiply>") 'pop-tag-mark)
;;; ;;
;;; (see etags chapter in Emacs manual for more) ;; (see etags chapter in Emacs manual for more)
;;; ;;
;;; ;;
;;; Keeping the TAGS file up to date ;; Keeping the TAGS file up to date
;;; ================================ ;; ================================
;;; ;;
;;; Tags mode has no way of knowing that you have created new tags by typing in ;; Tags mode has no way of knowing that you have created new tags by typing in
;;; your org-mode buffer. New tags make it into the TAGS file in 3 ways: ;; your org-mode buffer. New tags make it into the TAGS file in 3 ways:
;;; ;;
;;; 1. You re-run (org-ctags-create-tags "directory") to rebuild the file. ;; 1. You re-run (org-ctags-create-tags "directory") to rebuild the file.
;;; 2. You put the function `org-ctags-ask-rebuild-tags-file-then-find-tag' in ;; 2. You put the function `org-ctags-ask-rebuild-tags-file-then-find-tag' in
;;; your `org-open-link-functions' list, as is done in the setup ;; your `org-open-link-functions' list, as is done in the setup
;;; above. This will cause the TAGS file to be rebuilt whenever a link ;; above. This will cause the TAGS file to be rebuilt whenever a link
;;; cannot be found. This may be slow with large file collections however. ;; cannot be found. This may be slow with large file collections however.
;;; 3. You run the following from the command line (all 1 line): ;; 3. You run the following from the command line (all 1 line):
;;; ;;
;;; ctags --langdef=orgmode --langmap=orgmode:.org ;; ctags --langdef=orgmode --langmap=orgmode:.org
;;; --regex-orgmode="/<<([^>]+)>>/\1/d,definition/" ;; --regex-orgmode="/<<([^>]+)>>/\1/d,definition/"
;;; -f /your/path/TAGS -e -R /your/path/*.org ;; -f /your/path/TAGS -e -R /your/path/*.org
;;; ;;
;;; If you are paranoid, you might want to run (org-ctags-create-tags ;; If you are paranoid, you might want to run (org-ctags-create-tags
;;; "/path/to/org/files") at startup, by including the following toplevel form ;; "/path/to/org/files") at startup, by including the following toplevel form
;;; in .emacs. However this can cause a pause of several seconds if ctags has ;; in .emacs. However this can cause a pause of several seconds if ctags has
;;; to scan lots of files. ;; to scan lots of files.
;;; ;;
;;; (progn ;; (progn
;;; (message "-- rebuilding tags tables...") ;; (message "-- rebuilding tags tables...")
;;; (mapc 'org-create-tags tags-table-list)) ;; (mapc 'org-create-tags tags-table-list))
(eval-when-compile (require 'cl)) (eval-when-compile (require 'cl))
(require 'org) (require 'org)
@ -219,7 +219,7 @@ The following patterns are replaced in the string:
;;; General utility functions. =============================================== ;;; General utility functions. ===============================================
;;; These work outside org-ctags mode. ;; These work outside org-ctags mode.
(defun org-ctags-get-filename-for-tag (tag) (defun org-ctags-get-filename-for-tag (tag)
"TAG is a string. Search the active TAGS file for a matching tag, "TAG is a string. Search the active TAGS file for a matching tag,
@ -535,5 +535,5 @@ a new topic."
(provide 'org-ctags) (provide 'org-ctags)
;;; arch-tag: 4b1ddd5a-8529-4b17-bcde-96a922d26343 ;; arch-tag: 4b1ddd5a-8529-4b17-bcde-96a922d26343
;;; org-ctags.el ends here ;;; org-ctags.el ends here

View File

@ -227,7 +227,9 @@ passed to the ditaa utility as command line arguments."
(message "ditaa-formatting...") (message "ditaa-formatting...")
(let* ((args (if (cdr headers) (mapconcat 'identity (cdr headers) " "))) (let* ((args (if (cdr headers) (mapconcat 'identity (cdr headers) " ")))
(data-file (make-temp-file "org-ditaa")) (data-file (make-temp-file "org-ditaa"))
(hash (sha1 (prin1-to-string (list body args)))) (hash (progn
(set-text-properties 0 (length body) nil body)
(sha1 (prin1-to-string (list body args)))))
(raw-out-file (if headers (car headers))) (raw-out-file (if headers (car headers)))
(out-file-parts (if (string-match "\\(.+\\)\\.\\([^\\.]+\\)$" raw-out-file) (out-file-parts (if (string-match "\\(.+\\)\\.\\([^\\.]+\\)$" raw-out-file)
(cons (match-string 1 raw-out-file) (cons (match-string 1 raw-out-file)
@ -287,7 +289,9 @@ digraph data_relationships {
(message "dot-formatting...") (message "dot-formatting...")
(let* ((args (if (cdr headers) (mapconcat 'identity (cdr headers) " "))) (let* ((args (if (cdr headers) (mapconcat 'identity (cdr headers) " ")))
(data-file (make-temp-file "org-ditaa")) (data-file (make-temp-file "org-ditaa"))
(hash (sha1 (prin1-to-string (list body args)))) (hash (progn
(set-text-properties 0 (length body) nil body)
(sha1 (prin1-to-string (list body args)))))
(raw-out-file (if headers (car headers))) (raw-out-file (if headers (car headers)))
(out-file-parts (if (string-match "\\(.+\\)\\.\\([^\\.]+\\)$" raw-out-file) (out-file-parts (if (string-match "\\(.+\\)\\.\\([^\\.]+\\)$" raw-out-file)
(cons (match-string 1 raw-out-file) (cons (match-string 1 raw-out-file)

View File

@ -130,10 +130,11 @@ FIXME: How to update when broken?"
(cond (cond
((org-bound-and-true-p org-inhibit-startup) ((org-bound-and-true-p org-inhibit-startup)
(setq org-indent-mode nil)) (setq org-indent-mode nil))
((and org-indent-mode (featurep 'xemacs))
(message "org-indent-mode does not work in XEmacs - refused to turn it on")
(setq org-indent-mode nil))
((and org-indent-mode ((and org-indent-mode
(or (< emacs-major-version 23) (not (org-version-check "23.1.50" "Org Indent mode" :predicate)))
(and (= emacs-major-version 23)
(< emacs-minor-version 2))))
(message "org-indent-mode is can crash Emacs 23.1 - refused to turn it on!") (message "org-indent-mode is can crash Emacs 23.1 - refused to turn it on!")
(ding) (ding)
(sit-for 1) (sit-for 1)

View File

@ -148,6 +148,7 @@ class, you can use the following macro-like placeholders.
[NO-PACKAGES] do not include the packages [NO-PACKAGES] do not include the packages
[EXTRA] the stuff from #+LaTeX_HEADER [EXTRA] the stuff from #+LaTeX_HEADER
[NO-EXTRA] do not include #+LaTeX_HEADER stuff [NO-EXTRA] do not include #+LaTeX_HEADER stuff
[BEAMER-HEADER-EXTRA] the beamer extra headers
So a header like So a header like
@ -415,6 +416,11 @@ and `org-export-with-tags' instead."
:group 'org-export-latex :group 'org-export-latex
:type 'string) :type 'string)
(defcustom org-export-latex-tabular-environment "tabular"
"Default environment used to build tables."
:group 'org-export-latex
:type 'string)
(defcustom org-export-latex-inline-image-extensions (defcustom org-export-latex-inline-image-extensions
'("pdf" "jpeg" "jpg" "png" "ps" "eps") '("pdf" "jpeg" "jpg" "png" "ps" "eps")
"Extensions of image files that can be inlined into LaTeX. "Extensions of image files that can be inlined into LaTeX.
@ -1660,7 +1666,9 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
(if (and longtblp caption) "\\\\\n" "\n") (if (and longtblp caption) "\\\\\n" "\n")
(if (and org-export-latex-tables-centered (not longtblp)) (if (and org-export-latex-tables-centered (not longtblp))
"\\begin{center}\n") "\\begin{center}\n")
(if (not longtblp) (concat "\\begin{tabular}{" align "}\n")) (if (not longtblp)
(format "\\begin{%s}{%s}\n"
org-export-latex-tabular-environment align))
(orgtbl-to-latex (orgtbl-to-latex
lines lines
`(:tstart nil :tend nil `(:tstart nil :tend nil
@ -1672,7 +1680,9 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
\\endfoot \\endfoot
\\endlastfoot" (length org-table-last-alignment)) \\endlastfoot" (length org-table-last-alignment))
nil))) nil)))
(if (not longtblp) (concat "\n\\end{tabular}")) (if (not longtblp)
(format "\n\\end{%s}"
org-export-latex-tabular-environment))
(if longtblp "\n" (if org-export-latex-tables-centered (if longtblp "\n" (if org-export-latex-tables-centered
"\n\\end{center}\n" "\n")) "\n\\end{center}\n" "\n"))
(if longtblp (if longtblp

View File

@ -466,7 +466,7 @@ matching filenames."
;; [[info:org:Selecting%20files]] shows how this is supposed to work: ;; [[info:org:Selecting%20files]] shows how this is supposed to work:
(let* ((r (plist-get (cdr prj) :recursive)) (let* ((r (plist-get (cdr prj) :recursive))
(b (expand-file-name (plist-get (cdr prj) :base-directory))) (b (expand-file-name (plist-get (cdr prj) :base-directory)))
(x (plist-get (cdr prj) :base-extension)) (x (or (plist-get (cdr prj) :base-extension) "org"))
(e (plist-get (cdr prj) :exclude)) (e (plist-get (cdr prj) :exclude))
(i (plist-get (cdr prj) :include)) (i (plist-get (cdr prj) :include))
(xm (concat "^" b (if r ".+" "[^/]+") "\\.\\(" x "\\)$"))) (xm (concat "^" b (if r ".+" "[^/]+") "\\.\\(" x "\\)$")))

View File

@ -164,6 +164,7 @@ default only Emacs Lisp (which has no requirements) is loaded."
(const :tag "Haskell" haskell) (const :tag "Haskell" haskell)
(const :tag "Latex" latex) (const :tag "Latex" latex)
(const :tag "Matlab" matlab) (const :tag "Matlab" matlab)
(const :tag "Mscgen" mscgen)
(const :tag "Ocaml" ocaml) (const :tag "Ocaml" ocaml)
(const :tag "Octave" octave) (const :tag "Octave" octave)
(const :tag "Perl" perl) (const :tag "Perl" perl)
@ -3571,7 +3572,9 @@ outside the table.")
org-table-rotate-recalc-marks org-table-sort-lines org-table-sum org-table-rotate-recalc-marks org-table-sort-lines org-table-sum
org-table-toggle-coordinate-overlays org-table-toggle-coordinate-overlays
org-table-toggle-formula-debugger org-table-wrap-region org-table-toggle-formula-debugger org-table-wrap-region
orgtbl-mode turn-on-orgtbl org-table-to-lisp))) orgtbl-mode turn-on-orgtbl org-table-to-lisp
orgtbl-to-generic orgtbl-to-tsv orgtbl-to-csv orgtbl-to-latex
orgtbl-to-orgtbl orgtbl-to-html orgtbl-to-texinfo)))
(defun org-at-table-p (&optional table-type) (defun org-at-table-p (&optional table-type)
"Return t if the cursor is inside an org-type table. "Return t if the cursor is inside an org-type table.
@ -10019,6 +10022,7 @@ such as the file name."
Note that this is still *before* the stuff will be removed from Note that this is still *before* the stuff will be removed from
the *old* location.") the *old* location.")
(defvar org-capture-last-stored-marker)
(defun org-refile (&optional goto default-buffer rfloc) (defun org-refile (&optional goto default-buffer rfloc)
"Move the entry at point to another heading. "Move the entry at point to another heading.
The list of target headings is compiled using the information in The list of target headings is compiled using the information in
@ -10139,6 +10143,11 @@ This can be done with a 0 prefix: `C-0 C-c C-w'"
(save-excursion (org-add-log-note)))) (save-excursion (org-add-log-note))))
(and org-auto-align-tags (org-set-tags nil t)) (and org-auto-align-tags (org-set-tags nil t))
(bookmark-set "org-refile-last-stored") (bookmark-set "org-refile-last-stored")
;; If we are refiling for capture, make sure that the
;; last-capture pointers point here
(when (org-bound-and-true-p org-refile-for-capture)
(bookmark-set "org-refile-last-stored")
(move-marker org-capture-last-stored-marker (point)))
(if (fboundp 'deactivate-mark) (deactivate-mark)) (if (fboundp 'deactivate-mark) (deactivate-mark))
(run-hooks 'org-after-refile-insert-hook)))) (run-hooks 'org-after-refile-insert-hook))))
(if regionp (if regionp
@ -14813,17 +14822,16 @@ If there is a specifyer for a cyclic time stamp, get the closest date to
DAYNR. DAYNR.
PREFER and SHOW-ALL are passed through to `org-closest-date'. PREFER and SHOW-ALL are passed through to `org-closest-date'.
the variable date is bound by the calendar when this is called." the variable date is bound by the calendar when this is called."
(let ((today (calendar-absolute-from-gregorian (calendar-current-date))))
(cond (cond
((and daynr (string-match "\\`%%\\((.*)\\)" s)) ((and daynr (string-match "\\`%%\\((.*)\\)" s))
(if (org-diary-sexp-entry (match-string 1 s) "" date) (if (org-diary-sexp-entry (match-string 1 s) "" date)
daynr daynr
(+ daynr 1000))) (+ daynr 1000)))
((and daynr (not (eq daynr today)) (string-match "\\+[0-9]+[dwmy]" s)) ((and daynr (string-match "\\+[0-9]+[dwmy]" s))
(org-closest-date s (if (and (boundp 'daynr) (integerp daynr)) daynr (org-closest-date s (if (and (boundp 'daynr) (integerp daynr)) daynr
(time-to-days (current-time))) (match-string 0 s) (time-to-days (current-time))) (match-string 0 s)
prefer show-all)) prefer show-all))
(t (time-to-days (apply 'encode-time (org-parse-time-string s))))))) (t (time-to-days (apply 'encode-time (org-parse-time-string s))))))
(defun org-days-to-iso-week (days) (defun org-days-to-iso-week (days)
"Return the iso week number." "Return the iso week number."