4

@NickD provided a good answer: use a face. OP's comment to Nick's answer says that he'll try to write a function that, given a string, returns a propertized string. Such functions already exist: propertize does that, and so does add-face-text-property. For example: (setq ss (propertize "abcde" 'face '(:foreground "red"))) or (setq ss &...


3

You need to create a string with the appropriate face. You do that by attaching a face text property to the string, giving it value of some face (predefined or defined for the specific purpose - you can look at all the predefined faces with M-x list-faces-display and pick one from there, or you can define your own face). E.g. here's a snippet to use a ...


3

It appears that the dashes are caused by the variable mode-line-end-spaces, which is the last item in mode-line-format by default. The default value of mode-line-end-spaces is (:eval (unless (display-graphic-p) "-%-")), which explains why the dashes only appear in terminal Emacs but not in GUI Emacs. This seems to remove the dashes, but I'm not ...


2

Refer to the manual: C-hig (elisp)Properties in Mode Or in the online manual (which is always for the most recent stable release of Emacs): https://www.gnu.org/software/emacs/manual/html_node/elisp/Properties-in-Mode.html I think there's no point in quoting an excerpt here -- you need to read the whole page.


1

Following @lawlist advise, using :box attribute for mode-line-inactive made it. The mode lines images shown in the question are from inactive frames. The second image shows an inactive frame with a mode line that does not render the straight lines. Using: (set-face-attribute 'mode-line-inactive nil :box t) renders the straight line with foreground color: ...


1

Disclaimer: I did not find a way to integrate it into the Spacemacs intended use of packages. Solution Adding this snippet to my dotspacemacs/user-config: (use-package doom-modeline :ensure t :init (doom-modeline-mode 1) :config ;; Enable flashing mode-line on errors (doom-themes-visual-bell-config) ;; Corrects (and improves) org-mode's native fontification....


1

Revisiting this old topic, (string-to-number (format-mode-line "%l") still holds up quite well against (line-number-at-position). I found it is also highly cached for "nearby" line positions. For example, operating on /usr/dict/words (236k lines here): (let* ((buf (get-buffer "words")) (win (get-buffer-window buf)) ...


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