[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scratch/tzz/auth-source-reveal-mode 4a7c98d 3/3: Create and document

From: Stefan Monnier
Subject: Re: scratch/tzz/auth-source-reveal-mode 4a7c98d 3/3: Create and document auth-source-reveal-mode
Date: Mon, 22 Jun 2020 17:09:08 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>> +    (setq-local
>>> +     prettify-symbols-compose-predicate #'auth-source-reveal-compose-p)
> SM> This erases any prior configuration of that variable, so it won't "play
> SM> ball" with other users.
> Is it better do what tex-mode.el does?
>   (add-function :override (local 'prettify-symbols-compose-predicate)
>                 #'tex--prettify-symbols-compose-p)

Even better is to not :override but do something more respectful of the
old value (which presumably is still useful for all the matches using the
"other" mapping).

>>> +  (prettify-symbols-mode (if auth-source-reveal-mode 1 -1)))
> SM> And here we forcefully enable/disable `prettify-symbols-mode` even if
> SM> all the user wanted if to hide the passwords.
> SM> I think we need to decouple the two user-level features.
> The plan was to make `prettify-symbols-mode' a library that other modes
> like `auth-source-reveal-mode' can use. I went halfway, creating some
> API-like functions. Are you suggesting that library is needed now to
> avoid the tight coupling? Or something else?

Yes, it's needed first: in some modes, enabling `prettify-symbols-mode`
can lead to really undesirable behavior (e.g. in Haskell it can lead to
code being plain wrong since it can affect indentation and indentation
is semantically significant like in Python).  So you really can't impose
it on the unsuspecting user.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]