help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

replace deprecated function ?


From: B. T. Raven
Subject: replace deprecated function ?
Date: Tue, 13 Feb 2018 12:16:19 -0600
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]