From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Shukaev Newsgroups: gmane.emacs.help Subject: Re: Something like `without-redisplay'? Date: Tue, 1 Sep 2015 01:37:22 +0200 Message-ID: References: <83egij1qr5.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1441064328 11965 80.91.229.3 (31 Aug 2015 23:38:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 31 Aug 2015 23:38:48 +0000 (UTC) Cc: help-gnu-emacs To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 01 01:38:34 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 1ZWYdv-0003QL-4I for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Sep 2015 01:37:39 +0200 Original-Received: from localhost ([::1]:42303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWYdu-0005Dh-Jf for geh-help-gnu-emacs@m.gmane.org; Mon, 31 Aug 2015 19:37:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWYdh-0005DL-UF for help-gnu-emacs@gnu.org; Mon, 31 Aug 2015 19:37:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWYdg-0005Nc-Uv for help-gnu-emacs@gnu.org; Mon, 31 Aug 2015 19:37:25 -0400 Original-Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:35668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWYdf-0005N8-C8; Mon, 31 Aug 2015 19:37:23 -0400 Original-Received: by lanb10 with SMTP id b10so46265061lan.2; Mon, 31 Aug 2015 16:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=z2LFIw1Mubkxzb8UUCZ9WGuTLnFSJbVptzZJne/Dvgs=; b=J8lLjujMT8g9e+FhS9q/6twiyh6x1+AE/PYUhXuiXEHIpO+99WoSVX1e29V9NprI00 btUrqbhabygFAX/yKeNWZ5km/Y/Jvq1Fb/AiKRzSKzNzRbsT7poEk0laCUSv9kq1SZwn 1wjolneCSxHLUbUCC1fH/c1gZepKSyoUaw18tLBQxMHV7asv/0xo1n3TkgpuNZgnjZcf LwsOksUW/OdvTqPP/t0Jo5zH7lgzyJ9DeMiCOpCYriAwi6KHvxfF64C5PDF0F2VK4l7+ 6tZfBbAJtNqIaoPX3N0iymxDoUYonAvSPSAXu5NvJrPyjNvKOCDENb4mJe97YQzfUXl+ RHsg== X-Received: by 10.112.171.68 with SMTP id as4mr11678661lbc.64.1441064242307; Mon, 31 Aug 2015 16:37:22 -0700 (PDT) Original-Received: by 10.112.34.17 with HTTP; Mon, 31 Aug 2015 16:37:22 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22a 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:106946 Archived-At: A couple of related questions. I have written several macros like the following: (defmacro devil-without-window-hscroll (&rest body) "\ Execute BODY without horizontal scrolling in the selected window." (declare (debug t) (indent defun)) `(let ((hscroll (window-hscroll))) (set-window-hscroll (selected-window) 0) (unwind-protect (progn ,@body) (set-window-hscroll (selected-window) hscroll)))) In brief, these are macros which somehow alter viewport (how window views a buffer) temporarily and then restore it. For instance, if `auto-hscroll-mode' is on, should I fear that `set-window-hscroll' will move point? I personally, have not experienced this problem, but still I want to know exactly what to expect. For example, would you recommend to wrap `set-window-hscroll' into `save-excursion' or that would be redundant? By the way, the same would apply to vertical changes in viewport (due to vertical scrolling, for example) as Emacs auto-scrolls (moves point to keep it in viewport) by default. Yet, again, I've never experienced any problem with this too.