GNU bug report logs - #19946
js-mode indentation with mixed Unix/DOS line endings

Previous Next

Package: emacs;

Reported by: jostein <at> kjonigsen.net

Date: Wed, 25 Feb 2015 16:45:03 UTC

Severity: minor

Tags: wontfix

Found in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.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 19946 in the body.
You can then email your comments to 19946 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-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Wed, 25 Feb 2015 16:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to jostein <at> kjonigsen.net:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 25 Feb 2015 16:45:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: bug-gnu-emacs <at> gnu.org
Cc: dancol <at> dancol.org
Subject: 24.4; js-mode, indentation
Date: Wed, 25 Feb 2015 11:09:37 +0100
To reproduce bug:

1. Open a js-file with mixed line-endings (starting with Linux, then
some windows)
2. Enable js-mode
3. Observe that SOME lines ends with ^M, some does not.
4. When a line ends with a opening curly-brace { followed by a ^M, you
   will find that the next line is not indented by js-indent-level, but
   up to the ^M + js-indent-level.

If this happens anywhere in the document, all indentation following this
point will be equally off.

While it can be argued the error was letting mixed line-endings in in
the first place, this does make sharing JS-files between Unix and
Windows-systems very hard and it would be nice is js-mode could smooth
over such issues.



In GNU Emacs 24.4.1 (i686-pc-mingw32)
 of 2014-10-24 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.3.9600
Configured using:
 `configure --prefix=/c/usr'

Important settings:
  value of $LANG: NOR
  locale-coding-system: cp1252

Major mode: Javascript

Minor modes in effect:
  magit-auto-revert-mode: t
  diff-auto-refine-mode: t
  helm-occur-match-plugin-mode: t
  electric-pair-mode: t
  show-paren-mode: t
  projectile-mode: t
  which-function-mode: t
  linum-mode: t
  company-mode: t
  global-hl-line-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  ido-yes-or-no-mode: t
  global-auto-revert-mode: t
  delete-selection-mode: t
  shell-dirtrack-mode: t
  flycheck-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<backspace> , SPC m a k e SPC <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
C-k C-x C-s <down> <down> <down> <down> <down-mouse-1> 
<mouse-1> <down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> 
C-s w e b - <home> <right> s e t q SPC <end> <return> 
( s e t q SPC j s - <company-dummy-event> i n d e n 
t <return> SPC 4 <end> <C-home> <wheel-down> <double-wheel-down> 
<triple-wheel-down> <wheel-up> <double-wheel-up> <triple-wheel-up> 
<wheel-down> <double-wheel-down> <wheel-down> <double-wheel-down> 
<triple-wheel-down> <triple-wheel-down> <triple-wheel-down> 
<down-mouse-1> <mouse-1> <home> ; ; <up> <home> ; ; 
C-x C-s C-x v g <down> <down> <down> <down> <down> 
s c c E m a s c : S-SPC F i x <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
c s : S-SPC F i x SPC J S - s e t t i n g s . C-c C-c 
q C-x C-k <return> <down-mouse-1> <mouse-1> <down-mouse-1> 
<mouse-1> <down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> 
<help-echo> <return> C-u 4 0 = <return> C-u 4 0 C-0 
= C-z C-u 4 0 = <return> <up> <up> C-SPC <down> <down> 
C-w <down-mouse-1> <mouse-1> <drag-n-drop> <down-mouse-1> 
<mouse-1> <drag-n-drop> M-x j s - m o <tab> <return> 
C-x C-s SPC <backspace> C-x C-s q <down-mouse-1> <mouse-1> 
C-x C-s <down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> 
<drag-n-drop> C-x C-k <return> <drag-n-drop> <drag-n-drop> 
M-x j s - m o <tab> <return> x s i n <tab> <backspace> 
<backspace> <backspace> <backspace> <down-mouse-1> 
<mouse-1> <wheel-down> <double-wheel-down> <triple-wheel-down> 
<triple-wheel-down> <triple-wheel-down> <wheel-down> 
<double-wheel-down> <triple-wheel-down> <wheel-down> 
<double-wheel-down> <triple-wheel-down> <wheel-down> 
<double-wheel-down> <wheel-down> <double-wheel-down> 
<triple-wheel-down> <wheel-down> <double-wheel-down> 
<triple-wheel-down> <triple-wheel-down> <wheel-up> 
<double-wheel-up> <triple-wheel-up> <triple-wheel-up> 
<triple-wheel-up> <triple-wheel-up> <triple-wheel-up> 
<triple-wheel-up> <triple-wheel-up> <triple-wheel-up> 
<triple-wheel-up> <triple-wheel-up> M-x e m a c s - 
u <backspace> b u <tab> <backspace> <backspace> b u 
g <tab> <wheel-up> <help-echo> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> r e p o r t - e 
m <tab> <return>

Recent messages:
Empty cache. Projectile is initializing cache...
Projectile is indexing
d:/Seven/Patches/Patch80/Clients/SM.web/Webs/CRM.Web.Development/. This
may take a while.
Quit
D:/Seven/Patches/Patch80/Clients/SM.web/Webs/CRM.Web.Development/gruntfile.js
and
d:/Seven/Patches/Patch80/Clients/SM.web/Webs/CRM.Web.Development/gruntfile.js
are the same file
'module' is not defined. [W117] [3 times]
'xsinmodule' is not defined. [W117] [2 times]
'module' is not defined. [W117]
Auto-saving...
byte-code: Beginning of buffer [3 times]
delete-backward-char: Text is read-only

Load-path shadows:
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox hides
c:/emacs/share/emacs/24.4/lisp/org/ox
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-texinfo
hides c:/emacs/share/emacs/24.4/lisp/org/ox-texinfo
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-publish
hides c:/emacs/share/emacs/24.4/lisp/org/ox-publish
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-org
hides c:/emacs/share/emacs/24.4/lisp/org/ox-org
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-odt
hides c:/emacs/share/emacs/24.4/lisp/org/ox-odt
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-md hides
c:/emacs/share/emacs/24.4/lisp/org/ox-md
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-man
hides c:/emacs/share/emacs/24.4/lisp/org/ox-man
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-latex
hides c:/emacs/share/emacs/24.4/lisp/org/ox-latex
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-icalendar
hides c:/emacs/share/emacs/24.4/lisp/org/ox-icalendar
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-html
hides c:/emacs/share/emacs/24.4/lisp/org/ox-html
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-beamer
hides c:/emacs/share/emacs/24.4/lisp/org/ox-beamer
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ox-ascii
hides c:/emacs/share/emacs/24.4/lisp/org/ox-ascii
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org hides
c:/emacs/share/emacs/24.4/lisp/org/org
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-w3m
hides c:/emacs/share/emacs/24.4/lisp/org/org-w3m
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-version
hides c:/emacs/share/emacs/24.4/lisp/org/org-version
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-timer
hides c:/emacs/share/emacs/24.4/lisp/org/org-timer
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-table
hides c:/emacs/share/emacs/24.4/lisp/org/org-table
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-src
hides c:/emacs/share/emacs/24.4/lisp/org/org-src
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-rmail
hides c:/emacs/share/emacs/24.4/lisp/org/org-rmail
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-protocol
hides c:/emacs/share/emacs/24.4/lisp/org/org-protocol
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-plot
hides c:/emacs/share/emacs/24.4/lisp/org/org-plot
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-pcomplete
hides c:/emacs/share/emacs/24.4/lisp/org/org-pcomplete
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-mouse
hides c:/emacs/share/emacs/24.4/lisp/org/org-mouse
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-mobile
hides c:/emacs/share/emacs/24.4/lisp/org/org-mobile
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-mhe
hides c:/emacs/share/emacs/24.4/lisp/org/org-mhe
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-macs
hides c:/emacs/share/emacs/24.4/lisp/org/org-macs
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-macro
hides c:/emacs/share/emacs/24.4/lisp/org/org-macro
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-loaddefs
hides c:/emacs/share/emacs/24.4/lisp/org/org-loaddefs
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-list
hides c:/emacs/share/emacs/24.4/lisp/org/org-list
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-irc
hides c:/emacs/share/emacs/24.4/lisp/org/org-irc
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-install
hides c:/emacs/share/emacs/24.4/lisp/org/org-install
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-inlinetask
hides c:/emacs/share/emacs/24.4/lisp/org/org-inlinetask
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-info
hides c:/emacs/share/emacs/24.4/lisp/org/org-info
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-indent
hides c:/emacs/share/emacs/24.4/lisp/org/org-indent
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-id
hides c:/emacs/share/emacs/24.4/lisp/org/org-id
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-habit
hides c:/emacs/share/emacs/24.4/lisp/org/org-habit
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-gnus
hides c:/emacs/share/emacs/24.4/lisp/org/org-gnus
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-footnote
hides c:/emacs/share/emacs/24.4/lisp/org/org-footnote
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-feed
hides c:/emacs/share/emacs/24.4/lisp/org/org-feed
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-faces
hides c:/emacs/share/emacs/24.4/lisp/org/org-faces
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-eshell
hides c:/emacs/share/emacs/24.4/lisp/org/org-eshell
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-entities
hides c:/emacs/share/emacs/24.4/lisp/org/org-entities
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-element
hides c:/emacs/share/emacs/24.4/lisp/org/org-element
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-docview
hides c:/emacs/share/emacs/24.4/lisp/org/org-docview
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-datetree
hides c:/emacs/share/emacs/24.4/lisp/org/org-datetree
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-ctags
hides c:/emacs/share/emacs/24.4/lisp/org/org-ctags
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-crypt
hides c:/emacs/share/emacs/24.4/lisp/org/org-crypt
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-compat
hides c:/emacs/share/emacs/24.4/lisp/org/org-compat
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-colview
hides c:/emacs/share/emacs/24.4/lisp/org/org-colview
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-clock
hides c:/emacs/share/emacs/24.4/lisp/org/org-clock
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-capture
hides c:/emacs/share/emacs/24.4/lisp/org/org-capture
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-bibtex
hides c:/emacs/share/emacs/24.4/lisp/org/org-bibtex
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-bbdb
hides c:/emacs/share/emacs/24.4/lisp/org/org-bbdb
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-attach
hides c:/emacs/share/emacs/24.4/lisp/org/org-attach
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-archive
hides c:/emacs/share/emacs/24.4/lisp/org/org-archive
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/org-agenda
hides c:/emacs/share/emacs/24.4/lisp/org/org-agenda
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob hides
c:/emacs/share/emacs/24.4/lisp/org/ob
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-tangle
hides c:/emacs/share/emacs/24.4/lisp/org/ob-tangle
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-table
hides c:/emacs/share/emacs/24.4/lisp/org/ob-table
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-sqlite
hides c:/emacs/share/emacs/24.4/lisp/org/ob-sqlite
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-sql
hides c:/emacs/share/emacs/24.4/lisp/org/ob-sql
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-shen
hides c:/emacs/share/emacs/24.4/lisp/org/ob-shen
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-sh hides
c:/emacs/share/emacs/24.4/lisp/org/ob-sh
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-screen
hides c:/emacs/share/emacs/24.4/lisp/org/ob-screen
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-scheme
hides c:/emacs/share/emacs/24.4/lisp/org/ob-scheme
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-scala
hides c:/emacs/share/emacs/24.4/lisp/org/ob-scala
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-sass
hides c:/emacs/share/emacs/24.4/lisp/org/ob-sass
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-ruby
hides c:/emacs/share/emacs/24.4/lisp/org/ob-ruby
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-ref
hides c:/emacs/share/emacs/24.4/lisp/org/ob-ref
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-R hides
c:/emacs/share/emacs/24.4/lisp/org/ob-R
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-python
hides c:/emacs/share/emacs/24.4/lisp/org/ob-python
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-plantuml
hides c:/emacs/share/emacs/24.4/lisp/org/ob-plantuml
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-picolisp
hides c:/emacs/share/emacs/24.4/lisp/org/ob-picolisp
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-perl
hides c:/emacs/share/emacs/24.4/lisp/org/ob-perl
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-org
hides c:/emacs/share/emacs/24.4/lisp/org/ob-org
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-octave
hides c:/emacs/share/emacs/24.4/lisp/org/ob-octave
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-ocaml
hides c:/emacs/share/emacs/24.4/lisp/org/ob-ocaml
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-mscgen
hides c:/emacs/share/emacs/24.4/lisp/org/ob-mscgen
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-maxima
hides c:/emacs/share/emacs/24.4/lisp/org/ob-maxima
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-matlab
hides c:/emacs/share/emacs/24.4/lisp/org/ob-matlab
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-makefile
hides c:/emacs/share/emacs/24.4/lisp/org/ob-makefile
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-lob
hides c:/emacs/share/emacs/24.4/lisp/org/ob-lob
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-lisp
hides c:/emacs/share/emacs/24.4/lisp/org/ob-lisp
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-lilypond
hides c:/emacs/share/emacs/24.4/lisp/org/ob-lilypond
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-ledger
hides c:/emacs/share/emacs/24.4/lisp/org/ob-ledger
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-latex
hides c:/emacs/share/emacs/24.4/lisp/org/ob-latex
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-keys
hides c:/emacs/share/emacs/24.4/lisp/org/ob-keys
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-js hides
c:/emacs/share/emacs/24.4/lisp/org/ob-js
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-java
hides c:/emacs/share/emacs/24.4/lisp/org/ob-java
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-io hides
c:/emacs/share/emacs/24.4/lisp/org/ob-io
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-haskell
hides c:/emacs/share/emacs/24.4/lisp/org/ob-haskell
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-gnuplot
hides c:/emacs/share/emacs/24.4/lisp/org/ob-gnuplot
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-fortran
hides c:/emacs/share/emacs/24.4/lisp/org/ob-fortran
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-exp
hides c:/emacs/share/emacs/24.4/lisp/org/ob-exp
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-eval
hides c:/emacs/share/emacs/24.4/lisp/org/ob-eval
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-emacs-lisp
hides c:/emacs/share/emacs/24.4/lisp/org/ob-emacs-lisp
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-dot
hides c:/emacs/share/emacs/24.4/lisp/org/ob-dot
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-ditaa
hides c:/emacs/share/emacs/24.4/lisp/org/ob-ditaa
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-css
hides c:/emacs/share/emacs/24.4/lisp/org/ob-css
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-core
hides c:/emacs/share/emacs/24.4/lisp/org/ob-core
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-comint
hides c:/emacs/share/emacs/24.4/lisp/org/ob-comint
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-clojure
hides c:/emacs/share/emacs/24.4/lisp/org/ob-clojure
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-calc
hides c:/emacs/share/emacs/24.4/lisp/org/ob-calc
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-C hides
c:/emacs/share/emacs/24.4/lisp/org/ob-C
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-awk
hides c:/emacs/share/emacs/24.4/lisp/org/ob-awk
c:/Users/josteink/AppData/Roaming/.emacs.d/elpa/org-20141215/ob-asymptote
hides c:/emacs/share/emacs/24.4/lisp/org/ob-asymptote

Features:
(shadow sort mail-extr emacsbug sendmail expand-region
text-mode-expansions cc-mode-expansions the-org-mode-expansions
nxml-mode-expansions js2-mode-expansions js-mode-expansions
web-mode-expansions html-mode-expansions er-basic-expansions
expand-region-core expand-region-custom pcre2el rxt re-builder sgml-mode
org-table ox-latex ox-icalendar ox-html ox-ascii ox-publish ox hideshow
web-mode js2-mode nodejs-repl gnutls mule-util js-comint eldoc cus-edit
wid-edit hippie-exp nxml-uchnm rng-xsd xsd-regexp rng-cmpct rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph
nxml-enc xmltok rect pp eieio-opt flyspell ispell tabify magit-key-mode
magit view epa derived diff-mode git-rebase-mode git-commit-mode
log-edit pcvs-util vc-git omnisharp helm-grep helm-regexp helm-plugin
helm-utils helm helm-source cc-langs csharp-mode cl
omnisharp-auto-complete-actions omnisharp-server-actions omnisharp-utils
popup warnings js json cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs misearch multi-isearch
mule-diag debug elec-pair bat-mode browse-url executable org-element
org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view
jka-compr image-mode dired org-bibtex bibtex org-bbdb org-w3m org
org-macro org-footnote org-pcomplete org-list org-faces org-entities
noutline outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat
org-macs org-loaddefs cal-menu calendar cal-loaddefs add-log
elisp-slime-nav paren paredit projectile ibuf-ext ibuffer pkg-info epl
grep f s ucs-normalize thingatpt which-func linum company-files
company-oddmuse company-keywords company-etags etags company-gtags
company-dabbrev-code company-dabbrev company-capf company-cmake
company-ropemacs company-xcode company-clang company-semantic
company-eclim company-template company-css company-nxml company-bbdb
company hl-line undo-tree diff easy-mmode imenu ido-yes-or-no ido
autorevert filenotify cus-start cus-load delsel server powershell-mode
speedbar sb-image ezimage dframe tramp tramp-compat tramp-loaddefs
trampver shell pcomplete flycheck find-func help-mode pcase subr-x dash
haskell-cabal haskell-utils let-alist rx tar-mode compile comint
ansi-color ring names cl-macs gv edebug autoload lisp-mnt epg mm-archive
message format-spec rfc822 mml mml-sec mailabbrev gmm-utils mailheader
mm-decode mm-bodies mm-encode mail-utils network-stream starttls
url-http tls mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw
url-cache url-auth url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source eieio byte-opt bytecomp byte-compile cconv
eieio-core gnus-util mm-util mail-prsvr password-cache url-vars
auto-complete-nxml-autoloads batch-mode-autoloads color-theme-autoloads
guru-mode-autoloads edmacro kmacro cl-loaddefs cl-lib
ido-yes-or-no-autoloads finder-inf macrostep-autoloads advice help-fns
nrepl-autoloads powershell-mode-autoloads pkg-info-autoloads info
easymenu slime-autoloads tidy-autoloads undo-tree-autoloads package
epg-config time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win
w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
w32notify w32 multi-tty emacs)

Memory information:
((conses 8 1546043 178817)
 (symbols 32 59486 0)
 (miscs 32 5094 4985)
 (strings 16 180340 46397)
 (string-bytes 1 5113818)
 (vectors 8 84825)
 (vector-slots 4 1992267 169560)
 (floats 8 331 1445)
 (intervals 28 133812 6716)
 (buffers 508 72))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sat, 19 Mar 2016 22:14:02 GMT) Full text and rfc822 format available.

Message #8 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Simen Heggestøyl <simenheg <at> gmail.com>
To: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
Cc: dan.colascione <at> gmail.com, 19946 <at> debbugs.gnu.org, jostein <at> kjonigsen.net
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sat, 19 Mar 2016 23:13:11 +0100
Can confirm that this bug is still present on the current master branch
(070b9de). The following patch seems to fix it:


From 9b9f09d518617d165833602d863ea8afedcec401 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= <simenheg <at> gmail.com>
Date: Sat, 19 Mar 2016 21:33:02 +0100
Subject: [PATCH] Handle indentation after carriage return better

* lisp/progmodes/js.el (js--proper-indentation): Handle indentation
after carriage return better (bug#19946).
---
 lisp/progmodes/js.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 1e5cc60..a156080 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1963,7 +1963,7 @@ 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 (looking-at "[({[]\\s-*\\(/[/*]\\|\n\\|\r\\)")
                  (progn ; nothing following the opening paren/bracket
                    (skip-syntax-backward " ")
                    (when (eq (char-before) ?\)) (backward-list))
-- 
2.7.0





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sun, 20 Mar 2016 01:28:02 GMT) Full text and rfc822 format available.

Message #11 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Simen Heggestøyl <simenheg <at> gmail.com>,
 Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
Cc: dan.colascione <at> gmail.com, 19946 <at> debbugs.gnu.org, jostein <at> kjonigsen.net
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 20 Mar 2016 03:27:21 +0200
On 03/20/2016 12:13 AM, Simen Heggestøyl wrote:
> Can confirm that this bug is still present on the current master branch
> (070b9de). The following patch seems to fix it:

I do not mind, but I'm not sure if we actually want to support this 
usage. There are a lot regexps in lisp/progmodes that use $. There are 
several in js-mode, aside from this one.

Some modes try to match [\r\n] (like CC Mode), but in general they seem 
to be a minority, and even CC Mode doesn't do that consistently.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sun, 20 Mar 2016 08:26:02 GMT) Full text and rfc822 format available.

Message #14 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: jostein <at> kjonigsen.net, 19946 <at> debbugs.gnu.org,
 Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>,
 Simen Heggestøyl <simenheg <at> gmail.com>,
 dan.colascione <at> gmail.com
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 20 Mar 2016 09:25:03 +0100
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 03/20/2016 12:13 AM, Simen Heggestøyl wrote:
>> Can confirm that this bug is still present on the current master branch
>> (070b9de). The following patch seems to fix it:
>
> I do not mind, but I'm not sure if we actually want to support this
> usage. There are a lot regexps in lisp/progmodes that use $. There are
> several in js-mode, aside from this one.

I wonder why ?\r doesn't have whitespace syntax in the first place.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sun, 20 Mar 2016 19:02:02 GMT) Full text and rfc822 format available.

Message #17 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>,
 Simen Heggestøyl <simenheg <at> gmail.com>
Cc: dan.colascione <at> gmail.com, 19946 <at> debbugs.gnu.org, jostein <at> kjonigsen.net
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 20 Mar 2016 20:01:00 +0100
On Sun, Mar 20, 2016, at 02:27 AM, Dmitry Gutov wrote:
> On 03/20/2016 12:13 AM, Simen Heggestøyl wrote:
> I do not mind, but I'm not sure if we actually want to support this 
> usage. There are a lot regexps in lisp/progmodes that use $. There are 
> several in js-mode, aside from this one.
> 
> Some modes try to match [\r\n] (like CC Mode), but in general they seem 
> to be a minority, and even CC Mode doesn't do that consistently.

I really don't see how that argument makes sense.

By following the cardinal rule of good software, that is produce the
least amont of astonishment, cc-mode does what's right: it produces the
expected outcome, no matter what kind of file it's working with.

The result: A happy user.

In my point of view, this should be the aim for all *-modes found in
Emacs, no matter what its current state of affair or conventions is.

The solution to this is either a bunch of hacky patches replacing $ with
\r\n (as above) or actually addressing what's probably the root cause
(as observed by Andreas)

> I wonder why ?\r doesn't have whitespace syntax in the first place.

Make ?\r be interpreted as white-space, because once you put Emacs
outside a GNU/Linux system honestly nothing else makes sense. Is there
any specific reason for its current behaviour?

Or put the other way: Are there known pieces of code which depends on \r
semantically not being white-space to function correctly?

As someone authoring two major modes, every time $ does not work as
expected and I need to write hacks, it breaks my heart. As of now, I
can't really use $ if I want my modes to work and that's just silly (but
at least now I know why).

--
Jostein Kjønigsen




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sun, 20 Mar 2016 19:03:01 GMT) Full text and rfc822 format available.

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

From: Daniel Colascione <dancol <at> dancol.org>
To: jostein <at> kjonigsen.net, Dmitry Gutov <dgutov <at> yandex.ru>,
 Simen Heggestøyl <simenheg <at> gmail.com>
Cc: 19946 <at> debbugs.gnu.org, dan.colascione <at> gmail.com
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 20 Mar 2016 12:02:48 -0700
[Message part 1 (text/plain, inline)]
On 03/20/2016 12:01 PM, Jostein Kjønigsen wrote:
> On Sun, Mar 20, 2016, at 02:27 AM, Dmitry Gutov wrote:
>> On 03/20/2016 12:13 AM, Simen Heggestøyl wrote:
>> I do not mind, but I'm not sure if we actually want to support this 
>> usage. There are a lot regexps in lisp/progmodes that use $. There are 
>> several in js-mode, aside from this one.
>>
>> Some modes try to match [\r\n] (like CC Mode), but in general they seem 
>> to be a minority, and even CC Mode doesn't do that consistently.
> 
> I really don't see how that argument makes sense.
> 
> By following the cardinal rule of good software, that is produce the
> least amont of astonishment, cc-mode does what's right: it produces the
> expected outcome, no matter what kind of file it's working with.
> 
> The result: A happy user.
> 
> In my point of view, this should be the aim for all *-modes found in
> Emacs, no matter what its current state of affair or conventions is.
> 
> The solution to this is either a bunch of hacky patches replacing $ with
> \r\n (as above) or actually addressing what's probably the root cause
> (as observed by Andreas)
> 
>> I wonder why ?\r doesn't have whitespace syntax in the first place.
> 
> Make ?\r be interpreted as white-space, because once you put Emacs
> outside a GNU/Linux system honestly nothing else makes sense. Is there
> any specific reason for its current behaviour?
> 
> Or put the other way: Are there known pieces of code which depends on \r
> semantically not being white-space to function correctly?
> 
> As someone authoring two major modes, every time $ does not work as
> expected and I need to write hacks, it breaks my heart. As of now, I
> can't really use $ if I want my modes to work and that's just silly (but
> at least now I know why).

Line ending divergence is best addressed at the file encoding level, not
the individual mode level. I don't think it's worth while replacing uses
of $ with \r?\n just to address cases in which line ending translation
is broken.


[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sun, 20 Mar 2016 19:16:02 GMT) Full text and rfc822 format available.

Message #23 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: Daniel Colascione <dancol <at> dancol.org>, jostein <at> kjonigsen.net,
 Dmitry Gutov <dgutov <at> yandex.ru>,
 Simen Heggestøyl <simenheg <at> gmail.com>
Cc: 19946 <at> debbugs.gnu.org, dan.colascione <at> gmail.com
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 20 Mar 2016 20:15:12 +0100
On Sun, Mar 20, 2016, at 08:02 PM, Daniel Colascione wrote:
> Line ending divergence is best addressed at the file encoding level, not
> the individual mode level. I don't think it's worth while replacing uses
> of $ with \r?\n just to address cases in which line ending translation
> is broken.

I appreciate being principled about correctness and fixing the real
problems where they are. I really do. But I'm also trying to be
pragmatic when the real world calls.

While your argument definitely sounds reasonable at first, it's worth
noting that this problem often occurs in distributed projects where some
files end up with mixed line-break formats (due to bad source-control
settings or whatever).

In those cases line-ending translation cannot be done "correctly"
because the file does not adher to one standard only, and unless the
user is aware of this, he will simply blame Emacs as "broken" when
indentation suddenly goes crazy in his file.

If we should at least attempt to adhere to the principle of least
astonishment, we need to either accept \r\n patches everywhere or change
the semantics of $ to also include \r, line-break format be damned.

Or do someone have another option which involves less drastic means? In
that case I'm all ears.

-- 
Jostein Kjønigsen
jostein <at> kjonigsen.net / jostein <at> secure.kjonigsen.net




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sun, 20 Mar 2016 19:19:02 GMT) Full text and rfc822 format available.

Message #26 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: jostein <at> kjonigsen.net, Simen Heggestøyl
 <simenheg <at> gmail.com>
Cc: 19946 <at> debbugs.gnu.org, dan.colascione <at> gmail.com
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 20 Mar 2016 21:18:26 +0200
On 03/20/2016 09:01 PM, Jostein Kjønigsen wrote:

>> Some modes try to match [\r\n] (like CC Mode), but in general they seem
>> to be a minority, and even CC Mode doesn't do that consistently.
>
> I really don't see how that argument makes sense.

It's not an argument, it's an observation: clearly we, as a project, 
haven't made a decision to properly support mixed-newline files.

> By following the cardinal rule of good software, that is produce the
> least amont of astonishment, cc-mode does what's right: it produces the
> expected outcome, no matter what kind of file it's working with.

Does it? CC Mode still uses $ in a lot of places.

>> I wonder why ?\r doesn't have whitespace syntax in the first place.
>
> Make ?\r be interpreted as white-space, because once you put Emacs
> outside a GNU/Linux system honestly nothing else makes sense. Is there
> any specific reason for its current behaviour?

Hmm, does this help?

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 15a52ba..dffdb77 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -578,6 +578,7 @@ js-mode-syntax-table
     (c-populate-syntax-table table)
     (modify-syntax-entry ?$ "_" table)
     (modify-syntax-entry ?` "\"" table)
