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

Re: TAB not jumping past <embed>



白井です。

From: Hideyuki SHIRAI (白井秀行) <shirai@xxxxxxxxxxx> 曰く
Subject: [emacs-w3m:10528] Re: TAB not jumping past <embed>
Message-ID: <20081209.230214.91199038.shirai.hideyuki@xxxxxxxxxxx>
Date: Tue, 09 Dec 2008 23:02:14 +0900 (JST)

>> - w3m-anchor-sequence が変わってない
>> - w3m-anchor-sequence が w3m-max-anchor-sequence にひとしい
>> - 1 番の w3m-anchor-sequence がある (ここは loop して最小を探すようにし
>>  てもいいかも)

previous-anchor も、今が '1' だったら、w3m-max-anchor-sequence
に移動した方が良いと思う、というパッチを書いてみました。青田のパッ
チも含みます。

# 最近 elisp も emacs-w3m もご無沙汰なので査読希望 ^^;;;

-- 
白井秀行 (mailto:shirai@xxxxxxxxxxx)

Index: w3m.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.1394
diff -u -u -r1.1394 w3m.el
--- w3m.el	5 Dec 2008 16:42:23 -0000	1.1394
+++ w3m.el	10 Dec 2008 03:45:43 -0000
@@ -6834,9 +6834,16 @@
 	(setq w3m-goto-anchor-hist nil)
 	(if (w3m-imitate-widget-button)
 	    (widget-forward 1)
-	  ;; Make a search from the beginning of the buffer.
-	  (goto-char (point-min))
-	  (w3m-goto-next-anchor)))
+	  (let ((hseq (w3m-anchor-sequence))
+		pos)
+	    ;; Make a search from the beginning of the buffer.
+	    (goto-char (point-min))
+	    (w3m-goto-next-anchor)
+	    (and (= hseq (w3m-anchor-sequence))
+		 (= hseq w3m-max-anchor-sequence)
+		 (setq pos (text-property-any
+			    (point-min) (point-max) 'w3m-anchor-sequence 1))
+		 (goto-char pos)))))
       (setq arg (1- arg))
       (if (member (w3m-anchor-sequence) w3m-goto-anchor-hist)
 	  (setq arg (1+ arg))
@@ -6853,8 +6860,9 @@
 	  (goto-char pos)
 	(setq pos (previous-single-property-change pos 'w3m-anchor-sequence))
 	(and pos (goto-char pos))))
-     ((or (not pos) (< hseq 2)) nil)
+     ((not pos) nil)
      (t
+      (if (= hseq 1) (setq hseq (1+ w3m-max-anchor-sequence)))
       (setq pos
 	    ;; hseq is not sequence in form.
 	    (catch 'loop