I'm trying to have my mode-line to display a "(modified)" string instead of the *
mark. To do that, I make a test with buffer-modified-p
but this seems to be always true for "special" buffers as well (such as for example completion list or org agenda). What would be the proper way to do the test (i.e. files that have been modified by me) ? Here is the relevant part of my code: '(:eval (if (buffer-modified-p) "%b (modified)" "%b"))
Solution:
'(:eval (if (and (or buffer-file-name
(string= (buffer-name) "*scracth*"))
(buffer-modified-p))
"%b (modified)" "%b"))