From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 01 15:23:20 2019 Received: (at submit) by debbugs.gnu.org; 1 Mar 2019 20:23:20 +0000 Received: from localhost ([127.0.0.1]:56820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzogh-0006jE-7f for submit@debbugs.gnu.org; Fri, 01 Mar 2019 15:23:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzluS-0000Yp-7F for submit@debbugs.gnu.org; Fri, 01 Mar 2019 12:25:22 -0500 Received: from lists.gnu.org ([209.51.188.17]:45399) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gzluN-0005oy-26 for submit@debbugs.gnu.org; Fri, 01 Mar 2019 12:25:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzluK-0007sp-Ul for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2019 12:25:14 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzlsq-0004ut-Ve for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2019 12:23:45 -0500 Received: from www.shallowsky.com ([71.19.149.191]:59042 helo=shallowsky.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gzlsq-0004sK-Dd for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2019 12:23:40 -0500 Received: from shallowsky.com (unknown [97.123.107.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by shallowsky.com (Postfix) with ESMTPSA id C05E112F2B2 for ; Fri, 1 Mar 2019 10:23:32 -0700 (MST) Date: Fri, 1 Mar 2019 10:23:30 -0700 From: Akkana Peck To: bug-gnu-emacs@gnu.org Subject: 26.1; Wrong line endings detected for XML files Message-ID: <20190301172329.GA1295@shallowsky.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 71.19.149.191 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 01 Mar 2019 15:23:17 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I often use emacs to edit GPX files produced by OsmAnd. Emacs displays these files with ^M at the end, failing to detect the proper newlines. od shows the file as having \r\n (^J^M) at the end of every line. I initially thought this was because the final line of the file lacks any newline characters, but if I edit the file and write it, emacs adds a final ^J^M, and if I then try to read that file back into emacs it still fails to detect the proper line endings, and shows the ^M on every line. The problem is related to the file containing XML: if I edit the file and change all the < > to ( ) then open the file, it opens in Fundamental mode and emacs uses DOS encoding and doesn't show the ^M characters. But if I open the file normally (it uses nXML mode) then switch to Fundamental, that doesn't fix the erroneous newline detection. Of course I can fix it manually, but I'd like to find a way to get emacs to open the file properly without my needing to run extra commands. I asked about this on #emacs and a helpful person commented: | I think auto-coding-functions is a problem. | sgml-xml-auto-coding-function specifically. | mule.el: (memq detected '(utf-8 'utf-8-with-signature 'utf-8-hfs undecided)) | That looks a bit funny to me. | Ugh, no, it's both sgml-* functions in auto-coding-functions? | I must have screwed something up, sgml-html-meta-auto-coding-function returns nil for me. | But sgml-xml-auto-coding-function returns utf-8-unix. | I don't know enough about how Emacs chooses character sets to speculate at how this should be fixed, but I *think* that function should probably return utf-8 not utf-8-unix. I'm attaching a small test file that shows the problem. In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.4) of 2019-02-03, modified by Debian built on zam904 Windowing system distributor 'The X.Org Foundation', version 11.0.12003000 System Description: Debian GNU/Linux buster/sid Recent messages: Quit [2 times] Saving file /tmp/test.paren... Wrote /tmp/test.paren Using vacuous schema Type C-x 1 to delete the help window. Using vacuous schema Quit Missing space after name token Error during redisplay: (jit-lock-function 59) signaled (cl-assertion-failed (bobp)) Entering debugger... Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-26.1+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2 Important settings: value of $LC_COLLATE: C value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: nXML Minor modes in effect: recentf-mode: t dubcaps-mode: t auto-insert-mode: t global-keys-minor-mode: t delete-selection-mode: t tooltip-mode: t global-eldoc-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-etags hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-etags /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-tng hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-tng /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-dabbrev hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-dabbrev /usr/share/emacs/site-lisp/elpa/company-0.9.9/all hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/all /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-eclim hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-eclim /usr/share/emacs/site-lisp/elpa/company-0.9.9/clang-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/clang-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-files hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-files /usr/share/emacs/site-lisp/elpa/company-0.9.9/company hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-clang hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-clang /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-semantic hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-semantic /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-abbrev hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-abbrev /usr/share/emacs/site-lisp/elpa/company-0.9.9/keywords-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/keywords-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/transformers-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/transformers-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/frontends-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/frontends-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-bbdb hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-bbdb /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-yasnippet hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-yasnippet /usr/share/emacs/site-lisp/elpa/company-0.9.9/files-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/files-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/elisp-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/elisp-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/core-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/core-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-keywords hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-keywords /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-oddmuse hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-oddmuse /usr/share/emacs/site-lisp/elpa/company-0.9.9/bbdb-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/bbdb-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-autoloads hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-autoloads /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-dabbrev-code hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-dabbrev-code /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-pkg hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-pkg /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-cmake hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-cmake /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-capf hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-capf /usr/share/emacs/site-lisp/elpa/company-0.9.9/capf-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/capf-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-nxml hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-nxml /usr/share/emacs/site-lisp/elpa/company-0.9.9/cmake-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/cmake-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-elisp hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-elisp /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-tempo hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-tempo /usr/share/emacs/site-lisp/elpa/company-0.9.9/async-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/async-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-css hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-css /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-ispell hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-ispell /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-xcode hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-xcode /usr/share/emacs/site-lisp/elpa/company-0.9.9/template-tests hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/template-tests /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-gtags hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-gtags /usr/share/emacs/site-lisp/elpa/company-0.9.9/company-template hides /usr/share/emacs/site-lisp/elpa-src/company-0.9.9/company-template /usr/share/emacs/site-lisp/elpa/elpy-1.28.0/elpy-profile hides /usr/share/emacs/site-lisp/elpa-src/elpy-1.28.0/elpy-profile /usr/share/emacs/site-lisp/elpa/elpy-1.28.0/elpy-autoloads hides /usr/share/emacs/site-lisp/elpa-src/elpy-1.28.0/elpy-autoloads /usr/share/emacs/site-lisp/elpa/elpy-1.28.0/elpy-pkg hides /usr/share/emacs/site-lisp/elpa-src/elpy-1.28.0/elpy-pkg /usr/share/emacs/site-lisp/elpa/elpy-1.28.0/elpy-refactor hides /usr/share/emacs/site-lisp/elpa-src/elpy-1.28.0/elpy-refactor /usr/share/emacs/site-lisp/elpa/elpy-1.28.0/elpy-shell hides /usr/share/emacs/site-lisp/elpa-src/elpy-1.28.0/elpy-shell /usr/share/emacs/site-lisp/elpa/elpy-1.28.0/debian-autoloads hides /usr/share/emacs/site-lisp/elpa-src/elpy-1.28.0/debian-autoloads /usr/share/emacs/site-lisp/elpa/elpy-1.28.0/elpy-django hides /usr/share/emacs/site-lisp/elpa-src/elpy-1.28.0/elpy-django /usr/share/emacs/site-lisp/elpa/elpy-1.28.0/elpy hides /usr/share/emacs/site-lisp/elpa-src/elpy-1.28.0/elpy /usr/share/emacs/site-lisp/elpa/find-file-in-project-5.7.2/find-file-in-project hides /usr/share/emacs/site-lisp/elpa-src/find-file-in-project-5.7.2/find-file-in-project /usr/share/emacs/site-lisp/elpa/find-file-in-project-5.7.2/find-file-in-project-autoloads hides /usr/share/emacs/site-lisp/elpa-src/find-file-in-project-5.7.2/find-file-in-project-autoloads /usr/share/emacs/site-lisp/elpa/find-file-in-project-5.7.2/find-file-in-project-pkg hides /usr/share/emacs/site-lisp/elpa-src/find-file-in-project-5.7.2/find-file-in-project-pkg /usr/share/emacs/site-lisp/elpa/highlight-indentation-0.7.0/highlight-indentation hides /usr/share/emacs/site-lisp/elpa-src/highlight-indentation-0.7.0/highlight-indentation /usr/share/emacs/site-lisp/elpa/highlight-indentation-0.7.0/highlight-indentation-pkg hides /usr/share/emacs/site-lisp/elpa-src/highlight-indentation-0.7.0/highlight-indentation-pkg /usr/share/emacs/site-lisp/elpa/highlight-indentation-0.7.0/highlight-indentation-autoloads hides /usr/share/emacs/site-lisp/elpa-src/highlight-indentation-0.7.0/highlight-indentation-autoloads /usr/share/emacs/site-lisp/elpa/ivy-0.11.0/ivy-autoloads hides /usr/share/emacs/site-lisp/elpa-src/ivy-0.11.0/ivy-autoloads /usr/share/emacs/site-lisp/elpa/ivy-0.11.0/colir hides /usr/share/emacs/site-lisp/elpa-src/ivy-0.11.0/colir /usr/share/emacs/site-lisp/elpa/ivy-0.11.0/ivy hides /usr/share/emacs/site-lisp/elpa-src/ivy-0.11.0/ivy /usr/share/emacs/site-lisp/elpa/ivy-0.11.0/ivy-overlay hides /usr/share/emacs/site-lisp/elpa-src/ivy-0.11.0/ivy-overlay /usr/share/emacs/site-lisp/elpa/ivy-0.11.0/ivy-pkg hides /usr/share/emacs/site-lisp/elpa-src/ivy-0.11.0/ivy-pkg /usr/share/emacs/site-lisp/elpa/pyvenv-1.20/pyvenv-autoloads hides /usr/share/emacs/site-lisp/elpa-src/pyvenv-1.20/pyvenv-autoloads /usr/share/emacs/site-lisp/elpa/pyvenv-1.20/pyvenv hides /usr/share/emacs/site-lisp/elpa-src/pyvenv-1.20/pyvenv /usr/share/emacs/site-lisp/elpa/pyvenv-1.20/pyvenv-pkg hides /usr/share/emacs/site-lisp/elpa-src/pyvenv-1.20/pyvenv-pkg /usr/share/emacs/site-lisp/elpa/s-1.12.0/s-pkg hides /usr/share/emacs/site-lisp/elpa-src/s-1.12.0/s-pkg /usr/share/emacs/site-lisp/elpa/s-1.12.0/s hides /usr/share/emacs/site-lisp/elpa-src/s-1.12.0/s /usr/share/emacs/site-lisp/elpa/s-1.12.0/s-autoloads hides /usr/share/emacs/site-lisp/elpa-src/s-1.12.0/s-autoloads /usr/share/emacs/site-lisp/elpa/yasnippet-0.13.0/yasnippet hides /usr/share/emacs/site-lisp/elpa-src/yasnippet-0.13.0/yasnippet /usr/share/emacs/site-lisp/elpa/yasnippet-0.13.0/yasnippet-pkg hides /usr/share/emacs/site-lisp/elpa-src/yasnippet-0.13.0/yasnippet-pkg /usr/share/emacs/site-lisp/elpa/yasnippet-0.13.0/yasnippet-autoloads hides /usr/share/emacs/site-lisp/elpa-src/yasnippet-0.13.0/yasnippet-autoloads /usr/share/emacs/site-lisp/rst hides /usr/share/emacs/26.1/lisp/textmodes/rst Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec epa epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-print debug cus-edit cus-start cus-load thingatpt cl-extra eieio-opt speedbar sb-image ezimage dframe find-func completion help-fns radix-tree help-mode misearch multi-isearch 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 sgml-mode dom nxml-util nxml-enc xmltok executable flyspell ispell elec-pair recentf tree-widget wid-edit web-mode advice disp-table rx derived autoinsert undo-tree diff finder-inf undo-tree-autoloads package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv easy-mmode delsel edmacro kmacro cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded 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 dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 242866 90418) (symbols 48 30048 2) (miscs 40 479 1132) (strings 32 58710 4561) (string-bytes 1 1505161) (vectors 16 32349) (vector-slots 8 1417747 146910) (floats 8 90 605) (intervals 56 1403 50) (buffers 992 20)) --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="test.gpx" --2fHTh5uZTiUOsy+g-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 01 15:41:16 2019 Received: (at 34704) by debbugs.gnu.org; 1 Mar 2019 20:41:16 +0000 Received: from localhost ([127.0.0.1]:56826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzoy3-00079M-TE for submit@debbugs.gnu.org; Fri, 01 Mar 2019 15:41:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzoxz-000797-EE for 34704@debbugs.gnu.org; Fri, 01 Mar 2019 15:41:14 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzoxh-000477-Jx; Fri, 01 Mar 2019 15:40:56 -0500 Received: from [176.228.60.248] (port=1172 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gzoxh-0001nF-7B; Fri, 01 Mar 2019 15:40:53 -0500 Date: Fri, 01 Mar 2019 22:40:40 +0200 Message-Id: <83tvgmgwfr.fsf@gnu.org> From: Eli Zaretskii To: Akkana Peck In-reply-to: <20190301172329.GA1295@shallowsky.com> (message from Akkana Peck on Fri, 1 Mar 2019 10:23:30 -0700) Subject: Re: bug#34704: 26.1; Wrong line endings detected for XML files References: <20190301172329.GA1295@shallowsky.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34704 Cc: 34704@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Date: Fri, 1 Mar 2019 10:23:30 -0700 > From: Akkana Peck > > I often use emacs to edit GPX files produced by OsmAnd. > Emacs displays these files with ^M at the end, failing to detect > the proper newlines. od shows the file as having \r\n (^J^M) > at the end of every line. > > I initially thought this was because the final line of the file > lacks any newline characters, but if I edit the file and write it, > emacs adds a final ^J^M, and if I then try to read that file back > into emacs it still fails to detect the proper line endings, and > shows the ^M on every line. > > The problem is related to the file containing XML: > if I edit the file and change all the < > to ( ) then open the file, > it opens in Fundamental mode and emacs uses DOS encoding and doesn't > show the ^M characters. But if I open the file normally (it uses nXML > mode) then switch to Fundamental, that doesn't fix the erroneous > newline detection. Of course I can fix it manually, but I'd like > to find a way to get emacs to open the file properly without my > needing to run extra commands. An example file that causes this is needed to investigate the problem. There could be several different factors which cause this result, and it is impossible to know which one is responsible for your case. > | I think auto-coding-functions is a problem. > | sgml-xml-auto-coding-function specifically. > | mule.el: (memq detected '(utf-8 'utf-8-with-signature 'utf-8-hfs undecided)) > | That looks a bit funny to me. > | Ugh, no, it's both sgml-* functions in auto-coding-functions? > | I must have screwed something up, sgml-html-meta-auto-coding-function returns nil for me. > | But sgml-xml-auto-coding-function returns utf-8-unix. > | I don't know enough about how Emacs chooses character sets to speculate at how this should be fixed, but I *think* that function should probably return utf-8 not utf-8-unix. I'm afraid that doesn't clarify the issue. > I'm attaching a small test file that shows the problem. Your test file doesn't show a problem for me, neither with Emacs 26.1 nor with the current pretest of Emacs 26.2. I see an XML file with Unix EOL format, and no ^M characters. Maybe your mailer somehow "fixed" the file? Can you send it in a compressed archive? Please also test this in "emacs -Q", it could be that something in your customizations causes this. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 01 21:28:01 2019 Received: (at 34704) by debbugs.gnu.org; 2 Mar 2019 02:28:01 +0000 Received: from localhost ([127.0.0.1]:56897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzuNd-0000Fh-DB for submit@debbugs.gnu.org; Fri, 01 Mar 2019 21:28:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzuNb-0000FU-LS for 34704@debbugs.gnu.org; Fri, 01 Mar 2019 21:27:59 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzuNR-0007tt-Py; Fri, 01 Mar 2019 21:27:51 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1gzuNQ-00075O-6j; Fri, 01 Mar 2019 21:27:48 -0500 From: Glenn Morris To: Eli Zaretskii Subject: Re: bug#34704: 26.1; Wrong line endings detected for XML files References: <20190301172329.GA1295@shallowsky.com> <83tvgmgwfr.fsf@gnu.org> X-Spook: Air borne quarter Foot and Mouth Mexicles Panama X-Ran: xv)8-$D`VL,7Vi~1A/|JB3P>:~N^}}bn_UQ~l#T20}{w (Eli Zaretskii's message of "Fri, 01 Mar 2019 22:40:40 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 34704 Cc: 34704@debbugs.gnu.org, Akkana Peck X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii wrote: >> I'm attaching a small test file that shows the problem. > > Your test file doesn't show a problem for me, neither with Emacs 26.1 Try running unix2dos on it, as attached. --=-=-= Content-Type: application/octet-stream; charset=utf-8 Content-Disposition: attachment; filename=test.gpx.gz Content-Transfer-Encoding: base64 H4sICOHpeVwAA3Rlc3QuZ3B4ALOxr8jNUShLLSrOzM+zVTfUM1BXSM1Lzk/JzEu3VQ8NcdO1UFco LknMS0nMyc9LtVWvTC1WV7C34+WySS+ogGtUMtQzVFJILkpNLMkvslXyL851zEvRVgIqU1CwKSnK BjMgzOLUdBhPH4kL5oCM1QeaC6QBTH1KbZkAAAA= --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 01 21:29:14 2019 Received: (at control) by debbugs.gnu.org; 2 Mar 2019 02:29:14 +0000 Received: from localhost ([127.0.0.1]:56901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzuOn-0000I1-RR for submit@debbugs.gnu.org; Fri, 01 Mar 2019 21:29:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzuOm-0000Hj-K0 for control@debbugs.gnu.org; Fri, 01 Mar 2019 21:29:12 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzuOa-00015A-W4 for control@debbugs.gnu.org; Fri, 01 Mar 2019 21:29:02 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1gzuOY-0001cK-Ld for control@debbugs.gnu.org; Fri, 01 Mar 2019 21:29:00 -0500 Subject: control message for bug 34704 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Fri, 01 Mar 2019 21:28:58 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tag 34704 confirmed From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 02 01:54:22 2019 Received: (at 34704) by debbugs.gnu.org; 2 Mar 2019 06:54:22 +0000 Received: from localhost ([127.0.0.1]:56943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzyXO-0000Bc-8d for submit@debbugs.gnu.org; Sat, 02 Mar 2019 01:54:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzyXM-0000BM-9t for 34704@debbugs.gnu.org; Sat, 02 Mar 2019 01:54:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzyXA-0000Mr-7O; Sat, 02 Mar 2019 01:54:10 -0500 Received: from [176.228.60.248] (port=3055 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gzyX6-0007qu-SX; Sat, 02 Mar 2019 01:54:06 -0500 Date: Sat, 02 Mar 2019 08:53:53 +0200 Message-Id: <83sgw5him6.fsf@gnu.org> From: Eli Zaretskii To: Glenn Morris In-reply-to: (message from Glenn Morris on Fri, 01 Mar 2019 21:27:48 -0500) Subject: Re: bug#34704: 26.1; Wrong line endings detected for XML files References: <20190301172329.GA1295@shallowsky.com> <83tvgmgwfr.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34704 Cc: 34704@debbugs.gnu.org, akkana@shallowsky.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Glenn Morris > Cc: Akkana Peck , 34704@debbugs.gnu.org > Date: Fri, 01 Mar 2019 21:27:48 -0500 > > >> I'm attaching a small test file that shows the problem. > > > > Your test file doesn't show a problem for me, neither with Emacs 26.1 > > Try running unix2dos on it, as attached. Thanks, the OP told me off-list how to download the original file. The problem seems to happen only on systems whose default EOL is "-unix". From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 02 03:48:17 2019 Received: (at 34704-done) by debbugs.gnu.org; 2 Mar 2019 08:48:17 +0000 Received: from localhost ([127.0.0.1]:56976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h00Jd-00031m-7u for submit@debbugs.gnu.org; Sat, 02 Mar 2019 03:48:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h00JZ-00031V-Ue for 34704-done@debbugs.gnu.org; Sat, 02 Mar 2019 03:48:16 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h00JT-0001mw-K4; Sat, 02 Mar 2019 03:48:07 -0500 Received: from [176.228.60.248] (port=2268 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h00JR-0006sR-JV; Sat, 02 Mar 2019 03:48:05 -0500 Date: Sat, 02 Mar 2019 10:47:53 +0200 Message-Id: <83lg1xhdc6.fsf@gnu.org> From: Eli Zaretskii To: Akkana Peck In-reply-to: <83sgw5him6.fsf@gnu.org> (message from Eli Zaretskii on Sat, 02 Mar 2019 08:53:53 +0200) Subject: Re: bug#34704: 26.1; Wrong line endings detected for XML files References: <20190301172329.GA1295@shallowsky.com> <83tvgmgwfr.fsf@gnu.org> <83sgw5him6.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34704-done Cc: rgm@gnu.org, 34704-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Date: Sat, 02 Mar 2019 08:53:53 +0200 > From: Eli Zaretskii > Cc: 34704@debbugs.gnu.org, akkana@shallowsky.com > > The problem seems to happen only on systems whose default EOL is > "-unix". More accurately, those whose default value of buffer-file-coding-system is utf-8-unix, he-he. Fixed on the emacs-26 branch. From unknown Sat Jun 14 19:22:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 30 Mar 2019 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator