Re: [ESS] Displaying R plots within an Emacs buffer

2024-03-21 Thread Tyler Smith via ESS-help
That looks cool!

I don't understand the code, but seeing it only took 20 lines, maybe it's 
something I could figure out.

Great start!

- tyler

-- 
plantarum.ca

On Thu, Mar 21, 2024, at 5:30 PM, Stephen J. Eglen via ESS-help wrote:
> This is an itch I've had for ESS for probably at least 10 
> years... how
> to get R plots displayed dynamically in an Emacs buffer?
>
> See code [1] and demo [2] for a proof of concept.  Feedback (and 
> any
> expertise with websockets) welcome!
>
> Best wishes,
>
> Stephen
>
> [1] https://github.com/sje30/ess-unigd
>
> [2] https://youtu.be/1h7UR7t9JFM
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] emacs theme for polymode with noweb files

2023-12-05 Thread Tyler Smith via ESS-help
Hi Johannes,

Tibbles add an extra layer of complexity, in that they apply their own colors 
to output, which doesn't necessarily follow the Emacs theme. I turn them off 
with:

```
options(crayon.enabled = FALSE)
```

See more discussion here:

https://github.com/tidyverse/tibble/issues/395

Tyler

-- 
plantarum.ca

On Tue, Dec 5, 2023, at 4:33 AM, Hüsing, Johannes via ESS-help wrote:
> Thanks, Tyler, for the directions, which made me burn office hours 
> while looking fort he optimal font face.
>
> One of these faces seems to be assigned to documenting the contents of 
> a tidyverse object. Via the link you can find the face used for 
> printing a data frame vs printing a tibble. The latter one has issues 
> with foreground and background being to similar, as you can see in 
> https://i.imgur.com/Q2lez8e.png (sorry if i am not aware of the custom 
> method of posting images).
>
> Following your directions of
>> Put the cursor over the offending characters, and call the function `M-x 
>> describe-face`.
> I get the following:
>
> Documentation:
> Basic default face.
>
> Defined in ‘faces.el’.
>
>
>Family: Consolas
>   Foundry: outline
> Width: normal
>Height: 102
>Weight: normal
> Slant: normal
>Foreground: #f8f8f2
> DistantForeground: unspecified
>Background: #282a36
> Underline: nil
>  Overline: nil
>Strike-through: nil
>   Box: nil
>   Inverse: nil
>   Stipple: nil
>  Font: # -outline-Consolas-normal-normal-normal-mono-17-*-*-*-c-*-iso8859-1>
>   Fontset: 
> -outline-Consolas-normal-normal-normal-mono-17-*-*-*-c-*-fontset-auto1
>Extend: nil
>   Inherit: nil
>
> Clearly, the offending character is a lot darker than it yould be if it 
> used the foreground of the basic default face.
> Is ESS using the "DistantForeground" and interpreting "unspecified" as 
> "black"?
>
> Is there a proper way to let ESS format outputs as default foreground 
> on default background, regardless if it's printing from tidyverse 
> objects or base R objects?
>
> Otherwise, the dracula theme works fine with me. Even the 
> auto-dim-other-buffers-mode works like a charm for both light and dark 
> themes. It's just that the workflow suggested here does not work as 
> nicely as I hoped it to do.
>
> Cheers
>
> Johannes
>
>
> Johannes Hüsing
> Epidemiologie
>
>
> Landeskrebsregister NRW gGmbH
> Gesundheitscampus 10
> 44801 Bochum
> T 0234 54509-216
> F 0234 54509-499
> johannes.hues...@krebsregister.nrw.de
> www.landeskrebsregister.nrw.de
>
>
> 1. Landesqualitätskonferenz jetzt anmelden unter Qualitätskonferenzen 
> 
> Newsletter LKR NRW jetzt anmelden unter Newsletter 
> 
> Geschäftsführer
> Dr. Andres Schützendübel
> Vorsitzender der Gesellschafterversammlung
> Staatssekretär Dr. Edmund Heller
> Sitz der Gesellschaft
> Bochum
> Registergericht
> Amtsgericht Bochum
> HRB 17715
>
> HINWEIS: Diese Nachricht ist nur für den Adressaten bestimmt. Es ist 
> nicht erlaubt, diese Nachricht zu kopieren oder Dritten zugänglich zu 
> machen. Sollten Sie irrtümlich diese Nachricht erhalten haben, bitte 
> ich um Ihre Mitteilung per E-Mail oder unter der oben angegebenen 
> Telefonnummer.
>
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] emacs theme for polymode with noweb files

2023-12-04 Thread Tyler Smith via ESS-help
Hi,

I use cyberpunk, which is pretty usable as-is. 

However, more important, I think, than the actual theme you use, is being able 
to tweak the styling of individual faces. Once you pick a theme that is 
reasonably close to what you want, if there are bits that you don't like, you 
can easily change them. Put the cursor over the offending characters, and call 
the function `M-x describe-face`. You'll be prompted for the face you want to 
see, and the default is the face of the character under point[1] (the cursor).

The window that opens includes a link to `customize this face` at the top. 
Click that, and you'll get the interface for changing the style. The next 
window that opens will show any styles that are applied to the face in 
question. You can change that to whatever you like, and apply it to the current 
session with `C-c C-c`. To save it permanently, type `C-c C-s`. Note that you 
don't see all the possible attributes by default, only the ones that have been 
changed. To see the other options, click the `show all attributes` button.

Even with good themes, I find there are differences among displays (i.e., my 
laptop screen and my monitor) that benefit from adjusting a few of the colour 
choices.

Good luck!

Tyler

[1] Note that if you use `hl-line-mode`, you should turn it off before doing 
this, otherwise that's the face you'll be offered. If you don't use 
`hl-line-mode`, ignore this.

-- 
plantarum.ca

On Sun, Dec 3, 2023, at 5:48 PM, LaurentEss via ESS-help wrote:
> Dear ESS-list,
>
>    I tried many dark color themes to do literate programming with 
> polymode (.rnw file) but there are always some drawbacks : the color of 
> the beginning and the end of the chunks (<<>>= and @) are 
> unreadable, the color of the text when I want to see the available 
> buffers (C-x C-b) is unreadable, etc...
>
> May you please tell me the name of a color theme which works fine with 
> polymode for noweb files ?
>
> I tried to find an answer on the web without success.
>
> Thank you
>
> Best regards
>
> Laurent
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] ess, noweb and polymode

2023-11-17 Thread Tyler Smith via ESS-help
Hi Laurent,

You might need to include 

