emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Using search options in HTTP-style links
@ 2024-04-15  7:04 Joseph Turner
  2024-04-15 11:48 ` Ihor Radchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Joseph Turner @ 2024-04-15  7:04 UTC (permalink / raw)
  To: Org Mode Mailing List; +Cc: Adam Porter, Jonas Bernoulli, Protesilaos Stavrou

Hello!

[[info:org#Search Options]] says that search options are intended for
file: type links only.  However, since Org documents can also be loaded
over network protocols like HTTP and hyper://, I'd like to deliberate
if/how search options might be encoded inside HTTP-style link fragments.

HTTP-style links are URL-encoded with "#"-prefixed link fragments:

(let ((domain "https://ushin.org")
      (filename "needs-list.org")
      (search-option "::#care"))
  (format "%s/%s#%s" domain (url-hexify-string filename)
          (url-hexify-string search-option)))

=>  "https://ushin.org/needs-list.org#%3A%3A%23care"

Currently, loading the above URL with EWW...

(eww "https://ushin.org/needs-list.org#%3A%3A%23care")

...loads the file in eww-mode with point at the top of the file.

I think it would be more useful to instead activate org-mode (or a mode
which derives from it - "eww-org-mode"?), decode the link fragment, and
then jump to the location specified by the search option.

Web browsers like Firefox don't handle Org search options in link
fragments, but then again, they don't handle Org documents at all.  On my
machine, loading https://ushin.org/needs-list.org#%3A%3A%23care in
Firefox downloads the file as if the fragment weren't there.

What other issues might arise when encoding search options this way?

Any other comments/questions welcome :)

Thank you!

Joseph


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

end of thread, other threads:[~2024-06-09  2:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-15  7:04 Using search options in HTTP-style links Joseph Turner
2024-04-15 11:48 ` Ihor Radchenko
2024-04-15 23:55   ` Joseph Turner
2024-04-22 20:02     ` Ihor Radchenko
2024-05-15  7:31       ` Joseph Turner
2024-05-18 11:29         ` Ihor Radchenko
2024-05-18 17:11           ` Joseph Turner
2024-05-18 17:28             ` Ihor Radchenko
2024-05-19  6:45               ` Joseph Turner

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