From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: florian@fsavigny.de (Florian v. Savigny) Newsgroups: gmane.emacs.help Subject: emacsclient: Different --eval for emacs as alternate editor? Date: Sat, 23 Feb 2013 09:09:13 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1361628572 23329 80.91.229.3 (23 Feb 2013 14:09:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Feb 2013 14:09:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 23 15:09:55 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U9FnT-0000Kk-Oq for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Feb 2013 15:09:51 +0100 Original-Received: from localhost ([::1]:49719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9Fn9-0005wD-2O for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Feb 2013 09:09:31 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9Fms-0005Ng-8O for help-gnu-emacs@gnu.org; Sat, 23 Feb 2013 09:09:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9Fmm-0001Rc-7v for help-gnu-emacs@gnu.org; Sat, 23 Feb 2013 09:09:13 -0500 Original-Received: from srv4.ns-domain-hosting.de ([178.63.89.203]:46114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9Fmm-0001RF-0V for help-gnu-emacs@gnu.org; Sat, 23 Feb 2013 09:09:08 -0500 X-No-Relay: not in my network Original-Received: from bertrandrussell.Speedport_W_723V_1_27_000 (p4FECC50C.dip.t-dialin.net [79.236.197.12]) by srv4.ns-domain-hosting.de (Postfix) with ESMTPA id C2BBA15DC004 for ; Sat, 23 Feb 2013 15:09:06 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 178.63.89.203 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89241 Archived-At: Hi there, this is either a question about emacs(client) commandline invocation, or one about bookmark.el: I have been trying to write menu entries for Fvwm which would call either emacsclient or emacs and would take me directy to an Emacs bookmark. I have tried the following command line: emacsclient -c -a emacs --eval '(bookmark-jump "name")' This only works, however, when emacsclient does not have to call emacs instead, i.e. only if Emacs is already running and bookmark-alist is already set. Basically, bookmark-jump is autoloaded, and when you call it when the bookmark list has not been loaded yet (e.g. directly after Emacs startup), it seems to take care of that when you call it *interactively*. It does not do that, however, when called as above. Thus, I conclude the trick is somehow buried in the functions used in the (interactive ...) form of bookmark-jump, i.e., bookmark-jump does not seem to have been designed with non-interactive use in mind. I would think it clumsy, to say the least, to pass the following form to --eval instead: (progn (bookmark-load '~/.emacs.bmk' t) ; t: OVERWRITE (bookmark-jump "name")) I would have to overwrite because when emacs is already running, any newly loaded bookmarks are normally added to the list, which would basically duplicate all the bookmarks (or worse, when this happens several times in one session) if I did not use that argument. The overwriting, on the other hand, would destroy any new bookmarks. So both would be crap. The solutions I can think of are to either 1) pass different lisp code depending on whether emacs(server) is already running or not. (The progn form above.) Is there a standard way of doing this? Or, 2) maybe there is some way to tell bookmark-jump to load the default bookmark file even when it is called non-interactively? Can anybody help? Thanks so much! Florian