all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Elisp syntax hilighting problem
@ 2006-04-22  0:16 Lennart Borgman
  2006-04-22 15:13 ` Andreas Schwab
  2006-04-23 14:05 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Lennart Borgman @ 2006-04-22  0:16 UTC (permalink / raw)


The defconst below sometimes upset the syntax highlighting so that the 
function following it is in the same face as the string:

(defconst rng-in-attribute-value-regex
  (replace-regexp-in-string
   "w"
   xmltok-ncname-regexp
   "<w\\(?::w\\)?\
\\(?:[ \t\r\n]+w\\(?::w\\)?[ \t\r\n]*=\
[ \t\r\n]*\\(?:\"[^\"]*\"\\|'[^']*'\\)\\)*\
[ \t\r\n]+\\(w\\(:w\\)?\\)[ \t\r\n]*=[ \t\r\n]*\
\\(\"[^\"]*\\|'[^']*\\)\\="
   t
   t))


More problems: The \\= is not marked. The two [ at beginning of line is marked with a red face.

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

* Re: Elisp syntax hilighting problem
  2006-04-22  0:16 Elisp syntax hilighting problem Lennart Borgman
@ 2006-04-22 15:13 ` Andreas Schwab
  2006-04-22 23:22   ` Lennart Borgman
  2006-04-23 14:05 ` Stefan Monnier
  1 sibling, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2006-04-22 15:13 UTC (permalink / raw)
  Cc: Emacs Devel

Lennart Borgman <lennart.borgman.073@student.lu.se> writes:

> The defconst below sometimes upset the syntax highlighting so that the
> function following it is in the same face as the string:

I cannot reproduce that here.  Can you give more details about the
situation where it occurs?

> (defconst rng-in-attribute-value-regex
>  (replace-regexp-in-string
>   "w"
>   xmltok-ncname-regexp
>   "<w\\(?::w\\)?\
> \\(?:[ \t\r\n]+w\\(?::w\\)?[ \t\r\n]*=\
> [ \t\r\n]*\\(?:\"[^\"]*\"\\|'[^']*'\\)\\)*\
> [ \t\r\n]+\\(w\\(:w\\)?\\)[ \t\r\n]*=[ \t\r\n]*\
> \\(\"[^\"]*\\|'[^']*\\)\\="
>   t
>   t))
>
>
> More problems: The \\= is not marked.

There are no builtin rules for marking this.  Only grouping constructs
have special faces.

> The two [ at beginning of line is marked with a red face.

This is a feature.  It marks characters (by default those of open paren
syntax at the start of a line) that breaks the simple-minded parsing of
beginning-of-defun.  Prepend a backslash to avoid that.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Elisp syntax hilighting problem
  2006-04-22 15:13 ` Andreas Schwab
@ 2006-04-22 23:22   ` Lennart Borgman
  0 siblings, 0 replies; 4+ messages in thread
From: Lennart Borgman @ 2006-04-22 23:22 UTC (permalink / raw)
  Cc: Emacs Devel

Andreas Schwab wrote:
> Lennart Borgman <lennart.borgman.073@student.lu.se> writes:
>
>   
>> The defconst below sometimes upset the syntax highlighting so that the
>> function following it is in the same face as the string:
>>     
>
> I cannot reproduce that here.  Can you give more details about the
> situation where it occurs?
>   
I happens sometimes but not always. One way I have seen to reproduce it 
is to delete the line after defconst and before next declaration. I just 
tested it - it worked for me a couple of times (ie I could see the 
problem) and then everything looked ok again.
>   
>> (defconst rng-in-attribute-value-regex
>>  (replace-regexp-in-string
>>   "w"
>>   xmltok-ncname-regexp
>>   "<w\\(?::w\\)?\
>> \\(?:[ \t\r\n]+w\\(?::w\\)?[ \t\r\n]*=\
>> [ \t\r\n]*\\(?:\"[^\"]*\"\\|'[^']*'\\)\\)*\
>> [ \t\r\n]+\\(w\\(:w\\)?\\)[ \t\r\n]*=[ \t\r\n]*\
>> \\(\"[^\"]*\\|'[^']*\\)\\="
>>   t
>>   t))
>>
>>
>> More problems: The \\= is not marked.
>>     
>
> There are no builtin rules for marking this.  Only grouping constructs
> have special faces.
>   
Oh, I see. Maybe it should be marked?
>   
>> The two [ at beginning of line is marked with a red face.
>>     
>
> This is a feature.  It marks characters (by default those of open paren
> syntax at the start of a line) that breaks the simple-minded parsing of
> beginning-of-defun.  Prepend a backslash to avoid that.
>   
Thanks.

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

* Re: Elisp syntax hilighting problem
  2006-04-22  0:16 Elisp syntax hilighting problem Lennart Borgman
  2006-04-22 15:13 ` Andreas Schwab
@ 2006-04-23 14:05 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2006-04-23 14:05 UTC (permalink / raw)
  Cc: Emacs Devel

> The defconst below sometimes upset the syntax highlighting so that the
> function following it is in the same face as the string:
[...]
> More problems: The \\= is not marked. The two [ at beginning of line is
> marked with a red face.

The warning (red) face is used to warn you that this part of the code can
cause the problem you mention.


        Stefan

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

end of thread, other threads:[~2006-04-23 14:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-22  0:16 Elisp syntax hilighting problem Lennart Borgman
2006-04-22 15:13 ` Andreas Schwab
2006-04-22 23:22   ` Lennart Borgman
2006-04-23 14:05 ` Stefan Monnier

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.