Do or can we have some info in the modeline (is it called modeline in lem ?) like so to show the encoding:
Do or can we have some info in the modeline (is it called modeline in lem ?) like so to show the encoding:
Emacs:
With details:
Notepad++:
The line break format should be a useful information to display, too?
Next step could be to be able to actually change the encoding, line break format?
Originally posted by @rpx99 in https://github.com/lem-project/lem/issues/850#issuecomment-1647275515
I can give a few hints.
Yes it is called modeline too.
There is the file src/modeline.lisp, defining:
- the list of everything to display:
*modeline-status-list*it can be any element that is print-able, or a function - some attributes to style the elements
- a function to add a custom element to it:
modeline-add-status-list.
This worked:
LEM> (modeline-add-status-list "-lol-")
Then I wondered how to find the encoding.
LEM> (apropos "encoding")
gave a lot of results, searching the ones with "lem" I got: buffer-encoding, and it seems to work:
LEM> (lem-base::buffer-encoding (find-file-buffer "lem.asd")) ;; if lem.asd is open
;; => <#LEM-ENCODINGS/UTF-8::UTF-8 {xyz}>
I press Enter on it and I see in the inspector that it has two slots: BOM and END-OF-LINE (value: :LF).
See src/base/unicode.lisp with the encoding base class, and lib/encodings/utf-8.lisp with (defclass utf-8 (encoding) …).
Ready for a PR? :D