Revert "Replace insignificant backquotes" for Org files

Revert everything of commit 1808d254a5 "Replace insignificant
backquotes" that touches Org source files since these should not have
been changed.

* lisp/org/ob-C.el:
* lisp/org/ob-core.el:
* lisp/org/ob-exp.el:
* lisp/org/ob-groovy.el:
* lisp/org/ob-haskell.el:
* lisp/org/ob-io.el:
* lisp/org/ob-lisp.el:
* lisp/org/ob-lob.el:
* lisp/org/ob-lua.el:
* lisp/org/ob-octave.el:
* lisp/org/ob-perl.el:
* lisp/org/ob-python.el:
* lisp/org/ob-ref.el:
* lisp/org/ob-ruby.el:
* lisp/org/ob-sql.el:
* lisp/org/org-agenda.el:
* lisp/org/org-capture.el:
* lisp/org/org-clock.el:
* lisp/org/org-colview.el:
* lisp/org/org-duration.el:
* lisp/org/org-element.el:
* lisp/org/org-entities.el:
* lisp/org/org-gnus.el:
* lisp/org/org-indent.el:
* lisp/org/org-info.el:
* lisp/org/org-inlinetask.el:
* lisp/org/org-lint.el:
* lisp/org/org-list.el:
* lisp/org/org-mouse.el:
* lisp/org/org-plot.el:
* lisp/org/org-src.el:
* lisp/org/org-table.el:
* lisp/org/org.el:
* lisp/org/ox-ascii.el:
* lisp/org/ox-html.el:
* lisp/org/ox-latex.el:
* lisp/org/ox-man.el:
* lisp/org/ox-md.el:
* lisp/org/ox-org.el:
* lisp/org/ox-publish.el:
* lisp/org/ox-texinfo.el:
* lisp/org/ox.el: Undo changes made by commit "Replace insignificant
backquotes".
This commit is contained in:
Michael Heerdegen 2018-11-26 13:39:26 +01:00
parent 038b425cf0
commit d28118940c
42 changed files with 374 additions and 374 deletions

View file

