From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: scroll-restore.el Date: Fri, 22 Feb 2008 20:26:39 +0100 Message-ID: <47BF21EF.10601@gmx.at> References: <87myq4saw1.fsf@catnip.gol.com> <20080219190127.GA1106@muc.de> <877ih0o9dx.fsf@catnip.gol.com> <86lk5f4fjb.fsf@timbral.net> <87ejb7babz.fsf@xmission.com> <85lk5fcod6.fsf@lola.goethe.zz> <8e24944a0802201446g3329febcw190f78145e3f5c4e@mail.gmail.com> <47BD2883.20009@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1203708825 6104 80.91.229.12 (22 Feb 2008 19:33:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Feb 2008 19:33:45 +0000 (UTC) Cc: david.delaharpe.golden@gmail.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 22 20:34:10 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JSded-0005VM-Es for ged-emacs-devel@m.gmane.org; Fri, 22 Feb 2008 20:33:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSde7-0005vA-W5 for ged-emacs-devel@m.gmane.org; Fri, 22 Feb 2008 14:33:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JSde3-0005un-Rc for emacs-devel@gnu.org; Fri, 22 Feb 2008 14:33:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JSde2-0005uF-Cp for emacs-devel@gnu.org; Fri, 22 Feb 2008 14:33:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSde2-0005uC-7N for emacs-devel@gnu.org; Fri, 22 Feb 2008 14:33:18 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JSde1-00048g-Gs for emacs-devel@gnu.org; Fri, 22 Feb 2008 14:33:17 -0500 Original-Received: (qmail invoked by alias); 22 Feb 2008 19:33:15 -0000 Original-Received: from N775P031.adsl.highway.telekom.at (EHLO [62.47.40.223]) [62.47.40.223] by mail.gmx.net (mp008) with SMTP; 22 Feb 2008 20:33:15 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19FvjlV1pFFknoiN6SiCEM36fU/VLlg1N59ha43Fq ezOmWAEXgFPI01 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90004 Archived-At: > I think this is trying to implement too many different features, and > we don't want them all. I would rather implement just the feature of > restoring point after you scroll back to the previous screen, in a > simple way. It's the only feature I use in practice. But I never scroll a window when the region is highlighted. Scrolling with a highlighted region is a real pain when `point' gets relocated to stay on screen. > In general, it is best to avoid `pre-command-hook' whenever a finer > tool can be used, and likewise `post-command-hook'. Goes without saying. Last summer someone on bug-gnu-emacs lamented the absence of such a feature. I just wanted to know whether I liked it and use it ever since. > ;; Note: We can't use `point-before-scroll' for our purposes because > ;; that variable is buffer-local. > > WHY isn't `point-before-scroll' enough? The variable must be window-local to handle the case of independently scrolling two or more windows showing the same buffer (setting `mouse-wheel-follow-mouse' to t makes that possible). > Would it be enough just for the feature of restoring point? > > We need a variable that recorded > ;; `window-point' before a sequence of scroll operations. Also > ;; `point-before-scroll' is not handled by mwheel.el and some other > ;; commands that do implicit scrolling. > > I presume we can fix `point-before-scroll' to DTRT in those cases. In > general, if a primitive feature isn't suitable for the job it is meant for, > let's make it suitable, rather than do the job in a heavy-handed way. I'll have to look into how `point-before-scroll' is currently used by the scroll-bar / mouse code and whether it can (or should) be safely made window-local. > If we want a few commands to do a certain thing, then it is a bad idea > to use `post-command-hook' to check for them. Instead we should > change those commands to do it, whatever IT is. We can add a new > specific hook, and run it from commands and features that scroll. > > People often choose `post-command-hook' rather than change C code. > But when we design changes to install in Emacs, we should not design > them based on the premise of "avoid changing the C code." Fully agreed.