Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Non-ASCII Characters

6 views
Skip to first unread message

Donald Peterson

unread,
Jul 25, 1993, 1:49:16 PM7/25/93
to

I need to be able to enter non-ascii characters (e.g. characters with
'foreign' accents etc. not on the keyboard) into text files, and also
to use them in search-and-replace. How can I do this in emacs?

Email replies preferred: D.M.Pe...@cs.bham.ac.uk

Tor Slettnes

unread,
Jul 25, 1993, 3:14:38 PM7/25/93
to D.M.Pe...@cs.bham.ac.uk
D.M.Pe...@cs.bham.ac.uk (Donald Peterson) writes:
I need to be able to enter non-ascii characters (e.g. characters with
'foreign' accents etc. not on the keyboard) into text files, and also
to use them in search-and-replace. How can I do this in emacs?


In emacs-18 (works for emacs-19 too):
Press Ctrl-Q, followed by the octal code for the character.
(You need an ISO-Latin-1 table).
The characters will show up as octal codes on the screen.

If you use particular codes often, you can define functions in
your .emacs file. I used to have the following functions and
assignments:

;;; Definitions for the norwegian letters <ae>, <oe> and <aa>
(defun insert-ae () (interactive (insert (format "%c" ?\346))))
(defun insert-oe () (interactive (insert (format "%c" ?\370))))
(defun insert-aa () (interactive (insert (format "%c" ?\345))))
(defun insert-AE () (interactive (insert (format "%c" ?\306))))
(defun insert-OE () (interactive (insert (format "%c" ?\330))))
(defun insert-AA () (interactive (insert (format "%c" ?\305))))

(global-unset-key "\^o")
(global-set-key "\^oe" 'insert-ae)
(global-set-key "\^oo" 'insert-oe)
(global-set-key "\^oa" 'insert-aa)
(global-set-key "\^oE" 'insert-AE)
(global-set-key "\^oO" 'insert-OE)
(global-set-key "\^oA" 'insert-AA)


In emacs-19, you are able to see the characters on the screen,
and also use more 'logical' keystrokes to enter the characters.
In your .emacs:

(standard-display-european 1) ; Shows extended chars. on the
; screen, instead of octal codes.

(load "iso-insert") ; Enables use of 'C-x 8' + a key combination
; E.g. C-x 8 " A for A diaeresis

; Check out the file .../emacs/lisp/iso-insert.el

Good luck!
-tor

Wolfgang

unread,
Jul 26, 1993, 8:58:47 AM7/26/93
to

Hello !


In article <TOR.93Ju...@netcom4.netcom.com>
t...@netcom4.netcom.com (Tor Slettnes) writes:

> [...]


>
> In emacs-18 (works for emacs-19 too):
> Press Ctrl-Q, followed by the octal code for the character.
> (You need an ISO-Latin-1 table).
> The characters will show up as octal codes on the screen.


If you use X-windows, you can do this with 'xmodmap', and
you will see the character itself on the screen (not the octal
code!), in Emacs 18 as well as in Emacs 19. You also don't
have to type 'CTRL-q <octal code>', you can get the characters
with one keystroke by using the 'ALT' key. Eg: hitting
'ALT-a' will insert the 'German Umlaut a'. It works for all
programs, not just for Emacs! If you like to know more about
this, just let me know.

Bye,

--

Wolfgang.

Wolfgang Mettbach (aka Ged@Padermud) ``` Address: Geroldstr. 14
email: wo...@uni-paderborn.de (o o) 33098 Paderborn Phone 05251-21685
---------------------------------oOO--(_)--OOo--------------------------------
The world of Padermud is at telnet 131.234.2.42 3000 (mud.uni-paderborn.de)
----------------------------------------------------------------------------
What the devil am I doing here?
Sounds like our Captain.
-- Picard and Riker, "Lonely Among Us", stardate 41249.3

Arnaldo Mandel

unread,
Jul 27, 1993, 6:27:25 AM7/27/93
to
Rather than xmodmap and C-x 8, there is a better solution to those who
learned to type on typewriters. On typewriters, in order to get an
accented letter by typing first the accent, then the letter. This
package implements that behavior. It can be made into a minor mode
quite easily (and requires some tweaking in the maps, IMHO); thus, one
can touch type with accents, and revert back to normal mode when
editing in a language with no accents, like English and C. This minor
mode has become of standard use in my site.

I suggest the emacs maintainers add this package, and the
corresponding minor mode, to the distribution - C-x 8 just doesn't
cut it.

;; el-accents.el -- electric accent keys
;;
;; SCCS Status : @(#)@ el-accents.el 1.3
;; Author : Johan Vromans
;; Created On : Tue Feb 5 09:58:05 1991
;; Last Modified By: Johan Vromans
;; Last Modified On: Tue Oct 15 18:39:07 1991
;; Update Count : 4
;; Status : OK
;;
;; Use pseudo-accents to allow "dead keys" like a typewriter.
;;
;; Pseudo-accents are:
;;
;; ' (minute) -> grave accent
;; ` (backtick) -> acute accent
;; " (second) -> diaeresis
;; ^ (caret) -> circonflexe
;;
;; In general:
;;
;; pseudo-accent appropriate letter -> accented letter
;; pseudo-accent space -> pseudo-accent
;; pseudo-accent pseudo-accent -> accent (if available)
;; pseudo-accent other -> pseudo-accent other
;;
;; Function "electric-accents" can be used to enable the dead keys, or
;; disable them if called with a non-null argument.
;;
;; The inserted codes are conformant to the ISO Latin-1 alphabeth.
;;
;; Thanks to: Dale <d...@math.mit.edu>
;;


..................................................................
Arnaldo Mandel \ a...@ime.usp.br (1st choice)
Computer Science Dep. \ ama...@cce.usp.br (2nd)
Universidade de S\~{a}o Paulo / mac...@fpsp.fapesp.br
S\~{a}o Paulo - SP - Brazil / (if all else fails)

0 new messages