Hot answers tagged

4

Are there any better alternatives? Emacs 27 will support a fill column indicator natively by way of the buffer-local minor mode display-fill-column-indicator-mode and its global counterpart global-display-fill-column-indicator-mode. Here it is in action: Quoth (emacs) Displaying Boundaries: 14.15 Displaying Boundaries =========================== Emacs ...


3

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 needs (e.g. do you need to take into account proportional fonts, or possible presence of images, or ...), so you may like to expand your question by explaining what ...


3

It might be better to find fonts that can be used to display those characters, but if you really want to remove them: (defun delete-non-displayable () (interactive) (require 'descr-text) ;; for `describe-char-display' (save-excursion (goto-char (point-min)) (while (not (eobp)) (if (or (eolp) (looking-at "\t") (...


2

One option would be to use the built-in compile mechanism: set the variable compilation-scroll-output to a non-nil value with (setq compilation-scroll-output t); type M-x compile; and use whatever command-line is needed.


2

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 more efficient and has at least the same level of simplicity as his solution. But maybe such a statement is subjective. (defun delete-non-displayable () "...


2

I believe you are looking for the variable disable-point-adjustment. You will want to dead its docstring to better understand how you want to use it (i.e. you'll have to reset it every time point "enters" one of those overlays).


1

Well, this was embarassing. It turned out that putting text properties is way faster than deleting and inserting text. Other answers and suggestions are still welcome though :)


1

I'm not sure about the feasibility of this. First, I believe this requires a backwards font on the system. I'm no expert on how text is actually rendered but, speaking generally, text is rendered using a "base description", such as a vector mapping. This base information is contained in a font file, such as a .ttf. Without some mapping, Emacs doesn't ...


1

If I understand correctly, Emacs is that tool. Let me illustrate. In the following Ctrl + x is denoted as C-x and Alt + x is denoted as M-x (this is the standard Emacs notation). Open a new instance of Emacs. You can create splits, similarly to screen. To create a vertical split, press C-x 3. To create a horizontal split, press C-x 2. Do that and your ...


1

Since fill-column-indicator is quite heavy, this solution shows a character to the right of the current line. So when you're typing you can see the line limit before you exceed it. This defines the minor-mode hl-line-margin-mode: ;; Global, ensures one active margin for the active buffer. (defvar hl-line-margin--overlay nil) (defun hl-line-margin--...


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