redacted.el
redacted.el copied to clipboard
Redact mode line?
Currently it doesn't seem to do anything to the mode line. Can it be redacted as well?
Hey @BlueFlo0d, thanks for the suggestion. That's an interesting take. It might be possible, but I'm not certain how overlays or display-tables work within the mode line. I'll have a look at the weekend.
So, just to be sure, you would like redacted-mode
to act as if the following hook was active?
(add-hook 'redacted-mode-hook
(lambda () (if redacted-mode
(setq mode-line-format " [REDACTED ] ")
(setq mode-line-format (cdar (get 'mode-line-format 'standard-value))))))
(You can try it out with the current redacted-mode
package)
That might be feasible, yeah. I'd probably have to introduce a new customization option redacted-mode-redact-modeline
, which is either nil
, t
or a string
(for custom [REDACTED]
messages).
Ah, that's a feasible solution, and I'm already doing it :) https://github.com/BlueFlo0d/insecure-lock
I think a new customization option is not strictly necessary because users can do this themselves relatively easily.
I'm still curious about whether the same effect applied to buffer text can be applied to mode line…
I'm still curious about whether the same effect applied to buffer text can be applied to mode line…
That's a good question; I'm not entirely sure though. The mode-line is, as far as I know, not accessible as a "normal" buffer, so the buffer-display-table
trick doesn't apply. If you were able to get the contents of the mode-line, then a string replacement should be feasible.