From: "Byung-Hee HWANG (황병희)" <soyeomul@doraji.xyz>
To: ding@gnus.org
Subject: Re: Custom Message-ID
Date: Mon, 15 Aug 2016 23:31:17 +0900 [thread overview]
Message-ID: <yw.87lgzy9k96.fsf@alex.chromebook> (raw)
In-Reply-To: <yu.86eg5qxhe6.fsf@student.uu.se> (Emanuel Berg's message of "Mon, 15 Aug 2016 15:59:13 +0200")
>> Anyway i want a Message-ID as below: (example)
>>
>> <yw.87jdfsfms7838.fsf@myhost.fqdn>
>
> [...]
> 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")))
Before i was struggling for finding it about 15 hours. Anyway now i got
it, solved it. Thanks Emanuel^^ and you are elisp expert, it is true;;
Sincerely,
--
^고맙습니다 감사합니다_^))//
next prev parent reply other threads:[~2016-08-15 14:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-14 12:27 Byung-Hee HWANG (황병희)
2016-08-14 13:41 ` Eric Abrahamsen
2016-08-15 14:07 ` Byung-Hee HWANG (황병희)
2016-08-15 16:30 ` Ted Zlatanov
2016-08-15 17:12 ` Emanuel Berg
2016-08-15 17:07 ` Andreas Schwab
2016-08-15 17:15 ` Emanuel Berg
2016-08-15 17:27 ` Emanuel Berg
2016-08-17 11:58 ` Byung-Hee HWANG (황병희)
2016-08-18 14:23 ` Byung-Hee HWANG (황병희)
2016-08-15 13:59 ` Emanuel Berg
2016-08-15 14:31 ` Byung-Hee HWANG (황병희) [this message]
2016-08-15 17:10 ` Emanuel Berg
2016-08-18 14:50 ` Byung-Hee HWANG (황병희)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yw.87lgzy9k96.fsf@alex.chromebook \
--to=soyeomul@doraji.xyz \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).