Allow rendering for buffers without a name/path#8
Allow rendering for buffers without a name/path#8der-daniel wants to merge 1 commit intomola-T:masterfrom der-daniel:master
Conversation
This commit enables renderings of buffers without a name, thus without a path. Therefore you cannot use '(buffer-file-name)' though it returns nil if the buffer has not been saved yet. To be able to use things like 'Edit in Emacs' (Chrome Extensions) you need to have a mechanism to save such buffers.
|
Sorry for late reply. I think checking for file extension is necessary. "If you render a non Markdown file nothing dramatic happens." That's not accurate because a Generally, you can edit Having absolute path Thanks |
|
Hi, yes I tried it with a temp buffer. Please add a Word Around. For Frodo |
|
Unless the act of generating markdown causes some serious side effect that like breaking emacs, I'm inclined to agree with @der-daniel's original statement that it's unnecessary to check the file extension, and actually detrimental. A file's extension is no guarantee of its contents. It's fairly common for markdown files to not have an extension at all, for instance. If flymd tries to render a non-markdown file as markdown, what's the problem? The user has asked for something non-nonsensical, and that's what they'll get. It may look garbled, but that's their fault. I'm in favor of taking that requirement out. More will be gained from removing this requirement than keeping it, in my opinion. I was just about to post an issue for this, but I discovered this pull request first. P.S. @der-daniel You should run M-x delete-trailing-whitespace on your code. :) |
Like stated in Issue #7, I was not able to render
Markdownin a buffer without or with a strange name.I made some minor changed to write such buffer to
/tmp/or thesetq'doutput-dir.I also removed the file extension check, since it does not provide any sanity. If you render a non
Markdownfile nothing dramatic happens. 😄Thanks for this nice Package.
I hope the will make its way into the project.
Feel free to criticize changes I made.
For Frodo,
Daniel