all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#58626: Proposed changes to implement opening URLs on macOS
@ 2022-10-18 22:53 Perry Smith via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-12 20:57 ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Perry Smith via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-18 22:53 UTC (permalink / raw)
  To: 58626

[-- Attachment #1: Type: text/plain, Size: 1912 bytes --]

NOTE: I am subscribed to this list but I do not receive emails from
the list.  Please CC me on replies and updates.  I will also check in
the archive every few days.

My email to the developers list explains better why I did this.[1] The
short version is an exception thrown by my Ruby on Rails app displays
a stack trace with file names and line numbers.  In the past, it was
possible to click on the line and it would pop into Emacs.  This was
after adding in Mitsuharu Yamamoto mods and other effort.  I wanted to
recreate that facility but in such a way that it might be accepted
into the main Emacs development.

It appears macOS uses the scheme in URLs a lot so these changes seem
to fit in with their general designs.

Attached is my patch file based upon the emacs-28.2 tar ball.  With
these changes, I can do:

    open emacs:///some/path/to/file.txt#25,40

and the file opens in Emacs with lines 25-40 highlighted.  Clicking a
link in a browser page with the same href as above causes the same
action.  The fragment can be omitted entirely or can be just a single
line.  The comma can also be a dash or a colon.

(I’m also going to submit a feature request to RoR to leverage this
feature.)

I don’t claim to be a lisp programmer so feel free to clean up what
I’ve done.

Note that the documentation says:

    If your delegate implements this method, AppKit does not call the
    application:openFile: or application:openFiles: methods.

I left the code for openFile and openFiles under an **assumption**
that on macOS before 10.13, openURLs will not be called and the system
will fall back to the openFile and openFiles entry points but I'm not
a macOS programmer either.

Thank you to Daniel Martin.  His reply to my email helped a lot.

Thank you for your time,
Perry
[1] https://lists.gnu.org/archive/html/emacs-devel/2022-10/msg01271.htmlf



[-- Attachment #2: open-url.diff.gz --]
[-- Type: application/x-gzip, Size: 3188 bytes --]

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

end of thread, other threads:[~2022-11-12 23:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-18 22:53 bug#58626: Proposed changes to implement opening URLs on macOS Perry Smith via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-12 20:57 ` Stefan Kangas
2022-11-12 23:36   ` Perry Smith via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.