From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/80921 Path: news.gmane.org!not-for-mail From: Philipp Haselwarter Newsgroups: gmane.emacs.gnus.general Subject: Re: Customize citation character Date: Thu, 19 Jan 2012 20:24:41 +0100 Message-ID: <87fwfbmr5y.fsf@nzebook.haselwarter.org> References: <87wr8pohnv.fsf@nzebook.haselwarter.org> <87ty3tqxf7.fsf@marauder.physik.uni-ulm.de> <878vl4riz3.fsf@live.com> <8739bcri5p.fsf@live.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1327001197 31176 80.91.229.12 (19 Jan 2012 19:26:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 19 Jan 2012 19:26:37 +0000 (UTC) Cc: ding@gnus.org To: Yagnesh Raghava Yakkala Original-X-From: ding-owner+M29203@lists.math.uh.edu Thu Jan 19 20:26:33 2012 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 1Rnxd0-0003SQ-6i for ding-account@gmane.org; Thu, 19 Jan 2012 20:26:30 +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 1RnxbR-0004aG-Fr; Thu, 19 Jan 2012 13:24:53 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1RnxbQ-0004a8-Bx for ding@lists.math.uh.edu; Thu, 19 Jan 2012 13:24:52 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RnxbP-000312-5C for ding@lists.math.uh.edu; Thu, 19 Jan 2012 13:24:52 -0600 Original-Received: from mailout-de.gmx.net ([213.165.64.22]) by quimby.gnus.org with smtp (Exim 4.72) (envelope-from ) id 1RnxbN-0007J0-EM for ding@gnus.org; Thu, 19 Jan 2012 20:24:49 +0100 Original-Received: (qmail invoked by alias); 19 Jan 2012 19:24:43 -0000 Original-Received: from 222.162.112.78.rev.sfr.net (EHLO nzebook.haselwarter.org) [78.112.162.222] by mail.gmx.net (mp070) with SMTP; 19 Jan 2012 20:24:43 +0100 X-Authenticated: #26138819 X-Provags-ID: V01U2FsdGVkX1+dg7cgVj6dt2kZ9+McyzQRHlEZBDpczfbrWgMV7S K3kbR+bZVVPOT2 X-NSA-Fodder: Sundevil Axis of Evil DRM Dateline NSA basement United Nations X-Meat: Lobster In-Reply-To: <8739bcri5p.fsf@live.com> (Yagnesh Raghava Yakkala's message of "Thu, 19 Jan 2012 03:15:46 +0900") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.92 (gnu/linux) X-Y-GMX-Trusted: 0 X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:80921 Archived-At: Thanks for all the input, here's what I've come up with so far: --8<---------------cut here---------------start------------->8--- (defcustom my-citation-look '("" "=E2=94=82" "") "(prefix citation-string suffix)" :group 'my) (defun my-citation-style nil (let ((inhibit-read-only t) (alist gnus-cite-face-list) cflist face gnus-cite-prefix-alist) (save-excursion (gnus-narrow-to-body) (gnus-cite-parse) (dolist (prefix gnus-cite-prefix-alist) ;(reverse (setq cflist (append cflist (list (car alist))) alist (cdr alist)) (let* ((current-cflist cflist) (depth (length cflist)) (len (length (car prefix))) (look (concat (car my-citation-look) (mapconcat (lambda (s) (propertize s 'face (pop current-cflist))) (make-vector depth (cadr my-citation-look)) "") (caddr my-citation-look)))) (dolist (line (cdr prefix)) (goto-char (point-min)) (forward-line (1- line)) (put-text-property (point) (+ (point) len) 'display look))))) (widen))) --8<---------------cut here---------------end--------------->8--- I'm quite satisfied with the results, although the usage of `gnus-cite-prefix-alist' could probably be better: Sometimes it becomes a little overzealous, for example in gmane.emacs.orgmode:51261 (OT: better way to link articles?). Someone with a better understanding of gnus internals could probably figure out how to fix this. --=20 Philipp Haselwarter