emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: org-open-link-from-string in a program
Date: Sat, 03 Aug 2013 12:56:50 +0200	[thread overview]
Message-ID: <87iozn11ql.fsf@gmail.com> (raw)
In-Reply-To: 87mwoz3w9s.fsf@ericabrahamsen.net

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>
>>> 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.

[...]

>> #+begin_src emacs-lisp
>> (defun org-open-link-from-string (s &optional arg reference-buffer)
>>   "Open a link in the string S, as if it was in Org-mode."
>>       [...snip...]
>> 	(org-open-at-point arg reference-buffer)))))
>> #+end_src
>>
>> ,----------------------------------------------------------------------
>> | org-open-at-point is an interactive Lisp function in `org.el'.
>> |
>> | (org-open-at-point &optional ARG REFERENCE-BUFFER)
>> |
>> | Open link at or after point.
>> | If there is no link at point, this function will search forward up to
>> | the end of the current line.
>> | Normally, files will be opened by an appropriate application.  If the
>> | optional prefix argument ARG is non-nil, Emacs will visit the file.
>> | With a double prefix argument, try to open outside of Emacs, in the
>> | application the system uses for this file type.
>> `----------------------------------------------------------------------
>>
>> Maybe because you call
>>
>> ,---------------------------------
>> | (org-open-link-from-string addr)
>> `---------------------------------
>>
>> without ARG, Emacs is not visiting the file and thus its buffer does not
>> become current?
>
> Huh, interesting -- I had looked at that function, and assumed that the
> what the arg did was to force a file that might otherwise be opened by
> an external process to be opened in emacs. I still think that's what it
> means (and adding a '(4) doesn't solve the problem), but there's other
> stuff in there that might lead to a solution.

Yes, you are right about the meaning of ARG, I should have looked twice. 

>> Anyway, when you're done - please share, this is quite interesting.
>
> I will! It's pretty much done, except for this one little bug.

I can imagine that this is very useful for managing phonecalls to be
made in the future...

-- 
cheers,
Thorsten

  reply	other threads:[~2013-08-03 10:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=87iozn11ql.fsf@gmail.com \
    --to=tjolitz@gmail.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).