Nel mio caso ho dovuto farlo in modo interattivo. Le risposte precedenti mi ha dato le funzioni giuste per chiamare, quindi era solo una questione di avvolgendolo un po 'per renderli interattivi:
(defun func-region (start end func)
"run a function over the region between START and END in current buffer."
(save-excursion
(let ((text (delete-and-extract-region start end)))
(insert (funcall func text)))))
(defun hex-region (start end)
"urlencode the region between START and END in current buffer."
(interactive "r")
(func-region start end #'url-hexify-string))
(defun unhex-region (start end)
"de-urlencode the region between START and END in current buffer."
(interactive "r")
(func-region start end #'url-unhex-string))
aggiungere il sale, voglio dire si legano ai tasti a seconda dei gusti.
Questo è abbastanza buono per ora. È strano che usi solo una lista costante di 17 caratteri, però. Forse lo aggiusterò prima o poi. – Ken
'url-unhex-string' fa quello che vuoi. – Cheeso