dired-hide-dotfiles icon indicating copy to clipboard operation
dired-hide-dotfiles copied to clipboard

Directions for setting '.' key does not work in Emacs 29.1

Open mok0 opened this issue 2 years ago • 2 comments

When adding your suggested lines to my init.el I get the following warning from Emacs, and it fails to load the remainder of the init.el file:

⛔ Warning (initialization): An error occurred while loading ‘/Users/mok/.emacs.d/init.el’:

Symbol's value as variable is void: dired-mode-map

mok0 avatar Aug 12 '23 00:08 mok0

Ah.

You should probably:

(defun my-dired-mode-hook ()
  "My `dired' mode hook."
  ;; To hide dot-files by default
  (dired-hide-dotfiles-mode))

(with-eval-after-load 'dired
  (define-key dired-mode-map "." #'dired-hide-dotfiles-mode)
  (add-hook 'dired-mode-hook #'my-dired-mode-hook))

If that works and you feel like it, please send a PR.

mattiasb avatar Aug 15 '23 11:08 mattiasb

Thank you for your suggestion, unfortunately it does not work for me, I am not sure what is going on but it may interfere with the completion framework. Hitting '.' makes dired change directory to the parent even though I mapped it like you propose.

I will just live with the fact that dotfiles are not visible for now :-)

mok0 avatar Aug 16 '23 03:08 mok0