mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-19 19:37:58 +00:00
Backport: Update Org to v9.1.4
Please note this is a bugfix release. See etc/ORG-NEWS for details.
(cherry picked from commit 567b5efe1f)
This commit is contained in:
parent
5381c70b7a
commit
445eefd238
31 changed files with 562 additions and 461 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
@settitle The Org Manual
|
@settitle The Org Manual
|
||||||
@include docstyle.texi
|
@include docstyle.texi
|
||||||
|
|
||||||
@set VERSION 9.1.2
|
@set VERSION 9.1.4
|
||||||
@set DATE 2017-09-17
|
@set DATE 2017-09-17
|
||||||
|
|
||||||
@c Version and Contact Info
|
@c Version and Contact Info
|
||||||
|
|
@ -1299,7 +1299,7 @@ level, all sibling headings. With a double prefix argument, also show the
|
||||||
entire subtree of the parent.
|
entire subtree of the parent.
|
||||||
@cindex show branches, command
|
@cindex show branches, command
|
||||||
@orgcmd{C-c C-k,outline-show-branches}
|
@orgcmd{C-c C-k,outline-show-branches}
|
||||||
Expose all the headings of the subtree, CONTENT view for just one subtree.
|
Expose all the headings of the subtree, CONTENTS view for just one subtree.
|
||||||
@cindex show children, command
|
@cindex show children, command
|
||||||
@orgcmd{C-c @key{TAB},outline-show-children}
|
@orgcmd{C-c @key{TAB},outline-show-children}
|
||||||
Expose all direct children of the subtree. With a numeric prefix argument N,
|
Expose all direct children of the subtree. With a numeric prefix argument N,
|
||||||
|
|
@ -1461,10 +1461,10 @@ Demote current heading by one level.
|
||||||
Promote the current subtree by one level.
|
Promote the current subtree by one level.
|
||||||
@orgcmd{M-S-@key{right},org-demote-subtree}
|
@orgcmd{M-S-@key{right},org-demote-subtree}
|
||||||
Demote the current subtree by one level.
|
Demote the current subtree by one level.
|
||||||
@orgcmd{M-S-@key{up},org-move-subtree-up}
|
@orgcmd{M-@key{up},org-move-subtree-up}
|
||||||
Move subtree up (swap with previous subtree of same
|
Move subtree up (swap with previous subtree of same
|
||||||
level).
|
level).
|
||||||
@orgcmd{M-S-@key{down},org-move-subtree-down}
|
@orgcmd{M-@key{down},org-move-subtree-down}
|
||||||
Move subtree down (swap with next subtree of same level).
|
Move subtree down (swap with next subtree of same level).
|
||||||
@orgcmd{M-h,org-mark-element}
|
@orgcmd{M-h,org-mark-element}
|
||||||
Mark the element at point. Hitting repeatedly will mark subsequent elements
|
Mark the element at point. Hitting repeatedly will mark subsequent elements
|
||||||
|
|
@ -5818,8 +5818,7 @@ The following commands insert or update the dynamic block:
|
||||||
Insert a dynamic block capturing a column view. You will be prompted
|
Insert a dynamic block capturing a column view. You will be prompted
|
||||||
for the scope or ID of the view.
|
for the scope or ID of the view.
|
||||||
@orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update}
|
@orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update}
|
||||||
Update dynamic block at point. The cursor needs to be in the
|
Update dynamic block at point.
|
||||||
@code{#+BEGIN} line of the dynamic block.
|
|
||||||
@orgcmd{C-u C-c C-x C-u,org-update-all-dblocks}
|
@orgcmd{C-u C-c C-x C-u,org-update-all-dblocks}
|
||||||
Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
|
Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
|
||||||
you have several clock table blocks, column-capturing blocks or other dynamic
|
you have several clock table blocks, column-capturing blocks or other dynamic
|
||||||
|
|
@ -6604,8 +6603,7 @@ argument, jump to the first clock report in the current document and
|
||||||
update it. The clock table always includes also trees with
|
update it. The clock table always includes also trees with
|
||||||
@code{:ARCHIVE:} tag.
|
@code{:ARCHIVE:} tag.
|
||||||
@orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update}
|
@orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update}
|
||||||
Update dynamic block at point. The cursor needs to be in the
|
Update dynamic block at point.
|
||||||
@code{#+BEGIN} line of the dynamic block.
|
|
||||||
@orgkey{C-u C-c C-x C-u}
|
@orgkey{C-u C-c C-x C-u}
|
||||||
Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
|
Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
|
||||||
you have several clock table blocks in a buffer.
|
you have several clock table blocks in a buffer.
|
||||||
|
|
@ -7352,6 +7350,7 @@ gnus | %:group, @r{for messages also all email fiel
|
||||||
eww, w3, w3m | %:url
|
eww, w3, w3m | %:url
|
||||||
info | %:file %:node
|
info | %:file %:node
|
||||||
calendar | %:date
|
calendar | %:date
|
||||||
|
org-protocol | %:link %:description %:annotation
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
|
|
@ -7593,22 +7592,15 @@ javascript:location.href='org-protocol://store-link?url='+
|
||||||
@cindex capture protocol
|
@cindex capture protocol
|
||||||
@cindex protocol, capture
|
@cindex protocol, capture
|
||||||
|
|
||||||
@cindex capture, %:url placeholder
|
|
||||||
@cindex %:url template expansion in capture
|
|
||||||
@cindex capture, %:title placeholder
|
|
||||||
@cindex %:title template expansion in capture
|
|
||||||
Activating @code{capture} handler pops up a @samp{Capture} buffer and fills
|
Activating @code{capture} handler pops up a @samp{Capture} buffer and fills
|
||||||
the capture template associated to the @samp{X} key with them. The template
|
the capture template associated to the @samp{X} key with them.
|
||||||
refers to the data through @code{%:url} and @code{%:title} placeholders.
|
|
||||||
Moreover, any selected text in the browser is appended to the body of the
|
|
||||||
entry.
|
|
||||||
|
|
||||||
@example
|
@example
|
||||||
emacsclient org-protocol://capture?template=X?url=URL?title=TITLE?body=BODY
|
emacsclient org-protocol://capture?template=X?url=URL?title=TITLE?body=BODY
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
To use this feature, add a bookmark with an arbitrary name, e.g.
|
To use this feature, add a bookmark with an arbitrary name, e.g. @samp{Org:
|
||||||
@samp{Org: capture} and enter this as @samp{Location}:
|
capture} and enter this as @samp{Location}:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
javascript:location.href='org-protocol://template=x'+
|
javascript:location.href='org-protocol://template=x'+
|
||||||
|
|
@ -7622,6 +7614,21 @@ The result depends on the capture template used, which is set in the bookmark
|
||||||
itself, as in the example above, or in
|
itself, as in the example above, or in
|
||||||
@code{org-protocol-default-template-key}.
|
@code{org-protocol-default-template-key}.
|
||||||
|
|
||||||
|
@cindex capture, %:link placeholder
|
||||||
|
@cindex %:link template expansion in capture
|
||||||
|
@cindex capture, %:description placeholder
|
||||||
|
@cindex %:description template expansion in capture
|
||||||
|
@cindex capture, %:annotation placeholder
|
||||||
|
@cindex %:annotation template expansion in capture
|
||||||
|
The following template placeholders are available:
|
||||||
|
|
||||||
|
@example
|
||||||
|
%:link The URL
|
||||||
|
%:description The webpage title
|
||||||
|
%:annotation Equivalent to [[%:link][%:description]]
|
||||||
|
%i The selected text
|
||||||
|
@end example
|
||||||
|
|
||||||
@node @code{open-source} protocol
|
@node @code{open-source} protocol
|
||||||
@subsection @code{open-source} protocol
|
@subsection @code{open-source} protocol
|
||||||
@cindex open-source protocol
|
@cindex open-source protocol
|
||||||
|
|
@ -10782,8 +10789,9 @@ Toggle inclusion of inlinetasks (@code{org-export-with-inlinetasks}).
|
||||||
@cindex property, UNNUMBERED
|
@cindex property, UNNUMBERED
|
||||||
Toggle section-numbers (@code{org-export-with-section-numbers}). When set to
|
Toggle section-numbers (@code{org-export-with-section-numbers}). When set to
|
||||||
number @samp{n}, Org numbers only those headlines at level @samp{n} or above.
|
number @samp{n}, Org numbers only those headlines at level @samp{n} or above.
|
||||||
Set @code{UNNUMBERED} property to non-@code{nil} to disable numbering of
|
Setting @code{UNNUMBERED} property to non-@code{nil} disables numbering of
|
||||||
heading and subheadings entirely.
|
a heading. Since subheadings inherit from this property, it affects their
|
||||||
|
numbering, too.
|
||||||
|
|
||||||
@item p:
|
@item p:
|
||||||
@vindex org-export-with-planning
|
@vindex org-export-with-planning
|
||||||
|
|
|
||||||
|
|
@ -492,9 +492,6 @@ It used to be ~@samp~ but ~@asis~ is neutral and, therefore, more
|
||||||
suitable as a default value.
|
suitable as a default value.
|
||||||
*** Texinfo default process includes ~--no-split~ option
|
*** Texinfo default process includes ~--no-split~ option
|
||||||
*** New entities : ~\dollar~ and ~\USD~
|
*** New entities : ~\dollar~ and ~\USD~
|
||||||
*** ~org-parse-time-string~ accepts a new optional argument
|
|
||||||
=ZONE= specifies the current time zone.
|
|
||||||
*** ~org-time-string-to-seconds~ now accepts an optional =ZONE= argument
|
|
||||||
*** Support for date style URLs in =org-protocol://open-source=
|
*** Support for date style URLs in =org-protocol://open-source=
|
||||||
URLs like =https://cool-blog.com/2017/05/20/cool-post/= are
|
URLs like =https://cool-blog.com/2017/05/20/cool-post/= are
|
||||||
covered by rewrite rules.
|
covered by rewrite rules.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
% Reference Card for Org Mode
|
% Reference Card for Org Mode
|
||||||
\def\orgversionnumber{9.1.2}
|
\def\orgversionnumber{9.1.4}
|
||||||
\def\versionyear{2017} % latest update
|
\def\versionyear{2017} % latest update
|
||||||
\input emacsver.tex
|
\input emacsver.tex
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1765,15 +1765,17 @@ to `org-babel-named-src-block-regexp'."
|
||||||
|
|
||||||
(defun org-babel-src-block-names (&optional file)
|
(defun org-babel-src-block-names (&optional file)
|
||||||
"Returns the names of source blocks in FILE or the current buffer."
|
"Returns the names of source blocks in FILE or the current buffer."
|
||||||
(when file (find-file file))
|
(with-current-buffer (if file (find-file-noselect file) (current-buffer))
|
||||||
(save-excursion
|
(org-with-point-at 1
|
||||||
(goto-char (point-min))
|
(let ((regexp "^[ \t]*#\\+begin_src ")
|
||||||
(let* ((re (org-babel-named-src-block-regexp-for-name))
|
(case-fold-search t)
|
||||||
(names (and (looking-at re)
|
(names nil))
|
||||||
(list (match-string-no-properties 9)))))
|
(while (re-search-forward regexp nil t)
|
||||||
(while (ignore-errors (org-next-block 1 nil re))
|
(let ((element (org-element-at-point)))
|
||||||
(push (match-string-no-properties 9) names))
|
(when (eq 'src-block (org-element-type element))
|
||||||
names)))
|
(let ((name (org-element-property :name element)))
|
||||||
|
(when name (push name names))))))
|
||||||
|
names))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun org-babel-goto-named-result (name)
|
(defun org-babel-goto-named-result (name)
|
||||||
|
|
@ -2416,8 +2418,11 @@ INFO may provide the values of these header arguments (in the
|
||||||
(goto-char location)
|
(goto-char location)
|
||||||
(when (looking-at (concat org-babel-result-regexp ".*$"))
|
(when (looking-at (concat org-babel-result-regexp ".*$"))
|
||||||
(delete-region
|
(delete-region
|
||||||
(if keep-keyword (1+ (match-end 0)) (1- (match-beginning 0)))
|
(if keep-keyword (line-beginning-position 2)
|
||||||
(progn (forward-line 1) (org-babel-result-end))))))))
|
(save-excursion
|
||||||
|
(skip-chars-backward " \r\t\n")
|
||||||
|
(line-beginning-position 2)))
|
||||||
|
(progn (forward-line) (org-babel-result-end))))))))
|
||||||
|
|
||||||
(defun org-babel-remove-inline-result (&optional datum)
|
(defun org-babel-remove-inline-result (&optional datum)
|
||||||
"Remove the result of the current inline-src-block or babel call.
|
"Remove the result of the current inline-src-block or babel call.
|
||||||
|
|
@ -2454,24 +2459,21 @@ in the buffer."
|
||||||
|
|
||||||
(defun org-babel-result-end ()
|
(defun org-babel-result-end ()
|
||||||
"Return the point at the end of the current set of results."
|
"Return the point at the end of the current set of results."
|
||||||
(save-excursion
|
(cond ((looking-at-p "^[ \t]*$") (point)) ;no result
|
||||||
(cond
|
((looking-at-p (format "^[ \t]*%s[ \t]*$" org-bracket-link-regexp))
|
||||||
((org-at-table-p) (progn (goto-char (org-table-end)) (point)))
|
(line-beginning-position 2))
|
||||||
((org-at-item-p) (let* ((struct (org-list-struct))
|
(t
|
||||||
(prvs (org-list-prevs-alist struct)))
|
(let ((element (org-element-at-point)))
|
||||||
(org-list-get-list-end (point-at-bol) struct prvs)))
|
(if (memq (org-element-type element)
|
||||||
((let ((case-fold-search t)) (looking-at "^\\([ \t]*\\):results:"))
|
;; Possible results types.
|
||||||
(progn (re-search-forward (concat "^" (match-string 1) ":END:"))
|
'(drawer example-block export-block fixed-width item
|
||||||
(forward-char 1) (point)))
|
plain-list src-block table))
|
||||||
(t
|
(save-excursion
|
||||||
(let ((case-fold-search t))
|
(goto-char (min (point-max) ;for narrowed buffers
|
||||||
(if (looking-at (concat "[ \t]*#\\+begin_\\([^ \t\n\r]+\\)"))
|
(org-element-property :end element)))
|
||||||
(progn (re-search-forward (concat "[ \t]*#\\+end_" (match-string 1))
|
(skip-chars-backward " \r\t\n")
|
||||||
nil t)
|
(line-beginning-position 2))
|
||||||
(forward-char 1))
|
(point))))))
|
||||||
(while (looking-at "[ \t]*\\(: \\|:$\\|\\[\\[\\)")
|
|
||||||
(forward-line 1))))
|
|
||||||
(point)))))
|
|
||||||
|
|
||||||
(defun org-babel-result-to-file (result &optional description)
|
(defun org-babel-result-to-file (result &optional description)
|
||||||
"Convert RESULT into an `org-mode' link with optional DESCRIPTION.
|
"Convert RESULT into an `org-mode' link with optional DESCRIPTION.
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(require 'ob)
|
(require 'ob)
|
||||||
|
|
||||||
(declare-function org-time-string-to-time "org" (s &optional zone))
|
(declare-function org-time-string-to-time "org" (s))
|
||||||
(declare-function org-combine-plists "org" (&rest plists))
|
(declare-function org-combine-plists "org" (&rest plists))
|
||||||
(declare-function orgtbl-to-generic "org-table" (table params))
|
(declare-function orgtbl-to-generic "org-table" (table params))
|
||||||
(declare-function gnuplot-mode "ext:gnuplot-mode" ())
|
(declare-function gnuplot-mode "ext:gnuplot-mode" ())
|
||||||
|
|
|
||||||
|
|
@ -494,10 +494,9 @@ non-nil, return the full association list to be used by
|
||||||
link)
|
link)
|
||||||
source-name
|
source-name
|
||||||
params
|
params
|
||||||
(org-unescape-code-in-string
|
(if org-src-preserve-indentation
|
||||||
(if org-src-preserve-indentation
|
(org-trim body t)
|
||||||
(org-trim body t)
|
(org-trim (org-remove-indentation body)))
|
||||||
(org-trim (org-remove-indentation body))))
|
|
||||||
comment)))
|
comment)))
|
||||||
(if only-this-block
|
(if only-this-block
|
||||||
(list (cons src-lang (list result)))
|
(list (cons src-lang (list result)))
|
||||||
|
|
|
||||||
|
|
@ -606,8 +606,8 @@ subtree to see if any of the subtasks have project status.
|
||||||
See also the variable `org-tags-match-list-sublevels' which applies
|
See also the variable `org-tags-match-list-sublevels' which applies
|
||||||
to projects matched by this search as well.
|
to projects matched by this search as well.
|
||||||
|
|
||||||
After defining this variable, you may use `\\[org-agenda-list-stuck-projects]'
|
After defining this variable, you may use `org-agenda-list-stuck-projects'
|
||||||
\(bound to `C-c a #') to produce the list."
|
\(bound to `\\[org-agenda] #') to produce the list."
|
||||||
:group 'org-agenda-custom-commands
|
:group 'org-agenda-custom-commands
|
||||||
:type '(list
|
:type '(list
|
||||||
(string :tag "Tags/TODO match to identify a project")
|
(string :tag "Tags/TODO match to identify a project")
|
||||||
|
|
@ -2520,7 +2520,7 @@ The following commands are available:
|
||||||
("MobileOrg"
|
("MobileOrg"
|
||||||
["Push Files and Views" org-mobile-push t]
|
["Push Files and Views" org-mobile-push t]
|
||||||
["Get Captured and Flagged" org-mobile-pull t]
|
["Get Captured and Flagged" org-mobile-pull t]
|
||||||
["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "C-c a ?"]
|
["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "\\[org-agenda] ?"]
|
||||||
["Show note / unflag" org-agenda-show-the-flagging-note t]
|
["Show note / unflag" org-agenda-show-the-flagging-note t]
|
||||||
"--"
|
"--"
|
||||||
["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t])
|
["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t])
|
||||||
|
|
|
||||||
|
|
@ -381,10 +381,7 @@ direct children of this heading."
|
||||||
(point)
|
(point)
|
||||||
(concat "ARCHIVE_" (upcase (symbol-name item)))
|
(concat "ARCHIVE_" (upcase (symbol-name item)))
|
||||||
value))))
|
value))))
|
||||||
(widen)
|
(widen))))
|
||||||
;; Save and kill the buffer, if it is not the same
|
|
||||||
;; buffer.
|
|
||||||
(unless (eq this-buffer buffer) (save-buffer)))))
|
|
||||||
;; Here we are back in the original buffer. Everything seems
|
;; Here we are back in the original buffer. Everything seems
|
||||||
;; to have worked. So now run hooks, cut the tree and finish
|
;; to have worked. So now run hooks, cut the tree and finish
|
||||||
;; up.
|
;; up.
|
||||||
|
|
|
||||||
|
|
@ -507,7 +507,7 @@ This can be used after files have been added externally."
|
||||||
(let ((attach-dir (org-attach-dir)))
|
(let ((attach-dir (org-attach-dir)))
|
||||||
(when attach-dir
|
(when attach-dir
|
||||||
(let ((files (org-attach-file-list attach-dir)))
|
(let ((files (org-attach-file-list attach-dir)))
|
||||||
(and files (org-attach-tag))
|
(org-attach-tag (not files))
|
||||||
(when org-attach-file-list-property
|
(when org-attach-file-list-property
|
||||||
(dolist (file files)
|
(dolist (file files)
|
||||||
(unless (string-match "^\\.\\.?\\'" file)
|
(unless (string-match "^\\.\\.?\\'" file)
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,12 @@
|
||||||
(defvar org-capture-is-refiling nil
|
(defvar org-capture-is-refiling nil
|
||||||
"Non-nil when capture process is refiling an entry.")
|
"Non-nil when capture process is refiling an entry.")
|
||||||
|
|
||||||
|
(defvar org-capture--prompt-history-table (make-hash-table :test #'equal)
|
||||||
|
"Hash table for all history lists per prompt.")
|
||||||
|
|
||||||
|
(defvar org-capture--prompt-history nil
|
||||||
|
"History list for prompt placeholders.")
|
||||||
|
|
||||||
(defgroup org-capture nil
|
(defgroup org-capture nil
|
||||||
"Options concerning capturing new entries."
|
"Options concerning capturing new entries."
|
||||||
:tag "Org Capture"
|
:tag "Org Capture"
|
||||||
|
|
@ -1311,8 +1317,8 @@ Of course, if exact position has been required, just put it there."
|
||||||
|
|
||||||
(defun org-capture-mark-kill-region (beg end)
|
(defun org-capture-mark-kill-region (beg end)
|
||||||
"Mark the region that will have to be killed when aborting capture."
|
"Mark the region that will have to be killed when aborting capture."
|
||||||
(let ((m1 (move-marker (make-marker) beg))
|
(let ((m1 (copy-marker beg))
|
||||||
(m2 (move-marker (make-marker) end)))
|
(m2 (copy-marker end t)))
|
||||||
(org-capture-put :begin-marker m1)
|
(org-capture-put :begin-marker m1)
|
||||||
(org-capture-put :end-marker m2)))
|
(org-capture-put :end-marker m2)))
|
||||||
|
|
||||||
|
|
@ -1792,19 +1798,25 @@ The template may still contain \"%?\" for cursor positioning."
|
||||||
(let* ((upcase? (equal (upcase key) key))
|
(let* ((upcase? (equal (upcase key) key))
|
||||||
(org-end-time-was-given nil)
|
(org-end-time-was-given nil)
|
||||||
(time (org-read-date upcase? t nil prompt)))
|
(time (org-read-date upcase? t nil prompt)))
|
||||||
(let ((org-time-was-given upcase?))
|
(org-insert-time-stamp
|
||||||
(org-insert-time-stamp
|
time (or org-time-was-given upcase?)
|
||||||
time org-time-was-given
|
(member key '("u" "U"))
|
||||||
(member key '("u" "U"))
|
nil nil (list org-end-time-was-given))))
|
||||||
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))
|
||||||
(push (org-completing-read
|
(push (org-completing-read
|
||||||
(concat (or prompt "Enter string")
|
(concat (or prompt "Enter string")
|
||||||
(and default (format " [%s]" default))
|
(and default (format " [%s]" default))
|
||||||
": ")
|
": ")
|
||||||
completions nil nil nil nil default)
|
completions
|
||||||
|
nil nil nil 'org-capture--prompt-history default)
|
||||||
strings)
|
strings)
|
||||||
(insert (car strings)))
|
(insert (car strings))
|
||||||
|
;; Save updated history list for current prompt.
|
||||||
|
(puthash prompt org-capture--prompt-history
|
||||||
|
org-capture--prompt-history-table))
|
||||||
(_
|
(_
|
||||||
(error "Unknown template placeholder: \"%%^%s\""
|
(error "Unknown template placeholder: \"%%^%s\""
|
||||||
key))))))))
|
key))))))))
|
||||||
|
|
|
||||||
|
|
@ -1467,7 +1467,7 @@ The time is always returned as UTC."
|
||||||
(and (or (not cmt) (equal cmt "auto"))
|
(and (or (not cmt) (equal cmt "auto"))
|
||||||
lr))
|
lr))
|
||||||
(setq org--msg-extra "showing task time since last repeat.")
|
(setq org--msg-extra "showing task time since last repeat.")
|
||||||
(and lr (org-time-string-to-time lr t)))
|
(and lr (org-time-string-to-time lr)))
|
||||||
(t nil))))
|
(t nil))))
|
||||||
|
|
||||||
(defun org-clock-find-position (find-unclosed)
|
(defun org-clock-find-position (find-unclosed)
|
||||||
|
|
@ -1604,9 +1604,9 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
|
||||||
(insert "--")
|
(insert "--")
|
||||||
(setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive))
|
(setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive))
|
||||||
(setq s (- (float-time
|
(setq s (- (float-time
|
||||||
(apply #'encode-time (org-parse-time-string te nil t)))
|
(apply #'encode-time (org-parse-time-string te)))
|
||||||
(float-time
|
(float-time
|
||||||
(apply #'encode-time (org-parse-time-string ts nil t))))
|
(apply #'encode-time (org-parse-time-string ts))))
|
||||||
h (floor (/ s 3600))
|
h (floor (/ s 3600))
|
||||||
s (- s (* 3600 h))
|
s (- s (* 3600 h))
|
||||||
m (floor (/ s 60))
|
m (floor (/ s 60))
|
||||||
|
|
@ -1711,8 +1711,8 @@ Optional argument N tells to change by that many units."
|
||||||
(begts (if updatets1 begts1 begts2)))
|
(begts (if updatets1 begts1 begts2)))
|
||||||
(setq tdiff
|
(setq tdiff
|
||||||
(time-subtract
|
(time-subtract
|
||||||
(org-time-string-to-time org-last-changed-timestamp t)
|
(org-time-string-to-time org-last-changed-timestamp)
|
||||||
(org-time-string-to-time ts t)))
|
(org-time-string-to-time ts)))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char begts)
|
(goto-char begts)
|
||||||
(org-timestamp-change
|
(org-timestamp-change
|
||||||
|
|
@ -1820,10 +1820,10 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
|
||||||
(lmax 30)
|
(lmax 30)
|
||||||
(ltimes (make-vector lmax 0))
|
(ltimes (make-vector lmax 0))
|
||||||
(level 0)
|
(level 0)
|
||||||
(tstart (cond ((stringp tstart) (org-time-string-to-seconds tstart t))
|
(tstart (cond ((stringp tstart) (org-time-string-to-seconds tstart))
|
||||||
((consp tstart) (float-time tstart))
|
((consp tstart) (float-time tstart))
|
||||||
(t tstart)))
|
(t tstart)))
|
||||||
(tend (cond ((stringp tend) (org-time-string-to-seconds tend t))
|
(tend (cond ((stringp tend) (org-time-string-to-seconds tend))
|
||||||
((consp tend) (float-time tend))
|
((consp tend) (float-time tend))
|
||||||
(t tend)))
|
(t tend)))
|
||||||
(t1 0)
|
(t1 0)
|
||||||
|
|
@ -1840,11 +1840,10 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
|
||||||
(let* ((ts (float-time
|
(let* ((ts (float-time
|
||||||
(apply #'encode-time
|
(apply #'encode-time
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(org-parse-time-string
|
(org-parse-time-string (match-string 2))))))
|
||||||
(match-string 2) nil t)))))
|
|
||||||
(te (float-time
|
(te (float-time
|
||||||
(apply #'encode-time
|
(apply #'encode-time
|
||||||
(org-parse-time-string (match-string 3) nil t))))
|
(org-parse-time-string (match-string 3)))))
|
||||||
(dt (- (if tend (min te tend) te)
|
(dt (- (if tend (min te tend) te)
|
||||||
(if tstart (max ts tstart) ts))))
|
(if tstart (max ts tstart) ts))))
|
||||||
(when (> dt 0) (cl-incf t1 (floor (/ dt 60))))))
|
(when (> dt 0) (cl-incf t1 (floor (/ dt 60))))))
|
||||||
|
|
@ -2725,7 +2724,9 @@ LEVEL is an integer. Indent by two spaces per level above 1."
|
||||||
(setq te (float-time (apply #'encode-time (org-parse-time-string te))))))
|
(setq te (float-time (apply #'encode-time (org-parse-time-string te))))))
|
||||||
(setq tsb
|
(setq tsb
|
||||||
(if (eq step0 'week)
|
(if (eq step0 'week)
|
||||||
(- ts (* 86400 (- (nth 6 (decode-time (seconds-to-time ts))) ws)))
|
(let ((dow (nth 6 (decode-time (seconds-to-time ts)))))
|
||||||
|
(if (< dow ws) ts
|
||||||
|
(- ts (* 86400 (- dow ws)))))
|
||||||
ts))
|
ts))
|
||||||
(setq p1 (plist-put p1 :header ""))
|
(setq p1 (plist-put p1 :header ""))
|
||||||
(setq p1 (plist-put p1 :step nil))
|
(setq p1 (plist-put p1 :step nil))
|
||||||
|
|
@ -2735,9 +2736,14 @@ LEVEL is an integer. Indent by two spaces per level above 1."
|
||||||
(setq p1 (plist-put p1 :tstart (format-time-string
|
(setq p1 (plist-put p1 :tstart (format-time-string
|
||||||
(org-time-stamp-format nil t)
|
(org-time-stamp-format nil t)
|
||||||
(seconds-to-time (max tsb ts)))))
|
(seconds-to-time (max tsb ts)))))
|
||||||
|
(cl-incf tsb (let ((dow (nth 6 (decode-time (seconds-to-time tsb)))))
|
||||||
|
(if (or (eq step0 'day)
|
||||||
|
(= dow ws))
|
||||||
|
step
|
||||||
|
(* 86400 (- ws dow)))))
|
||||||
(setq p1 (plist-put p1 :tend (format-time-string
|
(setq p1 (plist-put p1 :tend (format-time-string
|
||||||
(org-time-stamp-format nil t)
|
(org-time-stamp-format nil t)
|
||||||
(seconds-to-time (min te (setq tsb (+ tsb step)))))))
|
(seconds-to-time (min te tsb)))))
|
||||||
(insert "\n" (if (eq step0 'day) "Daily report: "
|
(insert "\n" (if (eq step0 'day) "Daily report: "
|
||||||
"Weekly report starting on: ")
|
"Weekly report starting on: ")
|
||||||
(plist-get p1 :tstart) "\n")
|
(plist-get p1 :tstart) "\n")
|
||||||
|
|
@ -2895,9 +2901,9 @@ Otherwise, return nil."
|
||||||
(setq ts (match-string 1)
|
(setq ts (match-string 1)
|
||||||
te (match-string 3))
|
te (match-string 3))
|
||||||
(setq s (- (float-time
|
(setq s (- (float-time
|
||||||
(apply #'encode-time (org-parse-time-string te nil t)))
|
(apply #'encode-time (org-parse-time-string te)))
|
||||||
(float-time
|
(float-time
|
||||||
(apply #'encode-time (org-parse-time-string ts nil t))))
|
(apply #'encode-time (org-parse-time-string ts))))
|
||||||
neg (< s 0)
|
neg (< s 0)
|
||||||
s (abs s)
|
s (abs s)
|
||||||
h (floor (/ s 3600))
|
h (floor (/ s 3600))
|
||||||
|
|
|
||||||
|
|
@ -1070,7 +1070,7 @@ as a canonical duration, i.e., using units defined in
|
||||||
(cond
|
(cond
|
||||||
((string-match-p org-ts-regexp s)
|
((string-match-p org-ts-regexp s)
|
||||||
(/ (- org-columns--time
|
(/ (- org-columns--time
|
||||||
(float-time (apply #'encode-time (org-parse-time-string s nil t))))
|
(float-time (apply #'encode-time (org-parse-time-string s))))
|
||||||
60))
|
60))
|
||||||
((org-duration-p s) (org-duration-to-minutes s t)) ;skip user units
|
((org-duration-p s) (org-duration-to-minutes s t)) ;skip user units
|
||||||
(t (user-error "Invalid age: %S" s))))
|
(t (user-error "Invalid age: %S" s))))
|
||||||
|
|
|
||||||
|
|
@ -1308,23 +1308,19 @@ CONTENTS is the contents of the element."
|
||||||
(inlinetask-re (and (featurep 'org-inlinetask) "^\\*+ "))
|
(inlinetask-re (and (featurep 'org-inlinetask) "^\\*+ "))
|
||||||
items struct)
|
items struct)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(catch 'exit
|
(catch :exit
|
||||||
(while t
|
(while t
|
||||||
(cond
|
(cond
|
||||||
;; At limit: end all items.
|
;; At limit: end all items.
|
||||||
((>= (point) limit)
|
((>= (point) limit)
|
||||||
(throw 'exit
|
(let ((end (progn (skip-chars-backward " \r\t\n")
|
||||||
(let ((end (progn (skip-chars-backward " \r\t\n")
|
(line-beginning-position 2))))
|
||||||
(forward-line)
|
(dolist (item items) (setcar (nthcdr 6 item) end)))
|
||||||
(point))))
|
(throw :exit (sort (nconc items struct) #'car-less-than-car)))
|
||||||
(dolist (item items (sort (nconc items struct)
|
|
||||||
'car-less-than-car))
|
|
||||||
(setcar (nthcdr 6 item) end)))))
|
|
||||||
;; At list end: end all items.
|
;; At list end: end all items.
|
||||||
((looking-at org-list-end-re)
|
((looking-at org-list-end-re)
|
||||||
(throw 'exit (dolist (item items (sort (nconc items struct)
|
(dolist (item items) (setcar (nthcdr 6 item) (point)))
|
||||||
'car-less-than-car))
|
(throw :exit (sort (nconc items struct) #'car-less-than-car)))
|
||||||
(setcar (nthcdr 6 item) (point)))))
|
|
||||||
;; At a new item: end previous sibling.
|
;; At a new item: end previous sibling.
|
||||||
((looking-at item-re)
|
((looking-at item-re)
|
||||||
(let ((ind (save-excursion (skip-chars-forward " \t")
|
(let ((ind (save-excursion (skip-chars-forward " \t")
|
||||||
|
|
@ -1348,7 +1344,7 @@ CONTENTS is the contents of the element."
|
||||||
;; Ending position, unknown so far.
|
;; Ending position, unknown so far.
|
||||||
nil)))
|
nil)))
|
||||||
items))
|
items))
|
||||||
(forward-line 1))
|
(forward-line))
|
||||||
;; Skip empty lines.
|
;; Skip empty lines.
|
||||||
((looking-at "^[ \t]*$") (forward-line))
|
((looking-at "^[ \t]*$") (forward-line))
|
||||||
;; Skip inline tasks and blank lines along the way.
|
;; Skip inline tasks and blank lines along the way.
|
||||||
|
|
@ -1360,17 +1356,18 @@ CONTENTS is the contents of the element."
|
||||||
(goto-char origin)))))
|
(goto-char origin)))))
|
||||||
;; At some text line. Check if it ends any previous item.
|
;; At some text line. Check if it ends any previous item.
|
||||||
(t
|
(t
|
||||||
(let ((ind (save-excursion (skip-chars-forward " \t")
|
(let ((ind (save-excursion
|
||||||
(current-column))))
|
(skip-chars-forward " \t")
|
||||||
(when (<= ind top-ind)
|
(current-column)))
|
||||||
(skip-chars-backward " \r\t\n")
|
(end (save-excursion
|
||||||
(forward-line))
|
(skip-chars-backward " \r\t\n")
|
||||||
|
(line-beginning-position 2))))
|
||||||
(while (<= ind (nth 1 (car items)))
|
(while (<= ind (nth 1 (car items)))
|
||||||
(let ((item (pop items)))
|
(let ((item (pop items)))
|
||||||
(setcar (nthcdr 6 item) (line-beginning-position))
|
(setcar (nthcdr 6 item) end)
|
||||||
(push item struct)
|
(push item struct)
|
||||||
(unless items
|
(unless items
|
||||||
(throw 'exit (sort struct #'car-less-than-car))))))
|
(throw :exit (sort struct #'car-less-than-car))))))
|
||||||
;; Skip blocks (any type) and drawers contents.
|
;; Skip blocks (any type) and drawers contents.
|
||||||
(cond
|
(cond
|
||||||
((and (looking-at "[ \t]*#\\+BEGIN\\(:\\|_\\S-+\\)")
|
((and (looking-at "[ \t]*#\\+BEGIN\\(:\\|_\\S-+\\)")
|
||||||
|
|
|
||||||
|
|
@ -624,7 +624,7 @@ containing the properties `:guid' and `:item-full-text'."
|
||||||
end (and (re-search-forward "</item>" nil t)
|
end (and (re-search-forward "</item>" nil t)
|
||||||
(match-beginning 0)))
|
(match-beginning 0)))
|
||||||
(setq item (buffer-substring beg end)
|
(setq item (buffer-substring beg end)
|
||||||
guid (if (string-match "<guid\\>.*?>\\(.*?\\)</guid>" item)
|
guid (if (string-match "<guid\\>.*?>\\([^\000]*?\\)</guid>" item)
|
||||||
(xml-substitute-special (match-string-no-properties 1 item))))
|
(xml-substitute-special (match-string-no-properties 1 item))))
|
||||||
(setq entry (list :guid guid :item-full-text item))
|
(setq entry (list :guid guid :item-full-text item))
|
||||||
(push entry entries)
|
(push entry entries)
|
||||||
|
|
|
||||||
|
|
@ -31,15 +31,31 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'org)
|
(require 'gnus-sum)
|
||||||
(require 'gnus-util)
|
(require 'gnus-util)
|
||||||
|
(require 'nnheader)
|
||||||
|
(require 'nnir)
|
||||||
|
(require 'org)
|
||||||
|
|
||||||
|
|
||||||
;;; Declare external functions and variables
|
;;; Declare external functions and variables
|
||||||
|
|
||||||
|
(declare-function gnus-activate-group "gnus-start" (group &optional scan dont-check method dont-sub-check))
|
||||||
|
(declare-function gnus-find-method-for-group "gnus" (group &optional info))
|
||||||
|
(declare-function gnus-group-group-name "gnus-group")
|
||||||
|
(declare-function gnus-group-jump-to-group "gnus-group" (group &optional prompt))
|
||||||
|
(declare-function gnus-group-read-group "gnus-group" (&optional all no-article group select-articles))
|
||||||
(declare-function message-fetch-field "message" (header &optional not-all))
|
(declare-function message-fetch-field "message" (header &optional not-all))
|
||||||
|
(declare-function message-generate-headers "message" (headers))
|
||||||
|
(declare-function message-narrow-to-headers "message")
|
||||||
|
(declare-function message-tokenize-header "message" (header &optional separator))
|
||||||
|
(declare-function message-unquote-tokens "message" (elems))
|
||||||
(declare-function nnvirtual-map-article "nnvirtual" (article))
|
(declare-function nnvirtual-map-article "nnvirtual" (article))
|
||||||
|
|
||||||
|
(defvar gnus-newsgroup-name)
|
||||||
|
(defvar gnus-summary-buffer)
|
||||||
|
(defvar gnus-other-frame-object)
|
||||||
|
|
||||||
|
|
||||||
;;; Customization variables
|
;;; Customization variables
|
||||||
|
|
||||||
|
|
@ -120,9 +136,11 @@ If `org-store-link' was called with a prefix arg the meaning of
|
||||||
(let* ((group
|
(let* ((group
|
||||||
(pcase (gnus-find-method-for-group gnus-newsgroup-name)
|
(pcase (gnus-find-method-for-group gnus-newsgroup-name)
|
||||||
(`(nnvirtual . ,_)
|
(`(nnvirtual . ,_)
|
||||||
(car (nnvirtual-map-article (gnus-summary-article-number))))
|
(save-excursion
|
||||||
|
(car (nnvirtual-map-article (gnus-summary-article-number)))))
|
||||||
(`(nnir . ,_)
|
(`(nnir . ,_)
|
||||||
(nnir-article-group (gnus-summary-article-number)))
|
(save-excursion
|
||||||
|
(nnir-article-group (gnus-summary-article-number))))
|
||||||
(_ gnus-newsgroup-name)))
|
(_ gnus-newsgroup-name)))
|
||||||
(header (with-current-buffer gnus-summary-buffer
|
(header (with-current-buffer gnus-summary-buffer
|
||||||
(gnus-summary-article-header)))
|
(gnus-summary-article-header)))
|
||||||
|
|
|
||||||
|
|
@ -539,8 +539,7 @@ When FILES is given, scan these files instead."
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(progn
|
(progn
|
||||||
(insert-file-contents-literally org-id-locations-file)
|
(insert-file-contents org-id-locations-file)
|
||||||
(goto-char (point-min))
|
|
||||||
(setq org-id-locations (read (current-buffer))))
|
(setq org-id-locations (read (current-buffer))))
|
||||||
(error
|
(error
|
||||||
(message "Could not read org-id-values from %s. Setting it to nil."
|
(message "Could not read org-id-values from %s. Setting it to nil."
|
||||||
|
|
|
||||||
|
|
@ -50,18 +50,20 @@
|
||||||
|
|
||||||
(require 'org)
|
(require 'org)
|
||||||
|
|
||||||
;; Declare the function form ERC that we use.
|
|
||||||
(declare-function erc-current-logfile "erc-log" (&optional buffer))
|
|
||||||
(declare-function erc-prompt "erc" ())
|
|
||||||
(declare-function erc-default-target "erc" ())
|
|
||||||
(declare-function erc-channel-p "erc" (channel))
|
|
||||||
(declare-function erc-buffer-filter "erc" (predicate &optional proc))
|
(declare-function erc-buffer-filter "erc" (predicate &optional proc))
|
||||||
(declare-function erc-server-buffer "erc" ())
|
(declare-function erc-channel-p "erc" (channel))
|
||||||
(declare-function erc-get-server-nickname-list "erc" ())
|
|
||||||
(declare-function erc-cmd-JOIN "erc" (channel &optional key))
|
(declare-function erc-cmd-JOIN "erc" (channel &optional key))
|
||||||
|
(declare-function erc-current-logfile "erc-log" (&optional buffer))
|
||||||
|
(declare-function erc-default-target "erc" ())
|
||||||
|
(declare-function erc-get-server-nickname-list "erc" ())
|
||||||
|
(declare-function erc-logging-enabled "erc-log" (&optional buffer))
|
||||||
|
(declare-function erc-prompt "erc" ())
|
||||||
|
(declare-function erc-save-buffer-in-logs "erc-log" (&optional buffer))
|
||||||
|
(declare-function erc-server-buffer "erc" ())
|
||||||
|
|
||||||
(defvar org-irc-client 'erc
|
(defvar org-irc-client 'erc
|
||||||
"The IRC client to act on.")
|
"The IRC client to act on.")
|
||||||
|
|
||||||
(defvar org-irc-link-to-logs nil
|
(defvar org-irc-link-to-logs nil
|
||||||
"Non-nil will store a link to the logs, nil will store an irc: style link.")
|
"Non-nil will store a link to the logs, nil will store an irc: style link.")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@
|
||||||
(declare-function org-remove-indentation "org" (code &optional n))
|
(declare-function org-remove-indentation "org" (code &optional n))
|
||||||
(declare-function org-show-subtree "org" ())
|
(declare-function org-show-subtree "org" ())
|
||||||
(declare-function org-sort-remove-invisible "org" (S))
|
(declare-function org-sort-remove-invisible "org" (S))
|
||||||
(declare-function org-time-string-to-seconds "org" (s &optional zone))
|
(declare-function org-time-string-to-seconds "org" (s))
|
||||||
(declare-function org-timer-hms-to-secs "org-timer" (hms))
|
(declare-function org-timer-hms-to-secs "org-timer" (hms))
|
||||||
(declare-function org-timer-item "org-timer" (&optional arg))
|
(declare-function org-timer-item "org-timer" (&optional arg))
|
||||||
(declare-function org-trim "org" (s &optional keep-lead))
|
(declare-function org-trim "org" (s &optional keep-lead))
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ Otherwise, return nil."
|
||||||
SEPARATORS is a regular expression. When nil, it defaults to
|
SEPARATORS is a regular expression. When nil, it defaults to
|
||||||
\"[ \f\t\n\r\v]+\".
|
\"[ \f\t\n\r\v]+\".
|
||||||
|
|
||||||
Unlike to `split-string', matching SEPARATORS at the beginning
|
Unlike `split-string', matching SEPARATORS at the beginning and
|
||||||
and end of string are ignored."
|
end of string are ignored."
|
||||||
(let ((separators (or separators "[ \f\t\n\r\v]+")))
|
(let ((separators (or separators "[ \f\t\n\r\v]+")))
|
||||||
(when (string-match (concat "\\`" separators) string)
|
(when (string-match (concat "\\`" separators) string)
|
||||||
(setq string (replace-match "" nil nil string)))
|
(setq string (replace-match "" nil nil string)))
|
||||||
|
|
@ -108,16 +108,15 @@ text properties."
|
||||||
(value (if (stringp display) display
|
(value (if (stringp display) display
|
||||||
(cl-some #'stringp display))))
|
(cl-some #'stringp display))))
|
||||||
(when value
|
(when value
|
||||||
(apply
|
(apply #'propertize
|
||||||
#'propertize
|
;; Displayed string could contain
|
||||||
;; Displayed string could contain
|
;; invisible parts, but no nested
|
||||||
;; invisible parts, but no nested display.
|
;; display.
|
||||||
(funcall prune-invisible value)
|
(funcall prune-invisible value)
|
||||||
(plist-put props
|
'display
|
||||||
'display
|
(and (not (stringp display))
|
||||||
(and (not (stringp display))
|
(cl-remove-if #'stringp display))
|
||||||
(cl-remove-if #'stringp
|
props))))))))
|
||||||
display)))))))))))
|
|
||||||
;; `display' property overrides `invisible' one. So we first
|
;; `display' property overrides `invisible' one. So we first
|
||||||
;; replace characters with `display' property. Then we remove
|
;; replace characters with `display' property. Then we remove
|
||||||
;; invisible characters.
|
;; invisible characters.
|
||||||
|
|
@ -125,7 +124,7 @@ text properties."
|
||||||
|
|
||||||
(defun org-string-width (string)
|
(defun org-string-width (string)
|
||||||
"Return width of STRING when displayed in the current buffer.
|
"Return width of STRING when displayed in the current buffer.
|
||||||
Unlike to `string-width', this function takes into consideration
|
Unlike `string-width', this function takes into consideration
|
||||||
`invisible' and `display' text properties."
|
`invisible' and `display' text properties."
|
||||||
(string-width (org-string-display string)))
|
(string-width (org-string-display string)))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -581,14 +581,15 @@ Escaping happens when a line starts with \"*\", \"#+\", \",*\" or
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char end)
|
(goto-char end)
|
||||||
(while (re-search-backward "^[ \t]*,?\\(\\*\\|#\\+\\)" beg t)
|
(while (re-search-backward "^[ \t]*\\(,*\\(?:\\*\\|#\\+\\)\\)" beg t)
|
||||||
(save-excursion (replace-match ",\\1" nil nil nil 1)))))
|
(save-excursion (replace-match ",\\1" nil nil nil 1)))))
|
||||||
|
|
||||||
(defun org-escape-code-in-string (s)
|
(defun org-escape-code-in-string (s)
|
||||||
"Escape lines in string S.
|
"Escape lines in string S.
|
||||||
Escaping happens when a line starts with \"*\", \"#+\", \",*\" or
|
Escaping happens when a line starts with \"*\", \"#+\", \",*\" or
|
||||||
\",#+\" by appending a comma to it."
|
\",#+\" by appending a comma to it."
|
||||||
(replace-regexp-in-string "^[ \t]*,?\\(\\*\\|#\\+\\)" ",\\1" s nil nil 1))
|
(replace-regexp-in-string "^[ \t]*\\(,*\\(?:\\*\\|#\\+\\)\\)" ",\\1"
|
||||||
|
s nil nil 1))
|
||||||
|
|
||||||
(defun org-unescape-code-in-region (beg end)
|
(defun org-unescape-code-in-region (beg end)
|
||||||
"Un-escape lines between BEG and END.
|
"Un-escape lines between BEG and END.
|
||||||
|
|
@ -597,7 +598,7 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char end)
|
(goto-char end)
|
||||||
(while (re-search-backward "^[ \t]*,?\\(,\\)\\(?:\\*\\|#\\+\\)" beg t)
|
(while (re-search-backward "^[ \t]*,*\\(,\\)\\(?:\\*\\|#\\+\\)" beg t)
|
||||||
(save-excursion (replace-match "" nil nil nil 1)))))
|
(save-excursion (replace-match "" nil nil nil 1)))))
|
||||||
|
|
||||||
(defun org-unescape-code-in-string (s)
|
(defun org-unescape-code-in-string (s)
|
||||||
|
|
@ -605,7 +606,7 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
|
||||||
Un-escaping happens by removing the first comma on lines starting
|
Un-escaping happens by removing the first comma on lines starting
|
||||||
with \",*\", \",#+\", \",,*\" and \",,#+\"."
|
with \",*\", \",#+\", \",,*\" and \",,#+\"."
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
"^[ \t]*,?\\(,\\)\\(?:\\*\\|#\\+\\)" "" s nil nil 1))
|
"^[ \t]*,*\\(,\\)\\(?:\\*\\|#\\+\\)" "" s nil nil 1))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1087,22 +1087,18 @@ Before doing so, re-align the table if necessary."
|
||||||
(interactive)
|
(interactive)
|
||||||
(org-table-maybe-eval-formula)
|
(org-table-maybe-eval-formula)
|
||||||
(org-table-maybe-recalculate-line)
|
(org-table-maybe-recalculate-line)
|
||||||
(if (or (looking-at "[ \t]*$")
|
(if (and org-table-automatic-realign
|
||||||
(save-excursion (skip-chars-backward " \t") (bolp)))
|
org-table-may-need-update)
|
||||||
(newline)
|
(org-table-align))
|
||||||
(if (and org-table-automatic-realign
|
(let ((col (org-table-current-column)))
|
||||||
org-table-may-need-update)
|
(beginning-of-line 2)
|
||||||
(org-table-align))
|
(when (or (not (org-at-table-p))
|
||||||
(let ((col (org-table-current-column)))
|
|
||||||
(beginning-of-line 2)
|
|
||||||
(if (or (not (org-at-table-p))
|
|
||||||
(org-at-table-hline-p))
|
(org-at-table-hline-p))
|
||||||
(progn
|
(beginning-of-line 0)
|
||||||
(beginning-of-line 0)
|
(org-table-insert-row 'below))
|
||||||
(org-table-insert-row 'below)))
|
(org-table-goto-column col)
|
||||||
(org-table-goto-column col)
|
(skip-chars-backward "^|\n\r")
|
||||||
(skip-chars-backward "^|\n\r")
|
(when (looking-at " ") (forward-char))))
|
||||||
(if (looking-at " ") (forward-char 1)))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun org-table-copy-down (n)
|
(defun org-table-copy-down (n)
|
||||||
|
|
@ -3242,7 +3238,7 @@ existing formula for column %s"
|
||||||
(goto-char beg)
|
(goto-char beg)
|
||||||
;; Mark named fields untouchable. Also check if several
|
;; Mark named fields untouchable. Also check if several
|
||||||
;; field/range formulas try to set the same field.
|
;; field/range formulas try to set the same field.
|
||||||
(remove-text-properties beg end '(org-untouchable t))
|
(remove-text-properties beg end '(:org-untouchable t))
|
||||||
(let ((current-line (count-lines org-table-current-begin-pos
|
(let ((current-line (count-lines org-table-current-begin-pos
|
||||||
(line-beginning-position)))
|
(line-beginning-position)))
|
||||||
seen-fields)
|
seen-fields)
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,13 @@
|
||||||
(defun org-release ()
|
(defun org-release ()
|
||||||
"The release version of Org.
|
"The release version of Org.
|
||||||
Inserted by installing Org mode or when a release is made."
|
Inserted by installing Org mode or when a release is made."
|
||||||
(let ((org-release "9.1.2"))
|
(let ((org-release "9.1.4"))
|
||||||
org-release))
|
org-release))
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun org-git-version ()
|
(defun org-git-version ()
|
||||||
"The Git version of org-mode.
|
"The Git version of org-mode.
|
||||||
Inserted by installing Org or when a release is made."
|
Inserted by installing Org or when a release is made."
|
||||||
(let ((org-git-version "release_9.1.2-40-g6ca906"))
|
(let ((org-git-version "release_9.1.4-44-gfe7310"))
|
||||||
org-git-version))
|
org-git-version))
|
||||||
|
|
||||||
(provide 'org-version)
|
(provide 'org-version)
|
||||||
|
|
|
||||||
192
lisp/org/org.el
192
lisp/org/org.el
|
|
@ -182,7 +182,8 @@ Stars are put in group 1 and the trimmed body in group 2.")
|
||||||
(declare-function org-export-get-environment "ox" (&optional backend subtreep ext-plist))
|
(declare-function org-export-get-environment "ox" (&optional backend subtreep ext-plist))
|
||||||
(declare-function org-latex-make-preamble "ox-latex" (info &optional template snippet?))
|
(declare-function org-latex-make-preamble "ox-latex" (info &optional template snippet?))
|
||||||
|
|
||||||
(defvar ffap-url-regexp) ;Silence byte-compiler
|
(defvar ffap-url-regexp)
|
||||||
|
(defvar org-element-paragraph-separate)
|
||||||
|
|
||||||
(defsubst org-uniquify (list)
|
(defsubst org-uniquify (list)
|
||||||
"Non-destructively remove duplicate elements from LIST."
|
"Non-destructively remove duplicate elements from LIST."
|
||||||
|
|
@ -1284,7 +1285,7 @@ star at the beginning of the headline, you can do this:
|
||||||
This list will be checked before `org-speed-commands-default'
|
This list will be checked before `org-speed-commands-default'
|
||||||
when the variable `org-use-speed-commands' is non-nil
|
when the variable `org-use-speed-commands' is non-nil
|
||||||
and when the cursor is at the beginning of a headline.
|
and when the cursor is at the beginning of a headline.
|
||||||
The car if each entry is a string with a single letter, which must
|
The car of each entry is a string with a single letter, which must
|
||||||
be assigned to `self-insert-command' in the global map.
|
be assigned to `self-insert-command' in the global map.
|
||||||
The cdr is either a command to be called interactively, a function
|
The cdr is either a command to be called interactively, a function
|
||||||
to be called, or a form to be evaluated.
|
to be called, or a form to be evaluated.
|
||||||
|
|
@ -5290,7 +5291,8 @@ is available. This option applies only if FILE is a URL."
|
||||||
;; Move point to after the url-retrieve header.
|
;; Move point to after the url-retrieve header.
|
||||||
(search-forward "\n\n" nil :move)
|
(search-forward "\n\n" nil :move)
|
||||||
;; Search for the success code only in the url-retrieve header.
|
;; Search for the success code only in the url-retrieve header.
|
||||||
(if (save-excursion (re-search-backward "HTTP.*\\s-+200\\s-OK" nil :noerror))
|
(if (save-excursion
|
||||||
|
(re-search-backward "HTTP.*\\s-+200\\s-OK" nil :noerror))
|
||||||
;; Update the cache `org--file-cache' and return contents.
|
;; Update the cache `org--file-cache' and return contents.
|
||||||
(puthash file
|
(puthash file
|
||||||
(buffer-substring-no-properties (point) (point-max))
|
(buffer-substring-no-properties (point) (point-max))
|
||||||
|
|
@ -5300,13 +5302,14 @@ is available. This option applies only if FILE is a URL."
|
||||||
file))))
|
file))))
|
||||||
(t
|
(t
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(condition-case err
|
(condition-case nil
|
||||||
(progn
|
(progn
|
||||||
(insert-file-contents file)
|
(insert-file-contents file)
|
||||||
(buffer-string))
|
(buffer-string))
|
||||||
(file-error
|
(file-error
|
||||||
(funcall (if noerror #'message #'user-error)
|
(funcall (if noerror #'message #'user-error)
|
||||||
(error-message-string err)))))))))
|
"Unable to read file %S"
|
||||||
|
file))))))))
|
||||||
|
|
||||||
(defun org-extract-log-state-settings (x)
|
(defun org-extract-log-state-settings (x)
|
||||||
"Extract the log state setting from a TODO keyword string.
|
"Extract the log state setting from a TODO keyword string.
|
||||||
|
|
@ -5750,18 +5753,27 @@ This should be called after the variable `org-link-parameters' has changed."
|
||||||
(verbatim? (member marker '("~" "="))))
|
(verbatim? (member marker '("~" "="))))
|
||||||
(when (save-excursion
|
(when (save-excursion
|
||||||
(goto-char (match-beginning 0))
|
(goto-char (match-beginning 0))
|
||||||
;; Do not match headline stars. Do not consider
|
|
||||||
;; stars of a headline as closing marker for bold
|
|
||||||
;; markup either. Do not match table hlines.
|
|
||||||
(and
|
(and
|
||||||
(not (looking-at-p org-outline-regexp-bol))
|
;; Do not match table hlines.
|
||||||
(not (and (equal marker "+")
|
(not (and (equal marker "+")
|
||||||
(org-match-line
|
(org-match-line
|
||||||
"^[ \t]*\\(|[-+]+|?\\|\\+[-+]+\\+\\)[ \t]*$")))
|
"[ \t]*\\(|[-+]+|?\\|\\+[-+]+\\+\\)[ \t]*$")))
|
||||||
|
;; Do not match headline stars. Do not consider
|
||||||
|
;; stars of a headline as closing marker for bold
|
||||||
|
;; markup either.
|
||||||
|
(not (and (equal marker "*")
|
||||||
|
(save-excursion
|
||||||
|
(forward-char)
|
||||||
|
(skip-chars-backward "*")
|
||||||
|
(looking-at-p org-outline-regexp-bol))))
|
||||||
|
;; Match full emphasis markup regexp.
|
||||||
(looking-at (if verbatim? org-verbatim-re org-emph-re))
|
(looking-at (if verbatim? org-verbatim-re org-emph-re))
|
||||||
(not (string-match-p
|
;; Do not span over paragraph boundaries.
|
||||||
(concat org-outline-regexp-bol "\\'")
|
(not (string-match-p org-element-paragraph-separate
|
||||||
(match-string 0)))))
|
(match-string 2)))
|
||||||
|
;; Do not span over cells in table rows.
|
||||||
|
(not (and (save-match-data (org-match-line "[ \t]*|"))
|
||||||
|
(string-match-p "|" (match-string 4))))))
|
||||||
(pcase-let ((`(,_ ,face ,_) (assoc marker org-emphasis-alist)))
|
(pcase-let ((`(,_ ,face ,_) (assoc marker org-emphasis-alist)))
|
||||||
(font-lock-prepend-text-property
|
(font-lock-prepend-text-property
|
||||||
(match-beginning 2) (match-end 2) 'face face)
|
(match-beginning 2) (match-end 2) 'face face)
|
||||||
|
|
@ -7945,8 +7957,7 @@ unchecked check box."
|
||||||
(org-insert-heading (or (and (equal arg '(16)) '(16))
|
(org-insert-heading (or (and (equal arg '(16)) '(16))
|
||||||
force-heading))
|
force-heading))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(org-back-to-heading)
|
(org-forward-heading-same-level -1)
|
||||||
(outline-previous-heading)
|
|
||||||
(let ((case-fold-search nil)) (looking-at org-todo-line-regexp)))
|
(let ((case-fold-search nil)) (looking-at org-todo-line-regexp)))
|
||||||
(let* ((new-mark-x
|
(let* ((new-mark-x
|
||||||
(if (or (equal arg '(4))
|
(if (or (equal arg '(4))
|
||||||
|
|
@ -9636,28 +9647,37 @@ active region."
|
||||||
(move-beginning-of-line 2)
|
(move-beginning-of-line 2)
|
||||||
(set-mark (point)))))
|
(set-mark (point)))))
|
||||||
(setq org-store-link-plist nil)
|
(setq org-store-link-plist nil)
|
||||||
(let (link cpltxt desc description search
|
(let (link cpltxt desc description search txt custom-id agenda-link)
|
||||||
txt custom-id agenda-link sfuns sfunsn)
|
|
||||||
(cond
|
(cond
|
||||||
|
;; Store a link using an external link type, if any function is
|
||||||
;; Store a link using an external link type
|
;; available. If more than one can generate a link from current
|
||||||
|
;; location, ask which one to use.
|
||||||
((and (not (equal arg '(16)))
|
((and (not (equal arg '(16)))
|
||||||
(setq sfuns
|
(let ((results-alist nil))
|
||||||
(delq
|
(dolist (f (org-store-link-functions))
|
||||||
nil (mapcar (lambda (f)
|
(when (funcall f)
|
||||||
(let (fs) (if (funcall f) (push f fs))))
|
;; XXX: return value is not link's plist, so we
|
||||||
(org-store-link-functions)))
|
;; store the new value before it is modified. It
|
||||||
sfunsn (mapcar (lambda (fu) (symbol-name (car fu))) sfuns))
|
;; would be cleaner to ask store link functions to
|
||||||
(or (and (cdr sfuns)
|
;; return the plist instead.
|
||||||
(funcall (intern
|
(push (cons f (copy-sequence org-store-link-plist))
|
||||||
(completing-read
|
results-alist)))
|
||||||
"Which function for creating the link? "
|
(pcase results-alist
|
||||||
sfunsn nil t (car sfunsn)))))
|
(`nil nil)
|
||||||
(funcall (caar sfuns)))
|
(`((,_ . ,_)) t) ;single choice: nothing to do
|
||||||
(setq link (plist-get org-store-link-plist :link)
|
(`((,name . ,_) . ,_)
|
||||||
desc (or (plist-get org-store-link-plist
|
;; Reinstate link plist associated to the chosen
|
||||||
:description)
|
;; function.
|
||||||
link))))
|
(apply #'org-store-link-props
|
||||||
|
(cdr (assoc-string
|
||||||
|
(completing-read
|
||||||
|
"Which function for creating the link? "
|
||||||
|
(mapcar #'car results-alist) nil t name)
|
||||||
|
results-alist)))
|
||||||
|
t))))
|
||||||
|
(setq link (plist-get org-store-link-plist :link))
|
||||||
|
(setq desc (or (plist-get org-store-link-plist :description)
|
||||||
|
link)))
|
||||||
|
|
||||||
;; Store a link from a source code buffer.
|
;; Store a link from a source code buffer.
|
||||||
((org-src-edit-buffer-p)
|
((org-src-edit-buffer-p)
|
||||||
|
|
@ -9845,7 +9865,9 @@ active region."
|
||||||
(car org-stored-links)))))
|
(car org-stored-links)))))
|
||||||
|
|
||||||
(defun org-store-link-props (&rest plist)
|
(defun org-store-link-props (&rest plist)
|
||||||
"Store link properties, extract names, addresses and dates."
|
"Store link properties.
|
||||||
|
The properties are pre-processed by extracting names, addresses
|
||||||
|
and dates."
|
||||||
(let ((x (plist-get plist :from)))
|
(let ((x (plist-get plist :from)))
|
||||||
(when x
|
(when x
|
||||||
(let ((adr (mail-extract-address-components x)))
|
(let ((adr (mail-extract-address-components x)))
|
||||||
|
|
@ -14610,7 +14632,7 @@ it as a time string and apply `float-time' to it. If S is nil, just return 0."
|
||||||
((numberp s) s)
|
((numberp s) s)
|
||||||
((stringp s)
|
((stringp s)
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(float-time (apply #'encode-time (org-parse-time-string s nil t)))
|
(float-time (apply #'encode-time (org-parse-time-string s)))
|
||||||
(error 0.)))
|
(error 0.)))
|
||||||
(t 0.)))
|
(t 0.)))
|
||||||
|
|
||||||
|
|
@ -17369,8 +17391,8 @@ both scheduled and deadline timestamps."
|
||||||
'timestamp)
|
'timestamp)
|
||||||
(org-at-planning-p))
|
(org-at-planning-p))
|
||||||
(time-less-p
|
(time-less-p
|
||||||
(org-time-string-to-time match t)
|
(org-time-string-to-time match)
|
||||||
(org-time-string-to-time d t)))))))
|
(org-time-string-to-time d)))))))
|
||||||
(message "%d entries before %s"
|
(message "%d entries before %s"
|
||||||
(org-occur regexp nil callback)
|
(org-occur regexp nil callback)
|
||||||
d)))
|
d)))
|
||||||
|
|
@ -17391,8 +17413,8 @@ both scheduled and deadline timestamps."
|
||||||
'timestamp)
|
'timestamp)
|
||||||
(org-at-planning-p))
|
(org-at-planning-p))
|
||||||
(not (time-less-p
|
(not (time-less-p
|
||||||
(org-time-string-to-time match t)
|
(org-time-string-to-time match)
|
||||||
(org-time-string-to-time d t))))))))
|
(org-time-string-to-time d))))))))
|
||||||
(message "%d entries after %s"
|
(message "%d entries after %s"
|
||||||
(org-occur regexp nil callback)
|
(org-occur regexp nil callback)
|
||||||
d)))
|
d)))
|
||||||
|
|
@ -17415,11 +17437,11 @@ both scheduled and deadline timestamps."
|
||||||
'timestamp)
|
'timestamp)
|
||||||
(org-at-planning-p))
|
(org-at-planning-p))
|
||||||
(not (time-less-p
|
(not (time-less-p
|
||||||
(org-time-string-to-time match t)
|
(org-time-string-to-time match)
|
||||||
(org-time-string-to-time start-date t)))
|
(org-time-string-to-time start-date)))
|
||||||
(time-less-p
|
(time-less-p
|
||||||
(org-time-string-to-time match t)
|
(org-time-string-to-time match)
|
||||||
(org-time-string-to-time end-date t))))))))
|
(org-time-string-to-time end-date))))))))
|
||||||
(message "%d entries between %s and %s"
|
(message "%d entries between %s and %s"
|
||||||
(org-occur regexp nil callback) start-date end-date)))
|
(org-occur regexp nil callback) start-date end-date)))
|
||||||
|
|
||||||
|
|
@ -17504,19 +17526,13 @@ days in order to avoid rounding problems."
|
||||||
(push m l))
|
(push m l))
|
||||||
(apply 'format fmt (nreverse l))))
|
(apply 'format fmt (nreverse l))))
|
||||||
|
|
||||||
(defun org-time-string-to-time (s &optional zone)
|
(defun org-time-string-to-time (s)
|
||||||
"Convert timestamp string S into internal time.
|
"Convert timestamp string S into internal time."
|
||||||
The optional ZONE is omitted or nil for Emacs local time, t for
|
(apply #'encode-time (org-parse-time-string s)))
|
||||||
Universal Time, ‘wall’ for system wall clock time, or a string as
|
|
||||||
in the TZ environment variable."
|
|
||||||
(apply #'encode-time (org-parse-time-string s nil zone)))
|
|
||||||
|
|
||||||
(defun org-time-string-to-seconds (s &optional zone)
|
(defun org-time-string-to-seconds (s)
|
||||||
"Convert a timestamp string S into a number of seconds.
|
"Convert a timestamp string S into a number of seconds."
|
||||||
The optional ZONE is omitted or nil for Emacs local time, t for
|
(float-time (org-time-string-to-time s)))
|
||||||
Universal Time, ‘wall’ for system wall clock time, or a string as
|
|
||||||
in the TZ environment variable."
|
|
||||||
(float-time (org-time-string-to-time s zone)))
|
|
||||||
|
|
||||||
(org-define-error 'org-diary-sexp-no-match "Unable to match diary sexp")
|
(org-define-error 'org-diary-sexp-no-match "Unable to match diary sexp")
|
||||||
|
|
||||||
|
|
@ -17733,17 +17749,13 @@ day number."
|
||||||
(list (nth 4 d) (nth 3 d) (nth 5 d))))
|
(list (nth 4 d) (nth 3 d) (nth 5 d))))
|
||||||
((listp d) (list (nth 4 d) (nth 3 d) (nth 5 d)))))
|
((listp d) (list (nth 4 d) (nth 3 d) (nth 5 d)))))
|
||||||
|
|
||||||
(defun org-parse-time-string (s &optional nodefault zone)
|
(defun org-parse-time-string (s &optional nodefault)
|
||||||
"Parse the standard Org time string.
|
"Parse the standard Org time string.
|
||||||
|
|
||||||
This should be a lot faster than the normal `parse-time-string'.
|
This should be a lot faster than the normal `parse-time-string'.
|
||||||
|
|
||||||
If time is not given, defaults to 0:00. However, with optional
|
If time is not given, defaults to 0:00. However, with optional
|
||||||
NODEFAULT, hour and minute fields will be nil if not given.
|
NODEFAULT, hour and minute fields will be nil if not given."
|
||||||
|
|
||||||
The optional ZONE is omitted or nil for Emacs local time, t for
|
|
||||||
Universal Time, ‘wall’ for system wall clock time, or a string as
|
|
||||||
in the TZ environment variable."
|
|
||||||
(cond ((string-match org-ts-regexp0 s)
|
(cond ((string-match org-ts-regexp0 s)
|
||||||
(list 0
|
(list 0
|
||||||
(when (or (match-beginning 8) (not nodefault))
|
(when (or (match-beginning 8) (not nodefault))
|
||||||
|
|
@ -17753,7 +17765,7 @@ in the TZ environment variable."
|
||||||
(string-to-number (match-string 4 s))
|
(string-to-number (match-string 4 s))
|
||||||
(string-to-number (match-string 3 s))
|
(string-to-number (match-string 3 s))
|
||||||
(string-to-number (match-string 2 s))
|
(string-to-number (match-string 2 s))
|
||||||
nil nil zone))
|
nil nil nil))
|
||||||
((string-match "^<[^>]+>$" s)
|
((string-match "^<[^>]+>$" s)
|
||||||
;; FIXME: `decode-time' needs to be called with ZONE as its
|
;; FIXME: `decode-time' needs to be called with ZONE as its
|
||||||
;; second argument. However, this requires at least Emacs
|
;; second argument. However, this requires at least Emacs
|
||||||
|
|
@ -19327,9 +19339,9 @@ boundaries."
|
||||||
;; "file:" links. Also check link abbreviations since
|
;; "file:" links. Also check link abbreviations since
|
||||||
;; some might expand to "file" links.
|
;; some might expand to "file" links.
|
||||||
(file-types-re (format "[][]\\[\\(?:file\\|[./~]%s\\)"
|
(file-types-re (format "[][]\\[\\(?:file\\|[./~]%s\\)"
|
||||||
(and link-abbrevs
|
(if (not link-abbrevs) ""
|
||||||
(format "\\|\\(?:%s:\\)"
|
(format "\\|\\(?:%s:\\)"
|
||||||
(regexp-opt link-abbrevs))))))
|
(regexp-opt link-abbrevs))))))
|
||||||
(while (re-search-forward file-types-re end t)
|
(while (re-search-forward file-types-re end t)
|
||||||
(let ((link (save-match-data (org-element-context))))
|
(let ((link (save-match-data (org-element-context))))
|
||||||
;; Check if we're at an inline image, i.e., an image file
|
;; Check if we're at an inline image, i.e., an image file
|
||||||
|
|
@ -20782,8 +20794,8 @@ This command does many different things, depending on context:
|
||||||
'(babel-call clock dynamic-block footnote-definition
|
'(babel-call clock dynamic-block footnote-definition
|
||||||
footnote-reference inline-babel-call inline-src-block
|
footnote-reference inline-babel-call inline-src-block
|
||||||
inlinetask item keyword node-property paragraph
|
inlinetask item keyword node-property paragraph
|
||||||
plain-list property-drawer radio-target src-block
|
plain-list planning property-drawer radio-target
|
||||||
statistics-cookie table table-cell table-row
|
src-block statistics-cookie table table-cell table-row
|
||||||
timestamp)
|
timestamp)
|
||||||
t))
|
t))
|
||||||
(type (org-element-type context)))
|
(type (org-element-type context)))
|
||||||
|
|
@ -20935,7 +20947,8 @@ Use `\\[org-edit-special]' to edit table.el tables"))
|
||||||
(cond (arg (call-interactively #'org-table-recalculate))
|
(cond (arg (call-interactively #'org-table-recalculate))
|
||||||
((org-table-maybe-recalculate-line))
|
((org-table-maybe-recalculate-line))
|
||||||
(t (org-table-align))))))
|
(t (org-table-align))))))
|
||||||
(`timestamp (org-timestamp-change 0 'day))
|
((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
|
;; When point is on an unsupported object type, we can miss
|
||||||
;; the fact that it also is at a heading. Handle it here.
|
;; the fact that it also is at a heading. Handle it here.
|
||||||
|
|
@ -21027,13 +21040,17 @@ object (e.g., within a comment). In these case, you need to use
|
||||||
(let ((context (if org-return-follows-link (org-element-context)
|
(let ((context (if org-return-follows-link (org-element-context)
|
||||||
(org-element-at-point))))
|
(org-element-at-point))))
|
||||||
(cond
|
(cond
|
||||||
;; In a table, call `org-table-next-row'.
|
;; In a table, call `org-table-next-row'. However, before first
|
||||||
|
;; column or after last one, split the table.
|
||||||
((or (and (eq (org-element-type context) 'table)
|
((or (and (eq (org-element-type context) 'table)
|
||||||
(>= (point) (org-element-property :contents-begin context))
|
(>= (point) (org-element-property :contents-begin context))
|
||||||
(< (point) (org-element-property :contents-end context)))
|
(< (point) (org-element-property :contents-end context)))
|
||||||
(org-element-lineage context '(table-row table-cell) t))
|
(org-element-lineage context '(table-row table-cell) t))
|
||||||
(org-table-justify-field-maybe)
|
(if (or (looking-at-p "[ \t]*$")
|
||||||
(call-interactively #'org-table-next-row))
|
(save-excursion (skip-chars-backward " \t") (bolp)))
|
||||||
|
(insert "\n")
|
||||||
|
(org-table-justify-field-maybe)
|
||||||
|
(call-interactively #'org-table-next-row)))
|
||||||
;; On a link or a timestamp, call `org-open-at-point' if
|
;; On a link or a timestamp, call `org-open-at-point' if
|
||||||
;; `org-return-follows-link' allows it. Tolerate fuzzy
|
;; `org-return-follows-link' allows it. Tolerate fuzzy
|
||||||
;; locations, e.g., in a comment, as `org-open-at-point'.
|
;; locations, e.g., in a comment, as `org-open-at-point'.
|
||||||
|
|
@ -21374,7 +21391,7 @@ an argument, unconditionally call `org-insert-heading'."
|
||||||
["Next keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-at-heading-p))]
|
["Next keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-at-heading-p))]
|
||||||
["Previous keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-at-heading-p))])
|
["Previous keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-at-heading-p))])
|
||||||
["Show TODO Tree" org-show-todo-tree :active t :keys "C-c / t"]
|
["Show TODO Tree" org-show-todo-tree :active t :keys "C-c / t"]
|
||||||
["Global TODO list" org-todo-list :active t :keys "C-c a t"]
|
["Global TODO list" org-todo-list :active t :keys "\\[org-agenda] t"]
|
||||||
"--"
|
"--"
|
||||||
["Enforce dependencies" (customize-variable 'org-enforce-todo-dependencies)
|
["Enforce dependencies" (customize-variable 'org-enforce-todo-dependencies)
|
||||||
:selected org-enforce-todo-dependencies :style toggle :active t]
|
:selected org-enforce-todo-dependencies :style toggle :active t]
|
||||||
|
|
@ -21453,8 +21470,8 @@ an argument, unconditionally call `org-insert-heading'."
|
||||||
"--"
|
"--"
|
||||||
["Export/Publish..." org-export-dispatch t]
|
["Export/Publish..." org-export-dispatch t]
|
||||||
("LaTeX"
|
("LaTeX"
|
||||||
["Org CDLaTeX mode" org-cdlatex-mode :style toggle
|
["Org CDLaTeX mode" org-cdlatex-mode :active (require 'cdlatex nil t)
|
||||||
:selected org-cdlatex-mode]
|
:style toggle :selected org-cdlatex-mode]
|
||||||
["Insert Environment" cdlatex-environment (fboundp 'cdlatex-environment)]
|
["Insert Environment" cdlatex-environment (fboundp 'cdlatex-environment)]
|
||||||
["Insert math symbol" cdlatex-math-symbol (fboundp 'cdlatex-math-symbol)]
|
["Insert math symbol" cdlatex-math-symbol (fboundp 'cdlatex-math-symbol)]
|
||||||
["Modify math symbol" org-cdlatex-math-modify
|
["Modify math symbol" org-cdlatex-math-modify
|
||||||
|
|
@ -21464,7 +21481,7 @@ an argument, unconditionally call `org-insert-heading'."
|
||||||
("MobileOrg"
|
("MobileOrg"
|
||||||
["Push Files and Views" org-mobile-push t]
|
["Push Files and Views" org-mobile-push t]
|
||||||
["Get Captured and Flagged" org-mobile-pull t]
|
["Get Captured and Flagged" org-mobile-pull t]
|
||||||
["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "C-c a ?"]
|
["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "\\[org-agenda] ?"]
|
||||||
"--"
|
"--"
|
||||||
["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t])
|
["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t])
|
||||||
"--"
|
"--"
|
||||||
|
|
@ -21568,7 +21585,9 @@ Your bug report will be posted to the Org mailing list.
|
||||||
["Cycle through agenda files" org-cycle-agenda-files t]
|
["Cycle through agenda files" org-cycle-agenda-files t]
|
||||||
["Occur in all agenda files" org-occur-in-agenda-files t]
|
["Occur in all agenda files" org-occur-in-agenda-files t]
|
||||||
"--")
|
"--")
|
||||||
(mapcar 'org-file-menu-entry (org-agenda-files t))))))))
|
(mapcar 'org-file-menu-entry
|
||||||
|
;; Prevent initialization from failing.
|
||||||
|
(ignore-errors (org-agenda-files t)))))))))
|
||||||
|
|
||||||
;;;; Documentation
|
;;;; Documentation
|
||||||
|
|
||||||
|
|
@ -22764,7 +22783,6 @@ assumed to be significant there."
|
||||||
;; `org-setup-filling' installs filling and auto-filling related
|
;; `org-setup-filling' installs filling and auto-filling related
|
||||||
;; variables during `org-mode' initialization.
|
;; variables during `org-mode' initialization.
|
||||||
|
|
||||||
(defvar org-element-paragraph-separate) ; org-element.el
|
|
||||||
(defun org-setup-filling ()
|
(defun org-setup-filling ()
|
||||||
(require 'org-element)
|
(require 'org-element)
|
||||||
;; Prevent auto-fill from inserting unwanted new items.
|
;; Prevent auto-fill from inserting unwanted new items.
|
||||||
|
|
@ -23617,7 +23635,9 @@ depending on context."
|
||||||
(skip-chars-forward " \r\t\n"))))
|
(skip-chars-forward " \r\t\n"))))
|
||||||
(narrow-to-region (org-element-property :contents-begin element)
|
(narrow-to-region (org-element-property :contents-begin element)
|
||||||
contents-end))
|
contents-end))
|
||||||
(call-interactively #'forward-sentence))))))
|
;; End of heading is considered as the end of a sentence.
|
||||||
|
(let ((sentence-end (concat (sentence-end) "\\|^\\*+ .*$")))
|
||||||
|
(call-interactively #'forward-sentence)))))))
|
||||||
|
|
||||||
(define-key org-mode-map "\M-a" 'org-backward-sentence)
|
(define-key org-mode-map "\M-a" 'org-backward-sentence)
|
||||||
(define-key org-mode-map "\M-e" 'org-forward-sentence)
|
(define-key org-mode-map "\M-e" 'org-forward-sentence)
|
||||||
|
|
@ -24230,10 +24250,11 @@ convenience:
|
||||||
(backward-char)
|
(backward-char)
|
||||||
(org-backward-paragraph))
|
(org-backward-paragraph))
|
||||||
((<= (point) post-affiliated) (goto-char begin))
|
((<= (point) post-affiliated) (goto-char begin))
|
||||||
|
;; Special behavior: on a table or a property drawer, move to
|
||||||
|
;; its beginning.
|
||||||
((memq type '(node-property table-row))
|
((memq type '(node-property table-row))
|
||||||
(goto-char (org-element-property
|
(goto-char (org-element-property
|
||||||
:post-affiliated (org-element-property :parent element))))
|
:post-affiliated (org-element-property :parent element))))
|
||||||
((memq type '(property-drawer table)) (goto-char begin))
|
|
||||||
(special?
|
(special?
|
||||||
(if (<= (point) contents-begin) (goto-char post-affiliated)
|
(if (<= (point) contents-begin) (goto-char post-affiliated)
|
||||||
;; Inside a verse block, see blank lines as paragraph
|
;; Inside a verse block, see blank lines as paragraph
|
||||||
|
|
@ -24244,8 +24265,7 @@ convenience:
|
||||||
(skip-chars-forward " \r\t\n" origin)
|
(skip-chars-forward " \r\t\n" origin)
|
||||||
(if (= (point) origin) (goto-char contents-begin)
|
(if (= (point) origin) (goto-char contents-begin)
|
||||||
(beginning-of-line))))))
|
(beginning-of-line))))))
|
||||||
((eq type 'paragraph)
|
((eq type 'paragraph) (goto-char contents-begin)
|
||||||
(goto-char contents-begin)
|
|
||||||
;; When at first paragraph in an item or a footnote definition,
|
;; When at first paragraph in an item or a footnote definition,
|
||||||
;; move directly to beginning of line.
|
;; move directly to beginning of line.
|
||||||
(let ((parent-contents
|
(let ((parent-contents
|
||||||
|
|
@ -24253,9 +24273,9 @@ convenience:
|
||||||
:contents-begin (org-element-property :parent element))))
|
:contents-begin (org-element-property :parent element))))
|
||||||
(when (and parent-contents (= parent-contents contents-begin))
|
(when (and parent-contents (= parent-contents contents-begin))
|
||||||
(beginning-of-line))))
|
(beginning-of-line))))
|
||||||
;; At the end of a greater element, move to the beginning of the
|
;; At the end of a greater element, move to the beginning of
|
||||||
;; last element within.
|
;; the last element within.
|
||||||
((>= (point) contents-end)
|
((and contents-end (>= (point) contents-end))
|
||||||
(goto-char (1- contents-end))
|
(goto-char (1- contents-end))
|
||||||
(org-backward-paragraph))
|
(org-backward-paragraph))
|
||||||
(t (goto-char (or post-affiliated begin))))
|
(t (goto-char (or post-affiliated begin))))
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,8 @@ Inner margin is applied between each headline."
|
||||||
|
|
||||||
(defcustom org-ascii-quote-margin 6
|
(defcustom org-ascii-quote-margin 6
|
||||||
"Width of margin used for quoting text, in characters.
|
"Width of margin used for quoting text, in characters.
|
||||||
This margin is applied on both sides of the text."
|
This margin is applied on both sides of the text. It is also
|
||||||
|
applied on the left side of contents in descriptive lists."
|
||||||
:group 'org-export-ascii
|
:group 'org-export-ascii
|
||||||
:version "24.4"
|
:version "24.4"
|
||||||
:package-version '(Org . "8.0")
|
:package-version '(Org . "8.0")
|
||||||
|
|
@ -551,79 +552,69 @@ INFO is a plist used as a communication channel."
|
||||||
(`inlinetask (plist-get info :ascii-inlinetask-width))
|
(`inlinetask (plist-get info :ascii-inlinetask-width))
|
||||||
(`headline
|
(`headline
|
||||||
(- (plist-get info :ascii-text-width)
|
(- (plist-get info :ascii-text-width)
|
||||||
(let ((low-level-rank (org-export-low-level-p element info)))
|
(let ((low-level-rank (org-export-low-level-p element info)))
|
||||||
(if low-level-rank (* low-level-rank 2)
|
(if low-level-rank (* low-level-rank 2)
|
||||||
(plist-get info :ascii-global-margin)))))
|
(plist-get info :ascii-global-margin)))))
|
||||||
;; Elements with a relative width: store maximum text width in
|
;; Elements with a relative width: store maximum text width in
|
||||||
;; TOTAL-WIDTH.
|
;; TOTAL-WIDTH.
|
||||||
(_
|
(_
|
||||||
(let* ((genealogy (org-element-lineage element nil t))
|
(let* ((genealogy (org-element-lineage element nil t))
|
||||||
;; Total width is determined by the presence, or not, of an
|
;; Total width is determined by the presence, or not, of an
|
||||||
;; inline task among ELEMENT parents.
|
;; inline task among ELEMENT parents.
|
||||||
(total-width
|
(total-width
|
||||||
(if (cl-some (lambda (parent)
|
(if (cl-some (lambda (parent)
|
||||||
(eq (org-element-type parent) 'inlinetask))
|
(eq (org-element-type parent) 'inlinetask))
|
||||||
genealogy)
|
genealogy)
|
||||||
(plist-get info :ascii-inlinetask-width)
|
(plist-get info :ascii-inlinetask-width)
|
||||||
;; No inlinetask: Remove global margin from text width.
|
;; No inlinetask: Remove global margin from text width.
|
||||||
(- (plist-get info :ascii-text-width)
|
(- (plist-get info :ascii-text-width)
|
||||||
(plist-get info :ascii-global-margin)
|
(plist-get info :ascii-global-margin)
|
||||||
(let ((parent (org-export-get-parent-headline element)))
|
(let ((parent (org-export-get-parent-headline element)))
|
||||||
;; Inner margin doesn't apply to text before first
|
;; Inner margin doesn't apply to text before first
|
||||||
;; headline.
|
;; headline.
|
||||||
(if (not parent) 0
|
(if (not parent) 0
|
||||||
(let ((low-level-rank
|
(let ((low-level-rank
|
||||||
(org-export-low-level-p parent info)))
|
(org-export-low-level-p parent info)))
|
||||||
;; Inner margin doesn't apply to contents of
|
;; Inner margin doesn't apply to contents of
|
||||||
;; low level headlines, since they've got their
|
;; low level headlines, since they've got their
|
||||||
;; own indentation mechanism.
|
;; own indentation mechanism.
|
||||||
(if low-level-rank (* low-level-rank 2)
|
(if low-level-rank (* low-level-rank 2)
|
||||||
(plist-get info :ascii-inner-margin)))))))))
|
(plist-get info :ascii-inner-margin)))))))))
|
||||||
(- total-width
|
(- total-width
|
||||||
;; Each `quote-block' and `verse-block' above narrows text
|
;; Each `quote-block' and `verse-block' above narrows text
|
||||||
;; width by twice the standard margin size.
|
;; width by twice the standard margin size.
|
||||||
(+ (* (cl-count-if (lambda (parent)
|
(+ (* (cl-count-if (lambda (parent)
|
||||||
(memq (org-element-type parent)
|
(memq (org-element-type parent)
|
||||||
'(quote-block verse-block)))
|
'(quote-block verse-block)))
|
||||||
genealogy)
|
genealogy)
|
||||||
2
|
2
|
||||||
(plist-get info :ascii-quote-margin))
|
(plist-get info :ascii-quote-margin))
|
||||||
;; Apply list margin once per "top-level" plain-list
|
;; Apply list margin once per "top-level" plain-list
|
||||||
;; containing current line
|
;; containing current line
|
||||||
(* (cl-count-if
|
(* (cl-count-if
|
||||||
(lambda (e)
|
(lambda (e)
|
||||||
(and (eq (org-element-type e) 'plain-list)
|
(and (eq (org-element-type e) 'plain-list)
|
||||||
(not (eq (org-element-type (org-export-get-parent e))
|
(not (eq (org-element-type (org-export-get-parent e))
|
||||||
'item))))
|
'item))))
|
||||||
genealogy)
|
genealogy)
|
||||||
(plist-get info :ascii-list-margin))
|
(plist-get info :ascii-list-margin))
|
||||||
;; Text width within a plain-list is restricted by
|
;; Compute indentation offset due to current list. It is
|
||||||
;; indentation of current item. If that's the case,
|
;; `org-ascii-quote-margin' per descriptive item in the
|
||||||
;; compute it with the help of `:structure' property from
|
;; genealogy, bullet's length otherwise.
|
||||||
;; parent item, if any.
|
(let ((indentation 0))
|
||||||
(let ((item
|
(dolist (e genealogy)
|
||||||
(if (eq (org-element-type element) 'item) element
|
(cond
|
||||||
(cl-find-if (lambda (parent)
|
((not (eq 'item (org-element-type e))))
|
||||||
(eq (org-element-type parent) 'item))
|
((eq (org-element-property :type (org-export-get-parent e))
|
||||||
genealogy))))
|
'descriptive)
|
||||||
(if (not item) 0
|
(cl-incf indentation org-ascii-quote-margin))
|
||||||
;; Compute indentation offset of the current item,
|
(t
|
||||||
;; that is the sum of the difference between its
|
(cl-incf indentation
|
||||||
;; indentation and the indentation of the top item in
|
(+ (string-width
|
||||||
;; the list and current item bullet's length. Also
|
(or (org-ascii--checkbox e info) ""))
|
||||||
;; remove checkbox length, and tag length (for
|
(string-width
|
||||||
;; description lists) or bullet length.
|
(org-element-property :bullet e)))))))
|
||||||
(let ((struct (org-element-property :structure item))
|
indentation)))))))
|
||||||
(beg-item (org-element-property :begin item)))
|
|
||||||
(+ (- (org-list-get-ind beg-item struct)
|
|
||||||
(org-list-get-ind
|
|
||||||
(org-list-get-top-point struct) struct))
|
|
||||||
(string-width (or (org-ascii--checkbox item info)
|
|
||||||
""))
|
|
||||||
(string-width
|
|
||||||
(let ((tag (org-element-property :tag item)))
|
|
||||||
(if tag (org-export-data tag info)
|
|
||||||
(org-element-property :bullet item))))))))))))))
|
|
||||||
|
|
||||||
(defun org-ascii--current-justification (element)
|
(defun org-ascii--current-justification (element)
|
||||||
"Return expected justification for ELEMENT's contents.
|
"Return expected justification for ELEMENT's contents.
|
||||||
|
|
@ -1458,40 +1449,54 @@ contextual information."
|
||||||
(bullet
|
(bullet
|
||||||
;; First parent of ITEM is always the plain-list. Get
|
;; First parent of ITEM is always the plain-list. Get
|
||||||
;; `:type' property from it.
|
;; `:type' property from it.
|
||||||
(org-list-bullet-string
|
(pcase list-type
|
||||||
(pcase list-type
|
(`descriptive
|
||||||
(`descriptive
|
(concat checkbox
|
||||||
(concat checkbox
|
(org-export-data (org-element-property :tag item)
|
||||||
(org-export-data (org-element-property :tag item) info)
|
info)))
|
||||||
": "))
|
(`ordered
|
||||||
(`ordered
|
;; Return correct number for ITEM, paying attention to
|
||||||
;; Return correct number for ITEM, paying attention to
|
;; counters.
|
||||||
;; counters.
|
(let* ((struct (org-element-property :structure item))
|
||||||
(let* ((struct (org-element-property :structure item))
|
(bul (org-list-bullet-string
|
||||||
(bul (org-element-property :bullet item))
|
(org-element-property :bullet item)))
|
||||||
(num (number-to-string
|
(num (number-to-string
|
||||||
(car (last (org-list-get-item-number
|
(car (last (org-list-get-item-number
|
||||||
(org-element-property :begin item)
|
(org-element-property :begin item)
|
||||||
struct
|
struct
|
||||||
(org-list-prevs-alist struct)
|
(org-list-prevs-alist struct)
|
||||||
(org-list-parents-alist struct)))))))
|
(org-list-parents-alist struct)))))))
|
||||||
(replace-regexp-in-string "[0-9]+" num bul)))
|
(replace-regexp-in-string "[0-9]+" num bul)))
|
||||||
(_ (let ((bul (org-element-property :bullet item)))
|
(_ (let ((bul (org-list-bullet-string
|
||||||
;; Change bullets into more visible form if UTF-8 is active.
|
(org-element-property :bullet item))))
|
||||||
(if (not utf8p) bul
|
;; Change bullets into more visible form if UTF-8 is active.
|
||||||
|
(if (not utf8p) bul
|
||||||
|
(replace-regexp-in-string
|
||||||
|
"-" "•"
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
"-" "•"
|
"+" "⁃"
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string "*" "‣" bul))))))))
|
||||||
"+" "⁃"
|
(indentation (if (eq list-type 'descriptive) org-ascii-quote-margin
|
||||||
(replace-regexp-in-string "*" "‣" bul))))))))))
|
(string-width bullet))))
|
||||||
(concat
|
(concat
|
||||||
bullet
|
bullet
|
||||||
(unless (eq list-type 'descriptive) checkbox)
|
checkbox
|
||||||
;; Contents: Pay attention to indentation. Note: check-boxes are
|
;; Contents: Pay attention to indentation. Note: check-boxes are
|
||||||
;; already taken care of at the paragraph level so they don't
|
;; already taken care of at the paragraph level so they don't
|
||||||
;; interfere with indentation.
|
;; interfere with indentation.
|
||||||
(let ((contents (org-ascii--indent-string contents (string-width bullet))))
|
(let ((contents (org-ascii--indent-string contents indentation)))
|
||||||
(if (eq (org-element-type (car (org-element-contents item))) 'paragraph)
|
;; Determine if contents should follow the bullet or start
|
||||||
|
;; a new line. Do the former when the first contributing
|
||||||
|
;; element to contents is a paragraph. In descriptive lists
|
||||||
|
;; however, contents always start a new line.
|
||||||
|
(if (and (not (eq list-type 'descriptive))
|
||||||
|
(org-string-nw-p contents)
|
||||||
|
(eq 'paragraph
|
||||||
|
(org-element-type
|
||||||
|
(cl-some (lambda (e)
|
||||||
|
(and (org-string-nw-p (org-export-data e info))
|
||||||
|
e))
|
||||||
|
(org-element-contents item)))))
|
||||||
(org-trim contents)
|
(org-trim contents)
|
||||||
(concat "\n" contents))))))
|
(concat "\n" contents))))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2154,21 +2154,17 @@ CODE is a string representing the source code to colorize. LANG
|
||||||
is the language used for CODE, as a string, or nil."
|
is the language used for CODE, as a string, or nil."
|
||||||
(when code
|
(when code
|
||||||
(cond
|
(cond
|
||||||
;; Case 1: No lang. Possibly an example block.
|
;; No language. Possibly an example block.
|
||||||
((not lang)
|
((not lang) (org-html-encode-plain-text code))
|
||||||
;; Simple transcoding.
|
;; Plain text explicitly set.
|
||||||
(org-html-encode-plain-text code))
|
((not org-html-htmlize-output-type) (org-html-encode-plain-text code))
|
||||||
;; Case 2: No htmlize or an inferior version of htmlize
|
;; No htmlize library or an inferior version of htmlize.
|
||||||
((not (and (or (require 'htmlize nil t)
|
((not (and (or (require 'htmlize nil t)
|
||||||
(error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
|
(error "Please install htmlize from \
|
||||||
|
https://github.com/hniksic/emacs-htmlize"))
|
||||||
(fboundp 'htmlize-region-for-paste)))
|
(fboundp 'htmlize-region-for-paste)))
|
||||||
;; Emit a warning.
|
;; Emit a warning.
|
||||||
(message "Cannot fontify src block (htmlize.el >= 1.34 required)")
|
(message "Cannot fontify src block (htmlize.el >= 1.34 required)")
|
||||||
;; Simple transcoding.
|
|
||||||
(org-html-encode-plain-text code))
|
|
||||||
;; Case 3: plain text explicitly set
|
|
||||||
((not org-html-htmlize-output-type)
|
|
||||||
;; Simple transcoding.
|
|
||||||
(org-html-encode-plain-text code))
|
(org-html-encode-plain-text code))
|
||||||
(t
|
(t
|
||||||
;; Map language
|
;; Map language
|
||||||
|
|
@ -2177,7 +2173,6 @@ is the language used for CODE, as a string, or nil."
|
||||||
(cond
|
(cond
|
||||||
;; Case 1: Language is not associated with any Emacs mode
|
;; Case 1: Language is not associated with any Emacs mode
|
||||||
((not (functionp lang-mode))
|
((not (functionp lang-mode))
|
||||||
;; Simple transcoding.
|
|
||||||
(org-html-encode-plain-text code))
|
(org-html-encode-plain-text code))
|
||||||
;; Case 2: Default. Fontify code.
|
;; Case 2: Default. Fontify code.
|
||||||
(t
|
(t
|
||||||
|
|
@ -2207,7 +2202,7 @@ is the language used for CODE, as a string, or nil."
|
||||||
(org-html-htmlize-region-for-paste
|
(org-html-htmlize-region-for-paste
|
||||||
(point-min) (point-max))))))
|
(point-min) (point-max))))))
|
||||||
;; Strip any enclosing <pre></pre> tags.
|
;; Strip any enclosing <pre></pre> tags.
|
||||||
(let* ((beg (and (string-match "\\`<pre[^>]*>\n*" code) (match-end 0)))
|
(let* ((beg (and (string-match "\\`<pre[^>]*>\n?" code) (match-end 0)))
|
||||||
(end (and beg (string-match "</pre>\\'" code))))
|
(end (and beg (string-match "</pre>\\'" code))))
|
||||||
(if (and beg end) (substring code beg end) code)))))))))
|
(if (and beg end) (substring code beg end) code)))))))))
|
||||||
|
|
||||||
|
|
@ -2220,7 +2215,7 @@ alist between line numbers and references (as returned by
|
||||||
`org-export-unravel-code'), a boolean specifying if labels should
|
`org-export-unravel-code'), a boolean specifying if labels should
|
||||||
appear in the source code, and the number associated to the first
|
appear in the source code, and the number associated to the first
|
||||||
line of code."
|
line of code."
|
||||||
(let* ((code-lines (org-split-string code "\n"))
|
(let* ((code-lines (split-string code "\n"))
|
||||||
(code-length (length code-lines))
|
(code-length (length code-lines))
|
||||||
(num-fmt
|
(num-fmt
|
||||||
(and num-start
|
(and num-start
|
||||||
|
|
@ -2328,15 +2323,7 @@ INFO is a plist used as a communication channel."
|
||||||
(org-element-property :priority headline)))
|
(org-element-property :priority headline)))
|
||||||
(text (org-export-data-with-backend
|
(text (org-export-data-with-backend
|
||||||
(org-export-get-alt-title headline info)
|
(org-export-get-alt-title headline info)
|
||||||
;; Create an anonymous back-end that will ignore any
|
(org-export-toc-entry-backend 'html)
|
||||||
;; footnote-reference, link, radio-target and target
|
|
||||||
;; in table of contents.
|
|
||||||
(org-export-create-backend
|
|
||||||
:parent 'html
|
|
||||||
:transcoders '((footnote-reference . ignore)
|
|
||||||
(link . (lambda (object c i) c))
|
|
||||||
(radio-target . (lambda (object c i) c))
|
|
||||||
(target . ignore)))
|
|
||||||
info))
|
info))
|
||||||
(tags (and (eq (plist-get info :with-tags) t)
|
(tags (and (eq (plist-get info :with-tags) t)
|
||||||
(org-export-get-tags headline info))))
|
(org-export-get-tags headline info))))
|
||||||
|
|
@ -2966,10 +2953,7 @@ images, set it to:
|
||||||
DESC is the description part of the link, or the empty string.
|
DESC is the description part of the link, or the empty string.
|
||||||
INFO is a plist holding contextual information. See
|
INFO is a plist holding contextual information. See
|
||||||
`org-export-data'."
|
`org-export-data'."
|
||||||
(let* ((home (when (plist-get info :html-link-home)
|
(let* ((link-org-files-as-html-maybe
|
||||||
(org-trim (plist-get info :html-link-home))))
|
|
||||||
(use-abs-url (plist-get info :html-link-use-abs-url))
|
|
||||||
(link-org-files-as-html-maybe
|
|
||||||
(lambda (raw-path info)
|
(lambda (raw-path info)
|
||||||
;; Treat links to `file.org' as links to `file.html', if
|
;; Treat links to `file.org' as links to `file.html', if
|
||||||
;; needed. See `org-html-link-org-files-as-html'.
|
;; needed. See `org-html-link-org-files-as-html'.
|
||||||
|
|
@ -2989,16 +2973,22 @@ INFO is a plist holding contextual information. See
|
||||||
((member type '("http" "https" "ftp" "mailto" "news"))
|
((member type '("http" "https" "ftp" "mailto" "news"))
|
||||||
(url-encode-url (org-link-unescape (concat type ":" raw-path))))
|
(url-encode-url (org-link-unescape (concat type ":" raw-path))))
|
||||||
((string= type "file")
|
((string= type "file")
|
||||||
;; Treat links to ".org" files as ".html", if needed.
|
;; During publishing, turn absolute file names belonging
|
||||||
|
;; to base directory into relative file names. Otherwise,
|
||||||
|
;; append "file" protocol to absolute file name.
|
||||||
(setq raw-path
|
(setq raw-path
|
||||||
(funcall link-org-files-as-html-maybe raw-path info))
|
(org-export-file-uri
|
||||||
;; If file path is absolute, prepend it with protocol
|
(org-publish-file-relative-name raw-path info)))
|
||||||
;; component - "file://".
|
;; Possibly append `:html-link-home' to relative file
|
||||||
(cond
|
;; name.
|
||||||
((file-name-absolute-p raw-path)
|
(let ((home (and (plist-get info :html-link-home)
|
||||||
(setq raw-path (org-export-file-uri raw-path)))
|
(org-trim (plist-get info :html-link-home)))))
|
||||||
((and home use-abs-url)
|
(when (and home
|
||||||
(setq raw-path (concat (file-name-as-directory home) raw-path))))
|
(plist-get info :html-link-use-abs-url)
|
||||||
|
(file-name-absolute-p raw-path))
|
||||||
|
(setq raw-path (concat (file-name-as-directory home) raw-path))))
|
||||||
|
;; Maybe turn ".org" into ".html".
|
||||||
|
(setq raw-path (funcall link-org-files-as-html-maybe raw-path info))
|
||||||
;; Add search option, if any. A search option can be
|
;; Add search option, if any. A search option can be
|
||||||
;; relative to a custom-id, a headline title, a name or
|
;; relative to a custom-id, a headline title, a name or
|
||||||
;; a target.
|
;; a target.
|
||||||
|
|
|
||||||
|
|
@ -285,6 +285,10 @@ This function shouldn't be used for floats. See
|
||||||
output
|
output
|
||||||
(concat (format "%s\n.br\n" label) output))))
|
(concat (format "%s\n.br\n" label) output))))
|
||||||
|
|
||||||
|
(defun org-man--protect-text (text)
|
||||||
|
"Protect minus and backslash characters in string TEXT."
|
||||||
|
(replace-regexp-in-string "-" "\\-" text nil t))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Template
|
;;; Template
|
||||||
|
|
@ -350,10 +354,9 @@ holding contextual information."
|
||||||
;;; Code
|
;;; Code
|
||||||
|
|
||||||
(defun org-man-code (code _contents _info)
|
(defun org-man-code (code _contents _info)
|
||||||
"Transcode a CODE object from Org to Man.
|
"Transcode a CODE object from Org to Man."
|
||||||
CONTENTS is nil. INFO is a plist used as a communication
|
(format "\\fC%s\\fP"
|
||||||
channel."
|
(org-man--protect-text (org-element-property :value code))))
|
||||||
(format "\\fC%s\\fP" code))
|
|
||||||
|
|
||||||
|
|
||||||
;;; Drawer
|
;;; Drawer
|
||||||
|
|
@ -1029,11 +1032,10 @@ holding contextual information."
|
||||||
|
|
||||||
;;; Verbatim
|
;;; Verbatim
|
||||||
|
|
||||||
(defun org-man-verbatim (_verbatim contents _info)
|
(defun org-man-verbatim (verbatim _contents _info)
|
||||||
"Transcode a VERBATIM object from Org to Man.
|
"Transcode a VERBATIM object from Org to Man."
|
||||||
CONTENTS is nil. INFO is a plist used as a communication
|
(format "\\fI%s\\fP"
|
||||||
channel."
|
(org-man--protect-text (org-element-property :value verbatim))))
|
||||||
(format ".nf\n%s\n.fi" contents))
|
|
||||||
|
|
||||||
|
|
||||||
;;; Verse Block
|
;;; Verse Block
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ a communication channel."
|
||||||
(format "<a id=\"%s\"></a>"
|
(format "<a id=\"%s\"></a>"
|
||||||
(or (org-element-property :CUSTOM_ID headline)
|
(or (org-element-property :CUSTOM_ID headline)
|
||||||
(org-export-get-reference headline info))))))
|
(org-export-get-reference headline info))))))
|
||||||
(concat (org-md--headline-title style level title anchor tags)
|
(concat (org-md--headline-title style level heading anchor tags)
|
||||||
contents)))))))
|
contents)))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -582,16 +582,7 @@ contents according to the current headline."
|
||||||
(format "[%s](#%s)"
|
(format "[%s](#%s)"
|
||||||
(org-export-data-with-backend
|
(org-export-data-with-backend
|
||||||
(org-export-get-alt-title headline info)
|
(org-export-get-alt-title headline info)
|
||||||
;; Create an anonymous back-end that will
|
(org-export-toc-entry-backend 'md)
|
||||||
;; ignore any footnote-reference, link,
|
|
||||||
;; radio-target and target in table of
|
|
||||||
;; contents.
|
|
||||||
(org-export-create-backend
|
|
||||||
:parent 'md
|
|
||||||
:transcoders '((footnote-reference . ignore)
|
|
||||||
(link . (lambda (object c i) c))
|
|
||||||
(radio-target . (lambda (object c i) c))
|
|
||||||
(target . ignore)))
|
|
||||||
info)
|
info)
|
||||||
(or (org-element-property :CUSTOM_ID headline)
|
(or (org-element-property :CUSTOM_ID headline)
|
||||||
(org-export-get-reference headline info))))
|
(org-export-get-reference headline info))))
|
||||||
|
|
|
||||||
|
|
@ -1159,12 +1159,8 @@ table of contents as a string, or nil."
|
||||||
;; Likewise, links, footnote references and regular targets are also
|
;; Likewise, links, footnote references and regular targets are also
|
||||||
;; suppressed.
|
;; suppressed.
|
||||||
(let* ((headlines (org-export-collect-headlines info depth scope))
|
(let* ((headlines (org-export-collect-headlines info depth scope))
|
||||||
(backend (org-export-create-backend
|
(backend (org-export-toc-entry-backend
|
||||||
:parent (org-export-backend-name (plist-get info :back-end))
|
(org-export-backend-name (plist-get info :back-end)))))
|
||||||
:transcoders '((footnote-reference . ignore)
|
|
||||||
(link . (lambda (object c i) c))
|
|
||||||
(radio-target . (lambda (object c i) c))
|
|
||||||
(target . ignore)))))
|
|
||||||
(when headlines
|
(when headlines
|
||||||
(org-odt--format-toc
|
(org-odt--format-toc
|
||||||
(and (not scope) (org-export-translate "Table of Contents" :utf-8 info))
|
(and (not scope) (org-export-translate "Table of Contents" :utf-8 info))
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,6 @@ You can overwrite this default per project in your
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
;;; Timestamp-related functions
|
;;; Timestamp-related functions
|
||||||
|
|
||||||
(defun org-publish-timestamp-filename (filename &optional pub-dir pub-func)
|
(defun org-publish-timestamp-filename (filename &optional pub-dir pub-func)
|
||||||
|
|
@ -392,7 +391,6 @@ If there is no timestamp, create one."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
;;; Getting project information out of `org-publish-project-alist'
|
;;; Getting project information out of `org-publish-project-alist'
|
||||||
|
|
||||||
(defun org-publish-property (property project &optional default)
|
(defun org-publish-property (property project &optional default)
|
||||||
|
|
@ -525,7 +523,6 @@ publishing FILENAME."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
;;; Tools for publishing functions in back-ends
|
;;; Tools for publishing functions in back-ends
|
||||||
|
|
||||||
(defun org-publish-org-to (backend filename extension plist &optional pub-dir)
|
(defun org-publish-org-to (backend filename extension plist &optional pub-dir)
|
||||||
|
|
@ -899,7 +896,6 @@ representation for the files to include, as returned by
|
||||||
(org-list-to-org list)))
|
(org-list-to-org list)))
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
;;; Interactive publishing functions
|
;;; Interactive publishing functions
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
@ -1154,7 +1150,8 @@ references with `org-export-get-reference'."
|
||||||
(let* ((filename (file-truename file))
|
(let* ((filename (file-truename file))
|
||||||
(crossrefs
|
(crossrefs
|
||||||
(org-publish-cache-get-file-property filename :crossrefs nil t))
|
(org-publish-cache-get-file-property filename :crossrefs nil t))
|
||||||
(cells (org-export-string-to-search-cell search)))
|
(cells
|
||||||
|
(org-export-string-to-search-cell (org-link-unescape search))))
|
||||||
(or
|
(or
|
||||||
;; Look for reference associated to search cells triggered by
|
;; Look for reference associated to search cells triggered by
|
||||||
;; LINK. It can match when targeted file has been published
|
;; LINK. It can match when targeted file has been published
|
||||||
|
|
@ -1169,6 +1166,17 @@ references with `org-export-get-reference'."
|
||||||
(org-publish-cache-set-file-property filename :crossrefs crossrefs)
|
(org-publish-cache-set-file-property filename :crossrefs crossrefs)
|
||||||
(org-export-format-reference new))))))
|
(org-export-format-reference new))))))
|
||||||
|
|
||||||
|
(defun org-publish-file-relative-name (filename info)
|
||||||
|
"Convert FILENAME to be relative to current project's base directory.
|
||||||
|
INFO is the plist containing the current export state. The
|
||||||
|
function does not change relative file names."
|
||||||
|
(let ((base (plist-get info :base-directory)))
|
||||||
|
(if (and base
|
||||||
|
(file-name-absolute-p filename)
|
||||||
|
(file-in-directory-p filename base))
|
||||||
|
(file-relative-name filename base)
|
||||||
|
filename)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Caching functions
|
;;; Caching functions
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,8 @@
|
||||||
:filters-alist
|
:filters-alist
|
||||||
'((:filter-headline . org-texinfo--filter-section-blank-lines)
|
'((:filter-headline . org-texinfo--filter-section-blank-lines)
|
||||||
(:filter-parse-tree . org-texinfo--normalize-headlines)
|
(:filter-parse-tree . org-texinfo--normalize-headlines)
|
||||||
(:filter-section . org-texinfo--filter-section-blank-lines))
|
(:filter-section . org-texinfo--filter-section-blank-lines)
|
||||||
|
(:filter-final-output . org-texinfo--untabify))
|
||||||
:menu-entry
|
:menu-entry
|
||||||
'(?i "Export to Texinfo"
|
'(?i "Export to Texinfo"
|
||||||
((?t "As TEXI file" org-texinfo-export-to-texinfo)
|
((?t "As TEXI file" org-texinfo-export-to-texinfo)
|
||||||
|
|
@ -405,6 +406,10 @@ If two strings share the same prefix (e.g. \"ISO-8859-1\" and
|
||||||
|
|
||||||
;;; Internal Functions
|
;;; Internal Functions
|
||||||
|
|
||||||
|
(defun org-texinfo--untabify (s _backend _info)
|
||||||
|
"Remove TAB characters in string S."
|
||||||
|
(replace-regexp-in-string "\t" (make-string tab-width ?\s) s))
|
||||||
|
|
||||||
(defun org-texinfo--filter-section-blank-lines (headline _backend _info)
|
(defun org-texinfo--filter-section-blank-lines (headline _backend _info)
|
||||||
"Filter controlling number of blank lines after a section."
|
"Filter controlling number of blank lines after a section."
|
||||||
(replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" "\n\n" headline))
|
(replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" "\n\n" headline))
|
||||||
|
|
@ -499,8 +504,12 @@ export state, as a plist."
|
||||||
(org-export-create-backend
|
(org-export-create-backend
|
||||||
:parent 'texinfo
|
:parent 'texinfo
|
||||||
:transcoders '((footnote-reference . ignore)
|
:transcoders '((footnote-reference . ignore)
|
||||||
(link . (lambda (object c i) c))
|
(link . (lambda (l c i)
|
||||||
(radio-target . (lambda (object c i) c))
|
(or c
|
||||||
|
(org-export-data
|
||||||
|
(org-element-property :raw-link l)
|
||||||
|
i))))
|
||||||
|
(radio-target . (lambda (_r c _i) c))
|
||||||
(target . ignore)))
|
(target . ignore)))
|
||||||
info))
|
info))
|
||||||
|
|
||||||
|
|
@ -519,18 +528,27 @@ strings (e.g., returned by `org-export-get-caption')."
|
||||||
(let* ((backend
|
(let* ((backend
|
||||||
(org-export-create-backend
|
(org-export-create-backend
|
||||||
:parent 'texinfo
|
:parent 'texinfo
|
||||||
:transcoders '((link . (lambda (object c i) c))
|
:transcoders '((link . (lambda (l c i)
|
||||||
(radio-target . (lambda (object c i) c))
|
(or c
|
||||||
|
(org-export-data
|
||||||
|
(org-element-property :raw-link l)
|
||||||
|
i))))
|
||||||
|
(radio-target . (lambda (_r c _i) c))
|
||||||
(target . ignore))))
|
(target . ignore))))
|
||||||
(short-backend
|
(short-backend
|
||||||
(org-export-create-backend
|
(org-export-create-backend
|
||||||
:parent 'texinfo
|
:parent 'texinfo
|
||||||
:transcoders '((footnote-reference . ignore)
|
:transcoders
|
||||||
(inline-src-block . ignore)
|
'((footnote-reference . ignore)
|
||||||
(link . (lambda (object c i) c))
|
(inline-src-block . ignore)
|
||||||
(radio-target . (lambda (object c i) c))
|
(link . (lambda (l c i)
|
||||||
(target . ignore)
|
(or c
|
||||||
(verbatim . ignore))))
|
(org-export-data
|
||||||
|
(org-element-property :raw-link l)
|
||||||
|
i))))
|
||||||
|
(radio-target . (lambda (_r c _i) c))
|
||||||
|
(target . ignore)
|
||||||
|
(verbatim . ignore))))
|
||||||
(short-str
|
(short-str
|
||||||
(if (and short caption)
|
(if (and short caption)
|
||||||
(format "@shortcaption{%s}\n"
|
(format "@shortcaption{%s}\n"
|
||||||
|
|
@ -1017,15 +1035,17 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
||||||
|
|
||||||
(defun org-texinfo--@ref (datum description info)
|
(defun org-texinfo--@ref (datum description info)
|
||||||
"Return @ref command for element or object DATUM.
|
"Return @ref command for element or object DATUM.
|
||||||
DESCRIPTION is the name of the section to print, as a string."
|
DESCRIPTION is the printed name of the section, as a string, or
|
||||||
|
nil."
|
||||||
(let ((node-name (org-texinfo--get-node datum info))
|
(let ((node-name (org-texinfo--get-node datum info))
|
||||||
;; Sanitize DESCRIPTION for cross-reference use. In
|
;; Sanitize DESCRIPTION for cross-reference use. In
|
||||||
;; particular, remove colons as they seem to cause (even
|
;; particular, remove colons as they seem to cause pain (even
|
||||||
;; within @asis{...} to the Texinfo reader.
|
;; within @asis{...}) to the Texinfo reader.
|
||||||
(title (replace-regexp-in-string
|
(title (and description
|
||||||
"[ \t]*:+" ""
|
(replace-regexp-in-string
|
||||||
(replace-regexp-in-string "," "@comma{}" description))))
|
"[ \t]*:+" ""
|
||||||
(if (equal title node-name)
|
(replace-regexp-in-string "," "@comma{}" description)))))
|
||||||
|
(if (or (not title) (equal title node-name))
|
||||||
(format "@ref{%s}" node-name)
|
(format "@ref{%s}" node-name)
|
||||||
(format "@ref{%s, , %s}" node-name title))))
|
(format "@ref{%s, , %s}" node-name title))))
|
||||||
|
|
||||||
|
|
@ -1073,20 +1093,8 @@ INFO is a plist holding contextual information. See
|
||||||
(org-element-type
|
(org-element-type
|
||||||
(org-element-property :parent destination))))))
|
(org-element-property :parent destination))))))
|
||||||
(let ((headline (org-element-lineage destination '(headline) t)))
|
(let ((headline (org-element-lineage destination '(headline) t)))
|
||||||
(org-texinfo--@ref
|
(org-texinfo--@ref headline desc info)))
|
||||||
headline
|
(_ (org-texinfo--@ref destination desc info)))))
|
||||||
(or desc (org-texinfo--sanitize-title
|
|
||||||
(org-element-property :title headline) info))
|
|
||||||
info)))
|
|
||||||
(_
|
|
||||||
(org-texinfo--@ref
|
|
||||||
destination
|
|
||||||
(or desc
|
|
||||||
(pcase (org-export-get-ordinal destination info)
|
|
||||||
((and (pred integerp) n) (number-to-string n))
|
|
||||||
((and (pred consp) n) (mapconcat #'number-to-string n "."))
|
|
||||||
(_ "???"))) ;cannot guess the description
|
|
||||||
info)))))
|
|
||||||
((string= type "mailto")
|
((string= type "mailto")
|
||||||
(format "@email{%s}"
|
(format "@email{%s}"
|
||||||
(concat (org-texinfo--sanitize-content path)
|
(concat (org-texinfo--sanitize-content path)
|
||||||
|
|
@ -1167,19 +1175,19 @@ is an integer, build the menu recursively, down to this depth."
|
||||||
(cond
|
(cond
|
||||||
((not level)
|
((not level)
|
||||||
(org-texinfo--format-entries (org-texinfo--menu-entries scope info) info))
|
(org-texinfo--format-entries (org-texinfo--menu-entries scope info) info))
|
||||||
((zerop level) nil)
|
((zerop level) "\n")
|
||||||
(t
|
(t
|
||||||
(org-element-normalize-string
|
(mapconcat
|
||||||
(mapconcat
|
(lambda (h)
|
||||||
(lambda (h)
|
(let ((entries (org-texinfo--menu-entries h info)))
|
||||||
(let ((entries (org-texinfo--menu-entries h info)))
|
(when entries
|
||||||
(when entries
|
(concat
|
||||||
(concat
|
(format "%s\n\n%s\n"
|
||||||
(format "%s\n\n%s\n"
|
(org-export-data (org-export-get-alt-title h info) info)
|
||||||
(org-export-data (org-export-get-alt-title h info) info)
|
(org-texinfo--format-entries entries info))
|
||||||
(org-texinfo--format-entries entries info))
|
(org-texinfo--build-menu h info (1- level))))))
|
||||||
(org-texinfo--build-menu h info (1- level))))))
|
(org-texinfo--menu-entries scope info)
|
||||||
(org-texinfo--menu-entries scope info) "\n")))))
|
""))))
|
||||||
|
|
||||||
(defun org-texinfo--format-entries (entries info)
|
(defun org-texinfo--format-entries (entries info)
|
||||||
"Format all direct menu entries in SCOPE, as a string.
|
"Format all direct menu entries in SCOPE, as a string.
|
||||||
|
|
|
||||||
|
|
@ -3954,9 +3954,7 @@ INFO is a plist holding contextual information."
|
||||||
(defun org-export-numbered-headline-p (headline info)
|
(defun org-export-numbered-headline-p (headline info)
|
||||||
"Return a non-nil value if HEADLINE element should be numbered.
|
"Return a non-nil value if HEADLINE element should be numbered.
|
||||||
INFO is a plist used as a communication channel."
|
INFO is a plist used as a communication channel."
|
||||||
(unless (cl-some
|
(unless (org-not-nil (org-export-get-node-property :UNNUMBERED headline t))
|
||||||
(lambda (head) (org-not-nil (org-element-property :UNNUMBERED head)))
|
|
||||||
(org-element-lineage headline nil t))
|
|
||||||
(let ((sec-num (plist-get info :section-numbers))
|
(let ((sec-num (plist-get info :section-numbers))
|
||||||
(level (org-export-get-relative-level headline info)))
|
(level (org-export-get-relative-level headline info)))
|
||||||
(if (wholenump sec-num) (<= level sec-num) sec-num))))
|
(if (wholenump sec-num) (<= level sec-num) sec-num))))
|
||||||
|
|
@ -4055,11 +4053,15 @@ used as a communication channel."
|
||||||
(memq (org-element-type (org-export-get-previous-element blob info))
|
(memq (org-element-type (org-export-get-previous-element blob info))
|
||||||
'(nil section)))
|
'(nil section)))
|
||||||
|
|
||||||
(defun org-export-last-sibling-p (blob info)
|
(defun org-export-last-sibling-p (datum info)
|
||||||
"Non-nil when BLOB is the last sibling in its parent.
|
"Non-nil when DATUM is the last sibling in its parent.
|
||||||
BLOB is an element or an object. INFO is a plist used as
|
DATUM is an element or an object. INFO is a plist used as
|
||||||
a communication channel."
|
a communication channel."
|
||||||
(not (org-export-get-next-element blob info)))
|
(let ((next (org-export-get-next-element datum info)))
|
||||||
|
(or (not next)
|
||||||
|
(and (eq 'headline (org-element-type datum))
|
||||||
|
(> (org-element-property :level datum)
|
||||||
|
(org-element-property :level next))))))
|
||||||
|
|
||||||
|
|
||||||
;;;; For Keywords
|
;;;; For Keywords
|
||||||
|
|
@ -5176,7 +5178,7 @@ return nil."
|
||||||
info 'first-match)))
|
info 'first-match)))
|
||||||
|
|
||||||
|
|
||||||
;;;; For Tables Of Contents
|
;;;; For Tables of Contents
|
||||||
;;
|
;;
|
||||||
;; `org-export-collect-headlines' builds a list of all exportable
|
;; `org-export-collect-headlines' builds a list of all exportable
|
||||||
;; headline elements, maybe limited to a certain depth. One can then
|
;; headline elements, maybe limited to a certain depth. One can then
|
||||||
|
|
@ -5186,6 +5188,9 @@ return nil."
|
||||||
;; Once the generic function `org-export-collect-elements' is defined,
|
;; Once the generic function `org-export-collect-elements' is defined,
|
||||||
;; `org-export-collect-tables', `org-export-collect-figures' and
|
;; `org-export-collect-tables', `org-export-collect-figures' and
|
||||||
;; `org-export-collect-listings' can be derived from it.
|
;; `org-export-collect-listings' can be derived from it.
|
||||||
|
;;
|
||||||
|
;; `org-export-toc-entry-backend' builds a special anonymous back-end
|
||||||
|
;; useful to export table of contents' entries.
|
||||||
|
|
||||||
(defun org-export-collect-headlines (info &optional n scope)
|
(defun org-export-collect-headlines (info &optional n scope)
|
||||||
"Collect headlines in order to build a table of contents.
|
"Collect headlines in order to build a table of contents.
|
||||||
|
|
@ -5271,6 +5276,32 @@ INFO is a plist used as a communication channel.
|
||||||
Return a list of src-block elements with a caption."
|
Return a list of src-block elements with a caption."
|
||||||
(org-export-collect-elements 'src-block info))
|
(org-export-collect-elements 'src-block info))
|
||||||
|
|
||||||
|
(defun org-export-toc-entry-backend (parent &rest transcoders)
|
||||||
|
"Return an export back-end appropriate for table of contents entries.
|
||||||
|
|
||||||
|
PARENT is an export back-end the returned back-end should inherit
|
||||||
|
from.
|
||||||
|
|
||||||
|
By default, the back-end removes footnote references and targets.
|
||||||
|
It also changes links and radio targets into regular text.
|
||||||
|
TRANSCODERS optional argument, when non-nil, specifies additional
|
||||||
|
transcoders. A transcoder follows the pattern (TYPE . FUNCTION)
|
||||||
|
where type is an element or object type and FUNCTION the function
|
||||||
|
transcoding it."
|
||||||
|
(declare (indent 1))
|
||||||
|
(org-export-create-backend
|
||||||
|
:parent parent
|
||||||
|
:transcoders
|
||||||
|
(append transcoders
|
||||||
|
`((footnote-reference . ,#'ignore)
|
||||||
|
(link . ,(lambda (l c i)
|
||||||
|
(or c
|
||||||
|
(org-export-data
|
||||||
|
(org-element-property :raw-link l)
|
||||||
|
i))))
|
||||||
|
(radio-target . ,(lambda (_r c _) c))
|
||||||
|
(target . ,#'ignore)))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Smart Quotes
|
;;;; Smart Quotes
|
||||||
;;
|
;;
|
||||||
|
|
@ -5657,6 +5688,7 @@ them."
|
||||||
("zh-TW" :html "作者" :utf-8 "作者"))
|
("zh-TW" :html "作者" :utf-8 "作者"))
|
||||||
("Continued from previous page"
|
("Continued from previous page"
|
||||||
("ar" :default "تتمة الصفحة السابقة")
|
("ar" :default "تتمة الصفحة السابقة")
|
||||||
|
("cs" :default "Pokračování z předchozí strany")
|
||||||
("de" :default "Fortsetzung von vorheriger Seite")
|
("de" :default "Fortsetzung von vorheriger Seite")
|
||||||
("es" :html "Continúa de la página anterior" :ascii "Continua de la pagina anterior" :default "Continúa de la página anterior")
|
("es" :html "Continúa de la página anterior" :ascii "Continua de la pagina anterior" :default "Continúa de la página anterior")
|
||||||
("fr" :default "Suite de la page précédente")
|
("fr" :default "Suite de la page précédente")
|
||||||
|
|
@ -5669,6 +5701,7 @@ them."
|
||||||
("sl" :default "Nadaljevanje s prejšnje strani"))
|
("sl" :default "Nadaljevanje s prejšnje strani"))
|
||||||
("Continued on next page"
|
("Continued on next page"
|
||||||
("ar" :default "التتمة في الصفحة التالية")
|
("ar" :default "التتمة في الصفحة التالية")
|
||||||
|
("cs" :default "Pokračuje na další stránce")
|
||||||
("de" :default "Fortsetzung nächste Seite")
|
("de" :default "Fortsetzung nächste Seite")
|
||||||
("es" :html "Continúa en la siguiente página" :ascii "Continua en la siguiente pagina" :default "Continúa en la siguiente página")
|
("es" :html "Continúa en la siguiente página" :ascii "Continua en la siguiente pagina" :default "Continúa en la siguiente página")
|
||||||
("fr" :default "Suite page suivante")
|
("fr" :default "Suite page suivante")
|
||||||
|
|
@ -5680,6 +5713,7 @@ them."
|
||||||
:utf-8 "(Продолжение следует)")
|
:utf-8 "(Продолжение следует)")
|
||||||
("sl" :default "Nadaljevanje na naslednji strani"))
|
("sl" :default "Nadaljevanje na naslednji strani"))
|
||||||
("Created"
|
("Created"
|
||||||
|
("cs" :default "Vytvořeno")
|
||||||
("sl" :default "Ustvarjeno"))
|
("sl" :default "Ustvarjeno"))
|
||||||
("Date"
|
("Date"
|
||||||
("ar" :default "بتاريخ")
|
("ar" :default "بتاريخ")
|
||||||
|
|
@ -5709,6 +5743,7 @@ them."
|
||||||
("zh-TW" :html "日期" :utf-8 "日期"))
|
("zh-TW" :html "日期" :utf-8 "日期"))
|
||||||
("Equation"
|
("Equation"
|
||||||
("ar" :default "معادلة")
|
("ar" :default "معادلة")
|
||||||
|
("cs" :default "Rovnice")
|
||||||
("da" :default "Ligning")
|
("da" :default "Ligning")
|
||||||
("de" :default "Gleichung")
|
("de" :default "Gleichung")
|
||||||
("es" :ascii "Ecuacion" :html "Ecuación" :default "Ecuación")
|
("es" :ascii "Ecuacion" :html "Ecuación" :default "Ecuación")
|
||||||
|
|
@ -5727,6 +5762,7 @@ them."
|
||||||
("zh-CN" :html "方程" :utf-8 "方程"))
|
("zh-CN" :html "方程" :utf-8 "方程"))
|
||||||
("Figure"
|
("Figure"
|
||||||
("ar" :default "شكل")
|
("ar" :default "شكل")
|
||||||
|
("cs" :default "Obrázek")
|
||||||
("da" :default "Figur")
|
("da" :default "Figur")
|
||||||
("de" :default "Abbildung")
|
("de" :default "Abbildung")
|
||||||
("es" :default "Figura")
|
("es" :default "Figura")
|
||||||
|
|
@ -5742,6 +5778,7 @@ them."
|
||||||
("zh-CN" :html "图" :utf-8 "图"))
|
("zh-CN" :html "图" :utf-8 "图"))
|
||||||
("Figure %d:"
|
("Figure %d:"
|
||||||
("ar" :default "شكل %d:")
|
("ar" :default "شكل %d:")
|
||||||
|
("cs" :default "Obrázek %d:")
|
||||||
("da" :default "Figur %d")
|
("da" :default "Figur %d")
|
||||||
("de" :default "Abbildung %d:")
|
("de" :default "Abbildung %d:")
|
||||||
("es" :default "Figura %d:")
|
("es" :default "Figura %d:")
|
||||||
|
|
@ -5760,7 +5797,7 @@ them."
|
||||||
("Footnotes"
|
("Footnotes"
|
||||||
("ar" :default "الهوامش")
|
("ar" :default "الهوامش")
|
||||||
("ca" :html "Peus de pàgina")
|
("ca" :html "Peus de pàgina")
|
||||||
("cs" :default "Pozn\xe1mky pod carou")
|
("cs" :default "Poznámky pod čarou")
|
||||||
("da" :default "Fodnoter")
|
("da" :default "Fodnoter")
|
||||||
("de" :html "Fußnoten" :default "Fußnoten")
|
("de" :html "Fußnoten" :default "Fußnoten")
|
||||||
("eo" :default "Piednotoj")
|
("eo" :default "Piednotoj")
|
||||||
|
|
@ -5787,6 +5824,7 @@ them."
|
||||||
("zh-TW" :html "腳註" :utf-8 "腳註"))
|
("zh-TW" :html "腳註" :utf-8 "腳註"))
|
||||||
("List of Listings"
|
("List of Listings"
|
||||||
("ar" :default "قائمة بالبرامج")
|
("ar" :default "قائمة بالبرامج")
|
||||||
|
("cs" :default "Seznam programů")
|
||||||
("da" :default "Programmer")
|
("da" :default "Programmer")
|
||||||
("de" :default "Programmauflistungsverzeichnis")
|
("de" :default "Programmauflistungsverzeichnis")
|
||||||
("es" :ascii "Indice de Listados de programas" :html "Índice de Listados de programas" :default "Índice de Listados de programas")
|
("es" :ascii "Indice de Listados de programas" :html "Índice de Listados de programas" :default "Índice de Listados de programas")
|
||||||
|
|
@ -5801,6 +5839,7 @@ them."
|
||||||
("zh-CN" :html "代码目录" :utf-8 "代码目录"))
|
("zh-CN" :html "代码目录" :utf-8 "代码目录"))
|
||||||
("List of Tables"
|
("List of Tables"
|
||||||
("ar" :default "قائمة بالجداول")
|
("ar" :default "قائمة بالجداول")
|
||||||
|
("cs" :default "Seznam tabulek")
|
||||||
("da" :default "Tabeller")
|
("da" :default "Tabeller")
|
||||||
("de" :default "Tabellenverzeichnis")
|
("de" :default "Tabellenverzeichnis")
|
||||||
("es" :ascii "Indice de tablas" :html "Índice de tablas" :default "Índice de tablas")
|
("es" :ascii "Indice de tablas" :html "Índice de tablas" :default "Índice de tablas")
|
||||||
|
|
@ -5819,6 +5858,7 @@ them."
|
||||||
("zh-CN" :html "表格目录" :utf-8 "表格目录"))
|
("zh-CN" :html "表格目录" :utf-8 "表格目录"))
|
||||||
("Listing"
|
("Listing"
|
||||||
("ar" :default "برنامج")
|
("ar" :default "برنامج")
|
||||||
|
("cs" :default "Program")
|
||||||
("da" :default "Program")
|
("da" :default "Program")
|
||||||
("de" :default "Programmlisting")
|
("de" :default "Programmlisting")
|
||||||
("es" :default "Listado de programa")
|
("es" :default "Listado de programa")
|
||||||
|
|
@ -5834,6 +5874,7 @@ them."
|
||||||
("zh-CN" :html "代码" :utf-8 "代码"))
|
("zh-CN" :html "代码" :utf-8 "代码"))
|
||||||
("Listing %d:"
|
("Listing %d:"
|
||||||
("ar" :default "برنامج %d:")
|
("ar" :default "برنامج %d:")
|
||||||
|
("cs" :default "Program %d:")
|
||||||
("da" :default "Program %d")
|
("da" :default "Program %d")
|
||||||
("de" :default "Programmlisting %d")
|
("de" :default "Programmlisting %d")
|
||||||
("es" :default "Listado de programa %d")
|
("es" :default "Listado de programa %d")
|
||||||
|
|
@ -5849,20 +5890,24 @@ them."
|
||||||
("zh-CN" :html "代码%d " :utf-8 "代码%d "))
|
("zh-CN" :html "代码%d " :utf-8 "代码%d "))
|
||||||
("References"
|
("References"
|
||||||
("ar" :default "المراجع")
|
("ar" :default "المراجع")
|
||||||
|
("cs" :default "Reference")
|
||||||
("fr" :ascii "References" :default "Références")
|
("fr" :ascii "References" :default "Références")
|
||||||
("de" :default "Quellen")
|
("de" :default "Quellen")
|
||||||
("es" :default "Referencias")
|
("es" :default "Referencias")
|
||||||
("sl" :default "Reference"))
|
("sl" :default "Reference"))
|
||||||
("See figure %s"
|
("See figure %s"
|
||||||
|
("cs" :default "Viz obrázek %s")
|
||||||
("fr" :default "cf. figure %s"
|
("fr" :default "cf. figure %s"
|
||||||
:html "cf. figure %s" :latex "cf.~figure~%s")
|
:html "cf. figure %s" :latex "cf.~figure~%s")
|
||||||
("sl" :default "Glej sliko %s"))
|
("sl" :default "Glej sliko %s"))
|
||||||
("See listing %s"
|
("See listing %s"
|
||||||
|
("cs" :default "Viz program %s")
|
||||||
("fr" :default "cf. programme %s"
|
("fr" :default "cf. programme %s"
|
||||||
:html "cf. programme %s" :latex "cf.~programme~%s")
|
:html "cf. programme %s" :latex "cf.~programme~%s")
|
||||||
("sl" :default "Glej izpis programa %s"))
|
("sl" :default "Glej izpis programa %s"))
|
||||||
("See section %s"
|
("See section %s"
|
||||||
("ar" :default "انظر قسم %s")
|
("ar" :default "انظر قسم %s")
|
||||||
|
("cs" :default "Viz sekce %s")
|
||||||
("da" :default "jævnfør afsnit %s")
|
("da" :default "jævnfør afsnit %s")
|
||||||
("de" :default "siehe Abschnitt %s")
|
("de" :default "siehe Abschnitt %s")
|
||||||
("es" :ascii "Vea seccion %s" :html "Vea sección %s" :default "Vea sección %s")
|
("es" :ascii "Vea seccion %s" :html "Vea sección %s" :default "Vea sección %s")
|
||||||
|
|
@ -5876,11 +5921,13 @@ them."
|
||||||
("sl" :default "Glej poglavje %d")
|
("sl" :default "Glej poglavje %d")
|
||||||
("zh-CN" :html "参见第%s节" :utf-8 "参见第%s节"))
|
("zh-CN" :html "参见第%s节" :utf-8 "参见第%s节"))
|
||||||
("See table %s"
|
("See table %s"
|
||||||
|
("cs" :default "Viz tabulka %s")
|
||||||
("fr" :default "cf. tableau %s"
|
("fr" :default "cf. tableau %s"
|
||||||
:html "cf. tableau %s" :latex "cf.~tableau~%s")
|
:html "cf. tableau %s" :latex "cf.~tableau~%s")
|
||||||
("sl" :default "Glej tabelo %s"))
|
("sl" :default "Glej tabelo %s"))
|
||||||
("Table"
|
("Table"
|
||||||
("ar" :default "جدول")
|
("ar" :default "جدول")
|
||||||
|
("cs" :default "Tabulka")
|
||||||
("de" :default "Tabelle")
|
("de" :default "Tabelle")
|
||||||
("es" :default "Tabla")
|
("es" :default "Tabla")
|
||||||
("et" :default "Tabel")
|
("et" :default "Tabel")
|
||||||
|
|
@ -5893,6 +5940,7 @@ them."
|
||||||
("zh-CN" :html "表" :utf-8 "表"))
|
("zh-CN" :html "表" :utf-8 "表"))
|
||||||
("Table %d:"
|
("Table %d:"
|
||||||
("ar" :default "جدول %d:")
|
("ar" :default "جدول %d:")
|
||||||
|
("cs" :default "Tabulka %d:")
|
||||||
("da" :default "Tabel %d")
|
("da" :default "Tabel %d")
|
||||||
("de" :default "Tabelle %d")
|
("de" :default "Tabelle %d")
|
||||||
("es" :default "Tabla %d")
|
("es" :default "Tabla %d")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue