Просмотр исходного кода

ob-core: Move org-babel-local-file-name to org-compat.el

* lisp/ob-core.el (org-babel-process-file-name): Move to
org-compat.el.
* lisp/org-compat.el (org-babel-local-file-name): Add compatibility
alias.
Kyle Meyer 8 лет назад
Родитель
Сommit
ffa4502771
2 измененных файлов с 8 добавлено и 7 удалено
  1. 0 7
      lisp/ob-core.el
  2. 8 0
      lisp/org-compat.el

+ 0 - 7
lisp/ob-core.el

@@ -2905,13 +2905,6 @@ can be specified as the REGEXP argument."
       (setq string (substring string 0 -1)))
     string))
 
-(defalias 'org-babel-local-file-name
-  (if (fboundp 'file-local-name)
-      'file-local-name
-    (lambda (file)
-      "Return the local name component of FILE."
-      (or (file-remote-p file 'localname) file))))
-
 (defun org-babel-process-file-name (name &optional no-quote-p)
   "Prepare NAME to be used in an external process.
 If NAME specifies a remote location, the remote portion of the

+ 8 - 0
lisp/org-compat.el

@@ -430,6 +430,14 @@ Pass COLUMN and FORCE to `move-to-column'."
     (lambda (&optional _beg _end)
       (with-no-warnings (font-lock-fontify-buffer)))))
 
+;; `file-local-name' was added in Emacs 26.1.
+(defalias 'org-babel-local-file-name
+  (if (fboundp 'file-local-name)
+      'file-local-name
+    (lambda (file)
+      "Return the local name component of FILE."
+      (or (file-remote-p file 'localname) file))))
+
 (defmacro org-no-popups (&rest body)
   "Suppress popup windows.
 Let-bind some variables to nil around BODY to achieve the desired