From: John Wiegley <johnw@newartisans.com>
To: emacs-orgmode@gnu.org
Subject: Re: running remember with emacsclient - how to get a new frame
Date: Thu, 06 Sep 2007 18:31:44 -0400 [thread overview]
Message-ID: <m27in3whm7.fsf@newartisans.com> (raw)
In-Reply-To: <b2e202b30709061430l1ff13f19x4f547f46d5f2e84c@mail.gmail.com> (Scott Jaderholm's message of "Thu\, 6 Sep 2007 15\:30\:46 -0600")
"Scott Jaderholm" <jaderholm@gmail.com> writes:
> On 9/6/07, Jason F. McBrayer <jmcbray@carcosa.net> wrote:
>
>> I define this function in my .emacs:
>>
>> (defun my-remember nil
>> (progn (select-frame
>> (make-frame '((name . "*Remember*") )))
>> (raise-frame)
>> (remember)))
>>
>
> Jason,
>
> This is great. How would you make it so that the frame displays with
> remember as the only window ?
I've made changes to remember.el to support this kind of usage. Just replace
the `remember' function in your remember.el file with the following.
John
(defcustom remember-in-new-frame nil
"Non-nil means use a separate frame for capturing remember data."
:type 'boolean
:group 'remember)
;;;###autoload
(defun remember (&optional initial)
"Remember an arbitrary piece of data.
With a prefix, uses the region as INITIAL."
(interactive
(list (when current-prefix-arg
(buffer-substring (point) (mark)))))
(funcall (if remember-in-new-frame
#'frame-configuration-to-register
#'window-configuration-to-register) remember-register)
(let* ((annotation
(if remember-run-all-annotation-functions-flag
(mapconcat 'identity
(delq nil (mapcar 'funcall remember-annotation-functions))
"\n")
(run-hook-with-args-until-success
'remember-annotation-functions)))
(buf (get-buffer-create remember-buffer)))
(run-hooks 'remember-before-remember-hook)
(funcall (if remember-in-new-frame
#'switch-to-buffer-other-frame
#'switch-to-buffer-other-window) buf)
(if remember-in-new-frame
(set-window-dedicated-p
(get-buffer-window (current-buffer) (selected-frame)) t))
(remember-mode)
(when (= (point-max) (point-min))
(when initial (insert initial))
(setq remember-annotation annotation)
(when remember-initial-contents (insert remember-initial-contents))
(when (and (stringp annotation)
(not (equal annotation "")))
(insert "\n\n" annotation))
(setq remember-initial-contents nil)
(goto-char (point-min)))
(message "Use C-c C-c to remember the data.")))
;;;###autoload
(defun remember-other-frame (&optional initial)
(interactive
(list (when current-prefix-arg
(buffer-substring (point) (mark)))))
(let ((remember-in-new-frame t))
(remember initial)))
next prev parent reply other threads:[~2007-09-06 22:31 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
2007-09-06 14:46 ` pete phillips
2007-09-06 21:30 ` Scott Jaderholm
2007-09-06 22:31 ` John Wiegley [this message]
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=m27in3whm7.fsf@newartisans.com \
--to=johnw@newartisans.com \
--cc=emacs-orgmode@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 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).