From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: how to set the initial point position when visit a file Date: Mon, 15 Oct 2007 17:36:09 +0200 Message-ID: References: <1192370035.707235.216150@v29g2000prd.googlegroups.com> <1192372416.039029.75980@z24g2000prh.googlegroups.com> <1192375674.871514.83460@i13g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1192464114 9052 80.91.229.12 (15 Oct 2007 16:01:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Oct 2007 16:01:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 15 18:01:44 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IhS4u-0003B1-3a for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Oct 2007 17:42:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IhS4n-0000oC-6F for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Oct 2007 11:41:53 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: individual.net t+B3ea0/CKuoCE22In/fSAGdoTcfLrvkWCGk6ecZ3PAZlApcBU Cancel-Lock: sha1:rPvgoDesHEykkAPoZVdbhlhVQvA= sha1:Z8ai1jXxNDwUfmQuKkkx91KT0QA= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt) Original-Xref: shelby.stanford.edu gnu.emacs.help:152943 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48447 Archived-At: moonrie writes: > intuitively, i do it this way: > > (search-forward "") > (backward-delete-char (length "")) > > :P, dunno a better way? You could make that into a command and bind it to a key and you could even add it to a hook to be run when a file opens. To make it into a command: (defun jump-startpos () (interactive) (let ((tag "")) (search-forward tag) (backward-delete-char (length tag)))) (BTW, I did not bother to test the code above, or your original code.) Bind the command to a key: (global-set-key (kbd "[f5]") 'jump-startpos) Place that into your .emacs and restart. /Mathias