0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-25 16:02:52 +00:00

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

This commit is contained in:
David Arroyo Menendez 2014-04-23 20:28:21 +02:00
commit 7bfdadc601
11 changed files with 53 additions and 51 deletions

View file

@ -2,6 +2,7 @@
#+TITLE: Org maintainer tasks #+TITLE: Org maintainer tasks
#+STARTUP: noindent #+STARTUP: noindent
#+OPTIONS: ^:nil
This document describes the tasks the Org-mode maintainer has to do This document describes the tasks the Org-mode maintainer has to do
and how they are performed. and how they are performed.

View file

@ -96,7 +96,7 @@ this variable.")
(defun org-babel-expand-body:R (body params &optional graphics-file) (defun org-babel-expand-body:R (body params &optional graphics-file)
"Expand BODY according to PARAMS, return the expanded body." "Expand BODY according to PARAMS, return the expanded body."
(let ((graphics-file (let ((graphics-file
(or graphics-file (org-babel-R-graphical-output-file params)))) (or graphics-file (org-babel-graphical-output-file params))))
(mapconcat #'identity (mapconcat #'identity
(append (append
(when (cdr (assoc :prologue params)) (when (cdr (assoc :prologue params))
@ -117,7 +117,7 @@ This function is called by `org-babel-execute-src-block'."
(cdr (assoc :session params)) params)) (cdr (assoc :session params)) params))
(colnames-p (cdr (assoc :colnames params))) (colnames-p (cdr (assoc :colnames params)))
(rownames-p (cdr (assoc :rownames params))) (rownames-p (cdr (assoc :rownames params)))
(graphics-file (org-babel-R-graphical-output-file params)) (graphics-file (org-babel-graphical-output-file params))
(full-body (full-body
(let ((inside (let ((inside
(list (org-babel-expand-body:R body params graphics-file)))) (list (org-babel-expand-body:R body params graphics-file))))
@ -251,11 +251,6 @@ current code buffer."
(process-name (get-buffer-process session))) (process-name (get-buffer-process session)))
(ess-make-buffer-current)) (ess-make-buffer-current))
(defun org-babel-R-graphical-output-file (params)
"Name of file to which R should send graphical output."
(and (member "graphics" (cdr (assq :result-params params)))
(cdr (assq :file params))))
(defvar org-babel-R-graphics-devices (defvar org-babel-R-graphics-devices
'((:bmp "bmp" "filename") '((:bmp "bmp" "filename")
(:jpg "jpeg" "filename") (:jpg "jpeg" "filename")

View file

@ -1591,7 +1591,7 @@ shown below.
;; row and column names ;; row and column names
(defun org-babel-del-hlines (table) (defun org-babel-del-hlines (table)
"Remove all 'hlines from TABLE." "Remove all 'hlines from TABLE."
(remove 'hline table)) (remq 'hline table))
(defun org-babel-get-colnames (table) (defun org-babel-get-colnames (table)
"Return the column names of TABLE. "Return the column names of TABLE.
@ -2890,6 +2890,13 @@ For the format of SAFE-LIST, see `org-babel-safe-header-args'."
(member (cdr pair) (cdr entry))) (member (cdr pair) (cdr entry)))
(t nil))))))) (t nil)))))))
;;; Used by backends: R, Maxima, Octave.
(defun org-babel-graphical-output-file (params)
"File where a babel block should send graphical output, per PARAMS."
(and (member "graphics" (cdr (assq :result-params params)))
(cdr (assq :file params))))
(provide 'ob-core) (provide 'ob-core)
;; Local variables: ;; Local variables:

View file

