Re: [ESS] Error installing on ubuntu

2024-05-02 Thread Ramon Diaz-Uriarte via ESS-help
Dear Sunyoung,

Have you tried using melpa, as Dirk mentioned?

If melpa is already among the package archives, it should be enough to do "M-x 
package-install" and then choose ess; alternatively, "M-x list-packages", 
search for ess, click on the version you want, and click on  "Install".

If you do not have melpa installed/configured take a look at: 
https://melpa.org/#/getting-started .

Best,

R.



On Thu, 02-May-2024, at 12:40:24, 신선영(수학과) via ESS-help 
 wrote:
> Apologize for reposting.
>
> I tried with both ess-24.01.0.zip and ess-24.01.0.tar.gz files, which are
> available at https://ess.r-project.org/index.php?Section=download. None of
> them worked and showed the same error message.
>
> Any help would be appreciated.
>
>
> Best,
> Sunyoung
>
> On Apr 28, 2024, at 12:36 PM, Dirk Eddelbuettel  wrote:
>
>
> On 27 April 2024 at 10:53, 신선영(수학과) via ESS-help wrote:
> | Dear all,
> |
> | I get the following error message:
> |
> | make -C lisp all
> | make[1]: Entering directory '/home/mathi/ess-24.01.1/lisp'
> | test -f ../etc/.IS.RELEASE || wget -qO -
> | 
> https://raw.githubusercontent.com/JuliaEditorSupport/julia-emacs/master/julia-mode.el
> | > julia-mode.el
> | test -f ../etc/.IS.RELEASE || wget -qO -
> | 
> https://raw.githubusercontent.com/JuliaEditorSupport/julia-emacs/master/julia-mode-latexsubs.el
> | > julia-mode-latexsubs.el
> | Computing dependencies
> | sed: can't read julia-mode-latexsubs.el: No such file or directory
> |
> | …
> | …
> |
> | In toplevel form:
> | julia-mode.el:40:2: Error: Cannot open load file: No such file or 
> directory, julia-mode-latexsubs
> | make[1]: *** [Makefile:58: julia-mode.elc] Error 1
> | make[1]: Leaving directory '/home/mathi/ess-24.01.1/lisp'
> | make: *** [Makefile:30: lisp] Error 2
> |
> | I uncommented some lines related with Julia in Makefile, but that did fix 
> the issue.
> |
> | Any advice is appreciated. Thanks.
>
> Where did you start from?  I sometimes use the Debian/Ubuntu (that I used to
> look after, now it is done by Seb, see https://tracker.debian.org/pkg/ess and
> https://packages.ubuntu.com/search?suite=all=all=any=ess=sourcenames)
> and sometimes I use melpa. It generally 'just works'.
>
> Dirk

--
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-31
Facultad de Medicina
Universidad Autónoma de Madrid
Arzobispo Morcillo, 4
28029 Madrid
Spain

Phone: +34-91-497-2412

Email: rdia...@gmail.com
   r.d...@uam.es
   ramon.d...@iib.uam.es

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


Re: [ESS] brace_linter

2024-04-30 Thread Ramon Diaz-Uriarte via ESS-help
Dear Mark,

Out of the box ("emacs -Q" and then "M-x package-initialize") I think there is 
no linting. At least for me, linting happens when I enable flycheck or flymake, 
so maybe flycheck or flymake are being enabled in your emacs-init.el file for 
all prog-modes? You can check this by

C-h v flymake-mode
C-h v flycheck-mode

in your R code buffer, to see which one of the above minor modes is active.

If you (or your config) enable flycheck or flymake in an R buffer, then the 
variables `flycheck-lintr-linters` (for flycheck)  and `ess-r-flymake-linters` 
(for flymake) control what linters are used. You could set whichever is 
relevant to your liking; for example, this keeps many linters quiet for me:

(setq flycheck-lintr-linters
  "with_defaults(object_name_linter = NULL, camel_case_linter = NULL, 
snake_case_linter = NULL, indentation_linter = NULL)")

But the most expedite procedure, if you do not need flycheck or flymake, could 
be to disable flycheck/flymake in ess-r-mode buffers. For example

(add-hook 'ess-r-mode-hook (lambda() (flycheck-mode -1)))

or

(add-hook 'ess-r-mode-hook (lambda() (flymake-mode -1)))

Note: I am assuming you are not using LSP; with LSP (at least with lsp-mode), 
things are slightly different. (And I do not use flymake, so the mentions to 
flymake above are guesses from analogy with flycheck).

Best,

R.


On Tue, 30-April-2024, at 07:29:33, Mark Leeds via ESS-help 
 wrote:
> Hi All: I use R and Emacs-ESS  and I recently upgraded to R 4.4 and Ubuntu
> 23.04.
>
> Since the 2 upgrades ( yesterday ), when I emacs an R file, at the bottom
> of the ESS session it says ( if I toggle at certain places in the file )
>
> "[brace_linter] Opening curly braces should never go on their own line and
> should always be followed by a new line. "
>
> So it seems like ESS is using linter to check my code but I don't want it
> to because it puts ugly green lines whereever I'm not following the rules
> it wants.  And I'm definitely not an emacs-lisp or ess intermediate. A
> beginner at most.  So thanks for your patience and help. I'm hoping that  I
> can put something in my .emacs file to override this behavior ?
>
>
> Mark
>
>   [[alternative HTML version deleted]]
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

--
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-31
Facultad de Medicina
Universidad Autónoma de Madrid
Arzobispo Morcillo, 4
28029 Madrid
Spain

Phone: +34-91-497-2412

Email: rdia...@gmail.com
   r.d...@uam.es
   ramon.d...@iib.uam.es

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


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

2024-03-25 Thread Ramon Diaz-Uriarte via ESS-help


On Mon, 25-March-2024, at 11:21:26, Stephen J Eglen  
wrote:
>> - I works perfectly for me in two different machines (both running
>> Debian and Emacs 29.2.50)
>
> Thanks for confirming.
>
>> - Maybe I am not understanding
>> https://github.com/sje30/ess-unigd#adjust-to-size-of-buffer--dynamically-update
>> , but resize of image (on changing frame and window sizes) happens
>> automagically for me.
>> - The only minor thing is that, for some reason, the svg is shown in
>> Fundamental mode (if I find-file other svgs, they are shown as images
>> directly); I guess it is something with my setup. revert-buffer solves
>> it.
>
> The code that you have currently just uses the default aspect ratio that
> httpgd() provides, i.e. 720x576 pixels.  The images will rescale as you
> change the buffer, but the aspect ratio won't change.

Aha, thanks for the clarification.

>
> I've got it now working locally so that the aspect ratio is the same size
> as the window that you use to view the svg.  This I think is more flexible.

Looking forward to that functionality :-)

Best,

R.

-- 
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-31
Facultad de Medicina 
Universidad Autónoma de Madrid 
Arzobispo Morcillo, 4
28029 Madrid
Spain

Phone: +34-91-497-2412

Email: rdia...@gmail.com
   r.d...@uam.es
   ramon.d...@iib.uam.es

https://ligarto.org/rdiaz


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


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

2024-03-24 Thread Ramon Diaz-Uriarte via ESS-help

Wow! This is really nice! Thanks, Stephen and Rodney!!

A few comments:
- I works perfectly for me in two different machines (both running Debian and 
Emacs 29.2.50)

- Maybe I am not understanding 
https://github.com/sje30/ess-unigd#adjust-to-size-of-buffer--dynamically-update 
, but resize of image (on changing frame and window sizes) happens 
automagically for me.

- The only minor thing is that, for some reason, the svg is shown in 
Fundamental mode (if I find-file other svgs, they are shown as images 
directly); I guess it is something with my setup. revert-buffer solves it.

Best,

R. 


P.S. FWIW, for a while I've been using a kind of similar thing with browsers 
that run inside Emacs. First I started using xwidget-webkit-browse-url, but 
since this recently broke or will be broken soon[1], I then started using EAF 
(Emacs Application Framework). With a browser one gets the browse history of 
plots, mentioned in https://github.com/sje30/ess-unigd#browse-history-of-plots 
. The procedure is similar to what Stephen does: first, in R load library 
httpgd and launch hgd. Then have xwidget-webkit-browse-url or eaf-open-browser 
open the URL returned by hgd.


[1]  https://mail.gnu.org/archive/html/bug-gnu-emacs/2023-09/msg02681.html , 
https://debbugs.gnu.org/db/66/66068.html

On Fri, 22-March-2024, at 16:43:23, "Sparapani, Rodney via ESS-help" 
 wrote:
> Oh, yeah, sorry that was stupid.  So now I have execute permission.
> But, this is what latest.svg shows now…
> Status: 404
> Reason: Not Found

-- 
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-31
Facultad de Medicina 
Universidad Autónoma de Madrid 
Arzobispo Morcillo, 4
28029 Madrid
Spain

Phone: +34-91-497-2412

Email: rdia...@gmail.com
   r.d...@uam.es
   ramon.d...@iib.uam.es

https://ligarto.org/rdiaz


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


[ESS] hs-show/hide-block and functions with definition over several lines

2023-12-23 Thread Ramon Diaz-Uriarte via ESS-help

Dear All,

I am having trouble using hide-show functions hs-show-block and hs-hide-block, 
when the R function definition extends over several lines; in this case, if I 
am at, say, the function name, hs-hide-block does nothing.

It is possible to define new functions that search for the next "{", but then 
that breaks using other code that calls hs-show/hide-block (such as a nice 
wrapper in  https://karthinks.com/software/simple-folding-with-hideshow/). 

I've found a way of (at least apparently) solving the issue. But it involves 
advice-add. Code that shows the problem and the solution is below.

My solution seems way too convoluted and fragile (elisp ignorance?) for what I 
understand is a common issue, so I think I must be missing something. Any 
suggestions?


Thanks,

##
[This is the code in file "test.R"]

f1 <- function(a, b
   c, d,
   e) {   
x <- 1
f2 <- function(u) {
u + 2
}
f2(a + b + c + d + e)
}

##

### Start emacs -Q and execute the following:


(require 'package)
(package-initialize)

;; https://emacs.stackexchange.com/a/29740
(use-package ess
  :init (require 'ess-site))

;; https://stat.ethz.ch/pipermail/ess-help/2009-April/005217.html
(setq hs-special-modes-alist
  '((ess-mode "{" "}" "#" nil nil)
))

(add-hook 'prog-mode-hook 'hs-minor-mode)

;; Open test.R
(find-file "test.R")

;; Use "M-x hs-hide-block" in examples below (to have everything shown
;; again, "M-x hs-show-all")

;; -  point anywhere in first line before "(" and hs-hide-block:
;;  nothing happens 

;; - point in "a", or "b", on the first line o point in "c" or ")" :
;; argument list is hidden, not the function

;; - point in space between ")" and "{" on second line:
;; hs-hide-block does nothing

;; - point in "{", second line: hs-hide-block hiddes the function


;; These do what I want

(defun hs-hide-block-R ( end)
  "hs-hide-block, jumping to opening brace"
  (interactive "P")
  (save-excursion
(search-forward "{")
(hs-hide-block)))

(defun hs-show-block-R ( end)
  "hs-hide-block, jumping to opening brace"
  (interactive "P")
  (save-excursion
(search-forward "{")
(hs-show-block)))


;; 
;; advice hs-show/hide-block so the above logic applies
;;  only when in ess-r-mode

(defun move-to-left-of-non-whitespace ()
  "Move point to the left of the first non-whitespace character if
all characters to the right are whitespace."
  (interactive)
  (if (looking-at "[[:space:]\n]*$")
  (progn
(skip-chars-backward "[:space:]")
(when (not (bolp)) (forward-char -1
  )

(defun my-advice-for-hs-hide-block (hs-hide-block  args)
  "In R code, find next ?{ before calling hs-hide-block.
In case we are after a ?{ but everything to the right is whitespace,
move to the ?{ first."
  (if (eq major-mode 'ess-r-mode)
  (save-excursion
(move-to-left-of-non-whitespace)
(search-forward "{")
(apply hs-hide-block args))
(apply hs-hide-block args)
))

(defun my-advice-for-hs-show-block (hs-show-block  args)
  "In R code, find next ?{ before calling hs-show-block.
In case we are after a ?{ but everything to the right is whitespace,
move to the ?{ first."
  (if (eq major-mode 'ess-r-mode)
  (save-excursion
(move-to-left-of-non-whitespace)
(search-forward "{")
(apply hs-show-block args))
(apply hs-show-block args)
))

(advice-add 'hs-hide-block :around #'my-advice-for-hs-hide-block)
(advice-add 'hs-show-block :around #'my-advice-for-hs-show-block)

;; If we run again the examples above, hs-hide/show-block hide/show
;; the blocks.

;; With the above, we can use Karthink's functions in
;; https://karthinks.com/software/simple-folding-with-hideshow/

;; And also works with hideshowvis: https://github.com/sheijk/hideshowvis
;; mentioned in Vitalie's
;; https://stat.ethz.ch/pipermail/ess-help/2009-April/005217.html




-- 
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-31
Facultad de Medicina 
Universidad Autónoma de Madrid 
Arzobispo Morcillo, 4
28029 Madrid
Spain

Phone: +34-91-497-2412

Email: rdia...@gmail.com
   r.d...@uam.es
   ramon.d...@iib.uam.es

https://ligarto.org/rdiaz


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