* Automatic shell CR escape \ alignment
@ 2011-10-28 21:39 Tracy Reed
2011-10-29 0:53 ` Tim Landscheidt
0 siblings, 1 reply; 2+ messages in thread
From: Tracy Reed @ 2011-10-28 21:39 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 915 bytes --]
Hello all,
When doing something like:
command -option1 reallylongargument \
-option2 evenlongerargumentfoo \
-option3 oddlengthreallylongargument \
-option4 reallylongargument \
I really like to keep my code to 80 columns and line up those line-ending
escape slashes so it looks neat. A few years ago someone showed me a really
cool trick to be used when making shell scripts tidy: When in shell mode you
could do something such that it would handle the column of \ in a special way and
always keep them lined up and move them all in or out together whenever the
length of the longest line changed. I have forgotten how it was done. Anyone
know?
Thanks!
--
Tracy Reed Digital signature attached for your safety.
Copilotco Professionally Managed PCI Compliant Secure Hosting
866-MY-COPILOT x101 http://copilotco.com
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Automatic shell CR escape \ alignment
2011-10-28 21:39 Automatic shell CR escape \ alignment Tracy Reed
@ 2011-10-29 0:53 ` Tim Landscheidt
0 siblings, 0 replies; 2+ messages in thread
From: Tim Landscheidt @ 2011-10-29 0:53 UTC (permalink / raw)
To: help-gnu-emacs
Tracy Reed <treed@edirectpublishing.com> wrote:
> When doing something like:
> command -option1 reallylongargument \
> -option2 evenlongerargumentfoo \
> -option3 oddlengthreallylongargument \
> -option4 reallylongargument \
> I really like to keep my code to 80 columns and line up those line-ending
> escape slashes so it looks neat. A few years ago someone showed me a really
> cool trick to be used when making shell scripts tidy: When in shell mode you
> could do something such that it would handle the column of \ in a special way and
> always keep them lined up and move them all in or out together whenever the
> length of the longest line changed. I have forgotten how it was done. Anyone
> know?
The basic concept is handled by align.el and there, appar-
ently, by basic-line-continuation. I don't know what custom-
izations you need for shell scripts, though (I usually pre-
fer manually calling align-regexp).
Tim
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-10-29 0:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-28 21:39 Automatic shell CR escape \ alignment Tracy Reed
2011-10-29 0:53 ` Tim Landscheidt
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 read-only IMAP folder(s) and NNTP newsgroup(s).