summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8ba6b84)
raw | patch | inline | side by side (parent: 8ba6b84)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Sat, 17 Dec 2011 16:08:36 +0000 (17:08 +0100) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Sat, 17 Dec 2011 16:46:46 +0000 (17:46 +0100) |
The lyrics screen is going to spawn a text editor to edit lyrics.
Put the infrastructure in place to make it configurable.
Put the infrastructure in place to make it configurable.
doc/config.sample | patch | blob | history | |
doc/ncmpc.1 | patch | blob | history | |
src/conf.c | patch | blob | history | |
src/defaults.h | patch | blob | history | |
src/options.c | patch | blob | history | |
src/options.h | patch | blob | history |
diff --git a/doc/config.sample b/doc/config.sample
index 75ab0f19209dccd667e30255f9da0f5f78f4b506..6ad6809feeffb6d6f9bb9780754813d1d1b0c4ab 100644 (file)
--- a/doc/config.sample
+++ b/doc/config.sample
## Automatically save the lyrics after receiving them.
#lyrics-autosave = no
+## The text editor used for editing lyrics.
+#text-editor = emacs
+
## Display song length in second column
#second-column = yes
diff --git a/doc/ncmpc.1 b/doc/ncmpc.1
index fc191f127a83a92e54e81fa2e0cab08446e27114..6f48734ba32c828d827fd80480cba1b44a08fa6f 100644 (file)
--- a/doc/ncmpc.1
+++ b/doc/ncmpc.1
.B lyrics\-show\-plugin = yes|no
Show the name of the plugin used to receive lyrics on the lyrics screen.
.TP
+.B text\-editor = EDITOR
+The text editor used for editing lyrics.
+.TP
.B second-column = yes|no
Display song length in a second column.
.SS Display
diff --git a/src/conf.c b/src/conf.c
index cce0b9408934025c097e139733f7362181e58389..9d1f8828d8d28d59dab74bbc71cf8bed4fe54801 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
#define CONF_JUMP_PREFIX_ONLY "jump-prefix-only"
#define CONF_LYRICS_AUTOSAVE "lyrics-autosave"
#define CONF_LYRICS_SHOW_PLUGIN "lyrics-show-plugin"
+#define CONF_TEXT_EDITOR "text-editor"
#define CONF_SECOND_COLUMN "second-column"
static bool
options.lyrics_show_plugin = str2bool(value);
#else
{}
+#endif
+ else if (!strcasecmp(name, CONF_TEXT_EDITOR))
+#ifdef ENABLE_LYRICS_SCREEN
+ {
+ g_free(options.text_editor);
+ options.text_editor = get_format(value);
+ }
+#else
+ {}
#endif
else if (!strcasecmp(CONF_SECOND_COLUMN, name))
#ifdef NCMPC_MINI
diff --git a/src/defaults.h b/src/defaults.h
index 9bb934dacb9c44698ce076f2aa4c6d960c67e073..fac784d2eaa64012f61cc481e2c9f83f18f659f4 100644 (file)
--- a/src/defaults.h
+++ b/src/defaults.h
#define DEFAULT_LYRICS_TIMEOUT 100
+#define DEFAULT_TEXT_EDITOR "editor"
+
#define DEFAULT_SCROLL TRUE
#define DEFAULT_SCROLL_SEP " *** "
diff --git a/src/options.c b/src/options.c
index f7044ccbe24ddd9645b77a2e8f66f61c75291b03..47fc3b9715e72829758d811642b426bac4d7012b 100644 (file)
--- a/src/options.c
+++ b/src/options.c
options.list_format = g_strdup(DEFAULT_LIST_FORMAT);
options.status_format = g_strdup(DEFAULT_STATUS_FORMAT);
options.screen_list = g_strsplit_set(DEFAULT_SCREEN_LIST, " ", 0);
+#ifdef ENABLE_LYRICS_SCREEN
+ options.text_editor = g_strdup(DEFAULT_TEXT_EDITOR);
+#endif
#ifndef NCMPC_MINI
options.scroll_sep = g_strdup(DEFAULT_SCROLL_SEP);
#endif
diff --git a/src/options.h b/src/options.h
index a8ad1ffdd76712036f19af881c404f7f5934c005..fc9f7a1e1c99682f4f7099568b3fe94dc2d2f883 100644 (file)
--- a/src/options.h
+++ b/src/options.h
int lyrics_timeout;
bool lyrics_autosave;
bool lyrics_show_plugin;
+ char *text_editor;
#endif
bool find_wrap;
bool find_show_last_pattern;