Hot answers tagged

11

There is nice package by TTN called aau2 which is available in GNU ELPA. I tried to test it. result is nice as you expected. M-x package-install RET ascii-art-to-unicode RET \select region/ M-x aa2u RET Edit: just for reference, here is mailing list link for an example. http://lists.gnu.org/archive/html/help-gnu-emacs/2014-05/msg00316.html


10

Here is a little fun with Unicode smiley faces. The en-dash visually becomes a black smiley face. The em-dash visually becomes a white smiley face. Note, some Emacs versions may not support the smiley face Unicode characters -- it is only meant to be a demonstration -- other Unicode characters can of course be chosen. Other faces can be used, and the ...


10

For some reason, Emacs isn't recognizing the file as UTF-8. You can force Emacs to reopen the file as UTF-8 by running the command C-x RET r (revert-buffer-with-coding-system) and entering utf-8. The reason why Emacs didn't recognize this file as UTF-8 (but recognizes other) is likely that it contains some invalid UTF-8 sequence. This sequence will still ...


9

You need the latex file to use \usepackage[utf8x]{inputenc} rather than the default \usepackage[utf8]{inputenc}. This works with standard (pdf)latex. For org export to generate this you have to set the variable org-latex-inputenc-alist accordingly. For example: (setq org-latex-inputenc-alist '(("utf8" . "utf8x"))) For the variable to be defined, you may ...


9

C-q 377 RET inserts the character with octal code 377 (aka LATIN SMALL LETTER Y WITH DIAERESIS). If you want to insert a byte instead of a character, you can do it with: M-: (insert (unibyte-string #o377)) RET As @legoscia mentioned, Emacs will probably ask you to use another coding system after inserting such a character, but you can choose utf-8 at that ...


9

To quote the docs: C-x = runs the command what-cursor-position, which is an interactive compiled Lisp function in simple.el. It is bound to C-x =. (what-cursor-position &optional DETAIL) Print info on cursor position (on screen and within buffer). Also describe the character after point, and give its character code in octal, decimal and ...


9

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 how to enter the diacritics. As always you can ask Emacs to show the documentation for a key with C-h K.


9

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 when called interactively (e.g. via C-x8RET or M-xinsert-charRET), as stated in its docstring: Interactively, prompt for CHARACTER. You can specify CHARACTER ...


8

As @wasamasa suggested, ido-ubiquitous should take care of completion when insert-char is used. There is a bug report that was closed in 2013, but I still see this behaviour with Emacs 24.4 and ido-ubiquitous version 20140904.1547, so I filed another bug report. EDIT: The maintainer of ido-ubiquitous wrote this: Ok, I figured out the problem. There are ...


8

This answer is written for Spacemacs 0.105.19 with default keybindings. Since you already know that Ctrl+v might be one way to do it, you can look at the documentation to understand what it does. In Insert mode, type Ctrl+h (help) then k (for describe-key) and then Ctrl+v. Amongst other things, this points out that The variable `read-quoted-char-radix' ...


8

Reading the GitHub discussion thread linked in @wvxvw’s comment, I discovered the variable inhibit-compacting-font-caches. Setting it to non-nil solves the issue: (setq inhibit-compacting-font-caches t) Now navigating point is fast. According to the variable’s documentation, inhibiting compacting font caches comes at the expense of more memory usage, which ...


7

There's no need to define a command to bind a unicode char: (define-key 'iso-transl-ctl-x-8-map "a" [?α]) binds α to C-x 8 a. While (define-key 'iso-transl-ctl-x-8-map (kbd "M-s") [?ς]) binds ς to C-x 8 M-s.


7

This occurs because Emacs uses different fonts for different parts of the Unicode character set. You can verify what font is being used by positioning the cursor over a character and pressing C-u C-x =. For instance, with my configuration over an ASCII character I get nil:-apple-Consolas-medium-normal-normal-*-14-*-*-*-m-0-iso10646-1 (#x88), but over a ⧺ I ...


7

Yes. There is a function key-description that takes a list or vector of keys and returns a string that describes them. This is used by the built-in help facilities such as describe-key and describe-function to display information about key bindings. It calls single-key-description on each element of the input list. Both of these are written in C rather than ...


6

Playing with Emacs’ fontsets definitions should be the answer. After reading Fontsets docs: The startup fontset will use the font that you specify, or a variant with a different registry and encoding, for all the characters that are supported by that font, and fallback on ‘fontset-default’ for other characters. If some characters appear on ...


6

I use agda-mode with a lot of mathematical symbols and have had the same problem. Used to be the only real solution was as @shosti suggests: customizing the font mappings. In my case, I had to disable a number of fonts because even though I had fonts installed with particular glyphs defined, emacs would often choose the wrong one (displaying boxes). Seemed ...


6

Use library highlight-chars.el to highlight any Unicode chars anyway you want. See Highlight Characters on Emacs Wiki. You can use command hc-highlight-chars to do highlight characters in four ways: individually using ranges using character classes (e.g. [:digit:]) using character sets (e.g. iso-8859-1 or lao) hc-highlight-chars prompts you for the ...


6

You can define your own key sequences with the elisp functions global-set-key and local-set-key. Thereby, it is recommended to use C-c and a single letter for user defined key sequences. (Otherwise it may be that you override key-sequences bound by other emacs-lisp libraries. Later you get into trouble when you discover that the library version of the key ...


6

You can use abbrev-mode to create strings that "expand" to the unicode characters you want. For example, the following abbrev table defines abbrevs for the first three lowercase letters of the Greek alphabet: (define-abbrev-table 'unicode-table '(("ualpha" "α") ("ubeta" "β") ("ugamma" "γ")) "Unicode characters I use all the time.") You can ...


6

By default, this is not possible (easiest way to see this is with C-h v char-fold-table RET and searching for ß — which you won't find). However, if you modify char-fold-table (the variable responsible for determining how folding occurs), then you can enable this. The structure of char-fold-table char-fold-table is a char-table — quoting the emacs manual:...


5

You'd just need to load proper unicode support in LaTeX via unicode-math and fontspec. Then you'd need to compile with xelatex or lualatex. See the docstring of the following variables: org-latex-packages-alist, org-latex-pdf-process and org-latex-compiler (the latter is introduced in Org 9). In the development version of Org you could do something like ...


5

After some trial and error, I managed to convert ÿ to the byte 377 using M-x recode-region, specifying that it was really in raw-text but was interpreted as latin-1. When saving the file, Emacs didn't want to save it as UTF-8, offering to save it as raw-text instead, which seems to have had the desired effect.


5

To get snow capped mountain included when you just type mount, you may want to do: (push '(unicode-name (styles substring)) completion-category-overrides) Actually, maybe this substring style should be enabled by default for unicode names, like it is for buffer names. Maybe you should lobby for it via M-x report-emacs-bug.


5

The character set used is in the ISO 10646 encoding, which includes the following double stroked letters C H N P Q R Z and no others. Unfortunately the TeX input method only defines shortcuts for N P R Z as describe-input-encoding will tell you. However, How can I add characters to an input method? shows you how to add extra sequences to this input ...


5

Do this, instead, starting with Emacs 26: (gethash "EURO SIGN" (ucs-names)) In other words, use something like this: (if (> emacs-major-version 25) (gethash "EURO SIGN" (ucs-names)) (cdr (assoc-string "EURO SIGN" (ucs-names) t))) Unfortunately, for people trying to provide backward-compatibility, they made an incompatible change in ucs-names, ...


5

For emacs to be able to combine successive characters, you need to be using a font that has support for both of the characters. As per the comments, in your case that was 'DejaVu Sans Mono'.


4

Another possibility would be to display line numbers and say the line number before the word, or, since looking over to get the exact line number would be bothersome, you could have the algorithm search within + or - 5 or 10 lines of the number you say. Or perhaps declare a region or function that you are working in and have all searches only look there. I ...


4

Library ucs-cmds.el can help. It provides a macro, ucsc-make-commands, for quickly creating a set of commands that insert Unicode characters. You provide a regexp to it, which is matched against all Unicode character names (in ucs-names). An insertion command is created for each of the characters whose name matches. (The command names are essentially the ...


4

I already had this problem in a different unanswered question here. I would expect different fonts at the same size to have the same heights, but this doesn't seem to be the case, so I will show my ad-hoc approach to fixing this. Leaving aside accents, and focusing only on plain characters, different fonts are necessary to display all the different ...


4

Names and code points used by insert-char come from the value of ucs-names, which is a (very long) alist of Unicode names and code points originating ultimately from C code. This list isn't populated during init, because doing so can take a little while, but during the first call to the function (ucs-names). If all you want to do is make Unicode 8 code ...


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