help-gnu-emacs
[Top][All Lists]
Advanced

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

String recognition in Emacs 21


From: Adam Warner
Subject: String recognition in Emacs 21
Date: Mon, 13 Jan 2003 04:17:43 +1300
User-agent: Pan/0.13.3 (That cat's something I can't explain)

Hi all,

I'd like Emacs to be able to correctly highlight Common Lisp strings. I
was very pleased that Gerd Moellmann pointed out
open-paren-in-column-0-is-defun-start. This now means that lines that
begin with ( are still parsed as a string--it does however appear to be
temperamental, e.g.:

"
(string
 "


(defun test ())

If you delete one of the lines between " and the function definition Emacs
decides to highlight the function as a string. Wait a little while and the
correct parsing flashes by before Emacs decides upon the incorrect
parsing. To get Emacs to correctly interpret the code it appears one has
to edit the string (e.g. delete and reinsert a line in the string)

I still have the problem that lines beginning with [ cause string data to
be parsed as code:

"Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place,
Suite 330, Boston, MA  02111-1307  USA Everyone is permitted to copy and
distribute verbatim copies of this license document, but changing it is
not allowed.

[This is the first released version of the Lesser GPL.  It also counts
 as the successor of the GNU Library Public License, version 2, hence the
 version number 2.1.]

Preamble

The licenses for most software are designed to take away your freedom to
share and change it. By contrast, the GNU General Public Licenses are
intended to guarantee your freedom to share and change free software--to
make sure the software is free for all its users."

One should find that the square bracket in the string has caused the last
two lines of the string to be parsed as code. Additional code after the
closing double quotation mark is interpreted as text.

Adding a backslash before the square bracket gives a semantically
equivalent string yet is properly parsed by Emacs. Is the incorrect
string parsing just a bug? (I'm only familiar with Common Lisp syntax.
Square brackets by themselves have no special significance in Common Lisp
(they are reserved as reader macro characters). I have checked and they
denote vectors in Emacs Lisp. Even so I don't see why they should affect
string parsing).

I'm yet to hack Emacs so figuring out how to fix this would be a
worthwhile exercise. But if someone knows the answer I won't protest :-)

I'm currently using version 21.2-5 in Debian unstable. 

Regards,
Adam


reply via email to

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