+    (modify-syntax-entry ?\C-M " " table)
     table)
   "Syntax table for `js-mode'.")






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sun, 20 Mar 2016 19:48:01 GMT) Full text and rfc822 format available.

Message #29 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>, jostein <at> kjonigsen.net,
 Simen Heggestøyl <simenheg <at> gmail.com>
Cc: 19946 <at> debbugs.gnu.org, dan.colascione <at> gmail.com
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 20 Mar 2016 20:47:44 +0100
On Sun, Mar 20, 2016, at 08:18 PM, Dmitry Gutov wrote:
> On 03/20/2016 09:01 PM, Jostein Kjønigsen wrote:
> 
> It's not an argument, it's an observation: clearly we, as a project, 
> haven't made a decision to properly support mixed-newline files.

Fair enough.

>> By following the cardinal rule of good software, that is produce the
>> least amont of astonishment, cc-mode does what's right: it produces the
>> expected outcome, no matter what kind of file it's working with.
> 
> Hmm, does this help?
> 
> diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
> index 15a52ba..dffdb77 100644
> --- a/lisp/progmodes/js.el
> +++ b/lisp/progmodes/js.el
> @@ -578,6 +578,7 @@ js-mode-syntax-table
>       (c-populate-syntax-table table)
>       (modify-syntax-entry ?$ "_" table)
>       (modify-syntax-entry ?` "\"" table)
> +    (modify-syntax-entry ?\C-M " " table)
>       table)
>     "Syntax table for `js-mode'.")
> 

That works for me, at least in js-mode.

While not a general solution to all weird files one might encounter
while working in Emacs, it at least makes js-files behave as expected.
And in a fairly reusable manner too: I can copy this code and I'm home
free.

Would pushing this up to cc-mode's c-populate-syntax-table function also
be considered an option? Or does that just sound on overall way too
risky?

-- 
Jostein Kjønigsen
jostein <at> kjonigsen.net / jostein <at> secure.kjonigsen.net




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sun, 20 Mar 2016 19:50:02 GMT) Full text and rfc822 format available.

