- [X] C config module that reads an ini-style file to set attributes
based on path
-- [ ] configure "initial_panes"
+- [X] configure "initial_panes"
- [X] discard old auto-load??
- [ ] file patterns for "complete" to (optionally) ignore
- [ ] read .gitignore and add to "ignore" list
return key_lookup_prefix(map, ci);
}
-static const char *initial_panes[] = {
- "attach-x11selection",
- "attach-messageline",
- "attach-global-keymap",
- "attach-mode-emacs",
- "attach-tile",
- NULL
-};
-
DEF_CMD(editor_activate_display)
{
/* Given a display attached to the root, integrate it
*/
struct pane *disp = ci->focus;
struct pane *p, *p2;
- int i;
+ char *ip = attr_find(ci->home->attrs, "editor-initial-panes");
+ char *save, *t, *m;
+ if (!ip)
+ return Efail;
+ ip = strsave(ci->home, ip);
p = pane_root(ci->focus);
- p2 = call_ret(pane, "attach-input", p);
- if (p2)
- pane_reparent(disp, p2);
- p = disp;
- for (i = 0; initial_panes[i]; i++) {
- const char *cmd = initial_panes[i];
- if (cmd)
- p2 = call_ret(pane, cmd, p);
+
+ for (t = strtok_r(ip, " \t\n", &save);
+ t;
+ t = strtok_r(NULL, " \t\n", &save)) {
+ if (!*t)
+ continue;
+ if (strcmp(t, "DISPLAY") == 0) {
+ if (disp) {
+ pane_reparent(disp, p);
+ p = disp;
+ disp = NULL;
+ }
+ continue;
+ }
+ m = strconcat(NULL, "attach-", t);
+ p2 = call_ret(pane, m, p);
+ free(m);
if (p2)
p = p2;
}
[include]
include = modules.ini
+[global]
+
+editor-initial-panes = input DISPLAY
+ " x11selection messageline"
+ " global-keymap mode-emacs tile"
[file:COMMIT_EDITMSG*]
APPEND view-default = ,textfill,whitespace,autospell
fill-width = 72