;; browse-url-mmm MMM ?
;; browse-url-generic arbitrary
+;; [The Netscape browser is now free software
+;; <URL:http://www.mozilla.org/>, albeit not GPLed, so it is
+;; reasonable to keep it as the default.]
+
;; Note that versions of Netscape before 1.1b1 did not have remote
;; control. <URL:http://www.netscape.com/newsref/std/x-remote.html>.
-;; Netscape can cache Web pages so it may be necessary to tell it to
+;; Browsers can cache Web pages so it may be necessary to tell them to
;; reload the current page if it has changed (e.g. if you have edited
;; it). There is currently no perfect automatic solution to this.
;; support for Java applets and multicast) can be used like Mosaic by
;; setting `browse-url-mosaic-program' appropriately.
-;; I [Denis Howe] recommend Nelson Minar <nelson@santafe.edu>'s excellent
-;; html-helper-mode.el for editing HTML and thank Nelson for
-;; his many useful comments on this code.
+;; I [Denis Howe, not Dave Love] recommend Nelson Minar
+;; <nelson@santafe.edu>'s excellent html-helper-mode.el for editing
+;; HTML and thank Nelson for his many useful comments on this code.
;; <URL:http://www.santafe.edu/%7Enelson/hhm-beta/>
;; See also hm--html-menus <URL:http://www.tnt.uni-hannover.de/%7Emuenkel/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Variables
-(eval-when-compile (require 'dired)
- (require 'thingatpt)
+(eval-when-compile (require 'thingatpt)
(require 'term))
(defgroup browse-url nil
:type '(repeat (string :tag "Argument"))
:group 'browse-url)
-(defcustom browse-url-temp-dir
- (or (getenv "TMPDIR") "/tmp")
+(defcustom browse-url-temp-dir temporary-file-directory
"The name of a directory for browse-url's temporary files.
Such files are generated by functions like `browse-url-of-region'.
You might want to set this to somewhere with restricted read permissions
:version "20.3"
:group 'browse-url)
-(defcustom browse-url-lynx-input-attempts 10
- "*How many times to try to move down from a series of lynx input fields."
- :version "20.3"
- :type 'integer
- :group 'browse-url)
+(defvar browse-url-lynx-input-attempts 10
+ "*How many times to try to move down from a series of lynx input fields.")
(defcustom browse-url-lynx-input-delay 0.2
- "How many seconds to wait for lynx between moves down from an input field."
- :version "20.3"
- :type 'number
- :group 'browse-url)
+ "How many seconds to wait for lynx between moves down from an input field.")
(defvar browse-url-temp-file-list '())
When called non-interactively, optional second argument NEW-WINDOW is
used instead of `browse-url-new-window-p'."
(interactive (browse-url-interactive-arg "Netscape URL: "))
- ;; URL encode any commas in the URL
- (while (string-match "," url)
- (setq url (replace-match "%2C" t t url)))
+ ;; URL encode any `confusing' characters in the URL. This needs to
+ ;; include at least commas; presumably also close parens.
+ (while (string-match "[,)]" url)
+ (setq url (replace-match
+ (format "%%%x" (string-to-char (match-string 0 url))) t t url)))
(let* ((process-environment (browse-url-process-environment))
(process (apply 'start-process
(concat "netscape " url) nil
used instead of `browse-url-new-window-p'."
(interactive (browse-url-interactive-arg "Mosaic URL: "))
(let ((pidfile (expand-file-name "~/.mosaicpid"))
- pid pidbuf)
+ pid)
(if (file-readable-p pidfile)
(save-excursion
(find-file pidfile)
(set-buffer (get-buffer-create " *Shell Command Output*"))
(erase-buffer)
;; don't worry about this failing.
- (call-process browse-url-grail nil 0 nil url)
+ (if new-window
+ (call-process browse-url-grail nil 0 nil "-b" url)
+ (call-process browse-url-grail nil 0 nil url))
(message "Sending URL to Grail... done")))
;; --- Mosaic using CCI ---
+;;;###autoload
(defun browse-url-cci (url &optional new-window)
"Ask the XMosaic WWW browser to load URL.
Default to the URL around or before point.