GNU bug report logs - #2481
23.0.91; javascript-mode indentation weirdness

Previous Next

Package: notemacs;

Reported by: Pat Maddox <pat.maddox <at> gmail.com>

Date: Thu, 26 Feb 2009 10:05:06 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 2481 in the body.
You can then email your comments to 2481 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2481; Package emacs. (Thu, 26 Feb 2009 10:05:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pat Maddox <pat.maddox <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 26 Feb 2009 10:05:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Pat Maddox <pat.maddox <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.91; javascript-mode indentation weirdness
Date: Thu, 26 Feb 2009 02:00:10 -0800
If I'm on the last line of a file in javascript-mode and press tab to
indent, it beeps and says "End of buffer".  This doesn't happen in any
other modes as far as I can tell.

There's another problem with indentation or parsing, I'm not sure if
it's related or not...I've written some code to automatically format
braces:

(add-hook 'javascript-mode-hook
          (lambda ()
            (textmate-mode)
            (local-set-key "\r"
                           (lambda () (interactive)
                             (insert-line-before-closing-braces)
                             (newline-and-indent)))))

(defun insert-line-before-closing-braces ()
  (interactive)
  (save-excursion
    (let ((content (buffer-substring (point) (line-end-position))))
      (if (and (> (length content) 0)
               (string= (replace-regexp-in-string ")\\\|}" "" content)  ""))
          (newline-and-indent)))))

If I'm on the first line of a file and type (), and move between the
parens and press return, I get an error.  It works fine in every other
mode I've tried, or on any line other than #1.  Here's the error

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  =(nil 41)
  (if (= (char-before) 41) (progn (backward-list)))
  (when (= (char-before) 41) (backward-list))
  (progn (skip-syntax-backward " ") (when (= ... 41) (backward-list))
(back-to-indentation) (cond (same-indent-p ...) (continued-expr-p ...)
(t ...)))
  (if (looking-at "[({[][ 	]*\\(/[/*]\\|$\\)") (progn
(skip-syntax-backward " ") (when ... ...) (back-to-indentation) (cond
... ... ...)) (unless same-indent-p (forward-char) (skip-chars-forward
" 	")) (current-column))
  (cond (ctrl-stmt-indent) ((js-continued-var-decl-list-p)
(js-re-search-backward "\\<var\\>" nil t) (+ ...
javascript-indent-level)) ((nth 1 parse-status) (goto-char ...) (if
... ... ... ...)) (continued-expr-p javascript-indent-level) (t (let
... ... ind)))
  (let ((ctrl-stmt-indent ...) (same-indent-p ...) (continued-expr-p
...)) (cond (ctrl-stmt-indent) (... ... ...) (... ... ...)
(continued-expr-p javascript-indent-level) (t ...)))
  (save-excursion (back-to-indentation) (let (... ... ...) (cond ...
... ... ... ...)))
  js-proper-indentation((1 1 nil nil nil nil 0 nil nil (1)))
  (indent-line-to (js-proper-indentation parse-status))
  (progn (indent-line-to (js-proper-indentation parse-status)) (when
(> offset 0) (forward-char offset)))
  (if (not (nth 8 parse-status)) (progn (indent-line-to ...) (when ... ...)))
  (when (not (nth 8 parse-status)) (indent-line-to
(js-proper-indentation parse-status)) (when (> offset 0) (forward-char
offset)))
  (let ((parse-status ...) (offset ...)) (when (not ...)
(indent-line-to ...) (when ... ...)))
  javascript-indent-line()
  indent-according-to-mode()
  newline-and-indent()
  (if (and (> ... 0) (string= ... "")) (newline-and-indent))
  (let ((content ...)) (if (and ... ...) (newline-and-indent)))
  (save-excursion (let (...) (if ... ...)))
  insert-line-before-closing-braces()
  (lambda nil (interactive) (insert-line-before-closing-braces)
(newline-and-indent))()
  call-interactively((lambda nil (interactive)
(insert-line-before-closing-braces) (newline-and-indent)) nil nil)


In GNU Emacs 23.0.91.1 (i386-apple-darwin9.6.0, NS apple-appkit-949.43)
 of 2009-02-26 on booyah.local
Windowing system distributor `Apple', version 10.3.949
configured using `configure  '--with-ns''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  nxhtml-global-minor-mode: t
  global-auto-revert-mode: t
  show-paren-mode: t
  yas/minor-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x b b l a <return> y M-x j a v a s c <tab> <return>
( <return> q C-x h C-w / / <return> ( <return> C-x
h C-w C-x C-f j a v a <return> <down> <down> C-SPC
<C-down> <down> <down> C-w <backspace> C-x C-s M-x
s u b m i <tab> <backspace> <backspace> <backspace>
<backspace> <backspace> b u g <tab> <tab> <M-backspace>
<M-backspace> r e p o <tab> r t <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
No buffer matching `bla', create one? (y or n)
Entering debugger...
Back to top level.
Mark set [4 times]
Loading tramp...done
Mark set
Saving file /Users/padillac/code/emacs/javascript.el...
Wrote /Users/padillac/code/emacs/javascript.el
Making completion list... [2 times]




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2481; Package emacs. (Thu, 26 Feb 2009 18:30:03 GMT) Full text and rfc822 format available.

Message #8 received at 2481 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Pat Maddox <pat.maddox <at> gmail.com>
Cc: 2481 <at> debbugs.gnu.org
Subject: Re: bug#2481: 23.0.91; javascript-mode indentation weirdness
Date: Thu, 26 Feb 2009 13:19:21 -0500
reassign 2481 notemacs
stop

Pat Maddox wrote:

> If I'm on the last line of a file in javascript-mode

javascript-mode is not part of Emacs.

> (add-hook 'javascript-mode-hook




bug reassigned from package `emacs' to `notemacs'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Thu, 26 Feb 2009 18:30:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, owner <at> emacsbugs.donarmstrong.com:
bug#2481; Package notemacs. (Thu, 26 Feb 2009 23:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to owner <at> emacsbugs.donarmstrong.com. (Thu, 26 Feb 2009 23:15:03 GMT) Full text and rfc822 format available.

Message #15 received at 2481 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>, 2481 <at> debbugs.gnu.org
Cc: Pat Maddox <pat.maddox <at> gmail.com>
Subject: Re: bug#2481: 23.0.91; javascript-mode indentation weirdness
Date: Fri, 27 Feb 2009 00:07:56 +0100
On Thu, Feb 26, 2009 at 7:19 PM, Glenn Morris <rgm <at> gnu.org> wrote:
> reassign 2481 notemacs
> stop
>
> Pat Maddox wrote:
>
>> If I'm on the last line of a file in javascript-mode
>
> javascript-mode is not part of Emacs.

Not yet.




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sat, 26 Feb 2011 22:07:02 GMT) Full text and rfc822 format available.

Notification sent to Pat Maddox <pat.maddox <at> gmail.com>:
bug acknowledged by developer. (Sat, 26 Feb 2011 22:07:03 GMT) Full text and rfc822 format available.

Message #20 received at 2481-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 2481-done <at> debbugs.gnu.org
Subject: Re: bug#2481: 23.0.91; javascript-mode indentation weirdness
Date: Sat, 26 Feb 2011 17:06:05 -0500
There is a js.el in Emacs now. Please try that. Report any problems as
new bug reports. Thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Mar 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 93 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.