Gnus development mailing list
 help / color / mirror / Atom feed
* Development splash smoothing
@ 2011-03-26 18:51 Adam Sjøgren
  2011-03-28  8:01 ` Julien Danjou
  2011-03-29 17:56 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 7+ messages in thread
From: Adam Sjøgren @ 2011-03-26 18:51 UTC (permalink / raw)
  To: ding

The splash screen in the development version has nice cautionary colours
- created by taking the .xpm version of the logo and adjusting the
colours:

 * http://koldfront.dk/misc/gnus/before.png

As can be seen, the .xpm version of the logo isn't quite as smooth as
the .svg version.

Ever so slightly annoying.

If you are like me, you'd like nice drawings even - or perhaps
especially - when you are on the bleeding edge.

I figured that ought to be possible to hack around - .svg is a text
format, after all...

So, here is a patch, hobbled together using Google and guessing. A lot.

It does make the splash screen look nicer, though:

 * http://koldfront.dk/misc/gnus/after.png

And the colours are replaced. Woo.

Let me know what you think, and please don't hesitate to tear my elisp
apart. I have no idea what I am doing.

  Best regards,

     Adam


[PATCH] Use the svg logo if present, and replace colors in it.

 * gnus.el (gnus-group-startup-message): Prefer svg file and replace colors.
   (gnus-splash-svg-color-symbols): New function.
---
 lisp/gnus.el |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/lisp/gnus.el b/lisp/gnus.el
index 83a8cf7..b63741d 100644
--- a/lisp/gnus.el
+++ b/lisp/gnus.el
@@ -1042,12 +1042,15 @@ be set in `.emacs' instead."
                                          ((boundp 'image-load-path)
                                           (symbol-value 'image-load-path))
                                          (t load-path)))
-                  (image (find-image
-                          `((:type xpm :file "gnus.xpm"
+                  (image (gnus-splash-svg-color-symbols (find-image
+                          `((:type svg :file "gnus.svg"
+                                   :color-symbols
+                                   (("#bf9900" . ,(car gnus-logo-colors))
+                                    ("#ffcc00" . ,(cadr gnus-logo-colors))))
+                            (:type xpm :file "gnus.xpm"
                                    :color-symbols
                                    (("thing" . ,(car gnus-logo-colors))
                                     ("shadow" . ,(cadr gnus-logo-colors))))
-                            (:type svg :file "gnus.svg")
                             (:type png :file "gnus.png")
                             (:type pbm :file "gnus.pbm"
                                    ;; Account for the pbm's background.
@@ -1056,7 +1059,7 @@ be set in `.emacs' instead."
                             (:type xbm :file "gnus.xbm"
                                    ;; Account for the xbm's background.
                                    :background ,(face-foreground 'gnus-splash)
-                                   :foreground ,(face-background 'default))))))
+                                   :foreground ,(face-background 'default)))))))
              (when image
                (let ((size (image-size image)))
                  (insert-char ?\n (max 0 (round (- (window-height)
@@ -1102,6 +1105,20 @@ be set in `.emacs' instead."
     (setq mode-line-buffer-identification (concat " " gnus-version))
     (set-buffer-modified-p t)))
 
+(defun gnus-splash-svg-color-symbols (list)
+  "Do color-symbol search-and-replace in svg file"
+  (let ((type (plist-get (cdr list) :type))
+        (file (plist-get (cdr list) :file))
+        (color-symbols (plist-get (cdr list) :color-symbols)))
+    (if (and (string= type "svg"))
+        (let ((data (with-temp-buffer (insert-file file) (buffer-string))))
+          (mapc (lambda (rule)
+                  (setq data (replace-regexp-in-string
+                              (concat "fill:" (car rule))
+                              (concat "fill:" (cdr rule)) data))) color-symbols)
+          (cons (car list) (list :type type :data data)))
+       list)))
+
 (eval-when (load)
   (let ((command (format "%s" this-command)))
     (when (string-match "gnus" command)
-- 
1.7.4.1

-- 
 "Ge mig en vinterdrog, ge mig allt du har                    Adam Sjøgren
  Kom nu jag är kroniskt låg, bara mörkret hörs"         asjo@koldfront.dk




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

* Re: Development splash smoothing
  2011-03-26 18:51 Development splash smoothing Adam Sjøgren
@ 2011-03-28  8:01 ` Julien Danjou
  2011-03-28 12:08   ` Adam Sjøgren
  2011-03-29 17:56   ` Lars Magne Ingebrigtsen
  2011-03-29 17:56 ` Lars Magne Ingebrigtsen
  1 sibling, 2 replies; 7+ messages in thread
From: Julien Danjou @ 2011-03-28  8:01 UTC (permalink / raw)
  To: ding

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

On Sat, Mar 26 2011, Adam Sjøgren wrote:

> Let me know what you think, and please don't hesitate to tear my elisp
> apart. I have no idea what I am doing.

I like it.

> +(defun gnus-splash-svg-color-symbols (list)
> +  "Do color-symbol search-and-replace in svg file"
> +  (let ((type (plist-get (cdr list) :type))
> +        (file (plist-get (cdr list) :file))
> +        (color-symbols (plist-get (cdr list) :color-symbols)))
> +    (if (and (string= type "svg"))

(and) what ? seems the and is useless here. :)

> +        (let ((data (with-temp-buffer (insert-file file) (buffer-string))))
> +          (mapc (lambda (rule)
> +                  (setq data (replace-regexp-in-string
> +                              (concat "fill:" (car rule))
> +                              (concat "fill:" (cdr rule)) data))) color-symbols)
> +          (cons (car list) (list :type type :data data)))
> +       list)))
> +
>  (eval-when (load)
>    (let ((command (format "%s" this-command)))
>      (when (string-match "gnus" command)
> -- 
> 1.7.4.1

-- 
Julien Danjou
❱ http://julien.danjou.info

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

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

* Re: Development splash smoothing
  2011-03-28  8:01 ` Julien Danjou
@ 2011-03-28 12:08   ` Adam Sjøgren
  2011-03-29 17:56   ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 7+ messages in thread
From: Adam Sjøgren @ 2011-03-28 12:08 UTC (permalink / raw)
  To: ding

On Mon, 28 Mar 2011 10:01:18 +0200, Julien wrote:

> On Sat, Mar 26 2011, Adam Sjøgren wrote:
>> Let me know what you think, and please don't hesitate to tear my elisp
>> apart. I have no idea what I am doing.

> I like it.

Thanks! My number of lines/hour is really, really low, though :-)

>> +(defun gnus-splash-svg-color-symbols (list)
>> +  "Do color-symbol search-and-replace in svg file"
>> +  (let ((type (plist-get (cdr list) :type))
>> +        (file (plist-get (cdr list) :file))
>> +        (color-symbols (plist-get (cdr list) :color-symbols)))
>> +    (if (and (string= type "svg"))

> (and) what ? seems the and is useless here. :)

Good catch; I had some more in there earlier but removed (some) of it.


   Thanks!

    Adam

-- 
 "Der er et uendeligt mørke udenfor                           Adam Sjøgren
  Hvis blot man kigger op"                               asjo@koldfront.dk




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

* Re: Development splash smoothing
  2011-03-26 18:51 Development splash smoothing Adam Sjøgren
  2011-03-28  8:01 ` Julien Danjou
@ 2011-03-29 17:56 ` Lars Magne Ingebrigtsen
  2011-03-29 21:16   ` Adam Sjøgren
  1 sibling, 1 reply; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 17:56 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> [PATCH] Use the svg logo if present, and replace colors in it.

Great; applied.

Do you have Gnus git access?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Development splash smoothing
  2011-03-28  8:01 ` Julien Danjou
  2011-03-28 12:08   ` Adam Sjøgren
@ 2011-03-29 17:56   ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 17:56 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> (and) what ? seems the and is useless here. :)

Fixed.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Development splash smoothing
  2011-03-29 17:56 ` Lars Magne Ingebrigtsen
@ 2011-03-29 21:16   ` Adam Sjøgren
  2011-03-29 22:15     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Adam Sjøgren @ 2011-03-29 21:16 UTC (permalink / raw)
  To: ding

On Tue, 29 Mar 2011 19:56:35 +0200, Lars wrote:

> asjo@koldfront.dk (Adam Sjøgren) writes:

>> [PATCH] Use the svg logo if present, and replace colors in it.

> Great; applied.

Thanks!

> Do you have Gnus git access?

Yes, but I hesitate to use it until/unless I feel confident that the
change should go in.


  Best regards,

    Adam

-- 
 "Soon we'll have spent a whole month at sea,                 Adam Sjøgren
  splitting atoms for no apparent reason"                asjo@koldfront.dk




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

* Re: Development splash smoothing
  2011-03-29 21:16   ` Adam Sjøgren
@ 2011-03-29 22:15     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 22:15 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> Yes, but I hesitate to use it until/unless I feel confident that the
> change should go in.

Okidoke.  But things can be reverted if it turns out to be a mistake.
:-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

end of thread, other threads:[~2011-03-29 22:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-26 18:51 Development splash smoothing Adam Sjøgren
2011-03-28  8:01 ` Julien Danjou
2011-03-28 12:08   ` Adam Sjøgren
2011-03-29 17:56   ` Lars Magne Ingebrigtsen
2011-03-29 17:56 ` Lars Magne Ingebrigtsen
2011-03-29 21:16   ` Adam Sjøgren
2011-03-29 22:15     ` Lars Magne Ingebrigtsen

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