Hello Piscium, Thank you for your feedback, can you be more specific about the way you perform copy + paste?
What is your environment? how do you run qemacs and what kind of keys do you use to perform copy + paste? qemacs does not convert tabs to spaces when copying with kill / yank commands. When using the OS clipboard, things get more messy: For example: when I run qemacs in the macOS iTerm2 terminal, and if I copy using the mac clipboard and paste into the qemacs terminal window with a mac paste shortcut (or right menu option), tabs are taken as commands and expand to spaces depending on the settings for the current window. Regarding other editors, it is not uncommon for the editor to reformat the block when pasting into C or similar mode buffers. qemacs does not do this and it is rather easy to hit Ctrl-Alt-\ to reindent the yanked block that is marked by default, assuming a yank command was used. I would like to improve qemacs integration with X-windows and other window managers, this is one of the many issues in this area. As a quick fix for your current issue, you can add a .qerc file somewhere in the file hierarchy with this line: indent_tabs_mode = 1; .qerc files are searched and parsed from the root directory down the directory tree leading to the file upon loading a file to set up projet wide settings. I agree I should document these configuration options Regarding the default for indent_tabs_mode as 0 except for Makefiles, let’s not start a war, but it has been my default for the last 20 years, after 20 years of advocating the use of TABs in source files, my personal take on hindsight 20/20 :) Ciao! Chqrlie. > On 9 Aug 2022, at 09:48, Piscium <grok...@gmail.com> wrote: > > Hi, > > I did a copy and paste, saved the file, and diff unexpectedly showed a > difference. It turns out that qemacs by default converts tabs to > spaces. I have used a number of text editors over the years, I think > this is the first where it is set by default. Neither mg nor emacs do > that, for example. > > I looked in the source code and found two ways of enabling the mode using M-x: > - with command set-indent-tabs-mode > - with command set-variable, passing as parameter indent-tabs-mode > > So far so good, however I don't want to be doing this every time, so I > tried to put that in the configuration file but I could not make it > work. It seems that indent-tabs-mode is a window variable instead of a > global variable. Would that be the reason why it cannot be configured > in the config file? Or is there something else I am missing? > > In a nutshell, what I am looking for is a way to enable the tabs mode > in the configuration file. I am running the latest version in github. >