all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Highlight parent if--else
@ 2008-07-31  1:30 Will Chang
  0 siblings, 0 replies; 5+ messages in thread
From: Will Chang @ 2008-07-31  1:30 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

Hi all,

I knew highlight-parentheses can highlight the parent ( { or[. Is it
possible to highlight the parent key words.

for example:

I often write some pl-sql like this.

IF piNum>0 THEN

ELSEIF piNum =-1 THEN

ELSE

END IF.

Can we highlight IF, ELSE END IF just like highlight-parentheses?

Thanks for your help.

[-- Attachment #2: Type: text/html, Size: 581 bytes --]

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

* Re: Highlight parent if--else
       [not found] <mailman.15620.1217467820.18990.help-gnu-emacs@gnu.org>
@ 2008-07-31  8:12 ` Xah
  2008-07-31  8:59   ` Nikolaj Schumacher
  0 siblings, 1 reply; 5+ messages in thread
From: Xah @ 2008-07-31  8:12 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 30, 6:30 pm, "Will Chang" <changwei...@gmail.com> wrote:
> Hi all,
>
> I knew highlight-parentheses can highlight the parent ( { or[. Is it
> possible to highlight the parent key words.
>
> for example:
>
> I often write some pl-sql like this.
>
> IF piNum>0 THEN
>
> ELSEIF piNum =-1 THEN
>
> ELSE
>
> END IF.
>
> Can we highlight IF, ELSE END IF just like highlight-parentheses?

From recent discussion on exactly this few months ago, the short
answer is that currently there's no elisp code that do what you want.

However, it is possible to write one that does that by using elisp's
syntax table.

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Highlight parent if--else
  2008-07-31  8:12 ` Highlight parent if--else Xah
@ 2008-07-31  8:59   ` Nikolaj Schumacher
  2008-07-31 10:07     ` Will Chang
       [not found]     ` <mailman.15639.1217498843.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Nikolaj Schumacher @ 2008-07-31  8:59 UTC (permalink / raw)
  To: Xah; +Cc: help-gnu-emacs

Xah <xahlee@gmail.com> wrote:

> On Jul 30, 6:30 pm, "Will Chang" <changwei...@gmail.com> wrote:
>> Can we highlight IF, ELSE END IF just like highlight-parentheses?
>
> However, it is possible to write one that does that by using elisp's
> syntax table.

I don't think so.  Syntax tables can only match single characters.

One would have to write versions of `up-list' and maybe `forward-sexp'.
The rest can be done with existing code.


regards,
Nikolaj Schumacher




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

* Re: Highlight parent if--else
  2008-07-31  8:59   ` Nikolaj Schumacher
@ 2008-07-31 10:07     ` Will Chang
       [not found]     ` <mailman.15639.1217498843.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Will Chang @ 2008-07-31 10:07 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]

both sql and ruby use if..else.... I think this feature is very useful.

But I just don't how to implement it. I am new comer to emacs.

Someone can give me more details to implement it? Thanks.



On Thu, Jul 31, 2008 at 4:59 PM, Nikolaj Schumacher <n_schumacher@web.de>wrote:

> Xah <xahlee@gmail.com> wrote:
>
> > On Jul 30, 6:30 pm, "Will Chang" <changwei...@gmail.com> wrote:
> >> Can we highlight IF, ELSE END IF just like highlight-parentheses?
> >
> > However, it is possible to write one that does that by using elisp's
> > syntax table.
>
> I don't think so.  Syntax tables can only match single characters.
>
> One would have to write versions of `up-list' and maybe `forward-sexp'.
> The rest can be done with existing code.
>
>
> regards,
> Nikolaj Schumacher
>
>
>

[-- Attachment #2: Type: text/html, Size: 1372 bytes --]

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

* Re: Highlight parent if--else
       [not found]     ` <mailman.15639.1217498843.18990.help-gnu-emacs@gnu.org>
@ 2008-07-31 12:04       ` Xah
  0 siblings, 0 replies; 5+ messages in thread
From: Xah @ 2008-07-31 12:04 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 31, 3:07 am, "Will Chang" <changwei...@gmail.com> wrote:
> I knew highlight-parentheses can highlight the parent ( { or[.

> Is it possible to highlight the parent key words.

> both sql and ruby use if..else.... I think this feature is very useful.
>
> But I just don't how to implement it. I am new comer to emacs.
>
> Someone can give me more details to implement it? Thanks.

the thread is here:

Newsgroups: gnu.emacs.help
Date: Sun, 30 Dec 2007 17:02:01 -0600
Subject: jump between if-fi

http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/71aefbc6b1684c38/

It would be rather a major project i think.

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-07-31 12:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.15620.1217467820.18990.help-gnu-emacs@gnu.org>
2008-07-31  8:12 ` Highlight parent if--else Xah
2008-07-31  8:59   ` Nikolaj Schumacher
2008-07-31 10:07     ` Will Chang
     [not found]     ` <mailman.15639.1217498843.18990.help-gnu-emacs@gnu.org>
2008-07-31 12:04       ` Xah
2008-07-31  1:30 Will Chang

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.