Gnus development mailing list
 help / color / mirror / Atom feed
* How do I get bigger gravatars (setting gravatar-size doesn't cut it)?
@ 2010-11-29 17:12 Štěpán Němec
  2010-11-29 21:22 ` Štěpán Němec
  0 siblings, 1 reply; 5+ messages in thread
From: Štěpán Němec @ 2010-11-29 17:12 UTC (permalink / raw)
  To: ding


I wanted to try out the gravatar support, but 32 pixels is too tiny for
me. So I did the obvious thing, set `gravatar-size' to a bigger number
(64). And nothing happens. I still get the tiny size. I suspect the
problem is actually somewhere down the line outside gravatar.el, because
for testing I turned off caching and also browsing the URL produced by
`gravatar-build-url' gives me the correct newly set image size. Any
chance the picture is rescaled after being retrieved and before being
actually displayed in the Article buffer?

  Štěpán




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I get bigger gravatars (setting gravatar-size doesn't cut it)?
  2010-11-29 17:12 How do I get bigger gravatars (setting gravatar-size doesn't cut it)? Štěpán Němec
@ 2010-11-29 21:22 ` Štěpán Němec
  2010-11-30  9:22   ` Julien Danjou
  0 siblings, 1 reply; 5+ messages in thread
From: Štěpán Němec @ 2010-11-29 21:22 UTC (permalink / raw)
  To: ding

Štěpán Němec <stepnem@gmail.com> writes:

> I wanted to try out the gravatar support, but 32 pixels is too tiny for
> me. So I did the obvious thing, set `gravatar-size' to a bigger number
> (64). And nothing happens. I still get the tiny size. I suspect the
> problem is actually somewhere down the line outside gravatar.el, because
> for testing I turned off caching and also browsing the URL produced by
> `gravatar-build-url' gives me the correct newly set image size. Any
> chance the picture is rescaled after being retrieved and before being
> actually displayed in the Article buffer?

Hm. Turns out there is also `gnus-gravatar-size', which overrides
`gravatar-size'. Oh well.

ISTM better would be making `gnus-gravatar-size' nil by default, meaning
to just use `gravatar-size'. Thoughts?

  Štěpán



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I get bigger gravatars (setting gravatar-size doesn't cut it)?
  2010-11-29 21:22 ` Štěpán Němec
@ 2010-11-30  9:22   ` Julien Danjou
  2010-11-30 15:33     ` Štěpán Němec
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Danjou @ 2010-11-30  9:22 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

On Mon, Nov 29 2010, Štěpán Němec wrote:

> ISTM better would be making `gnus-gravatar-size' nil by default, meaning
> to just use `gravatar-size'. Thoughts?

Sounds right. Done.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I get bigger gravatars (setting gravatar-size doesn't cut it)?
  2010-11-30  9:22   ` Julien Danjou
@ 2010-11-30 15:33     ` Štěpán Němec
  2010-11-30 23:10       ` Katsumi Yamaoka
  0 siblings, 1 reply; 5+ messages in thread
From: Štěpán Němec @ 2010-11-30 15:33 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> On Mon, Nov 29 2010, Štěpán Němec wrote:
>
>> ISTM better would be making `gnus-gravatar-size' nil by default, meaning
>> to just use `gravatar-size'. Thoughts?
>
> Sounds right. Done.

Thanks.

Another glitch I noticed: you encode the name in
`gnus-gravatar-transform-address', but then don't decode it in
`gnus-gravatar-insert', meaning the search fails and gravatars don't
work for non-ascii names (such as mine ;-)).

You also don't need to bind `inhibit-read-only' to t inside
`gnus-with-article-headers', as the latter already does that.

This works for me:

diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el
index a6ecd43..beb661f 100644
--- a/lisp/gnus/gnus-gravatar.el
+++ b/lisp/gnus/gnus-gravatar.el
@@ -85,7 +85,8 @@ (defun gnus-gravatar-insert (gravatar header address category)
       (when (buffer-live-p (current-buffer))
         (gnus-article-goto-header header)
         (mail-header-narrow-to-field)
-        (let ((real-name (cdr address))
+        (let ((real-name (when (cdr address)
+                           (mail-decode-encoded-word-string (cdr address))))
               (mail-address (car address)))
           (when (if real-name             ; have a realname, go for it!
                     (and (search-forward real-name nil t)
@@ -101,8 +102,7 @@ (defun gnus-gravatar-insert (gravatar header address category)
             ;; example we were fetching someaddress, and then we change to
             ;; another mail with the same someaddress.
             (unless (memq 'gnus-gravatar (text-properties-at (point)))
-              (let ((inhibit-read-only t)
-                    (point (point)))
+              (let ((point (point)))
                 (unless (featurep 'xemacs)
                   (setq gravatar (append gravatar gnus-gravatar-properties)))
                 (gnus-put-image gravatar nil category)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I get bigger gravatars (setting gravatar-size doesn't cut it)?
  2010-11-30 15:33     ` Štěpán Němec
@ 2010-11-30 23:10       ` Katsumi Yamaoka
  0 siblings, 0 replies; 5+ messages in thread
From: Katsumi Yamaoka @ 2010-11-30 23:10 UTC (permalink / raw)
  To: ding

Štěpán Němec wrote:
> Another glitch I noticed: you encode the name in
> `gnus-gravatar-transform-address', but then don't decode it in
> `gnus-gravatar-insert', meaning the search fails and gravatars don't
> work for non-ascii names (such as mine ;-)).

I've done a similar fix already:
http://article.gmane.org/gmane.emacs.gnus.cvs/10735

But I thought we had better use another one like
`gnus-extract-address-components' that supports non-ASCII text
rather than `mail-header-parse-addresses'.

> You also don't need to bind `inhibit-read-only' to t inside
> `gnus-with-article-headers', as the latter already does that.

I'm going to review it.  Thanks.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-30 23:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-29 17:12 How do I get bigger gravatars (setting gravatar-size doesn't cut it)? Štěpán Němec
2010-11-29 21:22 ` Štěpán Němec
2010-11-30  9:22   ` Julien Danjou
2010-11-30 15:33     ` Štěpán Němec
2010-11-30 23:10       ` Katsumi Yamaoka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).