all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Questions about bat-generic-mode
@ 2013-01-17 18:25 Pascal Quesseveur
  2013-01-17 20:58 ` Oleksandr Gavenko
       [not found] ` <mailman.17754.1358458783.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Pascal Quesseveur @ 2013-01-17 18:25 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

Here my questions:

1. In bat-generic-mode-compile compile fails when w32-shell-name
   returns a string containing a space as in
   C:/Program Files/GNU/...

   Setting w32-shell-name using short name solve the problem but are
   there other solutions besides install emacs in a directory whose
   name doesn't contain spaces?

2. Labels starting with ':' in goto statements are not
   fontified. There are some cases where the ':' is required as in
   goto :EOF. Perhaps the regexp used for fontification could be
   modified as follows:
 
   "[ \t\n|]\\<\\([gG][oO][tT][oO]\\)\\>[ \t]*\\(:?\\sw+\\)?"

3. comment-start is set to REM. It would be interesting to be able to
   set it to ::

4. echo can be followed by a space or a dot (to prevent newline). In
   the later case fontification fails. One modification could be:

     '("^[@ \t]*\\([eE][cC][hH][oO]\\)\\([ \t]+\\|[.]\\)\\(\\([oO]\\([nN]\\|[fF][fF]\\)\\)\\|\\([^>|\r\n]+\\)\\)"
       (1 font-lock-builtin-face)
       (4 font-lock-constant-face t t)
       (6 font-lock-string-face t t))


-- 
Pascal Quesseveur
pascal.quesseveur@free.fr


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Questions about bat-generic-mode
  2013-01-17 18:25 Questions about bat-generic-mode Pascal Quesseveur
@ 2013-01-17 20:58 ` Oleksandr Gavenko
       [not found] ` <mailman.17754.1358458783.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Oleksandr Gavenko @ 2013-01-17 20:58 UTC (permalink / raw)
  To: help-gnu-emacs

On 2013-01-17, Pascal Quesseveur wrote:

> 2. Labels starting with ':' in goto statements are not
>    fontified. There are some cases where the ':' is required as in
>    goto :EOF. Perhaps the regexp used for fontification could be
>    modified as follows:
>  
>    "[ \t\n|]\\<\\([gG][oO][tT][oO]\\)\\>[ \t]*\\(:?\\sw+\\)?"
>
Send a patch by M-x report-emacs-bug.

> 3. comment-start is set to REM. It would be interesting to be able to
>    set it to ::
>
Its nice thing but you know that :: is an very undocumented hack (invalid
label):

  http://xset.tripod.com/tip3.htm

> 4. echo can be followed by a space or a dot (to prevent newline). In
>    the later case fontification fails. One modification could be:
>
>      '("^[@ \t]*\\([eE][cC][hH][oO]\\)\\([ \t]+\\|[.]\\)\\(\\([oO]\\([nN]\\|[fF][fF]\\)\\)\\|\\([^>|\r\n]+\\)\\)"
>        (1 font-lock-builtin-face)
>        (4 font-lock-constant-face t t)
>        (6 font-lock-string-face t t))
Send a patch by M-x report-emacs-bug.

I also provide improvement to bat-generic-mode:

  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5719
                 [patch] fix bat-generic-mode highlighting pattern for CLI
                 switch.

-- 
Best regards!




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Questions about bat-generic-mode
       [not found] ` <mailman.17754.1358458783.855.help-gnu-emacs@gnu.org>
@ 2013-01-18 16:36   ` Pascal Quesseveur
  2013-01-20 20:00     ` Oleksandr Gavenko
       [not found]     ` <mailman.17972.1358712041.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Pascal Quesseveur @ 2013-01-18 16:36 UTC (permalink / raw)
  To: help-gnu-emacs

