aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/url/url-handlers.el
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2012-06-12 18:00:53 +0800
committerChong Yidong <[email protected]>2012-06-12 18:00:53 +0800
commit47fc1d6ba8179861744412a9322378654a9c30d8 (patch)
tree8027445e407d69e6d1eb109f120172680be3e629 /lisp/url/url-handlers.el
parentf1a4e679f3b0696089b4fd73717307ba5d23e1cf (diff)
* url-handlers.el: Re-order file to avoid recursive load.
Diffstat (limited to 'lisp/url/url-handlers.el')
-rw-r--r--lisp/url/url-handlers.el29
1 files changed, 14 insertions, 15 deletions
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el
index dc412c2d16..2cae2fbe42 100644
--- a/lisp/url/url-handlers.el
+++ b/lisp/url/url-handlers.el
@@ -91,6 +91,20 @@
;; write-region
;;;###autoload
+(define-minor-mode url-handler-mode
+ "Toggle using `url' library for URL filenames (URL Handler mode).
+With a prefix argument ARG, enable URL Handler mode if ARG is
+positive, and disable it otherwise. If called from Lisp, enable
+the mode if ARG is omitted or nil."
+ :global t :group 'url
+ ;; Remove old entry, if any.
+ (setq file-name-handler-alist
+ (delq (rassq 'url-file-handler file-name-handler-alist)
+ file-name-handler-alist))
+ (if url-handler-mode
+ (push (cons url-handler-regexp 'url-file-handler)
+ file-name-handler-alist)))
+
(defcustom url-handler-regexp "\\`\\(https?\\|ftp\\|file\\|nfs\\)://"
"Regular expression for URLs handled by `url-handler-mode'.
When URL Handler mode is enabled, this regular expression is
@@ -109,21 +123,6 @@ like URLs \(Gnus is particularly bad at this\)."
(if enable
(url-handler-mode)))))
-;;;###autoload
-(define-minor-mode url-handler-mode
- "Toggle using `url' library for URL filenames (URL Handler mode).
-With a prefix argument ARG, enable URL Handler mode if ARG is
-positive, and disable it otherwise. If called from Lisp, enable
-the mode if ARG is omitted or nil."
- :global t :group 'url
- ;; Remove old entry, if any.
- (setq file-name-handler-alist
- (delq (rassq 'url-file-handler file-name-handler-alist)
- file-name-handler-alist))
- (if url-handler-mode
- (push (cons url-handler-regexp 'url-file-handler)
- file-name-handler-alist)))
-
(defun url-run-real-handler (operation args)
(let ((inhibit-file-name-handlers (cons 'url-file-handler
(if (eq operation inhibit-file-name-operation)