Message #32 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: jostein <at> kjonigsen.net, Simen Heggestøyl
 <simenheg <at> gmail.com>
Cc: Alan Mackenzie <acm <at> muc.de>, 19946 <at> debbugs.gnu.org,
 dan.colascione <at> gmail.com
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 20 Mar 2016 21:49:12 +0200
On 03/20/2016 09:47 PM, Jostein Kjønigsen wrote:

>> diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
>> index 15a52ba..dffdb77 100644
>> --- a/lisp/progmodes/js.el
>> +++ b/lisp/progmodes/js.el
>> @@ -578,6 +578,7 @@ js-mode-syntax-table
>>       (c-populate-syntax-table table)
>>       (modify-syntax-entry ?$ "_" table)
>>       (modify-syntax-entry ?` "\"" table)
>> +    (modify-syntax-entry ?\C-M " " table)
>>       table)
>>     "Syntax table for `js-mode'.")
>>
>
> That works for me, at least in js-mode.
>
> While not a general solution to all weird files one might encounter
> while working in Emacs, it at least makes js-files behave as expected.
> And in a fairly reusable manner too: I can copy this code and I'm home
> free.
>
> Would pushing this up to cc-mode's c-populate-syntax-table function also
> be considered an option? Or does that just sound on overall way too
> risky?

I don't see any problem there, but that's up to Alan.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Mon, 21 Mar 2016 00:09:01 GMT) Full text and rfc822 format available.

