소스 검색

Backport commit 22946702b from Emacs

* lisp/ob-core.el (org-babel-local-file-name): Use `file-local-name'
when available.

22946702b4296c0e42e4baf6221e205b52d05cbf
Michael Albinus
Sun Nov 20 16:29:47 2016 +0100
Michael Albinus 8 년 전
부모
커밋
e97f04de8e
1개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 6 3
      lisp/ob-core.el

+ 6 - 3
lisp/ob-core.el

@@ -2905,9 +2905,12 @@ can be specified as the REGEXP argument."
       (setq string (substring string 0 -1)))
     string))
 
-(defun org-babel-local-file-name (file)
-  "Return the local name component of FILE."
-  (or (file-remote-p file 'localname) file))
+(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.