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

Re: Support for link-numbering



面白いので、ほんのほんのちょっとだけ、現実逃避。。。

From: Katsumi Yamaoka <yamaoka@jpl.org> さん曰く
Subject: [emacs-w3m:06623] Re: Support for link-numbering
Message-ID: <b9yk70jdtuc.fsf@jpl.org>
Date: Wed, 14 Apr 2004 14:14:19 +0900

> > ;; どちらにしても現実逃避時間は使い果たしたので,しばらく対応はできま
> > ;; せん.あとはよろしくお願いします.
> 
> I see.  You need to make an effort at your main work.

1. Emacs21 では積極的に色をつけるようにした。
2. Emacs20 だと、元の色を消しちゃうので小細工。

# トグルさせるよいキーはないかいな。。

-- 
白井秀行 (mailto:shirai@meadowy.org)

--- w3m-link-numbering.el.orig	Wed Apr 14 17:56:23 2004
+++ w3m-link-numbering.el	Wed Apr 14 17:57:21 2004
@@ -42,6 +42,12 @@
   :group 'w3m
   :type 'hook)
 
+(defface w3m-link-numbering-face 
+  '((((class color) (background light)) (:foreground "gray60"))
+    (((class color) (background dark)) (:foreground "gray50")))
+  "Face of link number."
+  :group 'w3m-face)
+
 (defvar w3m-link-numbering-mode-map
   (let ((keymap (make-sparse-keymap)))
     (substitute-key-definition 'w3m-view-this-url
@@ -80,9 +86,14 @@
       (let ((i 0))
 	(while (w3m-goto-next-anchor)
 	  (when (w3m-anchor)
-	    (let ((overlay (make-overlay (point) (1+ (point)))))
-	      (overlay-put overlay 'w3m-link-numbering-overlay (incf i))
-	      (overlay-put overlay 'before-string (format "[%d]" i)))))))))
+	    (let ((overlay (make-overlay (point) (1+ (point))))
+		  (num (format "[%d]" (incf i))))
+	      (when (featurep 'w3m-e20)
+		(overlay-put overlay 'face (get-text-property (point) 'face)))
+	      (put-text-property 0 (length num) 'face 'w3m-link-numbering-face num)
+	      (overlay-put overlay 'w3m-link-numbering-overlay i)
+	      (overlay-put overlay 'before-string num)
+	      (overlay-put overlay 'evaporate t))))))))
 
 (defun w3m-view-numbered-link (&optional arg)
   "Display the page pointed to by the specified link."