>>>> "VS" == Ville Skytt writes:
VS> On Sun, 2002-08-11 at 04:01, Vasily Korytov wrote:
> I've just wrote a comment-region-or-line function
(analogically to
> upcase-region-or-word, except for argument threating), I think it's
> useful as a keyboard shortcut. And I'm happy to contribute it back to
> the wonderful editor XEmacs. =))
>
> (defun comment-region-or-line (arg)
> "Comment the selected region or the following line."
> (interactive "p")
> (if (region-active-p)
> (comment-region (region-beginning) (region-end) arg)
> (comment-region (line-beginning-position) (line-end-position) arg)))
VS> Thanks, that looks useful. However line-(beginning|end)-position only
VS> exists in XEmacs >= 21.5.7, so they'd have to be replaced with
VS> point-at-bol and point-at-eol for cross version compatibility.
Sorry for late followup. Sure, this has to be done. Thanks for pointing
out at this -- I really didn't know it.
VS> I'm thinking about including this in some of the XEmacs packages, maybe
VS> xemacs-base or edit-utils. Suggestions welcome, about the package, and
VS> the target .el (or should it be put into a new file)...
If I'm not late, I'd suggest it go to edit-utils, not xemacs-base --
it's not a vital thing, anyway. As for .el file... Well... I really have
no ideas.
--
With respect, Vasily Korytov
PGP key fingerprint: A4FE 4665 A720 687F 4ECC 1474 7C16 C498 BAAB C999