Comments (5)
Example code:
(add-hook 'markdown-mode-hook #'poly-markdown-mode)
from poly-markdown.
It's not needed in all markdown files. The canonical way is to extend the markdown mode and assoc into auto-mode alist.
https://github.com/polymode/poly-R/blob/master/poly-R.el#L92
You can add hook locally if you want but that will mess child modes and also modes which use markdown as host or (especially) innermode.
from poly-markdown.
Really we shouldn't be adding the hook at all, instead let the user enable it manually. That's what I've seen
from poly-markdown.
The canonical way is to extend the markdown mode and assoc into auto-mode alist.
That's definitely not something I've seen. magit-filenotify recommends add-hook
. racer uses the same. The wiki recommends add-hook
for paredit.
Where did you get this idea?
from poly-markdown.
That's definitely not something I've seen
You haven't seen enough. Those functionality enhancers designed as to be used in hooks. Polymodes are proper emacs modes. Emacs modes are installed in auto-mode alist. End of story.
If a polymode is intended to be used as a minor-mode then yes, it should be placed in a hook, but poly-markdown is generally not.
The technical reason that I have given above is a very severe one. If I load it in markdown hook then child modes like poly-markdown+r-mode
will trigger poly-markdown-mode
, if markdown-mode
is used as a innermode it will trigger the poly-markdown-mode
etc.
from poly-markdown.
Related Issues (17)
- A problem while installing poly-markdown from epla HOT 7
- `fill-paragraph` causes Lisp nesting HOT 4
- mode-matcher and sh-mode HOT 1
- Errors running polymode HOT 2
- Raw blocks in pandoc markdown HOT 1
- Code folding with RMarkdown
- Unable to navigate markdown files
- Invalid slot type: pm-inner-chunkmode, head-matcher HOT 3
- Loading code in Agda code blocks removes syntax highlighting from the Markdown text
- Latex (Math) highlight is broken when auctex is installed
- Support additional pandoc language tag syntax
- Buffer-font-mode doesn't switch to fixed-pitch for code-blocks HOT 1
- Documentation of pm-inner/markdown-inline-math wrong
- Support for \[ \] and \( \) math modes HOT 5
- Overly aggressive inline fontification for multi-word inline code HOT 4
- $ character starts latex mode even inside fenced block HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poly-markdown.