pandoc-mode icon indicating copy to clipboard operation
pandoc-mode copied to clipboard

Allow conversion of scratch buffer

Open fm4d opened this issue 9 years ago • 3 comments
trafficstars

It would be nice to allow conversion of non-file buffers like scratch which is now impossible due to:

(buffer-file-name buffer)
(file-name-nondirectory filename)

in pandoc--call-external which fails because (buffer-file-name #scratch) ==> nil.

fm4d avatar May 12 '16 11:05 fm4d

That's actually a nice idea. pandoc-mode needs a file name, since some output format require an output file. But it's easy to create a file name based on the buffer name.

With this fix, a buffer that's not visiting a file can be processed in the normal way. If an output file is created, it gets the name of the buffer (plus relevant extension).

joostkremers avatar May 19 '16 15:05 joostkremers

Hmm, I'm just thinking, there's a nicer way to do this. Stay tuned.

joostkremers avatar May 19 '16 15:05 joostkremers

Done: dd1152f. Now, when pandoc is run on a buffer not visiting a file, messages display the buffer name instead of the (bogus) file name constructed from it.

Please let me know if you run into problems.

joostkremers avatar May 19 '16 15:05 joostkremers