unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: scratch/tzz/auth-source-reveal-mode 4a7c98d 3/3: Create and document auth-source-reveal-mode
Date: Mon, 22 Jun 2020 16:03:31 -0400	[thread overview]
Message-ID: <jwveeq6amz1.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20200622191656.2D20920A26@vcs0.savannah.gnu.org> (Teodor Zlatanov's message of "Mon, 22 Jun 2020 15:16:56 -0400 (EDT)")

> +(define-minor-mode auth-source-reveal-mode
[...]
> +  (when auth-source-reveal-mode
> +    ;; Install the prettification magic.
> +    (prettify-symbols-add-prettification-rx
> +     'auth-source-reveal-mode-prettify-regexp ; The identifier symbol.
> +     ;; regexp to hide/reveal
> +     (if (apply #'derived-mode-p auth-source-reveal-json-modes)
> +         (format "\"?password\"?[:[:blank:]]+\"\\([^\t\r\n\"]+\\)\"" auth-source-reveal-regex)
> +       (format "\\b%s\\b\\s-+\\([^ \t\r\n]+\\)" auth-source-reveal-regex))
> +     auth-source-reveal-hider)
> +
> +    (setq-local
> +     prettify-symbols-compose-predicate #'auth-source-reveal-compose-p)

This erases any prior configuration of that variable, so it won't "play
ball" with other users.

> +  (prettify-symbols-mode (if auth-source-reveal-mode 1 -1)))

And here we forcefully enable/disable `prettify-symbols-mode` even if
all the user wanted if to hide the passwords.
I think we need to decouple the two user-level features.


        Stefan




  parent reply	other threads:[~2020-06-22 20:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200622191653.26453.39420@vcs0.savannah.gnu.org>
     [not found] ` <20200622191655.E1C4E20A26@vcs0.savannah.gnu.org>
2020-06-22 20:00   ` scratch/tzz/auth-source-reveal-mode f16a4c8 2/3: Support regular expressions and API for prettify-symbols-mode Stefan Monnier
2020-06-22 20:32     ` Ted Zlatanov
     [not found] ` <20200622191656.2D20920A26@vcs0.savannah.gnu.org>
2020-06-22 20:03   ` Stefan Monnier [this message]
2020-06-22 20:39     ` scratch/tzz/auth-source-reveal-mode 4a7c98d 3/3: Create and document auth-source-reveal-mode Ted Zlatanov
2020-06-22 21:09       ` Stefan Monnier
2020-06-23 22:29         ` Ted Zlatanov
2020-06-24 15:13           ` Eli Zaretskii
2020-06-24 18:15             ` Ted Zlatanov
2020-06-24 18:36               ` Eli Zaretskii
2020-06-24 19:04                 ` Ted Zlatanov
2020-06-25 13:31                   ` Eli Zaretskii
2020-06-26 13:52                     ` Ted Zlatanov
2020-06-26 14:24                       ` Eli Zaretskii
2020-06-26 14:39                         ` Ted Zlatanov
2020-07-12 20:49                           ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwveeq6amz1.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).