Gnus development mailing list
 help / color / mirror / Atom feed
* make emacs handle 'if fi' like it does parens
@ 2022-02-12 15:50 hput
  2022-02-12 16:35 ` Eric Abrahamsen
  0 siblings, 1 reply; 3+ messages in thread
From: hput @ 2022-02-12 15:50 UTC (permalink / raw)
  To: ding

Version: GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit,\
cairo version 1.16.0, Xaw3d scroll bars) of 2021-11-05

Seems like google is getting harder and harder to find the right
strings to unearth wanted info.

We have a fine manual but it doesn't respond well to the hill-billy
strings my imagination supplies when using the info 'i' or 's'
searches. 

At any rate, I'm not having much luck looking for ways to make emacs
handle 'if', 'fi' in any shell-scripting mode, like it does parens in
things like cperl-mode.

I'd like to be able to jump between matching `if fi' and have the
matching pardner hilite as when putting cursor just after closing
paren.

If it is possible using standard emacs commands already, maybe
someone will be kind enough to mention the combinations?  If not, then
.. where might I find code that does what I'm after?




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

* Re: make emacs handle 'if fi' like it does parens
  2022-02-12 15:50 make emacs handle 'if fi' like it does parens hput
@ 2022-02-12 16:35 ` Eric Abrahamsen
  2022-02-13 14:28   ` hput
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Abrahamsen @ 2022-02-12 16:35 UTC (permalink / raw)
  To: ding

hput <hputn3@zohomail.com> writes:

> Version: GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit,\
> cairo version 1.16.0, Xaw3d scroll bars) of 2021-11-05
>
> Seems like google is getting harder and harder to find the right
> strings to unearth wanted info.
>
> We have a fine manual but it doesn't respond well to the hill-billy
> strings my imagination supplies when using the info 'i' or 's'
> searches. 
>
> At any rate, I'm not having much luck looking for ways to make emacs
> handle 'if', 'fi' in any shell-scripting mode, like it does parens in
> things like cperl-mode.
>
> I'd like to be able to jump between matching `if fi' and have the
> matching pardner hilite as when putting cursor just after closing
> paren.
>
> If it is possible using standard emacs commands already, maybe
> someone will be kind enough to mention the combinations?  If not, then
> .. where might I find code that does what I'm after?

(This probably should have gone to emacs.help, not emacs.gnus.general,
fwiw)

A brief test indicates that `forward-sexp' and `backward-sexp', bound to
C-M-f and C-M-b, do what you want.



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

* Re: make emacs handle 'if fi' like it does parens
  2022-02-12 16:35 ` Eric Abrahamsen
@ 2022-02-13 14:28   ` hput
  0 siblings, 0 replies; 3+ messages in thread
From: hput @ 2022-02-13 14:28 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

>> I'd like to be able to jump between matching `if fi' and have the
>> matching pardner hilite as when putting cursor just after closing
>> paren.
>>
>> If it is possible using standard emacs commands already, maybe
>> someone will be kind enough to mention the combinations?  If not, then
>> .. where might I find code that does what I'm after?
>
> (This probably should have gone to emacs.help, not emacs.gnus.general,
> fwiw)

Sorry, that was actually the intent .. had cursor on wrong group when
pressing `C-u a' and neglected to check the headers for rightness. 

> A brief test indicates that `forward-sexp' and `backward-sexp', bound to
> C-M-f and C-M-b, do what you want.


That works great but only C-M_f.  C-M-f plows thru a number of lines of code
and finds the correct 'fi'.

And just resting cursor on the `if'  lights up its `fi' pardner.


But C-M-b  Stops at the first '[[', 'while', 'done','read' etc that
occurs in code above.  And sadly never finds the
corresponding  'if'

Further, even C-M-f does nothing but hilight `elif' does'nt track to
next 'elif' or 'fi' 

WHOOPs I've wondered off ... and discussing on the wrong group
again...

I'll take any more commentary to 'emacs.help'

Thanks for the commands... C-M-f is proving to be a big help.



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

end of thread, other threads:[~2022-02-13 14:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-12 15:50 make emacs handle 'if fi' like it does parens hput
2022-02-12 16:35 ` Eric Abrahamsen
2022-02-13 14:28   ` hput

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 NNTP newsgroup(s).