Message #35 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Colascione <dancol <at> dancol.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>, jostein <at> kjonigsen.net,
 Simen Heggestøyl <simenheg <at> gmail.com>
Cc: Alan Mackenzie <acm <at> muc.de>, 19946 <at> debbugs.gnu.org,
 dan.colascione <at> gmail.com
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 20 Mar 2016 17:08:26 -0700
[Message part 1 (text/plain, inline)]
On 03/20/2016 12:49 PM, Dmitry Gutov wrote:
> On 03/20/2016 09:47 PM, Jostein Kjønigsen wrote:
> 
>>> diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
>>> index 15a52ba..dffdb77 100644
>>> --- a/lisp/progmodes/js.el
>>> +++ b/lisp/progmodes/js.el
>>> @@ -578,6 +578,7 @@ js-mode-syntax-table
>>>       (c-populate-syntax-table table)
>>>       (modify-syntax-entry ?$ "_" table)
>>>       (modify-syntax-entry ?` "\"" table)
>>> +    (modify-syntax-entry ?\C-M " " table)
>>>       table)
>>>     "Syntax table for `js-mode'.")
>>>
>>
>> That works for me, at least in js-mode.
>>
>> While not a general solution to all weird files one might encounter
>> while working in Emacs, it at least makes js-files behave as expected.
>> And in a fairly reusable manner too: I can copy this code and I'm home
>> free.
>>
>> Would pushing this up to cc-mode's c-populate-syntax-table function also
>> be considered an option? Or does that just sound on overall way too
>> risky?
> 
> I don't see any problem there, but that's up to Alan.

It don't have any problem teaching specific modes about carriage
returns, but this approach doesn't scale. A better approach, I think,
would be to extend something like ws-butler for dealing with
mixed-line-ending files. On load, we'd transform `\r\n' -> `\n', but
*remember* which `\n's represent `\r\n` and perform the reverse
translation when writing. This way, you'd preserve clowny extra carriage
returns from other people, but see a clean, unified view in Emacs.

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Mon, 21 Mar 2016 00:33:01 GMT) Full text and rfc822 format available.

