[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: syntax for ?= in sh-mode
From: |
Daniel Pfeiffer |
Subject: |
Re: syntax for ?= in sh-mode |
Date: |
Sun, 12 Sep 2004 21:05:53 +0200 |
Saluton,
Dan Nicolaescu <address@hidden> skribis:
> address@hidden (Daniel Pfeiffer) writes:
> > Dan Nicolaescu <address@hidden> skribis:
> >
> > > Is there any reason that the syntax of ?= is symbol in sh-mode?
> > > Can it be changed to punctuation (or something else)?
> > > This causes problem with dabbrev.
> > >
> > > For example, given the following file:
> > >
> > > #!/bin/bash
> > > MY_LONG_VAR=234
> > >
> > > ANOTHER_VAR=${MY_LO
> > >
> > > If the point is at the end (after _LO) and M-/ is pressed the
> > > completion will be "${MY_LONG_VAR=234", which is not very helpful.
> > > Changing the syntax of ?= to be "." makes M-/ complete ${MY_LONG_VAR,
> > > which is nicer.
> >
> > Fully agreed!
>
> The patch below implements this.
> Can somebody please check this in?
>
> 2004-09-10 Dan Nicolaescu <address@hidden>
>
> * progmodes/sh-script.el (sh-mode-default-syntax-table): Set syntax
> of = to "." (punctuation).
> ...
This doesn't go far enough. I have looked at the syntax of sh-mode and shell:
it is inconsistent chaos. The two differ, and in one table groups like ; & |
or * ? are in different categories. For sh-mode I'd suggest the following
changes:
$ word -> symbol
& symbol -> punctuation
* symbol -> punctuation
= symbol -> punctuation
@ punctuation -> symbol
| symbol -> punctuation
In shell this could be used as a basis for delimiting filenames, which would
only contain word and symbol. Then finally something like TMP=/tm TAB could
give completion of /tm.
Then maybe we should try to make both modes use the same syntax table. But I
don't know how this is best accomplished, since each is independent of the
other. A shell-common.el might be the solution.
I would have used `shell-cd-regexp' for the change I just submitted to
compile.el if I could require it standalone. Also completion would be very
welcome within M-! and M-|.
coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
--
lerne / learn / apprends / lär dig / ucz się Esperanto:
http://lernu.net/
- Re: syntax for ?= in sh-mode, Daniel Pfeiffer, 2004/09/10
- Re: syntax for ?= in sh-mode, Dan Nicolaescu, 2004/09/10
- Re: syntax for ?= in sh-mode,
Daniel Pfeiffer <=
- Re: syntax for ?= in sh-mode, Richard Stallman, 2004/09/13
- Re: syntax for ?= in sh-mode, Daniel Pfeiffer, 2004/09/15
- Message not available
- Re: syntax for ?= in sh-mode, Daniel Pfeiffer, 2004/09/17
- Re: syntax for ?= in sh-mode, Stefan, 2004/09/18
- Re: syntax for ?= in sh-mode, Richard Stallman, 2004/09/19
- Re: syntax for ?= in sh-mode, Stefan, 2004/09/20
- Re: syntax for ?= in sh-mode, Richard Stallman, 2004/09/21
- Re: syntax for ?= in sh-mode, Stefan Monnier, 2004/09/21
- Re: syntax for ?= in sh-mode, Miles Bader, 2004/09/21
- Re: syntax for ?= in sh-mode, Stefan Monnier, 2004/09/21