@ -52,7 +52,7 @@
(mapconcat 'identity (mapconcat 'identity
(list (list
;; graphic output ;; graphic output
(let ((graphic-file (org-babel-maxima-graphical-output-file params))) (let ((graphic-file (org-babel-graphical-output-file params)))
(if graphic-file (if graphic-file
(format (format
"set_plot_option ([gnuplot_term, png]); set_plot_option ([gnuplot_out_file, %S]);" "set_plot_option ([gnuplot_term, png]); set_plot_option ([gnuplot_out_file, %S]);"
@ -113,11 +113,6 @@ of the same value."
(format "%S: %s$" var (format "%S: %s$" var
(org-babel-maxima-elisp-to-maxima val)))) (org-babel-maxima-elisp-to-maxima val))))
(defun org-babel-maxima-graphical-output-file (params)
"Name of file to which maxima should send graphical output."
(and (member "graphics" (cdr (assq :result-params params)))
(cdr (assq :file params))))
(defun org-babel-maxima-elisp-to-maxima (val) (defun org-babel-maxima-elisp-to-maxima (val)
"Return a string of maxima code which evaluates to VAL." "Return a string of maxima code which evaluates to VAL."
(if (listp val) (if (listp val)

View file

@ -84,16 +84,16 @@ end")
body params (org-babel-variable-assignments:octave params))) body params (org-babel-variable-assignments:octave params)))
(result (org-babel-octave-evaluate (result (org-babel-octave-evaluate
session session
(if (org-babel-octave-graphical-output-file params) (if (org-babel-graphical-output-file params)
(mapconcat 'identity (mapconcat 'identity
(list (list
"set (0, \"defaultfigurevisible\", \"off\");" "set (0, \"defaultfigurevisible\", \"off\");"
full-body full-body
(format "print -dpng %s" (org-babel-octave-graphical-output-file params))) (format "print -dpng %s" (org-babel-graphical-output-file params)))
"\n") "\n")
full-body) full-body)
result-type matlabp))) result-type matlabp)))
(if (org-babel-octave-graphical-output-file params) (if (org-babel-graphical-output-file params)
nil nil
(org-babel-reassemble-table (org-babel-reassemble-table
result result
@ -268,11 +268,6 @@ This removes initial blank and comment lines and then calls
(match-string 1 string) (match-string 1 string)
string)) string))
(defun org-babel-octave-graphical-output-file (params)
"Name of file to which maxima should send graphical output."
(and (member "graphics" (cdr (assq :result-params params)))
(cdr (assq :file params))))
(provide 'ob-octave) (provide 'ob-octave)

View file

@ -650,7 +650,7 @@ of custom agenda commands."
:tag "Org Agenda Match View" :tag "Org Agenda Match View"
:group 'org-agenda) :group 'org-agenda)
(defgroup org-agenda-search-view nil (defgroup org-agenda-search-view nil
"Options concerning the general tags/property/todo match agenda view." "Options concerning the search agenda view."
:tag "Org Agenda Search View" :tag "Org Agenda Search View"
:group 'org-agenda) :group 'org-agenda)
@ -3752,6 +3752,9 @@ generating a new one."
(delete-dups (delete-dups
(mapcar 'downcase (org-get-tags-at)))))))))) (mapcar 'downcase (org-get-tags-at))))))))))
(run-hooks 'org-agenda-finalize-hook) (run-hooks 'org-agenda-finalize-hook)
(when org-agenda-top-headline-filter
(org-agenda-filter-top-headline-apply
org-agenda-top-headline-filter))
(when org-agenda-tag-filter (when org-agenda-tag-filter
(org-agenda-filter-apply org-agenda-tag-filter 'tag)) (org-agenda-filter-apply org-agenda-tag-filter 'tag))
(when (get 'org-agenda-tag-filter :preset-filter) (when (get 'org-agenda-tag-filter :preset-filter)

View file

@ -5451,9 +5451,13 @@ The following commands are available:
;; Initialize cache. ;; Initialize cache.
(org-element-cache-reset) (org-element-cache-reset)
;; Beginning/end of defun ;; Beginning/end of defun
(org-set-local 'beginning-of-defun-function 'org-back-to-heading) (org-set-local 'beginning-of-defun-function 'org-backward-element)
(org-set-local 'end-of-defun-function (org-set-local 'end-of-defun-function
(lambda () (interactive) (org-end-of-subtree nil t))) (lambda ()
(if (not (org-at-heading-p))
(org-forward-element)
(org-forward-element)
(forward-char -1))))
;; Next error for sparse trees ;; Next error for sparse trees
(org-set-local 'next-error-function 'org-occur-next-match) (org-set-local 'next-error-function 'org-occur-next-match)
;; Make sure dependence stuff works reliably, even for users who set it ;; Make sure dependence stuff works reliably, even for users who set it
@ -7740,7 +7744,7 @@ command."
pos hide-previous previous-pos) pos hide-previous previous-pos)
;; If we insert after content, move there and clean up whitespace ;; If we insert after content, move there and clean up whitespace
(when respect-content (when (and respect-content (not (org-on-heading-p)))
(org-end-of-subtree nil t) (org-end-of-subtree nil t)
(skip-chars-backward " \r\n") (skip-chars-backward " \r\n")
(and (not (looking-back "^\\*+")) (and (not (looking-back "^\\*+"))
@ -8589,11 +8593,11 @@ and still retain the repeater to cover future instances of the task."
beg end template task idprop beg end template task idprop
shift-n shift-what doshift nmin nmax) shift-n shift-what doshift nmin nmax)
(if (not (and (integerp n) (> n 0))) (if (not (and (integerp n) (> n 0)))
(error "Invalid number of replications %s" n)) (user-error "Invalid number of replications %s" n))
(if (and (setq doshift (and (stringp shift) (string-match "\\S-" shift))) (if (and (setq doshift (and (stringp shift) (string-match "\\S-" shift)))
(not (string-match "\\`[ \t]*\\+?\\([0-9]+\\)\\([hdwmy]\\)[ \t]*\\'" (not (string-match "\\`[ \t]*\\+?\\([0-9]+\\)\\([hdwmy]\\)[ \t]*\\'"
shift))) shift)))
(error "Invalid shift specification %s" shift)) (user-error "Invalid shift specification %s" shift))
(when doshift (when doshift
(setq shift-n (string-to-number (match-string 1 shift)) (setq shift-n (string-to-number (match-string 1 shift))
shift-what (cdr (assoc (match-string 2 shift) shift-what (cdr (assoc (match-string 2 shift)
@ -10627,7 +10631,7 @@ is used internally by `org-open-link-from-string'."
(setq clean-buffer-list-kill-buffer-names (setq clean-buffer-list-kill-buffer-names
(cons buf (cons buf
clean-buffer-list-kill-buffer-names)))) clean-buffer-list-kill-buffer-names))))
(error "Abort")))) (user-error "Abort"))))
((equal type "elisp") ((equal type "elisp")
(let ((cmd path)) (let ((cmd path))
(if (or (and (org-string-nw-p (if (or (and (org-string-nw-p
@ -10643,7 +10647,7 @@ is used internally by `org-open-link-from-string'."
(if (eq (string-to-char cmd) ?\() (if (eq (string-to-char cmd) ?\()
(eval (read cmd)) (eval (read cmd))
(call-interactively (read cmd)))) (call-interactively (read cmd))))
(error "Abort")))) (user-error "Abort"))))
((equal type "id") ((equal type "id")
(require 'ord-id) (require 'ord-id)
(funcall (nth 1 (assoc "id" org-link-protocols)) path)) (funcall (nth 1 (assoc "id" org-link-protocols)) path))
@ -10735,7 +10739,7 @@ there is one, return it."
(message "Select link to open, RET to open all:") (message "Select link to open, RET to open all:")
(setq c (read-char-exclusive)) (setq c (read-char-exclusive))
(and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))) (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*"))))
(when (equal c ?q) (error "Abort")) (when (equal c ?q) (user-error "Abort"))
(if (equal c ?\C-m) (if (equal c ?\C-m)
(setq link links) (setq link links)
(setq nth (- c ?0)) (setq nth (- c ?0))
@ -13036,7 +13040,7 @@ This function is run automatically after each state change to a DONE state."
(time-to-days (current-time)))) (time-to-days (current-time))))
(when (= (incf nshift) nshiftmax) (when (= (incf nshift) nshiftmax)
(or (y-or-n-p (message "%d repeater intervals were not enough to shift date past today. Continue? " nshift)) (or (y-or-n-p (message "%d repeater intervals were not enough to shift date past today. Continue? " nshift))
(error "Abort"))) (user-error "Abort")))
(org-timestamp-change n (cdr (assoc what whata))) (org-timestamp-change n (cdr (assoc what whata)))
(org-at-timestamp-p t) (org-at-timestamp-p t)
(setq ts (match-string 1)) (setq ts (match-string 1))
@ -13720,7 +13724,7 @@ starting point when no match is found."
(while (setq p1 (funcall search-func (point) 'org-type)) (while (setq p1 (funcall search-func (point) 'org-type))
(when (equal p1 limit) (when (equal p1 limit)
(goto-char pos) (goto-char pos)
(error "No more matches")) (user-error "No more matches"))
(when (equal (get-char-property p1 'org-type) 'org-occur) (when (equal (get-char-property p1 'org-type) 'org-occur)
(setq n (1- n)) (setq n (1- n))
(when (= n 0) (when (= n 0)
@ -13728,7 +13732,7 @@ starting point when no match is found."
(throw 'exit (point)))) (throw 'exit (point))))
(goto-char p1)) (goto-char p1))
(goto-char p1) (goto-char p1)
(error "No more matches")))) (user-error "No more matches"))))
(defun org-show-context (&optional key) (defun org-show-context (&optional key)
"Make sure point and context are visible. "Make sure point and context are visible.
@ -18151,11 +18155,12 @@ Optional argument FILE means use this file instead of the current."
((equal r ?r) ((equal r ?r)
(org-remove-file file) (org-remove-file file)
(throw 'nextfile t)) (throw 'nextfile t))
(t (error "Abort")))))) (t (user-error "Abort"))))))
(defun org-get-agenda-file-buffer (file) (defun org-get-agenda-file-buffer (file)
"Get a buffer visiting FILE. If the buffer needs to be created, add "Get an agenda buffer visiting FILE.
it to the list of buffers which might be released later." If the buffer needs to be created, add it to the list of buffers
which might be released later."
(let ((buf (org-find-base-buffer-visiting file))) (let ((buf (org-find-base-buffer-visiting file)))
(if buf (if buf
buf ; just return it buf ; just return it
@ -18577,7 +18582,7 @@ inspection."
(buffer-substring-no-properties (buffer-substring-no-properties
(region-beginning) (region-end))))) (region-beginning) (region-end)))))
(read-string "LaTeX Fragment: " frag nil frag)))) (read-string "LaTeX Fragment: " frag nil frag))))
(unless latex-frag (error "Invalid LaTeX fragment")) (unless latex-frag (user-error "Invalid LaTeX fragment"))
(let* ((tmp-in-file (file-relative-name (let* ((tmp-in-file (file-relative-name
(make-temp-name (expand-file-name "ltxmathml-in")))) (make-temp-name (expand-file-name "ltxmathml-in"))))
(ignore (write-region latex-frag nil tmp-in-file)) (ignore (write-region latex-frag nil tmp-in-file))
@ -23011,7 +23016,7 @@ package ox-bibtex by Taru Karttunen."
(if (not (save-excursion (if (not (save-excursion
(or (re-search-forward re nil t) (or (re-search-forward re nil t)
(re-search-backward re nil t)))) (re-search-backward re nil t))))
(error "No bibliography defined in file") (user-error "No bibliography defined in file")
(setq bib (concat (match-string 1) ".bib") (setq bib (concat (match-string 1) ".bib")
rds (list (list 'bib bib))))))) rds (list (list 'bib bib)))))))
(call-interactively 'reftex-citation))) (call-interactively 'reftex-citation)))
@ -23604,7 +23609,8 @@ When BLOCK-REGEXP is non-nil, use this regexp to find blocks."
(if (looking-at re) (forward-char 1)) (if (looking-at re) (forward-char 1))
(condition-case nil (condition-case nil
(funcall re-search-fn re nil nil arg) (funcall re-search-fn re nil nil arg)
(error (error "No %s code blocks" (if backward "previous" "further" )))) (error (user-error "No %s code blocks"
(if backward "previous" "further" ))))
(goto-char (match-beginning 0)) (org-show-context))) (goto-char (match-beginning 0)) (org-show-context)))
(defun org-previous-block (arg &optional block-regexp) (defun org-previous-block (arg &optional block-regexp)

View file

@ -454,6 +454,7 @@ export back-end currently used."
(not org-html-use-infojs) (not org-html-use-infojs)
(and (eq org-html-use-infojs 'when-configured) (and (eq org-html-use-infojs 'when-configured)
(or (not (plist-get exp-plist :infojs-opt)) (or (not (plist-get exp-plist :infojs-opt))
(string= "" (plist-get exp-plist :infojs-opt))
(string-match "\\<view:nil\\>" (string-match "\\<view:nil\\>"
(plist-get exp-plist :infojs-opt))))) (plist-get exp-plist :infojs-opt)))))
(let* ((template org-html-infojs-template) (let* ((template org-html-infojs-template)

View file

@ -85,10 +85,11 @@ keyword."
(defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due) (defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due)
"Contexts where iCalendar export should use a deadline time stamp. "Contexts where iCalendar export should use a deadline time stamp.
This is a list with several symbols in it. Valid symbol are: This is a list with possibly several symbols in it. Valid symbols are:
`event-if-todo' Deadlines in TODO entries become calendar events. `event-if-todo' Deadlines in TODO entries become calendar events.
`event-if-not-todo' Deadlines in non-TODO entries become calendar events. `event-if-not-todo' Deadlines in non-TODO entries become calendar events.
`todo-due' Use deadlines in TODO entries as due-dates" `todo-due' Use deadlines in TODO entries as due-dates."
:group 'org-export-icalendar :group 'org-export-icalendar
:type '(set :greedy t :type '(set :greedy t
(const :tag "Deadlines in non-TODO entries become events" (const :tag "Deadlines in non-TODO entries become events"
@ -101,7 +102,8 @@ This is a list with several symbols in it. Valid symbol are:
(defcustom org-icalendar-use-scheduled '(todo-start) (defcustom org-icalendar-use-scheduled '(todo-start)
"Contexts where iCalendar export should use a scheduling time stamp. "Contexts where iCalendar export should use a scheduling time stamp.
This is a list with several symbols in it. Valid symbol are: This is a list with possibly several symbols in it. Valid symbols are:
`event-if-todo' Scheduling time stamps in TODO entries become an event. `event-if-todo' Scheduling time stamps in TODO entries become an event.
`event-if-not-todo' Scheduling time stamps in non-TODO entries become an event. `event-if-not-todo' Scheduling time stamps in non-TODO entries become an event.
`todo-start' Scheduling time stamps in TODO entries become start date. `todo-start' Scheduling time stamps in TODO entries become start date.

View file

@ -752,7 +752,7 @@ e.g. \"tasks:nil\"."
(defcustom org-export-time-stamp-file t (defcustom org-export-time-stamp-file t
"Non-nil means insert a time stamp into the exported file. "Non-nil means insert a time stamp into the exported file.
The time stamp shows when the file was created. This option can The time stamp shows when the file was created. This option can
also be set with the OPTIONS keyword, e.g. \"timestamp:nil\"." also be set with the OPTIONS keyword, e.g. \"timestamp:nil\"."
:group 'org-export-general :group 'org-export-general
:type 'boolean) :type 'boolean)

View file

@ -488,15 +488,12 @@
(org-test-with-temp-text "* H1\n Body" (org-test-with-temp-text "* H1\n Body"
(org-insert-todo-heading-respect-content) (org-insert-todo-heading-respect-content)
(nth 2 (org-heading-components)))) (nth 2 (org-heading-components))))
;; Add headline after body of current subtree. ;; Add headline at the end of the first subtree
(should (should
(org-test-with-temp-text "* H1\nBody" (org-test-with-temp-text "* H1\nH1Body\n** H2\nH2Body"
(search-forward "H1Body")
(org-insert-todo-heading-respect-content) (org-insert-todo-heading-respect-content)
(eobp))) (and (eobp) (org-at-heading-p))))
(should
(org-test-with-temp-text "* H1\n** H2\nBody"
(org-insert-todo-heading-respect-content)
(eobp)))
;; In a list, do not create a new item. ;; In a list, do not create a new item.
(should (should
(org-test-with-temp-text "* H\n- an item\n- another one" (org-test-with-temp-text "* H\n- an item\n- another one"