A lightweight “electric” popup directory browser for Emacs.
- Popup buffer:
*Electric Directory*(reused every time). - Header line shows the current directory (abbreviated).
RETon a file opens it and exits;RETon a directory drills into it. Works with both column layouts (-C/-x/-m) and long listings (-l).ddeletes the file/dir at point (with prompt) and refreshes in place.~deletes backup/autosave files (*~and#*#) and refreshes.Backspace(DEL) goes up one directory.SPCorqquits and restores your previous window layout.- With a prefix argument (
C-u), run plainlist-directory.
The popup preserves your layout flags but sanitizes only -d/--directory and -F/--classify so filename parsing remains stable. Use a prefix argument (C-u) when invoking to be prompted for switches.
RET— visit file (exit) / enter directory (stay)SPC— quit (same asq)q— quitDEL— up one directoryn/p— next / previous lined— delete file or directory at point (prompts; refreshes)~— delete backup & autosave files in current dir (prompts; refreshes)- Scrolling:
C-vandM-vstill work as usual
M-x package-install RET electric-list-directory RET
Using use-package:
(use-package electric-list-directory
:ensure t
:bind ("C-x C-d" . electric-list-directory)) ; Replaces default `list-directory`If the file is in your load-path (e.g., ~/.e/):
(autoload 'electric-list-directory "electric-list-directory"
"Browse DIRNAME in an electric directory buffer." t)
;; Bind to C-x C-d (Note: this replaces the default `list-directory` binding):
(global-set-key (kbd "C-x C-d") #'electric-list-directory)M-x electric-list-directory
- Invoke with a prefix arg (
C-u) to get the built-inlist-directoryand a prompt for switches.
- 1.4 — Fix visiting behavior:
RETon a file now opens it and stays in that buffer (the popup is closed). Onlyq/SPCrestore the previous window layout.RETon a directory still drills in. - 1.3 — RET now works with column layouts (
-C/-x/-m) and long listings (-l); sanitize only-d/--directoryand-F/--classify; docstrings wrapped and key names quoted for package-lint; README updated. - 1.2 — Space quits (
SPCbehaves likeq); docstrings cleaned; Emacs 26.1+ compatibility. - 1.1 — Header line with current dir; drill-in on directories; delete helpers.