summaryrefslogtreecommitdiff
path: root/lisp/url/url-handlers.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-06-12 13:47:14 +0800
committerChong Yidong <cyd@gnu.org>2012-06-12 13:47:14 +0800
commitf1a4e679f3b0696089b4fd73717307ba5d23e1cf (patch)
treedc44016b20723e38247300b6c6eaec3cd4e98761 /lisp/url/url-handlers.el
parentbf67e61f291a82a9e90a7918f5188714853f0094 (diff)
downloademacs-f1a4e679f3b0696089b4fd73717307ba5d23e1cf.tar.gz
Various minor variable/hook cleanups.
* lisp/emacs-lisp/edebug.el (edebug-inhibit-emacs-lisp-mode-bindings): Rename from gud-inhibit-global-bindings. * lisp/emacs-lisp/eieio.el (eieio-pre-method-execution-hooks): Doc fix. * lisp/erc/erc-dcc.el (erc-dcc-chat-filter-functions): Rename from erc-dcc-chat-filter-hook, since this is an abnormal hook. * lisp/nxml/nxml-glyph.el (nxml-glyph-set-functions): Rename abnormal hook from nxml-glyph-set-hook. * lisp/progmodes/cwarn.el (cwarn-mode): Remove redundant variable declaration. * lisp/progmodes/pascal.el (pascal-toggle-completions): Doc fix. * lisp/textmodes/bibtex.el (bibtex-string-file-path, bibtex-file-path): Convert to defcustom. * lisp/url/url-handlers.el (url-handler-regexp): * lisp/url/url-nfs.el (url-nfs-automounter-directory-spec): * lisp/url/url-vars.el (url-load-hook): Convert to defcustom.
Diffstat (limited to 'lisp/url/url-handlers.el')
-rw-r--r--lisp/url/url-handlers.el42
1 files changed, 25 insertions, 17 deletions
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el
index d00a1174cdf..dc412c2d16d 100644
--- a/lisp/url/url-handlers.el
+++ b/lisp/url/url-handlers.el
@@ -90,13 +90,24 @@
;; verify-visited-file-modtime
;; write-region
-(defvar url-handler-regexp
- "\\`\\(https?\\|ftp\\|file\\|nfs\\)://"
- "A regular expression for matching URLs handled by `file-name-handler-alist'.
-Some valid URL protocols just do not make sense to visit interactively
-\(about, data, info, irc, mailto, etc\). This regular expression
-avoids conflicts with local files that look like URLs \(Gnus is
-particularly bad at this\).")
+;;;###autoload
+(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
+added to `file-name-handler-alist'.
+
+Some valid URL protocols just do not make sense to visit
+interactively \(about, data, info, irc, mailto, etc\). This
+regular expression avoids conflicts with local files that look
+like URLs \(Gnus is particularly bad at this\)."
+ :group 'url
+ :type 'regexp
+ :set (lambda (symbol value)
+ (let ((enable url-handler-mode))
+ (url-handler-mode 0)
+ (set-default symbol value)
+ (if enable
+ (url-handler-mode)))))
;;;###autoload
(define-minor-mode url-handler-mode
@@ -105,16 +116,13 @@ 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
- (if (not (boundp 'file-name-handler-alist))
- ;; Can't be turned ON anyway.
- (setq url-handler-mode nil)
- ;; 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))))
+ ;; 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