unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* String recognition in Emacs 21
@ 2003-01-12 15:17 Adam Warner
  2003-01-12 19:46 ` Kai Großjohann
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Warner @ 2003-01-12 15:17 UTC (permalink / raw)


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

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

* Re: String recognition in Emacs 21
  2003-01-12 15:17 String recognition in Emacs 21 Adam Warner
@ 2003-01-12 19:46 ` Kai Großjohann
  0 siblings, 0 replies; 2+ messages in thread
From: Kai Großjohann @ 2003-01-12 19:46 UTC (permalink / raw)


"Adam Warner" <usenet@consulting.net.nz> writes:

> 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.

Is it really impossible to write \( instead of ( in strings when the
open paren would be at the start of a line?  It would surely be the
easiest workaround.
-- 
Ambibibentists unite!

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

end of thread, other threads:[~2003-01-12 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-12 15:17 String recognition in Emacs 21 Adam Warner
2003-01-12 19:46 ` Kai Großjohann

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).