From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel 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 Message-ID: References: <20200622191653.26453.39420@vcs0.savannah.gnu.org> <20200622191656.2D20920A26@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="93602"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 22 23:09:51 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jnThP-000OHl-K0 for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Jun 2020 23:09:51 +0200 Original-Received: from localhost ([::1]:37950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnThO-0000MH-LB for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Jun 2020 17:09:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnTgp-0008Kn-5w for emacs-devel@gnu.org; Mon, 22 Jun 2020 17:09:15 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2033) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnTgm-0003Ec-U6 for emacs-devel@gnu.org; Mon, 22 Jun 2020 17:09:14 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7F6C644072E; Mon, 22 Jun 2020 17:09:11 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D8FF9440218; Mon, 22 Jun 2020 17:09:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1592860149; bh=LZj3mCGYjh/7c/3CszSuFud1ZmaGJGlxOQndYUAVwbY=; h=From:To:Subject:References:Date:In-Reply-To:From; b=QvB1y6yhqjcnW2dHNMBMFeVzYacQDTjQbqOC+pJuDTtCp3vKeWqIucwhUePTmM68d Knx1aBrwgne18FCYU5B1Vq+s5xuivMIuIpcdtkLHHBIJHToXlf8FeU39hxKCfU8dss N12hTzbp908zun54iqmDZfFAvJLg0VkiAZu0bONUt2ln9RPC4O93/EyPhDffxLROhE bMTcSX5hqv+PVncb/RcPaXfSHlvJVLQV1U6Eh0B9NcHmj5CQo0Xqq5GnRk7VXukTB1 4RXNpB1dqodHCUl1mrGutH/m4mpUFm+ta9jcQ1F+dZSBEh/EIIqqCZ8DYa0eaWfIk4 A/FB2YtglLwGg== Original-Received: from alfajor (unknown [108.175.228.207]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 985A112078C; Mon, 22 Jun 2020 17:09:09 -0400 (EDT) In-Reply-To: (Ted Zlatanov's message of "Mon, 22 Jun 2020 20:39:47 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/22 14:56:43 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252520 Archived-At: >>> + (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. Stefan