all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: seberino@spawar.navy.mil (Christian Seberino)
Subject: Re: How run a command JUST on region highlighted by MOUSE?!?!
Date: 2 Sep 2003 17:19:36 -0700	[thread overview]
Message-ID: <bf23f78f.0309021619.7347703b@posting.google.com> (raw)
In-Reply-To: uad9s9utz.fsf@ID-87814.user.dfncis.de

Oliver 

OK, I got your version to work after replacing (py-comment-region)
with  (py-comment-region beg end).  Can you please
explain the (interactive "r") and why you needed to add 2 args to
function at top?..--> (defun cs-py-comment-region(beg end) ..)

It all works but it would be nice to understand it too! 


Thanks again,

Chris

Oliver Scholz <alkibiades@gmx.de> wrote in message news:<uad9s9utz.fsf@ID-87814.user.dfncis.de>...
> seberino@spawar.navy.mil (Christian Seberino) writes:
> 
> > 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))
>          ^^^^
> 
> [untested]
> 
> (defun cs-py-comment-region (beg end)
>   (interactive "r")
>   (save-restriction
>     (narrow-to-region beg end)
>     (py-comment-region)
>     (delete-trailing-whitespace)))
> 
>     Oliver

  parent reply	other threads:[~2003-09-03  0:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-28 21:24 How run a command JUST on region highlighted by MOUSE?!?! Christian Seberino
2003-08-28 21:32 ` Andrew Taylor
2003-08-29 18:22   ` Christian Seberino
2003-08-29 18:34     ` Oliver Scholz
2003-09-03  0:03       ` Christian Seberino
2003-09-03  0:19       ` Christian Seberino [this message]
2003-08-29 18:56     ` Johan Bockgård
2003-08-29 21:45     ` Kevin Rodgers
2003-09-03  0:16       ` Christian Seberino
2003-09-03 22:04         ` Jeffery B. Rancier
2003-09-03 23:13         ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf23f78f.0309021619.7347703b@posting.google.com \
    --to=seberino@spawar.navy.mil \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.