From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: how to invoke 'server-visit-files' function from emacsclient -e ? Date: Wed, 12 Oct 2016 22:40:56 +0300 Message-ID: <83a8e99wzb.fsf@gnu.org> References: NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1476301340 13244 195.159.176.226 (12 Oct 2016 19:42:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Oct 2016 19:42:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 12 21:42:17 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buPPX-0000DP-AV for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Oct 2016 21:41:55 +0200 Original-Received: from localhost ([::1]:35412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buPPW-0007ar-2u for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Oct 2016 15:41:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buPP5-0007Yl-Ku for help-gnu-emacs@gnu.org; Wed, 12 Oct 2016 15:41:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buPP2-000349-Db for help-gnu-emacs@gnu.org; Wed, 12 Oct 2016 15:41:27 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buPP2-00033B-AC for help-gnu-emacs@gnu.org; Wed, 12 Oct 2016 15:41:24 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3491 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1buPOy-0004dt-Fv for help-gnu-emacs@gnu.org; Wed, 12 Oct 2016 15:41:22 -0400 In-reply-to: (message from Jason Vas Dias on Wed, 12 Oct 2016 15:34:17 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111513 Archived-At: > From: Jason Vas Dias > Date: Wed, 12 Oct 2016 15:34:17 +0100 > > I am trying to write a shell script that will accept a list of ( file > name, line number ) pairs > and get the user's running emacs process to visit each file, scroll to > the line number, and > wait for the user to press 'C-x+#' (invoke the 'server-edit' function) > before allowing > the next file to be visited . > > Since emacsclient does most of this (except scrolling to the line number, > a very important feature for this application) , [...] ??? Invoking emacsclient with the +LINE argument causes Emacs to scroll to the specified line. So I'm not sure why you need to do anything beyond invoking emacsclient. There must be some details you didn't tell. > Can anyone suggest a way of acheiving the desired result: > - loading one of many files into a running emacs , causing emacs to > scroll to a given line number > in that file, and then waiting for user to press 'C-x #' before > allowing the next file to be loaded ? Just emacsclient +LINE1 FILE1 +LINE2 FILE2 ... should do what you want. It does for me.