Message #38 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Daniel Colascione <dancol <at> dancol.org>, jostein <at> kjonigsen.net,
 Simen Heggestøyl <simenheg <at> gmail.com>
Cc: Alan Mackenzie <acm <at> muc.de>, 19946 <at> debbugs.gnu.org,
 dan.colascione <at> gmail.com
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Mon, 21 Mar 2016 02:32:38 +0200
On 03/21/2016 02:08 AM, Daniel Colascione wrote:

> It don't have any problem teaching specific modes about carriage
> returns, but this approach doesn't scale.

What about putting that mapping into the standard syntax table?

> A better approach, I think,
> would be to extend something like ws-butler for dealing with
> mixed-line-ending files. On load, we'd transform `\r\n' -> `\n', but
> *remember* which `\n's represent `\r\n` and perform the reverse
> translation when writing. This way, you'd preserve clowny extra carriage
> returns from other people, but see a clean, unified view in Emacs.

And yet another way is to use Git's automatic crlf conversion.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sun, 03 Apr 2016 18:06:01 GMT) Full text and rfc822 format available.

Message #41 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: John Wiegley <jwiegley <at> gmail.com>
To: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
Cc: dan.colascione <at> gmail.com, 19946 <at> debbugs.gnu.org,
 Simen Heggestøyl <simenheg <at> gmail.com>,
 Dmitry Gutov <dgutov <at> yandex.ru>, Daniel Colascione <dancol <at> dancol.org>,
 jostein <at> kjonigsen.net
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 03 Apr 2016 11:05:44 -0700
>>>>> Jostein Kjønigsen <jostein <at> secure.kjonigsen.net> writes:

