From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: luca.spinacci@selex-comms.com Newsgroups: gmane.emacs.help Subject: Switch to buffer and line... Date: Thu, 20 Oct 2005 14:59:45 +0200 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1129816690 20351 80.91.229.2 (20 Oct 2005 13:58:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 Oct 2005 13:58:10 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 20 15:57:56 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ESarq-0003NI-US for geh-help-gnu-emacs@m.gmane.org; Thu, 20 Oct 2005 15:54:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ESarq-0004TO-Bn for geh-help-gnu-emacs@m.gmane.org; Thu, 20 Oct 2005 09:54:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ESa1Z-0000XM-7Q for help-gnu-emacs@gnu.org; Thu, 20 Oct 2005 09:00:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ESa1U-0000Wv-E7 for help-gnu-emacs@gnu.org; Thu, 20 Oct 2005 08:59:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ESa1U-0000Wq-5b for help-gnu-emacs@gnu.org; Thu, 20 Oct 2005 08:59:56 -0400 Original-Received: from [81.120.201.7] (helo=relay1.selex-comms.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ESa1U-0002Yp-9m for help-gnu-emacs@gnu.org; Thu, 20 Oct 2005 08:59:56 -0400 Original-Received: from gefss001 ([10.1.202.2]) by relay1.selex-comms.com (8.12.11/8.12.11) with ESMTP id j9KCxnPl027727 for ; Thu, 20 Oct 2005 14:59:50 +0200 (CEST) Sensitivity: Original-To: help-gnu-emacs@gnu.org X-MIMETrack: Serialize by Router on mgeg01/S/EXT/MM1(Release 6.5.3|September 14, 2004) at 10/20/2005 14:59:49 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:30401 Archived-At: I have a buffer with number line and name of the new buffer to switch to: pointing the curson on the number line my function search backward for the name of the buffer and switch to that, but once it gets there the goto-line function doesn't take me to the requested line... (defun retrieve-buffer-and-line-at-point() (interactive) ( save-excursion(if(number-at-point) ; check if the cursor is pointing a number of line (setq target (number-at-point))) (call-interactively 'switch-at-point) ; switch to buffer: it works correctly! (if(current-buffer) (goto-line target)))) ; does nothing??? (defun switch-at-point() (interactive) ( save-excursion( if(search-backward "in buffer: ") ( save-excursion(end-of-line) (if(thing-at-point 'sexp) (switch-to-buffer(thing-at-point 'filename))))))) Thanks in advance, Luca.