From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Something like `without-redisplay'? Date: Tue, 01 Sep 2015 18:57:03 +0300 Message-ID: <83a8t6ceuo.fsf@gnu.org> References: <83egij1qr5.fsf@gnu.org> <83zj16zwup.fsf@gnu.org> <83h9nechuu.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1441123052 28544 80.91.229.3 (1 Sep 2015 15:57:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Sep 2015 15:57:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 01 17:57:24 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZWnw3-0006bk-5X for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Sep 2015 17:57:23 +0200 Original-Received: from localhost ([::1]:55336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWnw2-0006ut-RL for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Sep 2015 11:57:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWnvc-0006mf-V3 for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 11:57:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWnvZ-0002Og-Dq for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 11:56:56 -0400 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:38720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWnvZ-0002OT-2M for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 11:56:53 -0400 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NU000M009C29W00@mtaout29.012.net.il> for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 18:57:09 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NU000EQQ9N9VHB0@mtaout29.012.net.il> for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 18:57:09 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.185 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106961 Archived-At: > Date: Tue, 1 Sep 2015 17:24:08 +0200 > From: Alexander Shukaev > Cc: help-gnu-emacs > > >> behave incorrectly when window has non-zero horizontal scroll. The > >> problem might be deep in how Emacs implements `next-line' or > >> `previous-line' or whatever. > > > > More likely, the function in question has bug. > > > >> But I found a solution, when I use `evil-previous-visual-line' and > >> `evil-next-visual-line' in my own functions, I simply wrap their > >> calls into the `devil-without-window-hscroll' macro, so that during > >> their execution there is no horizontal scrolling. > > > > I'd suggest to find the bug in the function and fix it instead. > > I'd love to, but I'm no expert with these. Unfortunately, can't > afford some time for this now. Did you report the problem to the maintainer of that code? If not, I suggest to do that. > > It can in rare cases, if you scroll vertically. It all depends on > > what the code does, exactly. > > OK, then here is an example > > (save-excursion (scroll-down 10)) ;; just scroll > (previous-line 10) ;; then move point with the method we want > > I've tested it and so far, I see no problems with it. I think there > is another option to do the same like this > > (save-window-excursion (previous-line 10)) ;; just move point with the > method we want > (save-excursion (scroll-down 10)) ;; then scroll > > Which one is more reliable? Can I even expect any problems with these codes? Not with these, I think. I'm sorry, I cannot give any precise instructions regarding what not to do, except repeating that in general it is very unlikely that you will see point moving when Lisp code takes care to return point to the same place and does not change the window configuration. I just know that some code paths inside redisplay are capable of moving point if they otherwise cannot satisfy the constraints of vertical position of point, such as scroll-margin. > > Horizontal scrolling doesn't move point, AFAIR. > > Even if `auto-hscroll-mode' is on (which it is by default)? auto-hscroll-mode does the opposite: it scrolls the display to move point into the view. It doesn't move point.