Questions tagged [polymode]
Polymode is an emacs package that offers generic support for multiple major modes inside a single emacs buffer.
34
questions
0
votes
0
answers
18
views
Polymode in org-edit-special
I use (add-hook 'python-mode-hook 'poly-python-sql-mode) where poly-python-sql-mode is a special polymode that correctly highlights SQL queries that are used within strings in a Python file.
When this ...
0
votes
1
answer
37
views
Installed polymode from Melpa, but everything comes up in Fundamental mode
I've been happily using polymode to edit Rmarkdown documents for many years. I had installed it and configured it manually, and it was fine until the sysadmins upgraded emacs from 24 to 27. The file I ...
0
votes
0
answers
40
views
Polymode markdown: export to revealjs
I want to export a markdown document to revealjs slides. When I open the markdown file, poymode markdown major mode is activated. When I choose "export" from the menu, I can specify "...
0
votes
0
answers
46
views
Polymode support for Reticulate-library for mixing R and Python
Polymode work well with Rmarkdown using ESS in R analyses. There is a R package reticulate that allows running python within R either interactively with reticulate::repl_python() or by line or file ...
1
vote
2
answers
227
views
Evaluate Single Python Code Blocks in a Quarto File like in R Studio or Jupyter Lab
Quarto is a literate programming framework. It allows you to combine in a single file code (in various programming languages) and text (in markdown).*
When a Quarto document is rendered, the output ...
0
votes
1
answer
65
views
Can't install code as package
I've recently started to look into the Blazor framework and noticed there is no available major-mode for editing .razor files, which are essentially a mix of C# and HTML. I then started creating a ...
0
votes
1
answer
73
views
Indentation in HEREDOC
I'm looking for a way to make the indentation in HEREDOCs better. In my case, it's specifically in Ruby, but maybe this is a general question. Basically, I have the following situation: in our tests, ...
1
vote
0
answers
28
views
add personal template directory to poly-R
I'm trying to migrate my R workflow totally to emacs (my experience with emacs is very basic), so I installed ESS and poly-markdown and poly-R among other things.
When working in rmarkdown files I ...
1
vote
1
answer
47
views
Poly-Markdown+R does not find the right version of R for R code chunks
I am working on a Rmarkdown document and I have R 4.0.4 running in a buffer. I try to export the document with M-n e and it finds R 3.6.3
sessionInfo()
R version 3.6.3
This meant that I had a lot of ...
2
votes
0
answers
186
views
Styled components with polymode
Can I use polymode for styled components inside tsx or jsx files? For example:
// MyComponent.tsx
const x = 1;
const y = 2;
const myStyle = css`
background-color: red;
padding: ${x + y};
...
2
votes
0
answers
184
views
Polymode very slow in Rmd files
I am struggling with emacs constantly hanging as soon as I move the cursor into a code chunk in Rmd files. It spends about two seconds moving the cursor after I hit an arrow key. Can you help me get ...
3
votes
1
answer
123
views
Unexpected indentation in python chunks
Already one year ago, I described a problem on github with polymode and unexpected indents. Since there was no answer there so far and the problem is really annoying, I ask here for ideas for a ...
0
votes
0
answers
237
views
Broken syntax highlighting in polymode
I defined a polymode with julia-mode as the inner mode. It works well but sometimes syntax highlighting goes wrong and it can be fixed only by restarting emacs. I haven't figured out how I can ...
0
votes
1
answer
98
views
Elisp to get the language mode for the current ein cell?
When I'm using ein to run a python jupyter notebook, the major-mode variable is just "ein:notebook-multilang-mode" which makes it ambiguous what the current language is. I have elisp that only ...
2
votes
0
answers
732
views
Markdown and Latex highlighting (font lock) in R Markdown file
I am using polymode to edit rmarkdown files. Exporting to e.g. pdf is super simple and works very well. R code chunks are also properly highlighted.
But:
I do quite often use latex code inside (r)...
8
votes
1
answer
555
views
Can we get inline results with polymode for Rmd files?
As a new Emacs user, I've recently learned how to use polymode to handle R code in org-mode. I'm happy with it, since I get the same features than those implemented for example in Rstudio for Rmd ...
1
vote
0
answers
152
views
How to specify a pdf viewer for ess mode
I have set the variable ess-pdf-viewer-pref to "evince"
But when I export any Rnw file using M-n e, instead of displaying the pdf in evince it is displayed inside Emacs.
How can I stop Emacs ...
0
votes
1
answer
98
views
Text entered right-to-left in chunks using polymode
I use polymode when editing Rmarkdown files in Emacs 26.1 and have the following problem. I visit a new file, test.Rmd, and type the following at the top of the file (this creates a yaml chunk):
--- ...
2
votes
1
answer
199
views
Polymode changes from ESS-mode to Markdown-mode whenever I press enter
When I am editing .Rmd file within a polymode chunk, the mode switches from ESS to Markdown mode whenever I press enter. However, it switches back to ess-mode whenver I save the file.
I will try ...
2
votes
0
answers
563
views
Missing RMarkdown templates with poly-R
I use the ess, polymode, and poly-R packages together to work with RMarkdown files. I have also installed the R packages rmarkdown and tufte in my R library. While these R packages provide ".Rmd" ...
3
votes
1
answer
1k
views
ESS poly-R issue
I am trying to setup ESS with polymode and poly-markdown
I have the following in my myinit.org file which becomes
compiled into init.el
;; https://polymode.github.io/installation/
(use-package ...
3
votes
1
answer
911
views
Symbol's value as variable is void: polymode-mode-map
I define a function ess-rmarkdown to compile RMarkdown documents with polymode.
(use-package polymode
:ensure t
:config
(use-package poly-R)
(use-package poly-markdown)
;;; MARKDOWN
(add-...
2
votes
1
answer
102
views
Syntactic fontification of diff hunks
I'm looking for a multiple-major-modes package that doesn't remove fontification of the host mode from its inner submodes?
I tried MMM Mode and Polymode, but they remove the initial fontification and ...
6
votes
1
answer
480
views
ESS freezes on startup with ess-tracebug mode enabled
I am currently running R 3.3.1 in emacs 25.1.1, ESS 16.10, and polymode 20160805.448 installed via MELPA on Mac OS Sierra. Whenever I try to open an interactive R console using M-x R, it freezes ...
11
votes
1
answer
2k
views
Insert code chunk in R Markdown with yasnippet and polymode
I am trying to write a yasnippet to insert code chunks into an R Markdown file. I use polymode to have multiple major modes (markdown, ESS[S]) in a single file. This is my snippet:
# -*- mode: ...
1
vote
0
answers
37
views
Polymode: customise buffer names
Polymode creates a distinct buffer for each mode involved.
Some use really inconvenient names, where the mode part of the name is easily longer than the actual document name itself, e.g. foo.Rmd[poly-...
1
vote
0
answers
103
views
Good way to match symmetric delimiters
I am trying to match $$ resp $ pairs to switch into latex-mode via polymode in a markdown file. $$ is the delimiter for displayed math in this case and $ for inline math.
I know that this is not a ...
6
votes
2
answers
1k
views
How to set PDF export in polymode-mode to use xelatex engine?
Consider the below MWE of .Rmd file containing Arabic text which needs xelatex engine to be rendered by pandoc. As the documentation of the latter says putting this option would make it: --latex-...
1
vote
0
answers
86
views
Does SyncTeX work with Emacs polymode?
Specifically, I want to sync an Rnoweb (Rnw) source with a PDF opened in either Skim or Evince using polymode. Note that I have no problem weaving or exporting Rnw files and viewing PDFs with Skim. ...
2
votes
0
answers
34
views
polymode with fsharp-mode has trouble sending last line in code block to interactive
I just started setting up polymode
I got ESS and r going nicely with markdown.
(use-package markdown-mode)
(use-package polymode)
(require 'poly-R)
(require 'poly-markdown)
I was able to put r code ...
4
votes
1
answer
1k
views
Polymode with python and latex-mode
The polymode manual suggests that creating new polymodes should be very easy:
Creating new polymodes typically takes a few lines of code.
I wanted to set it up to make emacs to switch to python ...
6
votes
1
answer
782
views
What is the difference between the knitR and knitR-ESS for polymode?
I have recently setup polymode for use with Rnw and Rmd files.
When it came to knit/weave a document I was given the choice of four defaults;
knitR-ESS, Sweave, knitR and Sweave-ESS.
I usually use ...
3
votes
1
answer
598
views
Polymode appears in minibuffer but does not weave into a file on Windows, why?
This is a follow-up post to Polymode installation on Windows machine. Accordingly I installed polymode using this code in the init.el file after ESS code:
(require 'poly-R)
(require 'poly-markdown)...
3
votes
1
answer
609
views
Polymode installation on Windows machine
Polymode is very promising to handle the integration of R chunks using different modes.
I went through the documentation and it works well when I am inside .Rmd file but not inside .Rnw. In the .Rnw I ...