From 70fc17219137338917be8da925381268f9797f5c Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 29 Apr 2018 16:28:25 +0200 Subject: [PATCH] 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'. --- lisp/org-compat.el | 3 ++- lisp/org.el | 17 +---------------- lisp/ox.el | 4 ++-- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 0739f0f19..34a2bf115 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -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)) diff --git a/lisp/org.el b/lisp/org.el index af6322f8e..08d01e009 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -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 diff --git a/lisp/ox.el b/lisp/ox.el index 5a83ae01d..4becf38fe 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -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:///")