Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Alterative to tc-indent-region?
@ 2007-07-10  9:56 Svend Tollak Munkejord
  2007-07-10 15:31 ` David Z Maze
  0 siblings, 1 reply; 7+ messages in thread
From: Svend Tollak Munkejord @ 2007-07-10  9:56 UTC (permalink / raw)
  To: info-gnus-english

Hi,

Is there a function in standard No Gnus that resembles
tc-indent-region from Trivial Cite? (I didn't find any.)
tc-indent-region inserts ">" in front of each line, and it is
practical if you want to fix replies to replies made e.g. using
Outlook.

You may say "use tc, then", but I thought I'd try the standard Gnus
functions, since tc does not seem to be maintained anymore.

Regards,
-- 
Svend Tollak Munkejord 

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

* Re: Alterative to tc-indent-region?
  2007-07-10  9:56 Alterative to tc-indent-region? Svend Tollak Munkejord
@ 2007-07-10 15:31 ` David Z Maze
  2007-07-11  6:56   ` Svend Tollak Munkejord
  2007-07-11 19:34   ` Reiner Steib
  0 siblings, 2 replies; 7+ messages in thread
From: David Z Maze @ 2007-07-10 15:31 UTC (permalink / raw)
  To: info-gnus-english

Svend Tollak Munkejord <stm-direct_reply@pvv.org> writes:

