Enter Unicode by Decimal

Here's a piece of code that lets you inpute unicode by its decimal number

(defun replace-current-word-as-decimal-unicode-char ()
  "Replace current word as decimal number by a corresponding Unicode character.
If there's a text selection, use that as input."
  (let (bds p1 p2 inputStr )
    (if (region-active-p)
          (setq p1 (region-beginning))
          (setq p2 (region-end)) )
        (setq bds (bounds-of-thing-at-point 'word)  )
        (setq p1 (car bds))
        (setq p2 (cdr bds)) ) )

    (setq inputStr (buffer-substring-no-properties p1 p2)  )

    (delete-region p1 p2 )
    (ucs-insert (string-to-number inputStr) ) ) )

Popular posts from this blog

11 Years of Writing About Emacs

does md5 creates more randomness?

Google Code shutting down, future of ErgoEmacs