Browse Source

Move `org-trim' in "org-macs.el"

* lisp/org.el (org-trim): Move function...
* lisp/org-macs.el: ... here.
Nicolas Goaziou 7 years ago
parent
commit
442a2b430d
2 changed files with 8 additions and 8 deletions
  1. 8 0
      lisp/org-macs.el
  2. 0 8
      lisp/org.el

+ 8 - 0
lisp/org-macs.el

@@ -38,6 +38,14 @@
                  symbols)
                  symbols)
      ,@body))
      ,@body))
 
 
+(defsubst org-trim (s &optional keep-lead)
+  "Remove whitespace at the beginning and the end of string S.
+When optional argument KEEP-LEAD is non-nil, removing blank lines
+at the beginning of the string does not affect leading indentation."
+  (replace-regexp-in-string
+   (if keep-lead "\\`\\([ \t]*\n\\)+" "\\`[ \t\n\r]+") ""
+   (replace-regexp-in-string "[ \t\n\r]+\\'" "" s)))
+
 (defun org-string-nw-p (s)
 (defun org-string-nw-p (s)
   "Return S if S is a string containing a non-blank character.
   "Return S if S is a string containing a non-blank character.
 Otherwise, return nil."
 Otherwise, return nil."

+ 0 - 8
lisp/org.el

@@ -194,14 +194,6 @@ Stars are put in group 1 and the trimmed body in group 2.")
   "Get text property PROPERTY at the beginning of line."
   "Get text property PROPERTY at the beginning of line."
   (get-text-property (point-at-bol) property))
   (get-text-property (point-at-bol) property))
 
 
-(defsubst org-trim (s &optional keep-lead)
-  "Remove whitespace at the beginning and the end of string S.
-When optional argument KEEP-LEAD is non-nil, removing blank lines
-at the beginning of the string does not affect leading indentation."
-  (replace-regexp-in-string
-   (if keep-lead "\\`\\([ \t]*\n\\)+" "\\`[ \t\n\r]+") ""
-   (replace-regexp-in-string "[ \t\n\r]+\\'" "" s)))
-
 ;; load languages based on value of `org-babel-load-languages'
 ;; load languages based on value of `org-babel-load-languages'
 (defvar org-babel-load-languages)
 (defvar org-babel-load-languages)