emacs-devel
[Top][All Lists]
Advanced

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

Re: 26.1: calc-mode header line [PATCH]


From: Boruch Baum
Subject: Re: 26.1: calc-mode header line [PATCH]
Date: Mon, 7 Sep 2020 17:11:45 -0400
User-agent: NeoMutt/20180716

On 2020-09-07 22:24, Lars Ingebrigtsen wrote:
> Boruch Baum <boruch_baum@gmx.com> writes:
>
> > Off-topic: I have several private extensions to dired that are ready for
...
> >  1) display change - quickly change the 'ls' switches for a dired buffer
> >     from among entries in an alist. The changing can be incremental in
> >     the list or prompt the user based upon a useful plain-text
> >     description. Just additional code. No change to current code.
>
> Hm...  sounds nice, but what's the use case?

There are as many as there are combinations of 'ls' switches. There just
isn't enough room on a screen to show everything and most of the time
one doesn't need or want that much information, so one 'display' may omit
user/group, another show them as uid/gid, another show SElinux security
context, another show (or not) permissions, another have a different
date/time format, etc.

> >  2) history navigation - have each chain of dired buffers track where
> >     they've been and allow navigation backward and forward within that
> >     history. This does make a one-line change to a single current dired
> >     function. It adds several navigation functions, including a form of
> >     visit parent directory that adds a prefix argument to go up n levels
> >     in your current directory tree.
>
> Isn't `C-x C-f M-DEL' a few times easier to remember?

I have no idea what that keybinding is. With my extension, I use simple
keybindings similar to those of many file managers: C-<left> and
C-<right> for history navigation, C-<up> for parent. Additionally, I
bind '/' for some more general navigation.

>
> >  3) pass dired variables to a shell - for any emacs shell or terminal
> >     emulator, launch it from dired, and pass the current directory,
> >     current file at point, current tagged files ... for both the current
> >     dired buffer and an optional one other visible dired buffer on the
> >     same frame ($d1 $d2 $f1 $f2 $t1 $t2). For this, I still need to
> >     polish how the list of tagged files are handled (quoting, bash/zsh
> >     array variables versus POSIX/sh ).
>
> Hm.  What do you use that for?

I used to use (still do sometimes) Midnight Commander, which passes a
form of those variables to its shell. They're very convenient for performing
command line operations on those files.

> >  4) Recover a 'borked' dired session, useful if you've somehow
> >     accumulated n buffers / windows / frames and want to restore a basic
> >     setup.
>
> I'm not sure what a "dired session" is?  I just have a bunch of dired
> buffers open, but I don't consider that a "session"...

OK. So, I just called it a session, no big deal. My background is that I
use S-<f11> as a dired launcher: it creates a frame named 'dired', and
gives it two side-by-side dired buffers/windows. From that frame, the
same keybinding toggles bag to my editor or whatever other frame. So it
seems like a session to me.

>
> >  5) Fully exit dired. Just kills all dired buffers everywhere.
>
> That sounds very specialised.  But I've often wanted a command that
> would kill all buffers that have names that match a regexp, for
> instance.

If you want it, you'll see it was simple to code. IIRC, just walk the
buffer list and kill based upon your compare criteria. It could be
generalized, but I've only ever found a need for it for dired.

6) (or is it seven?) I just remembered: Another extension that's mature
and ready for the wild is dired quick preview feature almost identical
in operation to what exists in Midnight Commander with its 'C-x q'. As
you move point in dired in a file's line, it automatically opens a
buffer in the next window (emacs read-only "view-mode") after killing
any other preview buffer opened previously. It's a very quick way to
scan a files first page of contents, and you can use <tab> to quickly
navigate to/from the preview buffer to browse further. I use that a lot;
surprised I forgot to mention it in my original screed.

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0



reply via email to

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