From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#30186: 27.0.50; Password is not hidden in read-passwd Date: Fri, 26 Jan 2018 18:37:02 +0000 Message-ID: <20180126183702.GA5056@ACM> References: <871sikmd6o.fsf@mail.linkov.net> <83zi57qk2w.fsf@gnu.org> <87bmhm7wbw.fsf@mail.linkov.net> <87y3kp8thj.fsf@mail.linkov.net> <87372w8ddp.fsf@mail.linkov.net> <20180125173937.GA3857@ACM> <87vafp7i82.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1516992261 12375 195.159.176.226 (26 Jan 2018 18:44:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 Jan 2018 18:44:21 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: 30186@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 26 19:44:16 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ef8yu-0002Ow-0c for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Jan 2018 19:44:08 +0100 Original-Received: from localhost ([::1]:45338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef90u-0001Zf-Fu for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Jan 2018 13:46:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef90n-0001Z9-SH for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2018 13:46:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ef90k-00027h-Oo for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2018 13:46:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36129) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ef90k-00027d-Kq for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2018 13:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ef90k-0000t8-Dr for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2018 13:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Jan 2018 18:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30186 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30186-submit@debbugs.gnu.org id=B30186.15169923053269 (code B ref 30186); Fri, 26 Jan 2018 18:46:02 +0000 Original-Received: (at 30186) by debbugs.gnu.org; 26 Jan 2018 18:45:05 +0000 Original-Received: from localhost ([127.0.0.1]:44016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ef8zo-0000qf-NB for submit@debbugs.gnu.org; Fri, 26 Jan 2018 13:45:04 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:35817 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ef8zn-0000qQ-3t for 30186@debbugs.gnu.org; Fri, 26 Jan 2018 13:45:03 -0500 Original-Received: (qmail 18252 invoked by uid 3782); 26 Jan 2018 18:45:01 -0000 Original-Received: from acm.muc.de (p548C775F.dip0.t-ipconnect.de [84.140.119.95]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 26 Jan 2018 19:45:01 +0100 Original-Received: (qmail 5399 invoked by uid 1000); 26 Jan 2018 18:37:02 -0000 Content-Disposition: inline In-Reply-To: <87vafp7i82.fsf@mail.linkov.net> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142548 Archived-At: Hello, Juri. Firstly, apologies for answering your first post without having understood it properly. On Thu, Jan 25, 2018 at 23:15:41 +0200, Juri Linkov wrote: > >> Do you agree we could remove the effect of > >> with-silent-modifications around set-text-properties, > >> and leave it only on remove-list-of-text-properties? > >> This will help to fix the reported regression. > > I'm not sure about this. Doesn't `set-text-properties' need to be > > "protected", too? > I'm not sure either. Do you think that `set-text-properties' without > `with-silent-modifications' will cause the same problem that you > described in http://lists.gnu.org/r/emacs-devel/2015-04/msg00506.html set-text-properties outwith a with-silent-modifications will most definitely cause that problem. > > I'm not sure why you want to do this. Why do you want to do this? > Doing yank `C-y' in the minibuffer of `read-passwd' puts dots `.' > over the yanked characters using `display' properties, then later > `set-text-properties' removes all properties (exposing the yanked > characters), but without `with-silent-modifications' it used to put > `display' properties back. OK, I understand this, now. > After the change that added `with-silent-modifications', > the hook that puts `display' properties back doesn't run. Yes. [ .... ] The problem here appears to be a fundamental design bug in Emacs: that text properties are regarded as part of the buffer rather than something accompanying the buffer, as overlays are. before/after-change-functions are applied alike to proper buffer changes and text property changes. read-passwd absolutely needs an after-change-function to run on the text-property changes in remove-yank-excluded-properties. This seems fair enough. CC Mode absolutely requires the change hooks _not_ to run on the text-property changes in remove-yank-excluded-properties. The two conflict with eachother. A workaround might be for read-passwd to use an overlay rather than a text property for display. But this doesn't solve the underlying problem. I now see that the invocation of with-silent-modifications in remove-yank-excluded-properties is not the Right Thing. It breaks the model of text properties being an integral part of the buffer. Perhaps an alternative would be for Emacs to provide a flag which indicates to a before/after-change-function whether the current change is a "proper" change or merely a text property change. Change hook functions could then test this flag and, for example, refrain from doing anything for a text property change. -- Alan Mackenzie (Nuremberg, Germany).