[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Support variable-unquoting syntax in bat-mode
From: |
Jostein Kjønigsen |
Subject: |
Re: Support variable-unquoting syntax in bat-mode |
Date: |
Wed, 14 Mar 2018 21:48:53 +0100 |
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).
%0 is the program being executed, and in certain cases a normal parameter to extract (for instance in generic logging-statements).
--
Regards
Jostein Kjønigsen