[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: the w3m keys should work even if on a gnus header
- From: Katsumi Yamaoka <yamaoka@xxxxxxx>
- Date: Mon, 26 Dec 2011 18:52:24 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 11707
- References: <b4mr4zsyu03.fsf@xxxxxxx> <878vlz6etc.fsf@xxxxxxxxxxx>
In [emacs-w3m : No.11706] jidanni@xxxxxxxxxxx wrote:
> "what would be the standard best way to jump to the first image
> from *Subject*"? "h C-n C-n C-n }" ?
So, how about making the summary `h' command move the cursor to
the place where the emacs-w3m keys are available?
(defadvice gnus-summary-select-article-buffer (after jump-to-html-part
activate)
"Jump to an html part that emacs-w3m rendered, if any."
(unless (get-text-property (point) 'mm-inline-text-html-with-w3m)
(let ((pos (text-property-any (point-min) (point-max)
'mm-inline-text-html-with-w3m t)))
(gnus-goto-char pos))))
If you want the cursor to move to the first image, use this.
(defadvice gnus-summary-select-article-buffer (after jump-to-1st-image
activate)
"Jump to the first image that emacs-w3m rendered, if any."
(let ((pos (text-property-not-all (point-min) (point-max) 'w3m-image nil)))
(gnus-goto-char pos)))