unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56312: 28.1; URI discrepancy between `thing-at-point' and `org-open-at-point'
@ 2022-06-30  4:44 Teika Kazura
  2022-06-30 10:25 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Teika Kazura @ 2022-06-30  4:44 UTC (permalink / raw)
  To: 56312

Hello, Emacs world.

(An error reproduction code soon follows.)
When a cursor is on a url, (thing-at-point 'url) and (org-open-at-point) sometimes return different urls; more precisely, the delimiter sets of two seem to differ.

It's a corner case, and I don't think there exists a "correct" set of delimiters. But IMHO the behavior should be unified, by unifing the code. This makes Emacs' behavior more predictable / customizable, and code maintenance easier.

Since org-mode is now a part of Emacs, it possibly can rely on thing-at-point. (FYI: `browse-url-url-at-point' uses thing-at-point.)

How to reproduce it:
------------------------------------------------------------------------
#!/bin/bash

cat > /tmp/foo.txt << EOF
https://www.amazon.com/("false"-parethesis)Learning-Emacs-Third-Debra-Cameron/dp/0596006489/ref=sr_1_1?keywords=emacs+gnu&sr=8-1
EOF

cat > /tmp/foo.el <<EOF
(find-file "/tmp/foo.txt")
(set-buffer "foo.txt")
(require 'org)
(message "tap returns: *%s*" (thing-at-point 'url))
(org-open-at-point)
EOF

emacs -Q -l /tmp/foo.el

# Caution! rm -f will follow.
# rm -f /tmp/foo.txt /tmp/foo.el
-------------------------------------------------------------------------
In the above example, the url contains a special Japanese parenthesis U+ff08, not an ascii one. thing-at-point cuts before it, but (caution: your browser will be called) org-open-at-point opens the entire line.

As I said above, it's not likely that there is an absolutely "correct" delimiter set. In the above case, the Japanese parenthesis is a part of a valid URL [1]. But it also is a commonly used punctuation mark, so it's rational to treat it as a URL boundary.
(Sorry, I'm completely ignorant about the syntax table.)

[1] The above example is hypothetical, but there does exist such URLs in Japanese Amazon.

Thank you very much indeed for developing Emacs.
Best regards.

Teika

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

* bug#56312: 28.1; URI discrepancy between `thing-at-point' and `org-open-at-point'
  2022-06-30  4:44 bug#56312: 28.1; URI discrepancy between `thing-at-point' and `org-open-at-point' Teika Kazura
@ 2022-06-30 10:25 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-30 10:25 UTC (permalink / raw)
  To: Teika Kazura; +Cc: 56312

Teika Kazura <teika@gmx.com> writes:

> Since org-mode is now a part of Emacs, it possibly can rely on
> thing-at-point. (FYI: `browse-url-url-at-point' uses thing-at-point.)

I think this may be a duplicate of bug#42483.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2022-06-30 10:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30  4:44 bug#56312: 28.1; URI discrepancy between `thing-at-point' and `org-open-at-point' Teika Kazura
2022-06-30 10:25 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).