From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pat Maddox Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#2481: 23.0.91; javascript-mode indentation weirdness Date: Thu, 26 Feb 2009 02:00:10 -0800 Message-ID: <2c7e61990902260200q2495ab7fqe7cbe6acb583c9b1@mail.gmail.com> Reply-To: Pat Maddox , 2481@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1235643838 19147 80.91.229.12 (26 Feb 2009 10:23:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Feb 2009 10:23:58 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 26 11:25:14 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LcdQW-0000aL-Nu for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Feb 2009 11:25:13 +0100 Original-Received: from localhost ([127.0.0.1]:58664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LcdPB-0001lP-IG for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Feb 2009 05:23:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LcdP4-0001lI-Ss for bug-gnu-emacs@gnu.org; Thu, 26 Feb 2009 05:23:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LcdP2-0001l3-Mi for bug-gnu-emacs@gnu.org; Thu, 26 Feb 2009 05:23:42 -0500 Original-Received: from [199.232.76.173] (port=42497 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LcdP2-0001l0-CO for bug-gnu-emacs@gnu.org; Thu, 26 Feb 2009 05:23:40 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:37149) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LcdP1-0008Sa-O0 for bug-gnu-emacs@gnu.org; Thu, 26 Feb 2009 05:23:40 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1QANbt7019823; Thu, 26 Feb 2009 02:23:38 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n1QA56qJ015278; Thu, 26 Feb 2009 02:05:06 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Pat Maddox Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 26 Feb 2009 10:05:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 2481 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123564241814239 (code B ref -1); Thu, 26 Feb 2009 10:05:06 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 26 Feb 2009 10:00:18 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1QA0Ehx014078 for ; Thu, 26 Feb 2009 02:00:15 -0800 Original-Received: from mx10.gnu.org ([199.232.76.166]:50713) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Lcd08-00036H-0f for emacs-pretest-bug@gnu.org; Thu, 26 Feb 2009 04:57:56 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Lcd2K-0004nE-7j for emacs-pretest-bug@gnu.org; Thu, 26 Feb 2009 05:00:12 -0500 Original-Received: from qw-out-1920.google.com ([74.125.92.144]:62565) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lcd2J-0004n4-Tw for emacs-pretest-bug@gnu.org; Thu, 26 Feb 2009 05:00:12 -0500 Original-Received: by qw-out-1920.google.com with SMTP id 4so480015qwk.24 for ; Thu, 26 Feb 2009 02:00:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=c1U33+Vobp7MbuqOtco3YABEmHHo/SqibZG4x6ByUvQ=; b=s1narMnYtGxX4EVvpkg8twjBlTm4RQQR3jDuPmZvs6m+7+ZGhoVhd2/GIRlAZH+gJ3 ZcA6e9WTNqyDNQK+Iz3R7x1SIktnoXOcB+yaro00NhjymMklTfiUGohNkQKf5W4gQ+Xd ouBzk8JNshyHpcrTvg1o5DXjaHOilMcPu2FM4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=ZQ4AeLhrAHQMyHFa5UikANElcMAv8Qpl7G3mWVHmJ9nAECK27qVujzQjci8SRWgaj3 8dSctmNNKhaxSPseBOO3YuhTEVUbtn2eJr5W6IK5gMq8WzQ+4IzESgKbCQF8OOt8bXHw zsI/GgRR/VU5BBxliJ5G/YdbNXGxnj0RCxOrQ= Original-Received: by 10.224.2.138 with SMTP id 10mr1814381qaj.302.1235642410776; Thu, 26 Feb 2009 02:00:10 -0800 (PST) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 26 Feb 2009 05:23:42 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:25726 gmane.emacs.pretest.bugs:23996 Archived-At: 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 "\\" 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 y M-x j a v a s c ( q C-x h C-w / / ( C-x h C-w C-x C-f j a v a C-SPC C-w C-x C-s M-x s u b m i b u g r e p o r t 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]