0

I customized org-tag-alist using the built-in customization interface. This stored the values in ("tag") . <ascii key value>) pairs like this:

  ("ez" . 90)
  ("pin" . 73)
  ("per" . 61)
  ("inprog" . 78)
  ("maybe" . 66)

Is there any way to view this data with the ascii codes converted to characters, like this?

  ("ez" . ?Z)
  ("pin" . ?I)
  ("per" . ?=)
  ("inprog" . ?N)
  ("maybe" . ?B)
4
  • 2
    Not sure whether it makes a difference in this case, but you might want a character and not a string: ("ez" . ?Z) ...
    – NickD
    Oct 5, 2021 at 15:08
  • What @NickD said. If you really want strings, please edit your question, including its title, to reflect that it's not about chars but about strings.
    – Drew
    Oct 5, 2021 at 15:51
  • Do you actually use single-character abbreviations for 200 tags?
    – NickD
    Oct 5, 2021 at 16:19
  • @NickD Yes, I want characters. I've corrected the the question. No, I don't have keys assigned for all 200 tags. Oct 5, 2021 at 19:34

1 Answer 1

3

Just a replace regexp :

M-x query-replace-regexp \([[:digit:]]\{2\}\) → \,(format "?%c" (string-to-number \1))

instead of (string-to-number \1)you could prefer \#1 .

2
  • 1
    See my comment on the question: you might need to change the format.
    – NickD
    Oct 5, 2021 at 15:13
  • That character regexp is exactly what I was looking for. Using 'format' with 'string-to-number' was the missing piece of the puzzle for me. Oct 5, 2021 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.