Gnus development mailing list
 help / color / mirror / Atom feed
From: "Adam Sjøgren" <asjo@koldfront.dk>
To: ding@gnus.org
Subject: Re: Message-ID's secret
Date: Sun, 17 Nov 2019 17:40:00 +0100	[thread overview]
Message-ID: <87k17yv4m7.fsf@tullinup.koldfront.dk> (raw)
In-Reply-To: <yw.87tv72ttdo.fsf@delta.birch.chromebook>

황병희 writes:

>>          (message-number-base36 (user-uid) -1))
>
> Sorry still i do not understand what that means.

Let's unpack inside-out:

,----[ C-h f user-uid RET ]
| user-uid is a built-in function in ‘C source code’.
| 
| (user-uid)
| 
|   Probably introduced at or before Emacs version 18.
|   This function does not change global state, including the match data.
| 
| Return the effective uid of Emacs.
| Value is a fixnum, if it’s small enough, otherwise a bignum.
`----

So we get the uid of the user running Emacs. If you're on a one-user
Linux-system, that's often 1000.

For example, on my Debian GNU/Linux machine:

  $ grep $USER /etc/passwd
  asjo:x:1000:1000:Adam Sjøgren,,,:/home/asjo:/bin/bash

my uid is 1000.

Now, the next function:

,----[ C-h f message-number-base36 RET ]
| message-number-base36 is a compiled Lisp function in ‘message.el’.
| 
| (message-number-base36 NUM LEN)
| 
| Not documented.
`----

Not documented, but we can guess what it does from the name - it takes a
number and a length as input, and converts it to base36.

Here is the entire function from message.el:

  (defun message-number-base36 (num len)
    (if (if (< len 0)
            (<= num 0)
          (= len 0))
        ""
      (concat (message-number-base36 (/ num 36) (1- len))
              (char-to-string (aref "zyxwvutsrqponmlkjihgfedcba9876543210"
                                    (% num 36))))))

As 1000 is 27*36 + 28*1, you can see it gets translated into "87" by
this function.

So there is no secret here.

> We can set other user-uid by setq?

No, but if you run Emacs as another user, with another uid, you get
another beginning of your Message-ID.


  Best regards,

    Adam

-- 
 "I wish *I* was a tiger!"                                     Adam Sjøgren
 "A common lament."                                       asjo@koldfront.dk
 




  reply	other threads:[~2019-11-17 16:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-16 14:56 황병희
2019-11-16 15:14 ` Andreas Schwab
2019-11-16 15:46   ` 황병희
2019-11-16 15:16 ` Adam Sjøgren
2019-11-17 15:28   ` 황병희
2019-11-17 16:40     ` Adam Sjøgren [this message]
2019-11-18 13:35       ` 황병희
2019-11-19  4:59       ` 황병희
2019-11-20  4:33         ` 황병희
2019-11-21 12:39           ` 황병희
2019-11-21 22:12             ` 황병희
2020-08-06  3:18               ` 황병희
2020-08-14  4:52                 ` 황병희
2020-09-09  3:06                   ` 황병희
2020-12-26  1:43                     ` Byung-Hee HWANG
2020-10-20 15:36       ` Zhiwei Chen

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=87k17yv4m7.fsf@tullinup.koldfront.dk \
    --to=asjo@koldfront.dk \
    --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).