Received: (at 72392) by debbugs.gnu.org; 24 Aug 2024 08:23:06 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 24 04:23:06 2024 Received: from localhost ([127.0.0.1]:40391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1shm37-0006kx-Uc for submit <at> debbugs.gnu.org; Sat, 24 Aug 2024 04:23:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1shm36-0006kR-G3 for 72392 <at> debbugs.gnu.org; Sat, 24 Aug 2024 04:23:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1shm2E-0005Rn-Uj; Sat, 24 Aug 2024 04:22:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6uUwb+l0YNo6DLSEV12EZMaVxiLwWfCVND5ElxVbZEU=; b=SKK1XiGM4puy XNA+P0vXES6EqomysvE83ES9GS6p234W+qOsC7LkvHO33TeBYDAPPoL8yjrZ0Y0Ine2T7ZsBwDI1h xE5EK79LCdOEqpqvD8eFmHsWcMdwZ/uLPcC+uwbjC1TuZtsefFwsdAIexfUlI6YwUzOdq1rKk6R6I KRsfsN4V3LJHBoqmEX519Pk2plyg1IRE1fk1J9b57Nt9H2/QMfI0xWZxVyyq2hk0Dej81Xxe6uIXM a0uFvD5aBlym/oWE4cE1lXbcn/9k5xcTPoPVsBzVKBIzGN2nyBO7IvrUOJWTZltp0G6BWEXzD+SY+ LegbqdWr5GC87hERH50WfA==; Date: Sat, 24 Aug 2024 11:22:08 +0300 Message-Id: <86r0aenxe7.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: monnier@HIDDEN In-Reply-To: <867cczwgx6.fsf@HIDDEN> (message from Eli Zaretskii on Fri, 02 Aug 2024 09:57:25 +0300) Subject: Re: bug#72392: 30.0.50; Wrong `next-line` behavior References: <jwvcymu6my6.fsf-monnier+@gnu.org> <867cczwgx6.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72392 Cc: 72392 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Ping! A simple test case could go a long way towards a solution. > Cc: 72392 <at> debbugs.gnu.org, monnier@HIDDEN > Date: Fri, 02 Aug 2024 09:57:25 +0300 > From: Eli Zaretskii <eliz@HIDDEN> > > > Cc: monnier@HIDDEN > > Date: Wed, 31 Jul 2024 03:43:20 -0400 > > From: Stefan Monnier via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> > > > > - Apply the `smerge-mode.patch` below to Emacs's` master` (and > > recompile `smerge-mode.el`). > > - Open the short diff file below with: > > > > emacs -Q --eval '(setq-default word-wrap t diff-font-lock-prettify t)' \ > > .../bug-weird-next-line.diff > > > > - In my case, when this opens there's a "word wrap" just before "This" > > and just before "\id{seg}" (on the 4th and 5th lines, resp). > > If that's not the case for you, resize your frame so that this is > > the case. > > > > - Do `C-n` a few times. > > Any hope of a simpler recipe, which would not require patching Emacs? > Cannot you just post the contents of the problematic buffer and the > non-default settings to use to reproduce the problem? > > The bug is probably somewhere in vertical-motion or in line-move and > its subroutines, but a simpler recipe will make the investigation less > painful. > > TIA > > > >
bug-gnu-emacs@HIDDEN
:bug#72392
; Package emacs
.
Full text available.Received: (at 72392) by debbugs.gnu.org; 2 Aug 2024 06:57:56 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 02 02:57:56 2024 Received: from localhost ([127.0.0.1]:52216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sZmEe-0006h3-C5 for submit <at> debbugs.gnu.org; Fri, 02 Aug 2024 02:57:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1sZmEa-0006go-OH for 72392 <at> debbugs.gnu.org; Fri, 02 Aug 2024 02:57:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1sZmEC-0005HK-Vh; Fri, 02 Aug 2024 02:57:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=SVVs7o/Ao9oVM43oJlL6aDEyLErqwc5M9MhtpYs3oJQ=; b=aeDZZxSDjI85 bz/vot74Xs6a7tddePhZ1kUcApsbcrCg6lDqPm4iGc8SWirdvjkY/50/GE9jfSDAs7SRP9Z3x/58E rtX9dVXZn8+n6b/GK1l4/9qM+G3ZWY27lAcUoXLhwSOc0YWMPeCCpOvLbyPSmlKayZITWyQsWfjAy kFjEKHYY9BUB563FuwXF7/xVyouTMK/NWg1D3nfJ+70J+rKg0bBdWzWCbbyueBD9gfc9tDlyFJ1QW KL9RL9ESGkVkORHFmrEl9LLHdVLCx/GDW9wDhru3cPPxVNoQqf1aBGmEju6Y8fm93krPvUB+B/4IK uOQAjRpMZ4TDhN+a1foR1A==; Date: Fri, 02 Aug 2024 09:57:25 +0300 Message-Id: <867cczwgx6.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Stefan Monnier <monnier@HIDDEN> In-Reply-To: <jwvcymu6my6.fsf-monnier+@gnu.org> (bug-gnu-emacs@HIDDEN) Subject: Re: bug#72392: 30.0.50; Wrong `next-line` behavior References: <jwvcymu6my6.fsf-monnier+@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72392 Cc: 72392 <at> debbugs.gnu.org, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Cc: monnier@HIDDEN > Date: Wed, 31 Jul 2024 03:43:20 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> > > - Apply the `smerge-mode.patch` below to Emacs's` master` (and > recompile `smerge-mode.el`). > - Open the short diff file below with: > > emacs -Q --eval '(setq-default word-wrap t diff-font-lock-prettify t)' \ > .../bug-weird-next-line.diff > > - In my case, when this opens there's a "word wrap" just before "This" > and just before "\id{seg}" (on the 4th and 5th lines, resp). > If that's not the case for you, resize your frame so that this is > the case. > > - Do `C-n` a few times. Any hope of a simpler recipe, which would not require patching Emacs? Cannot you just post the contents of the problematic buffer and the non-default settings to use to reproduce the problem? The bug is probably somewhere in vertical-motion or in line-move and its subroutines, but a simpler recipe will make the investigation less painful. TIA
bug-gnu-emacs@HIDDEN
:bug#72392
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 31 Jul 2024 07:43:56 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 31 03:43:56 2024 Received: from localhost ([127.0.0.1]:48958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sZ404-00089K-3J for submit <at> debbugs.gnu.org; Wed, 31 Jul 2024 03:43:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:56192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1sZ3zz-000899-N1 for submit <at> debbugs.gnu.org; Wed, 31 Jul 2024 03:43:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <monnier@HIDDEN>) id 1sZ3zk-0001J3-3H for bug-gnu-emacs@HIDDEN; Wed, 31 Jul 2024 03:43:36 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <monnier@HIDDEN>) id 1sZ3zi-0000hV-1w for bug-gnu-emacs@HIDDEN; Wed, 31 Jul 2024 03:43:35 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6050C4408D3; Wed, 31 Jul 2024 03:43:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1722411808; bh=nKG76FeZscPt3UID16lNEMNRdiFxUIfKnK8NYU8QPe0=; h=From:To:Subject:Date:From; b=KuM11bBpveOGugL596zHedsVh0xYYLrngGbLTFUBgJCERmD1ZBRAgcfAjflOhwRLF sxiecVV5QzPfqQvQsdkFsNUjONpfSSQxfLUs8m4/EoXQNOvUfOLrdsSLXXlVek6jKA IXIBruBNrCJynVu2e3CsjFsWaCt9xImDv8c2gNeak1tTH1U+G1Jvca439tNM87g2QK kqIY8//12eGpFH4VftnE7dSpRZ57RbvotZhswU6oxzsZjvKdaQrIQg7O3AvwWmMOkM nd3N0Hlnb+ZDW2Yn1p67o/5AHdMQYFjDsBWslSKKMEeBETqn0bpaOY6HFSIDiHARAy utQf/ZuI0rXmA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 83482440071; Wed, 31 Jul 2024 03:43:28 -0400 (EDT) Received: from asado (dyn.144-85-159-142.dsl.vtx.ch [144.85.159.142]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AC1EC1201D8; Wed, 31 Jul 2024 03:43:27 -0400 (EDT) From: Stefan Monnier <monnier@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: 30.0.50; Wrong `next-line` behavior Message-ID: <jwvcymu6my6.fsf-monnier+@gnu.org> X-Debbugs-Cc: monnier@HIDDEN Date: Wed, 31 Jul 2024 03:43:20 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.000 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@HIDDEN; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Package: Emacs Version: 30.0.50 Here's a funny corner case I just bumped into: - Apply the `smerge-mode.patch` below to Emacs's` master` (and recompile `smerge-mode.el`). - Open the short diff file below with: emacs -Q --eval '(setq-default word-wrap t diff-font-lock-prettify t)' \ .../bug-weird-next-line.diff - In my case, when this opens there's a "word wrap" just before "This" and just before "\id{seg}" (on the 4th and 5th lines, resp). If that's not the case for you, resize your frame so that this is the case. - Do `C-n` a few times. What I see is that `C-n` jumps down to the "T" of the word-wrapped "This" as it should, but that the next `C-n` doesn't jump to the next (visual) line but jumps to the "s" of "This" instead. The same kind of misbehavior occurs on the next (logical) line with "\id{seg}". Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=smerge-mode.patch diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index a16c7871ff9..05ab757f09a 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -1034,26 +1034,68 @@ smerge--refine-highlight-change smerge-refine-forward-function) startline) (point))) - (end (progn (funcall (if smerge-refine-weight-hack - #'forward-char - smerge-refine-forward-function) - (if match-num2 - (- (string-to-number match-num2) - startline) - 1)) - (point)))) - (when smerge-refine-ignore-whitespace - (skip-chars-backward " \t\n" beg) (setq end (point)) - (goto-char beg) - (skip-chars-forward " \t\n" end) (setq beg (point))) - (when (> end beg) + (end (if (eq t match-num2) beg + (funcall (if smerge-refine-weight-hack + #'forward-char + smerge-refine-forward-function) + (if match-num2 + (- (string-to-number match-num2) + startline) + 1)) + (point)))) + (when (eq t match-num2) + ;; FIXME: No idea where this off-by-one comes from! + (setq beg (1+ beg)) + (setq end (1+ end)) + (goto-char end)) + (when (and smerge-refine-ignore-whitespace + (< beg end)) + (let* ((newend (progn (skip-chars-backward " \t\n" beg) (point))) + (newbeg (progn (goto-char beg) + (skip-chars-forward " \t\n" newend) (point)))) + (unless (eq newend newbeg) + (setq end newend) + (setq beg newbeg)))) + (cond + ((> end beg) (let ((ol (make-overlay beg end nil ;; Make them tend to shrink rather than spread when editing. 'front-advance nil))) + (overlay-put ol 'smerge--debug (list match-num1 match-num2 startline)) (overlay-put ol 'evaporate t) (dolist (x props) (overlay-put ol (car x) (cdr x))) - ol))))) + ol)) + ((= end beg) + (setq end (if (< beg (point-max)) + (1+ beg) + (cl-assert (< (point-min) (point-max))) + (setq beg (1- (point-max))) + (point-max))) + (let ((ol (make-overlay + beg end nil + ;; Make them tend to shrink rather than spread when editing. + 'front-advance nil))) + (overlay-put ol 'smerge--debug (list match-num1 match-num2 startline)) + (overlay-put ol 'evaporate t) + ;; Some of the properties need to go to `ol' and others + ;; need to go to the string :-( + ;; FIXME: I've seen lines in `diff-mode' where the half-space ends up + ;; placed at the beginning of the next line rather than the + ;; end of the current line, as in: + ;; + ;; -foo bar + ;; + foo bar b + ;; ^ + (overlay-put ol 'before-string + (propertize + " " 'face (cdr (assq 'face props)) + 'display '(space :width 0.5))) + (dolist (x props) + (unless (eq (car-safe x) 'face) + (overlay-put ol (car x) (cdr x)))) + ol)) + (t (error "Smerge WOW! %S" (list beg end match-num2))))))) ;;;###autoload (defun smerge-refine-regions (beg1 end1 beg2 end2 props-c &optional preproc props-r props-a) @@ -1114,20 +1156,18 @@ smerge-refine-regions (m2 (match-string 2)) (m4 (match-string 4)) (m5 (match-string 5))) - (when (memq op '(?d ?c)) - (setq last1 - (smerge--refine-highlight-change - beg1 m1 m2 - ;; Try to use props-c only for changed chars, - ;; fallback to props-r for changed/removed chars, - ;; but if props-r is nil then fallback to props-c. - (or (and (eq op '?c) props-c) props-r props-c)))) - (when (memq op '(?a ?c)) - (setq last2 - (smerge--refine-highlight-change - beg2 m4 m5 - ;; Same logic as for removed chars above. - (or (and (eq op '?c) props-c) props-a props-c))))) + (setq last1 + (smerge--refine-highlight-change + beg1 m1 (if (eq op ?a) t m2) + ;; Try to use props-c only for changed chars, + ;; fallback to props-r for changed/removed chars, + ;; but if props-r is nil then fallback to props-c. + (or (and (eq op '?c) props-c) props-r props-c))) + (setq last2 + (smerge--refine-highlight-change + beg2 m4 (if (eq op ?d) t m5) + ;; Same logic as for removed chars above. + (or (and (eq op '?c) props-c) props-a props-c)))) (forward-line 1) ;Skip hunk header. (and (re-search-forward "^[0-9]" nil 'move) ;Skip hunk body. (goto-char (match-beginning 0)))) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=bug-weird-next-line.diff @@ -2004,7 +2538,8 @@ equivalent to a function out of the interval. Its defining characteristic is -that the output of such a function has to agree at both endpoints of $\bI$. This -is enforced by the elimination principle of the $\bI$ that ensures that \id{seg} +that the output of such a function has to agree at both endpoints of $\bI$. +This is enforced by the elimination principle of the $\bI$ that ensures that +\id{seg} is respected. \begin{minted}[escapeinside=@@,mathescape=true]{agda} type I --=-=-=--
Stefan Monnier <monnier@HIDDEN>
:monnier@HIDDEN, bug-gnu-emacs@HIDDEN
.
Full text available.monnier@HIDDEN, bug-gnu-emacs@HIDDEN
:bug#72392
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.