From: Emanuel Berg <incal@dataswamp.org>
To: emacs-devel@gnu.org
Subject: Re: Unhelpful text in C-h v search-default-mode
Date: Fri, 29 Dec 2023 11:58:22 +0100 [thread overview]
Message-ID: <87frzlp969.fsf@dataswamp.org> (raw)
In-Reply-To: ZY6Y_3mO-Ny5xn0l@ACM
Alan Mackenzie wrote:
> Incidentally, why do we need the long string of hex digits
> in the subr names F616e....6461_anonymous_lambda_109?
> These are simply the ASCII codes for "anonymous_lambda"
Impressive that you just saw that!
I had to spend a lot of time before I even realized the
initial "F" is for function, i.e. not part of the hex string.
You just made one mistake, hex 2d is actually the hyphen, "-".
Yeah, this is what happens to people who rely on skills.
I found the code one the web and spent some time adopting it
to my style. But the credit for solving the problem belongs to
the SX user Inaimathi (see URL below).
As a side note, I know not everyone likes cl-lib and `cl-loop'
in particular but here at least I am very appreciative of the
below solution, style aspects not the least.
;;; -*- lexical-binding: t -*-
;;
;; this file:
;; https://dataswamp.org/~incal/emacs-init/hex.el
;;
;; original code:
;; https://stackoverflow.com/a/12007656
(require 'cl-lib)
(defun decode-hex (str)
(apply #'concat
(cl-loop
for i from 0 to (1- (/ (length str) 2))
for hex-byte = (substring str (* 2 i) (* 2 (1+ i)))
collect (format "%c" (string-to-number hex-byte 16)) )))
;; (decode-hex "616e6f6e796d6f75732d6c616d626461") ; anonymous-lambda
(provide 'hex)
--
underground experts united
https://dataswamp.org/~incal
next prev parent reply other threads:[~2023-12-29 10:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 9:45 Unhelpful text in C-h v search-default-mode Alan Mackenzie
2023-10-25 6:43 ` Juri Linkov
2023-12-29 7:12 ` Juri Linkov
2023-12-29 7:21 ` Emanuel Berg
2023-12-29 7:50 ` Eli Zaretskii
2023-12-29 7:54 ` Eli Zaretskii
2023-12-30 17:40 ` Juri Linkov
2023-12-29 10:01 ` Alan Mackenzie
2023-12-29 10:58 ` Emanuel Berg [this message]
2023-12-30 17:43 ` Juri Linkov
2023-12-31 3:23 ` Emanuel Berg
2023-12-29 11:45 ` Eli Zaretskii
2023-12-29 20:19 ` Andrea Corallo
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=87frzlp969.fsf@dataswamp.org \
--to=incal@dataswamp.org \
--cc=emacs-devel@gnu.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.