all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: James Nguyen <jamesn@fastmail.com>
To: Ingo Lohmar <i.lohmar@gmail.com>,
	James Nguyen <jamesn@fastmail.com>,
	27503@debbugs.gnu.org
Subject: bug#27503: 26.0.50; Not lining up Javascript arguments
Date: Tue, 27 Jun 2017 12:42:34 -0700	[thread overview]
Message-ID: <1498592554.2776738.1023241160.654C742F@webmail.messagingengine.com> (raw)
In-Reply-To: <87fuel70up.fsf@acer.localhost.com>

This would effectively be the same as my snippet right? I removed the if
check and the else block to always go into the progn.

This looks good to me unless there are other gotchas. Making it
configurable is ideal.

-- 
  James Nguyen
  jamesn@fastmail.com

On Tue, Jun 27, 2017, at 11:16 AM, Ingo Lohmar wrote:
> I've been meaning to post this for months, guess now is as good a time
> as any.  Here's an alternative take that I've been using for a long time
> without noticing any bugs.  It is a less intrusive change to achieve the
> desired effect AFAICT:
> 
> 
> 
> diff --git i/lisp/progmodes/js.el w/lisp/progmodes/js.el
> index bae9e52bf0..a27db82eb0 100644
> --- i/lisp/progmodes/js.el
> +++ w/lisp/progmodes/js.el
> @@ -475,6 +475,11 @@ js-flat-functions
>    :type 'boolean
>    :group 'js)
>  
> +(defcustom js-cont-nonempty-list-indent-rigidly nil
> +  "Indent continuation of non-empty ([{ lines in `js-mode' rigidly."
> +  :type 'boolean
> +  :group 'js)
> +
>  (defcustom js-comment-lineup-func #'c-lineup-C-comments
>    "Lineup function for `cc-mode-style', for C comments in `js-mode'."
>    :type 'function
> @@ -2092,7 +2097,8 @@ js--proper-indentation
>                   (switch-keyword-p (looking-at
>                   "default\\_>\\|case\\_>[^:]"))
>                   (continued-expr-p (js--continued-expression-p)))
>               (goto-char (nth 1 parse-status)) ; go to the opening char
> -             (if (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
> +             (if (or js-cont-nonempty-list-indent-rigidly
> +                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)"))
>                   (progn ; nothing following the opening paren/bracket
>                     (skip-syntax-backward " ")
>                     (when (eq (char-before) ?\)) (backward-list))





  reply	other threads:[~2017-06-27 19:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27  1:49 bug#27503: 26.0.50; Not lining up Javascript arguments James Nguyen
2017-06-27 18:16 ` Ingo Lohmar
2017-06-27 19:42   ` James Nguyen [this message]
2017-06-27 20:44     ` Ingo Lohmar
2017-06-28  0:45       ` James Nguyen
2017-06-28 10:36     ` Dmitry Gutov
2017-06-28 10:57     ` Nicolas Petton
2017-06-28 10:35   ` Dmitry Gutov
2017-06-28 14:56     ` Ingo Lohmar
2017-06-29  0:52       ` Dmitry Gutov
2017-07-01 11:23         ` Ingo Lohmar
2017-07-03  2:11           ` Dmitry Gutov
2017-07-03 18:05             ` Ingo Lohmar
2017-07-03 18:21               ` Ingo Lohmar
2017-07-03 21:01                 ` Dmitry Gutov
2017-07-03 23:14                   ` James Nguyen
2017-07-03 20:17               ` Dmitry Gutov

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=1498592554.2776738.1023241160.654C742F@webmail.messagingengine.com \
    --to=jamesn@fastmail.com \
    --cc=27503@debbugs.gnu.org \
    --cc=i.lohmar@gmail.com \
    /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.