From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87139 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.gnus.general Subject: Re: Endless impression~ Gnus' citation style.. Date: Mon, 18 Jul 2016 21:44:49 +0200 Message-ID: <86vb027mtq.fsf@student.uu.se> References: <9FD4EC76-7C11-4C93-8059-EB305BA9583F@yw.doraji.xyz> <861t2r826h.fsf@student.uu.se> <87h9bn9cp1.fsf@yale.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1468871176 6649 80.91.229.3 (18 Jul 2016 19:46:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2016 19:46:16 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M35359@lists.math.uh.edu Mon Jul 18 21:46:01 2016 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bPEUH-0001Eu-Lw for ding-account@gmane.org; Mon, 18 Jul 2016 21:45:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.86_2) (envelope-from ) id 1bPETU-0003jU-Qw; Mon, 18 Jul 2016 14:45:08 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1bPETR-0003io-17 for ding@lists.math.uh.edu; Mon, 18 Jul 2016 14:45:05 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_2) (envelope-from ) id 1bPETO-0000kt-Eb for ding@lists.math.uh.edu; Mon, 18 Jul 2016 14:45:04 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1bPETL-0007ng-2D for ding@gnus.org; Mon, 18 Jul 2016 21:44:59 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bPETJ-0000Ov-LP for ding@gnus.org; Mon, 18 Jul 2016 21:44:57 +0200 Original-Received: from c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se ([85.230.225.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2016 21:44:57 +0200 Original-Received: from embe8573 by c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2016 21:44:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 67 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:SLQsKdv8UL2nojmuXPhcy8He7xw= X-Spam-Score: -4.2 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87139 Archived-At: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) writes: > That is not the normal style. The default is > to have message-citation-line-function as > message-insert-citation-line, which produces: > "Name" writes: Byung-Hee is even > saying OK, that! I wouldn't call that a "style" because it appears only once! But why not - in that case, this is the function that does it - (defun message-insert-citation-line () "Insert a simple citation line." (when message-reply-headers (insert (mail-header-from message-reply-headers) " writes:") (newline) (newline))) - which is in: /usr/share/emacs/24.4/lisp/gnus/message.el The OP will have to write a function that constructs the desired outcome, and then replace it, much like Indiana Jones with the pouch of sand and the golden idol! I already have a couple of functions to do that: ;; This file: http://user.it.uu.se/~embe8573/conf/emacs-init/match-data-format.el (defun make-match-list (num string) (let ((match (match-string num string))) (when match (cons match (make-match-list (1+ num) string) )))) (defun match-data-format (data match format-str) (save-match-data (string-match match data) (apply (function message) format-str (make-match-list 1 data)) )) ;; This file: http://user.it.uu.se/~embe8573/conf/emacs-init/gnus/article.el (defun gnus-article-header-value (header) "Get the value of HEADER for the current article." (with-current-buffer gnus-original-article-buffer (gnus-fetch-field header) )) So using those function, it can be done like this - only problem is, do really all "From" headers look the same? (defun goofy-citation-line () (let*((message-id (gnus-article-header-value "Message-ID")) (from (gnus-article-header-value "From")) (from-mail (match-data-format from "\\(.*\\) (" "<%s>")) (from-name (match-data-format from ".*(\\(.*\\))" "%s")) (all (format "In %s, %s %s writes:\n\n" message-id from-name from-mail)) (all-no-at (replace-regexp-in-string "@" " " all)) ) (insert all-no-at) )) -- underground experts united .... http://user.it.uu.se/~embe8573 Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic - so far: 58 Blogomatic articles -