From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kamphausen@creativepharma.com (Stefan Kamphausen) Newsgroups: gmane.emacs.help Subject: Re: how to just back to previous location quickly? Date: 24 Apr 2003 05:50:18 -0700 Organization: http://groups.google.com/ Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <62ede926.0304240450.47d6df07@posting.google.com> References: NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1051189740 27419 80.91.224.249 (24 Apr 2003 13:09:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 24 Apr 2003 13:09:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 24 15:08:59 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 198gTC-000787-00 for ; Thu, 24 Apr 2003 15:08:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 198gHI-0001pz-00 for gnu-help-gnu-emacs@m.gmane.org; Thu, 24 Apr 2003 08:56:40 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: 217.226.220.60 Original-X-Trace: posting.google.com 1051188618 7854 127.0.0.1 (24 Apr 2003 12:50:18 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 24 Apr 2003 12:50:18 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:112272 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:8770 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8770 Hi, wang yin wrote in message news:... > Hi, > > I use M-. to go to a tag. And I M-. to some other places... > And I can M-* to get back to where I was step by step. > > But how can I get forth then? > I mean, if I jump to other locations with grep, tag, ... How can I > quickly get back to where I was? bookmarks are too slow. I've been using the following code for several years and I am very happy with it. You just quickly store your position (using C-. in my setting), move somewhere else and then can toggle between the stored and the new position using C-,. Of course the keybinding is a matter of taste... ;; suggested key-bindings: ;;(global-set-key '(control \.) 'ska-point-to-register) ;;(global-set-key '(control \,) 'ska-jump-to-register) (defun ska-point-to-register() "Store cursorposition _fast_ in a register. Use ska-jump-to-register to jump back to the stored position." (interactive) (setq zmacs-region-stays t) (point-to-register 8)) (defun ska-jump-to-register() "Switches between current cursorposition and position that was stored with ska-point-to-register." (interactive) (setq zmacs-region-stays t) (let ((tmp (point-marker))) (jump-to-register 8) (set-register 8 tmp))) Hope this helps... Stefan Kamphausen