Add compile function.#981
Closed
charJe wants to merge 3 commits intoemacs-ess:masterfrom
charJe:master
Closed
Conversation
I also added it to the mode line menu under ESS/Compile
Member
|
I think we should avoid adding small functions piecemeal, and instead implement compilation commands in a consistent way for a range of cases. Connected to #531. I've been using this for a while. (defun my-ess-r-eval-in-compile-buffer (expr)
"Evalate R expression EXPR in a standalone `compilation-mode' buffer."
(let* ((procname inferior-ess-r-program-name)
(command (format "%s --slave --no-readline -e \"%s\"" procname expr)))
(compilation-start command nil
(lambda (name-of-mode)
(concat "*" (downcase name-of-mode) "*"))
ess-r-error-regexp-alist)))
(defun my-ess-rmarkdown-render (arg)
(interactive "P")
(let ((cmd (if (file-exists-p "_bookdown.yml")
(if arg
(format "bookdown::render_book('%s')" buffer-file-name)
(format "bookdown::render_book('%s', preview = TRUE)" buffer-file-name))
(format "rmarkdown::render('%s')" buffer-file-name))))
(my-ess-r-eval-in-compile-buffer cmd))) |
Author
|
That's fine with me. I just needed the functionality, and I thought other people might need it too. It should be a part of the master branch. I also think there should be a menu item for discoverability. |
Member
|
I'm closing this for now because this single command would be better suited in the Emacs wiki or in an SO answer. If we're adding compilation-mode support to ESS, it should be part of a larger design. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.