I am using a cool software called Emacs Anywhere.
Usually, I invoke this software to write on Stack Overflow and on GitHub. Both websites use markdown.
Hence, almost every time I invoke Emacs Anywhere, I need to manually enable markdown mode.
I have markdown-mode with this package installed in my init file:
;; This package brings keybindings similar to org-mode, but to ;; markdown format! (use-package markdown-mode :ensure t :mode ("README\\.md\\'" . gfm-mode) :init (setq markdown-command "multimarkdown"))
I would like to make things more automatic. Take into account that for Emacs Anywhere to work it is necessary to have an Emacs server going on. This is provided by my config file, with:
;; Start server so that I can easily launch succesfully the ;; application called Emacs Anywhere (add-hook 'after-init-hook #'server-start)
Also, every time Emacs Anywhere is invoked, Emacs creates a new frame. Moreover, there is an addition of a new buffer called Emacs Anywhere.
Finally, what triggers the invocation of Emacs Anywhere is not exactly Emacs, but a shortcut defined on System Preference of the macOS.
Hence, I would like to ask, what is the best approach to automate
the process of enabling
markdown-mode? How to do it?
1 - Creating a hook enabling markdown triggered by frame creation in general?
Obs.: Maybe I am missing something, but I believe I only use Emacs new frames after invoking Emacs anywhere. It does not seem to be useful in my day-to-day activies programming, on Magit, dired, org-mode files...
2 - Creating a hook based on some inner workings of the Emacs server? For instance, a hook catching the connection between Emacs Anywhere and the frame creation?
3 - Maybe a hook triggered by the creation of buffer name written as
4 - Another approach?