On 23/06/2021 13:34, Allen Li wrote:

The idea is to add a new protocol that looks like "org-protocol://goto-heading?id=UUID-HERE" that jumps to the specified Org heading in Emacs.  The implementation is really simple:

It may be convenient in some cases. I prefer custom_id properties however since it provides some hint what is the link target. I am unsure, but maybe if you post complete recipe for customization and a bit more verbose description of use cases, more people will try it and will suggest possible improvements. In my opinion, currently conscious choices require more effort that actual code.

;;;###autoload
(defun goto-heading (arg)
   "Org protocol handler for navigating to Org headings.
ARG is a property list."
   (org-id-goto (plist-get arg :id))

- It seems `org-id-goto' does not call `org-mark-ring-push' (unlike `org-id-open' that is non-interactive). As a result it is impossible tu jump back using C-&.
- Should that heading be opened in current window or in other one?
- Likely other variants of specifying targets will be requested soon. Is it necessary to support file+custom_id, file+heading text, file+line number? If so, files should be filtered somehow to prevent security issues when attempt of opening of specific file (executable, image, etc.) can cause unexpected actions.
- Maybe even subprotocol name is not the best one.


Reply via email to