> If we should at least attempt to adhere to the principle of least
> astonishment, we need to either accept \r\n patches everywhere or change the
> semantics of $ to also include \r, line-break format be damned.

What if there were another buffer coding system called "broken-msdos" or
something, that accepted mixed \n and \r\n, but wrote out all \r\n?  I run
into such files often enough.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Sun, 03 Apr 2016 18:19:01 GMT) Full text and rfc822 format available.

Message #44 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: John Wiegley <jwiegley <at> gmail.com>
Cc: dan.colascione <at> gmail.com, 19946 <at> debbugs.gnu.org,
 jostein <at> secure.kjonigsen.net, simenheg <at> gmail.com, dgutov <at> yandex.ru,
 jostein <at> kjonigsen.net
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Sun, 03 Apr 2016 21:17:20 +0300
> From: John Wiegley <jwiegley <at> gmail.com>
> Date: Sun, 03 Apr 2016 11:05:44 -0700
> Cc: dan.colascione <at> gmail.com, 19946 <at> debbugs.gnu.org,
> 	Simen Heggestøyl <simenheg <at> gmail.com>,
> 	Dmitry Gutov <dgutov <at> yandex.ru>, jostein <at> kjonigsen.net
> 
> >>>>> Jostein Kjønigsen <jostein <at> secure.kjonigsen.net> writes:
> 
> > If we should at least attempt to adhere to the principle of least
> > astonishment, we need to either accept \r\n patches everywhere or change the
> > semantics of $ to also include \r, line-break format be damned.
> 
> What if there were another buffer coding system called "broken-msdos" or
> something, that accepted mixed \n and \r\n, but wrote out all \r\n?  I run
> into such files often enough.