@ -136,7 +136,7 @@ or `org-babel-execute:C++' or `org-babel-execute:D'."
(let* ((tmp-src-file (org-babel-temp-file
"C-src-"
(pcase org-babel-c-variant
('c ".c") ('cpp ".cpp") ('d ".d"))))
(`c ".c") (`cpp ".cpp") (`d ".d"))))
(tmp-bin-file ;not used for D
(org-babel-process-file-name
(org-babel-temp-file "C-bin-" org-babel-exeext)))
@ -154,29 +154,29 @@ or `org-babel-execute:C++' or `org-babel-execute:D'."
" "))
(full-body
(pcase org-babel-c-variant
('c (org-babel-C-expand-C body params))
('cpp (org-babel-C-expand-C++ body params))
('d (org-babel-C-expand-D body params)))))
(`c (org-babel-C-expand-C body params))
(`cpp (org-babel-C-expand-C++ body params))
(`d (org-babel-C-expand-D body params)))))
(with-temp-file tmp-src-file (insert full-body))
(pcase org-babel-c-variant
((or 'c 'cpp)
((or `c `cpp)
(org-babel-eval
(format "%s -o %s %s %s %s"
(pcase org-babel-c-variant
('c org-babel-C-compiler)
('cpp org-babel-C++-compiler))
(`c org-babel-C-compiler)
(`cpp org-babel-C++-compiler))
tmp-bin-file
flags
(org-babel-process-file-name tmp-src-file)
libs)
""))
('d nil)) ;; no separate compilation for D
(`d nil)) ;; no separate compilation for D
(let ((results
(org-babel-eval
(pcase org-babel-c-variant
((or 'c 'cpp)
((or `c `cpp)
(concat tmp-bin-file cmdline))
('d
(`d
(format "%s %s %s %s"
org-babel-D-compiler
flags
@ -323,9 +323,9 @@ FORMAT can be either a format string or a function which is called with VAL."
(let* ((basetype (org-babel-C-val-to-base-type val))
(type
(pcase basetype
('integerp '("int" "%d"))
('floatp '("double" "%f"))
('stringp
(`integerp '("int" "%d"))
(`floatp '("double" "%f"))
(`stringp
(list
(if (eq org-babel-c-variant 'd) "string" "const char*")
"\"%s\""))
@ -373,11 +373,11 @@ FORMAT can be either a format string or a function which is called with VAL."
(let ((type nil))
(mapc (lambda (v)
(pcase (org-babel-C-val-to-base-type v)
('stringp (setq type 'stringp))
('floatp
(`stringp (setq type 'stringp))
(`floatp
(if (or (not type) (eq type 'integerp))
(setq type 'floatp)))
('integerp
(`integerp
(unless type (setq type 'integerp)))))
val)
type))
@ -420,7 +420,7 @@ of the same value."
"Generate a utility function to convert a column name
into a column number."
(pcase org-babel-c-variant
((or 'c 'cpp)
((or `c `cpp)
"int get_column_num (int nbcols, const char** header, const char* column)
{
int c;
@ -430,7 +430,7 @@ into a column number."
return -1;
}
")
('d
(`d
"int get_column_num (string[] header, string column)
{
foreach (c, h; header)
@ -448,18 +448,18 @@ specifying a variable with the name of the table."
(concat
(format
(pcase org-babel-c-variant
((or 'c 'cpp) "const char* %s_header[%d] = {%s};")
('d "string %s_header[%d] = [%s];"))
((or `c `cpp) "const char* %s_header[%d] = {%s};")
(`d "string %s_header[%d] = [%s];"))
table
(length headers)
(mapconcat (lambda (h) (format "%S" h)) headers ","))
"\n"
(pcase org-babel-c-variant
((or 'c 'cpp)
((or `c `cpp)
(format
"const char* %s_h (int row, const char* col) { return %s[row][get_column_num(%d,%s_header,col)]; }"
table table (length headers) table))
('d
(`d
(format
"string %s_h (size_t row, string col) { return %s[row][get_column_num(%s_header,col)]; }"
table table table))))))

View file

@ -283,9 +283,9 @@ environment, to override this check."
(name (nth 4 info))
(name-string (if name (format " (%s) " name) " ")))
(pcase evalp
('nil nil)
('t t)
('query (or
(`nil nil)
(`t t)
(`query (or
(and (not (bound-and-true-p
org-babel-confirm-evaluate-answer-no))
(yes-or-no-p
@ -1991,7 +1991,7 @@ to HASH."
(catch :found
(org-with-wide-buffer
(pcase (org-element-type context)
((or 'inline-babel-call 'inline-src-block)
((or `inline-babel-call `inline-src-block)
;; Results for inline objects are located right after them.
;; There is no RESULTS line to insert either.
(let ((limit (org-element-property
@ -2013,7 +2013,7 @@ to HASH."
(skip-chars-backward " \t")
(point)))
(point))))))))
((or 'babel-call 'src-block)
((or `babel-call `src-block)
(let* ((name (org-element-property :name context))
(named-results (and name (org-babel-find-named-result name))))
(goto-char (or named-results (org-element-property :end context)))
@ -2067,20 +2067,20 @@ Return nil if ELEMENT cannot be read."
(org-with-wide-buffer
(goto-char (org-element-property :post-affiliated element))
(pcase (org-element-type element)
('fixed-width
(`fixed-width
(let ((v (org-trim (org-element-property :value element))))
(or (org-babel--string-to-number v) v)))
('table (org-babel-read-table))
('plain-list (org-babel-read-list))
('example-block
(`table (org-babel-read-table))
(`plain-list (org-babel-read-list))
(`example-block
(let ((v (org-element-property :value element)))
(if (or org-src-preserve-indentation
(org-element-property :preserve-indent element))
v
(org-remove-indentation v))))
('export-block
(`export-block
(org-remove-indentation (org-element-property :value element)))
('paragraph
(`paragraph
;; Treat paragraphs containing a single link specially.
(skip-chars-forward " \t")
(if (and (looking-at org-bracket-link-regexp)
@ -2093,7 +2093,7 @@ Return nil if ELEMENT cannot be read."
(buffer-substring-no-properties
(org-element-property :contents-begin element)
(org-element-property :contents-end element))))
((or 'center-block 'quote-block 'verse-block 'special-block)
((or `center-block `quote-block `verse-block `special-block)
(org-remove-indentation
(buffer-substring-no-properties
(org-element-property :contents-begin element)

View file

@ -175,7 +175,7 @@ this template."
;;
;; #+name: call_src
;; #+begin_src ...
((and (or 'babel-call 'src-block) (guard object?))
((and (or `babel-call `src-block) (guard object?))
nil)
(type type)))
(begin
@ -187,7 +187,7 @@ this template."
(skip-chars-backward " \r\t\n")
(point)))))
(pcase type
('inline-src-block
(`inline-src-block
(let* ((info
(org-babel-get-src-block-info nil element))
(params (nth 2 info)))
@ -215,7 +215,7 @@ this template."
;; insert value.
(delete-region begin end)
(insert replacement)))))
((or 'babel-call 'inline-babel-call)
((or `babel-call `inline-babel-call)
(org-babel-exp-do-export (org-babel-lob-get-info element)
'lob)
(let ((rep
@ -242,7 +242,7 @@ this template."
(goto-char begin)
(delete-region begin end)
(insert rep))))
('src-block
(`src-block
(let ((match-start (copy-marker (match-beginning 0)))
(ind (org-get-indentation)))
;; Take care of matched block: compute
@ -394,14 +394,14 @@ inhibit insertion of results into the buffer."
(nth 2 info)
`((:results . ,(if silent "silent" "replace")))))))
(pcase type
('block (org-babel-execute-src-block nil info))
('inline
(`block (org-babel-execute-src-block nil info))
(`inline
;; Position the point on the inline source block
;; allowing `org-babel-insert-result' to check that the
;; block is inline.
(goto-char (nth 5 info))
(org-babel-execute-src-block nil info))
('lob
(`lob
(save-excursion
(goto-char (nth 5 info))
(let (org-confirm-babel-evaluate)

View file

@ -83,12 +83,12 @@ If RESULT-TYPE equals `value' then return the value of the last statement
in BODY as elisp."
(when session (error "Sessions are not (yet) supported for Groovy"))
(pcase result-type
('output
(`output
(let ((src-file (org-babel-temp-file "groovy_")))
(progn (with-temp-file src-file (insert body))
(org-babel-eval
(concat org-babel-groovy-command " " src-file) ""))))
('value
(`value
(let* ((src-file (org-babel-temp-file "groovy_"))
(wrapper (format org-babel-groovy-wrapper-method body)))
(with-temp-file src-file (insert wrapper))

View file

@ -89,8 +89,8 @@
(org-babel-reassemble-table
(let ((result
(pcase result-type
('output (mapconcat #'identity (reverse (cdr results)) "\n"))
('value (car results)))))
(`output (mapconcat #'identity (reverse (cdr results)) "\n"))
(`value (car results)))))
(org-babel-result-cond (cdr (assq :result-params params))
result (org-babel-script-escape result)))
(org-babel-pick-name (cdr (assq :colname-names params))

View file

@ -74,14 +74,14 @@ If RESULT-TYPE equals `value' then return the value of the last statement
in BODY as elisp."
(when session (error "Sessions are not (yet) supported for Io"))
(pcase result-type
('output
(`output
(if (member "repl" result-params)
(org-babel-eval org-babel-io-command body)
(let ((src-file (org-babel-temp-file "io-")))
(progn (with-temp-file src-file (insert body))
(org-babel-eval
(concat org-babel-io-command " " src-file) "")))))
('value (let* ((src-file (org-babel-temp-file "io-"))
(`value (let* ((src-file (org-babel-temp-file "io-"))
(wrapper (format org-babel-io-wrapper-method body)))
(with-temp-file src-file (insert wrapper))
(let ((raw (org-babel-eval

View file

@ -87,8 +87,8 @@ current directory string."
BODY is the contents of the block, as a string. PARAMS is
a property list containing the parameters of the block."
(require (pcase org-babel-lisp-eval-fn
('slime-eval 'slime)
('sly-eval 'sly)))
(`slime-eval 'slime)
(`sly-eval 'sly)))
(org-babel-reassemble-table
(let ((result
(funcall (if (member "output" (cdr (assq :result-params params)))

View file

@ -105,8 +105,8 @@ after REF in the Library of Babel."
(when (equal name (org-element-property :name element))
(throw :found
(pcase (org-element-type element)
('src-block (org-babel-get-src-block-info t element))
('babel-call (org-babel-lob-get-info element))
(`src-block (org-babel-get-src-block-info t element))
(`babel-call (org-babel-lob-get-info element))
;; Non-executable data found. Since names
;; are supposed to be unique throughout
;; a document, bail out.

View file

@ -290,10 +290,10 @@ string. If RESULT-TYPE equals 'value then return the value of the
last statement in BODY, as elisp."
(let ((raw
(pcase result-type
('output (org-babel-eval org-babel-lua-command
(`output (org-babel-eval org-babel-lua-command
(concat (if preamble (concat preamble "\n"))
body)))
('value (let ((tmp-file (org-babel-temp-file "lua-")))
(`value (let ((tmp-file (org-babel-temp-file "lua-")))
(org-babel-eval
org-babel-lua-command
(concat
@ -364,7 +364,7 @@ fd:close()"
(funcall send-wait)))
(results
(pcase result-type
('output
(`output
(mapconcat
#'org-trim
(butlast
@ -375,7 +375,7 @@ fd:close()"
(insert org-babel-lua-eoe-indicator)
(funcall send-wait))
2) "\n"))
('value
(`value
(let ((tmp-file (org-babel-temp-file "lua-")))
(org-babel-comint-with-output
(session org-babel-lua-eoe-indicator nil body)

View file

@ -178,14 +178,14 @@ value of the last statement in BODY, as elisp."
org-babel-matlab-shell-command
org-babel-octave-shell-command)))
(pcase result-type
('output (org-babel-eval cmd body))
('value (let ((tmp-file (org-babel-temp-file "octave-")))
(org-babel-eval
cmd
(format org-babel-octave-wrapper-method body
(org-babel-process-file-name tmp-file 'noquote)
(org-babel-process-file-name tmp-file 'noquote)))
(org-babel-octave-import-elisp-from-file tmp-file))))))
(`output (org-babel-eval cmd body))
(`value (let ((tmp-file (org-babel-temp-file "octave-")))
(org-babel-eval
cmd
(format org-babel-octave-wrapper-method body
(org-babel-process-file-name tmp-file 'noquote)
(org-babel-process-file-name tmp-file 'noquote)))
(org-babel-octave-import-elisp-from-file tmp-file))))))
(defun org-babel-octave-evaluate-session
(session body result-type &optional matlabp)
@ -194,11 +194,11 @@ value of the last statement in BODY, as elisp."
(wait-file (org-babel-temp-file "matlab-emacs-link-wait-signal-"))
(full-body
(pcase result-type
('output
(`output
(mapconcat
#'org-babel-chomp
(list body org-babel-octave-eoe-indicator) "\n"))
('value
(`value
(if (and matlabp org-babel-matlab-with-emacs-link)
(concat
(format org-babel-matlab-emacs-link-wrapper-method
@ -232,9 +232,9 @@ value of the last statement in BODY, as elisp."
t full-body)
(insert full-body) (comint-send-input nil t)))) results)
(pcase result-type
('value
(`value
(org-babel-octave-import-elisp-from-file tmp-file))
('output
(`output
(setq results
(if matlabp
(cdr (reverse (delq "" (mapcar

View file

@ -136,12 +136,12 @@ return the value of the last statement in BODY, as elisp."
tmp-file 'noquote)))
(let ((results
(pcase result-type
('output
(`output
(with-temp-file tmp-file
(insert
(org-babel-eval org-babel-perl-command body))
(buffer-string)))
('value
(`value
(org-babel-eval org-babel-perl-command
(format org-babel-perl-wrapper-method
body tmp-babel-file))))))

View file

@ -265,10 +265,10 @@ string. If RESULT-TYPE equals `value' then return the value of the
last statement in BODY, as elisp."
(let ((raw
(pcase result-type
('output (org-babel-eval org-babel-python-command
(`output (org-babel-eval org-babel-python-command
(concat (if preamble (concat preamble "\n"))
body)))
('value (let ((tmp-file (org-babel-temp-file "python-")))
(`value (let ((tmp-file (org-babel-temp-file "python-")))
(org-babel-eval
org-babel-python-command
(concat
@ -314,7 +314,7 @@ last statement in BODY, as elisp."
(funcall send-wait)))
(results
(pcase result-type
('output
(`output
(let ((body (if (string-match-p ".\n+." body) ; Multiline
(let ((tmp-src-file (org-babel-temp-file
"python-")))
@ -332,7 +332,7 @@ last statement in BODY, as elisp."
(insert org-babel-python-eoe-indicator)
(funcall send-wait))
2) "\n")))
('value
(`value
(let ((tmp-file (org-babel-temp-file "python-")))
(org-babel-comint-with-output
(session org-babel-python-eoe-indicator nil body)

View file

@ -166,11 +166,11 @@ Emacs Lisp representation of the value of the variable."
(goto-char
(org-element-property :post-affiliated e))
(pcase (org-element-type e)
('babel-call
(`babel-call
(throw :found
(org-babel-execute-src-block
nil (org-babel-lob-get-info e) params)))
('src-block
(`src-block
(throw :found
(org-babel-execute-src-block
nil nil

View file

@ -200,8 +200,8 @@ return the value of the last statement in BODY, as elisp."
(if (not buffer)
;; external process evaluation
(pcase result-type
('output (org-babel-eval org-babel-ruby-command body))
('value (let ((tmp-file (org-babel-temp-file "ruby-")))
(`output (org-babel-eval org-babel-ruby-command body))
(`value (let ((tmp-file (org-babel-temp-file "ruby-")))
(org-babel-eval
org-babel-ruby-command
(format (if (member "pp" result-params)
@ -211,7 +211,7 @@ return the value of the last statement in BODY, as elisp."
(org-babel-eval-read-file tmp-file))))
;; comint session evaluation
(pcase result-type
('output
(`output
(let ((eoe-string (format "puts \"%s\"" org-babel-ruby-eoe-indicator)))
;; Force the session to be ready before the actual session
;; code is run. There is some problem in comint that will
@ -238,7 +238,7 @@ return the value of the last statement in BODY, as elisp."
"conf.prompt_mode=_org_prompt_mode;conf.echo=true"
eoe-string)))
"\n") "[\r\n]") 4) "\n")))
('value
(`value
(let* ((tmp-file (org-babel-temp-file "ruby-"))
(ppp (or (member "code" result-params)
(member "pp" result-params))))

View file

@ -175,16 +175,16 @@ This function is called by `org-babel-execute-src-block'."
(org-babel-temp-file "sql-out-")))
(header-delim "")
(command (pcase (intern engine)
('dbi (format "dbish --batch %s < %s | sed '%s' > %s"
(`dbi (format "dbish --batch %s < %s | sed '%s' > %s"
(or cmdline "")
(org-babel-process-file-name in-file)
"/^+/d;s/^|//;s/(NULL)/ /g;$d"
(org-babel-process-file-name out-file)))
('monetdb (format "mclient -f tab %s < %s > %s"
(`monetdb (format "mclient -f tab %s < %s > %s"
(or cmdline "")
(org-babel-process-file-name in-file)
(org-babel-process-file-name out-file)))
('mssql (format "sqlcmd %s -s \"\t\" %s -i %s -o %s"
(`mssql (format "sqlcmd %s -s \"\t\" %s -i %s -o %s"
(or cmdline "")
(org-babel-sql-dbstring-mssql
dbhost dbuser dbpassword database)
@ -192,14 +192,14 @@ This function is called by `org-babel-execute-src-block'."
(org-babel-process-file-name in-file))
(org-babel-sql-convert-standard-filename
(org-babel-process-file-name out-file))))
('mysql (format "mysql %s %s %s < %s > %s"
(`mysql (format "mysql %s %s %s < %s > %s"
(org-babel-sql-dbstring-mysql
dbhost dbport dbuser dbpassword database)
(if colnames-p "" "-N")
(or cmdline "")
(org-babel-process-file-name in-file)
(org-babel-process-file-name out-file)))
('postgresql (format
(`postgresql (format
"%spsql --set=\"ON_ERROR_STOP=1\" %s -A -P \
footer=off -F \"\t\" %s -f %s -o %s %s"
(if dbpassword
@ -211,7 +211,7 @@ 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"
(`sqsh (format "sqsh %s %s -i %s -o %s -m csv"
(or cmdline "")
(org-babel-sql-dbstring-sqsh
dbhost dbuser dbpassword database)
@ -219,13 +219,13 @@ footer=off -F \"\t\" %s -f %s -o %s %s"
(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
(`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
dbhost dbport dbuser dbpassword database)
@ -235,8 +235,8 @@ footer=off -F \"\t\" %s -f %s -o %s %s"
(with-temp-file in-file
(insert
(pcase (intern engine)
('dbi "/format partbox\n")
('oracle "SET PAGESIZE 50000
(`dbi "/format partbox\n")
(`oracle "SET PAGESIZE 50000
SET NEWPAGE 0
SET TAB OFF
SET SPACE 0
@ -249,10 +249,10 @@ SET MARKUP HTML OFF SPOOL OFF
SET COLSEP '|'
")
((or 'mssql 'sqsh) "SET NOCOUNT ON
((or `mssql `sqsh) "SET NOCOUNT ON
")
('vertica "\\a\n")
(`vertica "\\a\n")
(_ ""))
(org-babel-expand-body:sql body params)
;; "sqsh" requires "go" inserted at EOF.

View file

@ -6213,12 +6213,12 @@ scheduled items with an hour specification like [h]h:mm."
(or (not (memq (line-beginning-position 0) deadline-pos))
habitp))
nil)
('repeated-after-deadline
(`repeated-after-deadline
(let ((deadline (time-to-days
(org-get-deadline-time (point)))))
(and (<= schedule deadline) (> current deadline))))
('not-today pastschedp)
('t t)
(`not-today pastschedp)
(`t t)
(_ nil))
(throw :skip nil))
;; Skip habits if `org-habit-show-habits' is nil, or if we

View file

@ -1042,7 +1042,7 @@ Store them in the capture property list."
(org-capture-put :exact-position (point))
(setq target-entry-p
(and (derived-mode-p 'org-mode) (org-at-heading-p))))
('(clock)
(`(clock)
(if (and (markerp org-clock-hd-marker)
(marker-buffer org-clock-hd-marker))
(progn (set-buffer (marker-buffer org-clock-hd-marker))
@ -1101,11 +1101,11 @@ may have been stored before."
(goto-char (org-capture-get :pos))
(setq-local outline-level 'org-outline-level)
(pcase (org-capture-get :type)
((or 'nil 'entry) (org-capture-place-entry))
('table-line (org-capture-place-table-line))
('plain (org-capture-place-plain-text))
('item (org-capture-place-item))
('checkitem (org-capture-place-item)))
((or `nil `entry) (org-capture-place-entry))
(`table-line (org-capture-place-table-line))
(`plain (org-capture-place-plain-text))
(`item (org-capture-place-item))
(`checkitem (org-capture-place-item)))
(org-capture-mode 1)
(setq-local org-capture-current-plist org-capture-plist))
@ -1791,7 +1791,7 @@ The template may still contain \"%?\" for cursor positioning."
(let ((insert-fun (if (equal key "C") #'insert
(lambda (s) (org-insert-link 0 s)))))
(pcase org-capture--clipboards
('nil nil)
(`nil nil)
(`(,value) (funcall insert-fun value))
(`(,first-value . ,_)
(funcall insert-fun
@ -1811,7 +1811,7 @@ The template may still contain \"%?\" for cursor positioning."
time (or org-time-was-given upcase?)
(member key '("u" "U"))
nil nil (list org-end-time-was-given))))
('nil
(`nil
;; Load history list for current prompt.
(setq org-capture--prompt-history
(gethash prompt org-capture--prompt-history-table))

View file

@ -1692,11 +1692,11 @@ Optional argument N tells to change by that many units."
(org-timestamp-change
(round (/ (float-time tdiff)
(pcase timestamp?
('minute 60)
('hour 3600)
('day (* 24 3600))
('month (* 24 3600 31))
('year (* 24 3600 365.2)))))
(`minute 60)
(`hour 3600)
(`day (* 24 3600))
(`month (* 24 3600 31))
(`year (* 24 3600 365.2)))))
timestamp? 'updown)))))))
;;;###autoload
@ -2045,7 +2045,7 @@ in the buffer and update it."
(org-find-dblock "clocktable")
(org-show-entry))
(pcase (org-in-clocktable-p)
('nil
(`nil
(org-create-dblock
(org-combine-plists
(list :scope (if (org-before-first-heading-p) 'file 'subtree))
@ -2194,21 +2194,21 @@ have priority."
(error "Looking forward with quarters isn't implemented"))))
(when (= shift 0)
(pcase key
('yesterday (setq key 'today shift -1))
('lastweek (setq key 'week shift -1))
('lastmonth (setq key 'month shift -1))
('lastyear (setq key 'year shift -1))
('lastq (setq key 'quarter shift -1))))
(`yesterday (setq key 'today shift -1))
(`lastweek (setq key 'week shift -1))
(`lastmonth (setq key 'month shift -1))
(`lastyear (setq key 'year shift -1))
(`lastq (setq key 'quarter shift -1))))
;; Prepare start and end times depending on KEY's type.
(pcase key
((or 'day 'today) (setq m 0 h 0 h1 24 d (+ d shift)))
((or 'week 'thisweek)
((or `day `today) (setq m 0 h 0 h1 24 d (+ d shift)))
((or `week `thisweek)
(let* ((ws (or wstart 1))
(diff (+ (* -7 shift) (if (= dow 0) (- 7 ws) (- dow ws)))))
(setq m 0 h 0 d (- d diff) d1 (+ 7 d))))
((or 'month 'thismonth)
((or `month `thismonth)
(setq h 0 m 0 d (or mstart 1) month (+ month shift) month1 (1+ month)))
((or 'quarter 'thisq)
((or `quarter `thisq)
;; Compute if this shift remains in this year. If not, compute
;; how many years and quarters we have to shift (via floor*) and
;; compute the shifted years, months and quarters.
@ -2231,13 +2231,13 @@ have priority."
(setq shiftedy y)
(let ((qshift (* 3 (1- (+ q shift)))))
(setq m 0 h 0 d 1 month (+ 1 qshift) month1 (+ 4 qshift))))))
((or 'year 'thisyear)
((or `year `thisyear)
(setq m 0 h 0 d 1 month 1 y (+ y shift) y1 (1+ y)))
((or 'interactive 'untilnow)) ; Special cases, ignore them.
((or `interactive `untilnow)) ; Special cases, ignore them.
(_ (user-error "No such time block %s" key)))
;; Format start and end times according to AS-STRINGS.
(let* ((start (pcase key
('interactive (org-read-date nil t nil "Range start? "))
(`interactive (org-read-date nil t nil "Range start? "))
;; In theory, all clocks started after the dawn of
;; humanity. However, the platform's clock
;; support might not go back that far. Choose the
@ -2246,15 +2246,15 @@ have priority."
;; that works, otherwise 0 (1970). Going back
;; billions of years would loop forever on Mac OS
;; X 10.6 with Emacs 26 and earlier (Bug#27736).
('untilnow
(`untilnow
(let ((old 0))
(dolist (older '((-32768 0) (-33554432 0)) old)
(when (ignore-errors (decode-time older))
(setq old older)))))
(_ (encode-time 0 m h d month y))))
(end (pcase key
('interactive (org-read-date nil t nil "Range end? "))
('untilnow (current-time))
(`interactive (org-read-date nil t nil "Range end? "))
(`untilnow (current-time))
(_ (encode-time 0
(or m1 m)
(or h1 h)
@ -2263,15 +2263,15 @@ have priority."
(or y1 y)))))
(text
(pcase key
((or 'day 'today) (format-time-string "%A, %B %d, %Y" start))
((or 'week 'thisweek) (format-time-string "week %G-W%V" start))
((or 'month 'thismonth) (format-time-string "%B %Y" start))
((or 'year 'thisyear) (format-time-string "the year %Y" start))
((or 'quarter 'thisq)
((or `day `today) (format-time-string "%A, %B %d, %Y" start))
((or `week `thisweek) (format-time-string "week %G-W%V" start))
((or `month `thismonth) (format-time-string "%B %Y" start))
((or `year `thisyear) (format-time-string "the year %Y" start))
((or `quarter `thisq)
(concat (org-count-quarter shiftedq)
" quarter of " (number-to-string shiftedy)))
('interactive "(Range interactively set)")
('untilnow "now"))))
(`interactive "(Range interactively set)")
(`untilnow "now"))))
(if (not as-strings) (list start end text)
(let ((f (cdr org-time-stamp-formats)))
(list (format-time-string f start)
@ -2375,11 +2375,11 @@ the currently selected interval size."
(catch 'exit
(let* ((scope (plist-get params :scope))
(files (pcase scope
('agenda
(`agenda
(org-agenda-files t))
('agenda-with-archives
(`agenda-with-archives
(org-add-archive-files (org-agenda-files t)))
('file-with-archives
(`file-with-archives
(and buffer-file-name
(org-add-archive-files (list buffer-file-name))))
((pred functionp) (funcall scope))
@ -2502,7 +2502,7 @@ from the dynamic block definition."
(setq narrow (intern (format "%d!" narrow))))
(pcase narrow
((or 'nil (pred integerp)) nil) ;nothing to do
((or `nil (pred integerp)) nil) ;nothing to do
((and (pred symbolp)
(guard (string-match-p "\\`[0-9]+!\\'" (symbol-name narrow))))
(setq narrow-cut-p t)

View file

@ -1379,8 +1379,8 @@ PARAMS is a property list of parameters:
(let ((id (plist-get params :id))
view-file view-pos)
(pcase id
('global nil)
((or 'local 'nil) (setq view-pos (point)))
(`global nil)
((or `local `nil) (setq view-pos (point)))
((and (let id-string (format "%s" id))
(guard (string-match "^file:\\(.*\\)" id-string)))
(setq view-file (match-string-no-properties 1 id-string))

View file

@ -316,10 +316,10 @@ When optional argument CANONICAL is non-nil, ignore
Raise an error if expected format is unknown."
(pcase (or fmt org-duration-format)
('h:mm
(`h:mm
(let ((minutes (floor minutes)))
(format "%d:%02d" (/ minutes 60) (mod minutes 60))))
('h:mm:ss
(`h:mm:ss
(let* ((whole-minutes (floor minutes))
(seconds (floor (* 60 (- minutes whole-minutes)))))
(format "%s:%02d"
@ -328,7 +328,7 @@ Raise an error if expected format is unknown."
((pred atom) (error "Invalid duration format specification: %S" fmt))
;; Mixed format. Call recursively the function on both parts.
((and duration-format
(let `(special . ,(and mode (or 'h:mm:ss 'h:mm)))
(let `(special . ,(and mode (or `h:mm:ss `h:mm)))
(assq 'special duration-format)))
(let* ((truncated-format
;; Remove "special" mode from duration format in order to

View file

@ -588,9 +588,9 @@ is cleared and contents are removed in the process."
(when datum
(let ((type (org-element-type datum)))
(pcase type
('org-data (list 'org-data nil))
('plain-text (substring-no-properties datum))
('nil (copy-sequence datum))
(`org-data (list 'org-data nil))
(`plain-text (substring-no-properties datum))
(`nil (copy-sequence datum))
(_
(list type (plist-put (copy-sequence (nth 1 datum)) :parent nil)))))))
@ -1285,9 +1285,9 @@ CONTENTS is the contents of the element."
bullet
(and counter (format "[@%d] " counter))
(pcase checkbox
('on "[X] ")
('off "[ ] ")
('trans "[-] ")
(`on "[X] ")
(`off "[ ] ")
(`trans "[-] ")
(_ nil))
(and tag (format "%s :: " tag))
(when contents
@ -3185,13 +3185,13 @@ CONTENTS is the contents of the object, or nil."
;; a format string, escape percent signs
;; in description.
(replace-regexp-in-string "%" "%%" contents)))
((or 'bracket
'nil
((or `bracket
`nil
(guard (member type '("coderef" "custom-id" "fuzzy"))))
"[[%s]]")
;; Otherwise, just obey to `:format'.
('angle "<%s>")
('plain "%s")
(`angle "<%s>")
(`plain "%s")
(f (error "Wrong `:format' value: %s" f)))))
(format fmt
(pcase type
@ -3581,19 +3581,19 @@ Assume point is at the beginning of the timestamp."
(let* ((repeat-string
(concat
(pcase (org-element-property :repeater-type timestamp)
('cumulate "+") ('catch-up "++") ('restart ".+"))
(`cumulate "+") (`catch-up "++") (`restart ".+"))
(let ((val (org-element-property :repeater-value timestamp)))
(and val (number-to-string val)))
(pcase (org-element-property :repeater-unit timestamp)
('hour "h") ('day "d") ('week "w") ('month "m") ('year "y"))))
(`hour "h") (`day "d") (`week "w") (`month "m") (`year "y"))))
(warning-string
(concat
(pcase (org-element-property :warning-type timestamp)
('first "--") ('all "-"))
(`first "--") (`all "-"))
(let ((val (org-element-property :warning-value timestamp)))
(and val (number-to-string val)))
(pcase (org-element-property :warning-unit timestamp)
('hour "h") ('day "d") ('week "w") ('month "m") ('year "y"))))
(`hour "h") (`day "d") (`week "w") (`month "m") (`year "y"))))
(build-ts-string
;; Build an Org timestamp string from TIME. ACTIVEP is
;; non-nil when time stamp is active. If WITH-TIME-P is
@ -3622,7 +3622,7 @@ Assume point is at the beginning of the timestamp."
ts)))
(type (org-element-property :type timestamp)))
(pcase type
((or 'active 'inactive)
((or `active `inactive)
(let* ((minute-start (org-element-property :minute-start timestamp))
(minute-end (org-element-property :minute-end timestamp))
(hour-start (org-element-property :hour-start timestamp))
@ -3642,7 +3642,7 @@ Assume point is at the beginning of the timestamp."
(and hour-start minute-start)
(and time-range-p hour-end)
(and time-range-p minute-end))))
((or 'active-range 'inactive-range)
((or `active-range `inactive-range)
(let ((minute-start (org-element-property :minute-start timestamp))
(minute-end (org-element-property :minute-end timestamp))
(hour-start (org-element-property :hour-start timestamp))
@ -4227,17 +4227,17 @@ otherwise. Modes can be either `first-section', `item',
`table-row' or nil."
(if parentp
(pcase type
('headline 'section)
('inlinetask 'planning)
('plain-list 'item)
('property-drawer 'node-property)
('section 'planning)
('table 'table-row))
(`headline 'section)
(`inlinetask 'planning)
(`plain-list 'item)
(`property-drawer 'node-property)
(`section 'planning)
(`table 'table-row))
(pcase type
('item 'item)
('node-property 'node-property)
('planning 'property-drawer)
('table-row 'table-row))))
(`item 'item)
(`node-property 'node-property)
(`planning 'property-drawer)
(`table-row 'table-row))))
(defun org-element--parse-elements
(beg end mode structure granularity visible-only acc)
@ -5018,8 +5018,8 @@ the cache."
lower element
upper element)))))
(pcase side
('both (cons lower upper))
('nil lower)
(`both (cons lower upper))
(`nil lower)
(_ upper))))
(defun org-element--cache-put (element)
@ -5513,8 +5513,8 @@ that range. See `after-change-functions' for more information."
;; case for headline editing: if a headline is modified but
;; not removed, do not extend.
(when (pcase org-element--cache-change-warning
('t t)
('headline
(`t t)
(`headline
(not (and (org-with-limited-levels (org-at-heading-p))
(= (line-end-position) bottom))))
(_

View file

@ -38,7 +38,7 @@
(defun org-entities--user-safe-p (v)
"Non-nil if V is a safe value for `org-entities-user'."
(pcase v
('nil t)
(`nil t)
(`(,(and (pred stringp)
(pred (string-match-p "\\`[a-zA-Z][a-zA-Z0-9]*\\'")))
,(pred stringp) ,(pred booleanp) ,(pred stringp)

View file

@ -126,14 +126,14 @@ If `org-store-link' was called with a prefix arg the meaning of
(defun org-gnus-store-link ()
"Store a link to a Gnus folder or message."
(pcase major-mode
('gnus-group-mode
(`gnus-group-mode
(let ((group (gnus-group-group-name)))
(when group
(org-store-link-props :type "gnus" :group group)
(let ((description (org-gnus-group-link group)))
(org-add-link-props :link description :description description)
description))))
((or 'gnus-summary-mode 'gnus-article-mode)
((or `gnus-summary-mode `gnus-article-mode)
(let* ((group
(pcase (gnus-find-method-for-group gnus-newsgroup-name)
(`(nnvirtual . ,_)
@ -176,7 +176,7 @@ If `org-store-link' was called with a prefix arg the meaning of
(description (org-email-link-description)))
(org-add-link-props :link link :description description)
link)))
('message-mode
(`message-mode
(setq org-store-link-plist nil) ;reset
(save-excursion
(save-restriction

View file

@ -301,8 +301,8 @@ When optional argument HEADING is non-nil, assume line is at
a heading. Moreover, if is is `inlinetask', the first star will
have `org-warning' face."
(let* ((line (aref (pcase heading
('nil org-indent--text-line-prefixes)
('inlinetask org-indent--inlinetask-line-prefixes)
(`nil org-indent--text-line-prefixes)
(`inlinetask org-indent--inlinetask-line-prefixes)
(_ org-indent--heading-line-prefixes))
level))
(wrap

View file

@ -133,12 +133,12 @@ See `org-link-parameters' for details about PATH, DESC and FORMAT."
(manual (car parts))
(node (or (nth 1 parts) "Top")))
(pcase format
('html
(`html
(format "<a href=\"%s#%s\">%s</a>"
(org-info-map-html-url manual)
(org-info--expand-node-name node)
(or desc path)))
('texinfo
(`texinfo
(let ((title (or desc "")))
(format "@ref{%s,%s,,%s,}" node title manual)))
(_ nil))))

View file

@ -325,14 +325,14 @@ If the task has an end part, also demote it."
"Hide inline tasks in buffer when STATE is `contents' or `children'.
This function is meant to be used in `org-cycle-hook'."
(pcase state
('contents
(`contents
(let ((regexp (org-inlinetask-outline-regexp)))
(save-excursion
(goto-char (point-min))
(while (re-search-forward regexp nil t)
(org-inlinetask-toggle-visibility)
(org-inlinetask-goto-end)))))
('children
(`children
(save-excursion
(while
(or (org-inlinetask-at-task-p)

View file

@ -427,7 +427,7 @@ instead"
(lambda (datum)
(let ((key (org-element-property :key datum)))
(pcase (org-element-type datum)
('keyword
(`keyword
(let ((value (org-element-property :value datum)))
(and (string= key "PROPERTY")
(string-match deprecated-re value)
@ -435,7 +435,7 @@ instead"
(format "Deprecated syntax for \"%s\". \
Use header-args instead"
(match-string-no-properties 1 value))))))
('node-property
(`node-property
(and (member-ignore-case key deprecated-babel-properties)
(list
(org-element-property :begin datum)
@ -789,11 +789,11 @@ Use \"export %s\" instead"
(let ((name (org-trim (match-string-no-properties 0)))
(element (org-element-at-point)))
(pcase (org-element-type element)
((or 'drawer 'property-drawer)
((or `drawer `property-drawer)
(goto-char (org-element-property :end element))
nil)
((or 'comment-block 'example-block 'export-block 'src-block
'verse-block)
((or `comment-block `example-block `export-block `src-block
`verse-block)
nil)
(_
(push (list (line-beginning-position)
@ -920,7 +920,7 @@ Use \"export %s\" instead"
node-property src-block)
(lambda (datum)
(pcase (org-element-type datum)
((or 'babel-call 'inline-babel-call)
((or `babel-call `inline-babel-call)
(funcall verify
datum
nil
@ -928,13 +928,13 @@ Use \"export %s\" instead"
(list
(org-element-property :inside-header datum)
(org-element-property :end-header datum)))))
('inline-src-block
(`inline-src-block
(funcall verify
datum
(org-element-property :language datum)
(org-babel-parse-header-arguments
(org-element-property :parameters datum))))
('keyword
(`keyword
(when (string= (org-element-property :key datum) "PROPERTY")
(let ((value (org-element-property :value datum)))
(when (string-match "\\`header-args\\(?::\\(\\S-+\\)\\)?\\+? *"
@ -944,7 +944,7 @@ Use \"export %s\" instead"
(match-string 1 value)
(org-babel-parse-header-arguments
(substring value (match-end 0))))))))
('node-property
(`node-property
(let ((key (org-element-property :key datum)))
(when (let ((case-fold-search t))
(string-match "\\`HEADER-ARGS\\(?::\\(\\S-+\\)\\)?\\+?"
@ -954,7 +954,7 @@ Use \"export %s\" instead"
(match-string 1 key)
(org-babel-parse-header-arguments
(org-element-property :value datum))))))
('src-block
(`src-block
(funcall verify
datum
(org-element-property :language datum)
@ -980,13 +980,13 @@ Use \"export %s\" instead"
(org-babel-parse-header-arguments
(org-trim
(pcase type
('src-block
(`src-block
(mapconcat
#'identity
(cons (org-element-property :parameters datum)
(org-element-property :header datum))
" "))
('inline-src-block
(`inline-src-block
(or (org-element-property :parameters datum) ""))
(_
(concat
@ -1065,9 +1065,9 @@ Use \"export %s\" instead"
\\{org-lint--report-mode-map}"
(setf tabulated-list-format
`[("Line" 6
,(lambda (a b)
(< (string-to-number (aref (cadr a) 0))
(string-to-number (aref (cadr b) 0))))
(lambda (a b)
(< (string-to-number (aref (cadr a) 0))
(string-to-number (aref (cadr b) 0))))
:right-align t)
("Trust" 5 t)
("Warning" 0 t)])
@ -1207,8 +1207,8 @@ ARG can also be a list of checker names, as symbols, to run."
(message "Org linting process starting..."))
(let ((checkers
(pcase arg
('nil org-lint--checkers)
('(4)
(`nil org-lint--checkers)
(`(4)
(let ((category
(completing-read
"Checker category: "
@ -1218,7 +1218,7 @@ ARG can also be a list of checker names, as symbols, to run."
(lambda (c)
(assoc-string (org-lint-checker-categories c) category))
org-lint--checkers)))
('(16)
(`(16)
(list
(let ((name (completing-read
"Checker name: "

View file

@ -3438,15 +3438,15 @@ PARAMS is a plist used to tweak the behavior of the transcoder."
(start (and (not splice)
(org-list--generic-eval
(pcase type
('ordered ostart)
('unordered ustart)
(`ordered ostart)
(`unordered ustart)
(_ dstart))
depth)))
(end (and (not splice)
(org-list--generic-eval
(pcase type
('ordered oend)
('unordered uend)
(`ordered oend)
(`unordered uend)
(_ dend))
depth))))
;; Make sure trailing newlines in END appear in the output by
@ -3485,7 +3485,7 @@ PARAMS is a plist used to tweak the behavior of the transcoder."
(separator (and (org-export-get-next-element item info)
(org-list--generic-eval isep type depth)))
(closing (pcase (org-list--generic-eval iend type depth)
((or 'nil "") "\n")
((or `nil "") "\n")
((and (guard separator) s)
(if (equal (substring s -1) "\n") s (concat s "\n")))
(s s))))
@ -3510,9 +3510,9 @@ PARAMS is a plist used to tweak the behavior of the transcoder."
(or dtstart dtend ddstart ddend)))
(concat
(pcase (org-element-property :checkbox item)
('on cbon)
('off cboff)
('trans cbtrans))
(`on cbon)
(`off cboff)
(`trans cbtrans))
(and tag
(concat dtstart
(if backend
@ -3582,8 +3582,8 @@ with overruling parameters for `org-list-to-generic'."
LIST is as returned by `org-list-to-lisp'. PARAMS is a property
list with overruling parameters for `org-list-to-generic'."
(let* ((blank (pcase (cdr (assq 'heading org-blank-before-new-entry))
('t t)
('auto (save-excursion
(`t t)
(`auto (save-excursion
(org-with-limited-levels (outline-previous-heading))
(org-previous-line-empty-p)))))
(level (org-reduced-level (or (org-current-level) 0)))

View file

@ -416,7 +416,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
(let ((kwds org-todo-keywords-1))
(org-mouse-keyword-menu
kwds
(lambda (kwd) (org-todo kwd))
`(lambda (kwd) (org-todo kwd))
(lambda (kwd) (equal state kwd))))))
(defun org-mouse-tag-menu () ;todo
@ -461,11 +461,11 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
(defun org-mouse-agenda-type (type)
(pcase type
('tags "Tags: ")
('todo "TODO: ")
('tags-tree "Tags tree: ")
('todo-tree "TODO tree: ")
('occur-tree "Occur tree: ")
(`tags "Tags: ")
(`todo "TODO: ")
(`tags-tree "Tags tree: ")
(`todo-tree "TODO tree: ")
(`occur-tree "Occur tree: ")
(_ "Agenda command ???")))
(defun org-mouse-list-options-menu (alloptions &optional function)

View file

@ -200,9 +200,9 @@ manner suitable for prepending to a user-specified script."
(y-labels (plist-get params :ylabels))
(plot-str "'%s' using %s%d%s with %s title '%s'")
(plot-cmd (pcase type
('2d "plot")
('3d "splot")
('grid "splot")))
(`2d "plot")
(`3d "splot")
(`grid "splot")))
(script "reset")
;; ats = add-to-script
(ats (lambda (line) (setf script (concat script "\n" line))))
@ -211,9 +211,9 @@ manner suitable for prepending to a user-specified script."
(funcall ats (format "set term %s" (file-name-extension file)))
(funcall ats (format "set output '%s'" file)))
(pcase type ; type
('2d ())
('3d (when map (funcall ats "set map")))
('grid (funcall ats (if map "set pm3d map" "set pm3d"))))
(`2d ())
(`3d (when map (funcall ats "set map")))
(`grid (funcall ats (if map "set pm3d map" "set pm3d"))))
(when title (funcall ats (format "set title '%s'" title))) ; title
(mapc ats lines) ; line
(dolist (el sets) (funcall ats (format "set %s" el))) ; set
@ -239,7 +239,7 @@ manner suitable for prepending to a user-specified script."
"%Y-%m-%d-%H:%M:%S") "\"")))
(unless preface
(pcase type ; plot command
('2d (dotimes (col num-cols)
(`2d (dotimes (col num-cols)
(unless (and (eq type '2d)
(or (and ind (equal (1+ col) ind))
(and deps (not (member (1+ col) deps)))))
@ -255,10 +255,10 @@ manner suitable for prepending to a user-specified script."
(or (nth col col-labels)
(format "%d" (1+ col))))
plot-lines)))))
('3d
(`3d
(setq plot-lines (list (format "'%s' matrix with %s title ''"
data-file with))))
('grid
(`grid
(setq plot-lines (list (format "'%s' with %s title ''"
data-file with)))))
(funcall ats
@ -303,9 +303,9 @@ line directly before or after the table."
(setf params (org-plot/collect-options params))))
;; Dump table to datafile (very different for grid).
(pcase (plist-get params :plot-type)
('2d (org-plot/gnuplot-to-data table data-file params))
('3d (org-plot/gnuplot-to-data table data-file params))
('grid (let ((y-labels (org-plot/gnuplot-to-grid-data
(`2d (org-plot/gnuplot-to-data table data-file params))
(`3d (org-plot/gnuplot-to-data table data-file params))
(`grid (let ((y-labels (org-plot/gnuplot-to-grid-data
table data-file params)))
(when y-labels (plist-put params :ylabels y-labels)))))
;; Check for timestamp ind column.

View file

@ -742,24 +742,24 @@ If BUFFER is non-nil, test it instead."
(defun org-src-switch-to-buffer (buffer context)
(pcase org-src-window-setup
('current-window (pop-to-buffer-same-window buffer))
('other-window
(`current-window (pop-to-buffer-same-window buffer))
(`other-window
(switch-to-buffer-other-window buffer))
('other-frame
(`other-frame
(pcase context
('exit
(`exit
(let ((frame (selected-frame)))
(switch-to-buffer-other-frame buffer)
(delete-frame frame)))
('save
(`save
(kill-buffer (current-buffer))
(pop-to-buffer-same-window buffer))
(_ (switch-to-buffer-other-frame buffer))))
('reorganize-frame
(`reorganize-frame
(when (eq context 'edit) (delete-other-windows))
(org-switch-to-buffer-other-window buffer)
(when (eq context 'exit) (delete-other-windows)))
('switch-invisibly (set-buffer buffer))
(`switch-invisibly (set-buffer buffer))
(_
(message "Invalid value %s for `org-src-window-setup'"
org-src-window-setup)

View file

@ -5127,7 +5127,7 @@ information."
;; Make sure that contents are exported as Org data when :raw
;; parameter is non-nil.
,(when (and backend (plist-get params :raw))
'(setq contents
`(setq contents
;; Since we don't know what are the pseudo object
;; types defined in backend, we cannot pass them to
;; `org-element-interpret-data'. As a consequence,

View file

@ -5236,12 +5236,12 @@ When optional argument SKIP-KEY is non-nil, skip selection keys
next to tags."
(mapconcat (lambda (token)
(pcase token
('(:startgroup) "{")
('(:endgroup) "}")
('(:startgrouptag) "[")
('(:endgrouptag) "]")
('(:grouptags) ":")
('(:newline) "\\n")
(`(:startgroup) "{")
(`(:endgroup) "}")
(`(:startgrouptag) "[")
(`(:endgrouptag) "]")
(`(:grouptags) ":")
(`(:newline) "\\n")
((and
(guard (not skip-key))
`(,(and tag (pred stringp)) . ,(and key (pred characterp))))
@ -5266,7 +5266,7 @@ a string, summarizing TAGS, as a list of strings."
(when (eq group-status 'append)
(push (nreverse current-group) groups))
(setq group-status nil current-group nil))
('(:grouptags) (setq group-status 'append))
(`(:grouptags) (setq group-status 'append))
((and `(,tag . ,_) (guard group-status))
(if (eq group-status 'append) (push tag current-group)
(setq current-group (list tag))))
@ -7744,7 +7744,7 @@ When NEXT is non-nil, check the next line instead."
When optional argument PARENT is non-nil, consider parent
headline instead of current one."
(pcase (assq 'heading org-blank-before-new-entry)
('(heading . auto)
(`(heading . auto)
(save-excursion
(org-with-limited-levels
(unless (and (org-before-first-heading-p)
@ -7884,7 +7884,7 @@ When NO-COMMENT is non-nil, don't include COMMENT string."
(let ((todo (and (not no-todo) (match-string 2)))
(priority (and (not no-priority) (match-string 3)))
(headline (pcase (match-string 4)
('nil "")
(`nil "")
((and (guard no-comment) h)
(replace-regexp-in-string
(eval-when-compile
@ -8768,7 +8768,7 @@ with the original repeater."
(template (buffer-substring beg end))
(shift-n (and doshift (string-to-number (match-string 1 shift))))
(shift-what (pcase (and doshift (match-string 2 shift))
('nil nil)
(`nil nil)
("d" 'day)
("w" (setq shift-n (* 7 shift-n)) 'day)
("m" 'month)
@ -9690,7 +9690,7 @@ active region."
(push (cons f (copy-sequence org-store-link-plist))
results-alist)))
(pcase results-alist
('nil nil)
(`nil nil)
(`((,_ . ,_)) t) ;single choice: nothing to do
(`((,name . ,_) . ,_)
;; Reinstate link plist associated to the chosen
@ -11552,13 +11552,13 @@ order.")
#'identity
(append
(pcase org-refile-use-outline-path
('file (list (file-name-nondirectory
(`file (list (file-name-nondirectory
(buffer-file-name
(buffer-base-buffer)))))
('full-file-path
(`full-file-path
(list (buffer-file-name
(buffer-base-buffer))))
('buffer-name
(`buffer-name
(list (buffer-name
(buffer-base-buffer))))
(_ nil))
@ -13251,14 +13251,14 @@ TYPE is either `deadline' or `scheduled'. See `org-deadline' or
old-date)
(match-string 1 old-date)))))
(pcase arg
('(4)
(`(4)
(when (and old-date log)
(org-add-log-setup (if deadline? 'deldeadline 'delschedule)
nil old-date log))
(org-remove-timestamp-with-keyword keyword)
(message (if deadline? "Item no longer has a deadline."
"Item is no longer scheduled.")))
('(16)
(`(16)
(save-excursion
(org-back-to-heading t)
(let ((regexp (if deadline? org-deadline-time-regexp
@ -14779,8 +14779,8 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
(nreverse (org-split-string tags ":")))))
res)
(pcase onoff
('off (setq current (delete tag current)))
((or 'on (guard (not (member tag current))))
(`off (setq current (delete tag current)))
((or `on (guard (not (member tag current))))
(setq res t)
(cl-pushnew tag current :test #'equal))
(_ (setq current (delete tag current))))
@ -14830,7 +14830,7 @@ If DATA is nil or the empty string, all tags are removed."
(interactive "sTags: ")
(let ((data
(pcase (if (stringp data) (org-trim data) data)
((or 'nil "") nil)
((or `nil "") nil)
((pred listp) (format ":%s:" (mapconcat #'identity data ":")))
((pred stringp)
(format ":%s:"
@ -17207,9 +17207,9 @@ The internal representation needed by the calendar is (month day year).
This is a wrapper to handle the brain-dead convention in calendar that
user function argument order change dependent on argument order."
(pcase calendar-date-style
('american (list arg1 arg2 arg3))
('european (list arg2 arg1 arg3))
('iso (list arg2 arg3 arg1))))
(`american (list arg1 arg2 arg3))
(`european (list arg2 arg1 arg3))
(`iso (list arg2 arg3 arg1))))
(defun org-eval-in-calendar (form &optional keepdate)
"Eval FORM in the calendar window and return to current window.
@ -18015,14 +18015,14 @@ When SUPPRESS-TMP-DELAY is non-nil, suppress delays like \"--2d\"."
(pcase origin-cat
;; `day' category ends before `hour' if any, or at the end
;; of the day name.
('day (min (or (match-beginning 7) (1- (match-end 5))) origin))
('hour (min (match-end 7) origin))
('minute (min (1- (match-end 8)) origin))
(`day (min (or (match-beginning 7) (1- (match-end 5))) origin))
(`hour (min (match-end 7) origin))
(`minute (min (1- (match-end 8)) origin))
((pred integerp) (min (1- (match-end 0)) origin))
;; Point was right after the time-stamp. However, the
;; time-stamp length might have changed, so refer to
;; (match-end 0) instead.
('after (match-end 0))
(`after (match-end 0))
;; `year' and `month' have both fixed size: point couldn't
;; have moved into another part.
(_ origin))))
@ -20709,7 +20709,7 @@ Otherwise, return a user error."
(let ((element (org-element-at-point)))
(barf-if-buffer-read-only)
(pcase (org-element-type element)
('src-block
(`src-block
(if (not arg) (org-edit-src-code)
(let* ((info (org-babel-get-src-block-info))
(lang (nth 0 info))
@ -20722,7 +20722,7 @@ Otherwise, return a user error."
(switch-to-buffer
(funcall (intern (concat "org-babel-prep-session:" lang))
session params))))))
('keyword
(`keyword
(if (member (org-element-property :key element) '("INCLUDE" "SETUPFILE"))
(org-open-link-from-string
(format "[[%s]]"
@ -20738,24 +20738,24 @@ Otherwise, return a user error."
(match-string 0 value))
(t (user-error "No valid file specified")))))))
(user-error "No special environment to edit here")))
('table
(`table
(if (eq (org-element-property :type element) 'table.el)
(org-edit-table.el)
(call-interactively 'org-table-edit-formulas)))
;; Only Org tables contain `table-row' type elements.
('table-row (call-interactively 'org-table-edit-formulas))
('example-block (org-edit-src-code))
('export-block (org-edit-export-block))
('fixed-width (org-edit-fixed-width-region))
('latex-environment (org-edit-latex-environment))
(`table-row (call-interactively 'org-table-edit-formulas))
(`example-block (org-edit-src-code))
(`export-block (org-edit-export-block))
(`fixed-width (org-edit-fixed-width-region))
(`latex-environment (org-edit-latex-environment))
(_
;; No notable element at point. Though, we may be at a link or
;; a footnote reference, which are objects. Thus, scan deeper.
(let ((context (org-element-context element)))
(pcase (org-element-type context)
('footnote-reference (org-edit-footnote-reference))
('inline-src-block (org-edit-inline-src-code))
('link (call-interactively #'ffap))
(`footnote-reference (org-edit-footnote-reference))
(`inline-src-block (org-edit-inline-src-code))
(`link (call-interactively #'ffap))
(_ (user-error "No special environment to edit here"))))))))
(defvar org-table-coordinate-overlays) ; defined in org-table.el
@ -20842,7 +20842,7 @@ This command does many different things, depending on context:
;; a src block. Hence, we first check if point is in such
;; a block and then if it is at a blank line.
(pcase type
((or 'inline-src-block 'src-block)
((or `inline-src-block `src-block)
(unless org-babel-no-eval-on-ctrl-c-ctrl-c
(org-babel-eval-wipe-error-buffer)
(org-babel-execute-src-block
@ -20852,22 +20852,22 @@ This command does many different things, depending on context:
(user-error
(substitute-command-keys
"`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))
((or 'babel-call 'inline-babel-call)
((or `babel-call `inline-babel-call)
(let ((info (org-babel-lob-get-info context)))
(when info (org-babel-execute-src-block nil info))))
('clock (org-clock-update-time-maybe))
('dynamic-block
(`clock (org-clock-update-time-maybe))
(`dynamic-block
(save-excursion
(goto-char (org-element-property :post-affiliated context))
(org-update-dblock)))
('footnote-definition
(`footnote-definition
(goto-char (org-element-property :post-affiliated context))
(call-interactively 'org-footnote-action))
('footnote-reference (call-interactively #'org-footnote-action))
((or 'headline 'inlinetask)
(`footnote-reference (call-interactively #'org-footnote-action))
((or `headline `inlinetask)
(save-excursion (goto-char (org-element-property :begin context))
(call-interactively #'org-set-tags)))
('item
(`item
;; At an item: `C-u C-u' sets checkbox to "[-]"
;; unconditionally, whereas `C-u' will toggle its presence.
;; Without a universal argument, if the item has a checkbox,
@ -20905,7 +20905,7 @@ This command does many different things, depending on context:
(when block-item
(message "Checkboxes were removed due to empty box at line %d"
(org-current-line block-item))))))
('keyword
(`keyword
(let ((org-inhibit-startup-visibility-stuff t)
(org-startup-align-all-tables nil))
(when (boundp 'org-table-coordinate-overlays)
@ -20913,7 +20913,7 @@ This command does many different things, depending on context:
(setq org-table-coordinate-overlays nil))
(org-save-outline-visibility 'use-markers (org-mode-restart)))
(message "Local setup has been refreshed"))
('plain-list
(`plain-list
;; At a plain list, with a double C-u argument, set
;; checkboxes of each item to "[-]", whereas a single one
;; will toggle their presence according to the state of the
@ -20946,13 +20946,13 @@ This command does many different things, depending on context:
struct (org-list-parents-alist struct) old-struct)
(org-update-checkbox-count-maybe)
(save-excursion (goto-char beginm) (org-list-send-list 'maybe))))
((or 'property-drawer 'node-property)
((or `property-drawer `node-property)
(call-interactively #'org-property-action))
('radio-target
(`radio-target
(call-interactively #'org-update-radio-target-regexp))
('statistics-cookie
(`statistics-cookie
(call-interactively #'org-update-statistics-cookies))
((or 'table 'table-cell 'table-row)
((or `table `table-cell `table-row)
;; At a table, recalculate every field and align it. Also
;; send the table if necessary. If the table has
;; a `table.el' type, just give up. At a table row or cell,
@ -20975,9 +20975,9 @@ Use `\\[org-edit-special]' to edit table.el tables"))
(cond (arg (call-interactively #'org-table-recalculate))
((org-table-maybe-recalculate-line))
(t (org-table-align))))))
((or 'timestamp (and 'planning (guard (org-at-timestamp-p 'lax))))
((or `timestamp (and `planning (guard (org-at-timestamp-p 'lax))))
(org-timestamp-change 0 'day))
((and 'nil (guard (org-at-heading-p)))
((and `nil (guard (org-at-heading-p)))
;; When point is on an unsupported object type, we can miss
;; the fact that it also is at a heading. Handle it here.
(call-interactively #'org-set-tags))

View file

@ -549,8 +549,8 @@ INFO is a plist used as a communication channel."
INFO is a plist used as a communication channel."
(pcase (org-element-type element)
;; Elements with an absolute width: `headline' and `inlinetask'.
('inlinetask (plist-get info :ascii-inlinetask-width))
('headline
(`inlinetask (plist-get info :ascii-inlinetask-width))
(`headline
(- (plist-get info :ascii-text-width)
(let ((low-level-rank (org-export-low-level-p element info)))
(if low-level-rank (* low-level-rank 2)
@ -624,8 +624,8 @@ Return value is a symbol among `left', `center', `right' and
(while (and (not justification)
(setq element (org-element-property :parent element)))
(pcase (org-element-type element)
('center-block (setq justification 'center))
('special-block
(`center-block (setq justification 'center))
(`special-block
(let ((name (org-element-property :type element)))
(cond ((string= name "JUSTIFYRIGHT") (setq justification 'right))
((string= name "JUSTIFYLEFT") (setq justification 'left)))))))
@ -724,8 +724,8 @@ caption keyword."
element info nil 'org-ascii--has-caption-p))
(title-fmt (org-ascii--translate
(pcase (org-element-type element)
('table "Table %d:")
('src-block "Listing %d:"))
(`table "Table %d:")
(`src-block "Listing %d:"))
info)))
(org-ascii--fill-string
(concat (format title-fmt reference)
@ -890,8 +890,8 @@ If DATUM is a string, consider it to be a file name, per
`org-export-resolve-id-link'. INFO is the communication channel,
as a plist."
(pcase (org-element-type datum)
('plain-text (format "See file %s" datum)) ;External file
('headline
(`plain-text (format "See file %s" datum)) ;External file
(`headline
(format (org-ascii--translate "See section %s" info)
(if (org-export-numbered-headline-p datum info)
(mapconcat #'number-to-string
@ -907,7 +907,7 @@ as a plist."
(org-element-lineage datum
'(headline paragraph src-block table) t)))
(pcase (org-element-type enumerable)
('headline
(`headline
(format (org-ascii--translate "See section %s" info)
(if (org-export-numbered-headline-p enumerable info)
(mapconcat #'number-to-string number ".")
@ -915,11 +915,11 @@ as a plist."
(org-element-property :title enumerable) info))))
((guard (not number))
(org-ascii--translate "Unknown reference" info))
('paragraph
(`paragraph
(format (org-ascii--translate "See figure %s" info) number))
('src-block
(`src-block
(format (org-ascii--translate "See listing %s" info) number))
('table
(`table
(format (org-ascii--translate "See table %s" info) number))
(_ (org-ascii--translate "Unknown reference" info)))))))
@ -970,9 +970,9 @@ channel."
INFO is a plist used as a communication channel."
(let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8)))
(pcase (org-element-property :checkbox item)
('on (if utf8p "" "[X] "))
('off (if utf8p "" "[ ] "))
('trans (if utf8p "" "[-] ")))))
(`on (if utf8p "" "[X] "))
(`off (if utf8p "" "[ ] "))
(`trans (if utf8p "" "[-] ")))))
@ -1450,11 +1450,11 @@ contextual information."
;; First parent of ITEM is always the plain-list. Get
;; `:type' property from it.
(pcase list-type
('descriptive
(`descriptive
(concat checkbox
(org-export-data (org-element-property :tag item)
info)))
('ordered
(`ordered
;; Return correct number for ITEM, paying attention to
;; counters.
(let* ((struct (org-element-property :structure item))
@ -1586,8 +1586,8 @@ INFO is a plist holding contextual information."
(format " (%s)"
(org-ascii--describe-datum destination info)))))
;; External file.
('plain-text destination)
('headline
(`plain-text destination)
(`headline
(if (org-export-numbered-headline-p destination info)
(mapconcat #'number-to-string
(org-export-get-headline-number destination info)

View file

@ -624,12 +624,12 @@ export back-end currently used."
(match-string 1 options)
default)))
(pcase opt
('path (setq template
(`path (setq template
(replace-regexp-in-string
"%SCRIPT_PATH" val template t t)))
('sdepth (when (integerp (read val))
(`sdepth (when (integerp (read val))
(setq sdepth (min (read val) sdepth))))
('tdepth (when (integerp (read val))
(`tdepth (when (integerp (read val))
(setq tdepth (min (read val) tdepth))))
(_ (setq val
(cond
@ -2739,19 +2739,19 @@ INFO is a plist holding contextual information. See
(extra-newline (if (and (org-string-nw-p contents) headline) "\n" "")))
(concat
(pcase type
('ordered
(`ordered
(let* ((counter term-counter-id)
(extra (if counter (format " value=\"%s\"" counter) "")))
(concat
(format "<li%s%s>" class extra)
(when headline (concat headline br)))))
('unordered
(`unordered
(let* ((id term-counter-id)
(extra (if id (format " id=\"%s\"" id) "")))
(concat
(format "<li%s%s>" class extra)
(when headline (concat headline br)))))
('descriptive
(`descriptive
(let* ((term term-counter-id))
(setq term (or term "(no term)"))
;; Check-boxes in descriptive lists are associated to tag.
@ -2763,9 +2763,9 @@ INFO is a plist holding contextual information. See
(and (org-string-nw-p contents) (org-trim contents))
extra-newline
(pcase type
('ordered "</li>")
('unordered "</li>")
('descriptive "</dd>")))))
(`ordered "</li>")
(`unordered "</li>")
(`descriptive "</dd>")))))
(defun org-html-item (item contents info)
"Transcode an ITEM element from Org to HTML.
@ -2902,8 +2902,8 @@ if its description is a single link targeting an image file."
(cons 'plain-text org-element-all-objects)
(lambda (obj)
(pcase (org-element-type obj)
('plain-text (org-string-nw-p obj))
('link (if (= link-count 1) t
(`plain-text (org-string-nw-p obj))
(`link (if (= link-count 1) t
(cl-incf link-count)
(not (org-export-inline-image-p
obj (plist-get info :html-inline-image-rules)))))
@ -2930,8 +2930,8 @@ images, set it to:
(lambda (paragraph) (org-element-property :caption paragraph))"
(let ((paragraph (pcase (org-element-type element)
('paragraph element)
('link (org-export-get-parent element)))))
(`paragraph element)
(`link (org-export-get-parent element)))))
(and (eq (org-element-type paragraph) 'paragraph)
(or (not (fboundp 'org-html-standalone-image-predicate))
(funcall org-html-standalone-image-predicate paragraph))
@ -2941,8 +2941,8 @@ images, set it to:
(cons 'plain-text org-element-all-objects)
(lambda (obj)
(when (pcase (org-element-type obj)
('plain-text (org-string-nw-p obj))
('link (or (> (cl-incf link-count) 1)
(`plain-text (org-string-nw-p obj))
(`link (or (> (cl-incf link-count) 1)
(not (org-html-inline-image-p obj info))))
(_ t))
(throw 'exit nil)))
@ -3046,7 +3046,7 @@ INFO is a plist holding contextual information. See
(org-export-resolve-id-link link info))))
(pcase (org-element-type destination)
;; ID link points to an external file.
('plain-text
(`plain-text
(let ((fragment (concat "ID-" path))
;; Treat links to ".org" files as ".html", if needed.
(path (funcall link-org-files-as-html-maybe
@ -3054,13 +3054,13 @@ INFO is a plist holding contextual information. See
(format "<a href=\"%s#%s\"%s>%s</a>"
path fragment attributes (or desc destination))))
;; Fuzzy link points nowhere.
('nil
(`nil
(format "<i>%s</i>"
(or desc
(org-export-data
(org-element-property :raw-link link) info))))
;; Link points to a headline.
('headline
(`headline
(let ((href (or (org-element-property :CUSTOM_ID destination)
(org-export-get-reference destination info)))
;; What description to use?
@ -3189,9 +3189,9 @@ the plist used as a communication channel."
CONTENTS is the contents of the list. INFO is a plist holding
contextual information."
(let* ((type (pcase (org-element-property :type plain-list)
('ordered "ol")
('unordered "ul")
('descriptive "dl")
(`ordered "ol")
(`unordered "ul")
(`descriptive "dl")
(other (error "Unknown HTML list type: %s" other))))
(class (format "org-%s" type))
(attributes (org-export-read-attribute :attr_html plain-list)))

View file

@ -2434,7 +2434,7 @@ used as a communication channel."
nil t))))
;; Return proper string, depending on FLOAT.
(pcase float
('wrap (format "\\begin{wrapfigure}%s
(`wrap (format "\\begin{wrapfigure}%s
%s%s
%s%s
%s\\end{wrapfigure}"
@ -2443,7 +2443,7 @@ used as a communication channel."
(if center "\\centering" "")
comment-include image-code
(if caption-above-p "" caption)))
('sideways (format "\\begin{sidewaysfigure}
(`sideways (format "\\begin{sidewaysfigure}
%s%s
%s%s
%s\\end{sidewaysfigure}"
@ -2451,7 +2451,7 @@ used as a communication channel."
(if center "\\centering" "")
comment-include image-code
(if caption-above-p "" caption)))
('multicolumn (format "\\begin{figure*}%s
(`multicolumn (format "\\begin{figure*}%s
%s%s
%s%s
%s\\end{figure*}"
@ -2460,7 +2460,7 @@ used as a communication channel."
(if center "\\centering" "")
comment-include image-code
(if caption-above-p "" caption)))
('figure (format "\\begin{figure}%s
(`figure (format "\\begin{figure}%s
%s%s
%s%s
%s\\end{figure}"
@ -2767,12 +2767,12 @@ containing export options. Modify DATA by side-effect and return it."
;; Non-nil when OBJ can be added to the latex math block B.
(lambda (obj b)
(pcase (org-element-type obj)
('entity (org-element-property :latex-math-p obj))
('latex-fragment
(`entity (org-element-property :latex-math-p obj))
(`latex-fragment
(let ((value (org-element-property :value obj)))
(or (string-prefix-p "\\(" value)
(string-match-p "\\`\\$[^$]" value))))
((and type (or 'subscript 'superscript))
((and type (or `subscript `superscript))
(not (memq type (mapcar #'org-element-type
(org-element-contents b)))))))))
(org-element-map data '(entity latex-fragment subscript superscript)

View file

@ -552,9 +552,9 @@ contextual information."
(let* ((bullet (org-element-property :bullet item))
(type (org-element-property :type (org-element-property :parent item)))
(checkbox (pcase (org-element-property :checkbox item)
('on "\\o'\\(sq\\(mu'")
('off "\\(sq ")
('trans "\\o'\\(sq\\(mi'")))
(`on "\\o'\\(sq\\(mu'")
(`off "\\(sq ")
(`trans "\\o'\\(sq\\(mi'")))
(tag (let ((tag (org-element-property :tag item)))
;; Check-boxes must belong to the tag.
@ -861,7 +861,7 @@ a communication channel."
(push "|" alignment))
(push
(concat (pcase (org-export-table-cell-alignment cell info)
('left "l") ('right "r") ('center "c"))
(`left "l") (`right "r") (`center "c"))
width
divider)
alignment)

View file

@ -339,9 +339,9 @@ a communication channel."
(concat bullet
(make-string (- 4 (length bullet)) ? )
(pcase (org-element-property :checkbox item)
('on "[X] ")
('trans "[-] ")
('off "[ ] "))
(`on "[X] ")
(`trans "[-] ")
(`off "[ ] "))
(let ((tag (org-element-property :tag item)))
(and tag (format "**%s:** "(org-export-data tag info))))
(and contents
@ -400,11 +400,11 @@ a communication channel."
(org-export-resolve-fuzzy-link link info)
(org-export-resolve-id-link link info))))
(pcase (org-element-type destination)
('plain-text ; External file.
(`plain-text ; External file.
(let ((path (funcall link-org-files-as-md destination)))
(if (not contents) (format "<%s>" path)
(format "[%s](%s)" contents path))))
('headline
(`headline
(format
"[%s](#%s)"
;; Description.

View file

@ -124,8 +124,8 @@ we make sure it is always called."
(let ((first-child (car (org-element-contents h)))
(new-section (org-element-create 'section)))
(pcase (org-element-type first-child)
('section nil)
('nil (org-element-adopt-elements h new-section))
(`section nil)
(`nil (org-element-adopt-elements h new-section))
(_ (org-element-insert-before new-section first-child))))))
tree)

View file

@ -618,7 +618,7 @@ files, when entire projects are published (see
(project-plist (cdr project))
(publishing-function
(pcase (org-publish-property :publishing-function project)
('nil (user-error "No publishing function chosen"))
(`nil (user-error "No publishing function chosen"))
((and f (pred listp)) f)
(f (list f))))
(base-dir
@ -703,7 +703,7 @@ return a string. Return value is a list as returned by
(file-name-as-directory
(org-publish-property :base-directory project)))))
(pcase style
('list
(`list
(cons 'unordered
(mapcar
(lambda (f)
@ -712,7 +712,7 @@ return a string. Return value is a list as returned by
style
project)))
files)))
('tree
(`tree
(letrec ((files-only (cl-remove-if #'directory-name-p files))
(directories (cl-remove-if-not #'directory-name-p files))
(subtree-to-list
@ -778,7 +778,7 @@ Default for SITEMAP-FILENAME is `sitemap.org'."
(let ((retval t))
;; First we sort files:
(pcase sort-files
('alphabetically
(`alphabetically
(let ((A (if (funcall org-file-p a)
(concat (file-name-directory a)
(org-publish-find-title a project))
@ -791,7 +791,7 @@ Default for SITEMAP-FILENAME is `sitemap.org'."
(if ignore-case
(not (string-lessp (upcase B) (upcase A)))
(not (string-lessp B A))))))
((or 'anti-chronologically 'chronologically)
((or `anti-chronologically `chronologically)
(let* ((adate (org-publish-find-date a project))
(bdate (org-publish-find-date b project))
(A (+ (ash (car adate) 16) (cadr adate)))
@ -800,7 +800,7 @@ Default for SITEMAP-FILENAME is `sitemap.org'."
(if (eq sort-files 'chronologically)
(<= A B)
(>= A B)))))
('nil nil)
(`nil nil)
(_ (user-error "Invalid sort value %s" sort-files)))
;; Directory-wise wins:
(when (memq sort-folders '(first last))
@ -1104,9 +1104,9 @@ publishing directory."
"[[%s][%s]]"
;; Destination.
(pcase (car target)
('nil (format "file:%s" file))
('id (format "id:%s" (cdr target)))
('custom-id (format "file:%s::#%s" file (cdr target)))
(`nil (format "file:%s" file))
(`id (format "id:%s" (cdr target)))
(`custom-id (format "file:%s::#%s" file (cdr target)))
(_ (format "file:%s::*%s" file (cdr target))))
;; Description.
(car (last entry)))))

View file

@ -452,10 +452,10 @@ This is used to choose a separator for constructs like \\verb."
INFO is a plist used as a communication channel. See
`org-texinfo-text-markup-alist' for details."
(pcase (cdr (assq markup org-texinfo-text-markup-alist))
('nil text) ;no markup: return raw text
('code (format "@code{%s}" (org-texinfo--sanitize-content text)))
('samp (format "@samp{%s}" (org-texinfo--sanitize-content text)))
('verb
(`nil text) ;no markup: return raw text
(`code (format "@code{%s}" (org-texinfo--sanitize-content text)))
(`samp (format "@samp{%s}" (org-texinfo--sanitize-content text)))
(`verb
(let ((separator (org-texinfo--find-verb-separator text)))
(format "@verb{%s%s%s}" separator text separator)))
;; Else use format string.
@ -872,7 +872,7 @@ contextual information."
unnumbered)
((org-export-numbered-headline-p headline info) numbered)
(t unnumbered)))
('nil 'plain-list)
(`nil 'plain-list)
(_ (user-error "Invalid Texinfo class specification: %S" class))))
(_ (user-error "Invalid Texinfo class specification: %S" class)))))))
@ -993,7 +993,7 @@ contextual information."
(list tag))))))
(format "%s\n%s"
(pcase items
('nil "@item")
(`nil "@item")
(`(,item) (concat "@item " item))
(`(,item . ,items)
(concat "@item " item "\n"
@ -1077,18 +1077,18 @@ INFO is a plist holding contextual information. See
(org-export-resolve-fuzzy-link link info)
(org-export-resolve-id-link link info))))
(pcase (org-element-type destination)
('nil
(`nil
(format org-texinfo-link-with-unknown-path-format
(org-texinfo--sanitize-content path)))
;; Id link points to an external file.
('plain-text
(`plain-text
(if desc (format "@uref{file://%s,%s}" destination desc)
(format "@uref{file://%s}" destination)))
((or 'headline
((or `headline
;; Targets within headlines cannot be turned into
;; @anchor{}, so we refer to the headline parent
;; directly.
(and 'target
(and `target
(guard (eq 'headline
(org-element-type
(org-element-property :parent destination))))))
@ -1547,9 +1547,9 @@ information."
(let ((value (org-texinfo-plain-text
(org-timestamp-translate timestamp) info)))
(pcase (org-element-property :type timestamp)
((or 'active 'active-range)
((or `active `active-range)
(format (plist-get info :texinfo-active-timestamp-format) value))
((or 'inactive 'inactive-range)
((or `inactive `inactive-range)
(format (plist-get info :texinfo-inactive-timestamp-format) value))
(_ (format (plist-get info :texinfo-diary-timestamp-format) value)))))

View file

@ -1954,8 +1954,8 @@ Return a string."
(progn ,@body)
(org-link-broken
(pcase (plist-get info :with-broken-links)
('nil (user-error "Unable to resolve link: %S" (nth 1 err)))
('mark (org-export-data
(`nil (user-error "Unable to resolve link: %S" (nth 1 err)))
(`mark (org-export-data
(format "[BROKEN LINK: %s]" (nth 1 err)) info))
(_ nil))))))
(let* ((type (org-element-type data))
@ -4278,7 +4278,7 @@ A search cell follows the pattern (TYPE . SEARCH) where
A search cell is the internal representation of a fuzzy link. It
ignores white spaces and statistics cookies, if applicable."
(pcase (org-element-type datum)
('headline
(`headline
(let ((title (split-string
(replace-regexp-in-string
"\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]" ""
@ -4289,7 +4289,7 @@ ignores white spaces and statistics cookies, if applicable."
(cons 'other title)
(let ((custom-id (org-element-property :custom-id datum)))
(and custom-id (cons 'custom-id custom-id)))))))
('target
(`target
(list (cons 'target (split-string (org-element-property :value datum)))))
((and (let name (org-element-property :name datum))
(guard name))