From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#34911: 26.1; doc about lock file names Date: Sun, 19 May 2019 15:04:53 +0000 (UTC) Message-ID: <509ba95a-d515-40e8-a76f-3f614faeef47@default> References: > <83bm27uzbr.fsf@gnu.org>> <874l5ziqci.fsf@gmail.com> <871s0ucxnb.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="141246"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34911@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 19 17:08:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSNQ3-000aZc-P7 for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 May 2019 17:08:11 +0200 Original-Received: from localhost ([127.0.0.1]:49867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSNQ2-0005bk-4c for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 May 2019 11:08:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSNPv-0005be-HB for bug-gnu-emacs@gnu.org; Sun, 19 May 2019 11:08:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSNPu-0007fr-Fn for bug-gnu-emacs@gnu.org; Sun, 19 May 2019 11:08:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50020) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSNPu-0007fd-CS for bug-gnu-emacs@gnu.org; Sun, 19 May 2019 11:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hSNPu-0002we-5b for bug-gnu-emacs@gnu.org; Sun, 19 May 2019 11:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 May 2019 15:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34911 X-GNU-PR-Package: emacs Original-Received: via spool by 34911-submit@debbugs.gnu.org id=B34911.155827842511229 (code B ref 34911); Sun, 19 May 2019 15:08:02 +0000 Original-Received: (at 34911) by debbugs.gnu.org; 19 May 2019 15:07:05 +0000 Original-Received: from localhost ([127.0.0.1]:35330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSNOz-0002v3-35 for submit@debbugs.gnu.org; Sun, 19 May 2019 11:07:05 -0400 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:59618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSNOx-0002uW-AM for 34911@debbugs.gnu.org; Sun, 19 May 2019 11:07:03 -0400 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4JF46hc138808; Sun, 19 May 2019 15:06:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=8f0fVbvp3n81uJpdx0PsxyuzAEnDYPXsupbjm840/E8=; b=pqYngcNm6a2nDgERLNb4opjBjlhQ0+mN8XXwFykp3Pni7H5RJTDGcm6r4SCDX600k451 r/ou14bep37k1cJi+CKdjbZlTnTP3KQTlO7AiLs+4HwUkUeQuNmkCirMkcibY7JWhW1q +ZrgaNDhL8ujSt/VGZgXvtAVrBwX0P4kMPMs6cw38Y5JlSkBH6suPqW4DYuMF0bf/TqG iSfc5+qkrmuvYcx2lRxo8UcU2lf4VdZHyo/gyFTTYVq93/nGiyMaJ+JmKU3KUuDoGNQc 4AZ9GVRxCLtZcDMXfrkQTWwuV/pg+xTZUxViRdhQnOZ1IUPc5aKyawK+RBS5UX3N/J+0 OQ== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2130.oracle.com with ESMTP id 2sj7jdbhp8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 19 May 2019 15:06:56 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4JF4PGu188762; Sun, 19 May 2019 15:04:55 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 2sjucqxnn2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 19 May 2019 15:04:55 +0000 Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4JF4ss7011549; Sun, 19 May 2019 15:04:55 GMT In-Reply-To: <871s0ucxnb.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4849.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=803 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905190110 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=830 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905190110 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: 209.51.188.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:159547 Archived-At: > >> The default value is "^\\.?#\\|^\\.$\\|^\\.\\.$". > >> > >> \\.?# matches only the first char of an auto-save file > >> name, and the first two chars of a lock file name. It > >> does not match the full name, requiring it to end with > >> `#'. That means that (1) it cannot be used as is for, > >> say, font-locking such a (complete) name, and (2) as > >> it is now, it can falsely identify files that are not > >> auto-save or lock files. > > > > It's a regexp, so of course you can name files which aren't auto-save o= r > > lock files in such a way that they match it. >=20 > After looking at it some more, I realize you were probably suggesting > that the regexp should have something like "^.#\\|^#.*#$" instead of > "^\\.?#" No, I don't think so. It is correct, I think, to say that the beginning matches .# (or the whole thing matches . or ..) - that is, the dot is literal. What I was saying was that it is not enough to say how it starts. It should (in all cases) match the full file name. (And it is better to use \` and \'.) A main reason is what I mentioned: being able to reuse the variable for font-locking. I do that in `dired+.el', for example. Option `diredp-omit-files-regexp' is a regexp to font-lock file names omitted by `dired-omit-mode'. The default value is defined this way, reusing the value of `dired-omit-files': (let* ((strg dired-omit-files) ; <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Reuse = it (strg (if (eq ?^ (aref strg 0)) ; Remove initial ^ (substring strg 1) strg)) (strg (replace-regexp-in-string "\\(\\\\[|]\\)\\^" ; Remove other ^'s "\\1" strg 'FIXEDCASE nil)) (strg (replace-regexp-in-string "\\([$]\\)" ; Remove $'s "" strg 'FIXEDCASE nil))) strg) Doc string: Regexp for font-locking file names to be omitted by `dired-omit-mode'. The regexp is matched only against the file name, but the entire line is highlighted (with face `diredp-omit-file-name'). The default value of this option differs from that of `dired-omit-files' by removing "^" from the beginning, and "$" from the end, of each regexp choice. (The default value of `dired-omit-files', at least prior to Emacs 27, uses "^" and "$", but it should not.) If you want to control the beginning and end of choice matches then use "\`" and "\'" instead of "^" and "$". Note: If you change the value of this option then you need to restart Emacs to see the effect of the new value on font-locking.