From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/78103 Path: news.gmane.org!not-for-mail From: asjo@koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Newsgroups: gmane.emacs.gnus.general Subject: Development splash smoothing Date: Sat, 26 Mar 2011 19:51:59 +0100 Organization: koldfront - analysis & revolution, Copenhagen, Denmark Message-ID: <87vcz53eb4.fsf@topper.koldfront.dk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1301165623 12683 80.91.229.12 (26 Mar 2011 18:53:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 26 Mar 2011 18:53:43 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M26414@lists.math.uh.edu Sat Mar 26 19:53:39 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q3YcE-0002RE-Jx for ding-account@gmane.org; Sat, 26 Mar 2011 19:53:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Q3Yb1-0002D5-Sz; Sat, 26 Mar 2011 13:52:23 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Q3Yaz-0002Co-Kj for ding@lists.math.uh.edu; Sat, 26 Mar 2011 13:52:21 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1Q3Yav-0006Yq-8f for ding@lists.math.uh.edu; Sat, 26 Mar 2011 13:52:18 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Q3Yat-00065U-0v for ding@gnus.org; Sat, 26 Mar 2011 19:52:15 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q3Yas-0001q9-1k for ding@gnus.org; Sat, 26 Mar 2011 19:52:14 +0100 Original-Received: from 2505ds5-by.0.fullrate.dk ([95.166.24.143]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 Mar 2011 19:52:14 +0100 Original-Received: from asjo by 2505ds5-by.0.fullrate.dk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 Mar 2011 19:52:14 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 100 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 2505ds5-by.0.fullrate.dk Mail-Copies-To: never X-Now-Playing: A To The K, Black Sunday (Cypress Hill) X-Face: )qY&CseJ?.:=8F#^~GcSA?F=9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97,Q(^@xk}n4Ou rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S/IS9lMJ ^St'=VZBR Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:78103 Archived-At: 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