emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: jmcbray@carcosa.net (Jason F. McBrayer)
To: pete phillips <pete@smtl.co.uk>
Cc: emacs-orgmode@gnu.org
Subject: Re: running remember with emacsclient - how to get a new frame
Date: Thu, 06 Sep 2007 09:08:20 -0400	[thread overview]
Message-ID: <m1r6lcndq3.fsf@bertrand.carcosa.net> (raw)
In-Reply-To: <13256.1189076942@lap1.smtl.co.uk> (pete phillips's message of "Thu, 06 Sep 2007 12:09:02 +0100")

pete phillips <pete@smtl.co.uk> writes:

> Hi
>
> I want to bind a keyboard key to run 
>
> 	/usr/bin/emacsclient.emacs-snapshot  -e "(remember)"

I define this function in my .emacs:

(defun my-remember nil
  (progn (select-frame
          (make-frame '((name . "*Remember*") )))
         (raise-frame)
         (remember)))

And this additional code to close the frame if remember was opened in
its own frame:

(setq remember-all-handler-functions t)
(setq remember-handler-functions
      '(org-remember-handler
      (lambda nil
        (let* ((frame-names-alist (make-frame-names-alist))
               (frame (cdr (assoc "*Remember*" frame-names-alist))))
          (if frame
              (delete-frame frame t))))))
         
And use a script called 'remember' that runs:

emacsclient -n --eval '(my-remember)'

I've got quite a bit of other code to make emacsclient maximally
desktop-environment-friendly --- emacsclient always opening in new
frames, closing frames killing the associated buffer,
server-done closing the frame, a script to either start emacs or use
emacsclient as needed, running emacs with the initial frame unmapped,
letting you delete all visible frames, and a .desktop file that wraps
the aforementioned script.  One of these days I should package it all
up, but it's kind of all over the place.

-- 
+-----------------------------------------------------------+
| Jason F. McBrayer                    jmcbray@carcosa.net  |
| If someone conquers a thousand times a thousand others in |
| battle, and someone else conquers himself, the latter one |
| is the greatest of all conquerors.  --- The Dhammapada    |

  parent reply	other threads:[~2007-09-06 13:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-06 11:09 running remember with emacsclient - how to get a new frame pete phillips
2007-09-06 12:39 ` Tassilo Horn
2007-09-06 13:08 ` Jason F. McBrayer [this message]
2007-09-06 14:46   ` pete phillips
2007-09-06 21:30   ` Scott Jaderholm
2007-09-06 22:31     ` John Wiegley
2007-09-07  9:42     ` Jason F. McBrayer

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=m1r6lcndq3.fsf@bertrand.carcosa.net \
    --to=jmcbray@carcosa.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=pete@smtl.co.uk \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).