We already have that, it's called "dos".




Changed bug title to 'js-mode indentation with mixed Unix/DOS line endings' from '24.4; js-mode, indentation' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 28 Feb 2017 23:32:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19946; Package emacs. (Tue, 25 Aug 2020 09:49:01 GMT) Full text and rfc822 format available.

Message #49 received at 19946 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: dan.colascione <at> gmail.com, 19946 <at> debbugs.gnu.org, jostein <at> kjonigsen.net,
 Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>,
 Simen Heggestøyl <simenheg <at> gmail.com>
Subject: Re: bug#19946: 24.4; js-mode, indentation
Date: Tue, 25 Aug 2020 11:48:24 +0200
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 03/20/2016 12:13 AM, Simen Heggestøyl wrote:
>> Can confirm that this bug is still present on the current master branch
>> (070b9de). The following patch seems to fix it:
>
> I do not mind, but I'm not sure if we actually want to support this
> usage. There are a lot regexps in lisp/progmodes that use $. There are
> several in js-mode, aside from this one.
>
> Some modes try to match [\r\n] (like CC Mode), but in general they
> seem to be a minority, and even CC Mode doesn't do that consistently.

I think the rough consensus here is that we don't want to support this
in Emacs, so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Aug 2020 09:49:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 19946 <at> debbugs.gnu.org and jostein <at> kjonigsen.net Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Aug 2020 09:49:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Sep 2020 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 217 days ago.

Previous Next


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