Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [characters]

A “character” in Emacs Lisp is nothing more than an integer. In other words, characters are represented by their character codes. A "character" is a different type from a "string".

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

How to treat ' (single-quote) as an ordinary character in HTML mode?

In a mode derived from html-mode, I want to remove the property that ' opens a quote. I found character properties in the manual, but the following in the .emacs init file does not work: (define-...
0 votes
1 answer
19 views

correct elisp code to create frameset registers?

If I evaluate this: (frameset-to-register "r") then r is created as an empty register (try to jump to it afterwards!), whereas I'd like it to contain the frameset configuration just like C-x ...
0 votes
1 answer
75 views

Nonexistent newline on display after using outorg

I'm using outorg to convert an elisp file to an org file and then back to an elisp file via (outorg-convert-to-org) and (outorg-convert-back-to-code). When I do this conversion I notice that it looks ...
2 votes
1 answer
36 views

Highlight prettified code

is there a way of highlighting a prettified phrase? Something like: (push '("\\qquad " . "⧢") prettify-symbols-alist) (highlight-phrase "⧢" 'shadow) (highlight-...
1 vote
1 answer
22 views

prettify text, escape characters

I have (appendq! prettify-symbols-alist '( ("_\\infty" . (? (bl . cl) ?∞)) ;; works ("_{-\\infty}" . (? (bl . cl) "-∞")) ;; does not work ...
5 votes
1 answer
3k views

Test char at point

I want to test if char at point is, let's say, "{" I found: (string= "{" (buffer-substring-no-properties (point) (+ 1 (point)))) and: (string-match-p "{" (what-cursor-...
4 votes
4 answers
2k views

Unicode input from keyboard (QMK) to Emacs

I have setup my QMK-enabled keyboard to output Unicode characters. In short, that was adding UNICODE_ENABLE = yes line to the rules.mk file and adding the following two lines to the config.h file. #...
5 votes
2 answers
781 views

Zero width space shows as underscore

Typing a zero-width space in TERMINAL emacs shows an underscore-ish character. How to make it showing nothing?
1 vote
0 answers
137 views

how to turn off special character?

I am pretty new to emacs. does anyone how to turn off special character, such as 渘 ? I tried to search online but no luck. emacs 28
1 vote
0 answers
36 views

print hex-code in string

I hope "*ielm*"/eval-print-last-sexp print "\x80", but the result is ELISP> "😅\x80" "😅\200" ; Unicode characters should be displayed normally. My current ...
3 votes
3 answers
288 views

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

Is there a way for lisp to convert a string with accented characters into a non-accented counterpart without mapping each and every character or is creating a manual map the only way to achieve this? ...
2 votes
4 answers
688 views

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

I know how to count the number of words. How to count the number of characters in the marked (selected) region?
1 vote
1 answer
179 views

How to get the character representation of an integer?

As it is well known, characters in emacs are indistinguishable from the integer number representing them, so much so that the form (eq ?A 65) returns t. Nevertheless, there are situations in which one ...
4 votes
3 answers
269 views

the Term “Hash Notation“ in the Elisp Manual

I'm reading GNU Emacs Lisp Reference Manual, and I see the phrase "hash notation". Two places in the document seem to have different interpretations, so I have 2 questions. 2.1 Printed ...
1 vote
1 answer
30 views

The number of characters in one line is very different from `window-width`

In my environment, I can only enter 130 single-byte characters in one line in the actual buffer while window-width is returning 160. Apparently window-width is returning columns, not characters. Is ...
1 vote
1 answer
29 views

insert-char completion says no matches, but inserts character anyway?

I'm using C-x 8 RET to insert a Unicode character. I enter the hex value -- for example, 201c -- and the minibuffer says "no matches". But if I just hit enter, the expected left double quote ...
3 votes
1 answer
112 views

How to implement character folding (stripping Arabic text from diacritics or tashkeel aka text normalization or cleansing) when doing search in Emacs?

This is a follow-up question on a previous one here looking for a solution to this very common task of searching for a string in a text irrespective of the vowel diacritics associated with. Arabic ...
1 vote
2 answers
88 views

How to prevent the character `^[(B` from being displayed on the compilation buffer

When I run the test feature of Rust in Emacs compilation mode, with ansi-color mode loaded, somehow the character ^[(B is always displayed like below: It looks quite annoying. Does anyone know how to ...
2 votes
2 answers
227 views

Programmatically invoking insert-char for compatibility with unicode insertion in Linux

I'm trying to enter unicode chars in emacs in the same manner I can anywhere else in linux, with the C-S-u string shortcut. Unfortunately, the function I've written does not work. (defun insert-char-c ...
1 vote
2 answers
297 views

Way to keybind «» in Emacs

I would like to be able to keybind « and » to easy key bindings. At the moment in Emacs the only way to write these latin quotation marks is this: C-x 8 < and C-x 8 > I tried the following, but ...
4 votes
2 answers
940 views

Inserting the plus minus unicode symbol ± as a keyboard macro

I insert the plus minus symbol ± frequently enough that I want to bind it to a key. From emacs -Q, I've tried this: (global-set-key (kbd "C-c m") "±") However, when I enter C-c m, the minibuffer ...
8 votes
3 answers
2k views

Fast unicode symbol insertion?

Currently, I'm inserting unicode characters (mainly math symbols) using TeX input method. This is cumbersome, since, for each character, I have to do following: Switch to TeX input method pressing C-...
7 votes
2 answers
978 views

Idiomatic way of extending keymap for inserting unicode symbols?

I often find myself needing to insert Unicode characters that have no default binding in iso-transl-ctl-x-8-map, i.e., characters that can't be inserted using C-x 8 followed by one or more letters/...
1 vote
1 answer
825 views

Adding unicode special characters

I wanted to add a latin capital O with circumflex [ô] to a file in emacs, but for some reason all my attempts lead to the character being replaced by a question mark ?. I tried : M-x insert-char ...
8 votes
1 answer
2k views

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. Is there a non-interactive way to insert a character given its Unicode name?
1 vote
1 answer
205 views

Emacs shows white space and newline characters

What kind of feature is this and how to disable it? I've used the wrong shortcut, but I don't remember what I pressed. When I kill the buffer and open the same file again I have those markers. The ...
0 votes
0 answers
29 views

read-char-by-name to start from Arrows or Dingbats

Using (read-char-by-name "utfname: ") how can I start from Arrows or Dingbats rather than painfully starting from "Null" "START OF HEADING", ...
0 votes
2 answers
71 views

Interactive selection with hex codes

I want a function that can take a utf hexcode from the user, and use it to change the glasses-separator in glasses-mode. When I use completing-read using a list of hexcodes things for well and the ...
0 votes
1 answer
54 views

How to get the value of an evaluated function and nothing else?

In emacs, when I evaluate an elisp function, I get the value plus other stuff. For example, if I evaluate (+ 2 2), I get this: 4 (#04, #x4, ?\C-d) How can I setup emacs to just return 4?
2 votes
0 answers
156 views

Cannot input some characters using linux compose key in Emacs GUI

I'm trying to write some exotic characters, like ĵ, ĉ or ŭ. I am using a qwerty US keyboard layout on a GNU linux machine, and I set up my compose key with setxkbmap -layout us -option compose:ralt. ...
0 votes
1 answer
53 views

read-char-from-minibuffer for optional argument

The following counts the number of opening (brcmk-beg) and closing (brcmk-end) braces. Having brcmk-end an optional argument, I would like to print $begmk nil $count-begmk 0 when the user either ...
1 vote
1 answer
56 views

Displaying character input with interactive declaration

I have the following code for reading two characters, using the interactive declaration. When I run the interactive function the input character is not being shown after the description string. (...
0 votes
1 answer
60 views

Command that accepts a string and a selected region

Would like to have a function that selects a string (from a list or from a user-defined string, using the mini-buffer) and a selected region. User would input (), [], {} specifying the opening and ...
0 votes
1 answer
73 views

How can I insert a character by its hex code in the minibuffer?

I've seen it's possible to insert characters with their hex codes by using ctrl+x 8 RET but on regular buffers. I'd like to insert in the minibuffer itself.
0 votes
0 answers
79 views

How to represent guillemets in `org-mode`: Unicode vs Org-mode entities)?

I was planning to write some narrative in Emacs, and after a bit of research it seems that the most complete solution may be org-mode. Now, I report direct speech using guillemets (« and »). The ...
2 votes
1 answer
101 views

Fast character replacement table for strings?

Does Emacs have an API for creating a character translation table which can then be efficiently applied to strings? A data structure for example that can be created using a set of source & ...
0 votes
1 answer
164 views

How to print character code in UTF-8 (ie ASCII codes)

With (let ((c (char-after (point)))) I get the code of the current character, and if I just do (message "%X" c) it prints the hexadecimal UTF-16 apparently. Is there a simple way to get ...
1 vote
0 answers
55 views

Set a non-default font for latin characters

I want to display phonetic alphabet characters alongside general text in a somewhat coherent manner. My default font is JetBrains Mono, so at the very least, the characters of the phonetic alphabet ...
1 vote
1 answer
249 views

How to remove characters causing encoding error

When I visit any file under a certain file tree, emacs spits out this error: These default coding systems were tried to encode text in the buffer ‘ *temp file*’: (utf-8 (7862 . 4194279) (14646 . ...
1 vote
1 answer
275 views

isdigit in elisp

I wanted to check that char is a digit by comparing its code with codes of 0 and 9, presuming that the digits codes are contiguous in code table: (let ((char ?\e)) (if (and (>= char ?\0) (<= ...
2 votes
1 answer
269 views

Characters in unicode-smp charset have no glyphs in Emacs 27.1, debian buster, using MesloLGS NF font

I'm using Gnu Emacs 27.1 GTK on Debian 10 from buster-backports. I'm also using the MesloLGS NF font that ships with zsh powerlevel10k, and has a heck of a lot of unicode characters. Nonetheless, ...
0 votes
1 answer
101 views

Display Δ in the *Shell Command Output* Buffer

I have a shell command I'm running from Emacs that has a Δ character in its output. How can I configure the *Shell Command Output* buffer to display UTF-8 by default? edit: There could also be ...
0 votes
0 answers
128 views

Uppercase instead of lowercase Greek letter shown in Julia mode

I am writing Julia code in Emacs, which allows the use of unicode characters in the source code. However, some symbols come out looking weird. For example the Greek letter nu: becomes: Does anyone ...
1 vote
1 answer
270 views

unescaped character literals detection error

When I reload my init file I get an error (or warning) saying unescaped character literals `?(', `?)', `?[', `?]' detected! What does this error (warning) mean and how can one fix it?
0 votes
2 answers
531 views

How to prevent unwanted characters such as`[OB` and `^[OA` and hanging at bottom or top point on scrolling?

I am using emacs under iTerm2 on Mac. I am using mouse to scroll up and down. Please not that I haven't face with the issue when I remotely connected into a linux machine, which has exactly same emacs ...
1 vote
1 answer
60 views

Recursion in char_charset?

I am looking at the C code for Emacs as of Emacs 26.1, file charset.c , defun char-charset (around line 2040), and file charset.h, macro CHAR_CHARSET (around line 380). I don't understand how in the ...
1 vote
1 answer
250 views

How to print escaped characters with princ

When Emacs shows an integer value in the minibuffer, or as an output to IELM, it shows three representations of it -- octal, hex and as character: ELISP> 10 10 (#o12, #xa, ?\C-j) This is really ...
2 votes
1 answer
303 views

Hide non-breaking spaces in org-mode, but show them in code blocks

Default Emacs settings show non-breaking spaces as a kind of underscore. This is very useful because these otherwise invisible characters would break code execution in many programming languages, and ...
0 votes
1 answer
98 views

How to replace a letter with its numerical alphabetic position?

I have this code: \author[p]{...} \author[bc]{...} \author[p]{...} \author[l,o]{...} \author[t,q]{...} \author[at]{...} \author[z]{...} \author[ak]{...} \author[az]{...} \author[ah,bq]{...} ... I ...
2 votes
3 answers
2k views

how to teach emacs that `'` (dead acute) + c = ç?

I've set up my keyboard layout in arch with localectl set-x11-keymap us pc104 intl By default, in this layout, the ' is a dead character. It is called a dead acute. In Portuguese, we are used to ...