Loading ...
Sorry, an error occurred while loading the content.

212Character entities

Expand Messages
  • Norman Walsh
    Oct 3, 2003
    • 0 Attachment
      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      FWIW, I hacked a bit more at my Emacs code for dealing with Unicode:

      * Added a function to insert characters by Unicode name. Don't
      remember the ISO entity name for "triple prime"? No worries, hit
      C-t u type "trip<tab>pr<tab><enter>" and in it goes.

      * Added a similar function for ISO entity names.

      * Added a glyph list. Inserting literal Unicode characters is
      great, if they display properly. If not, I'd rather see the
      numeric character reference.

      * If the character occurs in an XML name, then I need the real
      character even if I can't see it. For those cases, each of the
      functions takes a prefix arg. In other words, C-u C-t u.

      * Adapted sgml-input so that it's sensitive to the glyph list. My
      new xml-input watches what you type and automatically replaces
      ISO entity names with appropriate characters.

      In other words, typing é automatically inserts an "e"
      while typing ‴ inserts ‴ because I don't have a
      glyph for it in my emacs setup.

      * The ISO entity names are all table driven; you can use any
      mneumonics you like.

      * I added code to construct a real Emacs pull-down menu (in
      addition to or instead of the pop-up menu) for any special
      characters that you'd like to access that way.

      See http://nwalsh.com/emacs/xmlchars/ and/or
      http://norman.walsh.name/2003/10/03/xmlunicode

      I have the following in my .emacs file:

      ;;; XML Characters

      ;; Two #'s because I've got # bound to quoted-insert
      (defvar unicode-charref-format "&##x%x;")

      (setq unicode-character-list-file "/home/ndw/emacs/unichars.el")
      (load-file "/home/ndw/emacs/xmlunicode.el")

      (defun bind-nxml-mode-keys ()
      (set-language-environment "utf-8")
      (define-key nxml-mode-map "\"" 'unicode-smart-double-quote)
      (define-key nxml-mode-map "\'" 'unicode-smart-single-quote)
      (define-key nxml-mode-map [menu-bar unichar]
      (cons "UniChar" unicode-character-menu-map))
      (set-input-method 'xml))

      (add-hook 'nxml-mode-hook 'rng-validate-mode)
      (add-hook 'nxml-mode-hook 'bind-nxml-mode-keys)

      (define-key ctl-t-map "c" 'unicode-character-menu-insert)
      (define-key ctl-t-map "e" 'unicode-character-shortcut-insert)
      (define-key ctl-t-map "u" 'unicode-character-insert)
      (define-key ctl-t-map "i" 'iso8879-character-insert)

      ;;; End of XML Characters

      Be seeing you,
      norm

      - --
      Norman Walsh <normyahoo@...> | The Future is something which
      http://nwalsh.com/ | everyone reaches at the rate of
      | sixty minutes an hour, whatever
      | he does, whoever he is.--C. S.
      | Lewis
      -----BEGIN PGP SIGNATURE-----
      Version: GnuPG v1.2.3 (GNU/Linux)
      Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

      iD8DBQE/fa2kOyltUcwYWjsRAt+lAJ0TJxQW0749D14fBG2xP2v2EtuI0QCfQc5+
      14LPm+O+SLNjoR7RKGaboyc=
      =i7Q5
      -----END PGP SIGNATURE-----
    • Show all 25 messages in this topic