aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-10-29 13:56:39 +0000
committerRichard M. Stallman2007-10-29 13:56:39 +0000
commitd9774611743fca896e2debd914bd303891674138 (patch)
treecf9871276c4b6f58fef4116364ead1113f82d88f
parent26c07a69b954b4616d09b03424a0c3dcb4902c6f (diff)
downloademacs-d9774611743fca896e2debd914bd303891674138.tar.gz
emacs-d9774611743fca896e2debd914bd303891674138.zip
(browse-url-text-xterm): Renamed from browse-url-lynx-xterm and made generic.
(browse-url-text-emacs): Likewise. (browse-url-text-browser): New variable. (browse-url-text-emacs-args): Renamed from browse-url-lynx-emacs-args. (browse-url-text-input-field, browse-url-text-input-attempts) (browse-url-kde-program): Likewise.
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/net/browse-url.el113
3 files changed, 81 insertions, 50 deletions
diff --git a/etc/NEWS b/etc/NEWS
index f65170003d0..10075824f6f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -346,6 +346,8 @@ applies before function-key-map. Also it is terminal-local contrary to
346key-translation-map. Terminal-specific key-sequences are generally added to 346key-translation-map. Terminal-specific key-sequences are generally added to
347this map rather than to function-key-map now. 347this map rather than to function-key-map now.
348 348
349** The new function `read-color' reads a color name using the minibuffer.
350
349** Changes related to multiple tty support. 351** Changes related to multiple tty support.
350 352
351*** $TERM is now set to `dumb' for subprocesses. If you want to know the 353*** $TERM is now set to `dumb' for subprocesses. If you want to know the
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a338679e219..2ce58cd08dc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,19 @@
12007-10-29 Drew Adams <drew.adams@oracle.com>
2
3 * faces.el (read-color): New function.
4 (face-at-point, foreground-color-at-point)
5 (background-color-at-point): New functions.
6
72007-10-28 Richard Stallman <rms@gnu.org>
8
9 * net/browse-url.el (browse-url-text-xterm): Renamed from
10 browse-url-lynx-xterm and made generic.
11 (browse-url-text-emacs): Likewise.
12 (browse-url-text-browser): New variable.
13 (browse-url-text-emacs-args): Renamed from browse-url-lynx-emacs-args.
14 (browse-url-text-input-field, browse-url-text-input-attempts)
15 (browse-url-kde-program): Likewise.
16
12007-10-29 Glenn Morris <rgm@gnu.org> 172007-10-29 Glenn Morris <rgm@gnu.org>
2 18
3 * textmodes/org-publish.el (org-publish-get-plist-from-filename): 19 * textmodes/org-publish.el (org-publish-get-plist-from-filename):
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index c2a0442478c..523588ec7c2 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -46,7 +46,7 @@
46;; browse-url-cci XMosaic 2.5 46;; browse-url-cci XMosaic 2.5
47;; browse-url-w3 w3 0 47;; browse-url-w3 w3 0
48;; browse-url-w3-gnudoit w3 remotely 48;; browse-url-w3-gnudoit w3 remotely
49;; browse-url-lynx-* Lynx 0 49;; browse-url-text-* Any text browser 0
50;; browse-url-generic arbitrary 50;; browse-url-generic arbitrary
51;; browse-url-default-windows-browser MS-Windows browser 51;; browse-url-default-windows-browser MS-Windows browser
52;; browse-url-default-macosx-browser Mac OS X browser 52;; browse-url-default-macosx-browser Mac OS X browser
@@ -246,10 +246,10 @@ regexp should probably be \".\" to specify a default browser."
246 (function-item :tag "Netscape" :value browse-url-netscape) 246 (function-item :tag "Netscape" :value browse-url-netscape)
247 (function-item :tag "Mosaic" :value browse-url-mosaic) 247 (function-item :tag "Mosaic" :value browse-url-mosaic)
248 (function-item :tag "Mosaic using CCI" :value browse-url-cci) 248 (function-item :tag "Mosaic using CCI" :value browse-url-cci)
249 (function-item :tag "Lynx in an xterm window" 249 (function-item :tag "Text browser in an xterm window"
250 :value browse-url-lynx-xterm) 250 :value browse-url-text-xterm)
251 (function-item :tag "Lynx in an Emacs window" 251 (function-item :tag "Text browser in an Emacs window"
252 :value browse-url-lynx-emacs) 252 :value browse-url-text-emacs)
253 (function-item :tag "KDE" :value browse-url-kde) 253 (function-item :tag "KDE" :value browse-url-kde)
254 (function-item :tag "Elinks" :value browse-url-elinks) 254 (function-item :tag "Elinks" :value browse-url-elinks)
255 (function-item :tag "Specified by `Browse Url Generic Program'" 255 (function-item :tag "Specified by `Browse Url Generic Program'"
@@ -502,9 +502,9 @@ enabled. The port number should be set in `browse-url-CCI-port'."
502 502
503(defvar browse-url-temp-file-name nil) 503(defvar browse-url-temp-file-name nil)
504(make-variable-buffer-local 'browse-url-temp-file-name) 504(make-variable-buffer-local 'browse-url-temp-file-name)
505 505
506(defcustom browse-url-xterm-program "xterm" 506(defcustom browse-url-xterm-program "xterm"
507 "The name of the terminal emulator used by `browse-url-lynx-xterm'. 507 "The name of the terminal emulator used by `browse-url-text-xterm'.
508This might, for instance, be a separate color version of xterm." 508This might, for instance, be a separate color version of xterm."
509 :type 'string 509 :type 'string
510 :group 'browse-url) 510 :group 'browse-url)
@@ -515,17 +515,6 @@ These might set its size, for instance."
515 :type '(repeat (string :tag "Argument")) 515 :type '(repeat (string :tag "Argument"))
516 :group 'browse-url) 516 :group 'browse-url)
517 517
518(defcustom browse-url-lynx-emacs-args (and (not window-system)
519 '("-show_cursor"))
520 "A list of strings defining options for Lynx in an Emacs buffer.
521
522The default is none in a window system, otherwise `-show_cursor' to
523indicate the position of the current link in the absence of
524highlighting, assuming the normal default for showing the cursor."
525 :type '(repeat (string :tag "Argument"))
526 :version "20.3"
527 :group 'browse-url)
528
529(defcustom browse-url-gnudoit-program "gnudoit" 518(defcustom browse-url-gnudoit-program "gnudoit"
530 "The name of the `gnudoit' program used by `browse-url-w3-gnudoit'." 519 "The name of the `gnudoit' program used by `browse-url-w3-gnudoit'."
531 :type 'string 520 :type 'string
@@ -562,28 +551,47 @@ incompatibly at version 4."
562 :type 'number 551 :type 'number
563 :group 'browse-url) 552 :group 'browse-url)
564 553
565(defcustom browse-url-lynx-input-field 'avoid 554(defcustom browse-url-text-browser "lynx"
566 "Action on selecting an existing Lynx buffer at an input field. 555 "The name of the text browser to invoke."
567What to do when sending a new URL to an existing Lynx buffer in Emacs 556 :type 'string
568if the Lynx cursor is on an input field (in which case the `g' command 557 :group 'browse-url
558 :version "23.1")
559
560(defcustom browse-url-text-emacs-args (and (not window-system)
561 '("-show_cursor"))
562 "A list of strings defining options for a text browser in an Emacs buffer.
563
564The default is none in a window system, otherwise `-show_cursor' to
565indicate the position of the current link in the absence of
566highlighting, assuming the normal default for showing the cursor."
567 :type '(repeat (string :tag "Argument"))
568 :version "23.1"
569 :group 'browse-url)
570
571(defcustom browse-url-text-input-field 'avoid
572 "Action on selecting an existing text browser buffer at an input field.
573What to do when sending a new URL to an existing text browser buffer in Emacs
574if the browser cursor is on an input field (in which case the `g' command
569would be entered as data). Such fields are recognized by the 575would be entered as data). Such fields are recognized by the
570underlines ____. Allowed values: nil: disregard it, 'warn: warn the 576underlines ____. Allowed values: nil: disregard it, `warn': warn the
571user and don't emit the URL, 'avoid: try to avoid the field by moving 577user and don't emit the URL, `avoid': try to avoid the field by moving
572down (this *won't* always work)." 578down (this *won't* always work)."
573 :type '(choice (const :tag "Move to try to avoid field" :value avoid) 579 :type '(choice (const :tag "Move to try to avoid field" :value avoid)
574 (const :tag "Disregard" :value nil) 580 (const :tag "Disregard" :value nil)
575 (const :tag "Warn, don't emit URL" :value warn)) 581 (const :tag "Warn, don't emit URL" :value warn))
576 :version "20.3" 582 :version "23.1"
577 :group 'browse-url) 583 :group 'browse-url)
578 584
579(defcustom browse-url-lynx-input-attempts 10 585(defcustom browse-url-text-input-attempts 10
580 "How many times to try to move down from a series of lynx input fields." 586 "How many times to try to move down from a series of text browser input fields."
581 :type 'integer 587 :type 'integer
588 :version "23.1"
582 :group 'browse-url) 589 :group 'browse-url)
583 590
584(defcustom browse-url-lynx-input-delay 0.2 591(defcustom browse-url-text-input-delay 0.2
585 "How many seconds to wait for lynx between moves down from an input field." 592 "Seconds to wait for a text browser between moves down from an input field."
586 :type 'number 593 :type 'number
594 :version "23.1"
587 :group 'browse-url) 595 :group 'browse-url)
588 596
589(defcustom browse-url-kde-program "kfmclient" 597(defcustom browse-url-kde-program "kfmclient"
@@ -876,7 +884,7 @@ Galeon, Konqueror, Netscape, Mosaic, Lynx in an xterm, and then W3."
876 ((executable-find browse-url-kde-program) 'browse-url-kde) 884 ((executable-find browse-url-kde-program) 'browse-url-kde)
877 ((executable-find browse-url-netscape-program) 'browse-url-netscape) 885 ((executable-find browse-url-netscape-program) 'browse-url-netscape)
878 ((executable-find browse-url-mosaic-program) 'browse-url-mosaic) 886 ((executable-find browse-url-mosaic-program) 'browse-url-mosaic)
879 ((executable-find browse-url-xterm-program) 'browse-url-lynx-xterm) 887 ((executable-find browse-url-xterm-program) 'browse-url-text-xterm)
880 ((locate-library "w3") 'browse-url-w3) 888 ((locate-library "w3") 'browse-url-w3)
881 (t 889 (t
882 (lambda (&ignore args) (error "No usable browser found")))) 890 (lambda (&ignore args) (error "No usable browser found"))))
@@ -1308,38 +1316,41 @@ The `browse-url-gnudoit-program' program is used with options given by
1308;; --- Lynx in an xterm --- 1316;; --- Lynx in an xterm ---
1309 1317
1310;;;###autoload 1318;;;###autoload
1311(defun browse-url-lynx-xterm (url &optional new-window) 1319(defun browse-url-text-xterm (url &optional new-window)
1312 ;; new-window ignored 1320 ;; new-window ignored
1313 "Ask the Lynx WWW browser to load URL. 1321 "Ask a text browser to load URL.
1314Default to the URL around or before point. A new Lynx process is run 1322URL defaults to the URL around or before point.
1323This runs the text browser specified by `browse-url-text-browser'.
1315in an Xterm window using the Xterm program named by `browse-url-xterm-program' 1324in an Xterm window using the Xterm program named by `browse-url-xterm-program'
1316with possible additional arguments `browse-url-xterm-args'." 1325with possible additional arguments `browse-url-xterm-args'."
1317 (interactive (browse-url-interactive-arg "Lynx URL: ")) 1326 (interactive (browse-url-interactive-arg "Text browser URL: "))
1318 (apply #'start-process `(,(concat "lynx" url) nil ,browse-url-xterm-program 1327 (apply #'start-process `(,(concat browse-url-text-browser url)
1319 ,@browse-url-xterm-args "-e" "lynx" 1328 nil ,browse-url-xterm-program
1329 ,@browse-url-xterm-args "-e" browse-url-text-browser
1320 ,url))) 1330 ,url)))
1321 1331
1322;; --- Lynx in an Emacs "term" window --- 1332;; --- Lynx in an Emacs "term" window ---
1323 1333
1324;;;###autoload 1334;;;###autoload
1325(defun browse-url-lynx-emacs (url &optional new-buffer) 1335(defun browse-url-text-emacs (url &optional new-buffer)
1326 "Ask the Lynx WWW browser to load URL. 1336 "Ask a text browser to load URL.
1327Default to the URL around or before point. With a prefix argument, run 1337URL defaults to the URL around or before point.
1328a new Lynx process in a new buffer. 1338This runs the text browser specified by `browse-url-text-browser'.
1339With a prefix argument, it runs a new browser process in a new buffer.
1329 1340
1330When called interactively, if variable `browse-url-new-window-flag' is 1341When called interactively, if variable `browse-url-new-window-flag' is
1331non-nil, load the document in a new lynx in a new term window, 1342non-nil, load the document in a new browser process in a new term window,
1332otherwise use any existing one. A non-nil interactive prefix argument 1343otherwise use any existing one. A non-nil interactive prefix argument
1333reverses the effect of `browse-url-new-window-flag'. 1344reverses the effect of `browse-url-new-window-flag'.
1334 1345
1335When called non-interactively, optional second argument NEW-WINDOW is 1346When called non-interactively, optional second argument NEW-WINDOW is
1336used instead of `browse-url-new-window-flag'." 1347used instead of `browse-url-new-window-flag'."
1337 (interactive (browse-url-interactive-arg "Lynx URL: ")) 1348 (interactive (browse-url-interactive-arg "Text browser URL: "))
1338 (let* ((system-uses-terminfo t) ; Lynx uses terminfo 1349 (let* ((system-uses-terminfo t) ; Lynx uses terminfo
1339 ;; (term-term-name "vt100") ; ?? 1350 ;; (term-term-name "vt100") ; ??
1340 (buf (get-buffer "*lynx*")) 1351 (buf (get-buffer "*text browser*"))
1341 (proc (and buf (get-buffer-process buf))) 1352 (proc (and buf (get-buffer-process buf)))
1342 (n browse-url-lynx-input-attempts)) 1353 (n browse-url-text-input-attempts))
1343 (if (and (browse-url-maybe-new-window new-buffer) buf) 1354 (if (and (browse-url-maybe-new-window new-buffer) buf)
1344 ;; Rename away the OLD buffer. This isn't very polite, but 1355 ;; Rename away the OLD buffer. This isn't very polite, but
1345 ;; term insists on working in a buffer named *lynx* and would 1356 ;; term insists on working in a buffer named *lynx* and would
@@ -1350,11 +1361,13 @@ used instead of `browse-url-new-window-flag'."
1350 (not buf) 1361 (not buf)
1351 (not proc) 1362 (not proc)
1352 (not (memq (process-status proc) '(run stop)))) 1363 (not (memq (process-status proc) '(run stop))))
1353 ;; start a new lynx 1364 ;; start a new text browser
1354 (progn 1365 (progn
1355 (setq buf 1366 (setq buf
1356 (apply #'make-term 1367 (apply #'make-term
1357 `("lynx" "lynx" nil ,@browse-url-lynx-emacs-args 1368 `(,browse-url-text-browser
1369 ,browse-url-text-browser
1370 nil ,@browse-url-text-emacs-args
1358 ,url))) 1371 ,url)))
1359 (switch-to-buffer buf) 1372 (switch-to-buffer buf)
1360 (term-char-mode) 1373 (term-char-mode)
@@ -1366,18 +1379,18 @@ used instead of `browse-url-new-window-flag'."
1366 (if (not (memq (process-status process) '(run stop))) 1379 (if (not (memq (process-status process) '(run stop)))
1367 (let ((buf (process-buffer process))) 1380 (let ((buf (process-buffer process)))
1368 (if buf (kill-buffer buf))))))) 1381 (if buf (kill-buffer buf)))))))
1369 ;; send the url to lynx in the old buffer 1382 ;; Send the url to the text browser in the old buffer
1370 (let ((win (get-buffer-window buf t))) 1383 (let ((win (get-buffer-window buf t)))
1371 (if win 1384 (if win
1372 (select-window win) 1385 (select-window win)
1373 (switch-to-buffer buf))) 1386 (switch-to-buffer buf)))
1374 (if (eq (following-char) ?_) 1387 (if (eq (following-char) ?_)
1375 (cond ((eq browse-url-lynx-input-field 'warn) 1388 (cond ((eq browse-url-text-input-field 'warn)
1376 (error "Please move out of the input field first")) 1389 (error "Please move out of the input field first"))
1377 ((eq browse-url-lynx-input-field 'avoid) 1390 ((eq browse-url-text-input-field 'avoid)
1378 (while (and (eq (following-char) ?_) (> n 0)) 1391 (while (and (eq (following-char) ?_) (> n 0))
1379 (term-send-down) ; down arrow 1392 (term-send-down) ; down arrow
1380 (sit-for browse-url-lynx-input-delay)) 1393 (sit-for browse-url-text-input-delay))
1381 (if (eq (following-char) ?_) 1394 (if (eq (following-char) ?_)
1382 (error "Cannot move out of the input field, sorry"))))) 1395 (error "Cannot move out of the input field, sorry")))))
1383 (term-send-string proc (concat "g" ; goto 1396 (term-send-string proc (concat "g" ; goto