Skip to content

Commit

Permalink
Fix emacs-everywhere-initialise in directories
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmiq authored and tecosaur committed Apr 13, 2021
1 parent 99997af commit 5475e1a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions emacs-everywhere.el
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,15 @@ This matches FILE against `emacs-everywhere-file-patterns'."
(defun emacs-everywhere-initialise ()
"Entry point for the executable.
APP is an `emacs-everywhere-app' struct."
(when (emacs-everywhere-file-p (buffer-file-name (buffer-base-buffer)))
(let ((file (buffer-file-name (buffer-base-buffer))))
(when (and file (emacs-everywhere-file-p file))
(let ((app (or (frame-parameter nil 'emacs-everywhere-app)
(emacs-everywhere-app-info))))
(setq-local emacs-everywhere-current-app app)
(with-demoted-errors "Emacs Everywhere: error running init hooks, %s"
(run-hooks 'emacs-everywhere-init-hooks))
(emacs-everywhere-mode 1)
(setq emacs-everywhere--contents (buffer-string)))))
(setq emacs-everywhere--contents (buffer-string))))))

;;;###autoload
(add-hook 'server-visit-hook #'emacs-everywhere-initialise)
Expand Down

0 comments on commit 5475e1a

Please sign in to comment.