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

Re: images have horizontal bar chopping them in half



jidanni@xxxxxxxxxxx writes:

> When one tabs to an image that is also a link, as those in
> http://en.wikipedia.org/wiki/James_Brown, they show up with a
> horizontal bar chopping them in half, at least using my
> http://jidanni.org/comp/configuration/.emacs-w3m
> emacs-w3m-version "1.4.263"

This is not a bug but a feature, showing you that the cursor is on an
anchor. Problem is that it seems there is no better way to highlight
images in Emacs. If there is one, we could change the face when the
anchor is an image like the following.

Regards,
Naohiro Aota

Index: w3m.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.1359
diff -u -r1.1359 w3m.el
--- w3m.el	19 May 2008 15:13:42 -0000	1.1359
+++ w3m.el	24 May 2008 17:02:16 -0000
@@ -882,6 +882,13 @@
 ;; backward-compatibility alias
 (put 'w3m-current-anchor-face 'face-alias 'w3m-current-anchor)
 
+(defface w3m-current-image-anchor
+  '((t ()))
+  "Face used to highlight the current image anchor."
+  :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-current-image-anchor-face 'face-alias 'w3m-image-current-anchor)
+
 (defface w3m-image
   '((((class color) (background light)) (:foreground "ForestGreen"))
     (((class color) (background dark)) (:foreground "PaleGreen"))
@@ -6613,7 +6620,10 @@
 	(setq beg pos)
 	(setq pos (next-single-property-change pos 'w3m-anchor-sequence))
 	(setq ov (make-overlay beg pos))
-	(overlay-put ov 'face 'w3m-current-anchor)
+	(overlay-put ov 'face
+		     (if (eq (get-text-property beg 'w3m-image-status) 'on)
+			 'w3m-current-image-anchor
+		       'w3m-current-anchor))
 	(overlay-put ov 'w3m-momentary-overlay t)
 	(overlay-put ov 'evaporate t)
 	t))))