qemacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemacs-devel] Config file questions


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:

I understand your concern, but I don’t know why it does not work on your system.
Did you install qemacs from source or via apt-get ?
I strongly advise you to install from source by checking out the latest version from Savannah:

On 19 Mar 2017, at 01:02, Hadrien Lacour <address@hidden> wrote:

Hello,
I'm faced with another challenge (well, I can't really program without being
able to change indent-tabs-mode anyway): any way to do what
toggle-truncate-lines does in the config file?

I did as you told and nothing changed at all (as expect, since I'm using
Gentoo which provide a really recent snapshot). Here's my full config file:

default_tab_width = 4;
indent_tabs_mode = 1;
set_system_font("fixed", "terminus,unifont");
set_style("default", "color", "#aaaaaa");
set_style("default", "font-size", "16");

Did you try to set "indent_tabs_mode = 1;"? Did it work?
I still have no idea of how "toggle-truncate-lines" should be used in the
config file (toggle-truncate-lines() doesn't work).
Anyway, wouldn't it be simpler from the user AND dev point of view to have the
config file simply be a command list exactly as the ones that can be used
inside qe?

I'll probably make a custom ebuild to change the default, but I'd sleep better
if the problem could be solved with config files.

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…"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]