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

Re: the w3m keys should work even if on a gnus header



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)))