Emacs - HinTak/cxterm GitHub Wiki
Internalization in GNU emacs
The figure below illustrates 3 useful tricks.
- After setting Language Environment to "Chinese-GB", the effect for some
of the other commands changes. In particular, the default of
M-x set-input-method
changes from nothing (no default), tochinese-py-punct
. M-x describ-char
goes into split-screen, and showing information about the current character at the cursor position, how to input it in the current input method, what font is being used to display it, etc.- It is possible to tell emacs, after a file opened and the content looking wrong, to tell it to "Revisit this file immediately using specified coding system".
General tips:
C-x \
to toggle current input method and ascii.- You select the one you mean using keys such as
C-f
(forward),C-b
(backward),C-n
(next line),C-p
(previous line) (or the arrow keys), and digits,C-SPC
for current position .C-x 8 RET
(M-x insert-char
) prompts raw code points in hex. C-x 1
to go back to single screen.C-x o
to switch to other screen.
There are three ways of telling emacs that the current file is in, for example, GB2312 encoding:
LANG=zh_CN.GB2312 emacs ...
at launch-*- coding: gb2312 -*-
as part of the first line of the file, or equivalent at the end of file (see Chapter 33, Customization, Local Variables in files, Specifying File Variables):
/* Local Variables: */
/* coding: gb2312 */
/* End: */
-
It is possible to set Emacs Directory Variables for whole set of files in a directory.
-
"Set Language Environment" and "Set Coding Systems" (both), as above.
Cut and Paste with other applications: Emacs is clever enough and treats by default everything from X11
(as x-select-request-type
) in the order UTF8_STRING
, COMPOUND_TEXT
, STRING
, regardless and independent
of the current file buffer content.
Various useful things under M-x
-
describe-key
and press a key -
describe-char
describe the character under the cursor. -
(global-set-key [kp-5] 'goto-line)
to bind keypad-5 togoto-line
. -
It is not a good idea to rebind
ESC
(Meta
and\C-[
), see description of meta-prefix-char and Meta-Character Syntax, or \C-h, or \C-i quirk. Ordinary text terminals have no way of generating non-ASCII control characters.. Other Character Modifier Bits, Basic Char Syntax
EDT bugs
-
#50364 27.2; EDT mode Xmodmap related documentation needs updating
-
edt-mapper: When numlock is on, keypad keys are alias'ed to
[deletechar]
, '[up]', etc. TPU mapper generates[kp-delete]
,[kp-up]
, etc.
Latest Manuals:
Subset (hosted and copied here): Emacs Chapter 19, pdf, Emacs Lisp reference, Chapter 33, pdf, EDT emulation, pdf. Also Annnotated sample xmodmap file for re-mapping the Num_Lock as GOLD key.
Reference: Intro to emacs Lisp Programming and Emacs Lisp Reference
Emacs FAQ contains a whole sections on key bindings.
Built-in Help:
Old Versions
Package emacs25
is available on Ubuntu bionic (18.04LTS).
Older versions are under current, emacs21, emacs22, emacs23, emacs24, emacs25.
Some older packaging is missing dfsg-compliance.
Historical
Variable default-enable-multibyte-characters
is obsolete since 23.2. The variable enable-multibyte-characters
is buffer-local,
and cannot be set directly, but only via the function set-buffer-multibyte
.
Changes in Emacs 23.2:
*** Unibyte sessions are now considered obsolete.
This refers to the EMACS_UNIBYTE environment variable as well as the
--unibyte, --multibyte, --no-multibyte, and --no-unibyte command line
arguments. Customizing enable-multibyte-characters and setting
default-enable-multibyte-characters are also deprecated.