[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#703: Octave comments in emacs

From: Chong Yidong
Subject: bug#703: Octave comments in emacs
Date: Thu, 21 Aug 2008 11:55:44 -0400

Stefan Monnier <address@hidden> wrote:

> > Is there a way to assign two different syntax rules for the same
> > character in emacs? Ie, one where ' is treated as a string quote
> > (and suppresses the syntax elements inside the quotes), and one
> > where it is treated as a suffix operator.
> Yes, there is, using the `syntax-table' property.  A common way to set
> this property is via the font-lock-syntactic-keywords variable.
> So all it takes is a regexp good enough to distinguish the two cases

Kurt Hornik <address@hidden> wrote:

> Octave mode has never provided syntax support for single quoted
> strings because there is no way (short of actually parsing the code)
> of telling these apart from single quotes used for transposition.

Maybe we could use a rough heuristic to handle most of the cases.  A '
character that occurs before "[=(] *" is probably the beginning of a
single quoted string, not a transpose operator.  WDYT?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]