summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-03-03 23:46:32 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-03-10 18:00:36 +0100
commitccfea3d8e58402d9c10197d7eb9b489dc139b561 (patch)
treec9576cb2c521cdae6453e583edfe72137d4c41be
parentd4827ea53fe651fd5d45c135958220b6c77ae8c3 (diff)
downloadorg-mode-ccfea3d8e58402d9c10197d7eb9b489dc139b561.tar.gz
Move `org-fill-template' into "org-macs.el"
* lisp/org.el (org-fill-template): Move function * lisp/org-macs.el: ...there.
-rw-r--r--lisp/ob-exp.el1
-rw-r--r--lisp/ob-sqlite.el1
-rw-r--r--lisp/ob-tangle.el1
-rw-r--r--lisp/org-macs.el10
-rw-r--r--lisp/org.el11
5 files changed, 10 insertions, 14 deletions
diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index 1a4c494..cd93ff2 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -32,7 +32,6 @@
(declare-function org-element-type "org-element" (element))
(declare-function org-escape-code-in-string "org-src" (s))
(declare-function org-export-copy-buffer "ox" ())
-(declare-function org-fill-template "org" (template alist))
(declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
(defvar org-src-preserve-indentation)
diff --git a/lisp/ob-sqlite.el b/lisp/ob-sqlite.el
index 04bf4fe..7522c83 100644
--- a/lisp/ob-sqlite.el
+++ b/lisp/ob-sqlite.el
@@ -28,7 +28,6 @@
;;; Code:
(require 'ob)
-(declare-function org-fill-template "org" (template alist))
(declare-function org-table-convert-region "org-table"
(beg0 end0 &optional separator))
(declare-function orgtbl-to-csv "org-table" (table params))
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index fa5ba80..59fb2e8 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -38,7 +38,6 @@
(declare-function org-before-first-heading-p "org" ())
(declare-function org-element-at-point "org-element" ())
(declare-function org-element-type "org-element" (element))
-(declare-function org-fill-template "org" (template alist))
(declare-function org-heading-components "org" ())
(declare-function org-id-find "org-id" (id &optional markerp))
(declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index eaf65a7..7978ca6 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -1000,6 +1000,16 @@ as-is if removal failed."
(insert code)
(if (org-do-remove-indentation n) (buffer-string) code)))
+(defun org-fill-template (template alist)
+ "Find each %key of ALIST in TEMPLATE and replace it."
+ (let ((case-fold-search nil))
+ (dolist (entry (sort (copy-sequence alist)
+ (lambda (a b) (< (length (car a)) (length (car b))))))
+ (setq template
+ (replace-regexp-in-string
+ (concat "%" (regexp-quote (car entry)))
+ (or (cdr entry) "") template t t)))
+ template))
;;; Text properties
diff --git a/lisp/org.el b/lisp/org.el
index 0fdfe49..2365975 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18818,17 +18818,6 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
(interactive "p")
(self-insert-command N))
-(defun org-fill-template (template alist)
- "Find each %key of ALIST in TEMPLATE and replace it."
- (let ((case-fold-search nil))
- (dolist (entry (sort (copy-sequence alist)
- (lambda (a b) (< (length (car a)) (length (car b))))))
- (setq template
- (replace-regexp-in-string
- (concat "%" (regexp-quote (car entry)))
- (or (cdr entry) "") template t t)))
- template))
-
(defun org-quote-vert (s)
"Replace \"|\" with \"\\vert\"."
(while (string-match "|" s)