When I type C-x d for the first time after starting emacs I get regular dired, not dired+ view. If I execute M-x diredp-dired-for-files I get dired+ view of the directory, and every C-x d after that opens dired+ view of any directory I visit. Also if dired+ package was updated from list-packages then C-x d invokes dired+ automatically even the first time and without me having to execute diredp-dired-for-files. Why doesn't dired+ get invoked automatically on the first and subsequent C-x d until I manually invoke it as diredp-dired-for-files? Is this how it supposed to work?

Edit I forgot to mention, package-initialize is the first command in my init.el. In fact, the packaging system takes care of this

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.

1 Answer 1

  • If you are using the package system (e.g. MELPA), make sure you have used (package-initialize.

  • Alternatively (especially if you are not using the package system): Put dired+.el (or dired+.elc) in a directory that is in your load-path, and put (require 'dired+) in your init file.

The reason Dired+ was not available from the outset is that it was not loaded by default. The above instructions should fix that. The reason that Dired+ was available after you used a Dired+ command was that the command you used was autoloaded, meaning that you could invoke it before Dired+ was loaded, and invoking it automatically loaded Dired+. Once it was loaded it was available from then on.

  • 1
    Unfortunately, it's not so simple because I do use the package system and (package-initialize) is the first command in my init.el, but this doesn't help in this case. Moreover, package-selected-packages list includes dired+. I assume that should guarantee dired+ is loaded by default.
    – dmakarov
    Commented Apr 30, 2015 at 18:33
  • 1
    @dmakarov: did you also include the (require 'dired+) line that Drew mentioned?
    – Dan
    Commented Apr 30, 2015 at 18:39
  • 1
    Indeed, adding (require 'dired+) solves this problem.
    – dmakarov
    Commented Apr 30, 2015 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.