From ab351d442d7bb4d17cbb43638aaed1775d8c0344 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Mon, 18 Sep 2017 12:01:12 +0200 Subject: Update Org to v9.1.1 Please see etc/ORG-NEWS for major changes. --- lisp/org/ob-C.el | 31 +- lisp/org/ob-R.el | 4 +- lisp/org/ob-clojure.el | 106 ++- lisp/org/ob-core.el | 24 +- lisp/org/ob-exp.el | 23 +- lisp/org/ob-gnuplot.el | 2 +- lisp/org/ob-lilypond.el | 2 +- lisp/org/ob-lua.el | 8 +- lisp/org/ob-maxima.el | 8 +- lisp/org/ob-plantuml.el | 28 +- lisp/org/ob-scheme.el | 156 ++-- lisp/org/ob-sql.el | 59 +- lisp/org/ob-sqlite.el | 5 +- lisp/org/ob-tangle.el | 3 +- lisp/org/org-agenda.el | 1378 ++++++++++++++--------------- lisp/org/org-archive.el | 22 +- lisp/org/org-attach.el | 76 +- lisp/org/org-bbdb.el | 55 +- lisp/org/org-bibtex.el | 13 +- lisp/org/org-capture.el | 398 +++++---- lisp/org/org-clock.el | 204 +++-- lisp/org/org-colview.el | 266 +++--- lisp/org/org-compat.el | 335 ++++--- lisp/org/org-datetree.el | 53 +- lisp/org/org-element.el | 251 ++---- lisp/org/org-entities.el | 2 + lisp/org/org-gnus.el | 283 +++--- lisp/org/org-habit.el | 2 +- lisp/org/org-info.el | 22 +- lisp/org/org-lint.el | 19 +- lisp/org/org-list.el | 62 +- lisp/org/org-macro.el | 72 +- lisp/org/org-macs.el | 84 ++ lisp/org/org-mouse.el | 23 +- lisp/org/org-protocol.el | 17 +- lisp/org/org-src.el | 29 +- lisp/org/org-table.el | 262 +++--- lisp/org/org-timer.el | 2 +- lisp/org/org-version.el | 4 +- lisp/org/org.el | 2160 ++++++++++++++++++++-------------------------- lisp/org/ox-ascii.el | 11 +- lisp/org/ox-beamer.el | 62 +- lisp/org/ox-html.el | 204 +++-- lisp/org/ox-icalendar.el | 129 +-- lisp/org/ox-latex.el | 91 +- lisp/org/ox-md.el | 119 ++- lisp/org/ox-odt.el | 13 +- lisp/org/ox-org.el | 3 +- lisp/org/ox-publish.el | 664 +++++++------- lisp/org/ox-texinfo.el | 271 +++--- lisp/org/ox.el | 619 ++++++++----- 51 files changed, 4652 insertions(+), 4087 deletions(-) (limited to 'lisp/org') diff --git a/lisp/org/ob-C.el b/lisp/org/ob-C.el index 86047eeeccf..78528a882bc 100644 --- a/lisp/org/ob-C.el +++ b/lisp/org/ob-C.el @@ -46,6 +46,19 @@ (defvar org-babel-default-header-args:C '()) +(defconst org-babel-header-args:C '((includes . :any) + (defines . :any) + (main . :any) + (flags . :any) + (cmdline . :any) + (libs . :any)) + "C/C++-specific header arguments.") + +(defconst org-babel-header-args:C++ + (append '((namespaces . :any)) + org-babel-header-args:C) + "C++-specific header arguments.") + (defcustom org-babel-C-compiler "gcc" "Command used to compile a C source code file into an executable. May be either a command in the path, like gcc @@ -196,15 +209,18 @@ its header arguments." (colnames (cdr (assq :colname-names params))) (main-p (not (string= (cdr (assq :main params)) "no"))) (includes (org-babel-read - (or (cdr (assq :includes params)) - (org-entry-get nil "includes" t)) + (cdr (assq :includes params)) nil)) (defines (org-babel-read - (or (cdr (assq :defines params)) - (org-entry-get nil "defines" t)) - nil))) + (cdr (assq :defines params)) + nil)) + (namespaces (org-babel-read + (cdr (assq :namespaces params)) + nil))) (when (stringp includes) (setq includes (split-string includes))) + (when (stringp namespaces) + (setq namespaces (split-string namespaces))) (when (stringp defines) (let ((y nil) (result (list t))) @@ -224,6 +240,11 @@ its header arguments." (mapconcat (lambda (inc) (format "#define %s" inc)) (if (listp defines) defines (list defines)) "\n") + ;; namespaces + (mapconcat + (lambda (inc) (format "using namespace %s;" inc)) + namespaces + "\n") ;; variables (mapconcat 'org-babel-C-var-to-C vars "\n") ;; table sizes diff --git a/lisp/org/ob-R.el b/lisp/org/ob-R.el index ded825b1d01..6781fb30a3b 100644 --- a/lisp/org/ob-R.el +++ b/lisp/org/ob-R.el @@ -159,10 +159,10 @@ This function is called by `org-babel-execute-src-block'." (result-type (cdr (assq :result-type params))) (session (org-babel-R-initiate-session (cdr (assq :session params)) params)) - (colnames-p (cdr (assq :colnames params))) - (rownames-p (cdr (assq :rownames params))) (graphics-file (and (member "graphics" (assq :result-params params)) (org-babel-graphical-output-file params))) + (colnames-p (unless graphics-file (cdr (assq :colnames params)))) + (rownames-p (unless graphics-file (cdr (assq :rownames params)))) (full-body (let ((inside (list (org-babel-expand-body:R body params graphics-file)))) diff --git a/lisp/org/ob-clojure.el b/lisp/org/ob-clojure.el index b99035b4cce..b49bfe58898 100644 --- a/lisp/org/ob-clojure.el +++ b/lisp/org/ob-clojure.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2009-2017 Free Software Foundation, Inc. -;; Author: Joel Boehland, Eric Schulte, Oleh Krehel +;; Author: Joel Boehland, Eric Schulte, Oleh Krehel, Frederick Giasson ;; ;; Keywords: literate programming, reproducible research ;; Homepage: http://orgmode.org @@ -43,19 +43,34 @@ (require 'ob) (declare-function cider-current-connection "ext:cider-client" (&optional type)) -(declare-function cider-current-session "ext:cider-client" ()) +(declare-function cider-current-ns "ext:cider-client" ()) +(declare-function nrepl--merge "ext:nrepl-client" (dict1 dict2)) (declare-function nrepl-dict-get "ext:nrepl-client" (dict key)) +(declare-function nrepl-dict-put "ext:nrepl-client" (dict key value)) +(declare-function nrepl-request:eval "ext:nrepl-client" + (input callback connection &optional session ns line column additional-params)) (declare-function nrepl-sync-request:eval "ext:nrepl-client" (input connection session &optional ns)) (declare-function org-trim "org" (s &optional keep-lead)) (declare-function slime-eval "ext:slime" (sexp &optional package)) +(defvar nrepl-sync-request-timeout) + (defvar org-babel-tangle-lang-exts) (add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj")) (defvar org-babel-default-header-args:clojure '()) (defvar org-babel-header-args:clojure '((package . :any))) +(defcustom org-babel-clojure-sync-nrepl-timeout 10 + "Timeout value, in seconds, of a Clojure sync call. +If the value is nil, timeout is disabled." + :group 'org-babel + :type 'integer + :version "26.1" + :package-version '(Org . "9.1") + :safe #'wholenump) + (defcustom org-babel-clojure-backend (cond ((featurep 'cider) 'cider) (t 'slime)) @@ -84,21 +99,86 @@ body))) (defun org-babel-execute:clojure (body params) - "Execute a block of Clojure code with Babel." + "Execute a block of Clojure code with Babel. +The underlying process performed by the code block can be output +using the :show-process parameter." (let ((expanded (org-babel-expand-body:clojure body params)) - result) + (response (list 'dict)) + result) (cl-case org-babel-clojure-backend (cider (require 'cider) - (let ((result-params (cdr (assq :result-params params)))) - (setq result - (nrepl-dict-get - (nrepl-sync-request:eval - expanded (cider-current-connection) (cider-current-session)) - (if (or (member "output" result-params) - (member "pp" result-params)) - "out" - "value"))))) + (let ((result-params (cdr (assq :result-params params))) + (show (cdr (assq :show-process params)))) + (if (member show '(nil "no")) + ;; Run code without showing the process. + (progn + (setq response + (let ((nrepl-sync-request-timeout + org-babel-clojure-sync-nrepl-timeout)) + (nrepl-sync-request:eval expanded + (cider-current-connection) + (cider-current-ns)))) + (setq result + (concat + (nrepl-dict-get response + (if (or (member "output" result-params) + (member "pp" result-params)) + "out" + "value")) + (nrepl-dict-get response "ex") + (nrepl-dict-get response "root-ex") + (nrepl-dict-get response "err")))) + ;; Show the process in an output buffer/window. + (let ((process-buffer (switch-to-buffer-other-window + "*Clojure Show Process Sub Buffer*")) + status) + ;; Run the Clojure code in nREPL. + (nrepl-request:eval + expanded + (lambda (resp) + (when (member "out" resp) + ;; Print the output of the nREPL in the output buffer. + (princ (nrepl-dict-get resp "out") process-buffer)) + (when (member "ex" resp) + ;; In case there is an exception, then add it to the + ;; output buffer as well. + (princ (nrepl-dict-get resp "ex") process-buffer) + (princ (nrepl-dict-get resp "root-ex") process-buffer)) + (when (member "err" resp) + ;; In case there is an error, then add it to the + ;; output buffer as well. + (princ (nrepl-dict-get resp "err") process-buffer)) + (nrepl--merge response resp) + ;; Update the status of the nREPL output session. + (setq status (nrepl-dict-get response "status"))) + (cider-current-connection) + (cider-current-ns)) + + ;; Wait until the nREPL code finished to be processed. + (while (not (member "done" status)) + (nrepl-dict-put response "status" (remove "need-input" status)) + (accept-process-output nil 0.01) + (redisplay)) + + ;; Delete the show buffer & window when the processing is + ;; finalized. + (mapc #'delete-window + (get-buffer-window-list process-buffer nil t)) + (kill-buffer process-buffer) + + ;; Put the output or the value in the result section of + ;; the code block. + (setq result + (concat + (nrepl-dict-get response + (if (or (member "output" result-params) + (member "pp" result-params)) + "out" + "value")) + (nrepl-dict-get response "ex") + (nrepl-dict-get response "root-ex") + (nrepl-dict-get response "err"))))))) (slime (require 'slime) (with-temp-buffer diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index e18716823df..c7c03845451 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -82,7 +82,6 @@ (declare-function org-reverse-string "org" (string)) (declare-function org-set-outline-overlay-data "org" (data)) (declare-function org-show-context "org" (&optional key)) -(declare-function org-split-string "org" (string &optional separators)) (declare-function org-src-coderef-format "org-src" (element)) (declare-function org-src-coderef-regexp "org-src" (fmt &optional label)) (declare-function org-table-align "org-table" ()) @@ -179,6 +178,14 @@ This string must include a \"%s\" which will be replaced by the results." :package-version '(Org . "9.0") :safe #'booleanp) +(defcustom org-babel-uppercase-example-markers nil + "When non-nil, begin/end example markers will be inserted in upper case." + :group 'org-babel + :type 'boolean + :version "26.1" + :package-version '(Org . "9.1") + :safe #'booleanp) + (defun org-babel-noweb-wrap (&optional regexp) (concat org-babel-noweb-wrap-start (or regexp "\\([^ \t\n].+?[^ \t]\\|[^ \t\n]\\)") @@ -234,11 +241,9 @@ should be asked whether to allow evaluation." (query (or (equal eval "query") (and export (equal eval "query-export")) (if (functionp org-confirm-babel-evaluate) - (save-excursion - (goto-char (nth 5 info)) - (funcall org-confirm-babel-evaluate - ;; language, code block body - (nth 0 info) (nth 1 info))) + (funcall org-confirm-babel-evaluate + ;; Language, code block body. + (nth 0 info) (nth 1 info)) org-confirm-babel-evaluate)))) (cond (noeval nil) @@ -2348,7 +2353,7 @@ INFO may provide the values of these header arguments (in the ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "RESULTS"))) (funcall wrap (concat "#+BEGIN_" name) - (concat "#+END_" (car (org-split-string name))) + (concat "#+END_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+BEGIN_EXPORT html" "#+END_EXPORT" nil nil @@ -2483,15 +2488,12 @@ file's directory then expand relative links." result) (if description (concat "[" description "]") "")))) -(defvar org-babel-capitalize-example-region-markers nil - "Make true to capitalize begin/end example markers inserted by code blocks.") - (defun org-babel-examplify-region (beg end &optional results-switches inline) "Comment out region using the inline `==' or `: ' org example quote." (interactive "*r") (let ((maybe-cap (lambda (str) - (if org-babel-capitalize-example-region-markers (upcase str) str)))) + (if org-babel-uppercase-example-markers (upcase str) str)))) (if inline (save-excursion (goto-char beg) diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el index dc9c53aade6..9606d3e474f 100644 --- a/lisp/org/ob-exp.el +++ b/lisp/org/ob-exp.el @@ -38,19 +38,18 @@ (defvar org-src-preserve-indentation) -(defcustom org-export-babel-evaluate t - "Switch controlling code evaluation during export. +(defcustom org-export-use-babel t + "Switch controlling code evaluation and header processing during export. When set to nil no code will be evaluated as part of the export -process and no header arguments will be obeyed. When set to -`inline-only', only inline code blocks will be executed. Users -who wish to avoid evaluating code on export should use the header -argument `:eval never-export'." +process and no header arguments will be obeyed. Users who wish +to avoid evaluating code on export should use the header argument +`:eval never-export'." :group 'org-babel :version "24.1" :type '(choice (const :tag "Never" nil) - (const :tag "Only inline code" inline-only) - (const :tag "Always" t))) -(put 'org-export-babel-evaluate 'safe-local-variable #'null) + (const :tag "Always" t)) + :safe #'null) + (defmacro org-babel-exp--at-source (&rest body) "Evaluate BODY at the source of the Babel block at point. @@ -128,12 +127,10 @@ this template." (defun org-babel-exp-process-buffer () "Execute all Babel blocks in current buffer." (interactive) - (when org-export-babel-evaluate + (when org-export-use-babel (save-window-excursion (let ((case-fold-search t) - (regexp (if (eq org-export-babel-evaluate 'inline-only) - "\\(call\\|src\\)_" - "\\(call\\|src\\)_\\|^[ \t]*#\\+\\(BEGIN_SRC\\|CALL:\\)")) + (regexp "\\(call\\|src\\)_\\|^[ \t]*#\\+\\(BEGIN_SRC\\|CALL:\\)") ;; Get a pristine copy of current buffer so Babel ;; references are properly resolved and source block ;; context is preserved. diff --git a/lisp/org/ob-gnuplot.el b/lisp/org/ob-gnuplot.el index f35374758f6..763386270d7 100644 --- a/lisp/org/ob-gnuplot.el +++ b/lisp/org/ob-gnuplot.el @@ -40,7 +40,7 @@ ;;; Code: (require 'ob) -(declare-function org-time-string-to-time "org" (s &optional buffer pos)) +(declare-function org-time-string-to-time "org" (s &optional zone)) (declare-function org-combine-plists "org" (&rest plists)) (declare-function orgtbl-to-generic "org-table" (table params)) (declare-function gnuplot-mode "ext:gnuplot-mode" ()) diff --git a/lisp/org/ob-lilypond.el b/lisp/org/ob-lilypond.el index 3320a7e55b4..0cc85685e91 100644 --- a/lisp/org/ob-lilypond.el +++ b/lisp/org/ob-lilypond.el @@ -89,7 +89,7 @@ you can leave the string empty on this case." (string :tag "Lilypond ") (string :tag "PDF Viewer ") (string :tag "MIDI Player")) - :version "24.3" + :version "24.4" :package-version '(Org . "8.2.7") :set (lambda (_symbol value) diff --git a/lisp/org/ob-lua.el b/lisp/org/ob-lua.el index 4fd7a323825..fc9d9f2f0e2 100644 --- a/lisp/org/ob-lua.el +++ b/lisp/org/ob-lua.el @@ -49,7 +49,7 @@ (defcustom org-babel-lua-command "lua" "Name of the command for executing Lua code." - :version "24.5" + :version "26.1" :package-version '(Org . "8.3") :group 'org-babel :type 'string) @@ -58,21 +58,21 @@ "Preferred lua mode for use in running lua interactively. This will typically be 'lua-mode." :group 'org-babel - :version "24.5" + :version "26.1" :package-version '(Org . "8.3") :type 'symbol) (defcustom org-babel-lua-hline-to "None" "Replace hlines in incoming tables with this when translating to lua." :group 'org-babel - :version "24.5" + :version "26.1" :package-version '(Org . "8.3") :type 'string) (defcustom org-babel-lua-None-to 'hline "Replace 'None' in lua tables with this before returning." :group 'org-babel - :version "24.5" + :version "26.1" :package-version '(Org . "8.3") :type 'symbol) diff --git a/lisp/org/ob-maxima.el b/lisp/org/ob-maxima.el index b2680aa7b6f..224b3605035 100644 --- a/lisp/org/ob-maxima.el +++ b/lisp/org/ob-maxima.el @@ -48,9 +48,13 @@ (defun org-babel-maxima-expand (body params) "Expand a block of Maxima code according to its header arguments." - (let ((vars (org-babel--get-vars params))) + (let ((vars (org-babel--get-vars params)) + (epilogue (cdr (assq :epilogue params))) + (prologue (cdr (assq :prologue params)))) (mapconcat 'identity (list + ;; Any code from the specified prologue at the start. + prologue ;; graphic output (let ((graphic-file (ignore-errors (org-babel-graphical-output-file params)))) (if graphic-file @@ -62,6 +66,8 @@ (mapconcat 'org-babel-maxima-var-to-maxima vars "\n") ;; body body + ;; Any code from the specified epilogue at the end. + epilogue "gnuplot_close ()$") "\n"))) diff --git a/lisp/org/ob-plantuml.el b/lisp/org/ob-plantuml.el index 20dc25f6484..8093100edaf 100644 --- a/lisp/org/ob-plantuml.el +++ b/lisp/org/ob-plantuml.el @@ -46,6 +46,31 @@ :version "24.1" :type 'string) +(defun org-babel-variable-assignments:plantuml (params) + "Return a list of PlantUML statements assigning the block's variables. +PARAMS is a property list of source block parameters, which may +contain multiple entries for the key `:var'. `:var' entries in PARAMS +are expected to be scalar variables." + (mapcar + (lambda (pair) + (format "!define %s %s" + (car pair) + (replace-regexp-in-string "\"" "" (cdr pair)))) + (org-babel--get-vars params))) + +(defun org-babel-plantuml-make-body (body params) + "Return PlantUML input string. +BODY is the content of the source block and PARAMS is a property list +of source block parameters. This function relies on the +`org-babel-expand-body:generic' function to extract `:var' entries +from PARAMS and on the `org-babel-variable-assignments:plantuml' +function to convert variables to PlantUML assignments." + (concat + "@startuml\n" + (org-babel-expand-body:generic + body params (org-babel-variable-assignments:plantuml params)) + "\n@enduml")) + (defun org-babel-execute:plantuml (body params) "Execute a block of plantuml code with org-babel. This function is called by `org-babel-execute-src-block'." @@ -54,6 +79,7 @@ This function is called by `org-babel-execute-src-block'." (cmdline (cdr (assq :cmdline params))) (in-file (org-babel-temp-file "plantuml-")) (java (or (cdr (assq :java params)) "")) + (full-body (org-babel-plantuml-make-body body params)) (cmd (if (string= "" org-plantuml-jar-path) (error "`org-plantuml-jar-path' is not set") (concat "java " java " -jar " @@ -85,7 +111,7 @@ This function is called by `org-babel-execute-src-block'." (org-babel-process-file-name out-file))))) (unless (file-exists-p org-plantuml-jar-path) (error "Could not find plantuml.jar at %s" org-plantuml-jar-path)) - (with-temp-file in-file (insert (concat "@startuml\n" body "\n@enduml"))) + (with-temp-file in-file (insert full-body)) (message "%s" cmd) (org-babel-eval cmd "") nil)) ;; signal that output has already been written to file diff --git a/lisp/org/ob-scheme.el b/lisp/org/ob-scheme.el index 2782853220b..f67080adfd3 100644 --- a/lisp/org/ob-scheme.el +++ b/lisp/org/ob-scheme.el @@ -44,37 +44,51 @@ (defvar geiser-impl--implementation) ; Defined in geiser-impl.el (defvar geiser-default-implementation) ; Defined in geiser-impl.el (defvar geiser-active-implementations) ; Defined in geiser-impl.el +(defvar geiser-debug-show-debug-p) ; Defined in geiser-debug.el +(defvar geiser-debug-jump-to-debug-p) ; Defined in geiser-debug.el +(defvar geiser-repl-use-other-window) ; Defined in geiser-repl.el +(defvar geiser-repl-window-allow-split) ; Defined in geiser-repl.el (declare-function run-geiser "ext:geiser-repl" (impl)) (declare-function geiser-mode "ext:geiser-mode" ()) (declare-function geiser-eval-region "ext:geiser-mode" (start end &optional and-go raw nomsg)) (declare-function geiser-repl-exit "ext:geiser-repl" (&optional arg)) +(declare-function geiser-eval--retort-output "ext:geiser-eval" (ret)) +(declare-function geiser-eval--retort-result-str "ext:geiser-eval" (ret prefix)) + +(defcustom org-babel-scheme-null-to 'hline + "Replace `null' and empty lists in scheme tables with this before returning." + :group 'org-babel + :version "26.1" + :package-version '(Org . "9.1") + :type 'symbol) (defvar org-babel-default-header-args:scheme '() "Default header arguments for scheme code blocks.") (defun org-babel-expand-body:scheme (body params) "Expand BODY according to PARAMS, return the expanded body." - (let ((vars (org-babel--get-vars params))) - (if (> (length vars) 0) - (concat "(let (" - (mapconcat - (lambda (var) (format "%S" (print `(,(car var) ',(cdr var))))) - vars "\n ") - ")\n" body ")") - body))) - - -(defvar org-babel-scheme-repl-map (make-hash-table :test 'equal) + (let ((vars (org-babel--get-vars params)) + (prepends (cdr (assq :prologue params)))) + (concat (and prepends (concat prepends "\n")) + (if (null vars) body + (format "(let (%s)\n%s\n)" + (mapconcat + (lambda (var) + (format "%S" (print `(,(car var) ',(cdr var))))) + vars + "\n ") + body))))) + + +(defvar org-babel-scheme-repl-map (make-hash-table :test #'equal) "Map of scheme sessions to session names.") (defun org-babel-scheme-cleanse-repl-map () "Remove dead buffers from the REPL map." (maphash - (lambda (x y) - (when (not (buffer-name y)) - (remhash x org-babel-scheme-repl-map))) + (lambda (x y) (unless (buffer-name y) (remhash x org-babel-scheme-repl-map))) org-babel-scheme-repl-map)) (defun org-babel-scheme-get-session-buffer (session-name) @@ -112,12 +126,9 @@ If the session is unnamed (nil), generate a name. If the session is `none', use nil for the session name, and org-babel-scheme-execute-with-geiser will use a temporary session." - (let ((result - (cond ((not name) - (concat buffer " " (symbol-name impl) " REPL")) - ((string= name "none") nil) - (name)))) - result)) + (cond ((not name) (concat buffer " " (symbol-name impl) " REPL")) + ((string= name "none") nil) + (name))) (defmacro org-babel-scheme-capture-current-message (&rest body) "Capture current message in both interactive and noninteractive mode" @@ -145,37 +156,46 @@ is true; otherwise returns the last value." (with-temp-buffer (insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl)) (newline) - (insert (if output - (format "(with-output-to-string (lambda () %s))" code) - code)) + (insert code) (geiser-mode) - (let ((repl-buffer (save-current-buffer - (org-babel-scheme-get-repl impl repl)))) - (when (not (eq impl (org-babel-scheme-get-buffer-impl - (current-buffer)))) - (message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl) - (org-babel-scheme-get-buffer-impl (current-buffer)) - (symbolp (org-babel-scheme-get-buffer-impl - (current-buffer))))) - (setq geiser-repl--repl repl-buffer) - (setq geiser-impl--implementation nil) - (setq result (org-babel-scheme-capture-current-message - (geiser-eval-region (point-min) (point-max)))) - (setq result - (if (and (stringp result) (equal (substring result 0 3) "=> ")) - (replace-regexp-in-string "^=> " "" result) - "\"An error occurred.\"")) - (when (not repl) - (save-current-buffer (set-buffer repl-buffer) - (geiser-repl-exit)) - (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) - (kill-buffer repl-buffer)) - (setq result (if (or (string= result "#") - (string= result "#")) - nil - result)))) + (let ((geiser-repl-window-allow-split nil) + (geiser-repl-use-other-window nil)) + (let ((repl-buffer (save-current-buffer + (org-babel-scheme-get-repl impl repl)))) + (when (not (eq impl (org-babel-scheme-get-buffer-impl + (current-buffer)))) + (message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl) + (org-babel-scheme-get-buffer-impl (current-buffer)) + (symbolp (org-babel-scheme-get-buffer-impl + (current-buffer))))) + (setq geiser-repl--repl repl-buffer) + (setq geiser-impl--implementation nil) + (let ((geiser-debug-jump-to-debug-p nil) + (geiser-debug-show-debug-p nil)) + (let ((ret (geiser-eval-region (point-min) (point-max)))) + (setq result (if output + (geiser-eval--retort-output ret) + (geiser-eval--retort-result-str ret ""))))) + (when (not repl) + (save-current-buffer (set-buffer repl-buffer) + (geiser-repl-exit)) + (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) + (kill-buffer repl-buffer))))) result)) +(defun org-babel-scheme--table-or-string (results) + "Convert RESULTS into an appropriate elisp value. +If the results look like a list or tuple, then convert them into an +Emacs-lisp table, otherwise return the results as a string." + (let ((res (org-babel-script-escape results))) + (cond ((listp res) + (mapcar (lambda (el) + (if (or (null el) (eq el 'null)) + org-babel-scheme-null-to + el)) + res)) + (t res)))) + (defun org-babel-execute:scheme (body params) "Execute a block of Scheme code with org-babel. This function is called by `org-babel-execute-src-block'" @@ -184,24 +204,28 @@ This function is called by `org-babel-execute-src-block'" "^ ?\\*\\([^*]+\\)\\*" "\\1" (buffer-name source-buffer)))) (save-excursion - (org-babel-reassemble-table - (let* ((result-type (cdr (assq :result-type params))) - (impl (or (when (cdr (assq :scheme params)) - (intern (cdr (assq :scheme params)))) - geiser-default-implementation - (car geiser-active-implementations))) - (session (org-babel-scheme-make-session-name - source-buffer-name (cdr (assq :session params)) impl)) - (full-body (org-babel-expand-body:scheme body params))) - (org-babel-scheme-execute-with-geiser - full-body ; code - (string= result-type "output") ; output? - impl ; implementation - (and (not (string= session "none")) session))) ; session - (org-babel-pick-name (cdr (assq :colname-names params)) - (cdr (assq :colnames params))) - (org-babel-pick-name (cdr (assq :rowname-names params)) - (cdr (assq :rownames params))))))) + (let* ((result-type (cdr (assq :result-type params))) + (impl (or (when (cdr (assq :scheme params)) + (intern (cdr (assq :scheme params)))) + geiser-default-implementation + (car geiser-active-implementations))) + (session (org-babel-scheme-make-session-name + source-buffer-name (cdr (assq :session params)) impl)) + (full-body (org-babel-expand-body:scheme body params)) + (result + (org-babel-scheme-execute-with-geiser + full-body ; code + (string= result-type "output") ; output? + impl ; implementation + (and (not (string= session "none")) session)))) ; session + (let ((table + (org-babel-reassemble-table + result + (org-babel-pick-name (cdr (assq :colname-names params)) + (cdr (assq :colnames params))) + (org-babel-pick-name (cdr (assq :rowname-names params)) + (cdr (assq :rownames params)))))) + (org-babel-scheme--table-or-string table)))))) (provide 'ob-scheme) diff --git a/lisp/org/ob-sql.el b/lisp/org/ob-sql.el index 7c3ee120d77..9250825d4e5 100644 --- a/lisp/org/ob-sql.el +++ b/lisp/org/ob-sql.el @@ -43,15 +43,25 @@ ;; - colnames (default, nil, means "yes") ;; - result-params ;; - out-file +;; ;; The following are used but not really implemented for SQL: ;; - colname-names ;; - rownames ;; - rowname-names ;; +;; Engines supported: +;; - mysql +;; - dbi +;; - mssql +;; - sqsh +;; - postgresql +;; - oracle +;; - vertica +;; ;; TODO: ;; ;; - support for sessions -;; - support for more engines (currently only supports mysql) +;; - support for more engines ;; - what's a reasonable way to drop table data into SQL? ;; @@ -116,6 +126,28 @@ SQL Server on Windows and Linux platform." (when database (format "-d \"%s\"" database)))) " ")) +(defun org-babel-sql-dbstring-sqsh (host user password database) + "Make sqsh commmand line args for database connection. +\"sqsh\" is one method to access Sybase or MS SQL via Linux platform" + (mapconcat #'identity + (delq nil + (list (when host (format "-S \"%s\"" host)) + (when user (format "-U \"%s\"" user)) + (when password (format "-P \"%s\"" password)) + (when database (format "-D \"%s\"" database)))) + " ")) + +(defun org-babel-sql-dbstring-vertica (host port user password database) + "Make Vertica command line args for database connection. Pass nil to omit that arg." + (mapconcat #'identity + (delq nil + (list (when host (format "-h %s" host)) + (when port (format "-p %d" port)) + (when user (format "-U %s" user)) + (when password (format "-w %s" (shell-quote-argument password) )) + (when database (format "-d %s" database)))) + " ")) + (defun org-babel-sql-convert-standard-filename (file) "Convert FILE to OS standard file name. If in Cygwin environment, uses Cygwin specific function to @@ -179,6 +211,20 @@ footer=off -F \"\t\" %s -f %s -o %s %s" (org-babel-process-file-name in-file) (org-babel-process-file-name out-file) (or cmdline ""))) + (`sqsh (format "sqsh %s %s -i %s -o %s -m csv" + (or cmdline "") + (org-babel-sql-dbstring-sqsh + dbhost dbuser dbpassword database) + (org-babel-sql-convert-standard-filename + (org-babel-process-file-name in-file)) + (org-babel-sql-convert-standard-filename + (org-babel-process-file-name out-file)))) + (`vertica (format "vsql %s -f %s -o %s %s" + (org-babel-sql-dbstring-vertica + dbhost dbport dbuser dbpassword database) + (org-babel-process-file-name in-file) + (org-babel-process-file-name out-file) + (or cmdline ""))) (`oracle (format "sqlplus -s %s < %s > %s" (org-babel-sql-dbstring-oracle @@ -203,18 +249,21 @@ SET MARKUP HTML OFF SPOOL OFF SET COLSEP '|' ") - (`mssql "SET NOCOUNT ON + ((or `mssql `sqsh) "SET NOCOUNT ON ") + (`vertica "\\a\n") (_ "")) - (org-babel-expand-body:sql body params))) + (org-babel-expand-body:sql body params) + ;; "sqsh" requires "go" inserted at EOF. + (if (string= engine "sqsh") "\ngo" ""))) (org-babel-eval command "") (org-babel-result-cond result-params (with-temp-buffer (progn (insert-file-contents-literally out-file) (buffer-string))) (with-temp-buffer (cond - ((memq (intern engine) '(dbi mysql postgresql)) + ((memq (intern engine) '(dbi mysql postgresql sqsh vertica)) ;; Add header row delimiter after column-names header in first line (cond (colnames-p @@ -239,7 +288,7 @@ SET COLSEP '|' (goto-char (point-max)) (forward-char -1)) (write-file out-file)))) - (org-table-import out-file '(16)) + (org-table-import out-file (if (string= engine "sqsh") '(4) '(16))) (org-babel-reassemble-table (mapcar (lambda (x) (if (string= (car x) header-delim) diff --git a/lisp/org/ob-sqlite.el b/lisp/org/ob-sqlite.el index 50e8ac1ab90..38058274a9a 100644 --- a/lisp/org/ob-sqlite.el +++ b/lisp/org/ob-sqlite.el @@ -123,10 +123,7 @@ This function is called by `org-babel-execute-src-block'." (if (listp val) (let ((data-file (org-babel-temp-file "sqlite-data-"))) (with-temp-file data-file - (insert (orgtbl-to-csv - val '(:fmt (lambda (el) (if (stringp el) - el - (format "%S" el))))))) + (insert (orgtbl-to-csv val nil))) data-file) (if (stringp val) val (format "%S" val)))) body))) diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el index ed09ff563a8..adc6806766d 100644 --- a/lisp/org/ob-tangle.el +++ b/lisp/org/ob-tangle.el @@ -29,13 +29,13 @@ (require 'cl-lib) (require 'org-src) +(require 'org-macs) (declare-function make-directory "files" (dir &optional parents)) (declare-function org-at-heading-p "org" (&optional ignored)) (declare-function org-babel-update-block-body "ob-core" (new-body)) (declare-function org-back-to-heading "org" (&optional invisible-ok)) (declare-function org-before-first-heading-p "org" ()) -(declare-function org-edit-special "org" (&optional arg)) (declare-function org-element-at-point "org-element" ()) (declare-function org-element-type "org-element" (element)) (declare-function org-fill-template "org" (template alist)) @@ -45,7 +45,6 @@ (declare-function org-open-link-from-string "org" (s &optional arg reference-buffer)) (declare-function org-remove-indentation "org" (code &optional n)) (declare-function org-store-link "org" (arg)) -(declare-function org-string-nw-p "org-macs" (s)) (declare-function org-trim "org" (s &optional keep-lead)) (declare-function outline-previous-heading "outline" ()) (declare-function org-id-find "org-id" (id &optional markerp)) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index a1ff76b36db..cf7a4dbf38b 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -277,10 +277,7 @@ list are are :deadline List deadline due on that date. When the date is today, also list any deadlines past due, or due within - `org-deadline-warning-days'. `:deadline' must appear before - `:scheduled' if the setting of - `org-agenda-skip-scheduled-if-deadline-is-shown' is to have - any effect. + `org-deadline-warning-days'. :deadline* Same as above, but only include the deadline if it has an hour specification as [h]h:mm. @@ -327,12 +324,14 @@ the daily/weekly agenda, see `org-agenda-skip-function'.") (string)) (list :tag "Number of days in agenda" (const org-agenda-span) - (choice (const :tag "Day" day) - (const :tag "Week" week) - (const :tag "Fortnight" fortnight) - (const :tag "Month" month) - (const :tag "Year" year) - (integer :tag "Custom"))) + (list + (const :format "" quote) + (choice (const :tag "Day" day) + (const :tag "Week" week) + (const :tag "Fortnight" fortnight) + (const :tag "Month" month) + (const :tag "Year" year) + (integer :tag "Custom")))) (list :tag "Fixed starting date" (const org-agenda-start-day) (string :value "2007-11-01")) @@ -975,18 +974,6 @@ will only be dimmed." (const :tag "Dim to a gray face" t) (const :tag "Make invisible" invisible))) -(defcustom org-timeline-show-empty-dates 3 - "Non-nil means `org-timeline' also shows dates without an entry. -When nil, only the days which actually have entries are shown. -When t, all days between the first and the last date are shown. -When an integer, show also empty dates, but if there is a gap of more than -N days, just insert a special line indicating the size of the gap." - :group 'org-agenda-skip - :type '(choice - (const :tag "None" nil) - (const :tag "All" t) - (integer :tag "at most"))) - (defgroup org-agenda-startup nil "Options concerning initial settings in the Agenda in Org Mode." :tag "Org Agenda Startup" @@ -1081,7 +1068,7 @@ have been removed when this is called, as will any matches for regular expressions listed in `org-agenda-entry-text-exclude-regexps'.") (defvar org-agenda-include-inactive-timestamps nil - "Non-nil means include inactive time stamps in agenda and timeline. + "Non-nil means include inactive time stamps in agenda. Dynamically scoped.") (defgroup org-agenda-windows nil @@ -1155,17 +1142,17 @@ When nil, only the days which actually have entries are shown." (defcustom org-agenda-format-date 'org-agenda-format-date-aligned "Format string for displaying dates in the agenda. -Used by the daily/weekly agenda and by the timeline. This should be -a format string understood by `format-time-string', or a function returning -the formatted date as a string. The function must take a single argument, -a calendar-style date list like (month day year)." +Used by the daily/weekly agenda. This should be a format string +understood by `format-time-string', or a function returning the +formatted date as a string. The function must take a single +argument, a calendar-style date list like (month day year)." :group 'org-agenda-daily/weekly :type '(choice (string :tag "Format string") (function :tag "Function"))) (defun org-agenda-format-date-aligned (date) - "Format a DATE string for display in the daily/weekly agenda, or timeline. + "Format a DATE string for display in the daily/weekly agenda. This function makes sure that dates are aligned for easy reading." (require 'cal-iso) (let* ((dayname (calendar-day-name date)) @@ -1225,8 +1212,7 @@ For example, 9:30am would become 09:30 rather than 9:30." (defcustom org-agenda-weekend-days '(6 0) "Which days are weekend? -These days get the special face `org-agenda-date-weekend' in the agenda -and timeline buffers." +These days get the special face `org-agenda-date-weekend' in the agenda." :group 'org-agenda-daily/weekly :type '(set :greedy t (const :tag "Monday" 1) @@ -1260,17 +1246,43 @@ Custom commands can set this variable in the options section." :version "24.1" :type 'boolean) -(defcustom org-agenda-repeating-timestamp-show-all t - "Non-nil means show all occurrences of a repeating stamp in the agenda. -When set to a list of strings, only show occurrences of repeating -stamps for these TODO keywords. When nil, only one occurrence is -shown, either today or the nearest into the future." +(defcustom org-agenda-show-future-repeats t + "Non-nil shows repeated entries in the future part of the agenda. +When set to the symbol `next' only the first future repeat is shown." + :group 'org-agenda-daily/weekly + :type '(choice + (const :tag "Show all repeated entries" t) + (const :tag "Show next repeated entry" next) + (const :tag "Do not show repeated entries" nil)) + :version "26.1" + :package-version '(Org . "9.1") + :safe #'symbolp) + +(defcustom org-agenda-prefer-last-repeat nil + "Non-nil sets date for repeated entries to their last repeat. + +When nil, display SCHEDULED and DEADLINE dates at their base +date, and in today's agenda, as a reminder. Display plain +time-stamps, on the other hand, at every repeat date in the past +in addition to the base date. + +When non-nil, show a repeated entry at its latest repeat date, +possibly being today even if it wasn't marked as done. This +setting is useful if you do not always mark repeated entries as +done and, yet, consider that reaching repeat date starts the task +anew. + +When set to a list of strings, prefer last repeats only for +entries with these TODO keywords." :group 'org-agenda-daily/weekly :type '(choice - (const :tag "Show repeating stamps" t) - (repeat :tag "Show repeating stamps for these TODO keywords" - (string :tag "TODO Keyword")) - (const :tag "Don't show repeating stamps" nil))) + (const :tag "Prefer last repeat" t) + (const :tag "Prefer base date" nil) + (repeat :tag "Prefer last repeat for entries with these TODO keywords" + (string :tag "TODO keyword"))) + :version "26.1" + :package-version '(Org . "9.1") + :safe (lambda (x) (or (booleanp x) (consp x)))) (defcustom org-scheduled-past-days 10000 "Number of days to continue listing scheduled items not marked DONE. @@ -1278,7 +1290,19 @@ When an item is scheduled on a date, it shows up in the agenda on this day and will be listed until it is marked done or for the number of days given here." :group 'org-agenda-daily/weekly - :type 'integer) + :type 'integer + :safe 'integerp) + +(defcustom org-deadline-past-days 10000 + "Number of days to warn about missed deadlines. +When an item has deadline on a date, it shows up in the agenda on +this day and will appear as a reminder until it is marked DONE or +for the number of days given here." + :group 'org-agenda-daily/weekly + :type 'integer + :version "26.1" + :package-version '(Org . "9.1") + :safe 'integerp) (defcustom org-agenda-log-mode-items '(closed clock) "List of items that should be shown in agenda log mode. @@ -1421,7 +1445,7 @@ E.g. when this is set to 1, the search view will only show headlines of level 1. When set to 0, the default value, don't limit agenda view by outline level." :group 'org-agenda-search-view - :version "24.4" + :version "26.1" :package-version '(Org . "8.3") :type 'integer) @@ -1453,11 +1477,12 @@ the variable `org-agenda-time-grid'." (defcustom org-agenda-time-grid '((daily today require-timed) - "----------------" - (800 1000 1200 1400 1600 1800 2000)) + (800 1000 1200 1400 1600 1800 2000) + "......" + "----------------") "The settings for time grid for agenda display. -This is a list of three items. The first item is again a list. It contains +This is a list of four items. The first item is again a list. It contains symbols specifying conditions when the grid should be displayed: daily if the agenda shows a single day @@ -1466,10 +1491,14 @@ symbols specifying conditions when the grid should be displayed: require-timed show grid only if at least one item has a time specification remove-match skip grid times already present in an entry -The second item is a string which will be placed behind the grid time. +The second item is a list of integers, indicating the times that +should have a grid line. -The third item is a list of integers, indicating the times that should have -a grid line." +The third item is a string which will be placed right after the +times that have a grid line. + +The fourth item is a string placed after the grid times. This +will align with agenda items" :group 'org-agenda-time-grid :type '(list @@ -1481,8 +1510,9 @@ a grid line." require-timed) (const :tag "Skip grid times already present in an entry" remove-match)) - (string :tag "Grid String") - (repeat :tag "Grid Times" (integer :tag "Time")))) + (repeat :tag "Grid Times" (integer :tag "Time")) + (string :tag "Grid String (after agenda times)") + (string :tag "Grid String (aligns with agenda items)"))) (defcustom org-agenda-show-current-time-in-grid t "Non-nil means show the current time in the time grid." @@ -1610,13 +1640,12 @@ When nil, such items are sorted as 0 minutes effort." (defcustom org-agenda-prefix-format '((agenda . " %i %-12:c%?-12t% s") - (timeline . " % s") (todo . " %i %-12:c") (tags . " %i %-12:c") (search . " %i %-12:c")) "Format specifications for the prefix of items in the agenda views. An alist with five entries, each for the different agenda types. The -keys of the sublists are `agenda', `timeline', `todo', `search' and `tags'. +keys of the sublists are `agenda', `todo', `search' and `tags'. The values are format strings. This format works similar to a printf format, with the following meaning: @@ -1669,11 +1698,12 @@ Custom commands can set this variable in the options section." (string :tag "General format") (list :greedy t :tag "View dependent" (cons (const agenda) (string :tag "Format")) - (cons (const timeline) (string :tag "Format")) (cons (const todo) (string :tag "Format")) (cons (const tags) (string :tag "Format")) (cons (const search) (string :tag "Format")))) - :group 'org-agenda-line-format) + :group 'org-agenda-line-format + :version "26.1" + :package-version '(Org . "9.1")) (defvar org-prefix-format-compiled nil "The compiled prefix format and associated variables. @@ -1795,7 +1825,7 @@ given agenda type. This can be set to a list of agenda types in which the agenda must display the inherited tags. Available types are `todo', -`agenda', `search' and `timeline'. +`agenda' and `search'. When set to nil, never show inherited tags in agenda lines." :group 'org-agenda-line-format @@ -1807,7 +1837,7 @@ When set to nil, never show inherited tags in agenda lines." (repeat :tag "Show inherited tags only in selected agenda types" (symbol :tag "Agenda type")))) -(defcustom org-agenda-use-tag-inheritance '(todo search timeline agenda) +(defcustom org-agenda-use-tag-inheritance '(todo search agenda) "List of agenda view types where to use tag inheritance. In tags/tags-todo/tags-tree agenda views, tag inheritance is @@ -1816,7 +1846,7 @@ controlled by `org-use-tag-inheritance'. In other agenda types, agenda entries. Still, you may want the agenda to be aware of the inherited tags anyway, e.g. for later tag filtering. -Allowed value are `todo', `search', `timeline' and `agenda'. +Allowed value are `todo', `search' and `agenda'. This variable has no effect if `org-agenda-show-inherited-tags' is set to `always'. In that case, the agenda is aware of those @@ -1825,7 +1855,8 @@ tags. The default value sets tags in every agenda type. Setting this option to nil will speed up non-tags agenda view a lot." :group 'org-agenda - :version "24.3" + :version "26.1" + :package-version '(Org . "9.1") :type '(choice (const :tag "Use tag inheritance in all agenda types" t) (repeat :tag "Use tag inheritance in selected agenda types" @@ -1854,13 +1885,21 @@ When this is the symbol `prefix', only remove tags when (defvaralias 'org-agenda-remove-tags-when-in-prefix 'org-agenda-remove-tags) -(defcustom org-agenda-tags-column -80 +(defcustom org-agenda-tags-column 'auto "Shift tags in agenda items to this column. -If this number is positive, it specifies the column. If it is negative, -it means that the tags should be flushright to that column. For example, --80 works well for a normal 80 character screen." +If set to `auto', tags will be automatically aligned to the right +edge of the window. + +If set to a positive number, tags will be left-aligned to that +column. If set to a negative number, tags will be right-aligned +to that column. For example, -80 works well for a normal 80 +character screen." :group 'org-agenda-line-format - :type 'integer) + :type '(choice + (const :tag "Automatically align to right edge of window" auto) + (integer :tag "Specific column" -80)) + :package-version '(Org . "9.1") + :version "26.1") (defvaralias 'org-agenda-align-tags-to-column 'org-agenda-tags-column) @@ -2259,7 +2298,7 @@ The following commands are available: (org-defkey org-agenda-mode-map "!" 'org-agenda-toggle-deadlines) (org-defkey org-agenda-mode-map "G" 'org-agenda-toggle-time-grid) (org-defkey org-agenda-mode-map "r" 'org-agenda-redo) -(org-defkey org-agenda-mode-map "g" (lambda () (interactive) (org-agenda-redo t))) +(org-defkey org-agenda-mode-map "g" 'org-agenda-redo-all) (org-defkey org-agenda-mode-map "e" 'org-agenda-set-effort) (org-defkey org-agenda-mode-map "\C-c\C-xe" 'org-agenda-set-effort) (org-defkey org-agenda-mode-map "\C-c\C-x\C-e" @@ -2310,6 +2349,7 @@ The following commands are available: (org-defkey org-agenda-mode-map "b" 'org-agenda-earlier) (org-defkey org-agenda-mode-map "\C-c\C-x\C-c" 'org-agenda-columns) (org-defkey org-agenda-mode-map "\C-c\C-x>" 'org-agenda-remove-restriction-lock) +(org-defkey org-agenda-mode-map "\C-c\C-x<" 'org-agenda-set-restriction-lock-from-agenda) (org-defkey org-agenda-mode-map "[" 'org-agenda-manipulate-query-add) (org-defkey org-agenda-mode-map "]" 'org-agenda-manipulate-query-subtract) @@ -2323,6 +2363,7 @@ The following commands are available: (org-defkey org-agenda-mode-map "<" 'org-agenda-filter-by-category) (org-defkey org-agenda-mode-map "^" 'org-agenda-filter-by-top-headline) (org-defkey org-agenda-mode-map ";" 'org-timer-set-timer) +(org-defkey org-agenda-mode-map "\C-c\C-x_" 'org-timer-stop) (define-key org-agenda-mode-map "?" 'org-agenda-show-the-flagging-note) (org-defkey org-agenda-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull) (org-defkey org-agenda-mode-map "\C-c\C-x\C-mp" 'org-mobile-push) @@ -2340,7 +2381,7 @@ The following commands are available: ("Agenda Files") "--" ("Agenda Dates" - ["Goto Today" org-agenda-goto-today (org-agenda-check-type nil 'agenda 'timeline)] + ["Goto Today" org-agenda-goto-today (org-agenda-check-type nil 'agenda)] ["Next Dates" org-agenda-later (org-agenda-check-type nil 'agenda)] ["Previous Dates" org-agenda-earlier (org-agenda-check-type nil 'agenda)] ["Jump to date" org-agenda-goto-date (org-agenda-check-type nil 'agenda)]) @@ -2386,7 +2427,7 @@ The following commands are available: "--" ["Show Logbook entries" org-agenda-log-mode :style toggle :selected org-agenda-show-log - :active (org-agenda-check-type nil 'agenda 'timeline) + :active (org-agenda-check-type nil 'agenda) :keys "v l (or just l)"] ["Include archived trees" org-agenda-archives-mode :style toggle :selected org-agenda-archives-mode :active t @@ -2443,13 +2484,13 @@ The following commands are available: ["Schedule" org-agenda-schedule t] ["Set Deadline" org-agenda-deadline t] "--" - ["Change Date +1 day" org-agenda-date-later (org-agenda-check-type nil 'agenda 'timeline)] - ["Change Date -1 day" org-agenda-date-earlier (org-agenda-check-type nil 'agenda 'timeline)] - ["Change Time +1 hour" org-agenda-do-date-later :active (org-agenda-check-type nil 'agenda 'timeline) :keys "C-u S-right"] - ["Change Time -1 hour" org-agenda-do-date-earlier :active (org-agenda-check-type nil 'agenda 'timeline) :keys "C-u S-left"] - ["Change Time + min" org-agenda-date-later :active (org-agenda-check-type nil 'agenda 'timeline) :keys "C-u C-u S-right"] - ["Change Time - min" org-agenda-date-earlier :active (org-agenda-check-type nil 'agenda 'timeline) :keys "C-u C-u S-left"] - ["Change Date to ..." org-agenda-date-prompt (org-agenda-check-type nil 'agenda 'timeline)]) + ["Change Date +1 day" org-agenda-date-later (org-agenda-check-type nil 'agenda)] + ["Change Date -1 day" org-agenda-date-earlier (org-agenda-check-type nil 'agenda)] + ["Change Time +1 hour" org-agenda-do-date-later :active (org-agenda-check-type nil 'agenda) :keys "C-u S-right"] + ["Change Time -1 hour" org-agenda-do-date-earlier :active (org-agenda-check-type nil 'agenda) :keys "C-u S-left"] + ["Change Time + min" org-agenda-date-later :active (org-agenda-check-type nil 'agenda) :keys "C-u C-u S-right"] + ["Change Time - min" org-agenda-date-earlier :active (org-agenda-check-type nil 'agenda) :keys "C-u C-u S-left"] + ["Change Date to ..." org-agenda-date-prompt (org-agenda-check-type nil 'agenda)]) ("Clock and Effort" ["Clock in" org-agenda-clock-in t] ["Clock out" org-agenda-clock-out t] @@ -2465,12 +2506,12 @@ The following commands are available: ["Decrease Priority" org-agenda-priority-down t] ["Show Priority" org-show-priority t]) ("Calendar/Diary" - ["New Diary Entry" org-agenda-diary-entry (org-agenda-check-type nil 'agenda 'timeline)] - ["Goto Calendar" org-agenda-goto-calendar (org-agenda-check-type nil 'agenda 'timeline)] - ["Phases of the Moon" org-agenda-phases-of-moon (org-agenda-check-type nil 'agenda 'timeline)] - ["Sunrise/Sunset" org-agenda-sunrise-sunset (org-agenda-check-type nil 'agenda 'timeline)] - ["Holidays" org-agenda-holidays (org-agenda-check-type nil 'agenda 'timeline)] - ["Convert" org-agenda-convert-date (org-agenda-check-type nil 'agenda 'timeline)] + ["New Diary Entry" org-agenda-diary-entry (org-agenda-check-type nil 'agenda)] + ["Goto Calendar" org-agenda-goto-calendar (org-agenda-check-type nil 'agenda)] + ["Phases of the Moon" org-agenda-phases-of-moon (org-agenda-check-type nil 'agenda)] + ["Sunrise/Sunset" org-agenda-sunrise-sunset (org-agenda-check-type nil 'agenda)] + ["Holidays" org-agenda-holidays (org-agenda-check-type nil 'agenda)] + ["Convert" org-agenda-convert-date (org-agenda-check-type nil 'agenda)] "--" ["Create iCalendar File" org-icalendar-combine-agenda-files t]) "--" @@ -2606,8 +2647,7 @@ type." (const agenda) (const todo) (const tags) - (const search) - (const timeline)) + (const search)) (integer :tag "Max number of entries"))))) (defcustom org-agenda-max-todos nil @@ -2625,8 +2665,7 @@ type." (const agenda) (const todo) (const tags) - (const search) - (const timeline)) + (const search)) (integer :tag "Max number of TODOs"))))) (defcustom org-agenda-max-tags nil @@ -2644,8 +2683,7 @@ type." (const agenda) (const todo) (const tags) - (const search) - (const timeline)) + (const search)) (integer :tag "Max number of tagged entries"))))) (defcustom org-agenda-max-effort nil @@ -2663,8 +2701,7 @@ to limit entries to in this type." (const agenda) (const todo) (const tags) - (const search) - (const timeline)) + (const search)) (integer :tag "Max number of minutes"))))) (defvar org-agenda-keep-restricted-file-list nil) @@ -2683,7 +2720,6 @@ T Call `org-todo-list' to display the global todo list, select only m Call `org-tags-view' to display headlines with tags matching a condition (the user is prompted for the condition). M Like `m', but select only TODO entries, no ordinary headlines. -L Create a timeline for the current buffer. e Export views to associated files. s Search entries for keywords. S Search entries for keywords, only with TODO keywords. @@ -2846,12 +2882,6 @@ Pressing `<' twice means to restrict to the current subtree or region (copy-sequence note)) nil 'face 'org-warning))))))) t t)) - ((equal org-keys "L") - (unless (derived-mode-p 'org-mode) - (user-error "This is not an Org file")) - (unless restriction - (put 'org-agenda-files 'org-restrict (list bfn)) - (org-call-with-arg 'org-timeline arg))) ((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects)) ((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files)) ((equal org-keys "!") (customize-variable 'org-stuck-projects)) @@ -2901,15 +2931,15 @@ Agenda views are separated by `org-agenda-block-separator'." (erase-buffer) (insert (eval-when-compile (let ((header - "Press key for an agenda command: < Buffer, subtree/region restriction --------------------------------- > Remove restriction -a Agenda for current week or day e Export agenda views -t List of all TODO entries T Entries with special TODO kwd -m Match a TAGS/PROP/TODO query M Like m, but only TODO entries -s Search for keywords S Like s, but only TODO entries -L Timeline for current buffer # List stuck projects (!=configure) -/ Multi-occur C Configure custom agenda commands -? Find :FLAGGED: entries * Toggle sticky agenda views + "Press key for an agenda command: +-------------------------------- < Buffer, subtree/region restriction +a Agenda for current week or day > Remove restriction +t List of all TODO entries e Export agenda views +m Match a TAGS/PROP/TODO query T Entries with special TODO kwd +s Search for keywords M Like m, but only TODO entries +/ Multi-occur S Like s, but only TODO entries +? Find :FLAGGED: entries C Configure custom agenda commands +* Toggle sticky agenda views # List stuck projects (!=configure) ") (start 0)) (while (string-match @@ -3344,6 +3374,7 @@ the agenda to write." (save-window-excursion (let ((bs (copy-sequence (buffer-string))) (extension (file-name-extension file)) + (default-directory (file-name-directory file)) beg content) (with-temp-buffer (rename-buffer org-agenda-write-buffer-name t) @@ -3374,7 +3405,8 @@ the agenda to write." (kill-buffer (current-buffer)) (message "Org file written to %s" file))) ((member extension '("html" "htm")) - (require 'htmlize) + (or (require 'htmlize nil t) + (error "Please install htmlize from https://github.com/hniksic/emacs-htmlize")) (set-buffer (htmlize-buffer (current-buffer))) (when org-agenda-export-html-style ;; replace