all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Commenting empty lines
@ 2021-05-17 20:29 ludvig-faddeev
  2021-05-18 11:31 ` Eli Zaretskii
  2021-05-22  4:32 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 3+ messages in thread
From: ludvig-faddeev @ 2021-05-17 20:29 UTC (permalink / raw)
  To: Help Gnu Emacs

Have made a keybinding for commenting lines like this

(global-set-key (kbd "C-;") (kbd "C-x C-;"))

This means that hitting "C-;" multiple times will comment and uncomment the line.

But when there is an empty line I want to insert the comment symbol, because
using "C-;" does not introduce the comment mark.






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Commenting empty lines
  2021-05-17 20:29 Commenting empty lines ludvig-faddeev
@ 2021-05-18 11:31 ` Eli Zaretskii
  2021-05-22  4:32 ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2021-05-18 11:31 UTC (permalink / raw)
  To: help-gnu-emacs

> From: ludvig-faddeev@gmx.com
> Date: Mon, 17 May 2021 22:29:35 +0200
> 
> Have made a keybinding for commenting lines like this
> 
> (global-set-key (kbd "C-;") (kbd "C-x C-;"))
> 
> This means that hitting "C-;" multiple times will comment and uncomment the line.
> 
> But when there is an empty line I want to insert the comment symbol, because
> using "C-;" does not introduce the comment mark.

Did you try setting comment-empty-lines to a non-nil value?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Commenting empty lines
  2021-05-17 20:29 Commenting empty lines ludvig-faddeev
  2021-05-18 11:31 ` Eli Zaretskii
@ 2021-05-22  4:32 ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 3+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-22  4:32 UTC (permalink / raw)
  To: help-gnu-emacs

ludvig-faddeev wrote:

> Have made a keybinding for commenting lines like this
>
> (global-set-key (kbd "C-;") (kbd "C-x C-;"))
>
> This means that hitting "C-;" multiple times will comment
> and uncomment the line.
>
> But when there is an empty line I want to insert the comment
> symbol, because using "C-;" does not introduce the
> comment mark.

Heh, creative! How does that work, I always wanted the "rapid
fire" interface in mpv for example, fast forward one time 1,
but two times and three times 1, 2, 4, not 1+1+1...

Anyway here, I think you look for `comment-empty-lines'?

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-22  4:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-17 20:29 Commenting empty lines ludvig-faddeev
2021-05-18 11:31 ` Eli Zaretskii
2021-05-22  4:32 ` Emanuel Berg via Users list for the GNU Emacs text editor

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.