From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.bugs Subject: bug#29916: 26.0.90; CRLF in diff-command output breaks smerge hunk header parsing Date: Sun, 31 Dec 2017 18:33:56 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="94eb2c035aaa95a98b0561a71de1" X-Trace: blaine.gmane.org 1514745212 5066 195.159.176.226 (31 Dec 2017 18:33:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 31 Dec 2017 18:33:32 +0000 (UTC) To: 29916@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 31 19:33:28 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eViQ8-0000CU-Vg for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Dec 2017 19:33:17 +0100 Original-Received: from localhost ([::1]:48075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eViS6-0002Xc-Cj for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Dec 2017 13:35:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eViRr-0002Wu-Qx for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 13:35:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eViRq-0007jp-6B for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 13:35:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50321) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eViRq-0007jg-0h for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 13:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eViRp-0006YV-O5 for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 13:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Copley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Dec 2017 18:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29916 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151474528325170 (code B ref -1); Sun, 31 Dec 2017 18:35:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 Dec 2017 18:34:43 +0000 Original-Received: from localhost ([127.0.0.1]:59002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eViRV-0006Xs-Ho for submit@debbugs.gnu.org; Sun, 31 Dec 2017 13:34:43 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eViRT-0006Xf-7x for submit@debbugs.gnu.org; Sun, 31 Dec 2017 13:34:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eViRM-0007Ya-He for submit@debbugs.gnu.org; Sun, 31 Dec 2017 13:34:34 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:55997) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eViRM-0007YW-DZ for submit@debbugs.gnu.org; Sun, 31 Dec 2017 13:34:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eViRK-0002SE-KY for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 13:34:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eViRJ-0007XQ-5Y for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 13:34:30 -0500 Original-Received: from mail-ot0-x22d.google.com ([2607:f8b0:4003:c0f::22d]:36723) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eViRI-0007X0-TJ for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 13:34:29 -0500 Original-Received: by mail-ot0-x22d.google.com with SMTP id w4so10688114otg.3 for ; Sun, 31 Dec 2017 10:34:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=u4SrRpy4Ten9zxWziZdh2Qu3Id19/F0OXfIdsJ6CwI8=; b=vT01S5ULNLAL8UTaiw+mlRKIBam4llpsyfyog8zyhT65ukmFNVeUPuMU1dYaXkE94V CVURRpwYiJhJdav0vZ4VYBeCjKU53ZdsF7HmaFanTVd2hqk5g0snMLNsPhamPttTcp5i cuD9gndZ3YOnoxstjVbq7Vl0z1cmJhmHaS/U88Y/Wi2nZNi7xrRzdD9cgn+2cKgnnqdz eyMNg6kAVXZj+iFRthr/mCEB9ZJHJIE0av7G3MZ3quQXB8XPxqIwAxVFw6lT1YLtKghE LclEJQWm4N7cQcIwht3BvMuxtLpxbYvbw/0O+cR7adsBvexKfJBPpC5mw4X3GNBZzzFC r7wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=u4SrRpy4Ten9zxWziZdh2Qu3Id19/F0OXfIdsJ6CwI8=; b=cvqmaKYjf+l/8XDLt2PMvIlGRAW53+4jEnz4n177TSeYHB2zh5ppZ5d7fCHp+Rt3QJ gTuhK2PurHN+PKd9x2saNzQ6HLXBFLRXTxf4mnOGebvy/wup4BY2/8KmHoXNu5mhGhRM DvM6IrdiXtY8MSXlk8SmaXh1r++LlkAAnaVoaxKQm7xa9ZzGJGgIth/omupZJV7O5hZl SDSlgXMz6XOHL/l4QKQv300vyaL0glY6sEJeWHBRHFurR8olYiRfwdZwArlg7xnQh+H2 fQJGPEdO5vbn1DYcqxlYy1M/+9VCREELvfs0zfJikUba57mzOLKtGsGfXMC4/4bEpW6J mdcA== X-Gm-Message-State: AKGB3mJWaP1xHbYhozrML1WcLEEH8pUwPkzo3UAovrledCJYkLWQNy02 v61/lJqgrtrRDutPYzsGWSrCVMlrlQ184SWtVeR9jQ== X-Google-Smtp-Source: ACJfBov2IYTPGkVuO9dFQrzWgrLrOcBqoGYQLQkqKWxPuHEQoWTzaWyRkZyDrbfPGaGCDpPMNAzJmbKyusaNYBgvhgw= X-Received: by 10.157.41.10 with SMTP id d10mr32007483otb.66.1514745267322; Sun, 31 Dec 2017 10:34:27 -0800 (PST) Original-Received: by 10.157.6.136 with HTTP; Sun, 31 Dec 2017 10:33:56 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:141655 Archived-At: --94eb2c035aaa95a98b0561a71de1 Content-Type: text/plain; charset="UTF-8" On Windows, CRLF line endings in the output of diff-command can lead to an error in `smerge-refine-regions'. To reproduce, download this patch: https://lists.gnu.org/archive/html/emacs-devel/2017-06/txtWF9rI8yqfI.txt (It is an example of a perfectly ordinary patch, with Unix line endings.) >From 'emacs -Q', visit the patch file, do "M-x diff-mode RET", then move point into the second diff hunk (in editfns.c) and type RET (diff-goto-source). The minibuffer shows this error, with a literal carriage return, shown here as ^M: Error running timer: (error "Unexpected patch hunk header: 41a42,121^M") The error doesn't seem to be critical (diff-goto-source still succeeds) but it's annoying, as it obscures a minibuffer prompt. As a data point, the error doesn't happen after applying the attached patch which partially reverts this commit: commit 184d74ce002ecb7399cb2b47fc671bfb2feb9855 Author: Stefan Monnier Date: Wed May 17 15:44:36 2017 -0400 * lisp/vc/smerge-mode.el (smerge-refine-regions): Work in multi-bufs The Lisp backtrace is: Debugger entered--Lisp error: (error "Unexpected patch hunk header: 41a42,121\015") signal(error ("Unexpected patch hunk header: 41a42,121\015")) error("Unexpected patch hunk header: %s" "41a42,121\015") smerge-refine-regions(1019 1212 1212 1485 nil diff-refine-preproc ((diff-mode . fine) (face diff-refine-removed)) ((diff-mode . fine) (face diff-refine-added))) diff-refine-hunk() #f(compiled-function () #)() apply(#f(compiled-function () #) nil) timer-event-handler([t 23113 10990 354825 nil #f(compiled-function () #) nil nil 0]) read-from-minibuffer("Use file c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c: " ("c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c" . 42) (keymap ...) nil file-name-history "c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c" nil) completing-read-default("Use file c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c: " read-file-name-internal file-exists-p t ("c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c" . 41) file-name-history "c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c" nil) completing-read("Use file c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c: " read-file-name-internal file-exists-p t ("c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c" . 41) file-name-history "c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c") read-file-name-default("Use file c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c: " "c:/Users/xxxxxx/AppData/Local/Temp/b/src/" "c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c" t "editfns.c" nil) read-file-name("Use file c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c: " "c:/Users/xxxxxx/AppData/Local/Temp/b/src/" "c:/Users/xxxxxx/AppData/Local/Temp/b/src/editfns.c" t "editfns.c") diff-find-file-name(nil nil) diff-find-source-location(nil t) diff-goto-source(nil return) funcall-interactively(diff-goto-source nil return) call-interactively(diff-goto-source nil nil) command-execute(diff-goto-source) In GNU Emacs 26.0.90 (build 1, x86_64-w64-mingw32) of 2017-12-31 built on MACHINE Repository revision: 39ca289a7a33d514c2a46f005db4e7173fb7e9f5 Windowing system distributor 'Microsoft Corp.', version 10.0.16299 Recent messages: Wrote c:/projects/emacs/lisp/vc/smerge-mode.el Quit [2 times] Finding changes in c:/projects/emacs/lisp/vc/smerge-mode.el...done Hunk already applied Annotating... Redisplaying annotation...done (Spanned from 6597.8 to 16.8 days old) Annotating... done Mark set Mark deactivated x is undefined Configured using: 'configure --config-cache --with-modules --without-pop 'CFLAGS=-O3 -ggdb3'' Configured features: XPM JPEG TIFF GIF PNG SOUND DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES LCMS2 Important settings: value of $EMACSLOADPATH: c:\emacs-lisp; value of $LANG: ENG locale-coding-system: cp1252 Major mode: Git-Log-View Minor modes in effect: diff-auto-refine-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-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 buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config 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 vc-annotate vc-dir ewoc smerge-mode m4-mode whitespace add-log log-view pcvs-util cl-extra help-mode vc-git diff-mode easymenu easy-mmode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher map seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win 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 w32notify dbusbind w32 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 130359 22263) (symbols 56 22153 2) (miscs 48 105 257) (strings 32 36280 1509) (string-bytes 1 943844) (vectors 16 23670) (vector-slots 8 1322832 187678) (floats 8 85 611) (intervals 56 4285 3571) (buffers 992 18)) --94eb2c035aaa95a98b0561a71de1 Content-Type: application/octet-stream; name="decode-diff-output.patch" Content-Disposition: attachment; filename="decode-diff-output.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jbv465cw0 ZGlmZiAtLWdpdCBhL2xpc3AvdmMvc21lcmdlLW1vZGUuZWwgYi9saXNwL3ZjL3NtZXJnZS1tb2Rl LmVsCmluZGV4IGVhMWUwYzcyNmYuLjg5YWYzN2Q2MzcgMTAwNjQ0Ci0tLSBhL2xpc3AvdmMvc21l cmdlLW1vZGUuZWwKKysrIGIvbGlzcC92Yy9zbWVyZ2UtbW9kZS5lbApAQCAtMTA4NCw3ICsxMDg0 LDcgQEAgc21lcmdlLXJlZmluZS1yZWdpb25zCiAgICAgOzsgQ2FsbCBkaWZmIG9uIHRob3NlIGZp bGVzLgogICAgICh1bndpbmQtcHJvdGVjdAogICAgICAgICAod2l0aC10ZW1wLWJ1ZmZlcgotICAg ICAgICAgIChsZXQgKChjb2Rpbmctc3lzdGVtLWZvci1yZWFkICdlbWFjcy1pbnRlcm5hbCkpCisg ICAgICAgICAgKGxldCAoKGNvZGluZy1zeXN0ZW0tZm9yLXJlYWQgJ2VtYWNzLW11bGUpKQogICAg ICAgICAgICAgKGNhbGwtcHJvY2VzcyBkaWZmLWNvbW1hbmQgbmlsIHQgbmlsCiAgICAgICAgICAg ICAgICAgICAgICAgICAgIChpZiAoYW5kIHNtZXJnZS1yZWZpbmUtaWdub3JlLXdoaXRlc3BhY2UK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCBzbWVyZ2UtcmVmaW5lLXdl aWdodC1oYWNrKSkK --94eb2c035aaa95a98b0561a71de1--