> Is there a function in standard No Gnus that resembles
> tc-indent-region from Trivial Cite? (I didn't find any.)
> tc-indent-region inserts ">" in front of each line, and it is
> practical if you want to fix replies to replies made e.g. using
> Outlook.

I might just use M-x replace-regexp ^ > to insert a > at the start of
each line.

(Bizarrely, this is something I know how to do *easier* in vi: move to
start of current region, use C-g to find the current line number, move
to end of region, then do :97,.s/^/>/ where 97 was that earlier line
number to do the same replace-regexp.)

C-h f indent-region talks about indenting non-blank lines with the fill
prefix, which is set via set-fill-prefix, which IIRC is usually bound to
C-x f.  So another approach would be to move after the citation mark on
an earlier line, run M-x set-fill-prefix, then select the section to
quote and run M-x indent-region.

C-h f message- TAB gives me a list of message-related functions (which
is to say, Gnus' message-composition mode) but nothing there jumped out
at me.

  --dzm

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

* Re: Alterative to tc-indent-region?
  2007-07-10 15:31 ` David Z Maze
@ 2007-07-11  6:56   ` Svend Tollak Munkejord
  2007-07-11 19:34   ` Reiner Steib
  1 sibling, 0 replies; 7+ messages in thread
From: Svend Tollak Munkejord @ 2007-07-11  6:56 UTC (permalink / raw)
  To: info-gnus-english

On 2007-07-10, David Z Maze wrote:

> Svend Tollak Munkejord <stm-direct_reply@pvv.org> writes:
>
>> Is there a function in standard No Gnus that resembles
>> tc-indent-region from Trivial Cite? (I didn't find any.)
>> tc-indent-region inserts ">" in front of each line, and it is
>> practical if you want to fix replies to replies made e.g. using
>> Outlook.
>
> I might just use M-x replace-regexp ^ > to insert a > at the start of
> each line.

Thank you. This can surely be used, but it is not quite as easy as
tc-indent-region; sometimes the lines may be indented.

Regards,
-- 
Svend Tollak Munkejord 

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

* Re: Alterative to tc-indent-region?
  2007-07-10 15:31 ` David Z Maze
  2007-07-11  6:56   ` Svend Tollak Munkejord
@ 2007-07-11 19:34   ` Reiner Steib
  2007-07-12  7:05     ` Svend Tollak Munkejord
  1 sibling, 1 reply; 7+ messages in thread
From: Reiner Steib @ 2007-07-11 19:34 UTC (permalink / raw)
  To: info-gnus-english

On Tue, Jul 10 2007, David Z Maze wrote:

> Svend Tollak Munkejord <stm-direct_reply@pvv.org> writes:
>
>> Is there a function in standard No Gnus that resembles
>> tc-indent-region from Trivial Cite? (I didn't find any.)
>> tc-indent-region inserts ">" in front of each line, and it is
>> practical if you want to fix replies to replies made e.g. using
>> Outlook.

,----[ `<f1> k M-;' ]
| M-; runs the command comment-region
|   which is an interactive compiled Lisp function in `newcomment'.
| It is bound to M-;.
| (comment-region beg end &optional arg)
| 
| Comment or uncomment each line in the region.
| With just C-u prefix arg, uncomment each line in region beg .. end.
| Numeric prefix arg means use arg comment characters.
| If arg is negative, delete that many comment characters instead.
| By default, comments start at the left margin, are terminated on each line,
| even for syntax in which newline does not end the comment and blank lines
| do not get comments.  This can be changed with `comment-style'.
| 
| The strings used as comment starts are built from
| `comment-start' without trailing spaces and `comment-padding'.
`----

> I might just use M-x replace-regexp ^ > to insert a > at the start of
> each line.
>
> (Bizarrely, this is something I know how to do *easier* in vi: move to
> start of current region, use C-g to find the current line number, move
> to end of region, then do :97,.s/^/>/ where 97 was that earlier line
> number to do the same replace-regexp.)

At least in Emacs 22, `query-replace' and `query-replace-regexp'
operate on the region.  Less complicated than finding and remembering
the line number, IMO.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: Alterative to tc-indent-region?
  2007-07-11 19:34   ` Reiner Steib
@ 2007-07-12  7:05     ` Svend Tollak Munkejord
  2007-07-12 16:30       ` Reiner Steib
  0 siblings, 1 reply; 7+ messages in thread
From: Svend Tollak Munkejord @ 2007-07-12  7:05 UTC (permalink / raw)
  To: info-gnus-english

On 2007-07-11, Reiner Steib wrote:

> On Tue, Jul 10 2007, David Z Maze wrote:
>
>> Svend Tollak Munkejord <stm-direct_reply@pvv.org> writes:
>>
>>> Is there a function in standard No Gnus that resembles
>>> tc-indent-region from Trivial Cite? (I didn't find any.)
>>> tc-indent-region inserts ">" in front of each line, and it is
>>> practical if you want to fix replies to replies made e.g. using
>>> Outlook.
>
> ,----[ `<f1> k M-;' ]
> | M-; runs the command comment-region
> |   which is an interactive compiled Lisp function in `newcomment'.
> | It is bound to M-;.
> | (comment-region beg end &optional arg)
> | 
> | Comment or uncomment each line in the region.
> | With just C-u prefix arg, uncomment each line in region beg .. end.
> | Numeric prefix arg means use arg comment characters.
> | If arg is negative, delete that many comment characters instead.
> | By default, comments start at the left margin, are terminated on each line,
> | even for syntax in which newline does not end the comment and blank lines
> | do not get comments.  This can be changed with `comment-style'.
> | 
> | The strings used as comment starts are built from
> | `comment-start' without trailing spaces and `comment-padding'.
> `----

Ah, I didn't know that comment-region was this clever. However, this
produces citations with "> > " in front of them. To have ">> "
instead, I set

(add-hook 'message-mode-hook
	  (lambda ()
	    (setq comment-start ">")))

in ~/.gnus

Does that seem to be an OK solution?

Regards,
-- 
Svend Tollak Munkejord 

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

* Re: Alterative to tc-indent-region?
  2007-07-12  7:05     ` Svend Tollak Munkejord
@ 2007-07-12 16:30       ` Reiner Steib
  2007-07-13  6:46         ` Svend Tollak Munkejord
  0 siblings, 1 reply; 7+ messages in thread
From: Reiner Steib @ 2007-07-12 16:30 UTC (permalink / raw)
  To: info-gnus-english

On Thu, Jul 12 2007, Svend Tollak Munkejord wrote:

> (add-hook 'message-mode-hook
> 	  (lambda ()
> 	    (setq comment-start ">")))
>
> in ~/.gnus
>
> Does that seem to be an OK solution?

Your suggestion doesn't work for me: I still get "> > foo".  Another
option is to use rectangle commands: `C-x r t >> SPC RET'
(string-rectangle).  I don't know any better solution; maybe someone
on emacs-devel or gnu.emacs.help knows how to do this using
`newcomment.el'.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: Alterative to tc-indent-region?
  2007-07-12 16:30       ` Reiner Steib
@ 2007-07-13  6:46         ` Svend Tollak Munkejord
  0 siblings, 0 replies; 7+ messages in thread
From: Svend Tollak Munkejord @ 2007-07-13  6:46 UTC (permalink / raw)
  To: info-gnus-english

On 2007-07-12, Reiner Steib wrote:

> On Thu, Jul 12 2007, Svend Tollak Munkejord wrote:
>
>> (add-hook 'message-mode-hook
>> 	  (lambda ()
>> 	    (setq comment-start ">")))
>>
>> in ~/.gnus
>>
>> Does that seem to be an OK solution?
>
> Your suggestion doesn't work for me: I still get "> > foo".  

Sorry, I must have been confused by my own tests. The following should
work, though:

(add-hook 'message-mode-hook
	  (lambda ()
	    (setq comment-start ">")
	    (setq comment-padding "")))

Regards,
-- 
Svend Tollak Munkejord 

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

end of thread, other threads:[~2007-07-13  6:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-10  9:56 Alterative to tc-indent-region? Svend Tollak Munkejord
2007-07-10 15:31 ` David Z Maze
2007-07-11  6:56   ` Svend Tollak Munkejord
2007-07-11 19:34   ` Reiner Steib
2007-07-12  7:05     ` Svend Tollak Munkejord
2007-07-12 16:30       ` Reiner Steib
2007-07-13  6:46         ` Svend Tollak Munkejord

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