comparison lisp/net/browse-url.el @ 31909:36892782f26a

(browse-url-file-url): Check for null maps.
author Sam Steingold <sds@gnu.org>
date Tue, 26 Sep 2000 13:05:29 +0000
parents 722700be186b
children d35dba8183fd
comparison
equal deleted inserted replaced
31908:06869c11cb90 31909:36892782f26a
403 "*A list of strings defining options for `browse-url-xterm-program'. 403 "*A list of strings defining options for `browse-url-xterm-program'.
404 These might set its size, for instance." 404 These might set its size, for instance."
405 :type '(repeat (string :tag "Argument")) 405 :type '(repeat (string :tag "Argument"))
406 :group 'browse-url) 406 :group 'browse-url)
407 407
408 (defcustom browse-url-lynx-emacs-args (and (not window-system) 408 (defcustom browse-url-lynx-emacs-args (and (not window-system)
409 '("-show_cursor")) 409 '("-show_cursor"))
410 "A list of strings defining options for Lynx in an Emacs buffer. 410 "A list of strings defining options for Lynx in an Emacs buffer.
411 411
412 The default is none in a window system, otherwise `-show_cursor' to 412 The default is none in a window system, otherwise `-show_cursor' to
413 indicate the position of the current link in the absence of 413 indicate the position of the current link in the absence of
538 (setq file (replace-match "%25" t t file) 538 (setq file (replace-match "%25" t t file)
539 s (1+ s)))) 539 s (1+ s))))
540 (while (string-match "[*\"()',=;? ]" file) 540 (while (string-match "[*\"()',=;? ]" file)
541 (let ((enc (format "%%%x" (aref file (match-beginning 0))))) 541 (let ((enc (format "%%%x" (aref file (match-beginning 0)))))
542 (setq file (replace-match enc t t file)))) 542 (setq file (replace-match enc t t file))))
543 (let ((maps browse-url-filename-alist)) 543 (dolist (map browse-url-filename-alist)
544 (while maps 544 (when (and map (string-match (car map) file))
545 (let* ((map (car maps)) 545 (setq file (replace-match (cdr map) t nil file))))
546 (from-re (car map))
547 (to-string (cdr map)))
548 (setq maps (cdr maps))
549 (and (string-match from-re file)
550 (setq file (replace-match to-string t nil file))))))
551 file) 546 file)
552 547
553 ;;;###autoload 548 ;;;###autoload
554 (defun browse-url-of-buffer (&optional buffer) 549 (defun browse-url-of-buffer (&optional buffer)
555 "Ask a WWW browser to display BUFFER. 550 "Ask a WWW browser to display BUFFER.