npostavs@users.sourceforge.net wrote: > Antonin Houska writes: > > Even though I have the following customizations in place > > > > '(comment-multi-line t) > > '(comment-style (quote extra-line)) > > > > comment-region command produces this > > > > /* some comment */ > > > > rather than this > > > > /* > > * some comment > > */ > > > > Attached is a patch that I use to fix the issue on my workstation. Besides > > fixing the (supposed) off-by-one error, the patch also removes trailing > > whitespace from the initial line of the comment ("/* "). (My knowledge of > > Elisp is not too advanced so I wonder if there's simpler way to trim > > whitespace from a string.) > > > You can use use `string-trim-right' from subr-x. Thanks. > > (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") > > (<= (point) end)) > > (or block (not (string= "" comment-end))) > > ! (or block (progn (goto-char beg) (search-forward > > ! "\n" > > ! (min (1+ end) (point-max)) t))))) > Maybe (re-search-forward "$" end t) is better? It's a bit unclear to me > what exactly all those tests are looking for. That code could use some > comments... I've just verified your approach - it does work too. Yes, comments would be useful. For the test we're fixing now, the reason seems to be to ensure that the last line of the comment can be broken w/o affecting the following (non-comment) text. Perhaps someone else might come up with better wording. New version of the patch is attached. -- Antonin Houska Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt Web: http://www.postgresql-support.de, http://www.cybertec.at