Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redact mode line? #9

Open
kchanqvq opened this issue Oct 9, 2022 · 4 comments
Open

Redact mode line? #9

kchanqvq opened this issue Oct 9, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@kchanqvq
Copy link

kchanqvq commented Oct 9, 2022

Currently it doesn't seem to do anything to the mode line. Can it be redacted as well?

@bkaestner bkaestner added the enhancement New feature or request label Oct 11, 2022
@bkaestner
Copy link
Owner

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.

@bkaestner
Copy link
Owner

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).

@kchanqvq
Copy link
Author

kchanqvq commented Oct 15, 2022

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…

@bkaestner
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants