all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* font-lock "=
@ 2010-05-06 20:23 Roger Mason
  2010-05-06 21:09 ` Lennart Borgman
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Roger Mason @ 2010-05-06 20:23 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I'm trying to write a major mode for amrita.  My mode is derived from
fundamental-mode.  

One of the operators in the language is "=.  That is, quotation marks
followed by the equals sign.  This is currently higlighted as a string
that continues up to the next occurrence of ".  I'd like to turn off
this behaviour and have the character pair "= not highlighted, or
highlighted in some other face.

Can someone suggest how to accomplish this?

Thanks,
Roger


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

* Re: font-lock "=
  2010-05-06 20:23 font-lock "= Roger Mason
@ 2010-05-06 21:09 ` Lennart Borgman
  2010-05-06 22:13 ` Kevin Rodgers
  2010-05-07 13:39 ` Roger Mason
  2 siblings, 0 replies; 6+ messages in thread
From: Lennart Borgman @ 2010-05-06 21:09 UTC (permalink / raw)
  To: Roger Mason; +Cc: help-gnu-emacs

On Thu, May 6, 2010 at 10:23 PM, Roger Mason <rmason@mun.ca> wrote:
> Hello,
>
> I'm trying to write a major mode for amrita.  My mode is derived from
> fundamental-mode.
>
> One of the operators in the language is "=.  That is, quotation marks
> followed by the equals sign.  This is currently higlighted as a string
> that continues up to the next occurrence of ".  I'd like to turn off
> this behaviour and have the character pair "= not highlighted, or
> highlighted in some other face.
>
> Can someone suggest how to accomplish this?


I do not know how to do it, but maybe you can use the text property
syntax-table on the " in "=.




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

* Re: font-lock "=
  2010-05-06 20:23 font-lock "= Roger Mason
  2010-05-06 21:09 ` Lennart Borgman
@ 2010-05-06 22:13 ` Kevin Rodgers
  2010-05-06 22:17   ` Lennart Borgman
  2010-05-07 13:39 ` Roger Mason
  2 siblings, 1 reply; 6+ messages in thread
From: Kevin Rodgers @ 2010-05-06 22:13 UTC (permalink / raw)
  To: help-gnu-emacs

Roger Mason wrote:
> Hello,
> 
> I'm trying to write a major mode for amrita.  My mode is derived from
> fundamental-mode.  
> 
> One of the operators in the language is "=.  That is, quotation marks
> followed by the equals sign.  This is currently higlighted as a string
> that continues up to the next occurrence of ".  I'd like to turn off
> this behaviour and have the character pair "= not highlighted, or
> highlighted in some other face.
> 
> Can someone suggest how to accomplish this?

;; make double quote the same as equals sign:
(modify-syntax-entry ?\" (char-to-string (char-syntax ?=)))

or just

;; change double quote to punctuation:
(modify-syntax-entry ?\" ".")

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: font-lock "=
  2010-05-06 22:13 ` Kevin Rodgers
@ 2010-05-06 22:17   ` Lennart Borgman
  0 siblings, 0 replies; 6+ messages in thread
From: Lennart Borgman @ 2010-05-06 22:17 UTC (permalink / raw)
  To: Kevin Rodgers; +Cc: help-gnu-emacs

On Fri, May 7, 2010 at 12:13 AM, Kevin Rodgers
<kevin.d.rodgers@gmail.com> wrote:
> Roger Mason wrote:
>>
>> Hello,
>>
>> I'm trying to write a major mode for amrita.  My mode is derived from
>> fundamental-mode.
>> One of the operators in the language is "=.  That is, quotation marks
>> followed by the equals sign.  This is currently higlighted as a string
>> that continues up to the next occurrence of ".  I'd like to turn off
>> this behaviour and have the character pair "= not highlighted, or
>> highlighted in some other face.
>>
>> Can someone suggest how to accomplish this?
>
> ;; make double quote the same as equals sign:
> (modify-syntax-entry ?\" (char-to-string (char-syntax ?=)))
>
> or just
>
> ;; change double quote to punctuation:
> (modify-syntax-entry ?\" ".")



It looks like amrita has subcode from other languages so that will
probably not work.




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

* Re: font-lock "=
  2010-05-06 20:23 font-lock "= Roger Mason
  2010-05-06 21:09 ` Lennart Borgman
  2010-05-06 22:13 ` Kevin Rodgers
@ 2010-05-07 13:39 ` Roger Mason
  2010-05-07 20:25   ` Lennart Borgman
  2 siblings, 1 reply; 6+ messages in thread
From: Roger Mason @ 2010-05-07 13:39 UTC (permalink / raw)
  To: help-gnu-emacs

Many thanks for the replies.  I've implemented (modify-syntax-entry ?\"
".") and that seems to work.

As Lennart noted, amrita uses various programming languages.  In the
longer term I'd like to use some kind of multi-mode to support the
various language sections that might be present in a buffer.

Thanks again,
Roger


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

* Re: font-lock "=
  2010-05-07 13:39 ` Roger Mason
@ 2010-05-07 20:25   ` Lennart Borgman
  0 siblings, 0 replies; 6+ messages in thread
From: Lennart Borgman @ 2010-05-07 20:25 UTC (permalink / raw)
  To: Roger Mason; +Cc: help-gnu-emacs

On Fri, May 7, 2010 at 3:39 PM, Roger Mason <rmason@mun.ca> wrote:
> Many thanks for the replies.  I've implemented (modify-syntax-entry ?\"
> ".") and that seems to work.
>
> As Lennart noted, amrita uses various programming languages.  In the
> longer term I'd like to use some kind of multi-mode to support the
> various language sections that might be present in a buffer.

If you send me an example I can see how it works in multi major mode.




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

end of thread, other threads:[~2010-05-07 20:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-06 20:23 font-lock "= Roger Mason
2010-05-06 21:09 ` Lennart Borgman
2010-05-06 22:13 ` Kevin Rodgers
2010-05-06 22:17   ` Lennart Borgman
2010-05-07 13:39 ` Roger Mason
2010-05-07 20:25   ` Lennart Borgman

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.