From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package proposal: visual-path-abbrev.el Date: Sat, 02 Mar 2019 13:34:36 +0200 Message-ID: <83k1hhh5mb.fsf@gnu.org> References: <87tvglpmcx.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="229442"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 02 12:34:59 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h02uw-000xS0-8K for ged-emacs-devel@m.gmane.org; Sat, 02 Mar 2019 12:34:58 +0100 Original-Received: from localhost ([127.0.0.1]:52938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h02uv-0007Ut-0Q for ged-emacs-devel@m.gmane.org; Sat, 02 Mar 2019 06:34:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h02um-0007Sr-DX for emacs-devel@gnu.org; Sat, 02 Mar 2019 06:34:49 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h02um-0003jc-AI for emacs-devel@gnu.org; Sat, 02 Mar 2019 06:34:48 -0500 Original-Received: from [176.228.60.248] (port=1082 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h02ul-0006ep-QR; Sat, 02 Mar 2019 06:34:48 -0500 In-reply-to: <87tvglpmcx.fsf@gnu.org> (message from Tassilo Horn on Sat, 02 Mar 2019 12:05:50 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233760 Archived-At: > From: Tassilo Horn > Date: Sat, 02 Mar 2019 12:05:50 +0100 > > I've just written a small minor mode which abbreviates file paths > visually by using overlays. When point enters such an overlay, the path > is shown normally again. The GNU Coding Style conventions frown on using "path" for anything but PATH-style directory lists. I think you mean "file names" here. > - Sometimes when scrolling fast and then stopping, only parts of the > visible buffer portion got the overlays applied. You can try > triggering that problem by enabling the mode in a *grep* buffer and > then scrolling a long way. Your code seems to update the overlays in a function called from post-command-hook, but post-command-hook runs before redisplay updates the window due to last command. So you are using stale window-start and window-end values, and if the last command scrolls some file names into the view, those file names might not have overlays on them. I think the preferred method is to use jit-lock-register to register your function; see e.g. glasses.el for how this can be done. > - When lines are wrapped around and line-move-visual is t, the mode can > make the line short enough so that it doesn't wrap anymore. But > still next-line moves point to where it would belong if the mode were > not active, i.e., point jumps to somewhere on the same line. That sounds like a bug, so a minimal recipe to reproduce this (in a bug report, please ;-) would be appreciated. Thanks.