diff options
Diffstat (limited to 'lisp/url')
-rw-r--r-- | lisp/url/ChangeLog | 6 | ||||
-rw-r--r-- | lisp/url/url-handlers.el | 42 | ||||
-rw-r--r-- | lisp/url/url-nfs.el | 7 | ||||
-rw-r--r-- | lisp/url/url-vars.el | 6 |
4 files changed, 39 insertions, 22 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 40295f6e1d..32015db840 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,9 @@ +2012-06-12 Chong Yidong <cyd@gnu.org> + + * url-handlers.el (url-handler-regexp): + * url-nfs.el (url-nfs-automounter-directory-spec): + * url-vars.el (url-load-hook): Convert to defcustom. + 2012-05-25 Leo Liu <sdl.web@gmail.com> * url-http.el (url-http-codes): Fix mal-formed defconst. diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el index d00a1174cd..dc412c2d16 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 diff --git a/lisp/url/url-nfs.el b/lisp/url/url-nfs.el index bfab147f26..cb5695b554 100644 --- a/lisp/url/url-nfs.el +++ b/lisp/url/url-nfs.el @@ -27,8 +27,7 @@ (require 'url-parse) (require 'url-file) -(defvar url-nfs-automounter-directory-spec - "file:/net/%h%f" +(defcustom url-nfs-automounter-directory-spec "file:/net/%h%f" "How to invoke the NFS automounter. Certain % sequences are recognized. %h -- the hostname of the NFS server @@ -38,7 +37,9 @@ %f -- the filename on the remote server %% -- a literal % -Each can be used any number of times.") +Each can be used any number of times." + :group 'url + :type 'string) (defun url-nfs-unescape (format host port user pass file) (with-current-buffer (get-buffer-create " *nfs-parse*") diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el index 6aa14b8bae..11546e1158 100644 --- a/lisp/url/url-vars.el +++ b/lisp/url/url-vars.el @@ -375,8 +375,10 @@ Currently supported methods: (modify-syntax-entry ?> ")<" url-parse-syntax-table) (modify-syntax-entry ?/ " " url-parse-syntax-table) -(defvar url-load-hook nil - "Hooks to be run after initializing the URL library.") +(defcustom url-load-hook nil + "Hook run after initializing the URL library." + :group 'url + :type 'hook) ;;; Make OS/2 happy - yeeks ;; (defvar tcp-binary-process-input-services nil |