summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-07-18 23:43:01 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-07-18 23:45:52 +0200
commit8fe6f275121ec9eaee6fd6caa9a26c609fd59379 (patch)
tree50cce6fa95fe25343c50a94afcf35fecbbad8889
parentaa822a46141cf52b852ce27a1fd75aae6883e566 (diff)
downloadorg-mode-8fe6f275121ec9eaee6fd6caa9a26c609fd59379.tar.gz
Deprecate "file+application" link types
* doc/org.texi (External links): Remove "file+emacs" and "file+sys" syntax. * lisp/org-compat.el (org): Support "file+emacs" and "file+sys" for the time being. * lisp/org-lint.el (org-lint--checkers): Add checker for obsolete link types. (org-lint-file-application): New function. * lisp/org.el (org-link-parameters): Remove deprecated link types.
-rw-r--r--doc/org.texi2
-rw-r--r--etc/ORG-NEWS5
-rw-r--r--lisp/org-compat.el7
-rw-r--r--lisp/org-lint.el15
-rw-r--r--lisp/org.el2
5 files changed, 25 insertions, 6 deletions
diff --git a/doc/org.texi b/doc/org.texi
index 81bff5f..24c0cb1 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -3554,8 +3554,6 @@ file}@footnote{ Headline searches always match the exact headline, ignoring
spaces and cookies. If the headline is not found and the value of the option
@code{org-link-search-must-match-exact-headline} is @code{query-to-create},
then the user will be queried to create it.}
-file+sys:/path/to/file @r{open via OS, like double-click}
-file+emacs:/path/to/file @r{force opening by Emacs}
docview:papers/last.pdf::NNN @r{open in doc-view mode at page}
id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID}
news:comp.emacs @r{Usenet link}
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 01e1ce1..2535a09 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -485,7 +485,10 @@ now shift to the first possible future occurrence, even if the
occurrence is later the same day the task is completed. (Timestamps
already in the future are still shifted one time further into the
future.)
-
+*** ~file+emacs~ and ~file+sys~ link types are deprecated
+They are still supported in Org 9.0 but will eventually be removed in
+a later release. Use ~file~ link type along with universal arguments
+to force opening it in either Emacs or with system application.
* Version 8.3
** Incompatible changes
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 5dd3d40..0675d5b 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -226,6 +226,13 @@ See `org-link-parameters' for documentation on the other parameters."
(make-obsolete 'org-add-link-type "org-link-add." "Org 9.0")
+;;;; Obsolete link types
+
+(with-eval-after-load 'org
+ (org-link-set-parameters "file+emacs") ;since Org 9.0
+ (org-link-set-parameters "file+sys")) ;since Org 9.0
+
+
;;; Miscellaneous functions
diff --git a/lisp/org-lint.el b/lisp/org-lint.el
index feb7090..444ab80 100644
--- a/lisp/org-lint.el
+++ b/lisp/org-lint.el
@@ -96,6 +96,7 @@
;; - incomplete drawers
;; - indented diary-sexps
;; - obsolete QUOTE section
+;; - obsolete "file+application" link
;;; Code:
@@ -273,7 +274,11 @@
:name 'quote-section
:description "Report obsolete QUOTE section"
:categories '(obsolete)
- :trust 'low))
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'file-application
+ :description "Report obsolete \"file+application\" link"
+ :categories '(link obsolete)))
"List of all available checkers.")
(defun org-lint--collect-duplicates
@@ -849,6 +854,14 @@ Use \"export %s\" instead"
(list (org-element-property :begin h)
"Deprecated QUOTE section"))))))
+(defun org-lint-file-application (ast)
+ (org-element-map ast 'link
+ (lambda (l)
+ (let ((app (org-element-property :application l)))
+ (and app
+ (list (org-element-property :begin l)
+ (format "Deprecated \"file+%s\" link type" app)))))))
+
(defun org-lint-wrong-header-argument (ast)
(let* ((reports)
(verify
diff --git a/lisp/org.el b/lisp/org.el
index b1f632f..8bbaec8 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1762,8 +1762,6 @@ The value of this is taken from the #+LINK lines.")
'(("doi" :follow org--open-doi-link)
("elisp" :follow org--open-elisp-link)
("file" :complete org-file-complete-link)
- ("file+emacs")
- ("file+sys")
("ftp" :follow (lambda (path) (browse-url (concat "ftp:" path))))
("help" :follow org--open-help-link)
("http" :follow (lambda (path) (browse-url (concat "http:" path))))