branch: elpa/markdown-mode commit 5f970814f4121474ec4f4b1bd43f759bb4b7108f Author: Carlos Scheidegger <carlos.scheideg...@rstudio.com> Commit: Carlos Scheidegger <carlos.scheideg...@rstudio.com>
make `markdown` pass `buffer-file-name` as a parameter to `markdown-command` --- CHANGES.md | 5 +++++ markdown-mode.el | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 0511ef0426..2a2a3b12bb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,11 @@ *Under development* +* Improvements: + - `markdown` passes `buffer-file-name` as a parameter to + `markdown-command` when `markdown-command-needs-filename` is + `t` and `markdown-command` is a function. + # Markdown Mode 2.5 * **Breaking changes:** diff --git a/markdown-mode.el b/markdown-mode.el index 10342fb809..7c60b58951 100644 --- a/markdown-mode.el +++ b/markdown-mode.el @@ -7351,7 +7351,11 @@ Return the name of the output buffer used." (if (not (null command-args)) (apply #'call-process-region begin-region end-region command nil buf nil command-args) (call-process-region begin-region end-region command nil buf)) - (funcall markdown-command begin-region end-region buf) + (if markdown-command-needs-filename + (if (not buffer-file-name) + (user-error "Must be visiting a file") + (funcall markdown-command begin-region end-region buf buffer-file-name)) + (funcall markdown-command begin-region end-region buf)) ;; If the ‘markdown-command’ function didn’t signal an ;; error, assume it succeeded by binding ‘exit-code’ to 0. 0))))))