>"OG" == Oleksandr Gavenko <gavenkoa@gmail.com> writes:

  OG> Its nice thing but you know that :: is an very undocumented hack
  OG> (invalid label):

  It is not so undocumented. I didn't mean replacing rem by :: in
  generic-bat-mode-setup-function but it would be nice to be able to
  change the default value. I haven't found a way to change it without
  modifying the function.

  OG> Send a patch by M-x report-emacs-bug.

  I am not a Windows expert and I dare not submit a patch without
  knowing better the Windows com. For instance I discovered today that
  echo( works like echo. and is sometimes considered better.


-- 
Pascal Quesseveur
pascal.quesseveur@free.fr


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Questions about bat-generic-mode
  2013-01-18 16:36   ` Pascal Quesseveur
@ 2013-01-20 20:00     ` Oleksandr Gavenko
       [not found]     ` <mailman.17972.1358712041.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Oleksandr Gavenko @ 2013-01-20 20:00 UTC (permalink / raw)
  To: help-gnu-emacs

On 2013-01-18, Pascal Quesseveur wrote:

>>"OG" == Oleksandr Gavenko <gavenkoa@gmail.com> writes:
>
>   OG> Its nice thing but you know that :: is an very undocumented hack
>   OG> (invalid label):
>
>   It is not so undocumented. I didn't mean replacing rem by :: in
>   generic-bat-mode-setup-function but it would be nice to be able to
>   change the default value. I haven't found a way to change it without
>   modifying the function.
>
3 years ago I also have desire to make patch that provide highlighting of '::'
as comment syntax and want 'M-;' (comment-dwim) be able uncomment such regions
as I involved in project with many batch files with such commenting style...

>   OG> Send a patch by M-x report-emacs-bug.
>
>   I am not a Windows expert and I dare not submit a patch without
>   knowing better the Windows com. For instance I discovered today that
>   echo( works like echo. and is sometimes considered better.

There a lot of batch-file modes for Emacs:

  http://www.emacswiki.org/emacs/DosScripts

 * http://emacswiki.org/emacs/batch-mode.el
 * http://emacswiki.org/emacs/cmd-mode.el

I don't try them as don't like any external dependency (but "apt-get install"
accept).

So stuck with bat-generic-mode. Feature that I like and which is missing is an
indentation for batch parentheses syntax:

  if exist file.txt (
    echo xxx
  ) else (
    echo yyy
  )

-- 
Best regards!




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Questions about bat-generic-mode
       [not found]     ` <mailman.17972.1358712041.855.help-gnu-emacs@gnu.org>
@ 2013-01-21 10:18       ` Pascal Quesseveur
  2013-01-21 10:40         ` Pascal Quesseveur
  0 siblings, 1 reply; 6+ messages in thread
From: Pascal Quesseveur @ 2013-01-21 10:18 UTC (permalink / raw)
  To: help-gnu-emacs

>"OG" == Oleksandr Gavenko <gavenkoa@gmail.com> writes:

  OG> 3 years ago I also have desire to make patch that provide
  OG> highlighting of '::' as comment syntax and want 'M-;'
  OG> (comment-dwim) be able uncomment such regions as I involved in
  OG> project with many batch files with such commenting style...

One solution is to use file variables. Comments starting with :: are
correctly processed by putting the following line at top of each batch
file.

:: -*-coding: iso-latin-1-dos; comment-start:"::" -*-

Regarding the coding I observed that when using a dos encoding
fontification doesn't work as expected: keywords set and goto are not
fontified when they are at lines beginning. It comes from the regex:

     '("[ \t\n|]\\<\\([gG][oO][tT][oO]\\)\\>[ \t]*\\(:?\\sw+\\)?"

I think it should be better to use [:space:].

  OG> So stuck with bat-generic-mode. Feature that I like and which is
  OG> missing is an indentation for batch parentheses syntax:

  OG>   if exist file.txt (
  OG>     echo xxx
  OG>   ) else (
  OG>     echo yyy
  OG>   )

+1


-- 
Pascal Quesseveur
pascal.quesseveur@free.fr


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Questions about bat-generic-mode
  2013-01-21 10:18       ` Pascal Quesseveur
@ 2013-01-21 10:40         ` Pascal Quesseveur
  0 siblings, 0 replies; 6+ messages in thread
From: Pascal Quesseveur @ 2013-01-21 10:40 UTC (permalink / raw)
  To: help-gnu-emacs

>"PQsr" == Pascal Quesseveur <pascal.quesseveur@free.fr> writes:

  PQsr> Regarding the coding I observed that when using a dos encoding
  PQsr> fontification doesn't work as expected: keywords set and goto are not
  PQsr> fontified when they are at lines beginning. It comes from the regex:

I would have done better to read. The regex is obvioulsly correct. The
problem was coming from the fact that I used a keyword as a label
(start).

 
-- 
Pascal Quesseveur
pascal.quesseveur@free.fr


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-21 10:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 18:25 Questions about bat-generic-mode Pascal Quesseveur
2013-01-17 20:58 ` Oleksandr Gavenko
     [not found] ` <mailman.17754.1358458783.855.help-gnu-emacs@gnu.org>
2013-01-18 16:36   ` Pascal Quesseveur
2013-01-20 20:00     ` Oleksandr Gavenko
     [not found]     ` <mailman.17972.1358712041.855.help-gnu-emacs@gnu.org>
2013-01-21 10:18       ` Pascal Quesseveur
2013-01-21 10:40         ` Pascal Quesseveur

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.