help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How run a command JUST on region highlighted by MOUSE?!?!


From: Christian Seberino
Subject: Re: How run a command JUST on region highlighted by MOUSE?!?!
Date: 29 Aug 2003 11:22:23 -0700

Andrew

Thanks for the help.  Can I please ask you a related question on usage
of narrow-to-region?

I set .emacs up to run this function when I highlight a region with
mouse
and type C-ac.....

 (defun cs-py-comment-region() (interactive)
      (narrow-to-region)
      (py-comment-region)
      (delete-trailing-whitespace)
      (widen))

I'm getting this error message...

cs-py-comment-region: Wrong number of arguments: #<subr
narrow-to-region>, 0
(New file)
Mark set
cs-py-comment-region: Wrong number of arguments: #<subr
narrow-to-region>, 0

I read Emacs LISP reference manual on narrow-to-region and it said..

Command: narrow-to-region start end
    This function sets the accessible portion of the current buffer to
start at start and end at end. Both arguments should be character
positions.

    In an interactive call, start and end are set to the bounds of the
current region (point and the mark, with the smallest first).


I assume "interactive call" = "highlighted a region with mouse"??

It seems narrow-to-region should get the start and end point values
automatically??!

Can I still make this work?

Any help would be greatly appreciated.

Sincerely,

Chris

Andrew Taylor <ataylor@its.to> wrote in message 
news:<5yu3b.865304$3C2.19502799@news3.calgary.shaw.ca>...
> Christian Seberino wrote:
> > I have a need to run delete-trailing-whitespace on JUST the region
> > highlighted with mouse.  Can I do this??
> 
> Select the region, M-x narrow-to-region, M-x delete-trailing-whitespace, 
>   M-x widen.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]