forked from mirrors/org-mode
Merge branch 'bugfix' into emacs-sync
The upcoming 9.5.1 release is the target for Emacs 28.1, but the plan is to regularly sync with the emacs-28 branch in the meantime.
This commit is contained in:
commit
fbc2f9a724
|
@ -0,0 +1,10 @@
|
|||
These data files are used by Org's oc-csl.el library.
|
||||
|
||||
LICENSE INFORMATION
|
||||
|
||||
chicago-author-date.csl
|
||||
locales-en-US.xml
|
||||
|
||||
Both of these files are part of the Citation Style Language (CSL)
|
||||
project (<https://citationstyles.org/>) and are released under the
|
||||
Creative Commons Attribution-ShareAlike 3.0 Unported license.
|
|
@ -20,11 +20,20 @@
|
|||
<contributor>
|
||||
<name>Andrew Dunning</name>
|
||||
<email>andrew.dunning@utoronto.ca</email>
|
||||
<uri>https://orcid.org/0000-0003-0464-5036</uri>
|
||||
</contributor>
|
||||
<contributor>
|
||||
<name>Matthew Roth</name>
|
||||
<email>matthew.g.roth@yale.edu</email>
|
||||
<uri> https://orcid.org/0000-0001-7902-6331</uri>
|
||||
</contributor>
|
||||
<contributor>
|
||||
<name>Brenton M. Wiernik</name>
|
||||
</contributor>
|
||||
<category citation-format="author-date"/>
|
||||
<category field="generic-base"/>
|
||||
<summary>The author-date variant of the Chicago style</summary>
|
||||
<updated>2017-10-12T12:00:00+00:00</updated>
|
||||
<updated>2018-01-24T12:00:00+00:00</updated>
|
||||
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
|
||||
</info>
|
||||
<locale xml:lang="en">
|
||||
|
@ -32,16 +41,13 @@
|
|||
<term name="editor" form="verb-short">ed.</term>
|
||||
<term name="container-author" form="verb">by</term>
|
||||
<term name="translator" form="verb-short">trans.</term>
|
||||
<term name="editortranslator" form="verb">
|
||||
<single>edited and translated by</single>
|
||||
<multiple>edited and translated by</multiple>
|
||||
</term>
|
||||
<term name="editortranslator" form="verb">edited and translated by</term>
|
||||
<term name="translator" form="short">trans.</term>
|
||||
</terms>
|
||||
</locale>
|
||||
<macro name="secondary-contributors">
|
||||
<choose>
|
||||
<if type="chapter paper-conference" match="none">
|
||||
<if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="none">
|
||||
<group delimiter=". ">
|
||||
<names variable="editor translator" delimiter=". ">
|
||||
<label form="verb" text-case="capitalize-first" suffix=" "/>
|
||||
|
@ -57,7 +63,7 @@
|
|||
</macro>
|
||||
<macro name="container-contributors">
|
||||
<choose>
|
||||
<if type="chapter paper-conference" match="any">
|
||||
<if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
|
||||
<group prefix=", " delimiter=", ">
|
||||
<names variable="container-author" delimiter=", ">
|
||||
<label form="verb" suffix=" "/>
|
||||
|
@ -250,7 +256,7 @@
|
|||
</else>
|
||||
</choose>
|
||||
</if>
|
||||
<else-if type="chapter paper-conference" match="any">
|
||||
<else-if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
|
||||
<choose>
|
||||
<if is-numeric="edition">
|
||||
<group delimiter=" " prefix=", ">
|
||||
|
@ -317,7 +323,7 @@
|
|||
</group>
|
||||
</group>
|
||||
</else-if>
|
||||
<else-if type="chapter paper-conference" match="any">
|
||||
<else-if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
|
||||
<choose>
|
||||
<if variable="page" match="none">
|
||||
<group prefix=". ">
|
||||
|
@ -331,7 +337,7 @@
|
|||
</macro>
|
||||
<macro name="locators-chapter">
|
||||
<choose>
|
||||
<if type="chapter paper-conference" match="any">
|
||||
<if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
|
||||
<choose>
|
||||
<if variable="page">
|
||||
<group prefix=", ">
|
||||
|
@ -360,7 +366,7 @@
|
|||
<else-if type="article-journal">
|
||||
<choose>
|
||||
<if variable="volume issue" match="any">
|
||||
<text variable="page" prefix=":"/>
|
||||
<text variable="page" prefix=": "/>
|
||||
</if>
|
||||
<else>
|
||||
<text variable="page" prefix=", "/>
|
||||
|
@ -407,7 +413,7 @@
|
|||
</macro>
|
||||
<macro name="container-title">
|
||||
<choose>
|
||||
<if type="chapter paper-conference" match="any">
|
||||
<if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
|
||||
<text macro="container-prefix" suffix=" "/>
|
||||
</if>
|
||||
</choose>
|
||||
|
@ -416,14 +422,14 @@
|
|||
<text variable="container-title" text-case="title"/>
|
||||
</if>
|
||||
<else-if type="legal_case" match="none">
|
||||
<group delimiter=" ">
|
||||
<text variable="container-title" text-case="title" font-style="italic"/>
|
||||
<choose>
|
||||
<if type="post-weblog">
|
||||
<text value="(blog)"/>
|
||||
</if>
|
||||
</choose>
|
||||
</group>
|
||||
<group delimiter=" ">
|
||||
<text variable="container-title" text-case="title" font-style="italic"/>
|
||||
<choose>
|
||||
<if type="post-weblog">
|
||||
<text value="(blog)"/>
|
||||
</if>
|
||||
</choose>
|
||||
</group>
|
||||
</else-if>
|
||||
</choose>
|
||||
</macro>
|
||||
|
@ -506,14 +512,21 @@
|
|||
</choose>
|
||||
</macro>
|
||||
<macro name="event">
|
||||
<group>
|
||||
<text term="presented at" suffix=" "/>
|
||||
<group delimiter=" ">
|
||||
<choose>
|
||||
<if variable="genre">
|
||||
<text term="presented at"/>
|
||||
</if>
|
||||
<else>
|
||||
<text term="presented at" text-case="capitalize-first"/>
|
||||
</else>
|
||||
</choose>
|
||||
<text variable="event"/>
|
||||
</group>
|
||||
</macro>
|
||||
<macro name="description">
|
||||
<choose>
|
||||
<if type="interview">
|
||||
<if variable="interviewer" type="interview" match="any">
|
||||
<group delimiter=". ">
|
||||
<text macro="interviewer"/>
|
||||
<text variable="medium" text-case="capitalize-first"/>
|
||||
|
@ -581,6 +594,7 @@
|
|||
</group>
|
||||
</group>
|
||||
</else-if>
|
||||
<else-if type="article-journal" match="any"/>
|
||||
<else>
|
||||
<group prefix=". " delimiter=", ">
|
||||
<choose>
|
||||
|
@ -593,7 +607,7 @@
|
|||
</else>
|
||||
</choose>
|
||||
</macro>
|
||||
<citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" givenname-disambiguation-rule="primary-name" collapse="year">
|
||||
<citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" givenname-disambiguation-rule="primary-name" collapse="year" after-collapse-delimiter="; ">
|
||||
<layout prefix="(" suffix=")" delimiter="; ">
|
||||
<group delimiter=", ">
|
||||
<choose>
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<locale xmlns="http://purl.org/net/xbiblio/csl" version="1.0" xml:lang="en-US">
|
||||
<info>
|
||||
<translator>
|
||||
<name>Andrew Dunning</name>
|
||||
</translator>
|
||||
<translator>
|
||||
<name>Sebastian Karcher</name>
|
||||
</translator>
|
||||
<translator>
|
||||
<name>Rintze M. Zelle</name>
|
||||
</translator>
|
||||
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
|
||||
<updated>2015-10-10T23:31:02+00:00</updated>
|
||||
</info>
|
||||
|
|
|
@ -290,7 +290,7 @@ Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE."
|
|||
(orgtbl-to-generic
|
||||
table
|
||||
(org-combine-plists
|
||||
'(:sep "\t" :fmt org-babel-gnuplot-quote-tsv-field)
|
||||
'(:sep "\t" :fmt org-babel-gnuplot-quote-tsv-field :raw t :backend ascii)
|
||||
params)))))
|
||||
data-file)
|
||||
|
||||
|
|
|
@ -96,27 +96,29 @@ like javac -verbose."
|
|||
(group (1+ (in alnum ?_))) ; capture the class name
|
||||
(0+ space) ?{)
|
||||
"Regexp for the class declaration.")
|
||||
(defconst org-babel-java--main-re (rx line-start (0+ space) "public"
|
||||
(1+ space) "static"
|
||||
(1+ space) "void"
|
||||
(1+ space) "main"
|
||||
(0+ space) ?\(
|
||||
(0+ space) "String"
|
||||
(0+ space) (1+ (in alnum ?_ ?\[ ?\] space)) ; "[] args" or "args[]"
|
||||
(0+ space) ?\)
|
||||
(0+ space) (opt "throws" (1+ (in alnum ?_ ?, ?. space)))
|
||||
?{)
|
||||
(defconst org-babel-java--main-re
|
||||
(rx line-start (0+ space) "public"
|
||||
(1+ space) "static"
|
||||
(1+ space) "void"
|
||||
(1+ space) "main"
|
||||
(0+ space) ?\(
|
||||
(0+ space) "String"
|
||||
(1+ (in alnum ?_ ?\[ ?\] space)) ; "[] args" or "args[]"
|
||||
?\)
|
||||
(0+ space) (opt "throws" (1+ (in alnum ?_ ?, ?. space)))
|
||||
?{)
|
||||
"Regexp for the main method declaration.")
|
||||
(defconst org-babel-java--any-method-re (rx line-start
|
||||
(0+ space) (opt (seq (1+ alnum) (1+ space))) ; visibility
|
||||
(opt (seq "static" (1+ space))) ; binding
|
||||
(1+ (in alnum ?_ ?\[ ?\])) ; return type
|
||||
(1+ space) (1+ (in alnum ?_)) ; method name
|
||||
(0+ space) ?\(
|
||||
(0+ space) (0+ (in alnum ?_ ?\[ ?\] ?, space)) ; params
|
||||
(0+ space) ?\)
|
||||
(0+ space) (opt "throws" (1+ (in alnum ?_ ?, ?. space)))
|
||||
?{)
|
||||
(defconst org-babel-java--any-method-re
|
||||
(rx line-start
|
||||
(0+ space) (opt (seq (1+ alnum) (1+ space))) ; visibility
|
||||
(opt (seq "static" (1+ space))) ; binding
|
||||
(1+ (in alnum ?_ ?\[ ?\])) ; return type
|
||||
(1+ space) (1+ (in alnum ?_)) ; method name
|
||||
(0+ space) ?\(
|
||||
(0+ (in alnum ?_ ?\[ ?\] ?, space)) ; params
|
||||
?\)
|
||||
(0+ space) (opt "throws" (1+ (in alnum ?_ ?, ?. space)))
|
||||
?{)
|
||||
"Regexp for any method.")
|
||||
(defconst org-babel-java--result-wrapper "\n public static String __toString(Object val) {
|
||||
if (val instanceof String) {
|
||||
|
@ -192,7 +194,7 @@ replaced in this string.")
|
|||
;; the dir to write the source file
|
||||
(packagedir (if (and (not run-from-temp) packagename)
|
||||
(file-name-as-directory
|
||||
(concat basedir (replace-regexp-in-string "\\\." "/" packagename)))
|
||||
(concat basedir (replace-regexp-in-string "\\." "/" packagename)))
|
||||
basedir))
|
||||
;; the filename of the source file
|
||||
(src-file (concat packagedir classname ".java"))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; ob-julia.el --- org-babel functions for julia code evaluation
|
||||
;;; ob-julia.el --- org-babel functions for julia code evaluation -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
|
||||
;; Authors: G. Jay Kerns, based on ob-R.el by Eric Schulte and Dan Davison
|
||||
|
@ -6,20 +6,20 @@
|
|||
;; Keywords: literate programming, reproducible research, scientific computing
|
||||
;; Homepage: https://github.com/phrb/ob-julia
|
||||
|
||||
;; This file is not part of GNU Emacs.
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
|||
(raw org html latex code pp wrap)
|
||||
(replace silent append prepend)
|
||||
(output value graphics))))
|
||||
"julia-specific header arguments.")
|
||||
"Julia-specific header arguments.")
|
||||
|
||||
(add-to-list 'org-babel-tangle-lang-exts '("julia" . "jl"))
|
||||
|
||||
|
@ -58,7 +58,8 @@
|
|||
:type 'string)
|
||||
|
||||
(defvar ess-current-process-name) ; dynamically scoped
|
||||
(defvar ess-local-process-name) ; dynamically scoped
|
||||
(defvar ess-local-process-name) ; dynamically scoped
|
||||
(defvar ess-eval-visibly-p) ; dynamically scoped
|
||||
(defun org-babel-edit-prep:julia (info)
|
||||
(let ((session (cdr (assq :session (nth 2 info)))))
|
||||
(when (and session
|
||||
|
@ -68,7 +69,7 @@
|
|||
|
||||
(defun org-babel-expand-body:julia (body params &optional _graphics-file)
|
||||
"Expand BODY according to PARAMS, return the expanded body."
|
||||
(mapconcat 'identity
|
||||
(mapconcat #'identity
|
||||
(append
|
||||
(when (cdr (assq :prologue params))
|
||||
(list (cdr (assq :prologue params))))
|
||||
|
@ -89,17 +90,13 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(graphics-file (and (member "graphics" (assq :result-params params))
|
||||
(org-babel-graphical-output-file params)))
|
||||
(colnames-p (unless graphics-file (cdr (assq :colnames params))))
|
||||
(rownames-p (unless graphics-file (cdr (assq :rownames params))))
|
||||
(full-body (org-babel-expand-body:julia body params graphics-file))
|
||||
(result
|
||||
(org-babel-julia-evaluate
|
||||
session full-body result-type result-params
|
||||
(or (equal "yes" colnames-p)
|
||||
(org-babel-pick-name
|
||||
(cdr (assq :colname-names params)) colnames-p))
|
||||
(or (equal "yes" rownames-p)
|
||||
(org-babel-pick-name
|
||||
(cdr (assq :rowname-names params)) rownames-p)))))
|
||||
(cdr (assq :colname-names params)) colnames-p)))))
|
||||
(if graphics-file nil result))))
|
||||
|
||||
(defun org-babel-normalize-newline (result)
|
||||
|
@ -133,11 +130,7 @@ This function is called by `org-babel-execute-src-block'."
|
|||
"Return list of julia statements assigning the block's variables."
|
||||
(let ((vars (org-babel--get-vars params)))
|
||||
(mapcar
|
||||
(lambda (pair)
|
||||
(org-babel-julia-assign-elisp
|
||||
(car pair) (cdr pair)
|
||||
(equal "yes" (cdr (assq :colnames params)))
|
||||
(equal "yes" (cdr (assq :rownames params)))))
|
||||
(lambda (pair) (org-babel-julia-assign-elisp (car pair) (cdr pair)))
|
||||
(mapcar
|
||||
(lambda (i)
|
||||
(cons (car (nth i vars))
|
||||
|
@ -150,21 +143,18 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(defun org-babel-julia-quote-csv-field (s)
|
||||
"Quote field S for export to julia."
|
||||
(if (stringp s)
|
||||
(concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\"")
|
||||
(concat "\"" (mapconcat #'identity (split-string s "\"") "\"\"") "\"")
|
||||
(format "%S" s)))
|
||||
|
||||
(defun org-babel-julia-assign-elisp (name value colnames-p rownames-p)
|
||||
(defun org-babel-julia-assign-elisp (name value)
|
||||
"Construct julia code assigning the elisp VALUE to a variable named NAME."
|
||||
(if (listp value)
|
||||
(let* ((lengths (mapcar 'length (cl-remove-if-not 'sequencep value)))
|
||||
(max (if lengths (apply 'max lengths) 0))
|
||||
(min (if lengths (apply 'min lengths) 0)))
|
||||
(let* ((lengths (mapcar #'length (cl-remove-if-not #'sequencep value)))
|
||||
(max (if lengths (apply #'max lengths) 0))
|
||||
(min (if lengths (apply #'min lengths) 0)))
|
||||
;; Ensure VALUE has an orgtbl structure (depth of at least 2).
|
||||
(unless (listp (car value)) (setq value (list value)))
|
||||
(let ((file (orgtbl-to-csv value '(:fmt org-babel-julia-quote-csv-field)))
|
||||
(header (if (or (eq (nth 1 value) 'hline) colnames-p)
|
||||
"TRUE" "FALSE"))
|
||||
(row-names (if rownames-p "1" "NULL")))
|
||||
(let ((file (orgtbl-to-csv value '(:fmt org-babel-julia-quote-csv-field))))
|
||||
(if (= max min)
|
||||
(format "%s = begin
|
||||
using CSV
|
||||
|
@ -183,11 +173,15 @@ end"
|
|||
(unless (string= session "none")
|
||||
(let ((session (or session "*Julia*"))
|
||||
(ess-ask-for-ess-directory
|
||||
(and (boundp 'ess-ask-for-ess-directory)
|
||||
ess-ask-for-ess-directory
|
||||
(not (cdr (assq :dir params))))))
|
||||
(and (bound-and-true-p ess-ask-for-ess-directory)
|
||||
(not (cdr (assq :dir params))))))
|
||||
(if (org-babel-comint-buffer-livep session)
|
||||
session
|
||||
;; FIXME: Depending on `display-buffer-alist', (julia) may end up
|
||||
;; popping up a new frame which `save-window-excursion' won't be able
|
||||
;; to "undo", so we really should call a kind of
|
||||
;; `julia-no-select' instead so we don't need to undo any
|
||||
;; window-changes afterwards.
|
||||
(save-window-excursion
|
||||
(when (get-buffer session)
|
||||
;; Session buffer exists, but with dead process
|
||||
|
@ -201,14 +195,6 @@ end"
|
|||
(buffer-name))))
|
||||
(current-buffer))))))
|
||||
|
||||
; (defun org-babel-julia-associate-session (session)
|
||||
; "Associate julia code buffer with a julia session.
|
||||
; Make SESSION be the inferior ESS process associated with the
|
||||
; current code buffer."
|
||||
; (setq ess-local-process-name
|
||||
; (process-name (get-buffer-process session)))
|
||||
; (ess-make-buffer-current))
|
||||
|
||||
(defun org-babel-julia-graphical-output-file (params)
|
||||
"Name of file to which julia should send graphical output."
|
||||
(and (member "graphics" (cdr (assq :result-params params)))
|
||||
|
@ -251,16 +237,16 @@ end"
|
|||
end")
|
||||
|
||||
(defun org-babel-julia-evaluate
|
||||
(session body result-type result-params column-names-p row-names-p)
|
||||
(session body result-type result-params column-names-p)
|
||||
"Evaluate julia code in BODY."
|
||||
(if session
|
||||
(org-babel-julia-evaluate-session
|
||||
session body result-type result-params column-names-p row-names-p)
|
||||
session body result-type result-params column-names-p)
|
||||
(org-babel-julia-evaluate-external-process
|
||||
body result-type result-params column-names-p row-names-p)))
|
||||
body result-type result-params column-names-p)))
|
||||
|
||||
(defun org-babel-julia-evaluate-external-process
|
||||
(body result-type result-params column-names-p row-names-p)
|
||||
(body result-type result-params column-names-p)
|
||||
"Evaluate BODY in external julia process.
|
||||
If RESULT-TYPE equals 'output then return standard output as a
|
||||
string. If RESULT-TYPE equals 'value then return the value of the
|
||||
|
@ -284,7 +270,7 @@ last statement in BODY, as elisp."
|
|||
(output (org-babel-eval org-babel-julia-command body))))
|
||||
|
||||
(defun org-babel-julia-evaluate-session
|
||||
(session body result-type result-params column-names-p row-names-p)
|
||||
(session body result-type result-params column-names-p)
|
||||
"Evaluate BODY in SESSION.
|
||||
If RESULT-TYPE equals 'output then return standard output as a
|
||||
string. If RESULT-TYPE equals 'value then return the value of the
|
||||
|
@ -314,7 +300,7 @@ last statement in BODY, as elisp."
|
|||
column-names-p)))
|
||||
(output
|
||||
(mapconcat
|
||||
'org-babel-chomp
|
||||
#'org-babel-chomp
|
||||
(butlast
|
||||
(delq nil
|
||||
(mapcar
|
||||
|
@ -327,13 +313,14 @@ last statement in BODY, as elisp."
|
|||
(substring line (match-end 1))
|
||||
line))
|
||||
(org-babel-comint-with-output (session org-babel-julia-eoe-output)
|
||||
(insert (mapconcat 'org-babel-chomp
|
||||
(insert (mapconcat #'org-babel-chomp
|
||||
(list body org-babel-julia-eoe-indicator)
|
||||
"\n"))
|
||||
(inferior-ess-send-input)))))) "\n"))))
|
||||
(inferior-ess-send-input))))))
|
||||
"\n"))))
|
||||
|
||||
(defun org-babel-julia-process-value-result (result column-names-p)
|
||||
"julia-specific processing of return value.
|
||||
"Julia-specific processing of return value.
|
||||
Insert hline if column names in output have been requested."
|
||||
(if column-names-p
|
||||
(cons (car result) (cons 'hline (cdr result)))
|
||||
|
|
|
@ -4,18 +4,20 @@
|
|||
|
||||
;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -87,42 +89,42 @@
|
|||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'symbol
|
||||
:safe t)
|
||||
:safe #'symbolp)
|
||||
|
||||
(defcustom org-cite-basic-author-year-separator ", "
|
||||
"String used to separate cites in an author-year configuration."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'string
|
||||
:safe t)
|
||||
:safe #'stringp)
|
||||
|
||||
(defcustom org-cite-basic-max-key-distance 2
|
||||
"Maximum (Levenshtein) distance between a wrong key and its suggestions."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'integer
|
||||
:safe t)
|
||||
:safe #'integerp)
|
||||
|
||||
(defcustom org-cite-basic-author-column-end 25
|
||||
"Column where author field ends in completion table, as an integer."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'integer
|
||||
:safe t)
|
||||
:safe #'integerp)
|
||||
|
||||
(defcustom org-cite-basic-column-separator " "
|
||||
"Column separator in completion table, as a string."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'string
|
||||
:safe t)
|
||||
:safe #'stringp)
|
||||
|
||||
(defcustom org-cite-basic-mouse-over-key-face 'highlight
|
||||
"Face used when mouse is over a citation key."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'face
|
||||
:safe t)
|
||||
:safe #'facep)
|
||||
|
||||
|
||||
;;; Internal variables
|
||||
|
|
|
@ -4,18 +4,20 @@
|
|||
|
||||
;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -78,7 +80,7 @@ If \"biblatex\" package is already required in the document, e.g., through
|
|||
:type '(choice
|
||||
(string :tag "Options (key=value,key2=value2...)")
|
||||
(const :tag "No option" nil))
|
||||
:safe t)
|
||||
:safe #'string-or-null-p)
|
||||
|
||||
|
||||
;;; Internal functions
|
||||
|
|
|
@ -4,18 +4,20 @@
|
|||
|
||||
;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -123,9 +125,11 @@ If nil then only the fallback en-US locale will be available."
|
|||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type '(choice
|
||||
(dir :tag "Locales directory")
|
||||
(directory :tag "Locales directory")
|
||||
(const :tag "Use en-US locale only" nil))
|
||||
:safe t)
|
||||
;; It's not obvious to me that arbitrary locations are safe.
|
||||
;;; :safe #'string-or-null-p
|
||||
)
|
||||
|
||||
(defcustom org-cite-csl-styles-dir nil
|
||||
"Directory of CSL style files.
|
||||
|
@ -134,9 +138,11 @@ directory. This variable is ignored when style file is absolute."
|
|||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type '(choice
|
||||
(dir :tag "Styles directory")
|
||||
(directory :tag "Styles directory")
|
||||
(const :tag "Use absolute file names" nil))
|
||||
:safe t)
|
||||
;; It's not obvious to me that arbitrary locations are safe.
|
||||
;;; :safe #'string-or-null-p
|
||||
)
|
||||
|
||||
;;;; Citelinks
|
||||
(defcustom org-cite-csl-link-cites t
|
||||
|
@ -144,7 +150,7 @@ directory. This variable is ignored when style file is absolute."
|
|||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'boolean
|
||||
:safe t)
|
||||
:safe #'booleanp)
|
||||
|
||||
(defcustom org-cite-csl-no-citelinks-backends '(ascii)
|
||||
"List of export back-ends for which cite linking is disabled.
|
||||
|
@ -152,8 +158,7 @@ Cite linking for export back-ends derived from any of the back-ends listed here,
|
|||
is also disabled."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type '(repeat symbol)
|
||||
:safe t)
|
||||
:type '(repeat symbol))
|
||||
|
||||
;;;; Output-specific variables
|
||||
(defcustom org-cite-csl-html-hanging-indent "1.5em"
|
||||
|
@ -161,7 +166,7 @@ is also disabled."
|
|||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'string
|
||||
:safe t)
|
||||
:safe #'stringp)
|
||||
|
||||
(defcustom org-cite-csl-html-label-width-per-char "0.6em"
|
||||
"Character width in CSS units for calculating entry label widths.
|
||||
|
@ -169,27 +174,33 @@ Used only when `second-field-align' is activated by the used CSL style."
|
|||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'string
|
||||
:safe t)
|
||||
:safe #'stringp)
|
||||
|
||||
(defcustom org-cite-csl-latex-hanging-indent "1.5em"
|
||||
"Size of hanging-indent for LaTeX output in valid LaTeX units."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'string
|
||||
:safe t)
|
||||
:safe #'stringp)
|
||||
|
||||
|
||||
;;; Internal variables
|
||||
(defconst org-cite-csl--etc-dir
|
||||
(let* ((oc-root (file-name-directory (locate-library "oc")))
|
||||
(oc-etc-dir-1 (expand-file-name "../etc/csl/" oc-root)))
|
||||
;; package.el and straight will put all of org-mode/lisp/ in org-mode/.
|
||||
;; This will cause .. to resolve to the directory above Org.
|
||||
;; To make life easier for people using package.el or straight, we can
|
||||
;; check to see if ../etc/csl exists, and if it doesn't try ./etc/csl.
|
||||
(if (file-exists-p oc-etc-dir-1) oc-etc-dir-1
|
||||
(expand-file-name "etc/csl/" oc-root)))
|
||||
"Directory \"etc/\" from repository.")
|
||||
(let ((oc-root (file-name-directory (locate-library "oc"))))
|
||||
(cond
|
||||
;; First check whether it looks like we're running from the main
|
||||
;; Org repository.
|
||||
((let ((csl-org (expand-file-name "../etc/csl/" oc-root)))
|
||||
(and (file-directory-p csl-org) csl-org)))
|
||||
;; Next look for the directory alongside oc.el because package.el
|
||||
;; and straight will put all of org-mode/lisp/ in org-mode/.
|
||||
((let ((csl-pkg (expand-file-name "etc/csl/" oc-root)))
|
||||
(and (file-directory-p csl-pkg) csl-pkg)))
|
||||
;; Finally fall back the location used by shared system installs
|
||||
;; and when running directly from Emacs repository.
|
||||
(t
|
||||
(expand-file-name "org/csl/" data-directory))))
|
||||
"Directory containing CSL-related data files.")
|
||||
|
||||
(defconst org-cite-csl--fallback-locales-dir org-cite-csl--etc-dir
|
||||
"Fallback CSL locale files directory.")
|
||||
|
|
|
@ -4,18 +4,20 @@
|
|||
|
||||
;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -69,8 +71,7 @@ If \"natbib\" package is already required in the document, e.g., through
|
|||
(const :tag "order as above, but numerical citations are compressed if possible" sort&compress)
|
||||
(const :tag "display full author list on first citation, abbreviate the others" longnamesfirst)
|
||||
(const :tag "redefine \\thebibliography to issue \\section* instead of \\chapter*" sectionbib)
|
||||
(const :tag "keep all the authors' names in a citation on one line" nonamebreak))
|
||||
:safe t)
|
||||
(const :tag "keep all the authors' names in a citation on one line" nonamebreak)))
|
||||
|
||||
|
||||
;;; Internal functions
|
||||
|
|
31
lisp/oc.el
31
lisp/oc.el
|
@ -4,18 +4,20 @@
|
|||
|
||||
;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -125,16 +127,14 @@ File names must be absolute."
|
|||
:package-version '(Org . "9.5")
|
||||
:type '(choice (const :tag "No global bibliography" nil)
|
||||
(repeat :tag "List of bibliography files"
|
||||
(file :tag "Bibliography")))
|
||||
:safe t)
|
||||
(file :tag "Bibliography"))))
|
||||
|
||||
(defcustom org-cite-activate-processor 'basic
|
||||
"Processor used for activating citations, as a symbol."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type '(choice (const :tag "Default fontification" nil)
|
||||
(symbol :tag "Citation processor"))
|
||||
:safe nil)
|
||||
(symbol :tag "Citation processor")))
|
||||
|
||||
(defcustom org-cite-export-processors '((t basic))
|
||||
"Processor used for exporting citations, as a triplet, or nil.
|
||||
|
@ -198,24 +198,21 @@ back-end."
|
|||
(string :tag "Use specific bibliography style"))
|
||||
(choice
|
||||
(const :tag "Default citation style" nil)
|
||||
(string :tag "Use specific citation style")))))
|
||||
:safe nil)
|
||||
(string :tag "Use specific citation style"))))))
|
||||
|
||||
(defcustom org-cite-follow-processor 'basic
|
||||
"Processor used for following citations, as a symbol."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type '(choice (const :tag "No following" nil)
|
||||
(symbol :tag "Citation processor"))
|
||||
:safe nil)
|
||||
(symbol :tag "Citation processor")))
|
||||
|
||||
(defcustom org-cite-insert-processor 'basic
|
||||
"Processor used for inserting citations, as a symbol."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type '(choice (const :tag "No insertion" nil)
|
||||
(symbol :tag "Citation processor"))
|
||||
:safe nil)
|
||||
(symbol :tag "Citation processor")))
|
||||
|
||||
(defcustom org-cite-adjust-note-numbers t
|
||||
"When non-nil, allow process to modify location of note numbers.
|
||||
|
@ -232,7 +229,7 @@ When nil, the note number is not moved."
|
|||
:package-version '(Org . "9.5")
|
||||
:type '(choice (const :tag "Automatic note number location" t)
|
||||
(const :tag "Place note numbers manually" nil))
|
||||
:safe t)
|
||||
:safe #'booleanp)
|
||||
|
||||
(defcustom org-cite-note-rules
|
||||
'(("en-us" inside outside after)
|
||||
|
@ -297,8 +294,7 @@ This roughly follows the Oxford Guide to Style recommendations."
|
|||
(const :tag "Citation next to punctuation" same))
|
||||
(choice :tag "Order of citation and punctuation"
|
||||
(const :tag "Citation first" before)
|
||||
(const :tag "Citation last" after))))
|
||||
:safe t)
|
||||
(const :tag "Citation last" after)))))
|
||||
|
||||
(defcustom org-cite-punctuation-marks '("." "," ";" ":" "!" "?")
|
||||
"List of strings that can be moved around when placing note numbers.
|
||||
|
@ -308,8 +304,7 @@ allowed to shuffle punctuation marks specified in this list in order to
|
|||
place note numbers according to rules defined in `org-cite-note-rules'."
|
||||
:group 'org-cite
|
||||
:package-version '(Org . "9.5")
|
||||
:type '(repeat string)
|
||||
:safe t)
|
||||
:type '(repeat string))
|
||||
|
||||
|
||||
;;; Citation processors
|
||||
|
|
|
@ -1,21 +1,23 @@
|
|||
;;; ol-doi.el --- DOI links support in Org -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
|
18
lisp/ol.el
18
lisp/ol.el
|
@ -178,8 +178,7 @@ link.
|
|||
:group 'org-link
|
||||
:package-version '(Org . "9.1")
|
||||
:type '(alist :tag "Link display parameters"
|
||||
:value-type plist)
|
||||
:safe nil)
|
||||
:value-type plist))
|
||||
|
||||
(defcustom org-link-descriptive t
|
||||
"Non-nil means Org displays descriptive links.
|
||||
|
@ -335,8 +334,7 @@ another window."
|
|||
(cons (const wl)
|
||||
(choice
|
||||
(const wl)
|
||||
(const wl-other-frame))))
|
||||
:safe nil)
|
||||
(const wl-other-frame)))))
|
||||
|
||||
(defcustom org-link-search-must-match-exact-headline 'query-to-create
|
||||
"Non-nil means internal fuzzy links can only match headlines.
|
||||
|
@ -385,15 +383,13 @@ single keystroke rather than having to type \"yes\"."
|
|||
:type '(choice
|
||||
(const :tag "with yes-or-no (safer)" yes-or-no-p)
|
||||
(const :tag "with y-or-n (faster)" y-or-n-p)
|
||||
(const :tag "no confirmation (dangerous)" nil))
|
||||
:safe nil)
|
||||
(const :tag "no confirmation (dangerous)" nil)))
|
||||
|
||||
(defcustom org-link-shell-skip-confirm-regexp ""
|
||||
"Regexp to skip confirmation for shell links."
|
||||
:group 'org-link-follow
|
||||
:version "24.1"
|
||||
:type 'regexp
|
||||
:safe nil)
|
||||
:type 'regexp)
|
||||
|
||||
(defcustom org-link-elisp-confirm-function 'yes-or-no-p
|
||||
"Non-nil means ask for confirmation before executing Emacs Lisp links.
|
||||
|
@ -410,15 +406,13 @@ single keystroke rather than having to type \"yes\"."
|
|||
:type '(choice
|
||||
(const :tag "with yes-or-no (safer)" yes-or-no-p)
|
||||
(const :tag "with y-or-n (faster)" y-or-n-p)
|
||||
(const :tag "no confirmation (dangerous)" nil))
|
||||
:safe nil)
|
||||
(const :tag "no confirmation (dangerous)" nil)))
|
||||
|
||||
(defcustom org-link-elisp-skip-confirm-regexp ""
|
||||
"A regexp to skip confirmation for Elisp links."
|
||||
:group 'org-link-follow
|
||||
:version "24.1"
|
||||
:type 'regexp
|
||||
:safe nil)
|
||||
:type 'regexp)
|
||||
|
||||
(defgroup org-link-store nil
|
||||
"Options concerning storing links in Org mode."
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
;; to current setup.
|
||||
|
||||
(defconst org-element-citation-key-re
|
||||
(rx "@" (group (one-or-more (any word "-.:?!`'/*@+|(){}<>&_^$#%&~"))))
|
||||
(rx "@" (group (one-or-more (any word "-.:?!`'/*@+|(){}<>&_^$#%~"))))
|
||||
"Regexp matching a citation key.
|
||||
Key is located in match group 1.")
|
||||
|
||||
|
@ -1024,7 +1024,7 @@ Assume point is at beginning of the headline."
|
|||
(title-start (prog1 (point)
|
||||
(unless (or todo priority commentedp)
|
||||
;; Headline like "* :tag:"
|
||||
(skip-syntax-backward " \t"))))
|
||||
(skip-chars-backward " \t"))))
|
||||
(tags (when (re-search-forward
|
||||
"[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"
|
||||
(line-end-position)
|
||||
|
|
|
@ -279,8 +279,7 @@ before org.el is loaded."
|
|||
:type '(choice
|
||||
(const :tag "A double click follows the link" double)
|
||||
(const :tag "Unconditionally follow the link with mouse-1" t)
|
||||
(integer :tag "mouse-1 click does not follow the link if longer than N ms" 450))
|
||||
:safe t)
|
||||
(integer :tag "mouse-1 click does not follow the link if longer than N ms" 450)))
|
||||
|
||||
(defcustom org-tab-follows-link nil
|
||||
"Non-nil means on links TAB will follow the link.
|
||||
|
@ -300,7 +299,7 @@ implementation is bad."
|
|||
In tables, the special behavior of RET has precedence."
|
||||
:group 'org-link-follow
|
||||
:type 'boolean
|
||||
:safe t)
|
||||
:safe #'booleanp)
|
||||
|
||||
|
||||
;;; Functions
|
||||
|
|
|
@ -326,17 +326,19 @@ it for output."
|
|||
|
||||
;;; Indentation
|
||||
|
||||
(defun org-do-remove-indentation (&optional n)
|
||||
(defun org-do-remove-indentation (&optional n skip-fl)
|
||||
"Remove the maximum common indentation from the buffer.
|
||||
When optional argument N is a positive integer, remove exactly
|
||||
that much characters from indentation, if possible. Return nil
|
||||
if it fails."
|
||||
that much characters from indentation, if possible. When
|
||||
optional argument SKIP-FL is non-nil, skip the first
|
||||
line. Return nil if it fails."
|
||||
(catch :exit
|
||||
(goto-char (point-min))
|
||||
;; Find maximum common indentation, if not specified.
|
||||
(let ((n (or n
|
||||
(let ((min-ind (point-max)))
|
||||
(save-excursion
|
||||
(when skip-fl (forward-line))
|
||||
(while (re-search-forward "^[ \t]*\\S-" nil t)
|
||||
(let ((ind (current-indentation)))
|
||||
(if (zerop ind) (throw :exit nil)
|
||||
|
@ -344,6 +346,7 @@ if it fails."
|
|||
min-ind))))
|
||||
(if (zerop n) (throw :exit nil)
|
||||
;; Remove exactly N indentation, but give up if not possible.
|
||||
(when skip-fl (forward-line))
|
||||
(while (not (eobp))
|
||||
(let ((ind (progn (skip-chars-forward " \t") (current-column))))
|
||||
(cond ((eolp) (delete-region (line-beginning-position) (point)))
|
||||
|
|
|
@ -99,8 +99,7 @@ Any `face' text property on the returned string overrides
|
|||
`org-num-face'."
|
||||
:group 'org-appearance
|
||||
:package-version '(Org . "9.3")
|
||||
:type 'function
|
||||
:safe nil)
|
||||
:type 'function)
|
||||
|
||||
(defcustom org-num-max-level nil
|
||||
"Level below which headlines are not numbered.
|
||||
|
|
|
@ -392,7 +392,7 @@ be set.
|
|||
Accepts string, nil, or lambda function which returns string
|
||||
or nil. Defaults to nil."
|
||||
:group 'org-plot
|
||||
:type '(alist :value-type (symbol group)))
|
||||
:type 'alist)
|
||||
|
||||
(defvar org--plot/radar-template
|
||||
"### spider plot/chart with gnuplot
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
(require 'org-keys)
|
||||
|
||||
(declare-function org-mode "org" ())
|
||||
(declare-function org--get-expected-indentation "org" (element contentsp))
|
||||
(declare-function org-element-at-point "org-element" ())
|
||||
(declare-function org-element-class "org-element" (datum &optional parent))
|
||||
(declare-function org-element-context "org-element" (&optional element))
|
||||
|
@ -327,7 +328,8 @@ a cons cell (LINE . COLUMN) or symbol `end'. See also
|
|||
(if (>= pos end) 'end
|
||||
(org-with-wide-buffer
|
||||
(goto-char (max beg pos))
|
||||
(cons (count-lines beg (line-beginning-position))
|
||||
(cons (count-lines (save-excursion (goto-char beg) (line-beginning-position))
|
||||
(line-beginning-position))
|
||||
;; Column is relative to the end of line to avoid problems of
|
||||
;; comma escaping or colons appended in front of the line.
|
||||
(- (point) (min end (line-end-position)))))))
|
||||
|
@ -445,6 +447,7 @@ Assume point is in the corresponding edit buffer."
|
|||
org-src--content-indentation
|
||||
0))))
|
||||
(use-tabs? (and (> org-src--tab-width 0) t))
|
||||
(preserve-fl (eq org-src--source-type 'latex-fragment))
|
||||
(source-tab-width org-src--tab-width)
|
||||
(contents (org-with-wide-buffer
|
||||
(let ((eol (line-end-position)))
|
||||
|
@ -466,7 +469,8 @@ Assume point is in the corresponding edit buffer."
|
|||
;; Add INDENTATION-OFFSET to every line in buffer,
|
||||
;; unless indentation is meant to be preserved.
|
||||
(when (> indentation-offset 0)
|
||||
(while (not (eobp))
|
||||
(when preserve-fl (forward-line))
|
||||
(while (not (eobp))
|
||||
(skip-chars-forward " \t")
|
||||
(when (or (not (eolp)) ; not a blank line
|
||||
(and (eq (point) (marker-position marker)) ; current line
|
||||
|
@ -518,7 +522,13 @@ Leave point in edit buffer."
|
|||
(source-tab-width (if indent-tabs-mode tab-width 0))
|
||||
(type (org-element-type datum))
|
||||
(block-ind (org-with-point-at (org-element-property :begin datum)
|
||||
(current-indentation)))
|
||||
(cond
|
||||
((save-excursion (skip-chars-backward " \t") (bolp))
|
||||
(current-indentation))
|
||||
((org-element-property :parent datum)
|
||||
(org--get-expected-indentation
|
||||
(org-element-property :parent datum) nil))
|
||||
(t (current-indentation)))))
|
||||
(content-ind org-edit-src-content-indentation)
|
||||
(blank-line (save-excursion (beginning-of-line)
|
||||
(looking-at-p "^[[:space:]]*$")))
|
||||
|
@ -548,7 +558,8 @@ Leave point in edit buffer."
|
|||
(insert contents)
|
||||
(remove-text-properties (point-min) (point-max)
|
||||
'(display nil invisible nil intangible nil))
|
||||
(unless preserve-ind (org-do-remove-indentation))
|
||||
(let ((lf (eq type 'latex-fragment)))
|
||||
(unless preserve-ind (org-do-remove-indentation (and lf block-ind) lf)))
|
||||
(set-buffer-modified-p nil)
|
||||
(setq buffer-file-name nil)
|
||||
;; Initialize buffer.
|
||||
|
|
|
@ -3630,7 +3630,7 @@ When this is non-nil, the headline after the keyword is set to the
|
|||
:group 'org-appearance
|
||||
:package-version '(Org . "9.4")
|
||||
:type 'boolean
|
||||
:safe t)
|
||||
:safe #'booleanp)
|
||||
|
||||
(defcustom org-fontify-done-headline t
|
||||
"Non-nil means change the face of a headline if it is marked DONE.
|
||||
|
@ -5113,6 +5113,7 @@ stacked delimiters is N. Escaping delimiters is not possible."
|
|||
'(invisible t))
|
||||
(add-text-properties (match-beginning 3) (match-end 3)
|
||||
'(invisible t)))
|
||||
(goto-char (match-end 0))
|
||||
(throw :exit t))))))))
|
||||
|
||||
(defun org-emphasize (&optional char)
|
||||
|
|
|
@ -795,7 +795,7 @@ Most common values are:
|
|||
:group 'org-export-html
|
||||
:package-version '(Org . "9.4")
|
||||
:type 'string
|
||||
:safe t)
|
||||
:safe #'stringp)
|
||||
|
||||
(defcustom org-html-with-latex org-export-with-latex
|
||||
"Non-nil means process LaTeX math snippets.
|
||||
|
@ -903,7 +903,7 @@ numbers are enabled."
|
|||
:group 'org-export-html
|
||||
:package-version '(Org . "9.3")
|
||||
:type 'boolean
|
||||
:safe t)
|
||||
:safe #'booleanp)
|
||||
|
||||
;;;; Table
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; ox-koma-letter.el --- KOMA Scrlttr2 Back-End for Org Export Engine
|
||||
;;; ox-koma-letter.el --- KOMA Scrlttr2 Back-End for Org Export Engine -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -11,12 +11,12 @@
|
|||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
@ -184,7 +184,6 @@
|
|||
(defcustom org-koma-letter-class-option-file "NF"
|
||||
"Letter Class Option File.
|
||||
This option can also be set with the LCO keyword."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-koma-letter-author 'user-full-name
|
||||
|
@ -196,7 +195,6 @@ Alternatively a string, nil or a function may be given.
|
|||
Functions must return a string.
|
||||
|
||||
This option can also be set with the AUTHOR keyword."
|
||||
:group 'org-export-koma-letter
|
||||
:type '(radio (function-item user-full-name)
|
||||
(string)
|
||||
(function)
|
||||
|
@ -210,7 +208,6 @@ returns `user-mail-address'. Alternatively a string, nil or
|
|||
a function may be given. Functions must return a string.
|
||||
|
||||
This option can also be set with the EMAIL keyword."
|
||||
:group 'org-export-koma-letter
|
||||
:type '(radio (function-item org-koma-letter-email)
|
||||
(string)
|
||||
(function)
|
||||
|
@ -220,33 +217,28 @@ This option can also be set with the EMAIL keyword."
|
|||
"Sender's address, as a string.
|
||||
This option can also be set with one or more FROM_ADDRESS
|
||||
keywords."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-koma-letter-phone-number ""
|
||||
"Sender's phone number, as a string.
|
||||
This option can also be set with the PHONE_NUMBER keyword."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-koma-letter-url ""
|
||||
"Sender's URL, e. g., the URL of her homepage.
|
||||
This option can also be set with the URL keyword."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string
|
||||
:safe #'stringp)
|
||||
|
||||
(defcustom org-koma-letter-from-logo ""
|
||||
"Commands for inserting the sender's logo, e. g., \\includegraphics{logo}.
|
||||
This option can also be set with the FROM_LOGO keyword."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string
|
||||
:safe #'stringp)
|
||||
|
||||
(defcustom org-koma-letter-place ""
|
||||
"Place from which the letter is sent, as a string.
|
||||
This option can also be set with the PLACE keyword."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-koma-letter-location ""
|
||||
|
@ -264,7 +256,6 @@ special heading.
|
|||
|
||||
The location field is typically printed right of the address
|
||||
field (See Figure 4.9. in the English manual of 2015-10-03)."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-koma-letter-opening ""
|
||||
|
@ -278,7 +269,6 @@ when:
|
|||
(3) the letter contains a headline without a special
|
||||
tag (e.g. \"to\" or \"ps\");
|
||||
then the opening will be implicitly set as the untagged headline title."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-koma-letter-closing ""
|
||||
|
@ -292,7 +282,6 @@ when:
|
|||
tag \"closing\";
|
||||
then the opening will be set as the title of the closing special
|
||||
heading title."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-koma-letter-signature ""
|
||||
|
@ -308,14 +297,12 @@ then the signature will be set as the content of the
|
|||
closing special heading.
|
||||
|
||||
Note if the content is empty the signature will not be set."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-koma-letter-prefer-special-headings nil
|
||||
"Non-nil means prefer headlines over keywords for TO and FROM.
|
||||
This option can also be set with the OPTIONS keyword, e.g.:
|
||||
\"special-headings:t\"."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-koma-letter-subject-format t
|
||||
|
@ -353,14 +340,12 @@ This option can also be set with the OPTIONS keyword, e.g.:
|
|||
(const :tag "Subject right-justified" right)
|
||||
(const :tag "Add title or description to subject" underlined)
|
||||
(const :tag "Set subject underlined" titled)
|
||||
(const :tag "Do not add title or description to subject" untitled)))
|
||||
:group 'org-export-koma-letter)
|
||||
(const :tag "Do not add title or description to subject" untitled))))
|
||||
|
||||
(defcustom org-koma-letter-use-backaddress nil
|
||||
"Non-nil prints return address in line above to address.
|
||||
This option can also be set with the OPTIONS keyword, e.g.:
|
||||
\"backaddress:t\"."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-koma-letter-use-foldmarks t
|
||||
|
@ -393,7 +378,6 @@ following ones:
|
|||
|
||||
This option can also be set with the OPTIONS keyword, e.g.:
|
||||
\"foldmarks:(b l m t)\"."
|
||||
:group 'org-export-koma-letter
|
||||
:type '(choice
|
||||
(const :tag "Activate default folding marks" t)
|
||||
(const :tag "Deactivate folding marks" nil)
|
||||
|
@ -418,14 +402,12 @@ This option can also be set with the OPTIONS keyword, e.g.:
|
|||
"Non-nil prints sender's phone number.
|
||||
This option can also be set with the OPTIONS keyword, e.g.:
|
||||
\"phone:t\"."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-koma-letter-use-url nil
|
||||
"Non-nil prints sender's URL.
|
||||
This option can also be set with the OPTIONS keyword, e.g.:
|
||||
\"url:t\"."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'boolean
|
||||
:safe #'booleanp)
|
||||
|
||||
|
@ -433,7 +415,6 @@ This option can also be set with the OPTIONS keyword, e.g.:
|
|||
"Non-nil prints sender's FROM_LOGO.
|
||||
This option can also be set with the OPTIONS keyword, e.g.:
|
||||
\"from-logo:t\"."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'boolean
|
||||
:safe #'booleanp)
|
||||
|
||||
|
@ -441,34 +422,29 @@ This option can also be set with the OPTIONS keyword, e.g.:
|
|||
"Non-nil prints sender's email address.
|
||||
This option can also be set with the OPTIONS keyword, e.g.:
|
||||
\"email:t\"."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-koma-letter-use-place t
|
||||
"Non-nil prints the letter's place next to the date.
|
||||
This option can also be set with the OPTIONS keyword, e.g.:
|
||||
\"place:nil\"."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-koma-letter-default-class "default-koma-letter"
|
||||
"Default class for `org-koma-letter'.
|
||||
The value must be a member of `org-latex-classes'."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-koma-letter-headline-is-opening-maybe t
|
||||
"Non-nil means a headline may be used as an opening and closing.
|
||||
See also `org-koma-letter-opening' and
|
||||
`org-koma-letter-closing'."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-koma-letter-prefer-subject nil
|
||||
"Non-nil means title should be interpreted as subject if subject is missing.
|
||||
This option can also be set with the OPTIONS keyword,
|
||||
e.g. \"title-subject:t\"."
|
||||
:group 'org-export-koma-letter
|
||||
:type 'boolean)
|
||||
|
||||
(defconst org-koma-letter-special-tags-in-letter '(to from closing location)
|
||||
|
@ -618,7 +594,7 @@ such as the one tagged with PS."
|
|||
|
||||
;;;; Export Block
|
||||
|
||||
(defun org-koma-letter-export-block (export-block contents info)
|
||||
(defun org-koma-letter-export-block (export-block _contents _info)
|
||||
"Transcode an EXPORT-BLOCK element into KOMA Scrlttr2 code.
|
||||
CONTENTS is nil. INFO is a plist used as a communication
|
||||
channel."
|
||||
|
@ -628,7 +604,7 @@ channel."
|
|||
|
||||
;;;; Export Snippet
|
||||
|
||||
(defun org-koma-letter-export-snippet (export-snippet contents info)
|
||||
(defun org-koma-letter-export-snippet (export-snippet _contents _info)
|
||||
"Transcode an EXPORT-SNIPPET object into KOMA Scrlttr2 code.
|
||||
CONTENTS is nil. INFO is a plist used as a communication
|
||||
channel."
|
||||
|
|
|
@ -413,7 +413,7 @@ to \"\\autoref{%s}\" or \"\\cref{%s}\" for example."
|
|||
:group 'org-export-latex
|
||||
:type 'string
|
||||
:package-version '(Org . "9.5")
|
||||
:safe t)
|
||||
:safe #'stringp)
|
||||
|
||||
;;;; Preamble
|
||||
|
||||
|
@ -793,7 +793,7 @@ default we use here encompasses both."
|
|||
:group 'org-export-latex
|
||||
:package-version '(Org . "9.5")
|
||||
:type 'string
|
||||
:safe t)
|
||||
:safe #'stringp)
|
||||
|
||||
(defcustom org-latex-default-table-mode 'table
|
||||
"Default mode for tables.
|
||||
|
|
|
@ -141,7 +141,7 @@ CONTENTS and INFO are ignored."
|
|||
CONTENTS is its contents, as a string or nil. INFO is ignored."
|
||||
(let ((case-fold-search t))
|
||||
(replace-regexp-in-string
|
||||
"^[ \t]*#\\+attr_[-_a-za-z0-9]+:\\(?: .*\\)?\n" ""
|
||||
"^[ \t]*#\\+attr_[-_a-z0-9]+:\\(?: .*\\)?\n" ""
|
||||
(org-export-expand blob contents t))))
|
||||
|
||||
(defun org-org-headline (headline contents info)
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
$failures = 0;
|
||||
|
||||
while ($page = shift) {
|
||||
system "mv $page $page.orig";
|
||||
open IN,"<$page.orig" or die "Cannot read from $page.orig\n";
|
||||
open OUT,">$page" or die "Cannot write to $page\n";
|
||||
|
||||
$toc = undef;
|
||||
|
||||
while (<IN>) {
|
||||
if (/<meta http-equiv="Content-Style-Type" content="text\/css">/) {
|
||||
print OUT;
|
||||
|
@ -13,7 +16,7 @@ while (<IN>) {
|
|||
} elsif (/<div class="contents">/) {
|
||||
print OUT;
|
||||
print OUT '<p>This is the official manual for the latest <a href="https://orgmode.org">Org mode</a> release.</p><div id="table-of-contents">';
|
||||
} elsif (/<h2>Table of Contents<\/h2>/) {
|
||||
} elsif (/<h2>Table of Contents<\/h2>|<h2 class="contents-heading">/) {
|
||||
print OUT;
|
||||
print OUT '<a href="https://orgmode.org">https://orgmode.org</a><br/><div id="text-table-of-contents">';
|
||||
$toc = 1;
|
||||
|
@ -25,4 +28,11 @@ while (<IN>) {
|
|||
}
|
||||
}
|
||||
system "rm $page.orig";
|
||||
|
||||
if (!defined($toc) || $toc != 0) {
|
||||
++$failures;
|
||||
print STDERR "Patching of $page failed\n";
|
||||
}
|
||||
}
|
||||
|
||||
$failures == 0 or die "Patching of $failures files failed\n";
|
||||
|
|
Loading…
Reference in New Issue