emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-open-link-from-string in a program
@ 2013-08-03  8:46 Eric Abrahamsen
  2013-08-03  9:18 ` Thorsten Jolitz
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Eric Abrahamsen @ 2013-08-03  8:46 UTC (permalink / raw)
  To: emacs-orgmode

I'm trying to write a small function that programmatically follows a
link to a gnus message, then calls
`gnus-summary-wide-reply-with-original' to start a reply to that
message. It seemed like `org-open-link-from-string' (after extracting
the address part from the link) would be the right choice, but I'm
seeing odd behavior.

When gnus sets up the reply buffer it also adds several hooks and
actions for restoring windows and marking messages as responded-to, etc,
and these hooks and actions depend on the value of (current-buffer) when
the reply was initiated. That's supposed to be the gnus summary buffer.

When I call all this from a function, however, (current-buffer)
continues to return the org buffer I started in, even after the link was
opened, which confuses gnus, and me. What I mean is this:

(let ((addr the-address-part-of-the-link))
   (org-open-link-from-string addr)
   (message "%s" (current-buffer)) ; returns the org buffer I started in
   (call-interactively
     'gnus-summary-wide-reply-with-original))

There must be something I'm misunderstanding about how buffers work when
you're doing something non-interactive. If I manually eval the
org-open-link-from-string statement, I end up in the summary buffer,
obviously, and all works fine.

What am I not getting?

Thanks!
Eric
  

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-08-08  5:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-03  8:46 org-open-link-from-string in a program Eric Abrahamsen
2013-08-03  9:18 ` Thorsten Jolitz
2013-08-03 10:26   ` Eric Abrahamsen
2013-08-03 10:56     ` Thorsten Jolitz
2013-08-03 11:04       ` Eric Abrahamsen
2013-08-03 11:18         ` Thorsten Jolitz
2013-08-04  4:21 ` Eric Abrahamsen
2013-08-04  8:22 ` Eric Abrahamsen
2013-08-08  5:58 ` [CODE] " Eric Abrahamsen

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).