From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87239 Path: news.gmane.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.gnus.general Subject: Re: Custom Message-ID Date: Mon, 15 Aug 2016 15:59:13 +0200 Message-ID: References: <8737m78ri3.fsf@alex.chromebook> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1471269640 16282 195.159.176.226 (15 Aug 2016 14:00:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 15 Aug 2016 14:00:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+M35459@lists.math.uh.edu Mon Aug 15 16:00:35 2016 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZIRO-0003tr-Kc for ding-account@gmane.org; Mon, 15 Aug 2016 16:00:34 +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 1bZIQN-0007po-Gv; Mon, 15 Aug 2016 08:59:31 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1bZIQK-0007pL-35 for ding@lists.math.uh.edu; Mon, 15 Aug 2016 08:59:28 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_2) (envelope-from ) id 1bZIQI-0005W6-3Z for ding@lists.math.uh.edu; Mon, 15 Aug 2016 08:59:27 -0500 Original-Received: from [195.159.176.226] (helo=blaine.gmane.org) by quimby.gnus.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1bZIQG-0008Ag-Ng for ding@gnus.org; Mon, 15 Aug 2016 15:59:24 +0200 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bZIQF-00011e-7H for ding@gnus.org; Mon, 15 Aug 2016 15:59:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 121 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:efECAliDnuD75NQeeHQgMVbhyxg= List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87239 Archived-At: Byung-Hee HWANG "(황병희)" wrote: > Firstly, i would like to give "Big Thanks" to > Jorge and Emanuel about two weeks ago, thanks > to them, i got my style's citiation in Gnus. > That is so happy. Well, obviously you are welcome, but thank us even more by making sure always to process the information (even when it doesn't help or you don't agree), that way, helping you solve problem A will given time and effort prepare you to solve problem O without help, and with even more time and efforts you can help someone else - perhaps even us - solve yet another problem! > Today i have more question. > > Really i am literary man rather than computing > man. You can be both! Start today! > In Message-ID of Gnus, i want to put a prefix > "yw" into front of Message-ID. The "yw" is > special to me. That is all. But i failed to > search a way. > As you know, i am not ... elisp expert Who is? :) > I searched google, and i looked some .el > files in gnus directory. Maybe message.el > seems to have hints. But i don't know what > key is. I don't think this is a problem that a lot of people have solved because it is in the mageo-mythical domain :) > Anyway i want a Message-ID as below: (example) > > There are 93 occurrences of "Message-ID" in the Gnus manual, and 8 in the "message manual" (or info file). It is a good start and probably a quick check (open the file in Emacs, then do normal search, or use the Emacs info interface if you are comfortable with that). 93 emacs /usr/share/info/emacs-24/gnus.info 8 emacs /usr/share/info/emacs-24/message.info The Message-ID header "contains a unique identifier for this electronic mail message. This is constructed by using the originator's domain name for the domain component along with a locally generated string". [1, p. 96] Now, if something is unique, and you append something to it, is there a hazard the result won't be unique? Well, it depends, but I think it should be safe. Here is the code you need, from /usr/share/emacs/24.4/lisp/gnus/message.el.gz starting at line 5544, with only one change (at line 15, or "5559"). ;; If you ever change this function, make sure the new version ;; cannot generate IDs that the old version could. ;; You might for example insert a "." somewhere (not next to another dot ;; or string boundary), or modify the "fsf" string. (defun message-unique-id () ;; Don't use microseconds from (current-time), they may be unsupported. ;; Instead we use this randomly inited counter. (setq message-unique-id-char (% (1+ (or message-unique-id-char (logand (random most-positive-fixnum) (1- (lsh 1 20))))) ;; (current-time) returns 16-bit ints, ;; and 2^16*25 just fits into 4 digits i base 36. (* 25 25))) (let ((tm (current-time))) (concat "yw." (if (or (eq system-type 'ms-dos) ;; message-number-base36 doesn't handle bigints. (floatp (user-uid))) (let ((user (downcase (user-login-name)))) (while (string-match "[^a-z0-9_]" user) (aset user (match-beginning 0) ?_)) user) (message-number-base36 (user-uid) -1)) (message-number-base36 (+ (car tm) (lsh (% message-unique-id-char 25) 16)) 4) (message-number-base36 (+ (nth 1 tm) (lsh (/ message-unique-id-char 25) 16)) 4) ;; Append a given name, because while the generated ID is unique ;; to this newsreader, other newsreaders might otherwise generate ;; the same ID via another algorithm. ".fsf"))) [1] @book{internet-message, title = {The Internet Message: Closing the Book with Electronic Mail}, author = {Marshall Rose}, publisher = {Prentice-Hall}, year = 1993, ISBN = {0-13-092941-7}, } -- underground experts united .... http://user.it.uu.se/~embe8573 Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic - so far: 66 Blogomatic articles -