From: "Jostein Kjønigsen" <jostein@secure.kjonigsen.net>
To: Eli Zaretskii <eliz@gnu.org>, jostein@kjonigsen.net
Cc: vladimir@thecybershadow.net, emacs-devel@gnu.org
Subject: Re: Support variable-unquoting syntax in bat-mode
Date: Wed, 14 Mar 2018 21:48:53 +0100 [thread overview]
Message-ID: <1521060533.1176720.1303384360.4AF7D686@webmail.messagingengine.com> (raw)
In-Reply-To: <834llisk3l.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]
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?
>
> --- 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ønigsen
jostein@kjonigsen.net 🍵 jostein@gmail.com
https://jostein.kjonigsen.net
[-- Attachment #2: Type: text/html, Size: 2948 bytes --]
next prev parent reply other threads:[~2018-03-14 20:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 8:37 Support variable-unquoting syntax in bat-mode Jostein Kjønigsen
2018-03-14 14:15 ` Vladimir Panteleev
2018-03-14 16:22 ` Eli Zaretskii
2018-03-14 20:48 ` Jostein Kjønigsen [this message]
2018-03-15 13:25 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521060533.1176720.1303384360.4AF7D686@webmail.messagingengine.com \
--to=jostein@secure.kjonigsen.net \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=jostein@kjonigsen.net \
--cc=vladimir@thecybershadow.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).