From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: scroll-restore.el Date: Thu, 21 Feb 2008 17:29:24 -0500 Message-ID: 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> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1203633416 1215 80.91.229.12 (21 Feb 2008 22:36:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Feb 2008 22:36:56 +0000 (UTC) Cc: david.delaharpe.golden@gmail.com, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 21 23:37:17 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 1JSK2W-0004BY-De for ged-emacs-devel@m.gmane.org; Thu, 21 Feb 2008 23:37:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSK21-0002I2-84 for ged-emacs-devel@m.gmane.org; Thu, 21 Feb 2008 17:36:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JSJuw-000457-8D for emacs-devel@gnu.org; Thu, 21 Feb 2008 17:29:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JSJuv-00044g-Ic for emacs-devel@gnu.org; Thu, 21 Feb 2008 17:29:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSJuv-00044Z-Aq for emacs-devel@gnu.org; Thu, 21 Feb 2008 17:29:25 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JSJuv-0006j9-83 for emacs-devel@gnu.org; Thu, 21 Feb 2008 17:29:25 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1JSJuu-0001RE-Kr; Thu, 21 Feb 2008 17:29:24 -0500 In-reply-to: <47BD2883.20009@gmx.at> (message from martin rudalics on Thu, 21 Feb 2008 08:30:11 +0100) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:89880 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. In general, it is best to avoid `pre-command-hook' whenever a finer tool can be used, and likewise `post-command-hook'. ;; Note: We can't use `point-before-scroll' for our purposes because ;; that variable is buffer-local. WHY isn't `point-before-scroll' enough? 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. 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."