From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.help Subject: Re: password.el: A minor mode to hide sensitive information (passwords) using overlays. Date: Wed, 21 Nov 2012 09:24:37 +0100 Message-ID: <87vcczicsa.fsf@gmx.de> References: <878v9w4mhm.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1353486389 27954 80.91.229.3 (21 Nov 2012 08:26:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2012 08:26:29 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?utf-8?Q?J=C3=BCrgen_H=C3=B6tzel?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 21 09:26:40 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tb5dm-0008PG-Bi for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Nov 2012 09:26:38 +0100 Original-Received: from localhost ([::1]:55063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb5db-0005Sj-RX for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Nov 2012 03:26:27 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb5dQ-0005QN-4c for help-gnu-emacs@gnu.org; Wed, 21 Nov 2012 03:26:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tb5dK-0006BS-9Y for help-gnu-emacs@gnu.org; Wed, 21 Nov 2012 03:26:16 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:43830) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Tb5dK-0006BN-0A for help-gnu-emacs@gnu.org; Wed, 21 Nov 2012 03:26:10 -0500 Original-Received: (qmail invoked by alias); 21 Nov 2012 08:24:39 -0000 Original-Received: from p57BB98CF.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.152.207] by mail.gmx.net (mp038) with SMTP; 21 Nov 2012 09:24:39 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1/GOiwDkvPGHsrgpVshVqyuXt6klmdFE+llHyuPvO bUPAqcdQ6d6Gqv In-Reply-To: (=?utf-8?Q?=22J=C3=BCrgen_H=C3=B6tzel=22's?= message of "Tue, 20 Nov 2012 16:33:45 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 213.165.64.22 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87831 Archived-At: J=C3=BCrgen H=C3=B6tzel writes: > Hi Michael, Hi J=C3=BCrgen, > I introduced a new custom variable password-mode-password-prefix-regexs: > So you can change this. That looks much better now. Maybe you could polish a little bit the default. I would make the colon optional, then .netrc or .authinfo files are supported out of the box. And maybe you shall allow any space class characters after the prefix. My proposal for a default value would be '("Password:?[[:space:]]+" "Passwort:?[[:space:]]+") You might also mention in the docstring of that custom option, that the regexps must not contain parentheses for grouping, otherwise your match wouldn't work. Shy groups are OK. Another minor annoyance is, that your code is activated only in case of *inserting* a character. I have no simple solution at hand, because there isn't a hook when deleting a character. Maybe you could remap keys and for the password string region, but I don't know whether this covers all use cases. Delete/undo is also problematic, because you don't know first hand which password to enter as confirmation. An alternative approach could be to mark the region which contains the password with the `read-only' property and catch the `text-read-only' error, which is raised when somebody tries to modify this region. In the error handler, you could call your password change mechanery. > J=C3=BCrgen Best regards, Michael.