all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* replace deprecated function ?
@ 2018-02-13 18:16 B. T. Raven
  2018-02-13 19:27 ` Emanuel Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: B. T. Raven @ 2018-02-13 18:16 UTC (permalink / raw)
  To: help-gnu-emacs

In order to convert arabic numerals to superscripts (for example in 
plaintext to refer to footnotes)I have been using the following function 
for a few years:

(defun num-to-supnum () ;; M-x sup
     "Replace digits with superscript digits."
   (interactive)
   (let ((start (point)))
     (save-excursion
       (query-replace-regexp-eval "[1234567890]"
                                  '(cdr (assoc 
(match-string-no-properties 0)
                                               '(("1" . "¹") ("2" . "²") 
("3" . "³") ("4" . "⁴") ("5" . "⁵")
                                                 ("6" . "⁶") ("7" . "⁷") 
("8" . "⁸") ("9" . "⁹") ("0" . "⁰"))

                                   ))
                                  nil start (point-max))
)))

But I notice that query-replace-regexp-eval is no longer considered 
kosher. How should this be rewritten for Emacs ver. 25? Especially I 
would like a function that is more immediately understandable than what 
I have now.

Thanks,

Ed


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-02-16 20:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-13 18:16 replace deprecated function ? B. T. Raven
2018-02-13 19:27 ` Emanuel Berg
2018-02-13 20:00   ` Emanuel Berg
2018-02-13 22:41     ` B. T. Raven
2018-02-13 23:19       ` Joost Kremers
2018-02-13 23:26       ` Emanuel Berg
2018-02-13 23:33         ` Emanuel Berg
2018-02-14  2:36         ` Yuri Khan
     [not found]         ` <mailman.9079.1518575794.27995.help-gnu-emacs@gnu.org>
2018-02-14  3:34           ` Emanuel Berg
     [not found]       ` <mailman.9067.1518563981.27995.help-gnu-emacs@gnu.org>
2018-02-14 23:04         ` B. T. Raven
2018-02-16 16:57           ` Emanuel Berg
2018-02-16 20:19             ` B. T. Raven
2018-02-13 21:14 ` Kaushal Modi
     [not found] ` <mailman.9061.1518556487.27995.help-gnu-emacs@gnu.org>
2018-02-14 23:31   ` B. T. Raven

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.