57 votes

How can I get a ruler at column 80?

Are there any better alternatives? Emacs 27 (officially released 2020-08-11) added support for a fill column indicator natively by way of the buffer-local minor mode display-fill-column-indicator-...
Basil's user avatar
  • 12.4k
12 votes
Accepted

Org mode: is it possible to display ONLINE images?

And again we have a use-case for image data not stored on harddisk. (The other two use-cases are base64 encoded images in org buffers and displaying previews of youtube videos.) Get org-yt and paste ...
Tobias's user avatar
  • 33.2k
10 votes

OTF ligature support in Emacs

emacs for now doesn't support ligatures (on OSX there is some support, but not on other platforms). However, emacs 24.4+ supports prettify-symbols-mode which in some ways is better than normal ...
Emmanuel Touzery's user avatar
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
Accepted

your emacs does not come with xwidget support... (Windows 10)

I don't use Emacs on Windows, nor do I use xwidgets, but I do know that Emacs has to be compiled with xwidgets (since some of its stuff is written in C) for it to work. Taking a cursory look at the ...
GDP2's user avatar
  • 1,350
8 votes

How to change line-number gutter width using display-line-numbers mode?

The built-in line numbering mechanism uses the text-area that is sandwiched between the left/right fringes and/or left/right margins, to the extent that fringes/margins exist. [What happens ...
lawlist's user avatar
  • 19.1k
7 votes
Accepted

How to display whole words as a different symbol?

Prettify-symbols-mode comes with emacs; here's a blog post about it. You need to add the substitution to prettify-symbols-alist in whatever mode you want it in. Here's an example for javascript-mode: ...
amitp's user avatar
  • 2,541
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
5 votes

Align columns in Org mode table with Japanese fonts

This depends on the fonts you are using. And I don't think Elisp has pixel level alignment capability. Org calculate width of string with string-width instead of length. string-width returns 1 for ...
Yasushi Shoji's user avatar
5 votes
Accepted

RTL text with left alignment and reversed line wrapping in Org mode

org-mode expressly sets bidi-paragraph-direction when the major-mode is enabled: (setq bidi-paragraph-direction 'left-to-right) Here is a link to the org-mode code section: https://github.com/emacs-...
lawlist's user avatar
  • 19.1k
5 votes
Accepted

Emacs Lisp to view text file like a table

You’re on pretty much the right track, though I am not very accomplished at writing modes myself. However, I feel compelled to point out that csv-mode can do this for you if you want. Open a buffer ...
db48x's user avatar
  • 18.1k
5 votes

Emacs Lisp to view text file like a table

One way to do (much of) what you want is as follows: You can force org-mode on the buffer visiting the file with M-x org-mode and use C-u C-u M-x org-table-convert-region to convert each line ...
NickD's user avatar
  • 29.8k
4 votes
Accepted

Display max line in bottom line (nox) (aka mode-line)

count-lines (also used by line-number-at-pos) is increasingly less efficient as the buffer grows in size/length, whereas (format-mode-line "%l") does not have those limitations -- however, there are ...
lawlist's user avatar
  • 19.1k
4 votes
Accepted

Everytime I open emacs with -nw my file is prepended with 0;276;0c. My screen realestate is also being cut in half

The file etc/PROBLEMS (part of emacs) has some information on this problem. ** Unexpected characters inserted into the buffer when you start Emacs. See e.g. http://debbugs.gnu.org/11129> This ...
YoungFrog's user avatar
  • 3,526
4 votes
Accepted

Change fill-column-indicator rule color immediately

The following three lines of code in this specific order will immediately visibly update the fci-rule-color -- in this example, I am using the color "red". (setq fci-rule-color "red") (fci-make-...
lawlist's user avatar
  • 19.1k
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
Accepted

Stop Emacs from updating display

You can let-bind the variable inhibit-redisplay for this purpose, so: (defun my-automatic-todo () (interactive) (let ((inhibit-redisplay t)) (let ((org-capture-entry `("z" "...
dieggsy's user avatar
  • 475
4 votes
Accepted

Replacing a string with symbols using font-lock?

Here's a code snippet that will make all occurrences of " / " appear as " ÷ " in the current buffer: (add-to-list 'font-lock-extra-managed-props 'display) (font-lock-add-keywords nil '((" \\(/\\) " ...
jpi's user avatar
  • 116
4 votes
Accepted

Uneven line numbers with display-line-numbers

This is what fixed my issue. All this is doing is, when the buffer is being setup for reading it would read the last line number and add the width of the number as the display-line-numbers-width. (...
sidharth arya's user avatar
3 votes

Show math formula in emacs when coding

TeXfrag texfrag shows doxygen-formulas embraced by \f[display formula\f] or \f$embedded formula\f$ as images. The regular expressions and also the functions for parsing the formulas can be customized....
Tobias's user avatar
  • 33.2k
3 votes

Change fill-column-indicator rule color immediately

I was looking for an example of setting fill-column-indicator font color in Emacs 27.1, and this page keeps coming up. As I eventually worked out what I needed I'm posting the answer here. (set-face-...
alls0rts's user avatar
  • 366
3 votes

Change fill-column-indicator rule color immediately

Here's the complete end-to-end solution I ended up with based on lawlist's answer. (defun my:color-is-closer-to-white-p (color) "Returns t if COLOR is closer to white than black." (< (color-...
Joe's user avatar
  • 1,322
3 votes
Accepted

redraw-display when focused

Add a hook to the focus event. (add-hook 'focus-in-hook 'redraw-display). Thanks to Håkon Hægland for the Answer!
Prgrm.celeritas's user avatar
3 votes
Accepted

Increase line-spacing on top

I believe you are looking for the line-height text property, as described in (elisp) Line Height, which see. This manual node describes the interactions between the properties line-height and line-...
Basil's user avatar
  • 12.4k
3 votes

How to display whole words as a different symbol?

While the current answer is useful, this example shows how to set many characters at once and enable globally when in graphical mode. (when local-cfg/use-prettify-symbols (add-hook 'rust-mode-...
ideasman42's user avatar
  • 8,806
3 votes

Hide mouse pointer while typing

You can use the mouse-avoidance-mode, see here for documentation. To test it simply enter M-x mouse-avoidance-mode and then select an option (see documentation link above) To have it permanently use ...
jue's user avatar
  • 4,576
3 votes

Prevent Emacs from resizing windows

Try the folowing after the windows are set up: (setq-default window-size-fixed t) The variable is buffer-local.
Jeff Spaulding's user avatar
3 votes
Accepted

prettify-symbols-mode and multi-character replacements?

I found a solution by looking into the implementation of ``prettify-symbols-mode''. ;; Special form for section etc. (let ((spec '(("\\\\part\\b" font-latex-sectioning-0-face "#") ...
kdb's user avatar
  • 1,561
3 votes

How can I find non-displayable unicode characters in a buffer?

Robert Pluim proposed already a solution. The credit for describe-char-display belongs to him. Here I detail what I meant in my comment to his answer. I've got the impression that this solution is ...
Tobias's user avatar
  • 33.2k
3 votes

Width of string as if it were displayed

As can be inferred from the question, a possible answer would be: (apply #'max (mapcar #'string-width (split-string STR "\n"))) but this may still not be sufficient depending on your particular ...
Stefan's user avatar
  • 26.4k

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