Last edit
Summary: Added a note about installing from elpa and a link to the package on marmalade-repo
Added:
> This package is now available from ELPA [http://marmalade-repo.org/packages/ascii/3.1]:
> M-x package-install <at the prompt, type 'ascii'>
This page describes package Lisp:ascii.el, by ViniciusJoseLatorre.
This package provides a way to display ASCII code on a window, that is, display in another window an ASCII table highlighting the current character code.
Maybe the name “ascii” is not a good name for this package, as this package also displays non-ASCII code, that is, character code which is greater than 255. It also displays characters codified in HTML (Á), quoted (=2F), escaped (\xFF) and Emacs Lisp character (?\^A).
This package is now available from ELPA [1]:
M-x package-install <at the prompt, type 'ascii'>
To use Lisp:ascii.el, insert in your ~/.emacs:
(require 'ascii)
Or:
(autoload 'ascii-on "ascii" "Turn on ASCII code display." t) (autoload 'ascii-off "ascii" "Turn off ASCII code display." t) (autoload 'ascii-display "ascii" "Toggle ASCII code display." t) (autoload 'ascii-customize "ascii" "Customize ASCII code display." t)
For good performance, be sure to byte-compile Lisp:ascii.el, e.g.
M-x byte-compile-file <give the path to ascii.el when prompted>
This will generate ascii.elc, which will be loaded instead of Lisp:ascii.el.
Lisp:ascii.el runs on GNU Emacs 20.4.1, 21, 22 and 23.
To activate AsciiMode, type:
M-x ascii-on RET
Or:
C-u 1 M-x ascii-display RET
To toggle AsciiMode, type:
M-x ascii-display RET
To customize AsciiMode, type:
M-x ascii-customize RET
You can also bind ‘ascii-display’, ‘ascii-on’, ‘ascii-off’ and ‘ascii-customize’ to some key, like:
(global-set-key "\C-c\C-a" 'ascii-on) (global-set-key "\C-c\C-e" 'ascii-off) (global-set-key "\C-c\C-t" 'ascii-display) (global-set-key "\C-c\C-c" 'ascii-customize)
If you’re using ‘mule’ package, a good usage example is to activate Lisp:ascii.el on emacs/etc/HELLO file.
Lisp:ascii.el has the following hook variable:
‘ascii-hook’ Below it’s shown a brief description of ascii options, please, see the options declaration in the code for a long documentation.
‘ascii-code’ ‘ascii-show-nonascii’ nil means converts to unibyte and display the ASCII code.‘ascii-show-nonascii-message’ nil means show a message when character code is above 255.‘ascii-window-size’ ‘ascii-display-code’ ‘ascii-keep-window’ nil means to keep ASCII window active.‘ascii-table-separator’ ‘ascii-ascii-face’ ‘ascii-non-ascii-face’ To set the above options you may:
a. insert the code in your ~/.emacs, like:
(setq ascii-window-size 6)
This way always keep your default settings when you enter a new Emacs session.
b. or use ‘set-variable’ in your Emacs session, like:
M-x set-variable RET ascii-window-size RET 6 RET
This way keep your settings only during the current Emacs session.
c. or use customization, for example:
Help option,Customize,Browse Customization Groups,Data group,Ascii groupThrough this way, you may choose if the settings are kept or not when you leave out the current Emacs session.
d. or see the option value:
C-h v ascii-window-size RET
and click the customize hypertext button.
Through this way, you may choose if the settings are kept or not when you leave out the current Emacs session.
e. or invoke:
M-x ascii-customize RET
and then customize AsciiMode options.
Through this way, you may choose if the settings are kept or not when you leave out the current Emacs session.
Thanks to Steven W. Orr <steveo@syslang.net> for patch to Emacs 23.
Thanks to Roman Belenov <roman@nstl.nnov.ru> for suggestion on dynamic ASCII table evaluation (depending on character encoding).
Thanks to AlexSchroeder for suggestion on customization.
apt-get install emacs-goodies-el (DebianPackage:emacs-goodies-el)