Andreas @ MadFlex
May 05, 2009

Write exotic characters in Emacs

For example you need to write the Unicode-Character for an EM DASH (in Unicode-block 20 character 14).

So first change the input-method in Emacs to rfc1345 with C-x RET C-

Now the input-method for this buffer is rfc1345 and with & and the char-code we can enter every unicode character (for example &-M for the EM DASH).

All charcodes are listet in rfc1345 (i.e. http://www.faqs.org/rfcs/rfc1345.html)

With C-\ you can toggle back to the "normal" input-method.

Jan 12, 2009

Using Generic-Mode in Emacs

These tables are generated using a python script which extracts the data from Matlab files. To write every caption or heading only once I use a data file in which I store key:value-pairs.

Example file:

# comment
key-1: this is the snippet which reoccurs often.
key-2: and this is another one

To highlight the keys and the comments I use generic-mode (see in Emacswiki).:

(define-generic-mode 'chunkdata-mode
  '("#")
  nil
  '(("^[a-zA-Z0-9\-\_\,]+:" . 'font-lock-variable-name-face))
  nil
  nil
  "Majormode for my chunks.data-files")

To enable this I added:

# -*- mode:chunkdata -*-

in the first line of the data-file. Now all Comments are highlighted in dark-red and all keys in dark-yellow. The result is a much better readability.