--- Begin Message ---
Subject: |
(un)comment-line macros |
Date: |
Tue, 12 Jan 2010 20:39:39 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Hi,
I wrote the following two very simple macros. Nevertheless, I find them
very useless, and would be pleased if you could include them in a future
version of emacs.
(defun comment-line ()
"comments the line"
(interactive)
(let ((start (point-at-bol))
(end (point-at-eol)))
(save-excursion
(indent-region start end)
(comment-region start end)
(if (not (string= major-mode "text-mode"))
(indent-for-tab-command)))))
(defun uncomment-line ()
"uncomments the current line"
(interactive)
(let ((start (point-at-bol))
(end (point-at-eol)))
(save-excursion
(uncomment-region start end)
(if (not (string= major-mode "text-mode"))
(indent-region start end)))))
I bound them to "C-c l" and "C-c u" respectively.
Yours sincerely,
Mads Jensen
signature.asc
Description: OpenPGP digital signature
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#5366: (un)comment-line macros |
Date: |
Thu, 06 Oct 2011 03:50:22 -0400 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
tags 5366 wontfix
stop
Thanks for sending them, but I don't think Emacs needs these commands.
--- End Message ---