all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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




      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

* 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.
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.