|
From: | Charles Gordon |
Subject: | Re: [Qemacs-devel] Config file questions |
Date: | Mon, 20 Mar 2017 00:43:04 +0100 |
On 19 Mar 2017, at 23:49, Hadrien Lacour <address@hidden> wrote:On Sun, Mar 19, 2017 at 10:48:00PM +0100, Charles Gordon wrote:
OK, I got it! indent_tabs_mode is a window variable. Changing it in the config file only affects the current window, and the setting is lost as soon as an actual file is loaded and attached to it. I used to be adamant about indenting the code with tabs only, but I changed to spaces only about 25 years ago, because tabs are inherently non portable and the code gets messed up when moved from one system to another, or copied and pasted into emails, websites, various editors... I only use tabs in Makefiles, because there is no choice, due to the syntax(*). The default is forced in the mode initialization code. Unlike tab_width that is initialized to the value of default_tab_width, there is no variable default_indent_tabs_mode to specify the default value for indent_tabs_mode. I should look into this and make it more intuitive. Here are some ideas: * issue a warning when window or buffer specific settings are changed in the config file * make these modifications affect a prototype window that would hold default settings, copied to any new window upon attachment to a buffer. As I said, the scripting is still work in progress. What do you mean by "have the config file simply be a command list exactly as the ones that can be used inside qe?” * most functions can be used from the config file but using set_indent_tabs_mode(1); would not work any better as it has the same problem: it only affects the current window. * do you mean that the config file should have a list of keystrokes to be run like a macro? This would not be very readable, but is feasible via define_kbd_macro(). The good news is there is a simple solution for you in the mean time: create a file named .qerc (DOT Q E R C) in your home directory with this contents: indent_tabs_mode = 1; When qemacs loads a file or creates a new file, it loads and evaluates all .qerc files it finds in all parent directories of the file, from the root directory all the way to the file directory. You can use this facility to set personal defaults in your home directory and project specific settings in different project directories. This should solve your problem. Chqrlie (*) I met Stuart Feldman at Bell Labs a long time ago: his first words after being introduced to me as the original inventor of make were to apologize for the syntax glitch: “Please to meet you, sorry about the tabs…" |
[Prev in Thread] | Current Thread | [Next in Thread] |