Browse Source

Move `org-fill-template' into "org-macs.el"

* lisp/org.el (org-fill-template): Move function
* lisp/org-macs.el: ...there.
Nicolas Goaziou 3 months ago
parent
commit
ccfea3d8e5
5 changed files with 10 additions and 14 deletions
  1. 0 1
      lisp/ob-exp.el
  2. 0 1
      lisp/ob-sqlite.el
  3. 0 1
      lisp/ob-tangle.el
  4. 10 0
      lisp/org-macs.el
  5. 0 11
      lisp/org.el

+ 0 - 1
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)

+ 0 - 1
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))

+ 0 - 1
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))

+ 10 - 0
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

+ 0 - 11
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)