Mark `org-file-remote-p' as obsolete

* lisp/org.el (org-file-remote-p): Move function...
* lisp/org-compat.el: ... here.
* lisp/ox.el (org-export--prepare-file-contents):
(org-export-file-uri): Use `file-remote-p'.
This commit is contained in:
Nicolas Goaziou 2018-04-29 16:28:25 +02:00
parent 4aa2513882
commit 70fc172191
3 changed files with 5 additions and 19 deletions

View File

@ -128,6 +128,7 @@ Case is significant."
(define-obsolete-function-alias 'org-match-string-no-properties 'match-string-no-properties "Org 9.0")
(define-obsolete-function-alias 'org-propertize 'propertize "Org 9.0")
(define-obsolete-function-alias 'org-select-frame-set-input-focus 'select-frame-set-input-focus "Org 9.0")
(define-obsolete-function-alias 'org-file-remote-p 'file-remote-p "Org 9.2")
(defmacro org-re (s)
"Replace posix classes in regular expression S."
@ -440,7 +441,7 @@ use of this function is for the stuck project list."
(org-align-tags t))
(defmacro org-with-silent-modifications (&rest body)
(declare (obsolete "use `with-silent-modifications' instead." "9.2")
(declare (obsolete "use `with-silent-modifications' instead." "Org 9.2")
(debug (body)))
`(with-silent-modifications ,@body))

View File

@ -10680,7 +10680,7 @@ If the file does not exist, an error is thrown."
'org-file-apps-entry-match-against-dlink-p file-apps))
(apps-dlink (cl-remove-if-not
'org-file-apps-entry-match-against-dlink-p file-apps))
(remp (and (assq 'remote apps) (org-file-remote-p file)))
(remp (and (assq 'remote apps) (file-remote-p file)))
(dirp (unless remp (file-directory-p file)))
(file (if (and dirp org-open-directory-means-index-dot-org)
(concat (file-name-as-directory file) "index.org")
@ -10852,21 +10852,6 @@ be opened in Emacs."
(when add-auto-mode
(mapcar (lambda (x) (cons (car x) 'emacs)) auto-mode-alist))))
(defvar ange-ftp-name-format)
(defun org-file-remote-p (file)
"Test whether FILE specifies a location on a remote system.
Return non-nil if the location is indeed remote.
For example, the filename \"/user@host:/foo\" specifies a location
on the system \"/user@host:\"."
(cond ((fboundp 'file-remote-p)
(file-remote-p file))
((fboundp 'tramp-handle-file-remote-p)
(tramp-handle-file-remote-p file))
((and (boundp 'ange-ftp-name-format)
(string-match (car ange-ftp-name-format) file))
t)))
;;;; Refiling

View File

@ -3510,7 +3510,7 @@ is to happen."
(when (and (eq 'link (org-element-type link))
(string= "file" (org-element-property :type link)))
(let ((old-path (org-element-property :path link)))
(unless (or (org-file-remote-p old-path)
(unless (or (file-remote-p old-path)
(file-name-absolute-p old-path))
(let ((new-path (file-relative-name
(expand-file-name old-path file-dir)
@ -4425,7 +4425,7 @@ has type \"radio\"."
"Return file URI associated to FILENAME."
(cond ((string-prefix-p "//" filename) (concat "file:" filename))
((not (file-name-absolute-p filename)) filename)
((org-file-remote-p filename) (concat "file:/" filename))
((file-remote-p filename) (concat "file:/" filename))
(t
(let ((fullname (expand-file-name filename)))
(concat (if (string-prefix-p "/" fullname) "file://" "file:///")