unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tom Tromey <tom@tromey.com>
To: 22431@debbugs.gnu.org
Cc: 19399@debbugs.gnu.org
Subject: bug#19399: js mode comment-filling fixlet
Date: Sat, 07 Jan 2017 22:17:13 -0700	[thread overview]
Message-ID: <877f662krq.fsf@tromey.com> (raw)
In-Reply-To: <CAAmKFxegUE6zozaECWWKQgjMc8Dni4=SQwZA4+uf1Nsysv7axQ@mail.gmail.com>

This patch fixes a couple js comment-filling bugs.

Dmitry mentioned comment-line-break-function in bug#22431; this patch
just sets it in js-mode.

For bug#19399, debugging showed that js-mode left
c-block-comment-start-regexp nil, so this sets it to the correct value.

I would normally check this in but I think it should probably be
reviewed.

Tom

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index e3f64a8..375ae9d 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3760,6 +3760,8 @@ js-mode
         c-line-comment-starter "//"
         c-comment-start-regexp "/[*/]\\|\\s!"
         comment-start-skip "\\(//+\\|/\\*+\\)\\s *")
+  (setq-local comment-line-break-function #'c-indent-new-comment-line)
+  (setq-local c-block-comment-start-regexp "\\*/")
 
   (setq-local electric-indent-chars
 	      (append "{}():;," electric-indent-chars)) ;FIXME: js2-mode adds "[]*".





  reply	other threads:[~2017-01-08  5:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-17 19:41 bug#19399: 24.4; fill-paragraph always errors on second slash of // in js-mode Taylor Venable
2017-01-08  5:17 ` Tom Tromey [this message]
2017-01-08  5:45   ` bug#19399: js mode comment-filling fixlet npostavs
2017-01-08  5:58     ` Tom Tromey
2017-01-10  3:40       ` Tom Tromey
2017-01-12  2:12         ` Dmitry Gutov
2017-01-12  3:52           ` Tom Tromey
2017-01-14 17:46 ` bug#19399: done Tom Tromey

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=877f662krq.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=19399@debbugs.gnu.org \
    --cc=22431@debbugs.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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