[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: patch: w3m-ems.diff



From: Leo <sdl.web@xxxxxxxxx> said
Subject: [emacs-w3m:11034] patch: w3m-ems.diff
Message-ID: <xbaivdk4c7ry.fsf@xxxxxxxxx>
Date: Mon, 31 Aug 2009 16:39:13 +0100

> The faces in w3m-ems test for window-system 'mac' which does not seem to
> exist in Emacs 23. The attached patch changed mac to ns in w3m-ems.diff.

From: Leo <sdl.web@xxxxxxxxx> said
Subject: [emacs-w3m:11035] patch: w3m-view-url-with-external-browser work better
Message-ID: <xbair5urdgvn.fsf@xxxxxxxxx>
Date: Mon, 31 Aug 2009 18:37:16 +0100

> emacs-w3m uses 'browse-url-default-browser' to open external browser.
> Unfortunately, that function is NOT meant to open a good external
> browser, in fact it looks more like a fallback. For example, on OS X, it
> launches X11 and then opens xterm just to say there's no lynx.
>
> The following patch will make w3m-view-url-with-external-browser work
> better on both OS X and Windows.

Thanks for your reports and patches.

I committed them to CVS HEAD with a little modification to keep
backward compatibilities for old emacsens.

--
Hideyuki SHIRAI (mailto:shirai@xxxxxxxxxxx)
Index: w3m-ems.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m-ems.el,v
retrieving revision 1.40
diff -u -r1.40 w3m-ems.el
--- w3m-ems.el	8 Dec 2008 05:07:25 -0000	1.40
+++ w3m-ems.el	1 Sep 2009 01:52:50 -0000
@@ -366,7 +366,7 @@

 ;;; Form buttons
 (defface w3m-form-button
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "lightgrey" :foreground "black"
      :box (:line-width 2 :style released-button))
     (((class color) (background light)) (:foreground "cyan" :underline t))
@@ -378,7 +378,7 @@
 (put 'w3m-form-button-face 'face-alias 'w3m-form-button)

 (defface w3m-form-button-mouse
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "DarkSeaGreen1" :foreground "black"
      :box (:line-width 2 :style released-button))
     (((class color) (background light)) (:foreground "cyan" :underline t))
@@ -390,7 +390,7 @@
 (put 'w3m-form-button-mouse-face 'face-alias 'w3m-form-button-mouse)

 (defface w3m-form-button-pressed
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "lightgrey" :foreground "black"
      :box (:line-width 2 :style pressed-button))
     (((class color) (background light)) (:foreground "cyan" :underline t))
@@ -671,7 +671,7 @@
   :type '(integer :size 0))

 (defface w3m-tab-unselected
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "Gray70" :foreground "Gray20"
      :box (:line-width -1 :style released-button))
     (((class color))
@@ -682,7 +682,7 @@
 (put 'w3m-tab-unselected-face 'face-alias 'w3m-tab-unselected)

 (defface w3m-tab-unselected-retrieving
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "Gray70" :foreground "OrangeRed"
      :box (:line-width -1 :style released-button))
     (((class color))
@@ -694,7 +694,7 @@
      'face-alias 'w3m-tab-unselected-retrieving)

 (defface w3m-tab-unselected-unseen
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "Gray70" :foreground "Gray20"
      :box (:line-width -1 :style released-button))
     (((class color))
@@ -705,7 +705,7 @@
 (put 'w3m-tab-unselected-unseen-face 'face-alias 'w3m-tab-unselected-unseen)

 (defface w3m-tab-selected
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "Gray90" :foreground "black"
      :box (:line-width -1 :style released-button))
     (((class color))
@@ -717,7 +717,7 @@
 (put 'w3m-tab-selected-face 'face-alias 'w3m-tab-selected)

 (defface w3m-tab-selected-retrieving
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "Gray90" :foreground "red"
      :box (:line-width -1 :style released-button))
     (((class color))
@@ -730,7 +730,7 @@
      'face-alias 'w3m-tab-selected-retrieving)

 (defface w3m-tab-background
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "LightSteelBlue" :foreground "black")
     (((class color))
      (:background "white" :foreground "black")))
@@ -740,7 +740,7 @@
 (put 'w3m-tab-background-face 'face-alias 'w3m-tab-background)

 (defface w3m-tab-selected-background
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "LightSteelBlue" :foreground "black")
     (((class color))
      (:background "white" :foreground "black")))
@@ -751,7 +751,7 @@
      'face-alias 'w3m-tab-selected-background)

 (defface w3m-tab-mouse
-  '((((type x w32 mac) (class color))
+  '((((type x w32 mac ns) (class color))
      :background "Gray75" :foreground "white"
      :box (:line-width -1 :style released-button)))
   "*Face used to highlight tabs under the mouse."
Index: w3m.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.1456
diff -u -r1.1456 w3m.el
--- w3m.el	25 Aug 2009 02:21:16 -0000	1.1456
+++ w3m.el	1 Sep 2009 01:52:50 -0000
@@ -1098,6 +1098,12 @@
 			  (eq 'w3m-browse-url
 			      (symbol-value 'browse-url-browser-function)))
 		      (cond
+		       ((and (memq system-type '(windows-nt ms-dos cygwin))
+			     (fboundp 'browse-url-default-windows-browser))
+			'browse-url-default-windows-browser)
+		       ((and (memq system-type '(darwin))
+			     (fboundp 'browse-url-default-macosx-browser))
+			'browse-url-default-macosx-browser)
 		       ((fboundp 'browse-url-default-browser)
 			'browse-url-default-browser)
 		       ((fboundp 'browse-url-netscape)