From: Stefan Monnier <monnier@iro.umontreal.ca>
To: uu1101@gmail.com
Cc: 17619@debbugs.gnu.org
Subject: bug#17619: 24.3; js-indent-line mixes display position with character position
Date: Sat, 31 May 2014 21:30:23 -0400 [thread overview]
Message-ID: <jwvr439ju2z.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <86sint4vlk.fsf@gmail.com> (uu's message of "Wed, 28 May 2014 20:16:39 +0200")
> `js-indent-line' mixes up display column with character count.
Indeed.
> I am using the following modification to work-around the issue, although
[..]
> (offset (- current-char-position (current-indentation))))
This still mixes char counts and column counts. I used the patch
below instead.
Stefan
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2014-05-31 20:02:47 +0000
+++ lisp/ChangeLog 2014-06-01 01:27:03 +0000
@@ -1,3 +1,8 @@
+2014-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/js.el (js-indent-line): Don't mix columns and chars
+ (bug#17619).
+
2014-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (set-transient-map): Don't wait for some "nested"
=== modified file 'lisp/progmodes/js.el'
--- lisp/progmodes/js.el 2014-05-01 23:55:25 +0000
+++ lisp/progmodes/js.el 2014-06-01 01:29:02 +0000
@@ -1907,7 +1907,7 @@
(interactive)
(let* ((parse-status
(save-excursion (syntax-ppss (point-at-bol))))
- (offset (- (current-column) (current-indentation))))
+ (offset (- (point) (save-excursion (back-to-indentation) (point)))))
(indent-line-to (js--proper-indentation parse-status))
(when (> offset 0) (forward-char offset))))
prev parent reply other threads:[~2014-06-01 1:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 18:16 bug#17619: 24.3; js-indent-line mixes display position with character position uu1101
2014-06-01 1:30 ` Stefan Monnier [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=jwvr439ju2z.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=17619@debbugs.gnu.org \
--cc=uu1101@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.