[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-open-link-from-string in a program

From: Thorsten Jolitz
Subject: Re: [O] org-open-link-from-string in a program
Date: Sat, 03 Aug 2013 12:56:50 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Eric Abrahamsen <address@hidden> writes:

> Thorsten Jolitz <address@hidden> writes:
>> Eric Abrahamsen <address@hidden> 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...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]