From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?Q?Jostein=20Kj=C3=B8nigsen?= Newsgroups: gmane.emacs.devel Subject: Re: Support variable-unquoting syntax in bat-mode Date: Wed, 14 Mar 2018 21:48:53 +0100 Message-ID: <1521060533.1176720.1303384360.4AF7D686@webmail.messagingengine.com> References: <1521016649.71943.1302515928.19D18627@webmail.messagingengine.com> <834llisk3l.fsf@gnu.org> Reply-To: jostein@kjonigsen.net NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_----------=_152106053311767202" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1521060432 30317 195.159.176.226 (14 Mar 2018 20:47:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Mar 2018 20:47:12 +0000 (UTC) Cc: vladimir@thecybershadow.net, emacs-devel@gnu.org To: Eli Zaretskii , jostein@kjonigsen.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 14 21:47:08 2018 Return-path: Envelope-to: ged-emacs-devel@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 1ewDIe-0007iv-JK for ged-emacs-devel@m.gmane.org; Wed, 14 Mar 2018 21:47:05 +0100 Original-Received: from localhost ([::1]:48226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewDKh-0000WX-JE for ged-emacs-devel@m.gmane.org; Wed, 14 Mar 2018 16:49:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewDKU-0000Uo-Vd for emacs-devel@gnu.org; Wed, 14 Mar 2018 16:49:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewDKT-00077d-RW for emacs-devel@gnu.org; Wed, 14 Mar 2018 16:48:59 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42085) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewDKP-00076l-Un; Wed, 14 Mar 2018 16:48:54 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 340E720BB7; Wed, 14 Mar 2018 16:48:53 -0400 (EDT) Original-Received: from web1 ([10.202.2.211]) by compute6.internal (MEProxy); Wed, 14 Mar 2018 16:48:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:content-transfer-encoding :content-type:date:from:in-reply-to:message-id:mime-version :references:reply-to:subject:to:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=zOkyYy5u4OWF6Jb1Hki9VBMkQdMi7aNxICxhKKDWX rE=; b=hrinbgBSD02E3L8g6Y4aDg/QvcPn0lN+BQL1BMIQPA0UrJRel0EEFM0gI w0YkcxwsLzxEImt39ufOH+4i8bcnMpctIzg7nPltQuOMi6LkhqkbwPZJpApP9eCf s5Hf95laESaIaL5cccqRazxRb2mCc1TAz/8znNylgmk0dFDnPHsE4uCWAz8aZFQl 9HIx0bXZM3y3EagSGmv9nGckhXz9AsVNF9jwlDorlaiJl2GxIr74QJX+ncB5KY2j hhCOdPjapWMZNQU54PPFyrqa9b1RRA4shxAZm/RSl+OVUcCUPSB0FjUj+vbQs4f3 /xoOh/5NwsPa7tQ1h3TbL4TPYxMEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :reply-to:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=zOkyYy5u4OWF6Jb1Hki9VBMkQdMi7aNxICxhKKDWXrE=; b=MBThDkbC58gR NERDYid5036KcGJREj+UJOacfoihZAj7gi7chTm0DLZEvV3bM1mM1aD+IMrUUIXf ZDuQ8WRSlVfQWlfUaIj5XUKDRnj8DC6f3Xgh1ImYNEQn1r3jMWHdkXKSdAozRCkE FWLIWMaEbfpciKKbwIptMtC5qHAcH+eYE+kf0Ipi7G6t0F76Bn+Us/8eTNaaIXWu nKiiga5g05ominNeb+cwHWDOO93vSt5yy5ebVwyUIi2uTWoe0B5ISBeVfZwYWr0T nkB6QjRi9Ugzr3pzsyCwPF9ywCU3TKpHFr4kP+NyJl2J/GlDcpgAqkyvl/DMMITZ VGEm6BL/+A== X-ME-Sender: Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id 11B9D9409C; Wed, 14 Mar 2018 16:48:53 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface - ajax-54087d22 In-Reply-To: <834llisk3l.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:223729 Archived-At: This is a multi-part message in MIME format. --_----------=_152106053311767202 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hey Eli. Thanks for the quick reply! On Wed, Mar 14, 2018, at 5:22 PM, Eli Zaretskii wrote: > I think this will break the test suite for bat-mode.el. Did you run > it after applying the change? I honestly just tested it inside a running Emacs sessions, but I will make sure to run "make check" before making concrete change-requests in the future. > That's because in the likes of "%~dp1" we want only "1" to be > highlighted as variable name. With your change, "~dp1" will be > highlighted in its entirety. That makes sense. I can appreciate that. > How about the patch below instead? >=20 > --- lisp/progmodes/bat-mode.el~ 2018-01-03 13:09:15.000000000 +0200 > +++ lisp/progmodes/bat-mode.el 2018-03-14 17:10:44.238856900 +0200 > @@ -84,6 +84,8 @@ > . 'bat-label-face) > ("\\_<\\(defined\\|set\\)\\_>[ \t]*\\(\\(\\sw\\|\\s_\\)+\\)" > (2 font-lock-variable-name-face)) > + ("%~\\([1-9]\\)" > + (1 font-lock-variable-name-face)) > ("%\\([^%~ \n]+\\)%?" > (1 font-lock-variable-name-face)) > ("!\\([^!%~ \n]+\\)!?" ; delayed-expansion !variable! That works for me, and running "make check", it seems all tests still pass. If I were to amend this in any way, it would be extending the range check from 0 (zero) to 9, (as opposed 1 to 9). % is the program being executed, and in certain cases a normal % parameter to extract (for instance in generic logging-statements). -- Regards Jostein Kj=C3=B8nigsen jostein@kjonigsen.net =F0=9F=8D=B5 jostein@gmail.com https://jostein.kjonigsen.net --_----------=_152106053311767202 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"
Hey Eli.

Thanks for the quick reply!

On Wed, Mar 14, 2018, at 5:22 PM, Eli Zaretskii wrote:
I think this will break the test suite for b= at-mode.el.  Did you run
it after applying the change?

I honestly just tested it inside a running Emacs sessions, but I will = make sure to run "make check" before making concrete change-requests in the= future.

That's because in the likes of "%~dp1" we wa= nt only "1" to be
highlighted as variable name.  With your change, "~dp1" will be
highlighted in its entirety.

That makes sense. I can appreciate that.

How about the patch below instead?

--- lisp/progmodes/bat-mode.el~ 2018-01-03 13:09:15.000000000 +0200
+++ lisp/progmodes/bat-mode.el 2018-03-14 17:10:44.238856900 +0200
=
@@ -84,6 +84,8 @@
          . 'bat-label-face)
        ("\\_<\\(defined\\|set\\)\\_>[ \t]*\= \(\\(\\sw\\|\\s_\\)+\\)"
          (2 font-lock-variable-name-face))
+        ("%~\\([1-9]\\)"
+         (1 font-lock-variable-name-face))
        ("%\\([^%~ \n]+\\)%?"
          (1 font-lock-variable-name-face))
        ("!\\([^!%~ \n]+\\)!?"  ; delayed-exp= ansion !variable!

That works for me, and running "make check", it seems all tests still = pass.

If I were to amend this in any way, it would be extending  the ra= nge check from 0 (zero) to 9, (as opposed 1 to 9).

%0  is the program being executed, and in certain cases a normal = parameter to extract (for instance in generic logging-statements).

--
Regards
Jostein Kj=C3=B8nigsen



--_----------=_152106053311767202--