all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

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.