* [Edbrowse-dev] bookmarks
@ 2014-11-23 7:05 Tyler Spivey
0 siblings, 0 replies; 2+ messages in thread
From: Tyler Spivey @ 2014-11-23 7:05 UTC (permalink / raw)
To: edbrowse-dev
I propose the following change.
If using the A command on a page (not on a link),
and the page has a title, use that as the auto-suggested bookmark name.
Old: ref=s9_dnav_bw_ir12_s
new: Amazon.com: Science Fiction - Science Fiction & Fantasy: Kindle Store
I don't have git's email sender setup, so I'll just paste a patch here.
I did notice one bug I do'nt know how to fix, though it might not matter much. If a link contains
< > or &, they're not turned into < > and &. This also applies to the title.
I'm not very familiar with the code, but this seems to work. I'll see how it works when I bookmark more.
>From 08d9dbd675aa77146c8f1f072a64929de8639a57 Mon Sep 17 00:00:00 2001
From: Tyler Spivey <tspivey@pcdesk.net>
Date: Sat, 22 Nov 2014 22:57:43 -0800
Subject: [PATCH] Make A suggest title if it can
Make the A command suggest the page title if it has one,
if we're not on a link.
---
src/buffers.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/buffers.c b/src/buffers.c
index 540cb99..4799838 100644
--- a/src/buffers.c
+++ b/src/buffers.c
@@ -3479,7 +3479,9 @@ static char *showLinks(void)
stringAndString(&a, &a_l, "<a href=");
stringAndString(&a, &a_l, h);
stringAndString(&a, &a_l, ">\n");
- s = (char *)getDataURL(h);
+ s = cw->ft;
+ if (!s || !*s)
+ s = (char *)getDataURL(h);
if (!s || !*s)
s = h;
t = s + strcspn(s, "\1?#");
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Edbrowse-dev] bookmarks
@ 2014-11-23 11:43 Karl Dahlke
0 siblings, 0 replies; 2+ messages in thread
From: Karl Dahlke @ 2014-11-23 11:43 UTC (permalink / raw)
To: Edbrowse-dev
Well I never argue with someone who proposes a 3 line change
that will make edbrowse behave the way every other browser behaves -
in this case folding the title into the bookmark.
I'll push this through later today.
And don't worry about things like the less than sign,
they are already encoded as < in the title,
which is just how they should be in the text of a hyperlink,
so I can just copy it in, as you propose.
Karl Dahlke
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-23 11:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-23 7:05 [Edbrowse-dev] bookmarks Tyler Spivey
2014-11-23 11:43 Karl Dahlke
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 NNTP newsgroup(s).