From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Mathias Dahl" Newsgroups: gmane.emacs.devel Subject: Re: Preserving sanity in Emacs [Re: rampant region highlighting] Date: Tue, 8 Apr 2008 01:54:04 +0200 Message-ID: <7dbe73ed0804071654p2637b14fy3173d8f8e811509c@mail.gmail.com> References: <47F945C3.1060103@harpegolden.net> <20080406230056.GB5362@muc.de> <47F961D2.7080002@harpegolden.net> <20080407212617.GC2078@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1207612460 31416 80.91.229.12 (7 Apr 2008 23:54:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2008 23:54:20 +0000 (UTC) Cc: Glenn Morris , emacs-devel@gnu.org To: "Alan Mackenzie" , "David De La Harpe Golden" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 08 01:54:53 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 1Jj1Ap-0006eG-0f for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2008 01:54:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jj1AB-0008CU-Og for ged-emacs-devel@m.gmane.org; Mon, 07 Apr 2008 19:54:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jj1A8-0008CN-WB for emacs-devel@gnu.org; Mon, 07 Apr 2008 19:54:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jj1A7-0008C7-IG for emacs-devel@gnu.org; Mon, 07 Apr 2008 19:54:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jj1A7-0008C4-FS for emacs-devel@gnu.org; Mon, 07 Apr 2008 19:54:07 -0400 Original-Received: from rn-out-0910.google.com ([64.233.170.191]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jj1A7-0003mc-0k for emacs-devel@gnu.org; Mon, 07 Apr 2008 19:54:07 -0400 Original-Received: by rn-out-0910.google.com with SMTP id e21so2235780rng.6 for ; Mon, 07 Apr 2008 16:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=vJewNnF51Yci8oCo653sf+fKcqnGPVrww/5D3J/Qb0M=; b=F6yLRL0HEFBLNvgu8v71niS651vf9+CzfYAUardqv9Pz7UNmhaq5JuEXTLU9dO5nhIS2HmS0xtgPTfTovTGNTfJ58F2muFK6CWP8Bh37HLROLQtr+moMkU8oJdNo6mlblk45XabInCYeCWT5zrUmYrM/btb8Ir6QZUQ7WFJrrts= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kLPD7bBlSKkeyIYrvFfpqNPnaBT6CX94MWjW5FdIUEyrXmvY1QodcglzgTFRj7VoFLQyLONPa7P3b53jM0kr1zTgBZ3299YDTIZQi0BJFfo8/OrmUSoWtV8CcPY6E4OmlKHw69j6AjHoKjPJxJTE32dEgjtdMjqdVUsB+A1taI4= Original-Received: by 10.114.151.13 with SMTP id y13mr6658893wad.145.1207612444311; Mon, 07 Apr 2008 16:54:04 -0700 (PDT) Original-Received: by 10.114.146.9 with HTTP; Mon, 7 Apr 2008 16:54:04 -0700 (PDT) In-Reply-To: <20080407212617.GC2078@muc.de> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:94651 Archived-At: > > I acknowledge that having the point always on-screen has benefits too > > (though e.g. a fringe indicator could "point towards the offscreen > > point" to address some concerns there...), but what if I'm just > > scrolling up to look at something? Martin's hack ensured that I can > > scroll away to have a look, and the point will reliably be where I left > > it when I scrolled back. May I suggest you have a look at unscroll.el, which lets you "unscroll" back to where you were, should you by mistake or on purpose scroll far far away in the buffer: ;;; Commentary: ;; To use: (require 'unscroll) in your .emacs. ;; This file uses "advice" to modify the scrolling commands such that ;; the screen appearance is preserved at the start of each series of ;; scrolls. Ever press C-v C-v C-v when you meant C-b C-b C-b? ;; That's what this is meant to remedy. ;; After scrolling (intentionally or otherwise), you can restore the ;; display with M-x unscroll RET, which I like to bind to C-M-v using ;; (define-key global-map "\C-\M-v" 'unscroll). http://se.aminet.net/pub/gnu/emacs-lisp/incoming/unscroll.el When I was new to Emacs it happened from time to time that I used some movement command by mistake. I would have needed this hack then. Nowadays I don't have that problem anymore and if it happens C-u C-SPC often takes me close to where I was. Still, I like the idea and it would be neat if it were built-in.