noctuid / link-hint.el

Pentadactyl-like Link Hinting in Emacs with Avy
GNU General Public License v3.0
160 stars 22 forks source link

Url with: right single quotation mark #196

Closed duianto closed 3 years ago

duianto commented 3 years ago

With the https://github.com/org-roam package installed.

A warning message appears on startup: https://github.com/org-roam/org-roam/blob/028c95a011395d01ff9b5217dc365f23187bc26c/org-roam-migrate.el#L41

WARNING: You're now on Org-roam v2!

In Emacs the message shows the url as: https://github.com/org-roam/org-roam/wiki/Hitchhiker’s-Rough-Guide-to-Org-roam-V2

Opening the url with: link-hint-open-link-at-point

Opens the page: https://github.com/org-roam/org-roam/wiki/Hitchhiker

That says: Create new page

Issue

The url stopped before the quote.

Cause

In Emacs, when the cursor is on the quote: calling: M-x describe-char shows that the characters name is:

RIGHT SINGLE QUOTATION MARK

A "normal" single quote: ' has the name:

APOSTROPHE

The url in the org-roam repository, has the "normal" quote: https://github.com/org-roam/org-roam/blob/028c95a011395d01ff9b5217dc365f23187bc26c/org-roam-migrate.el#L49

https://github.com/org-roam/org-roam/wiki/Hitchhiker's-Rough-Guide-to-Org-roam-V2 and it opens the correct wiki page.

Emacs might be converting the APOSTROPHE to a RIGHT SINGLE QUOTATION MARK.

Copying the url from Emacs with the RIGHT SINGLE QUOTATION MARK, and pasting it in a browser, doesn't lead to the correct page either: https://github.com/org-roam/org-roam/wiki/Hitchhiker%E2%80%99s-Rough-Guide-to-Org-roam-V2

It also opens a page that says: Create new page

Only tested in Spacemacs.

System Info
#### System Info :computer:
- OS: windows-nt
- Emacs: 27.2
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. 431dfd5ad)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(auto-completion autohotkey ivy compleseus helm emacs-lisp git html javascript multiple-cursors
                 (org :variables org-enable-roam-support t)
                 python spell-checking syntax-checking version-control treemacs)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2 HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP

noctuid commented 3 years ago

Thanks, try now.

duianto commented 3 years ago

No change.

Url with RIGHT SINGLE QUOTATION MARK

https://github.com/org-roam/org-roam/wiki/Hitchhiker’s-Rough-Guide-to-Org-roam-V2

(thing-at-point-url-at-point t)
(thing-at-point 'url)
(url-get-url-at-point)

all three commands return: "https://github.com/org-roam/org-roam/wiki/Hitchhiker"

Url with APOSTROPHE

https://github.com/org-roam/org-roam/wiki/Hitchhiker's-Rough-Guide-to-Org-roam-V2

(thing-at-point-url-at-point t)
(thing-at-point 'url)

both return: "https://github.com/org-roam/org-roam/wiki/Hitchhiker's-Rough-Guide-to-Org-roam-V2"

(url-get-url-at-point)

returns: "https://github.com/org-roam/org-roam/wiki/Hitchhiker"

noctuid commented 3 years ago

Sorry, reread the original comment more carefully. You're right. This is partially outside my control though. org-roam needs to format the url as a string so that this conversion doesn't happen. I will fix it so that it will then work in link-hint.

noctuid commented 3 years ago

Okay, link-hint should now correctly open that url in the warnings buffer (once it is fixed to use an apostrophe; see org-roam issue above).

duianto commented 3 years ago

The url has been fixed upstream. (fix): fix url in v2 warning by jethrokuan · Pull Request https://github.com/org-roam/org-roam/pull/1695

link-hint-open-link-at-point now opens the correct page.

Thanks.