~sircmpwn/gmni-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] gmnlm: add optional custom bookmark titles

Details
Message ID
<20220112180435.18568-1-temp.xanomes@volny.cz>
DKIM signature
pass
Download raw message
Patch: +5 -9
It is often useful to title a bookmark differently from how the page's
author titled it.
---
 src/gmnlm.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/gmnlm.c b/src/gmnlm.c
index 536914a..f5b7480 100644
--- a/src/gmnlm.c
+++ b/src/gmnlm.c
@@ -80,7 +80,7 @@ const char *help_msg =
	"b[N]\tJump back N entries in history, N is optional, default 1\n"
	"f[N]\tJump forward N entries in history, N is optional, default 1\n"
	"H\tView all page history\n"
	"m\tSave bookmark\n"
	"m [title]\tSave bookmark\n"
	"M\tBrowse bookmarks\n"
	"r\tReload the page\n"
	"d <path>\tDownload page to <path>\n"
@@ -154,7 +154,7 @@ trim_ws(char *in)
}

static void
save_bookmark(struct browser *browser)
save_bookmark(struct browser *browser, const char *title)
{
	char *path_fmt = get_data_pathfmt();
	static char path[PATH_MAX+1];
@@ -178,11 +178,6 @@ save_bookmark(struct browser *browser)
		return;
	}

	char *title = browser->page_title;
	if (title) {
		title = trim_ws(browser->page_title);
	}

	fprintf(f, "=> %s%s%s\n", browser->plain_url,
		title ? " " : "", title ? title : "");
	fclose(f);
@@ -617,8 +612,9 @@ do_prompts(const char *prompt, struct browser *browser)
		result = PROMPT_AGAIN;
		goto exit;
	case 'm':
		if (in[1]) break;
		save_bookmark(browser);
		if (in[1] != '\0' && !isspace(in[1])) break;
		char *title = in[1] ? &in[1] : browser->page_title;
		save_bookmark(browser, trim_ws(title));
		result = PROMPT_AGAIN;
		goto exit;
	case 'M':
-- 
2.34.1
Details
Message ID
<CH3XA8C54KJJ.2YRALO1VYQ72O@taiga>
In-Reply-To
<20220112180435.18568-1-temp.xanomes@volny.cz> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/gmni
   5f4c617..0603755  master -> master
Reply to thread Export thread (mbox)