From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrii Kolomoiets Newsgroups: gmane.emacs.devel Subject: Re: master f450798: Don't move point in vc-dir on vc-register/vc-checkin (bug#43188) Date: Tue, 15 Sep 2020 22:14:12 +0300 Message-ID: References: <20200904211737.15548.63989@vcs0.savannah.gnu.org> <20200904211738.DA94720667@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14709"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 15 21:17:53 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIGSf-0003in-82 for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Sep 2020 21:17:53 +0200 Original-Received: from localhost ([::1]:42134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIGSe-0004cu-7q for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Sep 2020 15:17:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIGPK-0001id-84 for emacs-devel@gnu.org; Tue, 15 Sep 2020 15:14:26 -0400 Original-Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:44920) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIGPE-0001tD-Ih for emacs-devel@gnu.org; Tue, 15 Sep 2020 15:14:25 -0400 Original-Received: by mail-lj1-x235.google.com with SMTP id b19so3782016lji.11 for ; Tue, 15 Sep 2020 12:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=MCQCcljZWg1xuN7+dtWR1xlGZrYg6kxV9CK7immP82g=; b=hyQClZ0SJQD4hIGqShSkM9J3+kFdWv90UUhxumqljrKgIunwcwEEHIvYz0O5PeHV7y 0gjmCTn5wOcDVsjvUEzthcX1+FlgGDrKANgRYChgdf4DUCQ/pNFDjHIfqFK5tzZKb+yy bv8kKCd+O5V5oLTzrlVm63y+rfTZr781sLf5csqpEossBLZpeJG/X2MZNDmIp//oR287 t9X/tOQq901xplw2qLn8weVpk8PJMzAB3wm1KSga7PptlWG40KrHHsZWW4a0T1bSREAi J97ntdrABjyqKrre0gKPDGg0f/qwjj23MRRKD7tw/NRTxlk4Pqyh8CLXum2QL4CYPFrS NQnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=MCQCcljZWg1xuN7+dtWR1xlGZrYg6kxV9CK7immP82g=; b=gTLQrV/8FHM8qeDm7wnBQ9pZSnvFieJhsa/uIAZNhCi9gbUf2+SVlTglajqwcmP9be gQw3CpEQkOQG4rLh1oi3ARA7cmU0fu2BsnZzg68JOZgQJvMaPiQRkC+n6gd8CqrWexeE jCWWLDH6pheLkPWDwkH4sYGFj0ojvgUsDE5kbQzxkccVLcka6tMOxMgnAOj8t79dkp9/ NVzCPGAZ08ivN2T1YCsRxHtQayw+DJOGnkt3SZj8hsdGoTzsvuMj1rY2Fw7OCv0RQm86 DTVspNqYfQrdFt5cNRSafijGPTTAi1KRPC6sbOWnXX8lcN4o6Bfd1/BhRwLoVpzaA0MI 6Odg== X-Gm-Message-State: AOAM531j1WdKDuVN5yi67SRefQ6gebqvwKsI2SagIlUmf+PWY5UyyhFB vyidN9wb5VQuLcMIhIKgbztRX/p5qjA= X-Google-Smtp-Source: ABdhPJzC4vut0N8FYgkKSBijXnrxGQNvNzZs0pgYtL5e3IzywqFXtQpIwTfwjffZod2yzjadQF7XRQ== X-Received: by 2002:a2e:8956:: with SMTP id b22mr7234449ljk.85.1600197255382; Tue, 15 Sep 2020 12:14:15 -0700 (PDT) Original-Received: from muffinmac ([91.206.110.141]) by smtp.gmail.com with ESMTPSA id 15sm4518199lfl.38.2020.09.15.12.14.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 12:14:14 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 13 Sep 2020 16:27:44 -0400") Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=andreyk.mad@gmail.com; helo=mail-lj1-x235.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:255783 Archived-At: Stefan Monnier writes: > Wow! That seems more complex than we'd like it to be. > Hmm... > > Maybe doing it inside ewoc--refresh-node makes it easier, as in the > 100% untested patch below. The complexity came from attempt to save the line and column offset within node. That code is not needed considering that there are not so many multiline ewoc nodes. The reason the save-point code was added to 'ewoc-invalidate' is to avoid point movements on refreshing each node and make one movement once all the nodes are refreshed. As I can see 'ewoc-invalidate' is used to refresh single node, so placing that code inside 'ewoc--refresh-node' is more appropriate. Your code works great except: > + (goto-char (+ m (* percent (- end m))))))) ^ this must be wrapped with (round) Also I would move point by offset rather than percent to save exactly the same position. Imagine the line in vc-dir (with point under |): edited |foo.txt After invalidation some text is added after filename, e.g.: edited |foo.txt (resolved conflict or something) Isn't it better to leave point where it was and not move it to the right because line length is increased?