unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Placing " at beginning and end of line?
@ 2015-03-19 13:45 Sharon Kimble
  2015-03-19 13:52 ` Tassilo Horn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sharon Kimble @ 2015-03-19 13:45 UTC (permalink / raw)
  To: help-gnu-emacs

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

How can I place " at the beginning of a line, and " at the end of a
line, in a highlighted region please? This is a block of 10+ lines,
and I need quotes from the beginning and end of each line.

I have a block of text, which is a latex preamble, as part of an org-mode
init file, which is tangled and creates my "init.el".

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
my git repo = https://bitbucket.org/boudiccas/dots
TGmeds = http://www.tgmeds.org.uk
Debian testing, fluxbox 1.3.7, emacs 24.4.1.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

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

* Re: Placing " at beginning and end of line?
  2015-03-19 13:45 Placing " at beginning and end of line? Sharon Kimble
@ 2015-03-19 13:52 ` Tassilo Horn
  2015-03-19 13:55 ` Yuri Khan
  2015-03-19 15:12 ` Nicolas Richard
  2 siblings, 0 replies; 4+ messages in thread
From: Tassilo Horn @ 2015-03-19 13:52 UTC (permalink / raw)
  To: Sharon Kimble; +Cc: help-gnu-emacs

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

Sharon Kimble <boudiccas@skimble.plus.com> writes:

Hi Sharon,

> How can I place " at the beginning of a line, and " at the end of a
> line, in a highlighted region please? This is a block of 10+ lines,
> and I need quotes from the beginning and end of each line.

I'd use a keyboard macro for that:

<f3>  ;; start recording
C-a   ;; goto beginning of line
"     ;; insert double-quote
C-e   ;; goto end of line
"     ;; insert double-quote
C-n   ;; goto next line
<f4>  ;; stop recording

Then you can hit <f4> repeatedly until all your lines are quoted.

HTH,
Tassilo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 212 bytes --]

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

* Re: Placing " at beginning and end of line?
  2015-03-19 13:45 Placing " at beginning and end of line? Sharon Kimble
  2015-03-19 13:52 ` Tassilo Horn
@ 2015-03-19 13:55 ` Yuri Khan
  2015-03-19 15:12 ` Nicolas Richard
  2 siblings, 0 replies; 4+ messages in thread
From: Yuri Khan @ 2015-03-19 13:55 UTC (permalink / raw)
  To: Sharon Kimble; +Cc: help-gnu-emacs

On Thu, Mar 19, 2015 at 7:45 PM, Sharon Kimble
<boudiccas@skimble.plus.com> wrote:
> How can I place " at the beginning of a line, and " at the end of a
> line, in a highlighted region please? This is a block of 10+ lines,
> and I need quotes from the beginning and end of each line.

Probably easiest would be to replace-regexp (C-M-%) .* with "\&".



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

* Re: Placing " at beginning and end of line?
  2015-03-19 13:45 Placing " at beginning and end of line? Sharon Kimble
  2015-03-19 13:52 ` Tassilo Horn
  2015-03-19 13:55 ` Yuri Khan
@ 2015-03-19 15:12 ` Nicolas Richard
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolas Richard @ 2015-03-19 15:12 UTC (permalink / raw)
  To: Sharon Kimble; +Cc: help-gnu-emacs

Sharon Kimble <boudiccas@skimble.plus.com> writes:

> How can I place " at the beginning of a line, and " at the end of a
> line, in a highlighted region please? This is a block of 10+ lines,
> and I need quotes from the beginning and end of each line.
>
> I have a block of text, which is a latex preamble, as part of an org-mode
> init file, which is tangled and creates my "init.el".

Another way is: C-M-% ^\|$ RET " RET
(i.e. replace all beginning of line and all end of line by a
double-quote character)

Yet another way would be using magnars' multiple-cursors-mode (available
from your favourite ELPA repository) : M-x mc/edit-lines (I have it bound to
"C-c e"), then do: " C-e " RET.

The added advantage of this solution is that it makes you feel extremely
powerful...

HTH,

-- 
Nicolas



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

end of thread, other threads:[~2015-03-19 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-19 13:45 Placing " at beginning and end of line? Sharon Kimble
2015-03-19 13:52 ` Tassilo Horn
2015-03-19 13:55 ` Yuri Khan
2015-03-19 15:12 ` Nicolas Richard

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).