Skip to main content
14 votes
Accepted

Insert character by its Unicode name

From the documentation of insert-char, I cannot see why (insert-char "GREEK SMALL LETTER EPSILON") doesn't work. It doesn't work because insert-char understands Unicode character names only ...
Basil's user avatar
  • 12.5k
13 votes
Accepted

Translate ae to ä on non-German keyboard

You should be able to press C-\ (toggle-input-method) and give it german-postfix as an argument if asked (or with prefix) and then be able to type as you described. The minibuffer will show you hints ...
p_wiersig's user avatar
  • 1,096
13 votes
Accepted

Zero width space shows as underscore

Refer to C-hig (elisp)Glyphless Chars By default the zero-width characters are displayed using the thin-space display method which will "Display a thin space, 1-pixel wide on graphical displays, ...
phils's user avatar
  • 51.8k
11 votes
Accepted

How can I ask emacs to show me (visually) invisible characters like CR LF?

Check out M-xwhitespace-mode and M-xcustomize-group RETwhitespace By default it is set up to visually emphasise spaces, tabs, and line endings, but you can tune it to eg leave spaces alone.
rpluim's user avatar
  • 5,365
10 votes
Accepted

Is there a more efficient alternative to search-forward when searching for a single character?

I have run the following benchmarks on GNU Emacs 27.0.50 (build 14, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2018-02-21 without customisations, i.e. by starting Emacs with the -Q flag. ...
Basil's user avatar
  • 12.5k
10 votes
Accepted

Test char at point

Use char-after like so: (eq ?{ (char-after))
phils's user avatar
  • 51.8k
10 votes

Showing bytes as hexadecimal escapes rather than octal escapes

edit: With Emacs 26.1 or later, it's a (setq display-raw-bytes-as-hex t) away. No, you can't. The display of unprintables above the printable ASCII range is hardcoded in xdisp.c: if (CHAR_BYTE8_P (...
wasamasa's user avatar
  • 22.2k
9 votes

Translate ae to ä on non-German keyboard

Without switching input methods there is direct access to all the german extra characters via C-x 8 ". In particular C-x 8 " a gives ä C-x 8 " A gives Ä etc. and C-x 8 " s gives ß Similarly C-x 8 ' ...
Andrew Swann's user avatar
  • 3,576
8 votes
Accepted

isdigit in elisp

Remove the backslashes before e, 0 and 9. (let ((char ?e)) (if (<= ?0 char ?9) (message "It's a digit") (message "It's not a digit"))) With the backslashes: \e is ...
aadcg's user avatar
  • 1,248
7 votes

Showing bytes as hexadecimal escapes rather than octal escapes

I figured it out thanks to the answer by Gilles and the 2010/2011 thread on gnu.emacs.help called “How switch from escaped octal character code to escaped HEX?” (Google Groups, Nabble). The details ...
ShreevatsaR's user avatar
6 votes
Accepted

What are the ?\(, ?\[, ?\{ symbols in emacs lisp?

Emacs represents characters with the ?a syntax (or ?\X for special characters, where X is one of them). (characterp "a") ; => nil (characterp ?a) ; =&...
Dan's user avatar
  • 33.2k
6 votes
Accepted

How do you type a space character in Spacemacs?

Spacemacs uses evil-mode which is a VI emulation layer. Evil-mode adds VI modal editing to spacemacs. In a nutshell modal editing has different modes where keybindings do different things. This is ...
Aquaactress's user avatar
  • 1,453
6 votes
Accepted

Way to keybind «» in Emacs

I tried the following, but apparently the quotation mark is interpreted as a macro: [...] You’re almost there, « and » are non-ASCII characters with codes above 127, so you have to use vectors ...
d125q's user avatar
  • 1,463
6 votes
Accepted

Convert accented characters to non-accented counterparts (character folding)

I don't know if it will manage all the non-ascii characters in your input file, but get-char-code-property is able to deal with all the cases you show. The doc string C-h v get-char-code-property says:...
NickD's user avatar
  • 31.4k
5 votes
Accepted

Make Emacs short keys work in different language

There is a package for that -- reverse-im (https://github.com/a13/reverse-im.el) It does what you want with one exception -- it doesn't work for magit menus and other packages that uses a kind of non-...
Maxim Kim's user avatar
  • 1,766
5 votes

Make Emacs short keys work in different language

You can add a host of remappings of the form (define-key function-key-map [?\C-ь] [?\C-x]) See also https://stackoverflow.com/questions/10639429
Stefan's user avatar
  • 26.5k
5 votes
Accepted

Non-greedy regex not working

The problem is not about using non-greedy matching. It is about which chars you're matching. Specifically, you want to match 《 followed by any number of non-《 chars, followed by IJ》. This is a ...
Drew's user avatar
  • 78.1k
4 votes
Accepted

Typing composite characters (e.g. diacritics) in emacs

This is a Dead Keys problem, and it's mentioned in the Emacs wiki. All the workarounds explained there solve the issue.
C2H5OH's user avatar
  • 181
4 votes

Replace certain multibyte characters

Most likely your file is actually not using latin-1, yet your Emacs tries to decode it as if it were using latin-1. Try C-x RET r windows-1252 RET to see if it fixes your problem. If it does, you'll ...
Stefan's user avatar
  • 26.5k
4 votes
Accepted

Showing bytes as hexadecimal escapes rather than octal escapes

You can do it with display tables. This may be a little clumsy and I haven't investigated how this might interfere with packages that use display tables for their own purposes, but the basic use case ...
Gilles 'SO- stop being evil''s user avatar
4 votes

Inserting the plus minus unicode symbol ± as a keyboard macro

You can get what you want with (global-set-key (kbd "C-c m") [177]) or if you prefer (global-set-key (kbd "C-c m") [?±]) Another solution uses the package key-chord which allows you to assign ...
Aidan Schofield's user avatar
4 votes
Accepted

Inserting the plus minus unicode symbol ± as a keyboard macro

With respect to why you saw what you saw: As Eli Zaretskii said in a reply to bug report #33829, the string is interpreted as a keyboard macro, and Emacs "interprets ±, which is a single byte with ...
Drew's user avatar
  • 78.1k
4 votes
Accepted

unescaped character literals detection error

Section 2.3.3.1 Basic Char Syntax of the Elisp manual says: The usual read syntax for alphanumeric characters is a question mark followed by the character; thus, ‘?A’ for the character ‘A’, ‘?B’ for ...
db48x's user avatar
  • 18.5k
4 votes
Accepted

How to count the number of characters in the marked (selected) region?

The command name count-words is a bit misleading. It shows the number of words. But, it also counts the number of lines and the number of characters. An output illustration: Region has 1 line, 51 ...
Pedro Delfino's user avatar
4 votes

the Term “Hash Notation“ in the Elisp Manual

Just for the second question: The “Hash Notation” is just a kind of notation using “#”. The mark “#” is named “hash mark”, so there is nothing to do with “hash function”.
Segrece's user avatar
  • 83
3 votes
Accepted

insert a single character

Keybindings need to refer to commands, which means you need to wrap your code in a lambda form. Also this is Lisp, so you don't need to surround the arguments to a function in parentheses. That all ...
rpluim's user avatar
  • 5,365
3 votes
Accepted

shell-command and C-h

On old teletypewriters, the BS control character, written ^H, \008 or \b, would backspace the print head by one character position. Underlining could be achieved by overstriking a character with an ...
jch's user avatar
  • 5,780
3 votes

Translate ae to ä on non-German keyboard

You could have a look at key-seq or key-chord. Both lets you bind keys pressed together to a command, so if you press "ae" at the same time, you can bind it to "ä".
Erik Sjöstrand's user avatar
3 votes
Accepted

Finding English Letters in a multilingual document

[:ascii:] char class can help. C-M-% to query replace regexp \(\ *\)\([[:ascii:]]*[a-zA-z]\) with \1\\lr{\2} If new line character must not be included into sentence then change regexp to replace to ...
muffinmad's user avatar
  • 2,330
3 votes
Accepted

Recursion in char_charset?

This isn't recursive, because there are actually three bits of code in play. First there is the Lisp function char-charset, then there is the CHAR_CHARSET macro, and finally there is the C function ...
db48x's user avatar
  • 18.5k

Only top scored, non community-wiki answers of a minimum length are eligible