all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: <ronaldo.mercado@diamond.ac.uk>
To: <florian@fsavigny.de>, <help-gnu-emacs@gnu.org>
Subject: RE: emacsclient: Different --eval for emacs as alternate editor?
Date: Thu, 28 Feb 2013 08:36:40 +0000	[thread overview]
Message-ID: <3D65E04168FA09429B823CA3FE25C4473BCF664B@EXCHMBX01.fed.cclrc.ac.uk> (raw)
In-Reply-To: <E1U9Fmm-0001RF-0V@eggs.gnu.org>

Sorry no direct answer.

I had a somewhat similar problem when trying to call "org-cycle" from a macro. I wanted the equivalent behaviour of C-u C-u C-u M-x org-cycle

It did not work when called non interactively. I had a fruitless attempt at using call-interactively and ended up digging the source of org-mode to find out that under the hood it did an "show-all" which is how I solved my problem.

I'd be glad to know if call-interactively is meant to solve these kind of problems.

Regards
		
> -----Original Message-----
> From: help-gnu-emacs-bounces+ronaldo.mercado=diamond.ac.uk@gnu.org
> [mailto:help-gnu-emacs-bounces+ronaldo.mercado=diamond.ac.uk@gnu.org]
> On Behalf Of Florian v. Savigny
> Sent: 23 February 2013 14:09
> To: help-gnu-emacs@gnu.org
> Subject: emacsclient: Different --eval for emacs as alternate editor?
> 
> 
> 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
> 
> 
> 


--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom







  reply	other threads:[~2013-02-28  8:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-23 14:09 emacsclient: Different --eval for emacs as alternate editor? Florian v. Savigny
2013-02-28  8:36 ` ronaldo.mercado [this message]
2013-02-28 18:15   ` Florian v. Savigny
2013-02-28 18:26   ` emacsclient, -a emacs, and --eval (rephrased) Florian v. Savigny
2013-02-28 18:33     ` "Jérôme M. Berger"
2013-03-03 16:53     ` PJ Weisberg
2013-03-04 22:43       ` Ludwig, Mark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D65E04168FA09429B823CA3FE25C4473BCF664B@EXCHMBX01.fed.cclrc.ac.uk \
    --to=ronaldo.mercado@diamond.ac.uk \
    --cc=florian@fsavigny.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.