8

The doc string tells you this: "Mode line lighter for Github Notifier." You couldn't otherwise know for sure what the code is about, or what :eval means in that context. That is, you couldn't know without checking where, and how, that user option (variable) is actually used in the surrounding code. Normally, you could use i in the Elisp manual, ...


7

See the variable display-time-default-load-average n.b. I found that very quickly using C-hd to search for "load average".


6

If you want something that changes according to conditions then you pretty much need to use :eval, as in the second borrowed-code snippet. There are several things wrong with your code. buffer-modified-p is a function, not a variable; you forgot to quote some things; etc. Try this, and then compare it carefully with your code: (setq-default mode-line-...


5

Use function abbreviate-file-name. C-h f tells us: abbreviate-file-name is a compiled Lisp function in files.el. (abbreviate-file-name FILENAME) Return a version of FILENAME shortened using directory-abbrev-alist. This also substitutes ~ for the user's home directory (unless the home directory is a root directory) and removes automounter prefixes (see the ...


5

In git, if you hover the mouse over the mode line portion which starts "Git", you get more information such as the branch and update status. Looks like you've asked about mode line customization before here and here, so you should understand how to set values in the mode line. To get the status of the file, the function you want is: (vc-state (buffer-file-...


4

I don't have much experience customizing the mode line, but the following seems working from here. It displays the status of column-number-mode using ON and OFF, when you click the text, the mode will be toggled and the text will be updated as well. (defvar mode-line-column-number-map (let ((map (make-sparse-keymap))) (define-key map [mode-line mouse-...


4

This has nothing to do with defcustom: if you look at the doc string of defcustom it says: (defcustom SYMBOL STANDARD DOC &rest ARGS) In this case, the SYMBOL is github-notifier-mode-line, the DOC is "Mode line lighter for Github Notifier.", the ARGS are :type 'sexp :risky t :group 'github-notifier). The whole quoted expression is the ...


3

Run C-h f defcustom RET to show the help information for defcustom. This will tell you what arguments it expects. In particular, is says that this is the expected signature: (defcustom SYMBOL STANDARD DOC &rest ARGS) So this :eval thing is in the position of the argument called STANDARD. A few lines down it says: SYMBOL is the variable name; it should ...


2

The relevant Bookmark+ code is in functions bmkp-bmenu-mode-line-string (which creates the string, with its faces) and bmkp-bmenu-mode-line (which displays that in the mode-line), in file bookmark+-bmu.el. In the first of these functions you will see that the faces used are (1) bmkp-heading (for the sorting... information) and (2) one or more of these faces ...


2

You might try this (have not tested, because I don't installed window-numbering, it found it in source code https://github.com/nschum/window-numbering.el/blob/master/window-numbering.el#L228.) (setq-default mode-line-format (list " " '(:eval (window-parameter (selected-window) 'ace-window-path))...


2

The short answer is that powerline and delight are not directly compatible; but I've made a change to delight (new version 1.04) to make such integration possible in general, and I've added a delight-powerline library which builds on top of that to handle powerline specifically. Original answer follows... Well I tried your config. My first comment is that ...


2

When the code in your init file runs, there are no open files at all. vc-mode is only set when a file is finally opened and determined to be in version–controlled. This means that when it runs your init file and evaluates vc-mode, it puts the nil value into the list that goes into mode-line-format. That nil is then skipped whenever the mode line is displayed....


2

This is a solution I found, don't know if it's the right way, but it works : (defvar music-paused nil) (setq-default mode-line-format '( (:eval (if (eq music-paused t) (propertize " ⏸ " 'local-map (make-mode-line-mouse-map 'mouse-1 '(lambda () (setq music-paused nil)) )) (propertize " ⏵ " 'local-map (make-mode-line-mouse-map 'mouse-1 '(lambda () ...


1

Customize evil-mode-line-format to nil for that. Make sure to set it before Evil is enabled, as it only prevents the state indicator from being added to the mode line.


1

Just have a look at mode-line-modes in bindings.el. There you find for the major mode the value used in the following snippet: (setq mode-line-format `(:propertize ("" mode-name) help-echo "Major mode\n\ mouse-1: Display major mode menu\n\ mouse-2: Show help for major mode\n\ mouse-3: Toggle minor modes" mouse-face mode-line-...


1

Spaceline helped me customize the mode-line for Helm buffers (uses helm-alive-p).


1

Define a separate face, e.g., my-remote-buf, that you use to show remote buffers. Set mode-line-buffer-identification to use that face when the buffer is remote: (setq mode-line-buffer-identification (list (propertize (car mode-line-buffer-identification) 'face 'my-remote-buf)))


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