[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [h-e-w] Quotation marks and other special characters

From: Rob Davenport
Subject: Re: [h-e-w] Quotation marks and other special characters
Date: Wed, 14 Jun 2017 13:12:04 +0000

Hi Carl,

I see the same behavior on my 25.1.1 on Windows 7 64-bit.  So I checked the 
Emacs manual: :

To insert a non-graphic character, or a character that your keyboard does not 
support, first quote it by typing C-q (quoted-insert). There are two ways to 
use C-q:
- C-q followed by any non-graphic character (even C-g) inserts that character. 
For instance, C-q <DEL> inserts a literal ‘DEL’ character.
- C-q followed by a sequence of octal digits inserts the character with the 
specified octal character code. You can use any number of octal digits; any 
non-digit terminates the sequence. If the terminating character is <RET>, that 
<RET> serves only to terminate the sequence. Any other non-digit terminates the 
sequence and then acts as normal input—thus, C-q 1 0 1 B inserts ‘AB’.

The use of octal sequences is disabled in ordinary non-binary Overwrite mode, 
to give you a convenient way to insert a digit instead of overwriting with it.

To use decimal or hexadecimal instead of octal, set the variable 
read-quoted-char-radix to 10 or 16. If the radix is 16, the letters a to f 
serve as part of a character code, just like digits. Case is ignored.

A few common Unicode characters can be inserted via a command starting with C-x 
8. For example, C-x 8 [ inserts ‘ which is Unicode code-point U+2018 LEFT 
SINGLE QUOTATION MARK, sometimes called a left single “curved quote” or “curly 
quote”. Similarly, C-x 8 ], C-x 8 { and C-x 8 } insert the curved quotes ’, “ 
and ”, respectively. Also, a working Alt key acts like C-x 8; e.g., A-[ acts 
like C-x 8 [ and inserts ‘. To see which characters have C-x 8 shorthands, type 
C-x 8 C-h.

Alternatively, you can use the command C-x 8 <RET> (insert-char). This prompts 
for the Unicode name or code-point of a character, using the minibuffer. If you 
enter a name, the command provides completion (see Completion). If you enter a 
code-point, it should be as a hexadecimal number (the convention for Unicode), 
or a number with a specified radix, e.g., #o23072 (octal); See Integer Basics. 
The command then inserts the corresponding character into the buffer.

And those worked nicely.   I could do C-x 8 <RET> and select the character code 
point I wanted by name with completion (using ivy) easily.
It's not exactly the same as the alt-codes, but I assume the Alt key on Windows 
builds is handled differently on Emacs than other programs, changing it to Meta 
but that might be circumventing whatever other code normally handles inserting 
the 'alt code'.   

(The Alt+0147 doesn't work for me in Notepad - but that may be due to other 
software (like xkeymacs that I'm running, even when I disabled it), but I have 
seen the Alt+numseq work before.)   Are you trying to enter Unicode characters, 
or upper ASCII characters?

If you set read-quoted-char-radix to 16, then do C-q <hexval>, Emacs inserts 
the hex character types (sort of - I'm not positive which - I'm sure it depends 
on the coding system of the buffer and other factors, maybe someone else will 
have better information).

For accented characters try C-x 8 ' <char> and C-x 8 C-h to see a list of 
characters to type.  C-x 8 ' seems to be for entering accented characters (I'm 
just guessing here - again someone else can probably provide more correct info).


-----Original Message-----
From: help-emacs-windows [mailto:address@hidden On Behalf Of Carl Winbäck
Sent: Wednesday, June 14, 2017 7:27 AM
To: address@hidden
Subject: Re: [h-e-w] Quotation marks and other special characters

PS. Sorry about the HTML formatting. I thought Gmail defaulted to plain text, 
but apparently not.

On 14 June 2017 at 13:13, Carl Winbäck <address@hidden> wrote:
> I’m not able to use ”alt codes” to insert special characters when 
> using Emacs 25.1.1 on Windows 10 Pro 64-bit.
> E.g. if I press Alt+0147 in order to insert an opening double quote 
> (”), Emacs just displays C-u 147- in the mode line. This keyboard 
> shortcut works fine in other applications such as Notepad.
> Any ideas how to solve this?
> Best regards,
> Carl Winbäck

reply via email to

[Prev in Thread] Current Thread [Next in Thread]