(require 'swiper)

before you run the other code.

ty

-- 
plantarum.ca

On Fri, Nov 17, 2023, at 1:43 PM, Laurent ESS via ESS-help wrote:
> Hi Tyler,
>
> Thank you for the idea, even if I would like to recover the 
> ess-noweb-goto-chunk.
>
> I installed swiper, ivy  and put the following lines in my .emacs.el:
>
> (defun my-list-chunks()
>    (interactive)
>    (swiper "<<"))
>
> (define-key polymode-map "g" #'my-list-chunks)
>
> When I do M-n g I have the message:
>
> my-list-chunks: Symbol’s function definition is void: swiper
>
>
> On 15/11/2023 21:13, Tyler Smith via ESS-help wrote:
>> Hi Laurent,
>>
>> I haven't used `ess-goto-chunk` before, but it sounds quite useful. I think 
>> you could get something similar with the `swiper` package. You can install 
>> `swiper` via `package-list-packages. It requires the `ivy` package, which 
>> should get installed automatically when you install `swiper`.
>>
>> Then you can define your own custom 'swipe'. For Rmd chunks, something like 
>> this:
>>
>> ```
>> (defun my-list-chunks ()
>>(interactive)
>>(swiper "```{"))
>>
>> (define-key polymode-map "g" #'my-list-chunks)
>> ```
>>
>> By default, `polymode-map` is bound to `M-n`, so this will call 
>> `my-list-chunks` when you hit `M-n g`.
>>
>> This displays all the matches in the minibuffer, and you can scroll through 
>> them with `C-n` and `C-p`, and hitting `enter` will take you to that chunk 
>> header. In my tests, there's something wrong with the text colours, but I 
>> don't have time to debug just now.
>>
>> Best,
>>
>> Tyler
>>
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] ess, noweb and polymode

2023-11-15 Thread Tyler Smith via ESS-help
Hi Laurent,

I haven't used `ess-goto-chunk` before, but it sounds quite useful. I think you 
could get something similar with the `swiper` package. You can install `swiper` 
via `package-list-packages. It requires the `ivy` package, which should get 
installed automatically when you install `swiper`. 

Then you can define your own custom 'swipe'. For Rmd chunks, something like 
this:

```
(defun my-list-chunks ()
  (interactive)
  (swiper "```{"))

(define-key polymode-map "g" #'my-list-chunks)
```

By default, `polymode-map` is bound to `M-n`, so this will call 
`my-list-chunks` when you hit `M-n g`. 

This displays all the matches in the minibuffer, and you can scroll through 
them with `C-n` and `C-p`, and hitting `enter` will take you to that chunk 
header. In my tests, there's something wrong with the text colours, but I don't 
have time to debug just now.

Best,

Tyler

-- 
plantarum.ca

On Wed, Nov 15, 2023, at 2:42 PM, LaurentEss via ESS-help wrote:
> Dear ESS-list,
>
>   Installing emacs to do literate programming, I have just 
> discovered that noweb-mode doesn't exist anymore. It has been replaced 
> by polymode if I well understood. So, I install from MELPA : ess, 
> polymode, poly-R, poly-markdown, poly-noweb and I placed in my .emacs.el 
> the following lines:
>
> ---
>
> (require 'poly-R)
> (require 'poly-markdown)
> (require 'poly-noweb)
>
>
> (add-to-list 'auto-mode-alist '("\\.[rR]nw" . poly-noweb+r-mode))
> (add-to-list 'auto-mode-alist '("\\.[rR]md" . poly-markdown+r-mode))
> (add-to-list 'auto-mode-alist '("\\.md$" . poly-markdown-mode))
>
> ;; Load ESS
> (load "ess-autoloads")
> -
>
> It seems to work but I don't find anymore some usefull ess-noweb 
> shortcuts. For example, I liked M-n g (binded to ess-noweb-goto-chunk)  
> which showed me all the chunks names in a ring buffer at the bottom of 
> the frame (very convenient to move in large file). Also, with the old 
> ess versions it was possible to put all the line of the begining of 
> every chunk (<< >>=) in yellow (for example) and all the line of the end 
> of the chunk (@) in blue thanks to the ess-noweb-font-lock-mode.el file 
> which was very convenient.
>
> Here are my questions:
>
> 1. Could you tell me if I didn't forget to install some emacs packages 
> to use polymode with noweb mode ?
>
> 2. If the two features described above really disappeared with yhe new 
> new version of ess with polymode, could you please give me some pointers 
> to try to get these two features in emacs ?
>
> Thank you for your advice
>
> Best regards
>
> Laurent
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] why a release from time to time would be nice

2023-10-12 Thread Tyler Smith via ESS-help
Hi Stephen,

yasnippet allows you to insert modifiable yaml templates. You can define 
'fields' that you want to modify, along with straight text that will be 
inserted verbatim. 

In my case, I enter the string 'yaml', hit the tab key, and the template is 
inserted. The cursor starts in the title field ($1), and I tab through category 
($2), excerpt ($3), tags ($4, $5), slug ($6), and finally ends in the body of 
the document ($0). 

I keep it simple, but you can use default values for fields, or define a list 
of options to pick from. In my case, I just enter the values by hand. You can 
also call elisp functions to enter computed values. I use the function 
`tws-today` to enter today's date.

The definition for this, stored in a file, is pasted below.

You can use options in the template to switch between different headers, or you 
could define different templates. For example, you could define a yamlblog 
template, a yamlmanuscript template, etc, with the defaults set to your various 
outputs.

There's a tutorial here: 
  https://github.com/joaotavora/yasnippet/blob/master/README.mdown 

and a short video here: 
  https://youtu.be/W-bRZlseNm0?si=wM-mq-HkO2wgS0or

But making a 'quick start' post specifically for ESS users would be a good 
idea. I will add it to my list, but the list is growing faster than I'm making 
posts lately!

- ty

```
# -*- mode: snippet; require-final-newline: nil -*-
# name: yamlpost
# key: yaml
# expand-env: ((yas-indent-line 'fixed))
# binding: direct-keybinding
# --
---
layout: post
title: "$1"
categories: 
  - $2
excerpt: "$3"
date: `(tws-today)`
tags:
  - $4
  - $5
slug: $6
bibliography: ../../plantarum.bib
csl: ../../american-journal-of-botany.csl
link-citations: true
---

\`\`\`{R init, echo = FALSE}
library(utils) 
library(graphics)
library(grDevices)
library(stats)
\`\`\`

$0

```
-- 
plantarum.ca

On Thu, Oct 12, 2023, at 10:35 AM, Stephen Bond wrote:
> Tyler,
>
> Happy you are lending a hand. I alternate between notebook and plain
> htmil output. this is my typical:
>
> ---
> title: "Title"
> author: "Author"
> date: "2023-10-08"
> output:
>   # html_document:
>   #   df_print: kable
>   #   mathjax: C:/emacs/MathJax.js
>   html_notebook:
> df_print: kable
> mathjax: C:/emacs/MathJax.js
> editor_options:
>   chunk_output_type: inline
> ---
>
> I am not familiar with yasnippet. Maybe that is the missing piece.
> Cheers
> Stephen
>
> On Tue, 2023-10-10 at 09:32 -0400, Tyler Smith wrote:
>> Hi Stephen,
>> 
>> Like Manuel, I also do my Rmd editing in Emacs, with ESS and polymode
>> to handle most things, and a yasnippet to insert my YAML section.
>> This covers my needs, but I'm not a very sophisticated user of YAML. 
>> 
>> What support would you like to see? Perhaps there are features you
>> aren't aware of, or if not, we might be able to come up with some
>> workable solutions. Whether or not that's an ESS issue, an polymode
>> issue, or a markdown-mode issue, remains to be seen.
>> 
>> Best,
>> 
>> Tyler
>> 
>> > On Fri, Oct 6, 2023, 10:13 Stephen Bond via ESS-help
>> > 
>> > wrote:
>> > 
>> > > Currently there is zero support for the meta/yaml section at the
>> > > beginning, which makes it inconvenient to the point I am using
>> > > Rstudio
>> > > to output my Rmd files.
>> > > 
>> 
>> On Fri, Oct 6, 2023, at 8:16 AM, Manuel Teodoro via ESS-help wrote:
>> > 
>> > I am not part of ESS team but I'm wondering what kind of problems
>> > you have
>> > with Rmd files, maybe we can give you some advices.
>> > 
>> > I do all my Rmd and Qmd files in Emacs without any problem.

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] why a release from time to time would be nice

2023-10-10 Thread Tyler Smith via ESS-help
Hi Stephen,

Like Manuel, I also do my Rmd editing in Emacs, with ESS and polymode to handle 
most things, and a yasnippet to insert my YAML section. This covers my needs, 
but I'm not a very sophisticated user of YAML. 

What support would you like to see? Perhaps there are features you aren't aware 
of, or if not, we might be able to come up with some workable solutions. 
Whether or not that's an ESS issue, an polymode issue, or a markdown-mode 
issue, remains to be seen.

Best,

Tyler

> On Fri, Oct 6, 2023, 10:13 Stephen Bond via ESS-help 
> wrote:
>
>> Currently there is zero support for the meta/yaml section at the
>> beginning, which makes it inconvenient to the point I am using Rstudio
>> to output my Rmd files.
>>

On Fri, Oct 6, 2023, at 8:16 AM, Manuel Teodoro via ESS-help wrote:
>
> I am not part of ESS team but I'm wondering what kind of problems you have
> with Rmd files, maybe we can give you some advices.
>
> I do all my Rmd and Qmd files in Emacs without any problem.

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] run R code upon starting each ESS session

2023-10-03 Thread Tyler Smith via ESS-help
On Tue, Oct 3, 2023, at 12:52 PM, Manuel Teodoro via ESS-help wrote:
> Is there a way to run R code upon starting each ESS session?
>

Hi Manuel,

ESS provides a hook you can use for this purpose. This is described in the 
manual: 

https://ess.r-project.org/Manual/ess.html#Customizing-startup

To run a custom script each time ESS starts, use something like the following:

(add-hook 'ess-r-post-run-hook (lambda () (ess-load-file "foo.R")))

- ty

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] [EXTERNAL] Re: How to Duplicate Previous Functionality/Workflow

2023-09-26 Thread Tyler Smith via ESS-help
On Tue, Sep 26, 2023, at 2:38 PM, Bassett Jr,Roland L via ESS-help wrote:
> Thanks to everyone for their responses - you've definitely helped with 
> most of my questions.  One still remains, though:
>
> How can I customize the weaver and the exporter so that it doesn't ask 
> each time?  It seems as though there should be a way to customize each 
> of these, but I can't figure out what it is.

I agree, it does seem like this ought to be customizable! I looked into the 
code a bit, and from what I can see there's no option to change it, beyond 
over-writing the existing functions.

- Tyler




>
> Roland Bassett
> Principal Biostatistician
> Department of Biostatistics - Unit 1411
> Faculty Center Tower FCT4.6071
> The University of Texas M. D. Anderson Cancer Center
> P.O. Box 301402
> Houston, TX 77230
>
> Phone: 713-563-4272
> Fax: 713-563-4242
> Email: rlbas...@mdanderson.org
>
> -----Original Message-
> From: ESS-help  On Behalf Of Tyler 
> Smith via ESS-help
> Sent: Saturday, September 23, 2023 10:38 AM
> To: Stephen J. Eglen 
> Cc: ESS-help 
> Subject: [EXTERNAL] Re: [ESS] How to Duplicate Previous 
> Functionality/Workflow
>
> THIS EMAIL IS A PHISHING RISK
>  Do you trust the sender?
> The email address is: ess-help-boun...@r-project.org
> While this email has passed our filters, we need you to review with 
> caution before taking any action.
> If the email looks at all suspicious, click the Report a Phish 
> button.
>
> On Fri, Sep 22, 2023, at 2:04 AM, Stephen J. Eglen wrote:
>>> (You probably didn't do this, because Docview isn't great for pdfs.
>>> The now abandoned package pdf-tools was a great option for reading
>>> pdfs inside Emacs).
>>
>> just to add a couple of comments:
>>
>> 1. pdf-tools was forked about 1-2 years ago, and now active at:
>>
>> https://urldefense.com/v3/__https://github.com/vedang/pdf-tools__;!!Pf
>> beBCCAmug!hJB8MImjmlLQXcAB-LAswXJZi7hbkrS4q5t30Qi2hgkPBMiYQFEMW4gXbr-6
>> hVAcqLnnAh9bX0OFHLbHRmIz8Hs$
>>
>> It can be a bit fussy to install compared to most Emacs packages,
>> because of dependencies and the binaries it creates.  However, I like
>> it and use it regularly.
>>
>
> Thanks, that's great news!  pdf-tools was my preferred pdf viewer when 
> it was active. I'll definitely check out the new fork
>
> ty
>
> __
> ESS-help@r-project.org mailing list
> https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/ess-help__;!!PfbeBCCAmug!hJB8MImjmlLQXcAB-LAswXJZi7hbkrS4q5t30Qi2hgkPBMiYQFEMW4gXbr-6hVAcqLnnAh9bX0OFHLbH1kUWylg$
>
> The information contained in this e-mail message may be ...{{dropped:11}}
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] How to Duplicate Previous Functionality/Workflow

2023-09-23 Thread Tyler Smith via ESS-help
On Fri, Sep 22, 2023, at 2:04 AM, Stephen J. Eglen wrote:
>> (You probably didn't do this, because Docview isn't great for
>> pdfs. The now abandoned package pdf-tools was a great option for
>> reading pdfs inside Emacs).
>
> just to add a couple of comments:
>
> 1. pdf-tools was forked about 1-2 years ago, and now active at:
>
> https://github.com/vedang/pdf-tools
>
> It can be a bit fussy to install compared to most Emacs packages,
> because of dependencies and the binaries it creates.  However, I like it
> and use it regularly.
>

Thanks, that's great news!  pdf-tools was my preferred pdf viewer when it was 
active. I'll definitely check out the new fork 

ty

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] How to Duplicate Previous Functionality/Workflow

2023-09-21 Thread Tyler Smith via ESS-help
On Thu, Sep 21, 2023, at 9:43 PM, Bassett Jr,Roland L via ESS-help wrote:
>
>   1.  How can I customize the exporter to use my preferred PDF viewer 
> (evince) instead of DocView?

I think the current default is for Emacs to open the exported file itself. To 
change this, you need to configure Emacs to send pdf files to an external 
program to open. You can do this with the `openwith` package:

  (require 'openwith)
  (openwith-mode t)
  (setq openwith-associations '(("\\.pdf\\'" "evince" (file

You'll need to install `openwith`. It's available on Melpa 
(https://melpa.org/#/?q=openwith). 

Note this will make Emacs do this for all pdf files, not just ones from 
polymode. So if you use Docview to open pdf files in other contexts, this won't 
work anymore. 

(You probably didn't do this, because Docview isn't great for pdfs. The now 
abandoned package pdf-tools was a great option for reading pdfs inside Emacs).

See also: 

https://emacs.stackexchange.com/questions/3105/how-to-use-an-external-program-as-the-default-way-to-open-pdfs-from-emacs

- ty

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] How to Duplicate Previous Functionality/Workflow

2023-09-21 Thread Tyler Smith via ESS-help
On Thu, Sep 21, 2023, at 9:43 PM, Bassett Jr,Roland L via ESS-help wrote:
>   2.  Different topic, but how can I duplicate the functionality of the 
> "_" key to insert "<-" instead of just "_"?

That feature is now called `ess-insert-assign`, and you need to bind it to the 
`_` key yourself. From the example in the manual:

  (define-key ess-r-mode-map "_" #'ess-insert-assign)
  (define-key inferior-ess-r-mode-map "_" #'ess-insert-assign)

I think this is only documented on the *New Features* page of the manual now, 
which I never think to check when I'm looking for things.

- ty

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Emacs, ESS and Rmarkdown: Is this the way compile is supposed to work?

2023-04-21 Thread Tyler Smith via ESS-help
Hi Kevin,

If you have an older version of `poly-R`, the function `poly-gfm+r-mode` might 
not be present. This was added to `poly-R` dev in July 2021, I'm not sure 
exactly when it would have been added to the released version.

If that's the case, updating to the current version of `poly-R` should fix the 
problem.

Alternatively, you need the following code evaluated *after* `(require 
'poly-R)` and *before* `(add-to-list ...)`:

```
(define-polymode poly-gfm+r-mode poly-markdown+r-mode 
  :lighter " PM-Rmd(gfm)"
  :hostmode 'poly-gfm-hostmode)
```

But that really shouldn't be necessary.

Best,

Tyler
-- 
plantarum.ca

On Fri, Apr 21, 2023, at 10:58 AM, Kevin Zembower via ESS-help wrote:
> Tyler, thanks for your response. I had found your website while 
> searching for a solution to my problem.
>
> Currently, I have this in my .emacs.d/init.el file:
> (setq load-path (append '("~/.emacs.d/polymode/" 
> "~/.emacs.d/polymode/modes") load-path))
> (require 'poly-R)
> (require 'poly-markdown)
> (add-to-list 'auto-mode-alist '("\\.Rmd" . poly-markdown+r-mode))
>
> This has been working for me without error so far.
>
> I commented out the last line and added this one:
> (add-to-list 'auto-mode-alist
>'("\\.[rR]md\\'" . poly-gfm+r-mode))
>
> When I save my init.el file and restart Emacs with a .Rmd file, I get 
> this error message:
>
> File mode specification error: (void-function poly-gfm+r-mode)
> Package cl is deprecated
>
> I'm using GNU Emacs 27.1, with rmarkdown 2.21. I'm not able to install 
> or find a poly-R or polymode package for this version of R
>
> Any ideas what I'm doing wrong? Thanks for any help and guidance.
>
> -Kevin
>
>
> On 4/21/23 06:00, ess-help-requ...@r-project.org wrote:
>> Message: 2
>> Date: Thu, 20 Apr 2023 13:55:19 -0400
>> From: "Tyler Smith"
>> To: ESS-help
>> Subject: Re: [ESS] Fwd: Emacs, ESS and Rmarkdown: Is this the way
>>  compile is supposed to work?
>> Message-ID:<98fe4222-3e4f-408a-8773-bde2cf87b...@app.fastmail.com>
>> Content-Type: text/plain; charset="us-ascii"
>> 
>> Hi Kevin,
>> 
>> You should be able to do what you want directly from the `.Rmd` buffer. I 
>> posted a tutorial here:
>> 
>> https://plantarum.ca/2021/10/03/emacs-tutorial-rmarkdown/
>> 
>> With the right packages installed, from the .Rmd buffer you can export your 
>> file with `M-n e`, select `markdown` and `html` when prompted, and the html 
>> will be generated and opened in a web browser.
>> 
>> The tutorial walks you through the steps in more detail.
>> 
>> Best,
>> 
>> Tyler
>> 
>> -- plantarum.ca
>
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Fwd: Emacs, ESS and Rmarkdown: Is this the way compile is supposed to work?

2023-04-20 Thread Tyler Smith via ESS-help
Hi Kevin,

You should be able to do what you want directly from the `.Rmd` buffer. I 
posted a tutorial here:

https://plantarum.ca/2021/10/03/emacs-tutorial-rmarkdown/

With the right packages installed, from the .Rmd buffer you can export your 
file with `M-n e`, select `markdown` and `html` when prompted, and the html 
will be generated and opened in a web browser.

The tutorial walks you through the steps in more detail.

Best,

Tyler

-- 
plantarum.ca

On Thu, Apr 20, 2023, at 12:11 PM, Kevin Zembower via ESS-help wrote:
> Thanks to Dirk Eddelbuettel's suggestion of his render.r executable, I 
> was able to boil it down to the commands I need to render the Rmarkdown.
>
> I run this _once_ in the R console window of Emacs running ESS:
> library(rmarkdown)
>
> Then, everytime I want to update the document I'm working on, I run:
> render("working_file.Rmd")
>
> For me, that outputs an HTML document, that I view in my browser.
>
> I feel certain that there's a better, easier way to do this, in the 
> Emacs/ESS/poly-R/Rmarkdown system, but this is what I needed to get me 
> unstuck, and until I have some time to spare, this is as far as I'm 
> taking it.
>
> Thanks, again, for the help.
>
> -Kevin
>
>
>  Forwarded Message 
> Subject: Emacs, ESS and Rmarkdown: Is this the way compile is supposed 
> to work?
> Date: Sat, 15 Apr 2023 15:21:26 -0400
> From: Kevin Zembower 
> To: ess-help@r-project.org
>
> I'm trying to get Emacs, ESS and Rmarkdown to work together for the 
> first time. Therefore, the problem might be me, and not the software.
>
> I have this program as Prob_11.Rmd:
> ==
> ---
> title: "Problem 11, Page 414"
> author: "Kevin"
> date: "13 Apr 2023"
> output: html_document
> ---
>
> ### Load the sample data ###
>
> Loading the sample data table into two vectors:
>
> ``` {r}
>
> (age11 <- c(18, 10, 3, 15, 12, 14, 15, 4, 20, 8))
>
> (age16 <- c(6, 7, 14, 5, 14, 12, 3, 9, 4, 7))
>
> ```
> 
>
> I get this as output after choosing Markdown->Preview & Export->Compile:
> =
> 
>   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
>
> http://www.w3.org/1999/xhtml;>
>
> 
> *markdown-output*
> 
>
> 
>
> 
>
> Load the sample data
> Loading the sample data table into two vectors:
> 
> (age11 - c(18, 10, 3, 15, 12, 14, 15, 4, 20, 8))
>
> (age16 - c(6, 7, 14, 5, 14, 12, 3, 9, 4, 7))
> 
>
> 
> 
> ==
>
> This looks correct, except that I was expecting the last two lines to 
> look like:
>
>> (age11 <- c(18, 10, 3, 15, 12, 14, 15, 4, 20, 8))
>   [1] 18 10  3 15 12 14 15  4 20  8
>> (age16 <- c(6, 7, 14, 5, 14, 12, 3, 9, 4, 7))
>   [1]  6  7 14  5 14 12  3  9  4  7
>
> Am I doing something wrong? Am I misunderstanding what RMarkdown is 
> doing? I tried options like 'echo=TRUE' and 'eval=TRUE' without success.
>
> Thanks for any advice or guidance. I posted this request on 
> stackoverflow.com, at 
> https://stackoverflow.com/questions/76014830/emacs-ess-and-rmarkdown-is-this-the-way-compile-is-supposed-to-work,
>  
> but didn't get any response.
>
> -Kevin
>
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Emacs 28 and Sweave files

2022-09-22 Thread Tyler Smith via ESS-help
Hi,

I just noticed that this question has an answer on emacs.stackexchange that 
might be helpful:

https://emacs.stackexchange.com/questions/17063/how-to-setup-knitr-workflow-in-emacs/17065#17065

Tyler

-- 
plantarum.ca

On Sun, Sep 11, 2022, at 10:42 AM, Tyler Smith via ESS-help wrote:
> Hi,
>
> That's my tutorial, I'm glad it's been of some use! However, it's very 
> explicitly targeted at RMarkdown files (.rmd). The details will differ 
> for LaTeX (.Rnw files), although the general approach is quite similar. 
> I'll try to update it to cover both, but I haven't used .Rnw in a few 
> years now 
>
> Best,
>
> Tyler
>
> -- 
> plantarum.ca
>
> On Sun, Sep 11, 2022, at 10:24 AM, Stephen Bond via ESS-help wrote:
>> I am trying to help even though I know little:
>>
>> I used the approach in 
>> https://plantarum.ca/2021/10/03/emacs-tutorial-rmarkdown/
>>> The main function you need for this is polymode-export, bound to M-n
>>> e.
>>> 
>>> The first time you run this, you’ll be asked which exporter you would
>>> like to use. There are two choices, markdown and markdown-ess.
>>
>> So, if you choose markdown it will ask for format and then you can type
>> pdf or html, it will weave and then look for pandoc. I have this in my
>> .emacs
>>
>>  '(markdown-command
>>(concat "pandoc" " --from=markdown --to=html" " --standalone --
>> mathjax --highlight-style=pygments"))
>>
>> You can see that it ignores the to=html and asks me every time. It also
>> igonres the title section, where I specify the output format. So, it
>> looks like polymode does not know how to read the title/yaml, but that
>> is not a big deal as you can set that in the dialog after M-n e
>>
>> Cheers
>> Stephen
>>
>> On Wed, 2022-09-07 at 17:03 -0400, Vincent Goulet via ESS-help wrote:
>>> Hi all,
>>> 
>>> A large part of my work in Emacs involves editing Sweave (.Rnw)
>>> files. I was very much used to the tried, tested and true ess-noweb
>>> mode for this purpose.
>>> 
>>> Now, in the development version of ESS that is required for Emacs 28,
>>> all the noweb stuff was gutted out and we're told to use polymode
>>> instead. For one thing, I think it's a pity that such fundamental
>>> interaction between R and Emacs (wasn't the whole concept of Sweave
>>> based off Emacs functionality?) is no longer part of ESS. I'd
>>> certainly vote for the return of noweb files support. (I understand
>>> that polymode brought improved support for RMarkdown files.)
>>> 
>>> I'm probably late to the party, but can anyone give me a primer on
>>> polymode for Rnw files? (Not Rmd files, some oldies like me still
>>> rely on LaTeX and Sweave -- not even knitr!)
>>> 
>>> I followed the polymode installation instructions and added the
>>> 'mode: poly-noweb' file variable to a .Rnw file. If I do 'M-n w' or
>>> 'M-n e' (what's the difference?), I'm first asked to select a weaver
>>> or an exporter. What's the answer? Pressing TAB does not offer any
>>> choice.
>>> 
>>> What if I just want to compile the LaTeX file? In Emacs 27, ESS was
>>> connected to AUCTeX and the weave step was integrated into the
>>> compilation step (C-c C-c). Anything as streamlined with polymode?
>>> 
>>> I also stumble into the following issues. First, as soon as I try to
>>> do anything in a .Rnw file, I get these error messages:
>>> 
>>> Error during redisplay: (internal--syntax-propertize 2) signaled
>>> (error "Variable binding depth exceeds max-specpdl-size")
>>> Error running timer ‘show-paren-function’: (error "internal--syntax-
>>> propertize did not move syntax-propertize--done")
>>> 
>>> Second, I ended up a few times with the following markers at the end
>>> of the file name in the modeline and in the mode display: HeadTail.
>>> I'm not too sure how to reproduce, but does this ring any bell here?
>>> 
>>> System info: 
>>> Emacs Modified for macOS 28.1-modified-1, based on
>>> GNU Emacs 28.1 (build 1, aarch64-apple-darwin21.1.0, NS appkit-
>>> 2113.00 Version 12.0.1 (Build 21A559)) of 2022-05-11
>>> polymode 0.2.2 installed through MELPA
>>> 
>>> Thanks in advance!
>>> 
>>> v.
>>> __
>>> ESS-help@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/ess-help
>>
>> __
>> ESS-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] github flavor

2022-02-13 Thread Tyler Smith via ESS-help

Hello Stephen,

The function `poly-gfm+r-mode` is defined in the `poly-R` library. 
It needs to be loaded before you can call it. The following 
addition to your code should do it:


```
(require 'poly-R)

(add-to-list 'auto-mode-alist
'("\\.[rR]md\\'" . poly-gfm+r-mode))
```

As long as the `(require 'poly-R)` line comes before you actually 
try to open an Rmarkdown file, the specific location doesn't 
really matter.


I'll update the tutorial. Whether or not (and when) the `require` 
command is needed does depend on how you have installed 
`polymode`. I think when I originally wrote this I had set up the 
package system to load it automatically, which is why I don't 
provide instructions to do it explicitly in the tutorial.


Best,

Tyler

On Sat, Feb 12 2022, Stephen Bond via ESS-help wrote:


Hello,

I am trying to activate the github flavor by:

(add-to-list 'auto-mode-alist
 '("\\.[rR]md\\'" . poly-gfm+r-mode))

as described in 
https://plantarum.ca/2021/10/03/emacs-tutorial-rmarkdown/


and get an error:
File mode specification error: (void-function poly-gfm+r-mode)

I have the following in my .emacs

(defun rmd-mode ()
  "ESS Markdown mode for rmd files"
  (interactive)
  ;; (setq load-path
  ;;   (append (list "path/to/polymode/" 
  "path/to/polymode/modes/")

  ;;   load-path))
  (require 'poly-R)
  (require 'poly-markdown) 
  (poly-markdown+r-mode))

(add-to-list 'auto-mode-alist '("\\.md" . poly-markdown-mode))
(add-to-list 'auto-mode-alist '("\\.Snw" . poly-noweb+r-mode))
(add-to-list 'auto-mode-alist '("\\.Rnw" . poly-noweb+r-mode))
;; I commented out to emable gfm, markdown+r works
;;(add-to-list 'auto-mode-alist '("\\.Rmd" . 
poly-markdown+r-mode))

;; associate the new polymode to Rmd files:
(add-to-list 'auto-mode-alist
 '("\\.[rR]md\\'" . poly-gfm+r-mode))

(custom-set-variables
'(markdown-command
   (concat "pandoc" " --from=markdown --to=html" " --standalone 
   --

mathjax --highlight-style=pygments"))
 '(org-agenda-files '("~/1.org"))
 '(package-selected-packages '(markdown-mode poly-R 
 poly-markdown poly-

org polymode ess))
 '(poly-pandoc-exporter
   #s(pm-shell-exporter unbound "pandoc" nil nil nil 
   pm-default-shell-

export-function pm-default-shell-export-sentinel nil)))

I am afraid there is a conflict somewhere.
Please, advise how to cleanup my setup.
Thanks
Stephen

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help



--
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] view documentation while developing a package

2022-02-07 Thread Tyler Smith via ESS-help
Hi,

I am working on a package using devtools. I recall in the past that when I 
loaded a package via `devtools::load_all` (or now via `C-c C-w l`), I could 
preview the documentation as if it was a normally installed package. i.e, `C-c 
C-v`, or ?functionname would bring up a regular help window.

However, this hasn't worked for me for a while, and now I wonder if it ever did?

For example, if I open an R process in the root directory of a package, and 
load the package via load_all(), pressing `C-c C-v` shows me a completion list 
for R help pages, including the help pages in the package from the current 
directory. But if I select one of those help files, I get the message 'can't 
find the documentation for '. I can still open help files for other 
packages.

Should this work? If it should, what do I need to do to configure it?

I've tried using the functions from `ess-r-package-mode` as well as running the 
related commands (load_all, document) directly from the R command line in ESS. 
Neither works for me.

Best,

Tyler
Emacs 29.0.50
ESS 18.10.3 (from melpa)
R 4.1.2 (Ubuntu)


-- 
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] .Rdata not loading

2021-12-23 Thread Tyler Smith via ESS-help

Hi Rich,

ESS doesn't load data. All it does is pass commands to R. It looks 
like the command is getting successfully passed to R, so ESS is 
not likely the problem. You can confirm this by running the code 
in an R terminal (i.e., outside of Emacs). If the file still won't 
load, then you can rule out ESS as the problem.


If this is true, then the problem is with R or your .Rdata file. 
One plausible explanation from stackoverflow[1] is that your 
.Rdata file, being quite large, may not have completely saved 
before R quit last time you used it. If that's the case, there may 
be no solution other than re-generating the data from scratch.


Another possibility is your .Rdata was created by a version of R 
that's different from the one you're using today. That sounds 
unlikely since you haven't manually updated your R version. Is it 
possible an automatic update happened over night? You could 
recover from this by re-installing the previous version of R. 


Good luck!

Tyler

[1]https://stackoverflow.com/questions/57065994/readitem-unknown-type-64-perhaps-written-by-later-version-of-r

On Thu, Dec 23 2021, Rich Shepard via ESS-help wrote:


On Thu, 23 Dec 2021, Rich Shepard via ESS-help wrote:

Just now I upgraded ess-17.11 to ess-18.10.2. RData still 
doesn't load.


I re-installed R-4.1.2 and when I started ESS it still showed 
17.11 rather

than the newly upgraded 18.10.2.

I'm stymied, beyond my R and ESS knowledge, and need to get some 
work done

ASAP. Help's needed.

Rich

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help



--
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] .Rdata not loading

2021-12-23 Thread Tyler Smith via ESS-help
That doesn't look like a problem with ESS - can you load .Rdata from R running 
in a terminal,  outside of emacs?

-- 
plantarum.ca

On Thu, Dec 23, 2021, at 12:59 PM, Rich Shepard via ESS-help wrote:
> On Thu, 23 Dec 2021, Tyler Smith wrote:
>
>> Have you recently updated R? The error message suggests the .Rdata file was 
>> created by a different version of R than the one you are currently running.
>
> Tyler,
>
> Just now I upgraded ess-17.11 to ess-18.10.2. RData still doesn't load.
>
> Rich
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] .Rdata not loading

2021-12-23 Thread Tyler Smith via ESS-help

Hi Rich,

Have you recently updated R? The error message suggests the .Rdata 
file was created by a different version of R than the one you are 
currently running.


Best,

Tyler

On Thu, Dec 23 2021, Rich Shepard via ESS-help wrote:

I use R with emacs and ESS. Each time I finish with a session I 
save the
image. Today when I invoke ESS the saved image did not load and 
manually

running 'load('.RData') fails:

load('.RData')

Error in load(".RData") :
  ReadItem: unknown type 0, perhaps written by later version of 
  R




This has not happed before.

Installed is R-4.1.2-x86_64-1_SBo and in the PWD I see:
$ ll .RData*
-rw-r--r-- 1 rshepard users 28074080 Dec 22 15:32 .RData
-rw-r--r-- 1 rshepard users  134 Nov  4 14:57 .RDataTmp
-rw-r--r-- 1 rshepard users0 Nov  4 14:57 .RDataTmp1

What might be keeping .RData from loading?

How do I load it?

TIA,

Rich

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help



--
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] emacs-ess and the dreaded dotemacs file

2021-10-19 Thread Tyler Smith via ESS-help
I didn't receive your attachment, I think the mailing list drops them?

The error you're getting indicates you have unbalanced parentheses (too many 
closing parentheses). That's an easy thing to do when copying and pasting code, 
and may be a side effect of some other issue.

Best,

Tyler

-- 
plantarum.ca

On Tue, Oct 19, 2021, at 5:03 AM, Mark Leeds via ESS-help wrote:
> Hi All: Would anyone mind doing me a big favor and fixing any ( even one is
> great )  problems in my current dotemacs file. I was able to get some of it
> to run but when it hits the auto-complete section, I start having all kinds
> of problems. For most of it, ( from the auto-complete section and on ),  I
> just copied the dotemacs file used at the link below ( the www.code.rd.com
> link ) . But things either changed dramatically since that link was created
> or the author is maybe not showing the whole file ?
>
> I'm lisp illiterate which obviously doesn't help. I use ubuntu but I doubt
> that matters.
>
> This all sounded like a good idea when I started it  but now its  been
> three days and I'm still not terribly far. Thanks to Rich Heiberger who was
> influential in getting the top part to work before it hits the
> auto-complete section. The dotemacsfile is
> attached. Note that the code in the dotemacsfile with all the semi-colons
> is the code from the link here. I don't see any typos but I could be
> mistaken.  Or
> maybe the link itself has typos ? Thanks so much for help in any way.
>
> https://www.codetd.com/en/article/8181443
>
> #===
> # ERROR THAT emacs --debug-init temp.R GIVES BUT I DOUBT THAT'S  THE ONLY
> ONE
> #===
> Debugger entered--Lisp error: (invalid-read-syntax ")")
>   eval-buffer(# nil "/home/markleeds/.emacs" nil t)  ;
> Reading at buffer position 432
>   load-with-code-conversion("/home/markleeds/.emacs"
> "/home/markleeds/.emacs" t t)
>   load("~/.emacs" t t)
>   #[0 " \205\262
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-10-03 Thread Tyler Smith via ESS-help



Chris Evans  writes:

Just one thing that may chime with the ongoing discussion that 
my post seems to have 
seeded: I wouldn't know how to handle "You'll need new versions 
of poly-R (updated 29
September 2021) and markdown-mode (updated 6 January 2021)" and 
I never got my head 
around what melpa is.  


The end of that section includes the line:

"As in previous tutorials, we can install all three of these 
packages from [MELPA](https://melpa.org/#/)."


The previous tutorial is available on my blog:

https://plantarum.ca/2020/12/30/emacs-tutorial-03/

And on youtube:

https://www.youtube.com/watch?v=So1LYzSk9o0

I've updated the post to point directly to these locations. You'll 
find explicit instructions on how to install packages from Melpa 
at either location.


Best,

Tyler

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-10-01 Thread Tyler Smith via ESS-help

Hello Chris,

Here is the Rmd tutorial I've been working on: 
https://github.com/ess-intro/presentation-rmarkdown/blob/master/presentation-rmarkdown.Rmd


I've just updated it to incorporate some simplifications in 
configuration that I've been working on with the Polymode 
developer Vitalie Spinu. You'll need new versions of poly-R 
(updated 29 September 2021) and markdown-mode (updated 6 January 
2021) to use this as-is. With those completed, there's no further 
reason to procrastinate on turning this into a video, so I guess 
that's coming soon now too!


Best,

Tyler

Chris Evans via ESS-help  writes:

I am having problems with long Rmd files (and large data, long 
processing times) in Rstudio. (Sorry, yes, I use Emacs for 
things and 
ESS when I'm working with R (but rarely Rmd files) on a server, 
but I use Rstudio routinely "at home".) This has made me decide 
it's 

http://johnstantongeddes.org/open%20science/2014/03/26/Rmd-polymode.html 

looked pretty straightforward but I thought I should ask here if 
any changes since 2014 might make that too historical, perhaps 
not
as I couldn't find much that was recent on the topic of ESS and 
Rmd.  However, before I mess with an Emacs/ESS that works just 
fine

currently, I thought I'd ask here.

I'm running on Ubuntu 20.04 "at home" and Debian (4.19.152-1 
(2020-10-18) in case it matters) on the server (and might as 
well 
set things up on both if it's easy).


Any advice will be gratefully received (and, who knows, might 
even tempt me back to Emacs/ESS for much more of what I'm 
doing!)


TIA,

Chris


--
Tyler Smith
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-19 Thread Tyler Smith via ESS-help
Hi,

Polymode went through a major overhaul which I think was after 2014, so that 
blog post may be outdated. The overhaul made polymode much easier to use, such 
that there's very little config needed to get it set up. I wrote a tutorial 
describing my Rmd workflow in the past year for Dirk's ESS Intro series which 
you might find useful. Unfortunately I can't find the link just now, as I'm at 
the cottage with very sporadic network connection.

Best, 

Tyler

-- 
plantarum.ca

On Sun, Sep 19, 2021, at 2:33 AM, Chris Evans via ESS-help wrote:
> I am having problems with long Rmd files (and large data, long 
> processing times) in Rstudio. (Sorry, yes, I use Emacs for things and 
> ESS when I'm working with R (but rarely Rmd files) on a server, but I 
> use Rstudio routinely "at home".) This has made me decide it's 
> 
> http://johnstantongeddes.org/open%20science/2014/03/26/Rmd-polymode.html 
> 
> looked pretty straightforward but I thought I should ask here if any 
> changes since 2014 might make that too historical, perhaps not
> as I couldn't find much that was recent on the topic of ESS and Rmd.  
> However, before I mess with an Emacs/ESS that works just fine
> currently, I thought I'd ask here.
> 
> I'm running on Ubuntu 20.04 "at home" and Debian (4.19.152-1 
> (2020-10-18) in case it matters) on the server (and might as well 
> set things up on both if it's easy).
> 
> Any advice will be gratefully received (and, who knows, might even 
> tempt me back to Emacs/ESS for much more of what I'm doing!)
> 
> TIA,
> 
> Chris
> 
> -- 
> Chris Evans (he/him)  Visiting Professor, University 
> of Sheffield and UDLA, Quito, Ecuador
> I do some consultation work for the University of Roehampton 
>  and other places
> but  remains my main Email address.  I have a work 
> web site at:
>https://www.psyctc.org/psyctc/
> and a site I manage for CORE and CORE system trust at:
>http://www.coresystemtrust.org.uk/
> I have "semigrated" to France, see: 
>https://www.psyctc.org/pelerinage2016/semigrating-to-france/ 
>
> https://www.psyctc.org/pelerinage2016/register-to-get-updates-from-pelerinage2016/
> 
> If you want an Emeeting, I am trying to keep them to Thursdays and my 
> diary is at:
>https://www.psyctc.org/pelerinage2016/ceworkdiary/
> Beware: French time, generally an hour ahead of UK.
> 
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] [OT] Enabled a hook and no longer find which

2021-08-02 Thread Tyler Smith via ESS-help
On Mon, Aug 2, 2021, at 6:20 PM, Dirk Eddelbuettel via ESS-help wrote:
> 
> But in one of the instrumented repos, as soon as I updated files src/ the
> files GTAGS and GRTAGS.  

Can you reproduce the problem after starting Emacs via `emacs -Q`? That would 
confirm the problem is not in your Emacs config. Or confirm that it is, if the 
problem isn't reproduced.

If it's not in your config it would have to be in a dir-local or file-local 
variable, or completely outside emacs (can you reproduce by editing files in 
another editor?). 

If it is in your config, can you post it somewhere?


Tyler

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] [OT] Enabled a hook and no longer find which

2021-07-30 Thread Tyler Smith via ESS-help
On Fri, Jul 30, 2021, at 1:56 PM, Dirk Eddelbuettel via ESS-help wrote:
> 
> tl;dr: I enabled an action 'on save' and I no longer find where :-/

Maybe check the values of before-save-hook and after-save-hook while visiting 
one of the files this problem applies to? You might find a function name you 
can grep for in your config. 

If it's only in certain directories, check if there is a `.dir-locals.el` file 
in that directory (or one of its parents).

Good luck!

Tyler

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] ess-pdf-viewer-pref no longer used?

2021-07-29 Thread Tyler Smith via ESS-help

Hi,

I have ess-pdf-viewer-pref set to "emacsclient". This used to have 
the effect of opening pdfs in Emacs. It doesn't work anymore, and 
pdfs opened from ESS (e.g. vignettes) are now opened in the 
default pdf program for my OS (which is Evince on my machine).


Searching the code, the varaible `ess-pdf-viewer-pref` no longer 
exists, except for a few mentions in the changelog. None of the 
mentions indicate it has been deprecated. I didn't find any 
reference to pdfs in the manual either.


What is the current way to configure which programs are used to 
open pdfs from ESS?


Best,

Tyler

--
Tyler Smith
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Polymode keymap error

2021-03-09 Thread Tyler Smith via ESS-help
Yes, no errors. I had to include all the dependencies to get it to 
work:


```

(setq package-load-list
 '((use-package t)
(bind-key t)
(polymode t)
(poly-R t)
(poly-markdown t)
(poly-noweb t)
(markdown-mode t)
(ess t)
(julia-mode t)))
(package-initialize)

(require 'use-package)

(use-package polymode
 :ensure t)

(use-package poly-R
 :after polymode
 :ensure t)

(use-package poly-markdown
 :after polymode
 :mode
 ("\\.Rmd\\'" . poly-markdown+R-mode)
 :ensure t)

```

John Haman writes:

Tyler, thanks, I'll try to reproduce your example when I get 
home tonight.


In the meantime, can you try your code without the defer 
keywords and confirm the absence of an error?


Thanks,
John

On Tue, Mar 9, 2021, at 10:22 AM, Tyler Smith wrote:
I can't reproduce your problem. I tried opening `emacs -Q`, 
then 
running the following code. It works without any error. Is this 
enough to cause the error on your system? If not, there's 
something else in your config creating the issue:



```
(setq package-load-list
  '((use-package t)
(bind-key t)))
(package-initialize)

(require 'use-package)

(use-package polymode
  :defer t
  :ensure t)

(use-package poly-R
  :defer t
  :after polymode
  :ensure t)

(use-package poly-markdown
  :defer t
  :after polymode
  :mode
  ("\\.Rmd\\'" . poly-markdown+R-mode)
  :ensure t)

```


John Haman writes:

> Thanks, I've been using this use-package declaration for some 
> time (with a few of my custom functions omitted for brevity)

>
> (use-package polymode
>   :defer t
>   :ensure t)
>
> (use-package poly-R
>   :defer t
>   :after polymode
>   :ensure t)
>
> (use-package poly-markdown
>   :defer t
>   :after polymode
>   :mode
>   ("\\.Rmd\\'" . poly-markdown+R-mode)
>   :ensure t)
>
>
>
> On Mon, Mar 8, 2021, at 10:32 PM, Tyler Smith wrote:
>> Can you show us your Emacs config, or at least the 
>> use-package 
>> expression you use for poly-mode?
>> 
>> Best,
>> 
>> Tyler
>> 
>> John Haman via ESS-help writes:
>> 
>> > I'm having an issue with Poly-R or poly-markdown. When I 
>> > start 
>> > up my 
>> > Emacs installation, I get a strange error about a keymap:

>> >
>> > Error (use-package): poly-markdown/:catch: Symbol’s value 
>> > as 
>> > variable is 
>> > void: keymap Disable showing Disable logging

>> >
>> > I have no issues loading polymode, but either of poly-R or 
>> > poly-markdown 
>> > triggers the error.

>> >
>> > Thanks everyone.
>> >
>> > The traceback is below.
>> >
>> > Debugger entered--Lisp error: (void-variable keymap)
>> > byte-code("\306\307!\210\310\311!\210\312\313\10!\203\23\0\10\202O\0\313\10!\203\35\0\314\202E\0\315\11J!\2036\0\316\10\11J\"\317\n\2@\"\20\211A\262..." 
>> > [keymap parent keylist parent-conf polymode-minor-mode-map 
>> > parent-conf-name make-variable-buffer-local 
>> > poly-markdown-mode 
>> > makunbound poly-markdown-mode-map (lambda (def-tmp-var) 
>> > (defvar 
>> > poly-markdown-mode-map def-tmp-var "Keymap for 
>> > poly-markdown-mode.")) 
>> > keymapp nil eieio-object-p 
>> > pm--get-keylist\.keymap-from-parent 
>> > append 
>> > derived-mode-map-name eieio-oref -minor-mode 
>> > easy-mmode-define-keymap 
>> > :inherit poly-markdown-polymode (lambda (def-tmp-var) 
>> > (defvar 
>> > poly-markdown-polymode def-tmp-var "Configuration object 
>> > for 
>> > `poly-markdown-mode' poly...")) clone :name 
>> > "poly-markdown-polymode" 
>> > :innermodes (poly-markdown-fenced-code-innermode 
>> > poly-markdown-displayed-math-innermode 
>> > poly-markdown-inline-math-innermode 
>> > poly-markdown-yaml-metadata-innermode) :hostmode 
>> > poly-markdown-hostmode 
>> > pm-polymode defalias #f(compiled-function ( arg) 
>> > "nil\n\n\\{poly-markdown-mode-map}" (interactive nil) 
>> > #>> > 0x141a4722905af83a>) add-minor-mode " PM" add-to-list 
>> > auto-mode-alist 
>> > ("\\.md\\'" . poly-markdown-mode)] 11)

>> >require(poly-markdown nil t)
>> >(not (require 'poly-markdown nil t))
>> >(if (not (require 'poly-markdown nil t)) 
>> >(display-warning 
>> > 'use-package (format "Cannot load %s" 'poly-markdown) 
>> > :error) 
>> > (use-package-statistics-gather :config 'poly-markdown nil) 
>> > (use-package-statistics-gather :config 'poly-markdown t))
>> >(progn (use-package-statistics-gather :init 
>> >'poly-markdown 
>> >nil) (if 
>> > (not (require 'poly-markdown nil t)) (display-warning 
>> > 'use-package 
>> > (format "Cannot load %s" 'poly-markdown) :error) 
>> > (use-package-statistics-gather :config 'poly-markdown nil) 
>> > (use-package-statistics-gather :config 'poly-markdown t)) 
>> > (use-package-statistics-gather :init 'poly-markdown t))
>> >(closure (t) nil (progn (use-package-statistics-gather 
>> >:init 
>> > 'poly-markdown nil) (if (not (require 'poly-markdown nil 
>> > t)) 
>> > (display-warning 'use-package (format "Cannot load %s" 
>> > 'poly-markdown) 
>> > :error) (use-package-statistics-gather :config 
>> > 

Re: [ESS] Polymode keymap error

2021-03-09 Thread Tyler Smith via ESS-help
I can't reproduce your problem. I tried opening `emacs -Q`, then 
running the following code. It works without any error. Is this 
enough to cause the error on your system? If not, there's 
something else in your config creating the issue:



```
(setq package-load-list
 '((use-package t)
(bind-key t)))
(package-initialize)

(require 'use-package)

(use-package polymode
 :defer t
 :ensure t)

(use-package poly-R
 :defer t
 :after polymode
 :ensure t)

(use-package poly-markdown
 :defer t
 :after polymode
 :mode
 ("\\.Rmd\\'" . poly-markdown+R-mode)
 :ensure t)

```


John Haman writes:

Thanks, I've been using this use-package declaration for some 
time (with a few of my custom functions omitted for brevity)


(use-package polymode
  :defer t
  :ensure t)

(use-package poly-R
  :defer t
  :after polymode
  :ensure t)

(use-package poly-markdown
  :defer t
  :after polymode
  :mode
  ("\\.Rmd\\'" . poly-markdown+R-mode)
  :ensure t)



On Mon, Mar 8, 2021, at 10:32 PM, Tyler Smith wrote:
Can you show us your Emacs config, or at least the use-package 
expression you use for poly-mode?


Best,

Tyler

John Haman via ESS-help writes:

> I'm having an issue with Poly-R or poly-markdown. When I 
> start 
> up my 
> Emacs installation, I get a strange error about a keymap:

>
> Error (use-package): poly-markdown/:catch: Symbol’s value as 
> variable is 
> void: keymap Disable showing Disable logging

>
> I have no issues loading polymode, but either of poly-R or 
> poly-markdown 
> triggers the error.

>
> Thanks everyone.
>
> The traceback is below.
>
> Debugger entered--Lisp error: (void-variable keymap)
> byte-code("\306\307!\210\310\311!\210\312\313\10!\203\23\0\10\202O\0\313\10!\203\35\0\314\202E\0\315\11J!\2036\0\316\10\11J\"\317\n\2@\"\20\211A\262..." 
> [keymap parent keylist parent-conf polymode-minor-mode-map 
> parent-conf-name make-variable-buffer-local 
> poly-markdown-mode 
> makunbound poly-markdown-mode-map (lambda (def-tmp-var) 
> (defvar 
> poly-markdown-mode-map def-tmp-var "Keymap for 
> poly-markdown-mode.")) 
> keymapp nil eieio-object-p 
> pm--get-keylist\.keymap-from-parent 
> append 
> derived-mode-map-name eieio-oref -minor-mode 
> easy-mmode-define-keymap 
> :inherit poly-markdown-polymode (lambda (def-tmp-var) (defvar 
> poly-markdown-polymode def-tmp-var "Configuration object for 
> `poly-markdown-mode' poly...")) clone :name 
> "poly-markdown-polymode" 
> :innermodes (poly-markdown-fenced-code-innermode 
> poly-markdown-displayed-math-innermode 
> poly-markdown-inline-math-innermode 
> poly-markdown-yaml-metadata-innermode) :hostmode 
> poly-markdown-hostmode 
> pm-polymode defalias #f(compiled-function ( arg) 
> "nil\n\n\\{poly-markdown-mode-map}" (interactive nil) 
> #> 0x141a4722905af83a>) add-minor-mode " PM" add-to-list 
> auto-mode-alist 
> ("\\.md\\'" . poly-markdown-mode)] 11)

>require(poly-markdown nil t)
>(not (require 'poly-markdown nil t))
>(if (not (require 'poly-markdown nil t)) (display-warning 
> 'use-package (format "Cannot load %s" 'poly-markdown) :error) 
> (use-package-statistics-gather :config 'poly-markdown nil) 
> (use-package-statistics-gather :config 'poly-markdown t))
>(progn (use-package-statistics-gather :init 'poly-markdown 
>nil) (if 
> (not (require 'poly-markdown nil t)) (display-warning 
> 'use-package 
> (format "Cannot load %s" 'poly-markdown) :error) 
> (use-package-statistics-gather :config 'poly-markdown nil) 
> (use-package-statistics-gather :config 'poly-markdown t)) 
> (use-package-statistics-gather :init 'poly-markdown t))
>(closure (t) nil (progn (use-package-statistics-gather 
>:init 
> 'poly-markdown nil) (if (not (require 'poly-markdown nil t)) 
> (display-warning 'use-package (format "Cannot load %s" 
> 'poly-markdown) 
> :error) (use-package-statistics-gather :config 'poly-markdown 
> nil) 
> (use-package-statistics-gather :config 'poly-markdown t)) 
> (use-package-statistics-gather :init 'poly-markdown t)))()
>eval-after-load(polymode (closure (t) nil (progn 
> (use-package-statistics-gather :init 'poly-markdown nil) (if 
> (not 
> (require 'poly-markdown nil t)) (display-warning 'use-package 
> (format 
> "Cannot load %s" 'poly-markdown) :error) 
> (use-package-statistics-gather 
> :config 'poly-markdown nil) (use-package-statistics-gather 
> :config 
> 'poly-markdown t)) (use-package-statistics-gather :init 
> 'poly-markdown t
>(condition-case err (eval-after-load 'polymode #'(lambda 
>nil 
>(progn 
> (use-package-statistics-gather :init 'poly-markdown nil) (if 
> (not 
> (require ... nil t)) (display-warning 'use-package (format 
> "Cannot load 
> %s" ...) :error) (use-package-statistics-gather :config 
> 'poly-markdown 
> nil) (use-package-statistics-gather :config 'poly-markdown 
> t)) 
> (use-package-statistics-gather :init 'poly-markdown t 
> ((debug error) 
> (funcall use-package--warning102 :catch err)))
>(progn (use-package-statistics-gather :use-package 
> 

Re: [ESS] Polymode keymap error

2021-03-08 Thread Tyler Smith via ESS-help
Can you show us your Emacs config, or at least the use-package 
expression you use for poly-mode?


Best,

Tyler

John Haman via ESS-help writes:

I'm having an issue with Poly-R or poly-markdown. When I start 
up my 
Emacs installation, I get a strange error about a keymap:


Error (use-package): poly-markdown/:catch: Symbol’s value as 
variable is 
void: keymap Disable showing Disable logging


I have no issues loading polymode, but either of poly-R or 
poly-markdown 
triggers the error.


Thanks everyone.

The traceback is below.

Debugger entered--Lisp error: (void-variable keymap)
byte-code("\306\307!\210\310\311!\210\312\313\10!\203\23\0\10\202O\0\313\10!\203\35\0\314\202E\0\315\11J!\2036\0\316\10\11J\"\317\n\2@\"\20\211A\262..." 
[keymap parent keylist parent-conf polymode-minor-mode-map 
parent-conf-name make-variable-buffer-local poly-markdown-mode 
makunbound poly-markdown-mode-map (lambda (def-tmp-var) (defvar 
poly-markdown-mode-map def-tmp-var "Keymap for 
poly-markdown-mode.")) 
keymapp nil eieio-object-p pm--get-keylist\.keymap-from-parent 
append 
derived-mode-map-name eieio-oref -minor-mode 
easy-mmode-define-keymap 
:inherit poly-markdown-polymode (lambda (def-tmp-var) (defvar 
poly-markdown-polymode def-tmp-var "Configuration object for 
`poly-markdown-mode' poly...")) clone :name 
"poly-markdown-polymode" 
:innermodes (poly-markdown-fenced-code-innermode 
poly-markdown-displayed-math-innermode 
poly-markdown-inline-math-innermode 
poly-markdown-yaml-metadata-innermode) :hostmode 
poly-markdown-hostmode 
pm-polymode defalias #f(compiled-function ( arg) 
"nil\n\n\\{poly-markdown-mode-map}" (interactive nil) #0x141a4722905af83a>) add-minor-mode " PM" add-to-list 
auto-mode-alist 
("\\.md\\'" . poly-markdown-mode)] 11)

   require(poly-markdown nil t)
   (not (require 'poly-markdown nil t))
   (if (not (require 'poly-markdown nil t)) (display-warning 
'use-package (format "Cannot load %s" 'poly-markdown) :error) 
(use-package-statistics-gather :config 'poly-markdown nil) 
(use-package-statistics-gather :config 'poly-markdown t))
   (progn (use-package-statistics-gather :init 'poly-markdown 
   nil) (if 
(not (require 'poly-markdown nil t)) (display-warning 
'use-package 
(format "Cannot load %s" 'poly-markdown) :error) 
(use-package-statistics-gather :config 'poly-markdown nil) 
(use-package-statistics-gather :config 'poly-markdown t)) 
(use-package-statistics-gather :init 'poly-markdown t))
   (closure (t) nil (progn (use-package-statistics-gather :init 
'poly-markdown nil) (if (not (require 'poly-markdown nil t)) 
(display-warning 'use-package (format "Cannot load %s" 
'poly-markdown) 
:error) (use-package-statistics-gather :config 'poly-markdown 
nil) 
(use-package-statistics-gather :config 'poly-markdown t)) 
(use-package-statistics-gather :init 'poly-markdown t)))()
   eval-after-load(polymode (closure (t) nil (progn 
(use-package-statistics-gather :init 'poly-markdown nil) (if 
(not 
(require 'poly-markdown nil t)) (display-warning 'use-package 
(format 
"Cannot load %s" 'poly-markdown) :error) 
(use-package-statistics-gather 
:config 'poly-markdown nil) (use-package-statistics-gather 
:config 
'poly-markdown t)) (use-package-statistics-gather :init 
'poly-markdown t
   (condition-case err (eval-after-load 'polymode #'(lambda nil 
   (progn 
(use-package-statistics-gather :init 'poly-markdown nil) (if 
(not 
(require ... nil t)) (display-warning 'use-package (format 
"Cannot load 
%s" ...) :error) (use-package-statistics-gather :config 
'poly-markdown 
nil) (use-package-statistics-gather :config 'poly-markdown t)) 
(use-package-statistics-gather :init 'poly-markdown t 
((debug error) 
(funcall use-package--warning102 :catch err)))
   (progn (use-package-statistics-gather :use-package 
   'poly-markdown 
nil) (use-package-ensure-elpa 'poly-markdown '(t) 'nil) (defvar 
use-package--warning102 #'(lambda (keyword err) (let ((msg 
(format 
"%s/%s: %s" ... keyword ...))) (display-warning 'use-package msg 
:error (condition-case err (eval-after-load 'polymode 
#'(lambda nil 
(progn (use-package-statistics-gather :init 'poly-markdown nil) 
(if (not 
...) (display-warning ... ... :error) 
(use-package-statistics-gather 
:config ... nil) (use-package-statistics-gather :config ... t)) 
(use-package-statistics-gather :init 'poly-markdown t 
((debug error) 
(funcall use-package--warning102 :catch err))) 
(use-package-statistics-gather :use-package 'poly-markdown t))
   (progn (progn (use-package-statistics-gather :use-package 
'poly-markdown nil) (use-package-ensure-elpa 'poly-markdown '(t) 
'nil) 
(defvar use-package--warning102 #'(lambda (keyword err) (let 
((msg ...)) 
(display-warning 'use-package msg :error (condition-case err 
(eval-after-load 'polymode #'(lambda nil (progn 
(use-package-statistics-gather :init ... nil) (if ... ... ... 
...) 
(use-package-statistics-gather :init ... t ((debug error) 
(funcall 
use-package--warning102 :catch err))) 

Re: [ESS] [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-28 Thread Tyler Smith via ESS-help
I understand your skepticism!

I could reframe my talk as "an overview of Blogdown" to more clearly articulate 
a single goal.

Best,

Tyler

-- 
plantarum.ca

On Mon, Dec 28, 2020, at 9:51 AM, Dirk Eddelbuettel via ESS-help wrote:
> 
> On 28 December 2020 at 14:26, Sparapani, Rodney via ESS-help wrote:
> | All great ideas.  How about ESS and Roxygen?
> 
> Good one, added!
> 
> On 28 December 2020 at 09:40, Tyler Smith wrote:
> | I'd be happy to demo blogging with Emacs, RMarkdown, Blogdown, Hugo, ESS 
> etc.
> 
> Colour me sceptical. That is a *series* of posts each of which will exceed 5
> mins. Take a subtopic or two, RMarkdown was already mentioned.
> 
> 
> But *great* to see quick responses. To keep it simpler (than a mailing or
> what not) I opened a one-off "collaborative editor" (never used this one
> before) at
> 
>http://collabedit.com/537yq
> 
> Treat it as volatile and disposable and maybe make local copies.  More
> content ideas are more than welcome!
> 
> Dirk
> 
> -- 
> https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
> 
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-28 Thread Tyler Smith via ESS-help
Hi Dirk,

I'd be happy to demo blogging with Emacs, RMarkdown, Blogdown, Hugo, ESS etc. I 
think a 5-10 minute demo with links to more detailed docs would be an engaging 
format.

Best,

Tyler

-- 
plantarum.ca

On Mon, Dec 28, 2020, at 9:08 AM, Dirk Eddelbuettel wrote:
> 
> A few weeks ago a few of riffed about all the "known unknown" in using ESS
> and that teaching each other a few tricks would be cool.  We really should do
> this. To kick it off, maybe we should spawn a quick one-off mailing list (I
> have used groups.io before) or Slack instance (if someone wants to spawn one)
> to discuss.
> 
> From the top of my head I can think of possible topics such as
> 
>  - installing ESS (possibly special mention to the bundles by VG for Windows
>and macOS, or KH for social science, or ...) -- no difficulty installing 
> 
>  - basic editing, highlighting etc maybe up to easily running multiple
>buffers and renaming them
> 
>  - other relevant Emacs tricks ?
> 
>  - ESS and RMarkdown happily co-existing and examples / demos
> 
>  - package building with ESS (I tend to do it outside myself)
> 
>  - debugging with ESS
>  
>  - other Emacs voodoo like tramp use with ESS ?
> 
>  - object browsers
> 
>  - your most favourite trick here!
> 
>  - your second most favourite trick here too!
> 
> I have found that 'one topic' in a few slides and very few minutes works so
> we could easily split this across different interest and skills and
> environments used and whatever other factor.  Not everybody will know all
> topics to gaps are normal -- let's fill them.
> 
> Dirk
> 
> -- 
> https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
>

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Emacs can find R-devel and R-newest, but not R-4.0.x

2020-11-26 Thread Tyler Smith via ESS-help

Hi Colin,

My apologies, I mis-remembered this. I had the same problem, and 
there was some discussion on the list and a new fix was proposed. 
This is documented on the '(ess) New features' page of the info 
manual, which notes the fix will appear in 19.04. In the interim I 
solved it locally by customizing `ess-r-runner-prefixes`, and in 
my old age I muddled all this together to give you bad advice.


Best,

Tyler

Colin Baxter via ESS-help writes:


Tyler Smith via ESS-help  writes:


> This was fixed in ESS 19.04. If you install/update ESS 
> from Melpa,

> you should get a recent version that includes this fix.

??? I have pulled ESS from git and M-x ESS-version  gives
18.10.3snapshot. Does this mean ESS from git lags behind Melpa?

Best wishes,

Colin Baxter.


URL: http://www.Colin-Baxter.com
-
GnuPG fingerprint: 68A8 799C 0230 16E7 BF68  2A27 BBFA 2492 91F5 
41C8


__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help



--
Tyler Smith
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Emacs can find R-devel and R-newest, but not R-4.0.x

2020-11-25 Thread Tyler Smith via ESS-help
This was fixed in ESS 19.04. If you install/update ESS from Melpa, you should 
get a recent version that includes this fix.

Best,

Tyler

-- 
plantarum.ca

On Wed, Nov 25, 2020, at 11:53 AM, Marius Hofert via ESS-help wrote:
> Hi,
> 
> I used to be able to start a specific R version with M-x R-... but it
> doesn't work anymore. On M-x R- I see:
> R-devel
> R-initialize-on-start
> R-mode
> R-newest
> R-transcript-mode
> ... but no R-4.0.x. I have R-4.0.0, R-4.0.2, R-4.0.3 and R-devel
> installed and M-x R-devel and M-x R-newest correctly find and start
> R-devel and R-4.0.3, respectively. The other two R versions are set up
> exactly in the same way, which is why it's so confusing that they are
> not found. Also, in an Emacs shell (M-x shell), R-4.0. completes
> to all R versions and I can also start every single one of them.
> 
> Any ideas what to try?
> 
> This is on macOS 10.15.7 with GNU Emacs 26.3 and ESS version 18.10.2
> [Released git: d4cd65da6dbf].
> 
> Thanks & cheers,
> Marius
> 
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] how to change default emacs behavior, upon running R code, from 2 side-by-by side frames to top-and-bottom frames?

2020-11-10 Thread Tyler Smith via ESS-help

Christopher W. Ryan via ESS-help writes:

When I execute a line of R code, the R buffer opens up as 
expected, but
it opens in a frame adjacent to the frame containing my source 
buffer. I
would like it to open the R buffer as a frame below my source 
code,

rather than adjacent to it.Â

How can I change the behavior from side-side frames to 
top-bottom frames?


In base Emacs, this is controlled by the variables 
`split-height-threshold` and `split-width-threshold`. Setting 
split-height-threshold to a lower value (default is 80), and the 
width threshold to a higher value, will prioritize splitting 
top/bottom over right/left.


The info node for this is: (emacs) Window Choice

Best,

Tyler

--
Tyler Smith
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Best Practice for building R packages

2020-10-08 Thread Tyler Smith via ESS-help
That sounds fun! I have pried myself away from your t4 videos this 
morning, but will look them over soon - they look great!


Best,

Tyler

Dirk Eddelbuettel writes:


On 8 October 2020 at 13:17, Ahmadou Dicko wrote:
| I do agree with your suggestion. There is much more to ESS 
than I
| know and it would be great if we could pool our resources to 
improve
| further. 


On 8 October 2020 at 09:38, Tyler Smith via ESS-help wrote:
| I would also be interested in a webinar.

Three, as they say, is a club -- so let's do this!!

I am currently in a teaching term so a little tied up until 
year-end but just
before I did about eight weeks with weekly short videos on 
'tools, toys, tips

and tricks' (mostly around the command-line). [1]

Emacs is natural follow-up to this but there is _so much_ I 
wanted to cover
there that I am effectively overwhelmed and hence inactive.  So 
let's turn
this upsite down and maybe _just_ focus on ESS. Shall we?  We 
could / should
just start with a wiki and hash out, say, half a dozen 
high-level topics and

then take turns.  Deal?

Dirk

[1] Blog posts under this tag: 
https://dirk.eddelbuettel.com/blog/code/t4/
First post was 
http://dirk.eddelbuettel.com/blog/2020/05/03#000_introducing_t4
and YouTube content is here: 
https://www.youtube.com/c/DirkEddelbuettel/videos



--
Tyler Smith
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Best Practice for building R packages

2020-10-08 Thread Tyler Smith via ESS-help
I only update my package once or twice a year, and haven't created 
a new one in a while. That said, I really like the ESS/devtools 
integration. I usually have to dig into the docs to remind myself 
about `C-c C-o C-o` to get a new roxygen template, but that's much 
less effort than refreshing myself on Rd syntax (again).


I didn't realize ESS automated compiling documentation! devtools' 
`document()` function is what I've been using, and I hadn't 
thought to look for an even shorter method.


I would also be interested in a webinar.

Best,

Tyler

Ahmadou Dicko via ESS-help writes:

I do agree with your suggestion. There is much more to ESS than 
I
know and it would be great if we could pool our resources to 
improve
further. For my part `ess-describe-object-at-point` really 
improved by

workflow as it can be customized to include any function.

Indeed, it would be great to pool resources on R package 
development in

ESS.
I use a lot the new ess-r-package-mode and the devtools wrapper 
(C-c C-w
*), it wraps several useful devtools functions for loading, 
documenting,

testing, checking, etc.
For roxygen, I use C-c C-o C-o to  generate a roxygen template 
for a given

function and C-c C-w d to document (Rd, NAMESPACE, etc.)
I would love to know what other people are doing and happy to 
contribute as

well.

Best,


On Thu, Oct 8, 2020 at 12:45 PM Jeremie Juste via ESS-help <
ess-help@r-project.org> wrote:


Hello Dirk,

On Thursday,  8 Oct 2020 at 06:57, Dirk Eddelbuettel wrote:

> We all may be a little different here.
>
> ESS now wraps around devtools, but my practices predate 
> devtools.  So I

still
> build, test, install, ... on the command-line for which I use 
> wrappers

(from
> my littler package, just updated yesterday) named
>   build.r
>   check.r
>   rcc.r  # a nicer checker around rmdcheck
>   roxy.r # run roxygen, I use a 'cached' 6.1.1 version 
>   that does not

force recompile...
>   install.r  # plus various install* variants for BioC, or 
>   GitHub, or

binaries...
>   kitten.r   # using a wrapper around package.skeleton()
>   render.r   # run rmarkdown::render()
>   ...
Many thanks for sharing this. It is an option that suites me 
perfectly.


> It may actually make sense for _all of use_ to maybe pool for 
> two or

three
> hours and a webinar over Zoom for 'favourite ESS' tricks.  I 
> keep

forgetting
> how there is -- just yesterday I once again forgot C-c C-e w 
> and looked

for
> the cheat sheet pdf and there are a bootload of options I 
> never used

> ...
I do agree with your suggestion. There is much more to ESS than 
I
know and it would be great if we could pool our resources to 
improve
further. For my part `ess-describe-object-at-point` really 
improved by

workflow as it can be customized to include any function.

Best regards,
--
Jeremie Juste

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help




--
Tyler Smith
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] how to deal with underscore in ggplot2 etc

2020-09-04 Thread Tyler Smith via ESS-help
This is a bit irritating, isn't it! You might not know that on ESS you can 
toggle between '<-' and '_' by pressing the underscore key twice. That's the 
quickest fix, and the one I use. I frequently find myself cursing to myself 
when I do this :)

You could probably use a different key to insert the '<-' symbol, but after 
many years with ESS that would feel odd.

Best,

Tyler

-- 
plantarum.ca

On Fri, Sep 4, 2020, at 9:33 AM, Stephen Bond via ESS-help wrote:
> Hello ESS users,
> Please, tell me how do you deal with the proliferation of functions 
> that use the underscore symbol? My biggest concern is using ggplot2 
> where all the geom functions have an underscore: geom_smooth etc?the 
> package is authored by the people behind Rstudio who do not care about 
> ESS users, but many other packages now employ the underscore heavily.Is 
> there a package/function that can rename all functions in a package by 
> replacing the underscore with a dot: geom_smooth becomes 
> geom.smooth??is there any interest by the ESS developers to create such 
> a package/function?I apologize if this has been discussed, but I cannot 
> find a search field in the archives.CheersStephen
> 
>   [[alternative HTML version deleted]]
> 
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] R 4.0

2020-04-16 Thread Tyler Smith via ESS-help

I have some TeX-related stuff:

r-mpost
r-pmpost
r-upmost

I don't know what they do, I assume they were pulled in as part of 
texlive.


Best,

Tyler


Alex Branham via ESS-help writes:

On Thu 16 Apr 2020 at 16:20, Kasper Daniel Hansen via ESS-help 
 wrote:


I have just updated ESS using list-packages. R-4.0 is not found 
due to the
value of ess-r-runners-prefixes. This can of course be 
customized, but I

think it should be changed to include "R-4"


Thanks. I wonder if we should just look for any R-* values. Can 
anyone
think of instances of an executable named R-* on exec-path that 
*isn't*

a version of R?

Alex

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help



--
Tyler Smith
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] how to organize init.el for both python and R/ESS? Your workflow?

2019-10-29 Thread Tyler Smith via ESS-help
On Tue, Oct 29, 2019, at 12:58 PM, Paul Johnson via ESS-help wrote:
> 
> I put in a bunch of python bells and whistles and now ESS and R sessions
> don't work the same.  I've got interference from flymake and something has
> entirely broken the "_" to create <-.

This *shouldn't* happen - I have only done a little Python coding, but elpy and 
friends shouldn't do anything to ESS and friends.

> I need to understand how to write init.el as a sequence of files so that I
> can load the ESS part when I need to write R, or the python part if I work
> on that. Can you share your strategies for dealing with that?

You can load files via:

(load "~/path/to/my/elisp.el")

So you could to something like this in your init:

(load "~/.emacs.d/my-python-config.el")
(load "~/.emacs.d/my-ess-config.el")

(using require/provides and modifying your load-path is probably more idiomatic 
for elisp, but not necessary here)

It might be useful to break your code into files more granularly, using 
different files for common stuff, keyboard config etc - basically each section 
in your init.el. The benefit here is, once you've parceled out all the code, it 
will be very easy to comment out each section in turn and find out where the 
problems are coming from. As I mentioned before, you really should be able to 
have ESS and elpy together in the same config without them breaking each other.

This might help if you want to do more troubleshooting:


Best,

Tyler



> 
> my init.el now:
> 
> (require 'package)
> (let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
> (not (gnutls-available-p
>(proto (if no-ssl "http" "https")))
>   (when no-ssl
> (warn "\
> Your version of Emacs does not support SSL connections,
> which is unsafe because it allows man-in-the-middle attacks.
> There are two things you can do about this warning:
> 1. Install an Emacs version that does support SSL and be safe.
> 2. Remove this warning from your init file so you won't see it again."))
>   ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA
> Stable as desired
>   (add-to-list 'package-archives (cons "melpa" (concat proto "://
> melpa.org/packages/")) t)
>   ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://
> stable.melpa.org/packages/")) t)
>   (when (< emacs-major-version 24)
> ;; For important compatibility libraries like cl-lib
> (add-to-list 'package-archives (cons "gnu" (concat proto "://
> elpa.gnu.org/packages/")
> ;; for stable packages, use this instead
> ;;add-to-list 'package-archives
> ;; '("melpa-stable" . "https://stable.melpa.org/packages/;) t)
> 
> (package-initialize)
> 
> ;for the window-purpose package
> (purpose-mode)
> ; C-c, D: `purpose-toggle-window-buffer-dedicated`
> 
> ;; ; Python settings
> ;; ; see
> http://emacs.stackexchange.com/questions/24453/weird-shell-output-when-using-ipython-5
> ;; ;; ;; Some python things I use, you may not need
> (elpy-enable)
> ;; ;; recommended in elpy docs
> (setq python-shell-interpreter "jupyter"
>python-shell-interpreter-args "console --simple-prompt"
>python-shell-prompt-detect-failure-warning nil)
> (add-to-list 'python-shell-completion-native-disabled-interpreters
>  "jupyter")
> ;; ;
> https://stackoverflow.com/questions/25154809/how-can-i-stop-elpy-from-overriding-some-of-my-keybindings/25159354
> ;; ; 
> https://emacs.stackexchange.com/questions/46247/cannot-bind-m-s-left
> (eval-after-load "elpy"
>   '(progn
>  (define-key elpy-mode-map [(control return)] nil)
>  (define-key elpy-mode-map [(shift return)]
> 'elpy-shell-send-statement-and-step)
>  (define-key elpy-mode-map (kbd "\M-\t") nil)
>  (define-key elpy-mode-map (kbd "s-") 'elpy-company-backend)
>  )
> )
> (setq elpy-rpc-timeout 10)
> 
> 
> ;; Org-mode with R doesn't work without this
> ;; http://orgmode.org/worg/org-contrib/babel/how-to-use-Org-Babel-for-R.html
> (custom-set-variables
>  ;; custom-set-variables was added by Custom.
>  ;; If you edit it by hand, you could mess it up, so be careful.
>  ;; Your init file should contain only one such instance.
>  ;; If there is more than one, they won't work right.
>  '(ansi-color-names-vector
>["#2e3436" "#a4" "#4e9a06" "#c4a000" "#204a87" "#5c3566" "#729fcf"
> "#ec"])
>  '(column-number-mode t)
>  '(cua-auto-tabify-rectangles nil)
>  '(cua-mode t nil (cua-base))
>  '(custom-enabled-themes (quote (whiteboard)))
>  '(inferior-R-args "--no-restore-history --no-save")
>  '(package-selected-packages
>(quote
> (ivy window-purpose pyenv-mode py-autopep8 math-symbol-lists
> material-theme ein ess-smart-underscore htmlize polymode
> org-link-minor-mode markdown-mode julia-mode elpy dash)))
>  '(show-paren-mode t))
> 
> (setq-default indent-tabs-mode nil)
> (setq default-tab-width 4)
> 
> 
> ;; https://www.emacswiki.org/emacs/SmoothScrolling#toc1
> ;; scroll one line at a time (less "jumpy" than defaults)
>  

Re: [ESS] how to organize init.el for both python and R/ESS? Your workflow?

2019-10-29 Thread Tyler Smith via ESS-help
On Tue, Oct 29, 2019, at 1:38 PM, Tyler Smith wrote:
> 
> This might help if you want to do more troubleshooting:

Sorry, sent that accidentally without the link:

https://emacs.stackexchange.com/questions/28429/how-do-i-troubleshoot-emacs-problems/28430#28430

Tyler

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help