From: Thorsten Jolitz <tjolitz@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Bug in comment-region?
Date: Thu, 04 Feb 2016 22:53:47 +0100 [thread overview]
Message-ID: <87io24xhuc.fsf@gmail.com> (raw)
In-Reply-To: 877fil2u8k.fsf@debian.uxu
Emanuel Berg <embe8573@student.uu.se> writes:
> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> which looks like a bug to me - the comment chars
>> should always be at BOL, shouldn't they?
>
> Try this:
>
> (setq comment-styles '(plain . (nil nil nil nil "Start comment at
> BOL.")))
So its a feature not a bug, thanks for the hint. I used
,----
| (defun outshine-comment-region (beg end &optional arg)
| "Use comment-style that always inserts at BOL.
| Call `comment-region' with a comment-style that guarantees
| insertion of comment-start markers at beginning-of-line."
| (interactive "r")
| (let ((comment-style
| (if (member comment-style '(indent-or-triple indent))
| 'plain
| comment-style)))
| (comment-region beg end arg)))
`----
now, because normally outshine should be major-mode agnostic and just
use the comment settings of the programming mode at hand. Only tested
with Emacs Lisp though ...
--
cheers,
Thorsten
prev parent reply other threads:[~2016-02-04 21:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-03 22:51 Bug in comment-region? Thorsten Jolitz
2016-02-04 0:26 ` Emanuel Berg
2016-02-04 0:29 ` Emanuel Berg
2016-02-04 21:53 ` Thorsten Jolitz [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87io24xhuc.fsf@gmail.com \
--to=tjolitz@gmail.com \
--cc=help-gnu-emacs@gnu.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).