all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Major mode for bash shell scripts?
@ 2003-04-10  5:54 Brian Poole
  2003-04-10  7:15 ` Klaus Zeitler
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Poole @ 2003-04-10  5:54 UTC (permalink / raw)


Is there a major mode for bash shell scripts?

If not what is the best way to ensure good indentation in bash shell
scripts?

Thanks

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

* Re: Major mode for bash shell scripts?
  2003-04-10  5:54 Major mode for bash shell scripts? Brian Poole
@ 2003-04-10  7:15 ` Klaus Zeitler
  2003-04-10 16:56   ` Kevin Rodgers
  0 siblings, 1 reply; 4+ messages in thread
From: Klaus Zeitler @ 2003-04-10  7:15 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii (1) Cancerous bugs (2) Illustrious caution (3) Deep-fried simultaneous gasket retributions, Size: 926 bytes --]

>>>>> "Brian" == Brian Poole <nospam@yahoo.com> writes:
    Brian> 
    Brian> Is there a major mode for bash shell scripts?
    Brian> If not what is the best way to ensure good indentation in bash shell
    Brian> scripts?

There's sh-script.el. You can use that for many different shells. Newer
versions also support indentation (not as fancy as c-mode or cperl though).
Didn't like the default indentation though, cause it looked like:

if [ ... ]
    then
    ...
fi

for ...
  do
  ...
done


I had to tweak a few variables to change it to e.g.

if [ ... ]
then
    ...
fi

for ...
do
    ...
done


Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
 ------------------------------------------
---
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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

* Re: Major mode for bash shell scripts?
  2003-04-10  7:15 ` Klaus Zeitler
@ 2003-04-10 16:56   ` Kevin Rodgers
  2003-04-11 13:43     ` Klaus Zeitler
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Rodgers @ 2003-04-10 16:56 UTC (permalink / raw)


Klaus Zeitler wrote:

> I had to tweak a few variables to change it to e.g.
> 
> if [ ... ]
> then
>     ...
> fi
> 
> for ...
> do
>     ...
> done

Could you post your variable settings?  Thanks!


-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

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

* Re: Major mode for bash shell scripts?
  2003-04-10 16:56   ` Kevin Rodgers
@ 2003-04-11 13:43     ` Klaus Zeitler
  0 siblings, 0 replies; 4+ messages in thread
From: Klaus Zeitler @ 2003-04-11 13:43 UTC (permalink / raw)


>>>>> "Kevin" == Kevin Rodgers <ihs_4664@yahoo.com> writes:
    Kevin> 
    Kevin> Klaus Zeitler wrote:
    >> I had to tweak a few variables to change it to e.g.
    >> if [ ... ]
    >> then
    >> ...
    >> fi
    Kevin> Could you post your variable settings?  Thanks!

(setq sh-indent-for-then 0)
(setq sh-indent-for-do 0)
(setq sh-indent-after-do '+)
(setq sh-indent-for-case-label '*)
(setq sh-indent-for-case-alt '+)
(setq sh-indent-comment t)

results in the following layout:

if [ ... ]
then
    ...
else
    ...
fi

while/for ...
do
    ...
done

case ... in
  a)
    ...
    ;;
  *)
esac

and comments will be aligned with the code.


I have one OT question: My last followups to gnu.emacs.bug didn't show up.
Is it not possible anymore to post directly to gnu.emacs.bug and do I
have to send followups to bug-gnu-emacs@gnu.org instead?


Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
 ------------------------------------------
---
You can't start worrying about what's going to happen. You get spastic
enough worrying about what's happening now.           -- Lauren Bacall

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

end of thread, other threads:[~2003-04-11 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-10  5:54 Major mode for bash shell scripts? Brian Poole
2003-04-10  7:15 ` Klaus Zeitler
2003-04-10 16:56   ` Kevin Rodgers
2003-04-11 13:43     ` Klaus Zeitler

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.