Re: dired_show_dot_files

Charlie Gordon <[email protected]> Sun, 21 Aug 2022 20:40:34 +0200
Newsgroups gmane.editors.qemacs.devel
Message-ID <[email protected]>
On 21 Aug 2022, at 19:42, Piscium <[email protected]> wrote:
>=20
> Hi Charlie,
>=20
> On Sun, 21 Aug 2022 at 17:34, Olivier <ogu@xxx> wrote:
>=20
> I am not sure who Olivier is!

An alias I use for some of my work for sure :)

>> You can toggle this variable by pressing =E2=80=98.=E2=80=99 in a =
dired buffer.
>> The setting applies to all dired current and future buffers, yet it =
is not saved (yet) when you exit qemacs.
>=20
> Thanks a lot. This is what I was looking for. It works.

I just realized this binding is non standard, emacs does something else =
for this key
and there is no simple key to toggle between hiding and showing dot =
files

>> If you want to hide the dot files by default when loading qemacs, add =
a line to your ~/.qe/config file:
>>    dired_show_dot_files=3D0;
>=20
> Thanks, this also works.

default settings should go to this file. It is loaded when qemacs is =
started.

> Btw, before I wrote the email I had tried to put this same line in
> qerc. It nearly worked. What I mean is that if from my home folder I
> would start qe with no parameter, I would be shown the files in my
> home folder including the dot files, but the moment I pressed a key,
> for example, down arrow, the dot files became hidden. I am not sure if
> this is a bug or the way it is intended to work. It looks as if qerc
> was read and processed only after my first key press instead of before
> the text being shown to me.

I never tested this. the =E2=80=9C.qerc=E2=80=9D files are loaded after =
attaching the newly created or loaded buffer to a window,
This is a problem here because the initial directory scan is performed =
as a side effect of setting the dired-mode
which itself is a side effect of attaching the window. The changed =
setting is detected after the first command run
in the window.  Good catch! It is not intended, but at least there is an =
explanation. I am working on dired
to implement a hierarchical directory view, like the Windows and macOS =
file managers.

>> You could also add these lines to create named macros and bind them =
to =E2=80=98f2=E2=80=99 and =E2=80=98f3=E2=80=99 but given how easy it =
is to switch inside a dired buffer, it seems hardly necessary:
>>    define_kbd_macro(=E2=80=9Chide-dot_files", =E2=80=9CM-x =
set-variable RET 1 RET", =E2=80=9Cf2");
>>    define_kbd_macro(=E2=80=9Chide-dot_files", =E2=80=9CM-x =
set-variable RET 0 RET", =E2=80=9Cf3=E2=80=9D);
>=20
> This does not work for me. =E2=80=9Chide-dot_files" has a dash and a
> underscore. It does not work even if I replace the dash with an
> underscore.

Sorry about that, the variable names have `-` (dashes) in them, the =
underlying C variables use `_` (underscore).
The config file parser does the conversion automatically, but the =
function set-variable does not. I should probably make this more =
transparent.
Sorry also about the guillemets instead of double quotes. This email =
client insists on silly automatic conversions.

>> I have started working on stabilizing and documenting all these =
features.
>=20
> Thanks.

Markdown seems the way to go now, so I will convert the texinfo files =
and write more documentation,
possibly extracting some comments from the source code, ala docbook.

>> As you have noticed, dired-mode is not quite as functional as in =
emacs, can you tell me what you use it for in emacs that you miss in =
qemacs?
>=20
> I am not (yet ?) an emacs user, maybe I will become some day, who
> knows. For me the advantage of microemacs is that it is much faster
> than emacs and using it I can get used to the key bindings, as there
> is some commonality.

Interesting.
I have not used microemacs since 1987, and lost track of the may =
versions available, including one customized by Linus Torvalds.
Which version do you use? I suspect it is =E2=80=9Cmg=E2=80=9D, widely =
available and part of the OpenBSD source tree, where do you get it from?

Cheers,

Chqrlie.