sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
* but tom-2 repeat cmd feature?
@ 2000-07-27 10:14 Fco. J. Ballesteros
  2000-07-28  1:27 ` Paul Jackson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fco. J. Ballesteros @ 2000-07-27 10:14 UTC (permalink / raw)
  To: sam-fans


Wouldn't it be nice if the button-2 menu could have an entry to repeat
the last command in the ~~sam~~ window?

I found myself repeating <move mouse> <click> "|fmt" just to reformat 
paragraphs in a LaTeX document I was editing. 

Anyone made that change to sam? Or is there a better way to do it?

(Doing a single |fmt when done with the modifications is not an option
because there are sections of the document that shoudn't be fmt'd).

regards

-- 
    ()    ascii ribbon campaign - against html mail 
    /\                          - against microsoft attachments



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

* Re: but tom-2 repeat cmd feature?
  2000-07-27 10:14 but tom-2 repeat cmd feature? Fco. J. Ballesteros
@ 2000-07-28  1:27 ` Paul Jackson
  2000-07-28  6:52 ` Steve Kilbane
  2000-07-29 21:41 ` James A. Robinson
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Jackson @ 2000-07-28  1:27 UTC (permalink / raw)
  To: Fco. J. Ballesteros; +Cc: sam-fans

On Thu, 27 Jul 2000, Fco. J. Ballesteros wrote:
> I found myself repeating <move mouse> <click> "|fmt"
> just to reformat paragraphs ... 

A simple thing I do that helps here -- I have a couple
commands, named "F" and "Q", on my path, which are
trivial shell scripts calling my favorite formating
and quoting (prepend '> ' to each line) filters.

Then the command is reduced a couple of key strokes,
to such as "|F" (both of which are shifted, it happens,
for even less finger calisthenics).

-- 
I won't rest till it's the best ...	   Software Production Engineer
Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj



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

* Re: but tom-2 repeat cmd feature?
  2000-07-27 10:14 but tom-2 repeat cmd feature? Fco. J. Ballesteros
  2000-07-28  1:27 ` Paul Jackson
@ 2000-07-28  6:52 ` Steve Kilbane
  2000-07-29 21:41 ` James A. Robinson
  2 siblings, 0 replies; 4+ messages in thread
From: Steve Kilbane @ 2000-07-28  6:52 UTC (permalink / raw)
  To: sam-fans

> Wouldn't it be nice if the button-2 menu could have an entry to repeat
> the last command in the ~~sam~~ window?

plausibly, but where the does "the last command" start and finish?

> I found myself repeating <move mouse> <click> "|fmt" just to reformat 
> paragraphs in a LaTeX document I was editing. 

After having done a "send" in the sam window, it's the default option
next time around. So four cicks do it:

- single click selects the sam window;
- double-click on b1 selects the whole line
- single click on b2 sends.

> (Doing a single |fmt when done with the modifications is not an option
> because there are sections of the document that shoudn't be fmt'd).

And you can't use y/pattern/ to avoid those parts?

steve




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

* Re: but tom-2 repeat cmd feature?
  2000-07-27 10:14 but tom-2 repeat cmd feature? Fco. J. Ballesteros
  2000-07-28  1:27 ` Paul Jackson
  2000-07-28  6:52 ` Steve Kilbane
@ 2000-07-29 21:41 ` James A. Robinson
  2 siblings, 0 replies; 4+ messages in thread
From: James A. Robinson @ 2000-07-29 21:41 UTC (permalink / raw)
  To: Fco. J. Ballesteros; +Cc: sam-fans

> Wouldn't it be nice if the button-2 menu could have an entry to repeat
> the last command in the ~~sam~~ window?
> 
> I found myself repeating <move mouse> <click> "|fmt" just to reformat 
> paragraphs in a LaTeX document I was editing. 

If I find I have to keep using ~~sam~~ do to the same thing, I just
set dot, double click the command in ~~sam~~ and select send. It is
more mouse movement and clicks than what you are suggesting.

However, I have found that it is normally pretty easy to use sam's
command language to find the patterns I want to format.  For example if
I had a selection


Here is some text that should
be adjusted with fmt

\begin{math}
math != fmt (
	x,
	y,
		z,
	a)
\end{math}

But the above math should not, and certainly
not

\begin{quote}
a
quote
of sorts
\end{quote}


then the regex command 'x/(.+\n)+/v/^\\begin{/|fmt' applied to the
selection will run through the text and fmt only those blocks of text
that don't begin with \begin{.

If you didn't have newline seperators I imagine you could do some fancy
things with ',' and ';' and friends, but I'm not sure what. In those
cases, I normally take a three step process where one regex splits the
text into managable pieces, one regex formats select pieces, and the
last regex recombines the pieces.


Jim


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

end of thread, other threads:[~2000-08-01  1:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-27 10:14 but tom-2 repeat cmd feature? Fco. J. Ballesteros
2000-07-28  1:27 ` Paul Jackson
2000-07-28  6:52 ` Steve Kilbane
2000-07-29 21:41 ` James A. Robinson

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