* bug#50500: Add ways to copy id bookmark link in eww
@ 2021-09-10 6:43 Yuchen Pei
2021-09-10 11:15 ` Lars Ingebrigtsen
0 siblings, 1 reply; 8+ messages in thread
From: Yuchen Pei @ 2021-09-10 6:43 UTC (permalink / raw)
To: 50500
[-- Attachment #1: Type: text/plain, Size: 774 bytes --]
Hello,
I'd like to add a functionality to copy the bookmark link to the
kill ring when the point is on a element with an id attribute.
For example, say I am reading
<http://www.gnu.org/licenses/gpl-3.0.html>, and Section 13 looks
interesting which I want to save for reference. By calling the
said function while the point is at Section 13, the link
<http://www.gnu.org/licenses/gpl-3.0.html#section13> is added to
the kill ring.
I imagine it makes sense to bind it to w when the point is not on
a link.
I took a look at eww.el and shr.el and I'm not sure where to start
to add this functionality. Does anyone have any pointers?
--
Best,
Yuchen
PGP Key: 47F9 D050 1E11 8879 9040 4941 2126 7E93 EF86 DFD0
<https://ypei.me/assets/ypei-pubkey.txt>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 243 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#50500: Add ways to copy id bookmark link in eww
2021-09-10 6:43 bug#50500: Add ways to copy id bookmark link in eww Yuchen Pei
@ 2021-09-10 11:15 ` Lars Ingebrigtsen
2021-09-10 13:03 ` Yuchen Pei
0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-10 11:15 UTC (permalink / raw)
To: Yuchen Pei; +Cc: 50500
Yuchen Pei <hi@ypei.me> writes:
> I'd like to add a functionality to copy the bookmark link to the kill
> ring when the point is on a element with an id attribute.
>
> For example, say I am reading
> <http://www.gnu.org/licenses/gpl-3.0.html>, and Section 13 looks
> interesting which I want to save for reference. By calling the said
> function while the point is at Section 13, the link
> <http://www.gnu.org/licenses/gpl-3.0.html#section13> is added to the
> kill ring.
Well, people put ids on all kinds of elements, but they're not generally
meant to be used for navigation. (I mean, sometimes they are, but
statistically speaking, they're not.)
So I'm not sure that `w' in general should be doing this in eww.
Anybody else got an opinion?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#50500: Add ways to copy id bookmark link in eww
2021-09-10 11:15 ` Lars Ingebrigtsen
@ 2021-09-10 13:03 ` Yuchen Pei
2021-09-10 16:08 ` Juri Linkov
2021-09-11 12:34 ` Lars Ingebrigtsen
0 siblings, 2 replies; 8+ messages in thread
From: Yuchen Pei @ 2021-09-10 13:03 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 50500
[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Yuchen Pei <hi@ypei.me> writes:
>
>> I'd like to add a functionality to copy the bookmark link to
>> the kill
>> ring when the point is on a element with an id attribute.
>>
>> For example, say I am reading
>> <http://www.gnu.org/licenses/gpl-3.0.html>, and Section 13
>> looks
>> interesting which I want to save for reference. By calling the
>> said
>> function while the point is at Section 13, the link
>> <http://www.gnu.org/licenses/gpl-3.0.html#section13> is added
>> to the
>> kill ring.
>
> Well, people put ids on all kinds of elements, but they're not
> generally
> meant to be used for navigation. (I mean, sometimes they are,
> but
> statistically speaking, they're not.)
>
> So I'm not sure that `w' in general should be doing this in eww.
> Anybody else got an opinion?
Makes sense. How about adding it as a customization variable, so
that one can customize whether `w` also includes the id bookmark
part and by default it does not. It is often useful to save more
precise positions in web page documents.
--
Best,
Yuchen
PGP Key: 47F9 D050 1E11 8879 9040 4941 2126 7E93 EF86 DFD0
<https://ypei.me/assets/ypei-pubkey.txt>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 243 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#50500: Add ways to copy id bookmark link in eww
2021-09-10 13:03 ` Yuchen Pei
@ 2021-09-10 16:08 ` Juri Linkov
2021-09-11 12:28 ` Lars Ingebrigtsen
2021-09-11 12:34 ` Lars Ingebrigtsen
1 sibling, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2021-09-10 16:08 UTC (permalink / raw)
To: Yuchen Pei; +Cc: Lars Ingebrigtsen, 50500
>> Well, people put ids on all kinds of elements, but they're not generally
>> meant to be used for navigation. (I mean, sometimes they are, but
>> statistically speaking, they're not.)
>>
>> So I'm not sure that `w' in general should be doing this in eww.
>> Anybody else got an opinion?
>
> Makes sense. How about adding it as a customization variable, so that one
> can customize whether `w` also includes the id bookmark part and by default
> it does not. It is often useful to save more precise positions in web
> page documents.
The problem is that "id" from such HTML:
<h5 id="section13">13. Use with the GNU Affero General Public License.</h5>
is not rendered on UI, so the user doesn't know that here is some "id"
available for bookmarking. But, for example, github.com for the sections
of the README.org file with ids displays visual indication that looks like
a chain icon on the left. If eww will support some visual indication about
ids used on the page like github does, then it will make sense also to
include the displayed id to the copied link.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#50500: Add ways to copy id bookmark link in eww
2021-09-10 16:08 ` Juri Linkov
@ 2021-09-11 12:28 ` Lars Ingebrigtsen
2021-09-11 19:06 ` Juri Linkov
0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-11 12:28 UTC (permalink / raw)
To: Juri Linkov; +Cc: Yuchen Pei, 50500
Juri Linkov <juri@linkov.net> writes:
> The problem is that "id" from such HTML:
>
> <h5 id="section13">13. Use with the GNU Affero General Public License.</h5>
>
> is not rendered on UI, so the user doesn't know that here is some "id"
> available for bookmarking. But, for example, github.com for the sections
> of the README.org file with ids displays visual indication that looks like
> a chain icon on the left. If eww will support some visual indication about
> ids used on the page like github does, then it will make sense also to
> include the displayed id to the copied link.
I'm not sure I understand -- do you want eww to have a visual indicator
on all HTML elements that have an id? That would be ... weird and ugly,
I think? Github doesn't display anything in particular on elements with
ids per se -- they do display a link icon on sections, and the sections
have ids, but that's because they generated the HTML that way.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#50500: Add ways to copy id bookmark link in eww
2021-09-10 13:03 ` Yuchen Pei
2021-09-10 16:08 ` Juri Linkov
@ 2021-09-11 12:34 ` Lars Ingebrigtsen
1 sibling, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-11 12:34 UTC (permalink / raw)
To: Yuchen Pei; +Cc: 50500
Yuchen Pei <hi@ypei.me> writes:
> Makes sense. How about adding it as a customization variable, so that
> one can customize whether `w` also includes the id bookmark part and
> by default it does not. It is often useful to save more precise
> positions in web page documents.
Hm... I think it would vary whether a user would want to do this or
not. Hm... Perhaps a `C-u' to `eww-copy-page-url' could make the
command do this?
I don't think any other web browsers offer to make links to random id'd
elements in the DOM, do they? id's aren't displayed visually -- they're
an internal DOM thing, so the user has no idea whether an element has an
id, or whether that id has a semantic meaning or not (they're usually
just put on elements so that they can be manipulated from Javascript).
So I'm sceptical that this would be useful in practice.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#50500: Add ways to copy id bookmark link in eww
2021-09-11 12:28 ` Lars Ingebrigtsen
@ 2021-09-11 19:06 ` Juri Linkov
2022-08-25 14:49 ` Lars Ingebrigtsen
0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2021-09-11 19:06 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Yuchen Pei, 50500
>> The problem is that "id" from such HTML:
>>
>> <h5 id="section13">13. Use with the GNU Affero General Public License.</h5>
>>
>> is not rendered on UI, so the user doesn't know that here is some "id"
>> available for bookmarking. But, for example, github.com for the sections
>> of the README.org file with ids displays visual indication that looks like
>> a chain icon on the left. If eww will support some visual indication about
>> ids used on the page like github does, then it will make sense also to
>> include the displayed id to the copied link.
>
> I'm not sure I understand -- do you want eww to have a visual indicator
> on all HTML elements that have an id? That would be ... weird and ugly,
> I think? Github doesn't display anything in particular on elements with
> ids per se -- they do display a link icon on sections, and the sections
> have ids, but that's because they generated the HTML that way.
That's why I said "*IF* eww will support some visual indication" :-)
But I don't think such visual distraction would be appreciated by users.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#50500: Add ways to copy id bookmark link in eww
2021-09-11 19:06 ` Juri Linkov
@ 2022-08-25 14:49 ` Lars Ingebrigtsen
0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-25 14:49 UTC (permalink / raw)
To: Juri Linkov; +Cc: Yuchen Pei, 50500
Juri Linkov <juri@linkov.net> writes:
> That's why I said "*IF* eww will support some visual indication" :-)
> But I don't think such visual distraction would be appreciated by users.
Me neither. And without such a display, then users have no idea where
the IDs are, which makes copying the #id when hitting `w' odd.
(Especially since we for reasons of efficiency only put the id text
properties on the first character of the element that has an id, it'd be
pretty random what you get.)
So all in all, I don't think this is something we want to add, and I'm
therefore closing this bug report.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-08-25 14:49 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-10 6:43 bug#50500: Add ways to copy id bookmark link in eww Yuchen Pei
2021-09-10 11:15 ` Lars Ingebrigtsen
2021-09-10 13:03 ` Yuchen Pei
2021-09-10 16:08 ` Juri Linkov
2021-09-11 12:28 ` Lars Ingebrigtsen
2021-09-11 19:06 ` Juri Linkov
2022-08-25 14:49 ` Lars Ingebrigtsen
2021-09-11 12:34 ` 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).