unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleksandr Gavenko <gavenkoa@gmail.com>
To: 5719@debbugs.gnu.org
Subject: bug#5719: [patch] fix bat-generic-mode highlighting pattern for CLI switch.
Date: Sun, 14 Mar 2010 22:18:19 +0200	[thread overview]
Message-ID: <4B9D448B.6060003@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 749 bytes --]

Pattern for highlight '/help', '/query', '/a' like
command line options currently does not require
leading whitespace char but MUST.

If you use Cygwin/MSYS from bat file you can type expressions like

   ls dir/sub-dir

and '/sub-dir' unfortunately highlighted as CLI switch!

Switch which start with - or + properly required leading whitespaces.

There exist one situation then you must highlight switch
exactly at start of line (and so there are no any leading whitespaces)
because this line considered continuation of previous line
if previous line end with '^' char.

But this not true for command.com and so unusual situation
so we can ignore it.

So in patch I just improve pattern for '+'/'-', which already
do job right.

-- 
Best regards!

[-- Attachment #2: .patch --]
[-- Type: text/plain, Size: 717 bytes --]

=== modified file 'lisp/generic-x.el'
--- lisp/generic-x.el	2010-01-13 08:35:10 +0000
+++ lisp/generic-x.el	2010-03-14 20:03:59 +0000
@@ -508,8 +508,7 @@
      '("^[ \t]*\\(:\\sw+\\)"         1 font-lock-function-name-face t)
      '("\\(%\\sw+%\\)"               1 font-lock-variable-name-face t)
      '("\\(%[0-9]\\)"                1 font-lock-variable-name-face t)
-     '("\\(/[^/ \"\t\n]+\\)"         1 font-lock-type-face)
-     '("[\t ]+\\([+-][^\t\n\" ]+\\)" 1 font-lock-type-face)
+     '("[\t ]+\\([+-/][^\t\n\" ]+\\)" 1 font-lock-type-face)
      '("[ \t\n|]\\<\\([gG][oO][tT][oO]\\)\\>[ \t]*\\(\\sw+\\)?"
        (1 font-lock-keyword-face)
        (2 font-lock-function-name-face nil t))


             reply	other threads:[~2010-03-14 20:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14 20:18 Oleksandr Gavenko [this message]
2010-06-27 18:44 ` bug#5719: [patch] fix bat-generic-mode highlighting pattern for CLI switch Chong Yidong

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=4B9D448B.6060003@gmail.com \
    --to=gavenkoa@gmail.com \
    --cc=5719@debbugs.gnu.org \
    /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).