all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nikos Apostolakis <absent@sdf.lonestar.org>
Subject: Re: Delete comments in region
Date: Fri, 21 Apr 2006 22:53:24 -0400	[thread overview]
Message-ID: <87y7xymicb.fsf@sdf.lonestar.org> (raw)
In-Reply-To: 44498748.9000905@stygian.net

Denis Bueno <dbueno@gmail.com> writes:

> Nikos Apostolakis wrote:
>
> I want to *zap* the comment entirely. Delete the comment syntax and
> the text of the comment itself. Not just remove the comment syntax
> around the comment text.
>

Ah! I see.


> ;; the following keys should all be entered in succession, but
> ;; they are commented for ease of viewing
> C-x ( ; start macro
> M-x kill-comment RET C-x )
>
> ;; Then, on the code whose comments need to be zapped:
> C-x e e e e e e ;;; as many e's as necessary

How about

(defun nea-kill-all-comments-in-buffer ()
       "Kill all comments in buffer."
       (interactive)
       (save-excursion
	 (beginning-of-buffer)
	 (kill-comment 
	(count-lines (point-min) (point-max)))))    

Or slightly more general:

(defun nea-kill-all-comments-in-region (begin end)
       "Kill all comments in region."
       (interactive "r")
       (save-excursion
	 (goto-char begin)
       (kill-comment (count-lines begin end))))

Note that this is not really tested.
HTH,
Nikos

>
> -Denis

  reply	other threads:[~2006-04-22  2:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-22  0:40 Delete comments in region Denis Bueno
2006-04-22  1:05 ` Nikos Apostolakis
2006-04-22  1:30   ` Denis Bueno
2006-04-22  2:53     ` Nikos Apostolakis [this message]
     [not found]   ` <mailman.755.1145669452.9609.help-gnu-emacs@gnu.org>
2006-04-22 20:30     ` liyer.vijay
     [not found] <mailman.750.1145666443.9609.help-gnu-emacs@gnu.org>
2006-04-25  9:05 ` Mathias Dahl

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=87y7xymicb.fsf@sdf.lonestar.org \
    --to=absent@sdf.lonestar.org \
    /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.