From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/88860 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Adam_Sj=C3=B8gren?= Newsgroups: gmane.emacs.gnus.general Subject: Re: Message-ID's secret Date: Sat, 16 Nov 2019 16:16:22 +0100 Organization: koldfront - analysis & revolution, Copenhagen, Denmark Message-ID: <87h833zwah.fsf@tullinup.koldfront.dk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="183234"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+M37064@lists.math.uh.edu Sat Nov 16 16:16:47 2019 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iVzob-000lU1-5m for ding-account@gmane.org; Sat, 16 Nov 2019 16:16:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.92.3) (envelope-from ) id 1iVzoX-0006WU-Gd; Sat, 16 Nov 2019 09:16:41 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1iVzoU-0006Te-55 for ding@lists.math.uh.edu; Sat, 16 Nov 2019 09:16:38 -0600 Original-Received: from quimby.gnus.org ([95.216.78.240]) by mx1.math.uh.edu with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1iVzoS-0000kA-87 for ding@lists.math.uh.edu; Sat, 16 Nov 2019 09:16:38 -0600 Original-Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226] helo=blaine.gmane.org) by quimby.gnus.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iVzoL-0004Cz-BA for ding@gnus.org; Sat, 16 Nov 2019 16:16:32 +0100 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1iVzoK-000lGI-Ri for ding@gnus.org; Sat, 16 Nov 2019 16:16:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ OpenPGP: id=476630590A231909B0A0961A49D0746121BDE416; url=https://asjo.koldfront.dk/gpg.asc Mail-Follow-Up-To: never 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:88860 Archived-At: 황병희 writes: > Really i'm Gnus' fan so i'm wondering Gnus' message-id have some secret. Secret? > According my view: > gnu/linux start with "87" > darwin start with "m2" > windows-nt start with "86" or "83" > > I saw the source code in message.el but still i do not > understand. Somebody explain about that? This is the function you want to understand: (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 (random (ash 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 (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) (ash (% message-unique-id-char 25) 16)) 4) (message-number-base36 (+ (nth 1 tm) (ash (/ 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"))) One way to figure out what happens is to use the M-x edebug-defun command on the function, and then calling it. You will then be able to step through the function, seeing every return value along the way. Here is the manual: · https://www.gnu.org/software/emacs/manual/html_node/eintr/edebug.html It is quite handy! E.g. the "87" you see is due to your uid, from the line: (message-number-base36 (user-uid) -1)) Best regards, Adam -- "I wish *I* was a tiger!" Adam Sjøgren "A common lament." asjo@koldfront.dk