├── .dir-locals.el ├── .gitignore ├── .mailmap ├── .travis.yml ├── 0001-ess-request-a-process-Honor-ess-gen-proc-buffer-name.patch ├── COPYING ├── ChangeLog ├── Makeconf ├── Makefile ├── NEWS ├── ONEWS ├── README.md ├── RPM.spec.in ├── VERSION ├── doc ├── CONTRIBUTING.org ├── Makefile ├── allnews.texi ├── announc.texi ├── atouchofstyle.css ├── authors.texi ├── bugrept.texi ├── bugs.texi ├── credits.texi ├── currfeat.texi ├── ess-defs.texi ├── ess.texi ├── help-bugs.texi ├── help-jags.texi ├── help-s.texi ├── help-sas.texi ├── images │ ├── ess_176_176.gif │ ├── ess_32_32.ico │ ├── icons │ │ ├── icon_external.png │ │ └── icon_mailto.png │ ├── logoESS.gif │ └── skyline.jpg ├── info │ └── dir ├── installation.texi ├── license.texi ├── mailing.texi ├── newfeat.texi ├── news.texi ├── onewfeat.texi ├── onews.texi ├── readme.texi ├── refcard │ └── refcard.tex └── requires.texi ├── etc ├── ESSR.rds ├── ESSR │ ├── BUILDESSR │ ├── LOADREMOTE │ └── R │ │ ├── .basic.R │ │ ├── .load.R │ │ ├── completion.R │ │ ├── debug.R │ │ ├── misc.R │ │ ├── mpi.R │ │ ├── ns-eval.R │ │ └── pkg.R ├── Makefile ├── all.txt ├── ess-julia.jl ├── ess-sas-sh-command ├── func.sas ├── icons │ ├── README │ ├── rbuffer.xpm │ ├── rfunction.xpm │ ├── rline.xpm │ ├── rregion.xpm │ ├── splus_letter_small.xpm │ ├── splus_letters_large.png │ ├── splus_letters_large.xpm │ ├── spluslogo.xpm │ ├── spluslogo.xpm.safe │ ├── startr.xpm │ ├── switch_ess.xpm │ ├── switchr.xpm │ └── switchs.xpm ├── proc.sas └── proc.txt ├── lisp ├── Makefile ├── ess-bugs-d.el ├── ess-bugs-l.el ├── ess-custom.el ├── ess-gretl.el ├── ess-help.el ├── ess-inf.el ├── ess-jags-d.el ├── ess-julia.el ├── ess-mode.el ├── ess-r-completion.el ├── ess-r-flymake.el ├── ess-r-mode.el ├── ess-r-package.el ├── ess-r-syntax.el ├── ess-r-xref.el ├── ess-rd.el ├── ess-rdired.el ├── ess-roxy.el ├── ess-s-lang.el ├── ess-sas-a.el ├── ess-sas-d.el ├── ess-sas-l.el ├── ess-site.el ├── ess-sp6-d.el ├── ess-toolbar.el ├── ess-tracebug.el ├── ess-trns.el ├── ess-utils.el ├── ess.el ├── essd-els.el └── obsolete │ ├── ess-eldoc.el │ ├── ess-font-lock.el │ ├── ess-mouse.el │ ├── ess-r-a.el │ ├── mouseme.el │ └── msdos.el ├── targets ├── create-pkg-file.el └── travis-install-package.el └── test ├── Makefile ├── dummy-pkg ├── DESCRIPTION ├── R │ └── test.R ├── man │ └── doc.Rd └── src │ └── test.c ├── ess-test-indentation.el ├── ess-test-inf.el ├── ess-test-org.el ├── ess-test-r-edit.el ├── ess-test-r-eval.el ├── ess-test-r-fontification.el ├── ess-test-r-package.el ├── ess-test-r-syntax.el ├── ess-test-r-token.el ├── ess-test-r-utils.el ├── ess-test-r.el ├── ess-test-rd.el ├── ess-test-roxy.el ├── ess-test.el ├── etest ├── .nosearch ├── README.md ├── etest.el └── test-etest.el ├── fixtures ├── Makevars ├── Makevars.win ├── file.R ├── file.Rout └── navigation.R ├── generate-indent-cases ├── generate-literate-cases ├── manual ├── R-ESS-bugs.R └── R-error-patterns.R ├── run-tests └── styles ├── C++.R ├── RRR+.R ├── RRR.R ├── RStudio-.R └── misc1.R /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ;;; Directory Local Variables 2 | ;;; For more information see (info "(emacs) Directory Variables") 3 | 4 | ((nil 5 | (bug-reference-bug-regexp . "#\\(?2:[0-9]+\\)") 6 | (bug-reference-url-format . "https://github.com/emacs-ess/ess/issues/%s") 7 | (sentence-end-double-space)) 8 | (emacs-lisp-mode 9 | (outline-regexp . "\f\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvum]\\|(setq\\|;;;;\\*") 10 | (indent-tabs-mode)) 11 | (ess-r-mode . ((ess-style . RRR)))) 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.orig 3 | *# 4 | *.info 5 | doc/ess.* 6 | doc/info/ess.info 7 | doc/readme.* 8 | doc/refcard/refcard.* 9 | *history 10 | *VERSION 11 | *REVISION 12 | *BACKUP* 13 | *REMOTE* 14 | *LOCAL* 15 | *BASE* 16 | *.elc 17 | doc/html/*.html 18 | README 19 | ANNOUNCE 20 | MM-MISC 21 | Mail-head 22 | RPM*.spec 23 | *SVN* 24 | ess-[1-9]*.[0-9][0-9] 25 | ess-[1-9]*.[0-9][0-9][-.]??? 26 | ess-[1-9]*.[0-9][0-9]-[0-9] 27 | ess-[1-9]*.[0-9][0-9]-[0-9][-.]??? 28 | lisp/julia* 29 | lisp/ess-autoloads.el 30 | tmp* 31 | .DS_Store 32 | ._.DS_Store 33 | .dependencies 34 | NEWS 35 | ONEWS 36 | 37 | # ELPA-generated files 38 | /ess-autoloads.el 39 | /ess-pkg.el 40 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Alex Branham 2 | David Shepherd 3 | David Whiting 4 | Ernest Adrogué nfdisco 5 | Ernest Adrogué nfdisco 6 | Henning Redestig 7 | Henning Redestig 8 | Mark Lunt 9 | Martin Maechler 10 | Martin Maechler 11 | Martin Maechler sfs 12 | Rodney Sparapani 13 | Shuguang Sun 14 | Shuguang Sun ShuguangSun 15 | Stefan Theussl theussl 16 | Stephen Eglen Stephen J. Eglen 17 | Wilfred Hughes 18 | Yi Liu Yi Liu 19 | Yi Liu YiLiu6240 20 | dickmao <7578770+dickmao@users.noreply.github.com> 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: emacs-lisp 2 | env: 3 | # When there's a new major Emacs release, also update 4 | # byte-compile-error-on-warn to the new release, below 5 | - EVM_EMACS=emacs-25.1-travis 6 | - EVM_EMACS=emacs-25.3-travis 7 | - EVM_EMACS=emacs-26.1-travis-linux-xenial 8 | - EVM_EMACS=emacs-26.2-travis-linux-xenial 9 | - EVM_EMACS=emacs-26.3-travis-linux-xenial 10 | - EVM_EMACS=emacs-27.1-travis-linux-xenial 11 | - EVM_EMACS=emacs-git-snapshot-travis-linux-xenial 12 | 13 | before_install: 14 | - echo "deb https://cloud.r-project.org/bin/linux/ubuntu trusty/" | sudo tee -a /etc/apt/sources.list 15 | - sudo add-apt-repository ppa:marutter/c2d4u -y 16 | - sudo apt-get update -qq 17 | - sudo apt-get install -y --no-install-recommends --allow-unauthenticated 18 | r-recommended 19 | r-cran-roxygen2 20 | texinfo 21 | texlive-latex-base 22 | texlive-latex-recommended 23 | texlive-latex-extra 24 | 25 | - git clone https://github.com/rejeep/evm.git $HOME/.evm 26 | - export PATH=$HOME/.evm/bin:$PATH 27 | 28 | - evm config path /tmp 29 | - evm install $EVM_EMACS --use --skip 30 | 31 | before_script: 32 | # link R executable to test defining runners based on other R 33 | # versions found on PATH. We're lying here that it is in fact a 34 | # different R version but that doesn't matter. 35 | - mkdir ess-r 36 | - ln -s $(which R) $PWD/ess-r/R-3.2.1 37 | - export PATH=$PATH:$PWD/ess-r/ 38 | 39 | script: 40 | - emacs --version 41 | - R --version 42 | - cd lisp; make julia-mode.elc 43 | - cd .. 44 | - make -C test -k all 45 | - make -C doc ../README 46 | # Create package.el-installable tar file, test that it installs 47 | # successfully: 48 | - make package 49 | - emacs --script targets/travis-install-package.el 50 | -------------------------------------------------------------------------------- /0001-ess-request-a-process-Honor-ess-gen-proc-buffer-name.patch: -------------------------------------------------------------------------------- 1 | From 68984a5a0a1df5a5a2619b579f23f70128e979cd Mon Sep 17 00:00:00 2001 2 | Message-ID: <68984a5a0a1df5a5a2619b579f23f70128e979cd.1705837631.git.yantar92@posteo.net> 3 | From: Ihor Radchenko 4 | Date: Sun, 21 Jan 2024 12:44:32 +0100 5 | Subject: [PATCH] ess-request-a-process: Honor 6 | ess-gen-proc-buffer-name-function 7 | 8 | * lisp/ess-inf.el (ess-request-a-process): Do not make processes not 9 | matching `ess-gen-proc-buffer-name-function' current. 10 | --- 11 | lisp/ess-inf.el | 4 +++- 12 | 1 file changed, 3 insertions(+), 1 deletion(-) 13 | 14 | diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el 15 | index 9ca3f455..aaff314c 100644 16 | --- a/lisp/ess-inf.el 17 | +++ b/lisp/ess-inf.el 18 | @@ -820,7 +820,7 @@ (defun ess-request-a-process (message &optional noswitch ask-if-1) 19 | (delete-dups (list "R" "S+" (or (bound-and-true-p S+-dialect-name) "S+") 20 | "stata" (or (bound-and-true-p STA-dialect-name) "stata") 21 | "julia" "SAS"))))) 22 | - (pname-list (delq nil ;; keep only those matching dialect 23 | + (pname-list (delq nil ;; keep only those matching dialect and `ess-gen-proc-buffer-name-function' 24 | (append 25 | (mapcar (lambda (lproc) 26 | (and (equal ess-dialect 27 | @@ -828,6 +828,8 @@ (defun ess-request-a-process (message &optional noswitch ask-if-1) 28 | 'ess-dialect 29 | (process-buffer (get-process (car lproc))))) 30 | (not (equal ess-local-process-name (car lproc))) 31 | + (equal (buffer-name (process-buffer (get-process (car lproc)))) 32 | + (funcall ess-gen-proc-buffer-name-function (car lproc))) 33 | (car lproc))) 34 | ess-process-name-list) 35 | ;; append local only if running 36 | -- 37 | 2.43.0 38 | 39 | -------------------------------------------------------------------------------- /Makeconf: -------------------------------------------------------------------------------- 1 | ## To install ESS for all users on your unix system: 2 | ## 1. Check variables below, edit as necessary 3 | ## 2. make 4 | ## 3. make install 5 | 6 | ## Section 1 7 | ## Installation variables for your Emacs variant 8 | ## 9 | ## Variable Description 10 | ## EMACS Path to GNU Emacs 11 | ## EMACSBATCH How to run Emacs as batch 12 | ## SITELISP Destination of site-lisp 13 | ## ESSDESTDIR Destination of ESS 14 | DESTDIR ?= /usr 15 | PREFIX ?= $(DESTDIR) 16 | 17 | ##__ GNU Emacs __ 18 | EMACS ?= emacs 19 | SITELISP ?= $(PREFIX)/share/emacs/site-lisp 20 | ESSDESTDIR ?= $(SITELISP)/ess 21 | EMACSBATCH ?= $(EMACS) -batch -Q 22 | 23 | # ##__ GNU Emacs __ for version 29.4 24 | # DESTDIR = /usr/local 25 | # PREFIX = $(DESTDIR) 26 | # EMACS = $(PREFIX)/emacs/29.4/bin/emacs 27 | # SITELISP = $(PREFIX)/emacs/29.4/share/emacs/site-lisp 28 | # ESSDESTDIR = $(SITELISP)/ess 29 | # EMACSBATCH = $(EMACS) -batch -Q 30 | 31 | ##__ GNU Emacs __ for macOS (and see Homebrew below) 32 | # PREFIX=/Applications/Emacs.app/Contents/Resources 33 | # EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs 34 | # ## standard site-lisp 35 | # SITELISP=$(PREFIX)/site-lisp 36 | # ## Vincent Goulet's Modified Emacs needs the following SITELISP 37 | # # SITELISP=$(PREFIX)/lisp 38 | # LISPDIR=$(SITELISP)/ess 39 | # ESSDESTDIR=$(LISPDIR) 40 | # INFODIR=/usr/local/info 41 | # ETCDIR =$(PREFIX)/etc/ess 42 | # EMACSBATCH=$(EMACS) -batch -Q 43 | ### R provides makeinfo/texi2pdf/texi2dvi outside of the PATH 44 | ### add the line "/opt/R/MACHINE/bin" to the file /etc/paths 45 | 46 | ##__ GNU Emacs with Homebrew __ for macOS 47 | ## site-lisp is not within .app directory 48 | # PREFIX=/Applications/Emacs.app/Contents/Resources 49 | # EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs 50 | # SITELISP=/opt/homebrew/share/emacs/site-lisp 51 | # LISPDIR=$(SITELISP)/ess 52 | # INFODIR=/usr/local/info 53 | # ETCDIR =$(PREFIX)/etc/ess 54 | 55 | ##__ Aquamacs __ (donated by Dan Knoepfle, Mar 26, 2011) 56 | # PREFIX=/Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes 57 | # EMACS=/Applications/Aquamacs.app/Contents/MacOS/Aquamacs 58 | # SITELISP=/Applications/Aquamacs.app/Contents/Resources/lisp 59 | # LISPDIR=$(PREFIX)/ess-mode/lisp 60 | # INFODIR=/Applications/Aquamacs.app/Contents/Resources/info 61 | # ETCDIR=$(PREFIX)/ess-mode/etc 62 | 63 | ## COMPILE-FLAGS is set in tests 64 | COMPILE ?= $(EMACSBATCH) $(COMPILE-FLAGS) --directory . --directory ./obsolete -f batch-byte-compile 65 | COMPILE-SIMPLE ?= $(EMACSBATCH) --directory . --directory ./obsolete -f batch-byte-compile 66 | 67 | ## Section 2 68 | ## Installation variables for your unix variant 69 | ## 70 | ## Variable Description 71 | ## MAKEINFO program to convert .texi{nfo} to .info 72 | ## MAKEHTML program to convert .texi{nfo} to .html 73 | ## MAKETXT program to convert .texi{nfo} to .txt 74 | ## INSTALLDIR to create directories, if necessary 75 | ## INSTALL to copy files, file copying commands expect 2 args: 76 | ## 1st) source-file & 2nd) target-directory 77 | ## UNINSTALL deletes all arguments 78 | ## DOCDIR Destination of other doc files 79 | ## DOWNLOAD Download internet file to stdout 80 | 81 | MAKEINFO ?= LC_ALL=C LANG=en makeinfo 82 | MAKEHTML ?= $(MAKEINFO) --html --no-split --css-include=atouchofstyle.css -o 83 | MAKETXT ?= $(MAKEINFO) --no-validate --plaintext --no-split -o - 84 | INSTALLDIR ?= mkdir -p 85 | INSTALL ?= cp -p 86 | UNINSTALL ?= rm -f 87 | TEXI2PDF ?= LANG=C texi2dvi --pdf 88 | DOWNLOAD ?= $(shell which wget > /dev/null && echo 'wget -qO -' || which curl) 89 | INSTALLINFO ?= install-info 90 | 91 | ## Section 3 92 | ## For ESS developers only, not part of installation procedure 93 | ## 94 | ## Variable Description 95 | ## GNUTAR the name of GNU tar to support the z option 96 | ## SVN_URL SVN repository URL (repo retired) 97 | ## UPLOAD_DIR Martin's upload directory 98 | ## ESS_HOMEPAGE Martin's svn co https://svn.r-project.org/ESS-web/trunk 99 | ## 100 | 101 | GNUTAR=tar 102 | # SVN_URL = https://svn.r-project.org/ESS 103 | UPLOAD_DIR = /u/maechler/emacs/ess-WWW/downloads/ess 104 | ESS_HOMEPAGE = /u/maechler/emacs/ESS-web 105 | 106 | GPG=$(shell (gpg2 --version > /dev/null 2>&1 && echo gpg2 ) || echo gpg ) 107 | 108 | .SUFFIXES: .i3 .m3 .nw .tex .dvi .html .c .h .el .elc 109 | 110 | # Local Variables: 111 | # mode: makefile-gmake 112 | # End: 113 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![ELPA](https://elpa.gnu.org/packages/ess.svg)](https://elpa.gnu.org/packages/ess.html) 2 | [![MELPA Stable](http://stable.melpa.org/packages/ess-badge.svg)](https://stable.melpa.org/#/ess) 3 | [![MELPA](http://melpa.org/packages/ess-badge.svg)](https://melpa.org/#/ess) 4 | 5 | 6 | # ESS 7 | 8 | Git development branch of Emacs Speaks Statistics: ESS. 9 | For more info, see our web page at https://ess.r-project.org/ 10 | 11 | -------------------------------------------------------------------------------- /RPM.spec.in: -------------------------------------------------------------------------------- 1 | # This is an RPM spec file that specifies how to package 2 | # ESS for Fedora Core Linux and, possibly, similar systems. 3 | 4 | %define name emacs-ess 5 | %define version @@VERSION@@ 6 | %define release 1.tgm 7 | Summary: Emacs Speaks Statistics add-on package for Emacs 8 | Name: %{name} 9 | Version: %{version} 10 | Release: %{release} 11 | Copyright: GPL 12 | Group: Applications/Editors 13 | Source: https://ESS.R-project.org/downloads/ess/ess-%{version}.tgz 14 | URL: https://ESS.R-project.org/ 15 | Packager: Detlef Steuer <.........de> 16 | BuildRoot: %{_tmppath}/%{name}-root 17 | Prefix: %{_prefix} 18 | BuildArchitectures: noarch 19 | BuildRequires: emacs 20 | Requires: emacs 21 | 22 | %description 23 | This package provides Emacs Speaks Statistics (ESS), which provides 24 | Emacs-based front ends for popular statistics packages. 25 | 26 | ESS provides an intelligent, consistent interface between the user and 27 | the software. ESS interfaces with S-PLUS, R, SAS, BUGS and other 28 | statistical analysis packages under the Unix, Microsoft Windows, and 29 | Apple Mac OS operating systems. ESS is a package for the GNU Emacs 30 | text editors whose features ESS uses to streamline the 31 | creation and use of statistical software. ESS knows the syntax and 32 | grammar of statistical analysis packages and provides consistent 33 | display and editing features based on that knowledge. ESS assists in 34 | interactive and batch execution of statements written in these 35 | statistical analysis languages. 36 | 37 | %prep 38 | %setup -n ess-%{version} 39 | ( cd doc && chmod u+w html info ) # fix perms to ensure builddir can be deleted 40 | 41 | %build 42 | make 43 | 44 | # create an init file that is loaded when a user starts up emacs to 45 | # tell emacs to autoload our package's Emacs code when needed 46 | cat > %{name}-init.el <<"EOF" 47 | ;;; Set up %{name} for Emacs. 48 | ;;; 49 | ;;; This file is automatically loaded by emacs's site-start.el 50 | ;;; when you start a new emacs session. 51 | 52 | (require 'ess-site) 53 | 54 | EOF 55 | 56 | # create a README.RPM file to document any quirks of this package 57 | cat > README.RPM < 69 | EOF 70 | 71 | 72 | %install 73 | %{__rm} -rf ${RPM_BUILD_ROOT} 74 | INITDIR=${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/site-start.d 75 | PKGLISP=${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/%{name}-%{version} 76 | INFODIR=${RPM_BUILD_ROOT}%{_infodir} 77 | %{__install} -D %{name}-init.el $INITDIR/%{name}-init.el 78 | %{__install} -d $PKGLISP 79 | %{__install} -d $INFODIR 80 | %{__make} install \ 81 | PREFIX=${RPM_BUILD_ROOT}%{_prefix} \ 82 | LISPDIR=$PKGLISP \ 83 | INFODIR=$INFODIR 84 | %{__rm} -f $INFODIR/dir # don't package but instead update in pre and post 85 | %{__cp} -a etc $PKGLISP # tuck ess's /etc into lisp dir for easy transport 86 | 87 | # Uncomment to print the README file after install. 88 | # 89 | # %post 90 | # echo 91 | # cat %{_defaultdocdir}/%{name}-%{version}/README.RPM 92 | # echo 93 | 94 | %clean 95 | %{__rm} -rf ${RPM_BUILD_ROOT} 96 | 97 | %files 98 | %defattr(-,root,root) 99 | %doc README README.RPM ANNOUNCE COPYING VERSION ChangeLog doc 100 | %dir %{_datadir}/emacs/site-lisp/%{name}-%{version} 101 | %{_datadir}/emacs/site-lisp/%{name}-%{version}/* 102 | %{_datadir}/emacs/site-lisp/site-start.d/* 103 | %{_infodir}/*.gz 104 | 105 | %post 106 | [ -f /usr/share/info/ess.info.gz ] && \ 107 | /sbin/install-info /usr/share/info/ess.info.gz /usr/share/info/dir || : 108 | 109 | %preun 110 | if [ $1 = 0 ]; then 111 | [ -f /usr/share/info/ess.info.gz ] && \ 112 | /sbin/install-info --delete /usr/share/info/ess.info.gz \ 113 | /usr/share/info/dir || : 114 | fi 115 | 116 | 117 | %changelog 118 | * Fri Oct 15 2004 Tom Moertel 5.2.3-1.tgm 119 | - Updated to ESS 5.2.3. 120 | 121 | * Fri Aug 27 2004 Tom Moertel 5.2.2-3.tgm 122 | - Updated ESS URL. 123 | - Fixed Summary. 124 | 125 | * Fri Aug 27 2004 Tom Moertel 5.2.2-2.tgm 126 | - Fixed bug: Forgot to include ESS's etc/ directory. 127 | 128 | * Thu Aug 26 2004 Tom Moertel 5.2.2-1.tgm 129 | - Initial build. 130 | 131 | 132 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 25.01.0 2 | -------------------------------------------------------------------------------- /doc/CONTRIBUTING.org: -------------------------------------------------------------------------------- 1 | * Contributing code 2 | Please make sure your contribution: 3 | 4 | - Does not introduce any byte compilation warnings or cause existing 5 | tests to fail (=make test=) 6 | - Satisfies M-x checkdoc 7 | 8 | We follow standard Elisp coding conventions with the following 9 | exceptions: 10 | 11 | - =indent-tabs-mode= should be =nil= 12 | - =sentence-end-double-space= should be =nil= 13 | 14 | Both of these are taken care of by the .dir-locals.el file. We do not 15 | require internal functions to be documented if their name is 16 | descriptive enough. 17 | 18 | If you have contributed to ESS in the past but changed your git 19 | username or email, please add the proper alias to .mailmap (see 20 | git-shortlog(1) for the format). 21 | 22 | ** FSF copyright assignment 23 | 24 | Unless your change is less than about 15 lines of code, you must 25 | assign copyright to the FSF. This is the same process that Emacs 26 | itself and all packages in GNU ELPA use (the paperwork can cover 27 | both). Instructions for this process can be found [[https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.future][here]]. If you have 28 | already signed the paperwork for GNU Emacs, nothing else needs to be 29 | done. 30 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makeconf 2 | 3 | TEXISRC = announc.texi authors.texi bugrept.texi bugs.texi \ 4 | credits.texi currfeat.texi ess.texi ess-defs.texi \ 5 | help-s.texi help-sas.texi installation.texi \ 6 | license.texi mailing.texi onewfeat.texi news.texi onews.texi \ 7 | newfeat.texi requires.texi help-bugs.texi \ 8 | help-jags.texi allnews.texi Makefile ../Makeconf ../VERSION 9 | 10 | PDFs = ess.pdf readme.pdf refcard/refcard.pdf 11 | TXTs = ../README ../ANNOUNCE ../NEWS ../ONEWS 12 | 13 | # Don't build pdf/html by default 14 | all : info text 15 | info : info/ess.info 16 | text : $(TXTs) 17 | html : html/ess.html html/readme.html html/news.html 18 | pdf : $(PDFs) 19 | 20 | ess.pdf : $(TEXISRC) 21 | $(TEXI2PDF) ess.texi 22 | 23 | readme.pdf : $(TEXISRC); $(TEXI2PDF) readme.texi 24 | 25 | distclean clean: 26 | @rm -f *.aux *.cp *.cps *.fn *.fns *.ky *.kys *.log *.out \ 27 | *.pg *.pgs *.tmp *.toc *.tp *.vr *.vrs 28 | @rm -f refcard/*.aux refcard/*.log 29 | @rm -f $(TXTs) $(PDFs) info/*.info* \ 30 | html/* *.info dir 31 | 32 | ../README: $(TEXISRC) 33 | -$(MAKETXT) readme.texi \ 34 | | perl -pe 'last if /^Concept Index/;' > $@ 35 | 36 | ../ANNOUNCE: $(TEXISRC) 37 | -$(MAKETXT) announc.texi \ 38 | | perl -pe 'last if /^Concept Index/;' > $@ 39 | 40 | ../NEWS: Makefile ess-defs.texi newfeat.texi news.texi 41 | -$(MAKETXT) news.texi > $@ 42 | 43 | ../ONEWS: Makefile ess-defs.texi onewfeat.texi onews.texi 44 | -$(MAKETXT) onews.texi > $@ 45 | 46 | ### File Dependencies 47 | 48 | info/ess.info: $(TEXISRC) ../VERSION 49 | @echo "making Info documentation..." 50 | -$(MAKEINFO) ess.texi 51 | mv -f ess.info info/ 52 | 53 | install: install-info install-other-docs 54 | 55 | install-info : info/ess.info 56 | -$(INSTALLDIR) $(INFODIR) 57 | $(INSTALL) info/ess.info $(INFODIR) 58 | $(INSTALL) info/dir $(INFODIR) 59 | grep $(ESSINFONODE1) $(INFODIR)/dir || \ 60 | (echo >> $(INFODIR)/dir; echo 'Emacs' >> $(INFODIR)/dir; \ 61 | echo $(ESSINFONODE1) $(ESSINFONODE2) >> $(INFODIR)/dir; \ 62 | echo $(ESSINFONODE3) >> $(INFODIR)/dir) 63 | 64 | install-other-docs: pdf html 65 | -$(INSTALLDIR) $(DOCDIR) 66 | $(INSTALL) ess.pdf readme.pdf $(DOCDIR) 67 | $(INSTALL) html/ess.html html/readme.html html/news.html $(DOCDIR) 68 | $(INSTALL) refcard/refcard.pdf $(DOCDIR) 69 | 70 | uninstall : 71 | -cd $(DOCDIR) && $(UNINSTALL) ess.pdf readme.pdf README ANNOUNCE 72 | -cd $(DOCDIR) && $(UNINSTALL) ess.html readme.html news.html 73 | -cd $(DOCDIR) && $(UNINSTALL) refcard.pdf 74 | 75 | ## TO DO: ess_toc.html & readme_toc.html should be merged into index.html 76 | html/ess.html: $(TEXISRC) 77 | @echo "making HTML documentation..." 78 | mkdir -p html 79 | -$(MAKEHTML) html/ess.html ess.texi 80 | 81 | html/readme.html: $(TEXISRC) 82 | -$(MAKEHTML) html/readme.html --no-validate readme.texi 83 | 84 | html/news.html: $(TEXISRC) 85 | mkdir -p html 86 | -$(MAKEHTML) html/news.html allnews.texi 87 | 88 | refcard/refcard.pdf: refcard/refcard.tex 89 | (cd refcard ; pdflatex refcard) 90 | -------------------------------------------------------------------------------- /doc/allnews.texi: -------------------------------------------------------------------------------- 1 | @settitle ESS -- Emacs Speaks Statistics 2 | @include ess-defs.texi 3 | @include newfeat.texi 4 | @include onewfeat.texi 5 | 6 | -------------------------------------------------------------------------------- /doc/announc.texi: -------------------------------------------------------------------------------- 1 | \input texinfo @c -*-texinfo-*- 2 | @comment %**start of header 3 | @setfilename announc.info 4 | @settitle ESS - Emacs Speaks Statistics 5 | @comment %**end of header 6 | 7 | @include ess-defs.texi 8 | @node Announce 9 | @chapter ANNOUNCING ESS 10 | @cindex ANNOUNCE 11 | 12 | The ESS Developers proudly announce the release of ESS 13 | @include ../VERSION 14 | 15 | @c -------------------------------------------------------------------- 16 | Emacs Speaks Statistics (ESS) provides an intelligent, consistent 17 | interface between the user and the software. ESS interfaces with 18 | R/S-PLUS, SAS, BUGS/JAGS, Stata and other statistical analysis 19 | packages under the UNIX, GNU Linux, Microsoft Windows, macOS and 20 | other operating systems. ESS is a package for the GNU Emacs text editor 21 | whose features ESS uses to streamline the creation 22 | and use of statistical software. ESS knows the syntax and grammar of 23 | statistical analysis packages and provides consistent display and 24 | editing features based on that knowledge. ESS assists in interactive 25 | and batch execution of statements written in these statistical 26 | analysis languages. 27 | 28 | ESS is freely available under the GNU General Public License (GPL). 29 | Please read the file COPYING which comes with the distribution, for 30 | more information about the license. For more detailed information, 31 | please read the README files that come with ESS. 32 | @c And to clear up any possible confusion; the name is ESS, NOT ESS-mode. 33 | @c Thank you :-). 34 | 35 | @menu 36 | * Latest Version:: 37 | * Current Features:: 38 | * Requirements:: 39 | * Mailing List:: 40 | * Reporting Bugs:: 41 | * Authors:: 42 | * License:: 43 | * New Features:: 44 | @end menu 45 | 46 | @node Latest Version, Current Features, Announce, Announce 47 | @section Getting the Latest Version 48 | @include installation.texi 49 | 50 | @node Current Features, Requirements, Latest Version, Announce 51 | @section Current Features 52 | @include currfeat.texi 53 | 54 | @node Requirements, Mailing List, Current Features, Announce 55 | @section Requirements 56 | @include requires.texi 57 | 58 | @node Mailing List, Reporting Bugs, Requirements, Announce 59 | @section Mailing List 60 | @include mailing.texi 61 | 62 | @node Reporting Bugs, Authors, Mailing List, Announce 63 | @section Reporting Bugs 64 | @include bugrept.texi 65 | 66 | @node Authors, License, Reporting Bugs, Announce 67 | @section Authors 68 | @include authors.texi 69 | 70 | @node License, New Features, Authors, Announce 71 | @section License 72 | @include license.texi 73 | 74 | @node New Features, , License, Announce 75 | @section New Features 76 | @include newfeat.texi 77 | 78 | @bye 79 | @c Remember to delete these lines before creating the info file. 80 | @iftex 81 | @lucidbook 82 | @bindingoffset = 0.5in 83 | @parindent = 0pt 84 | @end iftex 85 | 86 | @comment Local Variables: 87 | @comment TeX-master: "announc.texi" 88 | @comment End: 89 | -------------------------------------------------------------------------------- /doc/authors.texi: -------------------------------------------------------------------------------- 1 | @c ---- KEEP this synchronized with the @author entries in 2 | @c ./ess.texi 3 | @c ~~~~~~~~~~ 4 | @itemize @bullet 5 | @item 6 | @c @uref{https://www.google.com/,A.J. Rossini} 7 | @uref{mailto:blindglobe@@gmail.com, A.J. Rossini} 8 | @c -------- 9 | @item 10 | @c @uref{https://www.sbm.temple.edu/departments/statistics/,Richard M. Heiberger} 11 | @uref{mailto:rmh@@temple.edu, Richard M. Heiberger} 12 | @c -------- 13 | @item 14 | @c @uref{https://www.ci.tuwien.ac.at/~hornik,Kurt Hornik} 15 | @uref{mailto:Kurt.Hornik@@R-project.org, Kurt Hornik} 16 | @c -------- 17 | @item 18 | @c @uref{https://stat.ethz.ch/people/maechler/,Martin Maechler} 19 | @uref{mailto:maechler@@stat.math.ethz.ch, Martin Maechler} 20 | @c -------- 21 | @item 22 | @c @uref{https://www.mcw.edu/pcor/rsparapa,Rodney A. Sparapani} 23 | @uref{mailto:rsparapa@@mcw.edu, Rodney A. Sparapani} 24 | @c -------- 25 | @item 26 | @c @uref{https://www.damtp.cam.ac.uk/user/eglen,Stephen Eglen} 27 | @uref{mailto:stephen@@gnu.org, Stephen Eglen} 28 | @c -------- 29 | @item 30 | @c @uref{https://www.ucs.mun.ca/~sluque,Sebastian P. Luque} 31 | @uref{mailto:spluque@@gmail.com, Sebastian P. Luque} 32 | @c -------- 33 | @item 34 | @c @uref{https://www.google.com,Henning Redestig} 35 | @uref{mailto:henning.red@@googlemail.com, Henning Redestig} 36 | @c -------- 37 | @item 38 | @c @uref{http://github.com/vspinu, Vitalie Spinu} 39 | @uref{mailto:spinuvit@@gmail.com, Vitalie Spinu} 40 | @c -------- 41 | @item 42 | @c @uref{https://github.com/lionel-, Lionel Henry} 43 | @uref{mailto:lionel.hry@@gmail.com, Lionel Henry} 44 | @c -------- 45 | @item 46 | @c @uref{https://jabranham.com/, J. Alexander Branham} 47 | @uref{mailto:alex.branham@@gmail.com, J. Alexander Branham} 48 | @end itemize 49 | -------------------------------------------------------------------------------- /doc/bugrept.texi: -------------------------------------------------------------------------------- 1 | Please send bug reports, suggestions etc. to 2 | @email{ESS-bugs@@r-project.org}, or post them on our 3 | @uref{https://github.com/emacs-ess/ESS/issues, github issue tracker} 4 | 5 | The easiest way to do this is within Emacs by typing 6 | 7 | @kbd{M-x ess-submit-bug-report} 8 | 9 | This also gives the maintainers valuable information about your 10 | installation which may help us to identify or even fix the bug. 11 | 12 | If Emacs reports an error, backtraces can help us debug the problem. 13 | Type "M-x set-variable RET debug-on-error RET t RET". Then run the 14 | command that causes the error and you should see a *Backtrace* buffer 15 | containing debug information; send us that buffer. 16 | 17 | Note that comments, suggestions, words of praise and large cash 18 | donations are also more than welcome. 19 | -------------------------------------------------------------------------------- /doc/bugs.texi: -------------------------------------------------------------------------------- 1 | @itemize @bullet 2 | @item 3 | Commands like @code{ess-display-help-on-object} and list completion 4 | cannot be used while the user is entering a multi-line command. The 5 | only real fix in this situation is to use another ESS process. 6 | 7 | @item 8 | The @code{ess-eval-} commands can leave point in the ESS process 9 | buffer in the wrong place when point is at the same position as the last 10 | process output. This proves difficult to fix, in general, as we need to 11 | consider all @emph{windows} with @code{window-point} at the right place. 12 | 13 | @item 14 | It's possible to clear the modification flag (say, by saving the buffer) 15 | with the edit buffer not having been loaded into S. 16 | 17 | @item 18 | Backup files can sometimes be left behind, even when 19 | @code{ess-keep-dump-files} is @code{nil}. 20 | 21 | @item 22 | Passing an incomplete @Sl{} expression to @code{ess-execute} causes ESS 23 | to hang. 24 | 25 | @item 26 | The function-based commands don't always work as expected on functions 27 | whose body is not a parenthesized or compound expression, and don't even 28 | recognize anonymous functions (i.e. functions not assigned to any 29 | variable). 30 | 31 | @item 32 | Multi-line commands could be handled better by the command history 33 | mechanism. 34 | 35 | @item Changes to the continuation prompt in R (e.g. 36 | @code{options(continue = " ")}) are not automatically detected by ESS. 37 | Hence, for now, the best thing is not to change the continuation prompt. 38 | If you do change the continuation prompt, you will need to change 39 | accordingly the value of @code{inferior-ess-secondary-prompt} in 40 | @code{R-customize-alist}. 41 | 42 | @end itemize 43 | -------------------------------------------------------------------------------- /doc/credits.texi: -------------------------------------------------------------------------------- 1 | @cindex comint 2 | @cindex authors 3 | @cindex credits 4 | 5 | The ESS environment is built on the open-source projects of many 6 | contributors, dating back to 1989 where Doug Bates and Ed Kademan wrote 7 | S-mode to edit S and Splus files in GNU Emacs. Frank Ritter and Mike 8 | Meyer added features, creating version 2. Meyer and David Smith made 9 | further contributions, creating version 3. For version 4, David Smith 10 | provided significant enhancements to allow for powerful process 11 | interaction. 12 | 13 | John Sall wrote GNU Emacs macros for SAS source code around 1990. Tom 14 | Cook added functions to submit jobs, review listing and log files, and 15 | produce basic views of a dataset, thus creating a SAS-mode which was 16 | distributed in 1994. 17 | 18 | In 1994, A.J. Rossini extended S-mode to support XEmacs. Together 19 | with extensions written by Martin Maechler, this became version 4.7 20 | and supported S, Splus, and R. In 1995, Rossini extended SAS-mode to 21 | work with XEmacs. 22 | 23 | In 1997, Rossini merged S-mode and SAS-mode into a single Emacs 24 | package for statistical programming; the product of this marriage was 25 | called ESS version 5. Richard M. Heiberger designed the inferior mode 26 | for interactive SAS and SAS-mode was further integrated into ESS. 27 | Thomas Lumley's Stata mode, written around 1996, was also folded into 28 | ESS. More changes were made to support additional statistical 29 | languages, particularly XLispStat. 30 | 31 | ESS initially worked only with Unix statistics packages that used 32 | standard-input and standard-output for both the command-line interface 33 | and batch processing. ESS could not communicate with statistical 34 | packages that did not use this protocol. This changed in 1998 when 35 | Brian Ripley demonstrated use of the Windows Dynamic Data Exchange 36 | (DDE) protocol with ESS. Heiberger then used DDE to provide 37 | interactive interfaces for Windows versions of Splus. In 1999, Rodney 38 | A. Sparapani and Heiberger implemented SAS batch for ESS relying 39 | on files, rather than standard-input/standard-output, for Unix, 40 | Windows and Mac. In 2001, Sparapani added BUGS batch file processing 41 | to ESS for Unix and Windows. 42 | 43 | @itemize @bullet 44 | @item 45 | The multiple process code, and the idea for 46 | @code{ess-eval-line-and-next-line} are by Rod Ball. 47 | 48 | @item 49 | Thanks to Doug Bates for many useful suggestions. 50 | 51 | @item 52 | Thanks to Martin Maechler for reporting and fixing bugs, providing many 53 | useful comments and suggestions, and for maintaining the ESS mailing 54 | lists. 55 | 56 | @item 57 | Thanks to Frank Ritter for updates, particularly the menu code, and 58 | invaluable comments on the manual. 59 | 60 | @item 61 | Thanks to Ken'ichi Shibayama for his excellent indenting code, and many 62 | comments and suggestions. 63 | 64 | @item 65 | Thanks to Aki Vehtari for adding interactive BUGS support. 66 | 67 | @item 68 | Thanks to Brendan Halpin for bug-fixes and updates to Stata-mode. 69 | 70 | @item 71 | Last, but definitely not least, thanks to the many ESS users and 72 | contributors to the ESS mailing lists. 73 | @end itemize 74 | 75 | @emph{ESS} is being developed and currently maintained by 76 | 77 | @include authors.texi 78 | -------------------------------------------------------------------------------- /doc/currfeat.texi: -------------------------------------------------------------------------------- 1 | @itemize @bullet 2 | @item Languages Supported: 3 | @itemize @bullet 4 | @item S family (R, S, and S+ AKA S-PLUS) 5 | @item SAS 6 | @item BUGS/JAGS 7 | @item Stata 8 | @item Julia 9 | @end itemize 10 | @item Editing source code (S family, SAS, BUGS/JAGS, Stata, Julia) 11 | @itemize @bullet 12 | @item Syntactic indentation and highlighting of source code 13 | @item Partial evaluation of code 14 | @item Loading and error-checking of code 15 | @item Source code revision maintenance 16 | @item Batch execution (SAS, BUGS/JAGS) 17 | @item Use of imenu to provide links to appropriate functions 18 | @end itemize 19 | @item Interacting with the process (S family, SAS, Stata, Julia) 20 | @itemize @bullet 21 | @item Command-line editing 22 | @item Searchable Command history 23 | @item Command-line completion of S family object names and file names 24 | @item Quick access to object lists and search lists 25 | @item Transcript recording 26 | @item Interface to the help system 27 | @end itemize 28 | @item Transcript manipulation (S family, Stata) 29 | @itemize @bullet 30 | @item Recording and saving transcript files 31 | @item Manipulating and editing saved transcripts 32 | @item Re-evaluating commands from transcript files 33 | @end itemize 34 | @item Interaction with Help Pages and other Documentation (R) 35 | @itemize @bullet 36 | @item Fast Navigation 37 | @item Sending Examples to running ESS process. 38 | @item Fast Transfer to Further Help Pages 39 | @end itemize 40 | @item Help File Editing (R) 41 | @itemize @bullet 42 | @item Syntactic indentation and highlighting of source code. 43 | @item Sending Examples to running ESS process. 44 | @item Previewing 45 | @end itemize 46 | @end itemize 47 | 48 | -------------------------------------------------------------------------------- /doc/ess-defs.texi: -------------------------------------------------------------------------------- 1 | @c keep all doc macros here 2 | 3 | @macro wkbd{ARG} 4 | @w{@kbd{\ARG\}} 5 | @end macro 6 | 7 | @macro wcode{ARG} 8 | @w{@code{\ARG\}} 9 | @end macro 10 | 11 | @macro wsamp{ARG} 12 | @w{@samp{\ARG\}} 13 | @end macro 14 | 15 | @macro ESS{ARG} 16 | @acronym{ESS\ARG\} 17 | @end macro 18 | 19 | @macro iESS{ARG} 20 | @w{i@ESS{\ARG\}} 21 | @end macro 22 | 23 | @macro ESSVER 24 | @include ../VERSION 25 | @end macro 26 | 27 | @macro R{} 28 | R 29 | @end macro 30 | 31 | @macro Sl{} 32 | S 33 | @end macro 34 | 35 | @macro SPLUS{} 36 | @sc{S-Plus} 37 | @end macro 38 | 39 | @macro SAS{ARG} 40 | @w{@acronym{SAS\ARG\}} 41 | @end macro 42 | 43 | @macro UNIX{} 44 | @acronym{UNIX} 45 | @end macro 46 | 47 | @macro PC 48 | @acronym{PC} 49 | @end macro 50 | 51 | @macro MS 52 | @acronym{MS} 53 | @end macro 54 | 55 | @macro initfile{} 56 | @file{~/.emacs} or @file{~/.emacs.d/init.el} 57 | @end macro 58 | -------------------------------------------------------------------------------- /doc/help-bugs.texi: -------------------------------------------------------------------------------- 1 | @ESS{[BUGS]} provides 5 features. First, BUGS syntax is 2 | described to allow for proper fontification of statements, 3 | distributions, functions, commands and comments in BUGS model files, 4 | command files and log files. Second, @ESS{} creates templates for the 5 | command file from the model file so that a BUGS batch process can be 6 | defined by a single file. Third, @ESS{} provides a BUGS batch script 7 | that allows @ESS{} to set BUGS batch parameters. Fourth, key sequences 8 | are defined to create a command file and submit a BUGS batch process. 9 | Lastly, interactive submission of BUGS commands is also supported. 10 | 11 | @section ESS[BUGS]--Model files 12 | 13 | Model files with the @file{.bug} extension are edited in @ESS{[BUGS]} 14 | mode. Three keys are bound for your use in @ESS{[BUGS]}, @kbd{F2}, 15 | @kbd{C-c C-c} and @kbd{=}. @kbd{F2} performs the same action as it does 16 | in @ESS{[SAS]}, @xref{ESS(SAS)--Function keys for batch processing}. 17 | @kbd{C-c C-c} performs the function @code{ess-bugs-next-action} which 18 | you will use a lot. Pressing it in an empty buffer for a model file 19 | will produce a template for you. @kbd{=} inserts the set operator, 20 | @code{<-}. 21 | 22 | @section ESS[BUGS]--Command files 23 | 24 | Files ending in @file{.bmd} are used for BUGS command files. When you 25 | have finished editing your model file and press @kbd{C-c C-c}, a command 26 | file is created if one does not already exist. When you are finished 27 | editing your command file, pressing @kbd{C-c C-c} again will submit your 28 | command file as a batch job. 29 | 30 | @section ESS[BUGS]--Log files 31 | 32 | The @file{.bog} extension is used for BUGS log files. The command line 33 | generated by @ESS{} creates the @file{.bog} transcript file. 34 | 35 | -------------------------------------------------------------------------------- /doc/help-jags.texi: -------------------------------------------------------------------------------- 1 | @ESS{[JAGS]} provides 4 features. First, JAGS syntax is described to 2 | allow for proper fontification of statements, distributions, 3 | functions, commands and comments in JAGS model files, command files 4 | and log files. Second, @ESS{} creates templates for the command file 5 | from the model file so that a JAGS batch process can be defined by a 6 | single file. Third, @ESS{} provides a JAGS batch script that allows @ESS{} 7 | to set JAGS batch parameters. Fourth, key sequences are defined to 8 | create a command file and submit a JAGS batch process. 9 | 10 | @section ESS[JAGS]--Model files 11 | 12 | Files with the @file{.jag} extension are edited in @ESS{[JAGS]} mode. 13 | Three keys are bound for your use in @ESS{[JAGS]}, @kbd{F2}, @kbd{C-c C-c} and @kbd{=}. 14 | @kbd{F2} performs the same action as it does in @ESS{[SAS]}, 15 | @xref{ESS(SAS)--Function keys for batch processing}. @kbd{C-c C-c} performs the 16 | function @code{ess-bugs-next-action} which you will use a lot. Pressing it 17 | in an empty buffer for a model file will produce a template for you. @kbd{=} 18 | inserts the set operator, @code{<-}. 19 | 20 | The first press of @kbd{C-c C-c} will set up a template, including some 21 | necessary file-local variables in an empty buffer. These variables are 22 | @code{ess-jags-chains}, @code{ess-jags-monitor}, @code{ess-jags-thin}, 23 | @code{ess-jags-burnin} and @code{ess-jags-update}; they appear in the 24 | @code{Local Variables} section. When you are finished editing your 25 | model file, pressing @kbd{C-c C-c} will perform the necessary actions to 26 | build your command file for you. 27 | 28 | The @code{ess-jags-chains} variable is the number of chains that 29 | you want to initialize and sample from; defaults to 1. 30 | The @code{ess-jags-monitor} variable is a list of variables 31 | that you want monitored: encase each variable in double quotes. 32 | When you press @kbd{C-c C-c}, the 33 | appropriate statements are created in the command file to monitor the 34 | list of variables. By default, no variables are explicitly monitored 35 | which means JAGS will implicitly monitor all ``default'' variables. 36 | The @code{ess-jags-thin} variable is the thinning parameter. 37 | By default, the thinning parameter is set to 1, i.e. no thinning. 38 | The @code{ess-jags-burnin} variable is the number of initial samples 39 | to discard. By default, the burnin parameter is set to 10000. 40 | The @code{ess-jags-update} variable is the number of post-burnin samples 41 | to keep. By default, the update parameter is set to 10000. Both 42 | @code{ess-jags-burnin} and @code{ess-jags-update} are multiplied by 43 | @code{ess-jags-thin} since JAGS does not do it automatically. 44 | 45 | @section ESS[JAGS]--Command files 46 | 47 | Files ending in @file{.jmd} are for JAGS command files. For your 48 | @file{.jmd} file, there is only one variable, @code{ess-jags-command}, 49 | in the @code{Local Variables} section. When you have 50 | finished editing your model file and press @kbd{C-c C-c}, a command 51 | file is created if one does not already exist. 52 | When you are finished editing your command file, pressing @kbd{C-c C-c} 53 | again will submit your command file as a batch job. 54 | The @code{ess-jags-command} variable allows you to specify a different 55 | JAGS program to use to run your model; defaults to ``jags''. 56 | 57 | @section ESS[JAGS]--Log files 58 | 59 | The @file{.jog} extension is used for JAGS log 60 | files. You may find @kbd{F2} useful to refresh the @file{.jog} if the batch 61 | process over-writes or appends it. 62 | 63 | -------------------------------------------------------------------------------- /doc/help-s.texi: -------------------------------------------------------------------------------- 1 | @node ESS(R)--Editing files 2 | @section ESS[R]--Editing files 3 | 4 | @ESS{[R]} mode should be automatically turned on when visiting a file 5 | ending with an R or S suffix (*.R, *.S, *.s, etc), which enables the 6 | features discussed previously. Alternatively, type @kbd{M-x R-mode} to 7 | put the current buffer into R mode. However, one will have to start up 8 | an inferior process to take advantage of the interactive features. 9 | 10 | @node iESS(R)--Inferior ESS processes 11 | @section iESS[R]--Inferior ESS processes 12 | 13 | To start up iESS mode for R, use: 14 | @example 15 | M-x R 16 | M-x S+3 17 | M-x S4 18 | M-x S+5 19 | M-x S+6 20 | @end example 21 | 22 | @noindent 23 | (for R, S-PLUS 3.x, S4, S+5, S+6 or S+7, respectively. This assumes that 24 | you have access to each). 25 | 26 | @cindex command line arguments 27 | In the case that you wish to pass command line arguments to the starting 28 | R process, call it with the universal prefix. To set command line 29 | arguments that apply to all future iESS sessions, set the variable 30 | @code{inferior-R-args}. 31 | 32 | Note that R has some extremely useful command line arguments. For 33 | example, @code{--vanilla} will ensure R starts up without loading in any init 34 | files. 35 | 36 | If you have other versions of R or S available on the system, ESS 37 | is also able to start those versions. How this exactly works depend on 38 | which OS you are using (details below). The 39 | general principle, regardless of OS, is that ESS searches the paths 40 | listed in the variable @code{exec-path} for R binaries. If ESS cannot 41 | find your R binaries, on Unix you can change the Unix environment 42 | variable @code{PATH}, as this variable is used to set @code{exec-path}. 43 | 44 | R on GNU/Linux systems and other Unix-like systems (macOS): If you have 45 | "R-3.6.3" on your @code{exec-path}, it can be started using @kbd{M-x 46 | R-3.6.3}. By default, ESS will find versions of R beginning ``R-1'', 47 | ``R-2'', @dots{}, ``R-7'', ``R-devel'', or ``R-patched''. If your versions of R 48 | are called other names, consider renaming them with a symbolic link or 49 | change the variable @code{ess-r-runners-prefixes}. To see which functions have 50 | been created for starting different versions of R, type @kbd{M-x R-} and 51 | then hit [Tab]. These other versions of R can also be started from the 52 | "ESS->Start Process->Other" menu. 53 | 54 | R on Windows systems: If you have "rw1081" on your @code{exec-path}, it 55 | can be started using @kbd{M-x rw1081}. By default, ESS will find 56 | versions of R located in directories parallel to the version of R in 57 | your @code{PATH}. If your versions of R are called other names, you 58 | will need to change the variable @code{ess-rterm-versions}. To see 59 | which functions have been created for starting different versions of R, 60 | type @kbd{M-x rw} and then hit [Tab]. These other versions of 61 | R can also be started from the "ESS->Start Process->Other" menu. 62 | 63 | Once ESS has found these extra versions of R, it will then create a new 64 | function, called @kbd{M-x run-ess-r-newest}, which will call the newest version 65 | of R that it found. (ESS examines the date in the first line of 66 | information from @code{R --version} to determine which is newest.) 67 | 68 | @node Philosophies for using ESS(R) 69 | @section Philosophies for using ESS[R] 70 | 71 | There are two philosophies for using ESS. Most modern best practices 72 | prefer the first. ESS is configured for the first, and this is what the 73 | manual focuses on. 74 | 75 | 1: The source code is real. Objects are realizations of the source 76 | code. Source for EVERY user modified object is placed in a 77 | particular directory or directories, for later editing and retrieval. 78 | 79 | 2: R objects are real. Source code is a temporary realization of the 80 | objects. Dumped buffers should not be saved. 81 | _We_strongly_discourage_this_approach_. However, if you insist, add 82 | the following lines to your Emacs configuration file: 83 | @example 84 | (setq ess-keep-dump-files nil) 85 | (setq ess-delete-dump-files t) 86 | (setq ess-mode-silently-save nil) 87 | @end example 88 | 89 | @node Example ESS usage 90 | @section Example ESS usage 91 | 92 | Comments as to what should be happening are prefixed by "##". 93 | 94 | @display 95 | ### Data Analysis Example 96 | 97 | ## Open the file you want with 98 | C-x C-f myfile.R 99 | 100 | ## Edit as appropriate, then start and switch to an *R* 101 | process buffer with 102 | C-c C-z 103 | 104 | ## A new buffer *R* will appear. R will have been started 105 | ## in this buffer. The buffer is in iESS [R] mode. 106 | 107 | ## Return to the script 108 | C-z (or C-c C-z if you have pressed other keys in between) 109 | 110 | ## Send current region (if active), or function, or paragraph at 111 | point with 112 | C-M-x 113 | 114 | ## Send current region or function or paragraph and step with 115 | C-c C-c 116 | 117 | ## Send current line with 118 | C-RET 119 | 120 | ## or load the entire buffer with 121 | C-c C-l 122 | 123 | ## Save the revised myfile.R with 124 | C-x C-s. 125 | 126 | ## Save the entire *R* interaction buffer with 127 | C-x C-s. 128 | 129 | ## Search for documentation with 130 | C-c C-d 131 | 132 | ## Investigate available ESS commands with 133 | C-c C-h 134 | 135 | ## You will be prompted for a file name. The recommended name is 136 | ## myfile.Rout. With this suffix, the file will be opened in 137 | ## ess-transcript. 138 | 139 | @end display 140 | 141 | -------------------------------------------------------------------------------- /doc/images/ess_176_176.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/doc/images/ess_176_176.gif -------------------------------------------------------------------------------- /doc/images/ess_32_32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/doc/images/ess_32_32.ico -------------------------------------------------------------------------------- /doc/images/icons/icon_external.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/doc/images/icons/icon_external.png -------------------------------------------------------------------------------- /doc/images/icons/icon_mailto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/doc/images/icons/icon_mailto.png -------------------------------------------------------------------------------- /doc/images/logoESS.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/doc/images/logoESS.gif -------------------------------------------------------------------------------- /doc/images/skyline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/doc/images/skyline.jpg -------------------------------------------------------------------------------- /doc/info/dir: -------------------------------------------------------------------------------- 1 | This is the file .../info/dir, which contains the 2 | topmost node of the Info hierarchy, called (dir)Top. 3 | The first time you invoke Info you start off looking at this node. 4 |  5 | File: dir, Node: Top, This is the top of the INFO tree 6 | 7 | This (the Directory node) gives a menu of major topics. 8 | Typing "q" exits, "?" lists all Info commands, "d" returns here, 9 | "h" gives a primer for first-timers, 10 | "mEmacs" visits the Emacs manual, etc. 11 | 12 | In Emacs, you can click mouse button 2 on a menu item or cross reference 13 | to select it. 14 | 15 | * Menu: 16 | 17 | Emacs 18 | * ESS: (ess). Emacs Speaks Statistics 19 | (S/S+/R, SAS, BUGS, Stata, XLisp-Stat). 20 | -------------------------------------------------------------------------------- /doc/installation.texi: -------------------------------------------------------------------------------- 1 | @include requires.texi 2 | 3 | There are two main methods used for installing ESS. You may install from 4 | a third-party repository or from source code. Once you install it, you 5 | must also activate or load ESS in each Emacs session, though 6 | installation from a third-party repository likely takes care of that for 7 | you. See @ref{Activating and Loading ESS} for more details. 8 | 9 | @menu 10 | * Installing from a third-party repository:: 11 | * Installing from source:: 12 | * Activating and Loading ESS:: 13 | * Check Installation:: 14 | @end menu 15 | 16 | @node Installing from a third-party repository, Installing from source 17 | @section Installing from a third-party repository 18 | 19 | ESS is packaged by many third party repositories. Many GNU/Linux 20 | distributions package it, usually with the name ``emacs-ess'' or 21 | similar. 22 | 23 | ESS is also available through Milkypostman’s Emacs Lisp Package Archive 24 | (MELPA), a popular repository for Emacs packages. Instructions on how to 25 | do so are found on @uref{https://melpa.org/, MELPA's website}. MELPA 26 | also hosts MELPA-stable with stable ESS builds. You may choose between 27 | MELPA with the latest and greatest features (and bugs) or MELPA-stable, 28 | which may lag a bit behind but should be more stable. 29 | 30 | After installing, users should make sure ESS is activated or loaded in 31 | each Emacs session. See @ref{Activating and Loading ESS}. Depending on 32 | install method, this may be taken care of automatically. 33 | 34 | @node Installing from source, Activating and Loading ESS, Installing from a third-party repository 35 | @section Installing from source 36 | 37 | Stable versions of ESS are available at the 38 | @uref{https://ess.r-project.org, ESS web page} as a .tgz file or .zip 39 | file. ESS releases are GPG-signed, you should check the signature by 40 | downloading the accompanying @code{.sig} file and doing: 41 | 42 | @example 43 | gpg --verify ess-18.10.tgz.sig 44 | @end example 45 | 46 | Alternatively, you may download the git repository. ESS is currently 47 | hosted on GitHub: @uref{https://github.com/emacs-ess/ESS}. @code{git 48 | clone https://github.com/emacs-ess/ESS.git} will download it to a new 49 | directory @code{ESS} in the current working directory. 50 | 51 | We will refer to the location of the ESS source files as 52 | @file{/path/to/ESS/} hereafter. 53 | 54 | After installing, users should make sure they activate or load ESS in 55 | each Emacs session, see @ref{Activating and Loading ESS} 56 | 57 | Optionally, compile Elisp files, build the documentation, and the 58 | autoloads: 59 | @example 60 | cd /path/to/ESS/ 61 | make 62 | @end example 63 | Without this step the documentation, reference card, and autoloads 64 | will not be available. Uncompiled ESS will also run slower. 65 | 66 | Optionally, you may make ESS available to all users of a machine by 67 | installing it site-wide. To do so, run @code{make install}. You might 68 | need administrative privileges: 69 | 70 | @example 71 | make install 72 | @end example 73 | 74 | The files are installed into @code{/usr/share/emacs} directory. For this step to 75 | run correctly on macOS, you will need to adjust the @file{PREFIX} 76 | path in @file{Makeconf}. The necessary code and instructions are 77 | commented in that file. 78 | 79 | @node Activating and Loading ESS, Check Installation, Installing from source 80 | @section Activating and Loading ESS 81 | 82 | After installing ESS, you must activate or load it each Emacs session. 83 | ESS can be autoloaded, and if you used a third-party repository (such as 84 | your Linux distribution or MELPA) to install, you can likely skip this 85 | section and proceed directly to @ref{Check Installation} 86 | 87 | Otherwise, you may need to add the path to ESS to @code{load-path} with: 88 | 89 | @example 90 | (add-to-list 'load-path "/path/to/ESS/lisp") 91 | @end example 92 | 93 | You then need to decide whether to take advantage of deferred loading 94 | (which will result in a faster Emacs startup time) or require ESS when 95 | Emacs is loaded. To autoload ESS when needed (note that if installed 96 | from source, you must have run @code{make}): 97 | 98 | @example 99 | (load "ess-autoloads") 100 | @end example 101 | 102 | To require ESS on startup, you can either put 103 | 104 | @example 105 | (require 'ess-site) 106 | @end example 107 | 108 | or 109 | 110 | @example 111 | (require 'ess-r-mode) 112 | @end example 113 | 114 | In your configuration file, depending on whether you want all ESS 115 | features or only R related features. 116 | 117 | @node Check Installation, , Activating and Loading ESS 118 | @section Check Installation 119 | Restart Emacs and check that ESS was loaded from a correct 120 | location with @code{M-x ess-version}. 121 | 122 | -------------------------------------------------------------------------------- /doc/license.texi: -------------------------------------------------------------------------------- 1 | @comment ESS is free software; you can redistribute it and/or modify it under 2 | The source and documentation of ESS is free software. 3 | You can redistribute it and/or modify it under 4 | the terms of the GNU General Public License as published by the Free 5 | Software Foundation; either version 2, or (at your option) any later 6 | version. 7 | 8 | ESS is distributed in the hope that it will be useful, but WITHOUT ANY 9 | WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 11 | in the file COPYING in the same directory as this file for more 12 | details. 13 | -------------------------------------------------------------------------------- /doc/mailing.texi: -------------------------------------------------------------------------------- 1 | 2 | There is a mailing list for discussions and announcements relating to 3 | ESS. Join the list by sending an e-mail with "subscribe ess-help" (or 4 | "help") in the body to @email{ess-help-request@@r-project.org}; 5 | contributions to the list may be mailed to 6 | @email{ess-help@@r-project.org}. Rest assured, this is a fairly 7 | low-volume mailing list. 8 | 9 | The purposes of the mailing list include 10 | 11 | @itemize 12 | @item 13 | helping users of ESS to get along with it. 14 | @item 15 | discussing aspects of using ESS. 16 | @item 17 | suggestions for improvements. 18 | @item 19 | announcements of new releases of ESS. 20 | @item 21 | posting small patches to ESS. 22 | @end itemize 23 | -------------------------------------------------------------------------------- /doc/news.texi: -------------------------------------------------------------------------------- 1 | 2 | @include ess-defs.texi 3 | @include newfeat.texi 4 | -------------------------------------------------------------------------------- /doc/onews.texi: -------------------------------------------------------------------------------- 1 | 2 | @include ess-defs.texi 3 | @include onewfeat.texi 4 | -------------------------------------------------------------------------------- /doc/readme.texi: -------------------------------------------------------------------------------- 1 | \input texinfo @c -*-texinfo-*- 2 | @comment %**start of header 3 | @setfilename readme.info 4 | @settitle ESS - Emacs Speaks Statistics 5 | @comment %**end of header 6 | 7 | @include ess-defs.texi 8 | @node General Information 9 | @chapter General Information: README 10 | @cindex README 11 | 12 | This is the README file for the distribution of ESS version 13 | @include ../VERSION 14 | 15 | ESS is a GNU Emacs package for interactive statistical 16 | programming and data analysis. Languages supported: the S family (S, 17 | S-PLUS and R), SAS, BUGS/JAGS and Stata. ESS grew out of the 18 | desire for bug fixes and extensions to S-mode and SAS-mode as well as a 19 | consistent union of their features in one package. 20 | 21 | Installation instructions are provided in sections for both Unix and 22 | Windows; see below. 23 | 24 | The current development team is led by Martin Maechler since August 25 | 2004. Former project leader A.J. (Tony) Rossini 26 | (@email{rossini@@blindglobe.net}) did the initial port to XEmacs and has 27 | been the primary coder. Martin Maechler 28 | (@email{maechler@@stat.math.ethz.ch}) and Kurt Hornik 29 | (@email{Kurt.Hornik@@R-project.org}) have assisted with the S family and 30 | XLispStat. Stephen Eglen (@email{stephen@@gnu.org}) has worked mostly 31 | on R support. Richard M. Heiberger (@email{rmh@@temple.edu}) has 32 | assisted with S/S-PLUS development for Windows. Richard and Rodney 33 | A. Sparapani (@email{rsparapa@@mcw.edu}) have done much of the work 34 | improving SAS batch and interactive support. Rodney has also 35 | extended ESS to support BUGS/JAGS and has an interest in improving 36 | Stata support. 37 | 38 | We are grateful to the previous developers of S-mode (Doug Bates, Ed Kademan, 39 | Frank Ritter, David M. Smith), SAS-mode (Tom Cook) and Stata-mode (Thomas 40 | Lumley). 41 | @c The name is ESS. Not ESS-mode. 42 | 43 | @ifplaintext 44 | Table of Contents 45 | 46 | @itemize @bullet 47 | @item License 48 | @item Stability 49 | @item Requirements 50 | @item Latest Version 51 | @item Installation 52 | @item Starting an ESS Process 53 | @item New Features 54 | @item Current Features 55 | @item Reporting Bugs 56 | @item Mailing Lists 57 | @item Authors 58 | @end itemize 59 | @end ifplaintext 60 | 61 | @menu 62 | * License:: 63 | * Installation:: 64 | * Starting up:: 65 | * Current Features:: 66 | * New Features:: 67 | * Reporting Bugs:: 68 | * Mailing Lists:: 69 | * Authors:: 70 | @end menu 71 | 72 | @node License, Installation, General Information, General Information 73 | @section License 74 | @include license.texi 75 | 76 | @node Installation, Starting up, License, General Information 77 | @section Installation 78 | @include installation.texi 79 | 80 | @node Starting up, Current Features, Installation, General Information 81 | @section Starting an ESS process 82 | To start an @Sl{} session on Unix or on Windows when you 83 | use the Cygwin bash shell, simply type @kbd{M-x S RET}. 84 | 85 | To start an @Sl{} session on Windows when you 86 | use the MSDOS prompt shell, simply type @kbd{M-x S+6-msdos RET}. 87 | 88 | @node Current Features, New Features, Starting up, General Information 89 | @section Current Features 90 | 91 | @include currfeat.texi 92 | 93 | @node New Features, Reporting Bugs, Current Features, General Information 94 | @section New Features 95 | 96 | @include newfeat.texi 97 | 98 | @node Reporting Bugs, Mailing Lists, New Features, General Information 99 | @section Reporting Bugs 100 | 101 | @include bugrept.texi 102 | 103 | @node Mailing Lists, Authors, Reporting Bugs, General Information 104 | @section Mailing Lists 105 | 106 | @include mailing.texi 107 | 108 | @node Authors, , Mailing Lists, General Information 109 | @section Authors 110 | 111 | @include authors.texi 112 | 113 | @bye 114 | @c Remember to delete these lines before creating the info file. 115 | @iftex 116 | @lucidbook 117 | @bindingoffset = 0.5in 118 | @parindent = 0pt 119 | @end iftex 120 | 121 | @comment Local Variables: 122 | @comment TeX-master: "readme.texi" 123 | @comment End: 124 | -------------------------------------------------------------------------------- /doc/requires.texi: -------------------------------------------------------------------------------- 1 | ESS supports GNU Emacs versions 25.1 and newer. 2 | 3 | ESS is most likely to work with current/recent versions of the following 4 | statistical packages: R/S-PLUS, SAS, Stata, OpenBUGS and JAGS. 5 | 6 | To build the PDF documentation, you will need a version of TeX Live or 7 | texinfo that includes texi2dvi. 8 | -------------------------------------------------------------------------------- /etc/ESSR.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/etc/ESSR.rds -------------------------------------------------------------------------------- /etc/ESSR/BUILDESSR: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | ## -*- mode: R -*- 3 | ## code to build ESSR environment. 4 | ## Assume that current directory is etc/ESSR 5 | ## run "./BUILDESSR" to create ../ESSR.rda 6 | 7 | ## exactly as in inferior-ess-r-load-ESSR in ess-r-d.el 8 | source('./R/.load.R', local=TRUE) 9 | ESSR <- .ess.ESSR.load('./R/') 10 | saveRDS(ESSR, file = "../ESSR.rds") 11 | -------------------------------------------------------------------------------- /etc/ESSR/LOADREMOTE: -------------------------------------------------------------------------------- 1 | ## -*- mode: R -*- 2 | ## loading code which is first sent to R on remote sessions 3 | local({ 4 | ver <- '%s' ## <- passed from elisp 5 | root <- '~/.config/ESSR' 6 | if(!file.exists(root)) 7 | dir.create(root, recursive = TRUE) 8 | ## cannot use sprintf here 9 | essr_file <- file.path(root, paste('ESSRv', ver, '.rds', sep = '')) 10 | tryCatch({ 11 | if(!file.exists(essr_file)) { 12 | url <- paste('https://github.com/emacs-ess/ESS/raw/ESSRv', ver, '/etc/ESSR.rds', sep = '') 13 | utils::download.file(url, essr_file) 14 | } 15 | ESSR <- readRDS(essr_file) 16 | ESSR[[".ess.Rversion"]] <- ESSR[[".ess.getRversion"]]() 17 | attach(ESSR) 18 | print(TRUE) 19 | }, 20 | error = function(e) { 21 | print(e) 22 | print(FALSE) 23 | }) 24 | }) 25 | -------------------------------------------------------------------------------- /etc/ESSR/R/.load.R: -------------------------------------------------------------------------------- 1 | ## This file is sourced when R starts and `load.ESSR` is called. See 2 | ## inferior-ess-r-load-ESSR--local. 3 | ## Do not use _ in names, nor :: as they cannot be parsed in old R versions 4 | 5 | ## obtain the R version number as a string 6 | .ess.ESSR.get.rver <- function() { 7 | if(exists("getRversion", mode="function")) getRversion() 8 | else paste(R.version$major, R.version$minor, sep=".") 9 | } 10 | 11 | ## load .base.R and all other files into ESSR environment; then attach ESSR 12 | .ess.ESSR.load <- function(dir) { 13 | 14 | if (Sys.getenv("ESSR_TEST_LOAD_ERROR") != "") 15 | stop('Loading failed with a nice message.') 16 | 17 | Rver <- .ess.ESSR.get.rver() 18 | ESSR <- .ess.ESSR.create.env(Rver) 19 | .ess.ESSR.source.files(ESSR, dir, Rver) 20 | .ess.ESSR.attach.env(ESSR, Rver) 21 | 22 | ## BUILDESSR needs this: 23 | invisible(ESSR) 24 | } 25 | 26 | .ess.ESSR.create.env <- function(Rver) { 27 | 28 | ESSR <- 29 | if (Rver <= "1.3.0") ## really old library() revert order a bit 30 | attach(NULL, name = "ESSR") 31 | else if(length(nn <- names(formals(new.env))) && any(nn == "parent")) 32 | new.env(parent = 33 | if (Rver >= "1.9.0") getNamespace("utils") 34 | else .BaseNamespaceEnv) 35 | else 36 | new.env() 37 | 38 | assign(".ess.Rversion", Rver, envir = ESSR) 39 | 40 | ## updated by make !! 41 | VERSION <- "1.8" 42 | assign(".ess.ESSRversion", VERSION, envir = ESSR) 43 | 44 | ESSR 45 | } 46 | 47 | ## attempt to source the files in the ESSR directory and place the resulting R 48 | ## objects into ESSR environment; the updated version of the environment is 49 | ## returned 50 | .ess.ESSR.source.files <- function(ESSR, dir, Rver) { 51 | 52 | .source <- 53 | if(any("keep.source" == names(formals(sys.source)))) 54 | sys.source 55 | else 56 | function(..., keep.source) sys.source(...) 57 | 58 | ## .basic.R: 59 | try(.source(paste(dir,'/.basic.R', sep = ""), envir = ESSR, keep.source = FALSE)) 60 | 61 | ## all others try(*) as it will fail in old R 62 | if (Rver > "1.3.0") { # no sense if very old R 63 | for (f in dir(dir, pattern='\\.R$', full.names=TRUE)) 64 | try(.source(f, envir = ESSR, keep.source = FALSE)) 65 | } 66 | 67 | ESSR 68 | } 69 | 70 | 71 | ## attach the ESSR environment to the search path 72 | .ess.ESSR.attach.env <- function(ESSR, Rver) { 73 | if (Rver >= "2.4.0") 74 | attach(ESSR) 75 | else if (Rver > "1.3.0") { # borrow from older library() 76 | e <- attach(NULL, name = "ESSR") 77 | .Internal(lib.fixup(ESSR, e)) 78 | } else { # if old R, use as in that old library(): 79 | .Internal(lib.fixup(ESSR, .GlobalEnv)) 80 | } 81 | } 82 | 83 | 84 | ## copy any ESSR R objects in the global environment into a newly created ESSR 85 | ## environment; then remove the original objects and attach ESSR 86 | .ess.collect.ESSR.objects <- function() { 87 | 88 | Rver <- .ess.ESSR.get.rver() 89 | ESSR <- .ess.ESSR.create.env(Rver) 90 | essr.nms <- grep('\\.(ess|ESS)', ls(.GlobalEnv, all.names = TRUE), value = TRUE) 91 | for (nm in essr.nms) { 92 | assign(nm, get(nm, pos = .GlobalEnv), envir = ESSR) 93 | } 94 | .ess.ESSR.attach.env(ESSR, Rver) 95 | rm(list = essr.nms, pos = .GlobalEnv) 96 | } 97 | -------------------------------------------------------------------------------- /etc/ESSR/R/completion.R: -------------------------------------------------------------------------------- 1 | ## Do *NOT* use 1L -- it gives parse errors in historical versions of R 2 | 3 | ## Try a setup working in as old R as possible. 4 | ## ===> 5 | ## 1) do not use "_" in names! --- seems impossible for the Millenials .. 6 | ## 2) use our own simplified definition of '::' and ':::' ? 7 | ## 8 | if(!exists("local")) 9 | local <- function(expr, envir = environment()) { invisible(eval(expr, envir=envir)) } 10 | 11 | ##' Robust version of 12 | ##' utils:::.addFunctionInfo(c = c("recursive", "use.names")) # needed only for R <= 3.y.z 13 | local({ 14 | U <- asNamespace("utils"); fn <- ".addFunctionInfo" 15 | EX <- exists(fn, envir=U) 16 | if(EX && is.function(FN <- get(fn, envir=U))) { 17 | FN(c = c("recursive", "use.names")); ##dbg: cat("Calling utils:::",fn,"(c = ...)\n") 18 | } 19 | }) 20 | 21 | 22 | .ess_eval <- function(str, env = globalenv()) { 23 | ## don't remove; really need eval(parse( here!! 24 | tryCatch(eval(parse(text=str), envir = env), 25 | error=function(e) NULL) ## also works for special objects containing @:$ etc 26 | } 27 | 28 | .ess_nonull <- function(x, default = "") { 29 | if (is.null(x)) default 30 | else x 31 | } 32 | 33 | ## not needed for completion; called from (ess-r-xref--srcref *) in ../../../lisp/ess-r-xref.el 34 | .ess_srcref <- function(name, pkg) { 35 | if (!is.null(pkg) && requireNamespace(pkg)) { 36 | env <- asNamespace(pkg) 37 | } else { 38 | env <- globalenv() 39 | } 40 | fn <- .ess_eval(name, env) 41 | if (is.null(fn)) { 42 | objs <- utils::getAnywhere(name)$objs 43 | for (fn in objs) { 44 | if(is.function(fn)) 45 | break 46 | } 47 | } 48 | out <- "()\n" 49 | if (is.function(fn) && !is.null(utils::getSrcref(fn))) { 50 | file <- utils::getSrcFilename(fn, full.names = TRUE) 51 | if (file != "") { 52 | line <- .ess_nonull(utils::getSrcLocation(fn, "line" ), 1) 53 | col <- .ess_nonull(utils::getSrcLocation(fn, "column"), 1) 54 | out <- sprintf("(\"%s\" %d %d)\n", file, line, col - 1) 55 | } 56 | } 57 | cat(out) 58 | } 59 | 60 | 61 | .ess_fn_pkg <- function(fn_name) { 62 | objs <- utils::getAnywhere(fn_name) 63 | print(sub("(package|namespace):", "", objs$where)) 64 | } 65 | 66 | .ess_funargs <- function(funname) { 67 | if(.ess.Rversion > '2.14.1') { 68 | ## temporarily disable JIT compilation and errors 69 | comp <- compiler::enableJIT(0) 70 | op <- options(error=NULL) 71 | on.exit({ options(op); compiler::enableJIT(comp) }) 72 | } 73 | fun <- .ess_eval(funname) 74 | if(is.function(fun)) { 75 | special <- grepl('[:$@[]', funname) 76 | args <- if(!special){ 77 | fundef <- paste(funname, '.default',sep='') 78 | do.call('argsAnywhere', list(fundef)) 79 | } 80 | 81 | if(is.null(args)) 82 | args <- args(fun) 83 | if(is.null(args)) 84 | args <- do.call('argsAnywhere', list(funname)) 85 | 86 | fmls <- formals(args) 87 | fmls_names <- names(fmls) 88 | fmls <- gsub('\"', '\\\"', 89 | gsub("\\", "\\\\", as.character(fmls), fixed = TRUE), 90 | fixed=TRUE) 91 | args_alist <- 92 | sprintf("'(%s)", 93 | paste("(\"", fmls_names, "\" . \"", fmls, "\")", 94 | sep = '', collapse = ' ')) 95 | allargs <- 96 | if (special) fmls_names 97 | else tryCatch(gsub(' ?= ?', '', utils:::functionArgs(funname, ''), fixed = FALSE), 98 | error=function(e) NULL) 99 | allargs <- sprintf("'(\"%s\")", 100 | paste(allargs, collapse = '\" "')) 101 | envname <- 102 | if (is.primitive(fun)) "base" 103 | else environmentName(environment(fun)) 104 | if (envname == "R_GlobalEnv") envname <- "" 105 | cat(sprintf('(list \"%s\" %s %s)\n', 106 | envname, args_alist, allargs)) 107 | } 108 | } 109 | 110 | 111 | .ess_get_completions <- function(string, end, suffix = " = ") { 112 | oldopts <- utils::rc.options(funarg.suffix = suffix) 113 | on.exit(utils::rc.options(oldopts)) 114 | sett <- utils::rc.settings 115 | oldDots <- sett()[["dots"]] 116 | on.exit(sett(dots=oldDots), add=TRUE) 117 | sett(dots = FALSE) 118 | if(.ess.Rversion > '2.14.1') { 119 | comp <- compiler::enableJIT(0) 120 | op <- options(error=NULL) 121 | on.exit({ options(op); compiler::enableJIT(comp)}, add = TRUE) 122 | } 123 | utils:::.assignLinebuffer(string) 124 | utils:::.assignEnd(end) 125 | utils:::.guessTokenFromLine() 126 | utils:::.completeToken() 127 | c(get('token', envir=utils:::.CompletionEnv), 128 | utils:::.retrieveCompletions()) 129 | } 130 | 131 | .ess_arg_help <- function(arg, func) { 132 | op <- options(error=NULL) 133 | on.exit(options(op)) 134 | fguess <- 135 | if(is.null(func)) get('fguess', envir=utils:::.CompletionEnv) 136 | else func 137 | findArgHelp <- function(fun, arg){ 138 | file <- help(fun, try.all.packages=FALSE)[[1]] 139 | hlp <- utils:::.getHelpFile(file) 140 | id <- grep('arguments', tools:::RdTags(hlp), fixed=TRUE) 141 | if(length(id)){ 142 | arg_section <- hlp[[id[[1]]]] 143 | items <- grep('item', tools:::RdTags(arg_section), fixed=TRUE) 144 | ## cat('items:', items, fill=TRUE) 145 | if(length(items)){ 146 | arg_section <- arg_section[items] 147 | args <- unlist(lapply(arg_section, 148 | function(el) paste(unlist(el[[1]][[1]], TRUE, FALSE), collapse=''))) 149 | fits <- grep(arg, args, fixed=TRUE) 150 | ## cat('args', args, 'fits', fill=TRUE) 151 | if(length(fits)) 152 | paste(unlist(arg_section[[fits[1]]][[2]], TRUE, FALSE), collapse='') 153 | } 154 | } 155 | } 156 | funcs <- c(fguess, tryCatch(methods(fguess), 157 | warning= function(w) NULL, 158 | error = function(e) NULL)) 159 | if(length(funcs) > 1 && length(pos <- grep('default', funcs))) { 160 | funcs <- c(funcs[[pos[[1]]]], funcs[-pos[[1]]]) 161 | } 162 | i <- 1; found <- FALSE 163 | out <- 'No help found' 164 | while(i <= length(funcs) && is.null(out <- 165 | tryCatch(findArgHelp(funcs[[i]], arg), 166 | warning=function(w) {NULL}, 167 | error=function(e) {NULL}) 168 | )) 169 | i <- i + 1 170 | cat('\n\n', as.character(out), '\n') 171 | } 172 | -------------------------------------------------------------------------------- /etc/ESSR/R/misc.R: -------------------------------------------------------------------------------- 1 | .ess_weave <- function(command, file, encoding = NULL){ 2 | cmd_symb <- substitute(command) 3 | if (grepl('knit|purl', deparse(cmd_symb))) require(knitr) 4 | od <- getwd() 5 | on.exit(setwd(od)) 6 | setwd(dirname(file)) 7 | frame <- parent.frame() 8 | if (is.null(encoding)) 9 | eval(bquote(.(cmd_symb)(.(file))), envir = frame) 10 | else 11 | eval(bquote(.(cmd_symb)(.(file), encoding = .(encoding))), envir = frame) 12 | } 13 | 14 | .ess_knit <- function(file, output = NULL){ 15 | library(knitr) 16 | frame <- parent.frame() 17 | od <- getwd() 18 | on.exit(setwd(od)) 19 | setwd(dirname(file)) 20 | ## this bquote is really needed for data.table := operator to work correctly 21 | eval(bquote(knit(.(file), output = .(output))), envir = frame) 22 | } 23 | 24 | 25 | .ess_sweave <- function(file, output = NULL){ 26 | od <- getwd() 27 | frame <- parent.frame() 28 | on.exit(setwd(od)) 29 | setwd(dirname(file)) 30 | eval(bquote(Sweave(.(file), output = .(output))), envir = frame) 31 | } 32 | 33 | ## Users might find it useful. So don't prefix with .ess. 34 | .ess_htsummary <- function(x, hlength = 4, tlength = 4, digits = 3) { 35 | ## fixme: simplify and generalize 36 | snames <- c("mean", "sd", "min", "max", "nlev", "NAs") 37 | d <- " " 38 | num_sumr <- function(x){ 39 | c(f(mean(x, na.rm = TRUE)), 40 | f(sd(x, na.rm = TRUE)), 41 | f(min(x, na.rm = TRUE)), 42 | f(max(x, na.rm = TRUE)), 43 | d, 44 | f(sum(is.na(x), na.rm = TRUE))) 45 | } 46 | f <- function(x) format(x, digits = digits) 47 | 48 | if (is.data.frame(x) | is.matrix(x)) { 49 | if (nrow(x) <= tlength + hlength){ 50 | print(x) 51 | } else { 52 | if (is.matrix(x)) 53 | x <- data.frame(unclass(x)) 54 | ## conversion needed, to avoid problems with derived classes such 55 | ## as data.table 56 | h <- as.data.frame(head(x, hlength)) 57 | t <- as.data.frame(tail(x, tlength)) 58 | for (i in 1:ncol(x)) { 59 | h[[i]] <- f(h[[i]]) 60 | t[[i]] <- f(t[[i]]) 61 | } 62 | ## summaries 63 | sumr <- sapply(x, function(c){ 64 | if (is.logical(c)) 65 | ## treat logical as numeric; it's harmless 66 | c <- as.integer(c) 67 | if (is.numeric(c)) 68 | num_sumr(c) 69 | else if (is.factor(c)) c(d, d, d, d, nlevels(c), sum(is.na(c))) 70 | else rep.int(d, length(snames)) 71 | }) 72 | sumr <- as.data.frame(sumr) 73 | row.names(sumr) <- snames 74 | dots <- rep("...", ncol(x)) 75 | empty <- rep.int(" ", ncol(x)) 76 | lines <- rep.int(" ", ncol(x)) 77 | df <- rbind(h, ... = dots, t, `_____` = lines, sumr, ` ` = empty) 78 | print(df) 79 | } 80 | } else { 81 | cat("head(", hlength, "):\n", sep = "") 82 | print(head(x, hlength)) 83 | if (length(x) > tlength + hlength){ 84 | cat("\ntail(", tlength, "):\n", sep = "") 85 | print(tail(x, tlength)) 86 | } 87 | cat("_____\n") 88 | if (is.numeric(x) || is.logical(x)) 89 | print(structure(num_sumr(x), names = snames), quote = FALSE) 90 | else if (is.factor(x)){ 91 | cat("NAs: ", sum(is.na(x), na.rm = TRUE), "\n") 92 | cat("levels: \n") 93 | print(levels(x)) 94 | } 95 | } 96 | invisible(NULL) 97 | } 98 | 99 | 100 | .ess_vignettes <- function(all=FALSE) { 101 | vs <- unclass(browseVignettes(all = all)) 102 | vs <- vs[sapply(vs, length) > 0] 103 | 104 | mat2elist <- function(mat) { 105 | if (!is.null(dim(mat))){ 106 | apply(mat, 1, function(r) 107 | sprintf("(list \"%s\")", 108 | paste0(gsub("\"", "\\\\\"", 109 | as.vector(r[c("Title", "Dir", "PDF", 110 | "File", "R")])), 111 | collapse = "\" \""))) 112 | } 113 | } 114 | cat("(list \n", 115 | paste0(mapply(function(el, name) { 116 | sprintf("(list \"%s\" %s)", 117 | name, paste0(mat2elist(el), collapse = "\n")) 118 | }, 119 | vs, names(vs)), collapse = "\n"), ")\n") 120 | } 121 | 122 | .ess_Rd2txt <- function(rd) { 123 | fun <- tools::Rd2txt 124 | if (length(formals(fun)["stages"]))# newer R version 125 | fun(rd, stages = c("build", "install", "render")) 126 | else 127 | fun(rd) 128 | } 129 | 130 | ## Hacked help.start() to use with ess-rutils.el 131 | .ess_help_start <- function(update=FALSE, remote=NULL) { 132 | home <- if (is.null(remote)) { 133 | port <- tools::startDynamicHelp(NA) 134 | if (port > 0L) { 135 | if (update) 136 | make.packages.html(temp=TRUE) 137 | paste0("http://127.0.0.1:", port) 138 | } 139 | else stop(".ess_help_start() requires the HTTP server to be running", 140 | call.=FALSE) 141 | } else remote 142 | paste0(home, "/doc/html/index.html") 143 | } 144 | 145 | 146 | .ess.rdired <- function() { 147 | cat('\n') 148 | 149 | objs <- ls(envir = .GlobalEnv) 150 | if (length(objs)==0) { 151 | cat("No objects to view!\n") 152 | return(invisible(NULL)) 153 | } 154 | 155 | names(objs) <- objs 156 | objs <- lapply(objs, get, envir = .GlobalEnv) 157 | 158 | mode <- sapply(objs, data.class) 159 | length <- sapply(objs, length) 160 | size <- sapply(objs, function(obj) format(object.size(obj))) 161 | rows <- sapply(objs,nrow) 162 | # sapply returns a list rather than a vector if there are NULLs eg nrow returns NULL for non-dataframes. 163 | # check if list, replace NULLS with NA and convert to vector 164 | if (is.list(rows)) { 165 | rows[sapply(rows,is.null)] <- NA 166 | rows <- unlist(rows) 167 | } 168 | 169 | d <- data.frame(mode, length, rows, size) 170 | 171 | var.names <- row.names(d) 172 | 173 | ## If any names contain spaces, we need to quote around them. 174 | quotes <- rep('', length(var.names)) 175 | spaces <- grep(' ', var.names) 176 | if (any(spaces)) 177 | quotes[spaces] <- '\"' 178 | var.names <- paste(quotes, var.names, quotes, sep = '') 179 | row.names(d) <- paste(' ', var.names, sep = '') 180 | 181 | print(d) 182 | } 183 | -------------------------------------------------------------------------------- /etc/ESSR/R/mpi.R: -------------------------------------------------------------------------------- 1 | ## simple Message Parsing Interface 2 | 3 | .ess_mpi_send <- function(head, ...){ 4 | dots <- lapply(list(...), function(el) { 5 | if (is.null(el)) "nil" 6 | else if (is.logical(el)) {if (el) "t" else "nil"} 7 | else as.character(el) 8 | }) 9 | payload <- paste(dots, collapse = "") 10 | cat(sprintf("_%s%s\\", head, payload)) 11 | } 12 | 13 | .ess_mpi_message <- function(msg){ 14 | .ess_mpi_send("message", msg) 15 | } 16 | 17 | .ess_mpi_y_or_n <- function(prompt, callback = NULL){ 18 | .ess_mpi_send("y-or-n", prompt, callback) 19 | } 20 | 21 | .ess_mpi_eval <- function(expr, callback = NULL){ 22 | .ess_mpi_send("eval", expr, callback) 23 | } 24 | 25 | .ess_mpi_error <- function(msg) { 26 | .ess_mpi_send("error", msg) 27 | } 28 | 29 | -------------------------------------------------------------------------------- /etc/ESSR/R/pkg.R: -------------------------------------------------------------------------------- 1 | 2 | .ess_keep <- function(.x, .f, ...) { 3 | is_true <- vapply(.x, .f, logical(1), ...) 4 | .x[is_true] 5 | } 6 | 7 | .ess_devtools_functions <- function() { 8 | if (!requireNamespace("devtools")) { 9 | .ess_mpi_error("devtools is not installed") 10 | stop("internal error") 11 | } 12 | devtools_env <- asNamespace("devtools") 13 | exports <- getNamespaceExports("devtools") 14 | funs_exported <- as.list(devtools_env)[exports] 15 | 16 | is_first_arg <- function(f, arg) { 17 | args <- names(formals(f)) 18 | length(args) && args[[1]] == arg 19 | } 20 | 21 | funs_pkg <- .ess_keep(funs_exported, is.function) 22 | funs_pkg <- .ess_keep(funs_pkg, is_first_arg, "pkg") 23 | funs_names <- sort(names(funs_pkg)) 24 | 25 | funs_names 26 | } 27 | -------------------------------------------------------------------------------- /etc/Makefile: -------------------------------------------------------------------------------- 1 | ### Makefile - for scripts and icons (./etc) of ESS distribution. 2 | ### 3 | 4 | ## Before making changes here, please take a look at Makeconf 5 | include ../Makeconf 6 | 7 | #ETCFILES = $(wildcard BACKBUG[S5].BAT backbug[s5] *.S sas-keys.*) 8 | #ETCFILES = ESSR.R ess-developer.R SVN-REVISION *.S sas-keys.* ess-sas-sh-command 9 | # ETCFILES_1 = *.S sas-keys.* ess-sas-sh-command *.jl 10 | ETCFILES_1 = ess-sas-sh-command *.jl 11 | isRELEASE=$(shell test -f .IS.RELEASE && echo 'yes') 12 | ifeq ($(isRELEASE),yes) 13 | ETCFILES = .IS.RELEASE git-ref $(ETCFILES_1) 14 | else 15 | ETCFILES = $(ETCFILES_1) 16 | endif 17 | 18 | #ICONS = $(wildcard icons/*.xpm) 19 | ICONS = icons/*.xpm 20 | 21 | ESSR_UTIL_FILES = ESSR/LOADREMOTE 22 | ESSR_CODE_FILES = ESSR/R/*.R ESSR/R/.*.R 23 | 24 | all: 25 | 26 | show-etc: 27 | @echo $(ETCFILES) 28 | ls -l $(ETCFILES) 29 | 30 | install : 31 | $(INSTALLDIR) $(ETCDIR)/icons 32 | $(INSTALLDIR) $(ETCDIR)/ESSR/R 33 | $(INSTALL) $(ETCFILES) $(ETCDIR) 34 | $(INSTALL) $(ICONS) $(ETCDIR)/icons 35 | $(INSTALL) $(ESSR_UTIL_FILES) $(ETCDIR)/ESSR 36 | $(INSTALL) $(ESSR_CODE_FILES) $(ETCDIR)/ESSR/R 37 | chmod +x $(ETCDIR)/ess-sas-sh-command 38 | 39 | uninstall : 40 | -cd $(ETCDIR) && $(UNINSTALL) $(ETCFILES) 41 | -cd $(ETCDIR) && $(UNINSTALL) $(ICONS) 42 | -cd $(ETCDIR) && $(UNINSTALL) $(ESSR_UTIL_FILES) 43 | -cd $(ETCDIR) && $(UNINSTALL) $(ESSR_CODE_FILES) 44 | 45 | 46 | 47 | ## 'clean' shall remove *exactly* those things that are *not* in version control 48 | clean distclean: 49 | rm -rf SVN-REVISION 50 | ## 'distclean' removes also things in VC (svn, when they are remade by "make"): 51 | # distclean: clean 52 | # rm -rf ESSR_*.tar.gz 53 | -------------------------------------------------------------------------------- /etc/ess-julia.jl: -------------------------------------------------------------------------------- 1 | module ESS 2 | 3 | # These methods have been deprecated / moved 4 | macro current_module() 5 | return VERSION >= v"0.7-" ? :(@__MODULE__) : :(current_module()) 6 | end 7 | 8 | parse = VERSION >= v"0.7-" ? Base.Meta.parse : Base.parse 9 | function_module = VERSION >= v"0.7-" ? Base.parentmodule : Base.function_module 10 | 11 | function all_help_topics() 12 | ## There are not clear topics anymore. Approximate those with a very general 13 | ## apropos(" ") 14 | Base.Docs.apropos(" ") 15 | end 16 | 17 | function help(topic::AbstractString) 18 | if (VERSION >= v"1.0-") 19 | Core.eval(parentmodule(ESS), parse("@doc $topic")) 20 | elseif (VERSION >= v"0.4-") 21 | Core.eval(@current_module(), parse("@doc $topic")) 22 | else 23 | Base.Help.help(topic) 24 | end 25 | end 26 | 27 | ## modified version of function show(io::IO, m::Method) 28 | function fun_args(m::Method) 29 | tv, decls, file, line = Base.arg_decl_parts(m) 30 | io = VERSION >= v"0.7-" ? Base.stdout : STDOUT::IO # STDOUT is no longer in 1.0 31 | if !isempty(tv) 32 | Base.show_delim_array(io, tv, '{', ',', '}', false) 33 | end 34 | print(io, "(") 35 | join(io, [escape_string(isempty(d[2]) ? d[1] : d[1]*"::"*d[2]) for d in decls], 36 | ",", ",") 37 | Base.print(io, ")") 38 | end 39 | 40 | ## modified versionof show(io::IO, mt::MethodTable) 41 | function fun_args(f::Function) 42 | mt = Base.MethodList(methods(f).mt) 43 | mod = function_module(f) # Base.function_module deprecated in 0.7 44 | if mod == Main 45 | mod = "nil" 46 | end 47 | print("(list \"$mod\" nil '(") 48 | for d in mt 49 | print("\"") 50 | ## method 51 | fun_args(d) 52 | print("\" ") 53 | end 54 | print("))") 55 | end 56 | 57 | function fun_args(s::AbstractString) 58 | try 59 | mod = VERSION >= v"1.0-" ? parentmodule(ESS) : @current_module() 60 | m = Core.eval(mod, parse(s)) 61 | if ! isa(m, String) 62 | fun_args(m) 63 | end 64 | catch 65 | print("(list nil nil nil)") 66 | end 67 | end 68 | 69 | function fun_args(t::DataType) 70 | print("(list nil nil '(") 71 | for d = fieldnames(t) 72 | print("\"$d\" ") 73 | end 74 | print("))") 75 | end 76 | 77 | 78 | ### OBJECT COMPLETION 79 | # Must print an output of the form: 80 | # 81 | # Cache Module 82 | # Write Module 83 | # add Function 84 | # free Function 85 | function components(m::Module) 86 | for v in sort(names(m, all=true, imported=true)) 87 | s = string(v) 88 | if !startswith(s, "#") && isdefined(m,v) 89 | println(rpad(s, 30), summary(Core.eval(m,v))) 90 | end 91 | end 92 | end 93 | 94 | function components(t::DataType) 95 | for v in sort(fieldnames(t)) 96 | println(rpad(string(v), 30), "field") 97 | end 98 | end 99 | 100 | function components(v) 101 | t = typeof(v) 102 | if isa(t, DataType) 103 | return components(t) 104 | end 105 | end 106 | 107 | 108 | ### MISC 109 | function main_modules(m::Module) 110 | for nm in names(m) 111 | if isdefined(m, nm) 112 | mod = Core.eval(m, nm) 113 | if isa(mod, Module) 114 | print("\"$nm\" ") 115 | end 116 | end 117 | end 118 | end 119 | 120 | if VERSION >= v"0.7-" 121 | main_modules() = main_modules(Base.parentmodule(@current_module())) 122 | else 123 | main_modules() = main_modules(@current_module()) 124 | end 125 | 126 | end 127 | -------------------------------------------------------------------------------- /etc/ess-sas-sh-command: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ### (C) 1997, Richard M. Heiberger. 4 | ### This file is part of ESS. 5 | 6 | ## This file is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2, or (at your option) 9 | ## any later version. 10 | 11 | ## This file is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | 16 | ## A copy of the GNU General Public License is available at 17 | ## https://www.r-project.org/Licenses/ 18 | 19 | 20 | # For executing SAS, and running it in the proper manner for ESS 21 | # (feeding output back into appropriate ESS buffers). 22 | 23 | #echo $0 $@ 24 | #sas $1 2>$2 $3 25 | 26 | set -x 27 | stdout=$1 28 | stderr=$2 29 | shift 2 30 | set +x 31 | echo sas \$stdout 2\>$stderr $@ 32 | sas $stdout 2>$stderr $@ 33 | 34 | ## From the SAS online tech support: 35 | ## 36 | ## Redirecting the SAS Log and Output under UNIX. 37 | ## 38 | ## There are several ways of redirecting the SAS Log and Output under 39 | ## UNIX. 40 | ## 41 | ## To redirect the SAS Log, follow one of these steps: 42 | ## 43 | ## 1. 44 | ## In the source code, place the following line: 45 | ## 46 | ## proc printto log=stdout; 47 | ## 48 | ## to make a duplicate copy of the log in a file in addition 49 | ## to redirecting it to stdout, use this command to invoke 50 | ## SAS: 51 | ## 52 | ## sas -altlog doit.log doit.sas 53 | ## 54 | ## 2.Execute SAS in the background and use the UNIX 'tail' command 55 | ## to copy lines to stdout as they are added to the log. Use the 56 | ## command: 57 | ## 58 | ## sas doit.sas &; tail -f doit.log 59 | ## 60 | ## To redirect the SAS Log and Output under the Korn shell, use the 61 | ## following command: 62 | ## 63 | ## sas -stdio < doit.sas > doit.lst 2> doit.log 64 | ## 65 | ## To redirect the SAS Log and Output under the C-Shell, use the 66 | ## following command: 67 | ## 68 | ## (sas -stdio < doit.sas > doit.lst) >& doit.log 69 | 70 | ## From WWW.SAS.COM: 71 | ## How can I make SAS in batch mode behave like interactive SAS, 72 | ## continue running my SAS job, and not enter syntax check mode when 73 | ## it encounters an error? 74 | ## 75 | ## You can specify the NOSYNTAXCHECK option when you invoke your SAS 76 | ## program. 77 | -------------------------------------------------------------------------------- /etc/func.sas: -------------------------------------------------------------------------------- 1 | 2 | 3 | proc freq order=freq data=sashelp.vfunc; 4 | tables source fnctype fncprod; 5 | run; 6 | 7 | /* 8 | title 'FNCPROD=B'; 9 | proc print data=sashelp.vfunc; 10 | where fncname>' ' & FNCPROD='B'; 11 | run; 12 | 13 | title 'FNCPROD=X'; 14 | proc print data=sashelp.vfunc; 15 | where fncname>' ' & FNCPROD='X'; 16 | run; 17 | 18 | title 'FNCPROD=T'; 19 | proc print data=sashelp.vfunc; 20 | where fncname>' ' & FNCPROD='T'; 21 | run; 22 | 23 | title 'FNCPROD=I'; 24 | proc print data=sashelp.vfunc; 25 | where fncname>' ' & FNCPROD='I'; 26 | run; 27 | 28 | endsas; 29 | */ 30 | 31 | data vfunc; 32 | set sashelp.vfunc end=last; 33 | by fncname; 34 | where fncname>' ' & (fncprod='X' | source=fncprod='B'); 35 | file "func.txt"; 36 | 37 | if _n_=1 then do; 38 | put ";; SAS functions found in sashelp.vfunc where fncprod='X' | source=fncprod='B'"; 39 | end; 40 | 41 | if last.fncname; 42 | 43 | fncname=lowcase(fncname); 44 | 45 | retain alpha 'abcdefghijklmnopqrstuvwxyz' prev 1; 46 | 47 | format fncname $quote32.; 48 | 49 | i=indexc(alpha, substr(fncname, 1, 1)); 50 | 51 | if i>prev then do; 52 | prev=i; 53 | put; 54 | end; 55 | 56 | put fncname @; 57 | 58 | if last then put; 59 | run; 60 | 61 | data vfunc; 62 | set sashelp.vfunc end=last; 63 | by fncname; 64 | if last.fncname; 65 | 66 | where fncname>' ' & (fncprod='X' | source=fncprod='B'); 67 | file "check-func.sas"; 68 | 69 | fncname=trim(lowcase(fncname))||'();'; 70 | 71 | put fncname; 72 | run; 73 | 74 | proc contents varnum; 75 | run; 76 | 77 | proc print; 78 | var fncname; 79 | format fncname $quote32.; 80 | run; 81 | -------------------------------------------------------------------------------- /etc/icons/README: -------------------------------------------------------------------------------- 1 | 2 | Creating pixmaps: 3 | 4 | * spluslogo.xpm was dontated by David Smith at Insightful. 5 | 6 | * Other icons were created by SJE, using mostly `kiconedit' and 7 | hand-editing. 8 | 9 | * Transparency 10 | Need to add backgrounToolBarColor for XEmacs to show okay. 11 | e.g. /usr/share/xemacs-21.4.12/etc/toolbar/folder-cap-up.xpm 12 | has header: 13 | "X c Gray75 s backgroundToolBarColor", 14 | whereas I have set "c None" to indicate the background pixel; this line 15 | seems to work for both toolbars: 16 | ". c None s backgroundToolBarColor", 17 | 18 | * splus_letters_small.xpm 19 | 20 | 2010-05-18 & -21: SJE made this new Splus icon from the 21 | splus_letters_large.xpm (then image001.png from Louis Bajuk-Yorgan 22 | @tibco.com) file that Rich provided. I had to move the 23 | cross over to the left by one pixel, to then allow the image to be 24 | cropped to 48x48 (cropping performed in gimp). kiconedit was then 25 | used to rescale the icon to 24x24. Finally, background transparency 26 | added manually to the file, as noted above. 27 | 28 | 2010-05-21: updated file based on new image from TIBCO. Original 29 | 51x38 cropped to 50x38 in xv, then shrunk to 25x19 in kiconedit. 30 | Transparency added, and removed a lot of the extra white pixels into 31 | background colours manually in kiconedit. 32 | -------------------------------------------------------------------------------- /etc/icons/rbuffer.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *rbuffer[]={ 3 | "24 24 3 1", 4 | ". c None s backgroundToolBarColor", 5 | "a c #000000", 6 | "# c #1532ed", 7 | "........................", 8 | "...............#........", 9 | "...............##.......", 10 | ".....#############......", 11 | ".....##############.....", 12 | ".....#############......", 13 | "...............##.......", 14 | "...............#........", 15 | "........................", 16 | "........................", 17 | "........................", 18 | "...aaaaaaaaaaaaaaaaaa...", 19 | "........................", 20 | "........................", 21 | "...aaaaaaaaaaaaaaaaaa...", 22 | "........................", 23 | "........................", 24 | "...aaaaaaaaaaaaaaaaaa...", 25 | "........................", 26 | "........................", 27 | "...aaaaaaaaaaaaaaaaaa...", 28 | "........................", 29 | "........................", 30 | "...aaaaaaaaaaaaaaaaaa..."}; 31 | -------------------------------------------------------------------------------- /etc/icons/rfunction.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *rfunction[]={ 3 | "24 24 18 1", 4 | "B c #000000", 5 | "k c #181818", 6 | "Q c #1f1f1f", 7 | "z c #232323", 8 | "L c #313131", 9 | "Z c #3c3c3c", 10 | "O c #404040", 11 | "a c #5e5e5e", 12 | "W c #676767", 13 | "U c #757575", 14 | "N c #848484", 15 | "P c #969696", 16 | "0 c #a0a0a0", 17 | ". c None s backgroundToolBarColor", 18 | "G c #b9b9b9", 19 | "I c #c6c6c6", 20 | "T c #d5d5d5", 21 | "# c #1532ed", 22 | "........................", 23 | "...............#........", 24 | "...............##.......", 25 | ".....#############......", 26 | ".....##############.....", 27 | ".....#############......", 28 | "...............##.......", 29 | "...............#........", 30 | "........................", 31 | "........................", 32 | "........................", 33 | "..............az..zU....", 34 | "....ILBBz...GkP....aO...", 35 | "....zU......BG......LP..", 36 | "....BG.....UO.......0z..", 37 | "..BBBBBBP..zP.......GB..", 38 | "....BG.....BG........BI.", 39 | "....BG.....BG........BI.", 40 | "....BG.....LP.......GB..", 41 | "....BG.....NO.......PL..", 42 | "....BG......Q0......z0..", 43 | "....BG......TQU0..0ZW...", 44 | "..............NL..Z0....", 45 | "........................"}; 46 | -------------------------------------------------------------------------------- /etc/icons/rline.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *rline[]={ 3 | "24 24 3 1", 4 | ". c None s backgroundToolBarColor", 5 | "a c #000000", 6 | "# c #1532ed", 7 | "........................", 8 | "...............#........", 9 | "...............##.......", 10 | ".....#############......", 11 | ".....##############.....", 12 | ".....#############......", 13 | "...............##.......", 14 | "...............#........", 15 | "........................", 16 | "........................", 17 | "........................", 18 | "........................", 19 | "........................", 20 | "........................", 21 | "........................", 22 | "........................", 23 | "........................", 24 | "...aaaaaaaaaaaaaaaaaa...", 25 | "........................", 26 | "........................", 27 | "........................", 28 | "........................", 29 | "........................", 30 | "........................"}; 31 | -------------------------------------------------------------------------------- /etc/icons/rregion.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *rregion[]={ 3 | "24 24 3 1", 4 | ". c None s backgroundToolBarColor", 5 | "a c #000000", 6 | "# c #1532ed", 7 | "........................", 8 | "...............#........", 9 | "...............##.......", 10 | ".....#############......", 11 | ".....##############.....", 12 | ".....#############......", 13 | "...............##.......", 14 | "...............#........", 15 | "........................", 16 | "........................", 17 | "........................", 18 | "........................", 19 | "........................", 20 | "........................", 21 | "...aaaaaaaaaaaaaaaaaa...", 22 | "........................", 23 | "........................", 24 | "...aaaaaaaaaaaaaaaaaa...", 25 | "........................", 26 | "........................", 27 | "...aaaaaaaaaaaaaaaaaa...", 28 | "........................", 29 | "........................", 30 | "........................"}; 31 | -------------------------------------------------------------------------------- /etc/icons/splus_letter_small.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *dummy[]={ 3 | "25 19 151 2", 4 | "Qt c None s backgroundToolBarColor", 5 | "#M c #044b83", 6 | "#R c #044c86", 7 | "#t c #044c87", 8 | "ae c #044d87", 9 | "an c #044e7f", 10 | ".o c #044e81", 11 | "#l c #044e8d", 12 | "ak c #044f84", 13 | ".B c #044f88", 14 | "#m c #044f8e", 15 | "am c #045188", 16 | ".j c #04518b", 17 | ".O c #045191", 18 | "#6 c #04528f", 19 | "#O c #045388", 20 | ".k c #04538c", 21 | "#U c #04538e", 22 | "#Y c #045392", 23 | ".l c #045489", 24 | "## c #04548c", 25 | "#i c #045490", 26 | "#v c #045492", 27 | "#. c #04558e", 28 | "#C c #045593", 29 | "#k c #04568d", 30 | "#B c #045695", 31 | "#G c #045698", 32 | ".Y c #045795", 33 | ".R c #045890", 34 | "#j c #04598f", 35 | ".4 c #045995", 36 | "aj c #054e7b", 37 | "al c #054e89", 38 | "#h c #054e8d", 39 | "#S c #055188", 40 | "#V c #05518d", 41 | ".m c #055282", 42 | ".K c #055284", 43 | ".5 c #055583", 44 | ".t c #055791", 45 | "#u c #055894", 46 | ".n c #064e86", 47 | "#s c #074d76", 48 | ".p c #074e83", 49 | "a. c #074f89", 50 | "#a c #074f8a", 51 | "af c #075389", 52 | "#9 c #07548e", 53 | ".A c #075592", 54 | ".F c #075594", 55 | "#1 c #075a99", 56 | ".c c #094d79", 57 | ".9 c #094f89", 58 | ".J c #095681", 59 | "#A c #0b568d", 60 | ".s c #0c4f85", 61 | "#5 c #0c5188", 62 | "#w c #0d5486", 63 | ".b c #0e4e7d", 64 | ".N c #105287", 65 | ".X c #105685", 66 | "#H c #115789", 67 | "#Z c #13508a", 68 | "#2 c #135287", 69 | "#F c #195c8a", 70 | ".i c #1a5c8b", 71 | "#8 c #1b5684", 72 | "ai c #1b5a81", 73 | "ad c #1c5d87", 74 | "#P c #1d5c8c", 75 | "#r c #1d5f8a", 76 | "#N c #1f5b7d", 77 | "ao c #1f5c85", 78 | "#0 c #205a86", 79 | "#n c #206292", 80 | ".u c #216794", 81 | ".d c #245b81", 82 | ".G c #256390", 83 | ".3 c #265f85", 84 | "a# c #266287", 85 | "#x c #296286", 86 | "#b c #2a5f96", 87 | "#g c #2b6395", 88 | ".a c #2c658f", 89 | ".Q c #307195", 90 | ".E c #326897", 91 | ".S c #356f98", 92 | ".Z c #35789b", 93 | "ag c #396c94", 94 | "#I c #3a6a78", 95 | "#z c #3f7497", 96 | ".1 c #3f7c9e", 97 | "#J c #427585", 98 | "aa c #42768f", 99 | "#X c #447ca1", 100 | ".C c #457b9a", 101 | ".z c #457ba8", 102 | "ac c #48778f", 103 | ".q c #4e86b0", 104 | "#7 c #4f86b5", 105 | ".6 c #50829b", 106 | "#q c #538db5", 107 | "#D c #538eb3", 108 | ".e c #547f91", 109 | "ab c #5487a1", 110 | "#T c #58859c", 111 | "ah c #5983a7", 112 | "#c c #5a7d99", 113 | ".2 c #5b809c", 114 | ".P c #5d94bb", 115 | "#K c #6c91a0", 116 | "#4 c #6c99ba", 117 | "#L c #6c9cb7", 118 | "#o c #7097a7", 119 | "ap c #739eb3", 120 | ".v c #73a7c0", 121 | ".0 c #7cacc3", 122 | "#y c #7faac6", 123 | ".# c #82a0a8", 124 | "#Q c #84aec8", 125 | ".I c #86a8bd", 126 | ".L c #89b3cd", 127 | "#d c #8aa7b6", 128 | "as c #8db2cc", 129 | ".y c #8db9cd", 130 | ".h c #8eb5c9", 131 | ".8 c #8eb9d3", 132 | "#W c #8fb2c9", 133 | "at c #91b7c8", 134 | "#3 c #94b4cb", 135 | "ar c #95b7cb", 136 | ".T c #979798", 137 | ".U c #99999a", 138 | "#f c #99b9cd", 139 | ".g c #9b9b9b", 140 | ".V c #9c9c9c", 141 | ".r c #9cc2d4", 142 | ".w c #a7c8d0", 143 | ".x c #a9c8d1", 144 | "#p c #a9cbda", 145 | ".f c #abc5cd", 146 | "#E c #abcad6", 147 | "aq c #b1d0e0", 148 | "au c #b3d2e2", 149 | ".7 c #b8cfd6", 150 | "#e c #baced7", 151 | ".W c #d4e0e4", 152 | ".H c #d7e7ed", 153 | ".M c #dae6ef", 154 | ".D c #eef8f8", 155 | "QtQtQtQt.#.a.b.c.d.e.fQtQtQtQtQtQtQtQt.g.gQtQtQtQt", 156 | "QtQt.h.i.j.k.l.m.n.o.p.qQtQtQtQtQtQtQt.g.gQtQtQtQt", 157 | "Qt.r.s.t.u.v.w.x.y.z.A.B.CQtQtQtQtQtQt.g.gQtQtQtQt", 158 | ".D.E.F.G.HQtQtQtQtQt.I.J.K.LQtQtQtQtQt.g.gQtQtQtQt", 159 | ".M.N.O.PQtQtQtQtQtQtQt.Q.R.SQt.g.T.U.g.g.g.V.V.g.g", 160 | ".W.X.Y.ZQtQtQtQtQtQtQt.0.1.2Qt.g.g.g.g.g.g.g.g.g.g", 161 | "Qt.3.4.5.6.7QtQtQtQtQtQtQtQtQtQtQtQtQt.g.gQtQtQtQt", 162 | "Qt.8.9#.###a#b#c#d#eQtQtQtQtQtQtQtQtQt.g.gQtQtQtQt", 163 | "QtQt#f#g#h#i#j#k#l#m#n#oQtQtQtQtQtQtQt.g.gQtQtQtQt", 164 | "QtQtQtQt#p#q#r#s#t#u#v#w#xQtQtQtQtQtQt.g.gQtQtQtQt", 165 | "QtQtQtQtQtQtQtQt#y#z#A#B#C#DQtQtQtQtQtQtQtQtQtQtQt", 166 | "QtQtQtQtQtQtQtQtQtQt#E#F#G#HQtQtQtQtQtQtQtQtQtQtQt", 167 | "#I#J#KQtQtQtQtQtQtQtQt#L.B#MQtQtQtQtQtQtQtQtQtQtQt", 168 | "#N#O#PQtQtQtQtQtQtQtQt#Q#R#SQtQtQtQtQtQtQtQtQtQtQt", 169 | "#T#U#V#WQtQtQtQtQtQtQt#X#Y#ZQtQtQtQtQtQtQtQtQtQtQt", 170 | "Qt#0#1#2#3QtQtQtQtQt#4#5#6#7QtQtQtQtQtQtQtQtQtQtQt", 171 | "QtQt#8#9a.a#aaabacadaeafagQtQtQtQtQtQtQtQtQtQtQtQt", 172 | "QtQtQtahaiajakalamanaoapQtQtQtQtQtQtQtQtQtQtQtQtQt", 173 | "QtQtQtQtQtaqarasatauQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt"}; 174 | -------------------------------------------------------------------------------- /etc/icons/splus_letters_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/etc/icons/splus_letters_large.png -------------------------------------------------------------------------------- /etc/icons/spluslogo.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *spluslogo[]={ 3 | "24 24 10 1", 4 | "a c None s backgroundToolBarColor", 5 | "g c #000000", 6 | "h c #838383", 7 | "# c #ce3000", 8 | "f c #ce3062", 9 | "e c #ce6262", 10 | ". c #ce629b", 11 | "b c #cecece", 12 | "d c #ffcece", 13 | "c c #ffceff", 14 | ".##aaaa###aa#aab#a#ba.##", 15 | "#a#caaa#db#a#aab#a#bd#a#", 16 | "##caaaa#b#.a#aad#a#ba##c", 17 | "a.#a##a##.ca#aab#a#daa.#", 18 | "ea#aaaa#daaa#aab#a#bbea#", 19 | "##.aaaa#daaa###a.f#ac##.", 20 | "aaaaaaaaaaaaaaaaaaaaaaaa", 21 | "aaaaaaaaaaaaaaaaaaaaaaaa", 22 | "aaaaaggga###ahhhaaaaaaaa", 23 | "aaaaaggga###ahhhaaaaaaaa", 24 | "aaaaaggga###ahhhaaaaaaaa", 25 | "aaaaaaaaaaaaaaaaaaaaaaaa", 26 | "aaaaa###ahhhaaaahhhaaaaa", 27 | "aaaaa###ahhhaaaahhhaaaaa", 28 | "aaaaa###ahhhaaaahhhaaaaa", 29 | "aaaaaaaaaaaaaaaaaaaaaaaa", 30 | "aaaaahhhaaaahhha###aaaaa", 31 | "aaaaahhhaaaahhha###aaaaa", 32 | "aaaaahhhaaaahhha###aaaaa", 33 | "aaaaaaaaaaaaaaaaaaaaaaaa", 34 | "aaaaaaaahhha###agggaaaaa", 35 | "aaaaaaaahhha###agggaaaaa", 36 | "aaaaaaaahhha###agggaaaaa", 37 | "aaaaaaaaaaaaaaaaaaaaaaaa"}; 38 | -------------------------------------------------------------------------------- /etc/icons/spluslogo.xpm.safe: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *spluslogo[] = { 3 | /* width height num_colors chars_per_pixel */ 4 | " 24 24 13 1", 5 | /* colors */ 6 | ". c #000000", 7 | "# c #303062", 8 | "a c #494949", 9 | "b c #626262", 10 | "c c #838383", 11 | "d c #ce3000", 12 | "e c #ce3062", 13 | "f c #ce6262", 14 | "g c #ce629b", 15 | "h c #cecece", 16 | "i c #ffcece", 17 | "j c #ffceff", 18 | "k c None", 19 | /* pixels */ 20 | "gddkkkkdddiidkkhdkdhkgdd", 21 | "dkdjkkkdihdidkkhdkdhidkd", 22 | "ddjkkkkdhdgidkkidkdhkddj", 23 | "kgdkddkddgjidkkhdkdikkgd", 24 | "fkdiiikdikkidkkhdkdhhfkd", 25 | "ddgkkkkdikkidddkgedkjddg", 26 | "kkkkkkkkkkkkkkkkkkkkkkkk", 27 | "kkkkkkkkkkkkkkkkkkkkkkkk", 28 | "kkkkk...kdddkccckkkkkkkk", 29 | "kkkkk...kdddkccckkkkkkkk", 30 | "kkkkk...kdddkccckkkkkkkk", 31 | "kkkkkkkkkkkkkkkkkkkkkkkk", 32 | "kkkkkdddkccckkkkccckkkkk", 33 | "kkkkkdddkccckkkkccckkkkk", 34 | "kkkkkdddkccckkkkccckkkkk", 35 | "kkkkkkkkkkkkkkkkkkkkkkkk", 36 | "kkkkkccckkkkccckdddkkkkk", 37 | "kkkkkccckkkkccckdddkkkkk", 38 | "kkkkkccckkkkccckdddkkkkk", 39 | "kkkkkkkkkkkkkkkkkkkkkkkk", 40 | "kkkkkkkkccckdddk...kkkkk", 41 | "kkkkkkkkccckdddk...kkkkk", 42 | "kkkkkkkkccckdddk...kkkkk", 43 | "kkkkkkkkkkkkkkkkkkkkkkkk" 44 | }; 45 | -------------------------------------------------------------------------------- /etc/icons/startr.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *rlogo3[] = { 3 | /* width height num_colors chars_per_pixel */ 4 | " 24 24 130 2", 5 | /* colors */ 6 | ".. c None s backgroundToolBarColor", 7 | ".# c #747684", 8 | ".a c #acaeac", 9 | ".b c #8492bc", 10 | ".c c #94a2c4", 11 | ".d c #c4cacc", 12 | ".e c #84868c", 13 | ".f c #3c424c", 14 | ".g c #949aac", 15 | ".h c #bcbec4", 16 | ".i c #545e74", 17 | ".j c #d4dae4", 18 | ".k c #94a2d4", 19 | ".l c #8492c4", 20 | ".m c #7486ac", 21 | ".n c #a4b2d4", 22 | ".o c #ccd2e4", 23 | ".p c #9caacc", 24 | ".q c #8c9ac4", 25 | ".r c #848eac", 26 | ".s c #444e64", 27 | ".t c #949acc", 28 | ".u c #bcc2ec", 29 | ".v c #dce2e4", 30 | ".w c #b4bad4", 31 | ".x c #5c6674", 32 | ".y c #d4daec", 33 | ".z c #9ca2d4", 34 | ".A c #acbae4", 35 | ".B c #7c82a4", 36 | ".C c #6c769c", 37 | ".D c #d4d2d4", 38 | ".E c #8c92c4", 39 | ".F c #7c8eac", 40 | ".G c #a4b2dc", 41 | ".H c #545664", 42 | ".I c #8c92ac", 43 | ".J c #8c8e94", 44 | ".K c #949abc", 45 | ".L c #5c5e74", 46 | ".M c #7c86ac", 47 | ".N c #747ea4", 48 | ".O c #242a34", 49 | ".P c #9ca2bc", 50 | ".Q c #8c8a8c", 51 | ".R c #6c6e7c", 52 | ".S c #7482b4", 53 | ".T c #9c9aa4", 54 | ".U c #b4bedc", 55 | ".V c #dcdedc", 56 | ".W c #94a6d4", 57 | ".X c #8496c4", 58 | ".Y c #acb2cc", 59 | ".Z c #ccd2f4", 60 | ".0 c #8c9ad4", 61 | ".1 c #848ebc", 62 | ".2 c #949ed4", 63 | ".3 c #9ca6dc", 64 | ".4 c #7c8abc", 65 | ".5 c #7482a4", 66 | ".6 c #3c3a3c", 67 | ".7 c #9ca6bc", 68 | ".8 c #747a8c", 69 | ".9 c #acaebc", 70 | "#. c #8496b4", 71 | "## c #c4cadc", 72 | "#a c #545e84", 73 | "#b c #747aa4", 74 | "#c c #64728c", 75 | "#d c #ccd6ec", 76 | "#e c #9caadc", 77 | "#f c #8c9ecc", 78 | "#g c #949ec4", 79 | "#h c #bcc6f4", 80 | "#i c #9ca6cc", 81 | "#j c #8c96c4", 82 | "#k c #8c96bc", 83 | "#l c #5c6274", 84 | "#m c #7c8ab4", 85 | "#n c #4c4e6c", 86 | "#o c #9c9ea4", 87 | "#p c #acb6d4", 88 | "#q c #acaeb4", 89 | "#r c #848694", 90 | "#s c #3c465c", 91 | "#t c #bcbecc", 92 | "#u c #545e7c", 93 | "#v c #d4dee4", 94 | "#w c #6c7aa4", 95 | "#x c #94a2dc", 96 | "#y c #8492cc", 97 | "#z c #7486b4", 98 | "#A c #646a84", 99 | "#B c #9caad4", 100 | "#C c #8c9acc", 101 | "#D c #848eb4", 102 | "#E c #4c4e54", 103 | "#F c #bcc6e4", 104 | "#G c #5c668c", 105 | "#H c #d4deec", 106 | "#I c #7c82ac", 107 | "#J c #6c7a9c", 108 | "#K c #a4aac4", 109 | "#L c #d4d6dc", 110 | "#M c #a4b2e4", 111 | "#N c #545674", 112 | "#O c #b4bac4", 113 | "#P c #8c96b4", 114 | "#Q c #c4c6cc", 115 | "#R c #7c86b4", 116 | "#S c #2c2e3c", 117 | "#T c #bcc2d4", 118 | "#U c #ccced4", 119 | "#V c #6c727c", 120 | "#W c #c4cedc", 121 | "#X c #4c526c", 122 | "#Y c #747eac", 123 | "#Z c #9ca2c4", 124 | "#0 c #8c8a94", 125 | "#1 c #dcdee4", 126 | "#2 c #94a6dc", 127 | "#3 c #8496cc", 128 | "#4 c #acb2d4", 129 | "#5 c #848ec4", 130 | "#6 c #dcdef4", 131 | "#7 c #7482ac", 132 | "#8 c #949ecc", 133 | "#9 c #9ca6d4", 134 | "a. c #8c96cc", 135 | "a# c #5c627c", 136 | /* pixels */ 137 | "................................................", 138 | "................................................", 139 | ".....d.y#H#v.j#v.j#v.y#v#v.j.j#W#F#p............", 140 | "....#4.b#J#w#I.P#i#g#Z#8#Z#j#R#Y#ma.#P.j........", 141 | ".....Y.l.5.X.u.P.i#n.s#n#u#b#8.X.4.4.M#r........", 142 | ".....Y#y#z.3.G#X.Q.Q.Q#0.J#r#a.b#ja..E.C........", 143 | ".....Y#y.m.k#8.x.............Y#m.4.2.z.H.T......", 144 | ".....Y.E.S.k#8#l...............q#z.0.3#N.g......", 145 | ".....Y.l#z#9.ta#..............#B#Y.k.G.L#Q......", 146 | ".....Y.E.m.2.t.C............#6.I.F#d.I#s........", 147 | ".....Y.l#za..l.g#L#1.v#1.o#U#K#P###T#S#o........", 148 | ".....Y.X#7a.#j.b#C.p.c#..N.C.K#W#r.O.6.D........", 149 | ".....Y#y#7.2.Z.o.I.B.I#9#f#x#h#s#E#q............", 150 | ".....Y#j#7.W.u.i.6.f#X#A#j#2#e#X#T..............", 151 | ".....Y#y.m.k#8#l......#O#G#j#f.F.w..............", 152 | ".....Y#y#I#x#8#l.........9.N.l#R.1#J#Q..........", 153 | ".....Y#5#z.k#8#l........#O#c#D#5#5.b.I.V........", 154 | "....#4.l#R.k.t#l...........9.N.l#3.E.C.g........", 155 | ".....Y#y.m#x#8.x.............g.b#3#C.1.C#U......", 156 | "....#4.E#k.A#i#l.............7#Y.X#M.p.B.g......", 157 | ".....Y.1.c.U.K.i..............#G#m.n#p.r.i......", 158 | "....#t.8#V#A.R.e...............h.8.R.R.R.#.a....", 159 | "................................................", 160 | "................................................" 161 | }; 162 | -------------------------------------------------------------------------------- /etc/icons/switch_ess.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *switch_ess[]={ 3 | "24 24 13 1", 4 | ". c None s backgroundToolBarColor", 5 | "a c #000000", 6 | "e c #131313", 7 | "# c #1532ed", 8 | "d c #313131", 9 | "k c #434343", 10 | "j c #535353", 11 | "h c #707070", 12 | "b c #878787", 13 | "i c #949494", 14 | "g c #a0a0a0", 15 | "f c #bfbfbf", 16 | "c c #c3c3c3", 17 | "........................", 18 | "........................", 19 | "........................", 20 | "........................", 21 | "..###...................", 22 | "..###...................", 23 | "..###...................", 24 | "..###.aaaab.cdedc.cdedc.", 25 | "..###.af....ag....ag....", 26 | "..###.af....ba....ba....", 27 | "..###.aaad...fah...fah..", 28 | "..###.af.......ga....ga.", 29 | "..###.af....i..jk.i..jk.", 30 | "..###.aaaak.jeej..jeej..", 31 | "..###...................", 32 | "..###...................", 33 | "..###...................", 34 | "..###...........#.......", 35 | "..###...........##......", 36 | "..#################.....", 37 | "..##################....", 38 | "...################.....", 39 | "................##......", 40 | "................#......."}; 41 | -------------------------------------------------------------------------------- /etc/icons/switchr.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *rt4[]={ 3 | "24 24 85 2", 4 | "Qt c None s backgroundToolBarColor", 5 | ".V c #14162c", 6 | ".A c #1c263c", 7 | "#d c #24263c", 8 | ".K c #242e44", 9 | ".H c #2c3244", 10 | "#o c #2c3644", 11 | ".Q c #34364c", 12 | ".Z c #3c3e54", 13 | ".N c #3c4264", 14 | ".q c #444664", 15 | ".p c #444a64", 16 | "#. c #444e64", 17 | ".r c #4c4e6c", 18 | ".w c #4c566c", 19 | "#m c #545e74", 20 | "#j c #546284", 21 | ".B c #54628c", 22 | "#e c #5c6284", 23 | ".4 c #5c6a9c", 24 | "#k c #646a8c", 25 | "#p c #646e8c", 26 | ".5 c #646e9c", 27 | ".S c #647294", 28 | ".b c #647a94", 29 | ".c c #6c769c", 30 | ".h c #6c7aa4", 31 | ".3 c #6c7ea4", 32 | ".k c #747ea4", 33 | ".O c #7482b4", 34 | ".u c #7482bc", 35 | ".i c #7486b4", 36 | ".X c #7c82a4", 37 | ".d c #7c86a4", 38 | ".g c #7c86ac", 39 | "#b c #7c86b4", 40 | ".E c #7c86bc", 41 | "#h c #7c8abc", 42 | ".L c #7c8ac4", 43 | ".a c #7c8eb4", 44 | "## c #848eac", 45 | ".# c #848ebc", 46 | ".2 c #8492b4", 47 | ".m c #8492bc", 48 | ".l c #8492c4", 49 | ".I c #8492cc", 50 | ".t c #8496c4", 51 | ".f c #8c92b4", 52 | ".v c #8c92c4", 53 | ".W c #8c92cc", 54 | ".7 c #8c96a4", 55 | ".e c #8c96bc", 56 | ".F c #8c96c4", 57 | "#l c #8c96cc", 58 | ".y c #8c9ac4", 59 | ".C c #8c9ad4", 60 | "#f c #8c9ed4", 61 | ".1 c #949ac4", 62 | ".0 c #949ad4", 63 | ".D c #949ecc", 64 | "#g c #94a2d4", 65 | ".Y c #9ca6c4", 66 | ".j c #9caadc", 67 | "#a c #9caae4", 68 | ".J c #a4aae4", 69 | ".T c #a4aed4", 70 | ".P c #a4aee4", 71 | "#i c #a4b2ec", 72 | ".9 c #acaebc", 73 | ".s c #acb2e4", 74 | "#n c #acb2ec", 75 | ".G c #acb6e4", 76 | ".M c #b4baf4", 77 | ".o c #b4bedc", 78 | "#c c #b4bef4", 79 | "#s c #b4c6ec", 80 | ".n c #bcc2ec", 81 | ".z c #bcc2fc", 82 | ".U c #c4cef4", 83 | ".6 c #ccd2ec", 84 | ".8 c #ccd2fc", 85 | ".R c #ccd6ec", 86 | "#r c #d4defc", 87 | "#q c #d4e2fc", 88 | ".x c #1532ed", 89 | "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", 90 | "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", 91 | "QtQtQtQtQtQtQt.#.a.b.c.d.e.e.e.f.g.h.i.j.kQtQtQt", 92 | "QtQtQtQtQtQtQt.l.i.m.n.o.p.q.q.r.g.s.t.u.v.wQtQt", 93 | "QtQt.x.x.xQtQt.m.i.y.z.AQtQtQtQtQt.B.#.C.D.rQtQt", 94 | "QtQt.x.x.xQtQt.m.E.F.G.HQtQtQtQtQtQt.m.I.J.rQtQt", 95 | "QtQt.x.x.xQtQt.#.i.t.s.KQtQtQtQtQtQt.D.L.M.NQtQt", 96 | "QtQt.x.x.xQtQt.#.O.y.P.QQtQtQtQtQt.R.S.T.U.VQtQt", 97 | "QtQt.x.x.xQtQt.#.i.t.W.FQtQtQtQtQt.X.Y.U.ZQtQtQt", 98 | "QtQt.x.x.xQtQt.#.i.m.0.1.t.2.3.4.5.6.7.VQtQtQtQt", 99 | "QtQt.x.x.xQtQt.#.i.l.8.9.Q#.##.P#a.GQtQtQtQtQtQt", 100 | "QtQt.x.x.xQtQt.##b.t#c#dQtQtQt#e#f#g.SQtQtQtQtQt", 101 | "QtQt.x.x.xQtQt.##h.t#i.KQtQtQtQt#b.m#h.aQtQtQtQt", 102 | "QtQt.x.x.xQtQt.#.O.t#i.KQtQtQtQt#j.#.l.l#kQtQtQt", 103 | "QtQt.x.x.xQtQt.F.O.y.s.HQtQtQtQtQt#b.l#l.##mQtQt", 104 | "QtQt.x.x.xQtQt.##b.F#n#oQtQtQtQtQt#j.F#f.m#pQtQt", 105 | "QtQt.x.x.xQtQt.#.t#q#r.KQtQtQtQtQtQt.i#s#q.YQtQt", 106 | "QtQt.x.x.xQtQtQtQtQtQtQtQtQtQtQt.xQtQtQtQtQtQtQt", 107 | "QtQt.x.x.xQtQtQtQtQtQtQtQtQtQtQt.x.xQtQtQtQtQtQt", 108 | "QtQt.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.xQtQtQtQtQt", 109 | "QtQt.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.xQtQtQtQt", 110 | "QtQtQt.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.xQtQtQtQtQt", 111 | "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.x.xQtQtQtQtQtQt", 112 | "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.xQtQtQtQtQtQtQt"}; 113 | -------------------------------------------------------------------------------- /etc/icons/switchs.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *switchs[]={ 3 | "24 24 5 1", 4 | ". c None", 5 | "# c #000000", 6 | "c c #1532ed", 7 | "b c #838383", 8 | "a c #ce3000", 9 | "........................", 10 | "........###.aaa.bbb.....", 11 | "........###.aaa.bbb.....", 12 | "........###.aaa.bbb.....", 13 | "..ccc...................", 14 | "..ccc...aaa.bbb....bbb..", 15 | "..ccc...aaa.bbb....bbb..", 16 | "..ccc...aaa.bbb....bbb..", 17 | "..ccc...................", 18 | "..ccc...bbb....bbb.aaa..", 19 | "..ccc...bbb....bbb.aaa..", 20 | "..ccc...bbb....bbb.aaa..", 21 | "..ccc...................", 22 | "..ccc......bbb.aaa.###..", 23 | "..ccc......bbb.aaa.###..", 24 | "..ccc......bbb.aaa.###..", 25 | "..ccc...................", 26 | "..ccc...........c.......", 27 | "..ccc...........cc......", 28 | "..ccccccccccccccccc.....", 29 | "..cccccccccccccccccc....", 30 | "...cccccccccccccccc.....", 31 | "................cc......", 32 | "................c......."}; 33 | -------------------------------------------------------------------------------- /etc/proc.sas: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | all.txt scraped from 4 | ; 5 | */ 6 | 7 | data proc; 8 | length name $ 20; 9 | infile 'all.txt'; 10 | 11 | input name; 12 | 13 | if length(name)>1 & name^='SAS'; 14 | 15 | if verify(name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ')=0; 16 | 17 | name=lowcase(name); 18 | run; 19 | 20 | proc sort nodupkey data=proc; 21 | by name; 22 | run; 23 | 24 | data proc; 25 | set proc; 26 | by name; 27 | *these PROCs are not present on my system: YMMV; 28 | *if it starts with HP, then it requires the high-performance products; 29 | *where name not in:( 30 | 'aggregation', 'appsrv', 31 | 'compile', 32 | 'db2ext', 'db2util', 'dmsrvadm', 'dmsrvdatasvc', 'dmsrvprocesssvc', 33 | 'dqloclst', 'dqmatch', 'dqscheme', 34 | 'gis', 35 | 'hp', 36 | 'imstat', 'imxfer', 'items', 37 | 'lasr', 38 | 'mddb', 39 | 'optgraph', 40 | 'pds', 'pdscopy', 41 | 'quest', 42 | 'rdc', 'rdpool', 'rdsec', 'recommend', 'release', 'risk', 43 | 'source', 44 | 'tapecopy', 'tapelabel', 45 | 'vasmp' 46 | ); 47 | run; 48 | 49 | proc print; 50 | run; 51 | 52 | data proc; 53 | set proc end=last; 54 | 55 | file "proc.txt"; 56 | 57 | retain alpha 'abcdefghijklmnopqrstuvwxyz' prev 1; 58 | 59 | format name $quote32.; 60 | 61 | i=indexc(alpha, substr(name, 1, 1)); 62 | 63 | if i>prev then do; 64 | prev=i; 65 | put; 66 | end; 67 | 68 | put name @; 69 | 70 | if last then put; 71 | run; 72 | 73 | data proc; 74 | length name $ 35; 75 | set proc end=last; 76 | format name; 77 | file "check-proc.sas"; 78 | name='proc '||trim(name)||';run;quit;'; 79 | put name; 80 | run; 81 | -------------------------------------------------------------------------------- /etc/proc.txt: -------------------------------------------------------------------------------- 1 | "access" "aceclus" "adaptivereg" "aggregation" "anom" "anova" "append" "appsrv" "arima" "assess" "astore" "authlib" "autoreg" 2 | "bchoice" "bglimm" "binning" "bnet" "bom" "boolrule" "boxplot" "build" 3 | "calendar" "calis" "callrfc" "cancorr" "candisc" "capability" "cardinality" "carima" "cas" "casutil" "catalog" "catmod" "causalgraph" "causalmed" "causaltrt" "ccdm" "ccopula" "cesm" "chart" "cimport" "clp" "cluster" "cntselect" "compare" "compile" "computab" "contents" "convert" "copula" "copy" "corr" "correlation" "corresp" "countreg" "cpanel" "cpm" "cport" "cqlim" "cspatialreg" "cusum" "cv2view" 4 | "datasets" "datasource" "datekeys" "db2ext" "db2util" "dbcstab" "dbf" "dbload" "delete" "dfil" "dif" "discrim" "display" "distance" "dmsrvadm" "dmsrvdatasvc" "dmsrvprocesssvc" "document" "download" "dqloclst" "dqmatch" "dqscheme" "ds2" "dstods2" "dtree" 5 | "ecm" "entropy" "esm" "expand" "explode" "export" 6 | "factex" "factmac" "factor" "fastclus" "fastknn" "fcmp" "fedsql" "fism" "fmm" "fmtc2itm" "fontreg" "forest" "format" "forms" "freq" "freqtab" "fsbrowse" "fsedit" "fsletter" "fslist" "fsview" 7 | "g3d" "g3grid" "ga" "gam" "gammod" "gampl" "gamselect" "ganno" "gantt" "gareabar" "gbarline" "gchart" "gcontour" "gdevice" "gee" "genmod" "genselect" "geocode" "gfont" "ginside" "gis" "gkpi" "glimmix" "glm" "glmmod" "glmpower" "glmselect" "gmap" "gmm" "goptions" "gplot" "gproject" "gradar" "gradboost" "greduce" "gremove" "greplay" "groovy" "gslide" "gtile" "gvarclus" 8 | "hadoop" "hdmd" "hmm" "hp4score" "hpbin" "hpbnet" "hpboolrule" "hpcandisc" "hpcdm" "hpclus" "hpcopula" "hpcorr" "hpcountreg" "hpdecide" "hpdmdb" "hpds2" "hpexport" "hpf" "hpfarimaspec" "hpfdiagnose" "hpfengine" "hpfesmspec" "hpfevents" "hpfexmspec" "hpfidmspec" "hpfmm" "hpforest" "hpfreconcile" "hpfrepository" "hpfselect" "hpftemprecon" "hpfucmspec" "hpgenselect" "hpimpute" "hplmixed" "hplogistic" "hpmixed" "hpneural" "hpnlmod" "hppanel" "hppls" "hpprincomp" "hpqlim" "hpquantselect" "hpreduce" "hpreg" "hprisk" "hpsample" "hpseverity" "hpsplit" "hpsummary" "hpsvm" "hptmine" "hptmscore" "http" 9 | "ica" "iclifetest" "icphreg" "iml" "import" "imstat" "imxfer" "inbreed" "infomaps" "iomoperate" "irt" "ishikawa" "items" 10 | "javainfo" "json" 11 | "kclus" "kde" "kpca" "krige2d" 12 | "lasr" "lattice" "lifereg" "lifetest" "lmixed" "loan" "localedata" "loess" "logistic" "logselect" "lua" 13 | "macontrol" "mapimport" "mbanalysis" "mbc" "mcmc" "mdc" "mddb" "mds" "mdsummary" "means" "metadata" "metalib" "metaoperate" "mi" "mianalyze" "migrate" "mixed" "modeclus" "model" "modelmatrix" "mtlearn" "multtest" "mvpdiagnose" "mvpmodel" "mvpmonitor" "mwpca" 14 | "nested" "netdraw" "network" "nlin" "nlmixed" "nlmod" "nmf" "nnet" "npar1way" 15 | "odslist" "odstable" "odstext" "olap" "olapcontents" "olapoperate" "operate" "optex" "optgraph" "options" "optload" "optlp" "optlso" "optmilp" "optmodel" "optnet" "optnetwork" "optqp" "optsave" "orthoreg" 16 | "panel" "pareto" "partition" "pca" "pdlreg" "pds" "pdscopy" "phreg" "phselect" "plan" "plm" "plot" "pls" "plsmod" "pm" "pmenu" "power" "presenv" "princomp" "prinqual" "print" "printto" "probit" "proto" "prtdef" "prtexp" "psmatch" "pwencode" 17 | "qdevice" "qlim" "qtrselect" "quantlife" "quantreg" "quantselect" "quest" 18 | "rank" "rareevents" "rdc" "rdpool" "rdsec" "recommend" "reg" "registry" "regselect" "release" "reliability" "report" "risk" "rmstreg" "robustreg" "rpca" "rsreg" 19 | "s3" "sandwich" "scaproc" "score" "scoreaccel" "semisuplearn" "seqdesign" "seqtest" "server" "severity" "sevselect" "sgdesign" "sgmap" "sgpanel" "sgpie" "sgplot" "sgrender" "sgscatter" "shewhart" "sim2d" "similarity" "simlin" "simnormal" "simsystem" "smcalib" "smproject" "smscore" "smselect" "smspec" "soap" "sort" "source" "sparseml" "spatialreg" "spc" "spdo" "spectra" "spp" "sql" "sqoop" "ssm" "standard" "statespace" "stdize" "stdrate" "stepdisc" "stp" "stream" "summary" "surveyfreq" "surveyimpute" "surveylogistic" "surveymeans" "surveyphreg" "surveyreg" "surveyselect" "svdd" "svmachine" "syslin" 20 | "tabulate" "tapecopy" "tapelabel" "textmine" "timedata" "timeid" "timeplot" "timeseries" "tmodel" "tmscore" "tpspline" "transpose" "transreg" "trantab" "tree" "treesplit" "tscsreg" "tsinfo" "tsmodel" "tsne" "tsreconcile" "ttest" 21 | "ucm" "univariate" "upload" 22 | "varclus" "varcomp" "varimpute" "variogram" "varmax" "varreduce" "vasmp" 23 | "x11" "x12" "x13" "xsl" 24 | -------------------------------------------------------------------------------- /lisp/Makefile: -------------------------------------------------------------------------------- 1 | ### Makefile - for compiled e-lisp of ESS distribution. 2 | 3 | ## Before making changes here, please take a look at Makeconf 4 | include ../Makeconf 5 | 6 | 7 | ### Targets 8 | 9 | .PHONY: all dist install uninstall distclean clean compile 10 | 11 | JULIAS := julia-mode.el julia-mode-latexsubs.el 12 | ELS = $(filter-out ess-autoloads.el, $(wildcard *.el)) $(JULIAS) 13 | ##ELS = $(filter-out ess-autoloads.el, $(wildcard *.el obsolete/*.el)) $(JULIAS) 14 | ELC = $(ELS:.el=.elc) 15 | 16 | all dist: compile ess-autoloads.el 17 | 18 | compile: $(ELC) 19 | 20 | install: dist 21 | -$(INSTALLDIR) $(LISPDIR) 22 | $(INSTALL) $(ELS) ess-autoloads.el $(LISPDIR) 23 | $(INSTALL) $(ELC) $(LISPDIR) 24 | if [ -f /etc/debian_version -a -n "$(SITELISP)" -a ! -f "$(SITELISP)/ess-site.el" ] ; \ 25 | then \ 26 | ln -s $(LISPDIR)/ess-site.el $(SITELISP)/ess-site.el ; \ 27 | fi; 28 | 29 | distclean clean: 30 | rm -f $(ELC) ess-autoloads.el $(JULIAS) .dependencies 31 | 32 | 33 | ### File Targets 34 | 35 | .dependencies: $(ELS) 36 | @echo Computing dependencies 37 | @rm -f .dependencies 38 | @for f in $(ELS); do \ 39 | sed -n "s|^(require '\(ess.*\)).*$$|$${f}c: \1.elc|p" $${f} >> .dependencies;\ 40 | done 41 | ## @for f in obsolete/*.el; do \ 42 | ## echo "$$(basename $${f}c):$${f}c" >> .dependencies;\ 43 | ## done 44 | 45 | -include .dependencies 46 | 47 | .el.elc: 48 | $(COMPILE) $< 49 | ##obsolete/%.elc: obsolete/%.el 50 | ## $(COMPILE-SIMPLE) $< 51 | 52 | JULIA-REPO=https://raw.githubusercontent.com/JuliaEditorSupport/julia-emacs/master 53 | ## Should happen before building ESS; definitely *NOT* after unpacking tarball : 54 | $(JULIAS): 55 | test -f ../etc/.IS.RELEASE || $(DOWNLOAD) $(JULIA-REPO)/julia-mode.el > julia-mode.el 56 | test -f ../etc/.IS.RELEASE || $(DOWNLOAD) $(JULIA-REPO)/julia-mode-latexsubs.el > julia-mode-latexsubs.el 57 | julia-%.elc: julia-%.el 58 | $(COMPILE-SIMPLE) $< 59 | 60 | ess-autoloads.el: 61 | @printf "\nGenerating $@\n" 62 | $(EMACSBATCH) --eval "(progn\ 63 | (setq make-backup-files nil)\ 64 | (setq generated-autoload-file (expand-file-name \"$@\"))\ 65 | (setq find-file-visit-truename t)\ 66 | (update-directory-autoloads default-directory))" 67 | 68 | -------------------------------------------------------------------------------- /lisp/ess-r-xref.el: -------------------------------------------------------------------------------- 1 | ;;; ess-r-xref.el --- An xref backend for R. -*- lexical-binding: t -*- 2 | 3 | ;; Copyright (C) 2018-2020 Free Software Foundation, Inc. 4 | ;; Author: Aaron Jacobs 5 | ;; Created: 21 January 2018 6 | ;; Maintainer: ESS-core 7 | 8 | ;; This file is part of GNU Emacs. 9 | 10 | ;;; License: 11 | ;; 12 | ;; This program is free software; you can redistribute it and/or modify 13 | ;; it under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation, either version 3 of the License, or 15 | ;; (at your option) any later version. 16 | ;; 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | ;; 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program. If not, see 24 | ;; 25 | 26 | ;;; Commentary: 27 | 28 | ;; This file contains an xref backend for `ess-r-mode'. 29 | 30 | ;;; Code: 31 | 32 | (require 'xref) 33 | (require 'ess-inf) 34 | (require 'ess-r-package) 35 | (require 'ess-tracebug) 36 | (eval-when-compile 37 | (require 'subr-x)) 38 | 39 | ;; Silence the byte compiler. OK because this file is only loaded by ess-r-mode. 40 | (declare-function inferior-ess-r-force "ess-r-mode") 41 | 42 | 43 | (defvar ess-r-xref-pkg-sources nil 44 | "Alist of R package->directory associations. 45 | Each element is a cons cell (PACKAGE . DIRECTORY). This variable 46 | is used as a cache of package->directory associations, but could 47 | be used by the users for a more refined control of package 48 | locations than `ess-r-package-library-paths'.") 49 | 50 | (defun ess-r-xref-backend () 51 | "An `xref-backend-functions' implementation for `ess-r-mode'. 52 | R's xref backend searches for `ess-r-package-library-paths' when 53 | srcrefs point to temporary locations." 54 | 'ess-r) 55 | 56 | (cl-defmethod xref-backend-identifier-at-point ((_backend (eql ess-r))) 57 | (when-let ((sym (ess-symbol-at-point))) 58 | (symbol-name sym))) 59 | 60 | (cl-defmethod xref-backend-definitions ((_backend (eql ess-r)) symbol) 61 | (when-let ((xref (ess-r-xref--xref symbol))) 62 | (list xref))) 63 | 64 | (cl-defmethod xref-backend-apropos ((_backend (eql ess-r))) 65 | ;; Not yet supported. 66 | nil) 67 | 68 | (cl-defmethod xref-backend-identifier-completion-table ((_backend (eql ess-r))) 69 | (inferior-ess-r-force) 70 | (ess-get-words-from-vector--foreground ".ess_all_functions()\n")) 71 | 72 | (defun ess-r-xref--srcref (symbol) 73 | (inferior-ess-r-force) 74 | ;; Look for `symbol' inside the package namespace 75 | (let* ((pkg (ess-r-package-name)) 76 | (pkg (if pkg 77 | (concat "\"" pkg "\"") 78 | "NULL"))) 79 | (with-current-buffer (ess-command (format ".ess_srcref(\"%s\", %s)\n" symbol pkg)) 80 | (goto-char (point-min)) 81 | (if (re-search-forward "Error" nil t) 82 | (progn (message "R srcref lookup failed:\n%s" (buffer-string)) 83 | (sit-for 1) 84 | nil) 85 | (when (re-search-forward "(" nil 'noerror) 86 | (goto-char (match-beginning 0)) 87 | (read (current-buffer))))))) 88 | 89 | (defun ess-r-xref--pkg-srcfile (symbol src-file &optional default-pkg) 90 | "Search the R package containing symbol SYMBOL for file SRC-FILE. 91 | DEFAULT-PKG is the name of the package where presumably SYMBOL is located." 92 | (let* ((pkgs (delq nil 93 | (delete-dups 94 | (or (cons default-pkg 95 | (ess-get-words-from-vector (format ".ess_fn_pkg(\"%s\")\n" symbol))) 96 | (user-error "Can't find package for symbol %s" symbol))))) 97 | (lib-dirs (cond ((stringp ess-r-package-library-paths) 98 | (list ess-r-package-library-paths)) 99 | ((listp ess-r-package-library-paths) 100 | ess-r-package-library-paths) 101 | (t (user-error "Invalid value of `ess-r-package-library-paths'")))) 102 | (loc (or (cl-loop for pkg in pkgs 103 | for dir = (assoc-default pkg ess-r-xref-pkg-sources) 104 | when (and dir (file-exists-p dir)) return (cons pkg dir)) 105 | (cl-some (lambda (dir) 106 | (cl-loop for pkg in pkgs 107 | for path = (expand-file-name pkg dir) 108 | when (file-exists-p path) return (cons pkg path))) 109 | lib-dirs))) 110 | (file (when loc (expand-file-name src-file (cdr loc))))) 111 | (when file 112 | (unless (file-readable-p file) 113 | (error "Can't read %s" file)) 114 | ;; Cache package's source directory. 115 | (unless (assoc (car loc) ess-r-xref-pkg-sources) 116 | (push loc ess-r-xref-pkg-sources)) 117 | file))) 118 | 119 | (defun ess-r-xref--xref (symbol) 120 | "Create an xref for the source file reference of R symbol SYMBOL." 121 | (when-let ((ref (ess-r-xref--srcref symbol))) 122 | (let ((file (nth 0 ref)) 123 | (line (nth 1 ref)) 124 | (col (nth 2 ref))) 125 | (or 126 | ;; 1) Result of ESS evaluation 127 | (let* ((ess-ref (gethash file ess--srcrefs)) 128 | (ess-buff (when ess-ref (ess--dbg-find-buffer (car ess-ref))))) 129 | (when ess-buff 130 | ;; FIXME: this breaks when eval is on larger spans than function 131 | (xref-make symbol (xref-make-buffer-location ess-buff (nth 2 ess-ref))))) 132 | ;; 2) Real file from R proc working directory 133 | (unless (file-name-absolute-p file) 134 | (let ((file (expand-file-name file (ess-get-process-variable 'default-directory)))) 135 | (when (file-readable-p file) 136 | (xref-make symbol (xref-make-file-location file line col))))) 137 | ;; 3) Real file from the R's working directory 138 | (unless (file-name-absolute-p file) 139 | (when-let ((wdir (car (ess-get-words-from-vector ess-getwd-command)))) 140 | (let ((file (expand-file-name file wdir))) 141 | (when (file-readable-p file) 142 | (xref-make symbol (xref-make-file-location file line col)))))) 143 | ;; 4) Real file location from the current directory 144 | (when (file-readable-p file) 145 | (xref-make symbol (xref-make-file-location file line col))) 146 | ;; 5) Temporary sources - truncate and locate in ess-r-package-library-paths 147 | (when (string-match "/\\([^/]+\\)/\\(R/.*\\)$" file) 148 | (when-let ((pkg-file (ess-r-xref--pkg-srcfile 149 | symbol (match-string 2 file) (match-string 1 file)))) 150 | (xref-make symbol (xref-make-file-location 151 | (expand-file-name pkg-file) line col)))))))) 152 | 153 | (provide 'ess-r-xref) 154 | 155 | ;;; ess-r-xref.el ends here 156 | -------------------------------------------------------------------------------- /lisp/ess-site.el: -------------------------------------------------------------------------------- 1 | ;;; ess-site.el --- user customization of ESS -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 1993-2020 Free Software Foundation, Inc. 4 | ;; Author: David Smith 5 | ;; Created: 12 Nov 1993 6 | ;; Maintainer: ESS-core 7 | 8 | ;; This file is part of GNU Emacs. 9 | 10 | ;;; License: 11 | ;; 12 | ;; This program is free software; you can redistribute it and/or modify 13 | ;; it under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation, either version 3 of the License, or 15 | ;; (at your option) any later version. 16 | ;; 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | ;; 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program. If not, see 24 | ;; 25 | 26 | ;;; Commentary: 27 | 28 | ;; Load path, autoloads, and major modes 29 | ;; ======================================== 30 | ;; 31 | ;; This file defines all the site-specific customizations for ESS. It should be 32 | ;; edited on a per-site basis. users who wish to use ESS should add the path to 33 | ;; ess-site to their `load-path' and require it: 34 | ;; 35 | ;; (add-to-list 'load-path "/path/to/ess/lisp-directory");; 36 | ;; (require 'ess-site) 37 | ;; 38 | ;; For most users the variable ess-lisp-directory will automatically be set 39 | ;; correctly. If you are working with an old Emacs, one in which file-truename 40 | ;; is not defined, then you might need to change the value of ess-lisp-directory 41 | ;; to the directory which is to contain the file ess-site.elc. This is probably 42 | ;; the current directory, or the value of LISPDIR if it was set in the Makefile. 43 | ;; 44 | ;; Debug startup: (setq ess-show-load-messages t) 45 | 46 | ;;; Code: 47 | 48 | (when load-file-name 49 | ;; Modify this if ess-site.el is not in the ./lisp/ directory 50 | (defvar ess-lisp-directory (file-name-directory load-file-name) 51 | "Directory containing ess-site.el(c) and other ESS Lisp files.") 52 | (add-to-list 'load-path (directory-file-name ess-lisp-directory))) 53 | 54 | ;;; Loading popular dialects (they should become optional in the future) 55 | 56 | (require 'ess-r-mode) 57 | (require 'essd-els) ;; ess-remote 58 | (require 'ess-sas-d) 59 | (require 'ess-bugs-d) 60 | (require 'ess-jags-d) 61 | (require 'ess-toolbar) 62 | 63 | (provide 'ess-site) 64 | 65 | ;;; ess-site.el ends here 66 | -------------------------------------------------------------------------------- /lisp/ess-toolbar.el: -------------------------------------------------------------------------------- 1 | ;;; ess-toolbar.el --- Support for a toolbar in ESS. -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 1997-2020 Free Software Foundation, Inc. 4 | ;; Author: Stephen Eglen 5 | ;; Created: 2004-05-06 6 | ;; Maintainer: ESS-core 7 | 8 | ;; This file is part of GNU Emacs. 9 | 10 | ;;; License: 11 | ;; 12 | ;; This program is free software; you can redistribute it and/or modify 13 | ;; it under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation, either version 3 of the License, or 15 | ;; (at your option) any later version. 16 | ;; 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | ;; 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program. If not, see 24 | ;; 25 | 26 | ;;; Commentary: 27 | 28 | ;; This code adds a toolbar to ESS modes for editing R and S code. 29 | ;; Support can be added for other modes (e.g. STATA), just ask! 30 | ;; 31 | ;; This code is experimental. It has been tested only on Linux 32 | ;; machines. All feedback appreciated. 33 | ;; 34 | ;; If your Emacs can support images, the ESS toolbar should be loaded. 35 | ;; 36 | ;; If you see a toolbar, but no icons, check out the value of 37 | ;; ess-icon-directory. 38 | ;; 39 | ;; The toolbar can be customized in several ways. To see options, do: 40 | ;; M-x customize-group RET ess-toolbar RET 41 | ;; If you change any of the variables, you _may_ need to restart Emacs 42 | ;; to see any effect. See also the documentation for ess-toolbar-items 43 | ;; if you wish to change its value. 44 | 45 | ;;; Technical issues. 46 | 47 | ;; 2009-03-16: toolbar code in Emacs 23 has changed slightly to 22, 48 | ;; and presumably once Emacs 22 is no longer supported, this code can 49 | ;; be cleaned up a bit (i.e. no need to set load-path.) 50 | 51 | ;;; Code: 52 | 53 | (require 'ess-mode) 54 | 55 | (defgroup ess-toolbar nil 56 | "ESS: toolbar support." 57 | :group 'ess 58 | :link '(emacs-commentary-link :tag "Commentary" "ess-toolbar.el") 59 | :prefix "ess-") 60 | 61 | (defcustom ess-use-toolbar 62 | (and (fboundp 'display-images-p) (display-images-p)) 63 | "Non-nil means ESS should support the toolbar." 64 | :type 'boolean) 65 | 66 | 67 | (defcustom ess-toolbar-own-icons nil 68 | "Non-nil means that we only put our toolbar entries in ESS. 69 | Otherwise we get standard toolbar as well as ESS entries. 70 | The standard toolbar items are copied from the default toolbar." 71 | :type 'boolean) 72 | 73 | (defcustom ess-toolbar-global nil 74 | "*Non-nil means that the ESS toolbar is available in all Emacs buffers. 75 | Otherwise, the ESS toolbar is present only in R/S mode buffers. 76 | For beginners, this is probably better set to a non-nil value." 77 | :type 'boolean) 78 | 79 | (defcustom ess-toolbar-items 80 | '( (R "startr") 81 | ;;(S "spluslogo" "Start S process") 82 | (S "splus_letter_small") 83 | (ess-eval-line-and-step "rline") 84 | (ess-eval-region "rregion") 85 | (ess-eval-function-or-paragraph-and-step "rregion") 86 | (ess-load-file "rbuffer") 87 | (ess-eval-function "rfunction") 88 | (ess-switch-to-ESS "switch_ess")) 89 | "Items to be added to the ESS toolbar. 90 | Each list element has two items: 91 | 1. the name of the function to run 92 | 2. the icon to be used (without .xpm extension) 93 | 94 | General toolbar items are also added to the ESS toolbar 95 | iff `ess-toolbar-own-icons' is nil. 96 | 97 | Setting this variable with setq doesn't take effect once you have 98 | loaded ess-site, unless you follow it by a call to 99 | `ess-make-toolbar' afterwards. Instead, change its value using 100 | Custom, and then on all new ESS buffers you should see the 101 | toolbar has changed." 102 | :set (lambda (symbol value) 103 | (set-default symbol value) 104 | (if (fboundp 'ess-make-toolbar) 105 | (ess-make-toolbar))) 106 | :type '(repeat (list (function :tag "Function to run") 107 | (string :tag "Icon")))) 108 | 109 | (defvar ess-icon-directory 110 | (expand-file-name "icons" ess-etc-directory) 111 | "*Location for ESS icons. 112 | This variable should be set automatically by the ESS install process. 113 | Icons should be found in ESS/etc/icons/ directory. 114 | If `ess-icon-directory' is invalid, please report a bug.") 115 | 116 | (unless (file-directory-p ess-icon-directory) 117 | (ess-write-to-dribble-buffer 118 | "`ess-icon-directory' does not exist; using `ess-etc-directory'.\n") 119 | (setq ess-icon-directory ess-etc-directory)) 120 | 121 | (defvar ess-toolbar nil 122 | "Toolbar items to be added to ESS editing buffers.") 123 | 124 | (defun ess-make-toolbar () 125 | "Make the ESS toolbar." 126 | ;; Under Emacs, only worth building the toolbar if tool-bar-map is 127 | ;; available. e.g. when running Emacs within a terminal, tool-bar-map 128 | ;; is not available, so no need to make the tool-bar. 129 | (when (boundp 'tool-bar-map) 130 | (setq ess-toolbar 131 | (if (or ess-toolbar-own-icons (null tool-bar-map)) 132 | (make-sparse-keymap) 133 | (copy-keymap tool-bar-map))) 134 | (let ((tool-bar-map ess-toolbar) 135 | (load-path (list ess-icon-directory))) 136 | ;; in Emacs 22, icons are found by examining load-path, bound here 137 | ;; whereas Emacs 23 seems to want them in image-load-path, set at the 138 | ;; bottom of this file. 139 | (mapc #'ess-add-icon ess-toolbar-items)))) 140 | 141 | (defun ess-add-icon (x) 142 | "Add an ESS item to the Emacs toolbar. 143 | X should be a list, see `ess-toolbar-items' for the format." 144 | ;; By using tool-bar-add-item-from-menu instead of tool-bar-add-item 145 | ;; we get the tooltips "for free" from ess-mode-map. 146 | (tool-bar-add-item-from-menu (car x) (cadr x) ess-mode-map)) 147 | 148 | (defun ess-add-toolbar () 149 | "Add the ESS toolbar to a particular mode. 150 | The toolbar is added iff `ess-toolbar-global' is nil, else the toolbar 151 | is added globally when ess-toolbar.el is loaded." 152 | (when (and ess-toolbar (not ess-toolbar-global)) 153 | (setq-local tool-bar-map ess-toolbar))) 154 | 155 | ;; Make the toolbars. Each toolbar is hopefully made only when this file 156 | ;; is loaded; we don't need it to be remade every time. 157 | (if ess-use-toolbar 158 | (progn 159 | (ess-make-toolbar) 160 | ;; After making the toolbar, if ESS toolbar is needed globally, 161 | ;; add it here. 162 | (if ess-toolbar-global 163 | (setq tool-bar-map ess-toolbar) 164 | (ess-write-to-dribble-buffer "Creating global Emacs toolbar")) 165 | 166 | ;; Check for toolbar support - needed iff ess-use-toolbar is non-nil. 167 | (or 168 | ;; Emacs support for images: 169 | (and (fboundp 'display-images-p) (display-images-p)) 170 | ;; if above tests failed, give a warning. 171 | (progn 172 | (message "Toolbar support for ESS not available in this Emacs.") 173 | ;; Not sure if we want to delay startup of ESS. 174 | ;;(sit-for 2) 175 | )) 176 | )) 177 | 178 | ;; Following needed for Emacs 23, not Emacs 22 179 | (when (boundp 'image-load-path) 180 | (add-to-list 'image-load-path ess-icon-directory)) 181 | 182 | (provide 'ess-toolbar) 183 | 184 | ;;; ess-toolbar.el ends here 185 | -------------------------------------------------------------------------------- /lisp/obsolete/ess-eldoc.el: -------------------------------------------------------------------------------- 1 | ;;; ess-eldoc.el --- Use eldoc to report R function names. -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 1997-2022 Free Software Foundation, Inc. 4 | ;; Author: Stephen Eglen 5 | ;; Created: 2007-06-30 6 | ;; Maintainer: ESS-core 7 | 8 | ;; This file is part of GNU Emacs. 9 | 10 | ;;; License: 11 | ;; 12 | ;; This program is free software; you can redistribute it and/or modify 13 | ;; it under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation, either version 3 of the License, or 15 | ;; (at your option) any later version. 16 | ;; 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | ;; 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program. If not, see 24 | ;; 25 | 26 | ;;; Commentary: 27 | 28 | ;;;;; eldoc functionality has been moved into the core ;;;;; 29 | ;;;;; this file has no effect and is left in ESS in order not to break 30 | ;;;;; users configuration 31 | 32 | ;; This is an initial attempt to use the emacs facility ELDOC in R 33 | ;; buffers. Eldoc is used in Emacs lisp buffers to show the function 34 | ;; arglist and docstrings for variables. To try it, view an emacs 35 | ;; lisp buffer, and then do M-x turn-on-eldoc-mode, and move over 36 | ;; function and variable names. 37 | 38 | ;; This file extends eldoc to work in R buffers. It currently uses 39 | ;; Sven's ess-r-args.el file to retrieve args for a given R function 40 | ;; (via ess-r-args-get). Note that it works slightly different to 41 | ;; Sven's code, in that you just need to have the point over the name 42 | ;; of an R function, or inside its arguments list, for eldoc to show 43 | ;; the arg list. 44 | 45 | ;; To use this functionality, simply add 46 | ;; 47 | ;; (require 'ess-eldoc) 48 | ;; 49 | ;; to your .emacs file. When you visit a R mode, eldoc will be turned 50 | ;; on. However, you will first need to associate the R buffer with an 51 | ;; *R* process so that args can be looked up -- otherwise, eldoc will 52 | ;; silently not report anything. So, e.g. try: 53 | ;; C-x C-f somefile.R 54 | ;; M-x R (so that somefile.R is associated with *R*) 55 | ;; eldoc should then work. 56 | 57 | ;; e.g. put the following rnorm() command in an R buffer. The line 58 | ;; underneath shows a key of what arg list will be shown as you move 59 | ;; across the rnorm line. 60 | 61 | ;; rnorm(n=100, mean=sqrt(20), sd=10) 62 | ;; 1111111111111222223333333311444111 63 | ;; 1: rnorm 64 | ;; 2: mean 65 | ;; 3: sqrt 66 | ;; 4: sd 67 | ;; 68 | 69 | ;; Note that the arg list for rnorm() should be shown either when you 70 | ;; are on the function name, or in the arg list. However, since the 71 | ;; 2nd and 3rd arguments are also function names, the arg lists of 72 | ;; those function names are reported instead. This might be seen as 73 | ;; undesirable behaviour, in which case a solution would be to only 74 | ;; look up the function name if it is followed by (. 75 | 76 | ;; If you want to use this feature in *R* buffers, add the following 77 | ;; to .emacs: 78 | ;; (add-hook 'inferior-ess-mode-hook 'ess-use-eldoc) 79 | 80 | 81 | ;; In the current version, I do not cache the arg list, but that was 82 | ;; done in an earlier version, to save repeated calls to 83 | ;; ess-r-args-get. 84 | 85 | ;; This code has been tested only in Emacs 22.1. It will not work on 86 | ;; Emacs 21, because it needs the variable 87 | ;; eldoc-documentation-function. 88 | 89 | ;;;; VS [25-02-2012]: all these issues were at least partially addressed in the 90 | ;;;; new implementation: 91 | 92 | ;; Bug (in eldoc?): the arg list for legend() is too long to fit in 93 | ;; minibuffer, and it seems that we see the last N lines of the arg 94 | ;; list, rather than the first N lines. It would be better to see the 95 | ;; first N lines since the more important args come first. 96 | 97 | ;; Doc issue: the eldoc vars (e.g. eldoc-echo-area-use-multiline-p) 98 | ;; work only for elisp mode. 99 | 100 | ;; Issue: You will probably see the message "Using process 'R'" flash; 101 | ;; this is generated by `ess-request-a-process', and I'd like to avoid 102 | ;; that appearing, non-interactively. 103 | 104 | ;; If *R* is currently busy (e.g. processing Sys.sleep(999)), then the 105 | ;; eldoc commands won't work; ess-command could be silenced in this 106 | ;; regard perhaps with a new SILENT arg for example to prevent the 107 | ;; call to (ess-error). 108 | 109 | 110 | ;;; Code: 111 | 112 | ;; ;; This could be done on buffer local basis. 113 | ;; (setq ess-r-args-noargsmsg "") 114 | 115 | ;; ;; following two defvars are not currently used. 116 | ;; (defvar ess-eldoc-last-name nil 117 | ;; "Name of the last function looked up in eldoc. 118 | ;; We remember this to see whether we need to look up documentation, or used 119 | ;; the cached value in `ess-eldoc-last-args'.") 120 | 121 | ;; (defvar ess-eldoc-last-args nil 122 | ;; "Args list last looked up for eldoc. Used as cache.") 123 | 124 | ;; (defun ess-eldoc-2 () 125 | ;; ;; simple, old version. 126 | ;; (interactive) 127 | ;; (ess-r-args-get (ess-read-object-name-default))) 128 | 129 | ;; (defun ess-eldoc-1 () 130 | ;; "Return the doc string, or nil. 131 | ;; This is the first version; works only on function name, not within arg list." 132 | ;; (interactive) 133 | 134 | ;; ;; Possible ways to get the function at point. 135 | ;; ;;(setq name (thing-at-point 'sexp)) 136 | ;; ;;(setq name (ess-read-object-name-default)) 137 | ;; ;;(setq name (find-tag-default)) 138 | 139 | ;; (if ess-current-process-name 140 | ;; (progn 141 | ;; (setq name (ess-guess-fun)) ;guess the word at point. 142 | ;; (if (equal (length name) 0) 143 | ;; nil 144 | ;; ;; else 145 | ;; (unless (equal name ess-eldoc-last-name) 146 | ;; ;; name is different to the last name we lookedup, so get 147 | ;; ;; new args from R and store them. 148 | ;; (setq ess-eldoc-last-args (ess-r-args-get name) 149 | ;; ess-eldoc-last-name name)) 150 | ;; ess-eldoc-last-args)) 151 | ;; ;; no ESS process current. 152 | ;; nil) 153 | ;; ) 154 | 155 | 156 | ;; (defsubst ess-guess-fun () 157 | ;; "Guess what the function at point is." 158 | ;; ;; Derived from Man-default-man-entry in man.el 159 | ;; (let (word) 160 | ;; (save-excursion 161 | ;; (skip-chars-backward "-a-zA-Z0-9._+:") 162 | ;; (let ((start (point))) 163 | ;; (skip-chars-forward "-a-zA-Z0-9._+:") 164 | ;; (setq word (buffer-substring-no-properties start (point))))) 165 | ;; word)) 166 | 167 | (defun ess-use-eldoc () 168 | "Does nothing. Defined not to break old users' code." 169 | (interactive)) 170 | 171 | (provide 'ess-eldoc) 172 | 173 | ;;; ess-eldoc.el ends here 174 | -------------------------------------------------------------------------------- /lisp/obsolete/ess-font-lock.el: -------------------------------------------------------------------------------- 1 | ;;; ess-font-lock.el --- font-lock color options -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 2000-2022 Free Software Foundation, Inc. 4 | 5 | ;; Author: Richard M. Heiberger 6 | ;; Created: 06 Feb 2000 7 | 8 | ;; Keywords: languages, faces 9 | 10 | ;; This file is part of ESS 11 | 12 | ;; This file is free software; you can redistribute it and/or modify 13 | ;; it under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation; either version 2, or (at your option) 15 | ;; any later version. 16 | ;; 17 | ;; This file is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | ;; 22 | ;; A copy of the GNU General Public License is available at 23 | ;; https://www.r-project.org/Licenses/ 24 | 25 | ;;; Commentary: 26 | 27 | ;; provides syntax highlighting support. 28 | 29 | ;;; Code: 30 | 31 | ; Requires and autoloads 32 | 33 | (require 'font-lock) 34 | (require 'paren) 35 | 36 | ;; FIXME: What is this doing here!? 37 | (if (fboundp 'show-paren-mode) (show-paren-mode 1)) 38 | 39 | ;;; Emacs 20.x notes: 40 | 41 | ;; font-lock faces are defined in /emacs/emacs-20.5/lisp/font-lock.el 42 | ;; The font-lock faces are applied to ESS buffers by 43 | ;; ess-mode.el ess-inf.el ess-trns.el ess-custom.el 44 | ;; The keywords for faces are defined in the ess[dl]*.el files. 45 | ;; All faces can be looked at, under Emacs 20.x, with 46 | ;; [menu-bar] [Edit] [Text Properties] [Display Faces} 47 | 48 | (defun ess-font-lock-rmh () 49 | "Set font-lock colors to Richard Heiberger's usual choice." 50 | ;; FIXME: Turn it into a Custom theme! 51 | (interactive) 52 | 53 | (set-foreground-color "Black") 54 | (set-background-color "lightcyan") 55 | 56 | (set-face-background 'mode-line "lightskyblue") 57 | (set-face-foreground 'mode-line "midnightblue") 58 | 59 | (set-face-foreground 'font-lock-comment-face "Firebrick") 60 | (set-face-foreground 'font-lock-function-name-face "Blue") 61 | (set-face-foreground 'font-lock-keyword-face "Purple") 62 | (set-face-foreground 'font-lock-constant-face "Brown") 63 | (set-face-foreground 'font-lock-string-face "VioletRed") 64 | (set-face-foreground 'font-lock-type-face "Sienna") 65 | (set-face-foreground 'font-lock-variable-name-face "Black")) 66 | 67 | (defun ess-font-lock-blue () 68 | "Set font-lock colors to Richard Heiberger's blue color scheme." 69 | ;; FIXME: Turn it into a Custom theme! 70 | (interactive) 71 | 72 | (set-foreground-color "Black") 73 | (set-background-color "LightBlue") 74 | 75 | (set-face-foreground 'mode-line "LightBlue") 76 | (set-face-background 'mode-line "DarkSlateBlue") 77 | 78 | (set-face-foreground 'font-lock-comment-face "Firebrick") 79 | (set-face-foreground 'font-lock-function-name-face "Blue") 80 | (set-face-foreground 'font-lock-keyword-face "Purple") 81 | (set-face-foreground 'font-lock-constant-face "Brown") 82 | (set-face-foreground 'font-lock-string-face "VioletRed") 83 | (set-face-foreground 'font-lock-type-face "Sienna") 84 | (set-face-foreground 'font-lock-variable-name-face "Black")) 85 | 86 | (defun ess-font-lock-wheat () 87 | "Set font-lock colors to Richard Heiberger's wheat color scheme." 88 | ;; FIXME: Turn it into a Custom theme! 89 | (interactive) 90 | 91 | (set-foreground-color "Black") 92 | (set-background-color "Wheat") 93 | 94 | (set-face-foreground 'mode-line "Wheat") 95 | (set-face-background 'mode-line "Sienna") 96 | 97 | (set-face-foreground 'font-lock-comment-face "Firebrick") 98 | (set-face-foreground 'font-lock-function-name-face "Blue") 99 | (set-face-foreground 'font-lock-keyword-face "Purple") 100 | (set-face-foreground 'font-lock-constant-face "Brown") 101 | (set-face-foreground 'font-lock-string-face "VioletRed") 102 | (set-face-foreground 'font-lock-type-face "Sienna") 103 | (set-face-foreground 'font-lock-variable-name-face "Black")) 104 | 105 | 106 | (defun ess-font-lock-bw () 107 | "Set font-lock colors to Richard Heiberger's black and white color scheme." 108 | ;; FIXME: Turn it into a Custom theme! 109 | (interactive) 110 | 111 | (set-foreground-color "Black") 112 | (set-background-color "white") 113 | 114 | (set-face-foreground 'mode-line "gray10") 115 | (set-face-background 'mode-line "gray90") 116 | 117 | ;; modify-face is an interactive compiled Lisp function in `faces'. 118 | ;; Sample usage: 119 | 120 | ;;(modify-face FACE FOREGROUND BACKGROUND STIPPLE BOLD-P ITALIC-P UNDERLINE-P &optional INVERSE-P FRAME) 121 | 122 | (modify-face 'mode-line "gray10" "gray90" nil nil t nil ) 123 | (modify-face 'font-lock-comment-face "black" "white" nil nil t nil ) 124 | (modify-face 'font-lock-function-name-face "black" "white" nil t nil nil ) 125 | (modify-face 'font-lock-keyword-face "black" "white" nil nil nil t ) 126 | (modify-face 'font-lock-constant-face "black" "white" nil t nil nil ) 127 | (modify-face 'font-lock-string-face "black" "white" nil nil t t ) 128 | (modify-face 'font-lock-type-face "black" "white" nil t t nil ) 129 | (modify-face 'font-lock-variable-name-face "black" "white" nil nil nil nil ) 130 | (modify-face 'font-lock-builtin-face "black" "white" nil t nil nil ) 131 | (modify-face 'font-lock-warning-face "black" "white" nil t nil nil ) 132 | (modify-face 'show-paren-match-face "gray20" "gray80" nil t nil nil ) 133 | (modify-face 'show-paren-mismatch-face "white" "gray40" nil t t nil )) 134 | 135 | (defun ess-font-lock-db () 136 | "Set font-lock colors (leave fore-/back-ground alone) courtesy David Brahm " 137 | ;; FIXME: Turn it into a Custom theme! 138 | (interactive) 139 | (set-face-foreground 'font-lock-comment-face "Firebrick") ; #... %... 140 | (set-face-foreground 'font-lock-string-face "SeaGreen") ; "..." "..." 141 | (set-face-foreground 'font-lock-keyword-face "MediumBlue") ; if \end 142 | (set-face-foreground 'font-lock-function-name-face "VioletRed") ; talk<- {center} 143 | (set-face-foreground 'font-lock-variable-name-face "Blue") ; xv 144 | (set-face-foreground 'font-lock-type-face "Goldenrod") ; T,F ? 145 | (set-face-foreground 'font-lock-constant-face "Magenta") ; <- {eq1} 146 | ) 147 | 148 | (provide 'ess-font-lock) 149 | 150 | ;;; ess-font-lock.el ends here 151 | -------------------------------------------------------------------------------- /lisp/obsolete/ess-r-a.el: -------------------------------------------------------------------------------- 1 | ;;; ess-r-a.el -- Possible local customizations for R with ESS. -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 1997-2022 Free Software Foundation, Inc. 4 | ;; Author: A.J. Rossini 5 | ;; Created: 17 November 1999 6 | ;; Maintainer: ESS-core 7 | 8 | ;; This file is part of GNU Emacs. 9 | 10 | ;;; License: 11 | ;; 12 | ;; This program is free software; you can redistribute it and/or modify 13 | ;; it under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation, either version 3 of the License, or 15 | ;; (at your option) any later version. 16 | ;; 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | ;; 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program. If not, see 24 | ;; 25 | 26 | ;;; Commentary: 27 | 28 | ;; The purpose of this file is to demonstrate some of the extras that 29 | ;; have been constructed for the ESS R mode; if they prove 30 | ;; interesting, then they might be migrated to ess-r-mode, the primary 31 | ;; ESS R mode tools. 32 | 33 | ;;; Code: 34 | (require 'ess-inf) 35 | (require 'ess-r-mode) 36 | 37 | ;; you can invoke ESS/R from emacs by typing 38 | ;; C-u M-x essr 39 | ;; with vsize set to (for example) 40M, and nsize set to 600000. 40 | 41 | ;; Undefined on non-apple devices 42 | (declare-function ns-do-applescript "nsfns.m" (script)) 43 | (declare-function do-applescript "ess-r-a" (script)) 44 | (unless (fboundp 'do-applescript) 45 | (defalias 'do-applescript #'ns-do-applescript)) 46 | 47 | (defalias 'essr 48 | (read-kbd-macro 49 | "C-u M-x R RET - - vsize = 40M SPC - - nsize = 600000 2*RET")) 50 | 51 | (defun ess-r-do-region (start end) 52 | "Send from START to END to R via AppleScript." 53 | (interactive "r\nP") 54 | (message "Starting evaluation...") 55 | (do-applescript (concat 56 | "try\n" 57 | "tell application \"R\"\n" 58 | "activate\n" 59 | "with timeout of 0 seconds\n" 60 | "cmd \"" (buffer-substring start end) 61 | "\"\n" 62 | "end timeout\n" 63 | "end tell\n" 64 | "end try\n")) 65 | (message "Finished evaluation")) 66 | 67 | (defun ess-r-do-line () 68 | "Send the current line to R via AppleScript." 69 | (interactive) ;; "r\nP") 70 | (message "Starting evaluation...") 71 | (save-excursion 72 | (let ((end (point))) 73 | (move-to-column 0) 74 | (do-applescript (concat 75 | "try\n" 76 | "tell application \"R\"\n" 77 | "activate\n" 78 | "with timeout of 0 seconds\n" 79 | "cmd \"" (buffer-substring (point) end) 80 | "\"\n" 81 | "end timeout\n" 82 | "end tell\n" 83 | "end try\n")))) 84 | (message "Finished evaluation")) 85 | 86 | (defun ess-r-var (beg end) 87 | "Load the current region of numbers into an R variable. 88 | Prompts for a variable name. If none is given, it uses a default 89 | variable name, e. BEG and END denote the region in the current 90 | buffer to be sent." 91 | (interactive "r") 92 | (save-window-excursion 93 | (let ((tmp-file (make-temp-file "ess-r-var")) 94 | cmd 95 | var) 96 | (write-region beg end tmp-file) 97 | 98 | ;; Decide on the variable name to use in R; could use completion. 99 | (setq var (read-string "R Variable name (default e): ")) 100 | (if (equal var "") 101 | (setq var "e")) 102 | 103 | ;; Command to send to the R process. Get R to delete the file 104 | ;; rather than Emacs in case it takes R a long time to run the 105 | ;; scan command. 106 | (setq cmd (concat var " <- scan(\"" tmp-file "\"); " 107 | "unlink(\"" tmp-file "\")" )) 108 | 109 | ;; Put the output from the scan command into the process buffer so 110 | ;; the user has a record of it. 111 | (ess-execute cmd 'buffer)))) 112 | 113 | 114 | ;;; Peter Dalgaard's code. 115 | ;;; This needs to be cleaned and validated! 116 | 117 | (defun pd::set-up-demo () 118 | (run-ess-r) 119 | (split-window-vertically 6) 120 | (find-file "demos.R") 121 | 122 | ;; Don't need to run this as a function -- ought to be fine if set 123 | ;; just once. 124 | 125 | (defun ajr::scroll-to-end::peterD (emacs) 126 | "Goal: map prompt to bottom of the screen after every command. 127 | Alternatively, use the scroll-in-place package, not sure where that 128 | is)." 129 | (interactive) 130 | (other-buffer 1) 131 | (if (= emacs "emacs") 132 | (setq scroll-up-aggressively t) 133 | (setq scroll-conservatively -4)) ;; <- change this 134 | (other-buffer -1)) 135 | 136 | (defun show-max-other-window () 137 | (interactive) 138 | (other-window 1) 139 | (comint-show-maximum-output) 140 | (other-window -1)) 141 | 142 | ;; call this once 143 | ;; (ajr::scroll-to-end::peterD "emacs") 144 | 145 | (global-set-key [f11] #'show-max-other-window) 146 | (global-set-key [f12] #'ess-eval-line-visibly-and-step)) 147 | 148 | 149 | ; Provide package 150 | 151 | (provide 'ess-r-a) 152 | 153 | ;;; ess-r-a.el ends here 154 | -------------------------------------------------------------------------------- /lisp/obsolete/msdos.el: -------------------------------------------------------------------------------- 1 | ;;; msdos.el --- Run an MS-DOS shell in an NTemacs buffer with bash as the shell -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 1999-2022 Free Software Foundation, Inc. 4 | ;; Author: Richard M. Heiberger 5 | ;; Created: February 1999 6 | ;; Maintainer: ESS-core 7 | 8 | ;; This file is part of GNU Emacs. 9 | 10 | ;;; License: 11 | ;; 12 | ;; This program is free software; you can redistribute it and/or modify 13 | ;; it under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation, either version 3 of the License, or 15 | ;; (at your option) any later version. 16 | ;; 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | ;; 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program. If not, see 24 | ;; 25 | 26 | ;;; Commentary: 27 | 28 | ;; The file msdos.el in the next mail message opens an *msdos* buffer 29 | ;; in shell-mode and msdos-minor-mode. When cmdproxy.exe/command.com 30 | ;; is the Emacs shell, then this gets various setting right that M-x 31 | ;; shell currently misses. The function M-x msdos-minor-mode could be 32 | ;; automatically run by Emacs in shell-mode in that case. 33 | 34 | ;; When bash is the Emacs shell, msdos.el still opens a 35 | ;; cmdproxy.exe/command.com shell in the buffer *msdos*. There are 36 | ;; occasions when it is necessary to run DOS character-based programs 37 | ;; in an Emacs window. 38 | 39 | ;; I followed the suggestion by AndrewI to look at M-x shell and modify 40 | ;; it. It turns out not to have been trivial. 41 | 42 | ;;; Code: 43 | 44 | (require 'shell); and hence 'comint 45 | 46 | ;;; Customization and Buffer Variables 47 | 48 | (defcustom explicit-msdos-shell-file-name "cmdproxy.exe" 49 | "*If non-nil, is file name to use for explicitly requested msdos 50 | inferior shell." 51 | :type '(choice (const :tag "None" nil) file) 52 | :group 'shell) 53 | 54 | (defcustom explicit-msdos-comspec-file-name 55 | (if (w32-using-nt) 56 | "cmd.exe" 57 | "command.com") 58 | "*If non-nil, is file name to use for explicitly requested COMSPEC 59 | environment variable." 60 | :type '(choice (const :tag "None" nil) file) 61 | :group 'shell) 62 | 63 | (defvar-local msdos-minor-mode nil 64 | "Non-nil if using msdos-minor mode as a minor mode of some other mode.") 65 | 66 | (defun msdos () 67 | "Run an inferior msdos shell, with I/O through buffer *msdos*. 68 | This function is intended to be used in an Ntemacs session in which 69 | bash is the primary shell. But sometimes an MSDOS window, within emacs, 70 | is also needed. 71 | 72 | If buffer exists but shell process is not running, make new shell. 73 | If buffer exists and shell process is running, just switch to buffer `*msdos*'. 74 | Program used comes from variable `explicit-msdos-shell-file-name'. 75 | If a file `~/.emacs_SHELLNAME' exists, it is given as initial input 76 | (Note that this may lose due to a timing error if the shell 77 | discards input when it starts up.) 78 | The buffer is put in Shell mode, giving commands for sending input 79 | and controlling the subjobs of the shell. See `shell-mode'. 80 | See also the variable `shell-prompt-pattern'. 81 | 82 | The buffer is put into \\[msdos-minor-mode]. See `msdos-minor-mode'. 83 | 84 | The COMSPEC environment variable in the inferior shell, but not in the emacs 85 | process, is set to `explicit-msdos-comspec-file-name'. 86 | The SHELL environment variable in the inferior shell, but not in the emacs 87 | process, is set to `explicit-msdos-shell-file-name'. 88 | 89 | The shell file name (sans directories) is used to make a symbol name 90 | such as `explicit-csh-args'. If that symbol is a variable, 91 | its value is used as a list of arguments when invoking the shell. 92 | 93 | \(Type \\[describe-mode] in the shell buffer for a list of commands.)" 94 | (interactive) 95 | (if (not (comint-check-proc "*msdos*")) 96 | (let* ((prog explicit-msdos-shell-file-name) 97 | (name (file-name-nondirectory prog)) 98 | (startfile (concat "~/.emacs_" name)) 99 | (xargs-name (intern-soft (concat "explicit-" name "-args"))) 100 | shell-buffer 101 | (comspec (getenv "COMSPEC")) 102 | (shell (getenv "SHELL")) 103 | ) 104 | (save-excursion 105 | (setenv "COMSPEC" explicit-msdos-comspec-file-name) 106 | (setenv "SHELL" explicit-msdos-shell-file-name) 107 | (set-buffer (apply #'make-comint "msdos" prog 108 | (if (and xargs-name (boundp xargs-name)) 109 | (symbol-value xargs-name)) 110 | (if (file-exists-p startfile) 111 | (concat "/k " startfile)))) 112 | (setenv "COMSPEC" comspec) 113 | (setenv "SHELL" shell) 114 | (setq shell-buffer (current-buffer)) 115 | (shell-mode) 116 | (msdos-minor-mode) 117 | (sleep-for 4) ; need to wait, else working too fast! 118 | ;;; The `exit' warning should precede the "c:\" prompt. 119 | ;;; If not, then increase the sleep-for time! 120 | (goto-char (point-min)) 121 | (insert 122 | "Remember to exit this buffer with `exit'. If you kill the 123 | buffer without exiting, you may not be able to shut down Windows cleanly.") 124 | (goto-char (point-max))) 125 | (pop-to-buffer shell-buffer)) 126 | (pop-to-buffer "*msdos*"))) 127 | 128 | 129 | (defun msdos-minor-mode () 130 | "Minor mode for running msdos in a shell-mode buffer: 131 | a. Uses \\[set-buffer-process-coding-system] to set the coding system 132 | to `'raw-text-dos'. The DOS C-m C-l end-of-line is critical. The 133 | shell freezes without it. 134 | 135 | b. The variable `comint-completion-addsuffix' is set to `\\' for directories. 136 | 137 | c. Prevents echoing of commands. 138 | 139 | d. strips ctrl-m from output. 140 | " 141 | (interactive) 142 | (setq msdos-minor-mode t) 143 | (set (make-local-variable 'comint-completion-addsuffix) '("\\" . " ")) 144 | (setq comint-process-echoes t) 145 | (add-hook 'comint-output-filter-functions #'shell-strip-ctrl-m nil t) 146 | (set-process-coding-system (get-buffer-process (current-buffer)) 'raw-text-dos 'raw-text-dos) 147 | ;; buffer-process-coding-system is critical. 148 | ) 149 | 150 | ;; Install ourselves: 151 | 152 | 153 | (put 'msdos-minor-mode 'permanent-local t) 154 | (or (assq 'msdos-minor-mode minor-mode-alist) 155 | (setq minor-mode-alist 156 | (append minor-mode-alist 157 | (list '(msdos-minor-mode " msdos"))))) 158 | 159 | ;; Provide ourselves: 160 | 161 | (provide 'msdos) 162 | 163 | ;;; msdos.el ends here 164 | -------------------------------------------------------------------------------- /targets/create-pkg-file.el: -------------------------------------------------------------------------------- 1 | ;;; create-pkg-file.el --- Create ess-pkg.el -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 2018-2022 Free Software Foundation, Inc. 4 | 5 | ;;; Commentary: 6 | ;; Creates ess-pkg.el 7 | 8 | 9 | (require 'package) 10 | 11 | ;; This script is called from one directory up 12 | 13 | ;; Copy lisp into top-level 14 | (copy-directory "lisp" "." t t t) 15 | (delete-directory "lisp" t nil) 16 | ;; Make documentation 17 | (shell-command "make -C doc info/ess.info") 18 | (dolist (file '("doc/info/ess.info" "doc/info/dir")) 19 | (copy-file file (file-name-nondirectory file)) 20 | (delete-file file)) 21 | ;; Generate ess-pkg.el 22 | (find-file "ess.el") 23 | (package-generate-description-file (package-buffer-info) "ess-pkg.el") 24 | 25 | ;;; create-pkg-file.el ends here 26 | -------------------------------------------------------------------------------- /targets/travis-install-package.el: -------------------------------------------------------------------------------- 1 | ;;; travis-install-package.el -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 2018-2022 Free Software Foundation, Inc. 4 | 5 | ;;; Commentary: 6 | ;; This file simulates a user installing the ess-$VERSION.tar file and 7 | ;; then loading ess. It's meant to be used for testing purposes only. 8 | 9 | ;;; Code: 10 | 11 | (require 'package) 12 | (require 'subr-x) 13 | 14 | (add-to-list 'package-archives (cons "melpa" "https://melpa.org/packages/") t) 15 | 16 | (package-initialize) 17 | 18 | ;; Get julia-mode and install 19 | (package-refresh-contents) 20 | (package-install 'julia-mode) 21 | 22 | ;; This file gets called from one directory up 23 | (when-let ((file (directory-files default-directory t ".tar$"))) 24 | (package-install-file (car file))) 25 | 26 | (require 'ess-site) 27 | 28 | 29 | ;;; travis-install-package.el ends here 30 | 31 | ;; Local Variables: 32 | ;; no-byte-compile: t 33 | ;; End: 34 | -------------------------------------------------------------------------------- /test/Makefile: -------------------------------------------------------------------------------- 1 | 2 | include ../Makeconf 3 | 4 | .PHONY: literate all julia lisp ess inf org r r-indent literate cases indent-cases literate-cases 5 | 6 | all: compile lisp 7 | 8 | julia: 9 | @$(MAKE) -C .. julia 10 | 11 | lisp: julia 12 | ${EMACS} -Q --script run-tests 13 | 14 | ess: 15 | ${EMACS} -Q --script run-tests --ess 16 | 17 | inf: 18 | ${EMACS} -Q --script run-tests --inf 19 | 20 | org: 21 | ${EMACS} -Q --script run-tests --org 22 | 23 | r r-core: 24 | ${EMACS} -Q --script run-tests --r-core 25 | 26 | r-indent: 27 | ${EMACS} -Q --script run-tests --r-indent 28 | 29 | r-pkg: 30 | ${EMACS} -Q --script run-tests --r-pkg 31 | 32 | literate: 33 | ${EMACS} -Q --script run-tests --literate 34 | 35 | cases: indent-cases literate-cases 36 | 37 | indent-cases: 38 | ${EMACS} -Q --script generate-indent-cases 39 | 40 | literate-cases: 41 | ${EMACS} -Q --script generate-literate-cases 42 | 43 | .PHONY: compile 44 | compile: 45 | @cd .. && make -k lisp \ 46 | "COMPILE-FLAGS = --eval \"(setq byte-compile-error-on-warn t)\"" 47 | -------------------------------------------------------------------------------- /test/dummy-pkg/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: foo 2 | Title: title 3 | License: GPL-2 4 | Description: Package description. 5 | Author: author 6 | Maintainer: maintainer 7 | Version: 0.1 8 | -------------------------------------------------------------------------------- /test/dummy-pkg/R/test.R: -------------------------------------------------------------------------------- 1 | 2 | ## Test file 3 | 4 | NULL 5 | -------------------------------------------------------------------------------- /test/dummy-pkg/man/doc.Rd: -------------------------------------------------------------------------------- 1 | \name{doc} 2 | 3 | \examples{ 4 | letters 5 | } 6 | -------------------------------------------------------------------------------- /test/dummy-pkg/src/test.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/test/dummy-pkg/src/test.c -------------------------------------------------------------------------------- /test/ess-test-indentation.el: -------------------------------------------------------------------------------- 1 | ;; ess-test-indentation.el --- Tests for ESS indentation -*- lexical-binding: t; -*- 2 | ;; 3 | ;; Filename: ess-tests.el 4 | ;; Created: 07-05-2015 (ESS 15.09) 5 | ;; Keywords: tests, indentation 6 | ;; 7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 8 | ;; 9 | ;; This file is *NOT* part of GNU Emacs. 10 | ;; This file is part of ESS 11 | ;; 12 | ;; This program is free software; you can redistribute it and/or 13 | ;; modify it under the terms of the GNU General Public License as 14 | ;; published by the Free Software Foundation; either version 3, or 15 | ;; (at your option) any later version. 16 | ;; 17 | ;; This file is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | ;; 22 | ;; A copy of the GNU General Public License is available at 23 | ;; https://www.r-project.org/Licenses/ 24 | ;; 25 | ;; 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;; 28 | ;;; Commentary: 29 | ;; 30 | ;; To run these tests: 31 | ;; All tests: M-x ert t 32 | ;; 33 | ;; To apply styles for manual testing: 34 | ;; M-: (let ((ess-style-alist ess-test-style-alist)) 35 | ;; (ess-set-style 'misc1)) 36 | ;; 37 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 38 | ;; 39 | ;;; Code: 40 | 41 | (require 'ert) 42 | (require 'etest "etest/etest") 43 | (require 'ess-r-mode) 44 | (require 'ess-test-r-utils) 45 | 46 | ;;; Indentation tests 47 | 48 | (defvar ess-test-style-alist 49 | `((RRR 50 | ,@(cdr (assq 'RRR ess-style-alist))) 51 | (RRR+ 52 | ,@(cdr (assq 'RRR+ ess-style-alist))) 53 | (RStudio- 54 | ,@(cdr (assq 'RStudio- ess-style-alist))) 55 | (C++ 56 | ,@(cdr (assq 'C++ ess-style-alist))) 57 | (DEFAULT 58 | ,@(cdr (assq 'DEFAULT ess-style-alist))) 59 | (misc1 60 | (ess-indent-offset . 3) 61 | (ess-offset-block . open-delim) 62 | (ess-offset-arguments . (prev-call 5)) 63 | (ess-offset-arguments-newline . open-delim) 64 | (ess-offset-continued . cascade) 65 | (ess-align-nested-calls . ("ifelse")) 66 | (ess-align-arguments-in-calls . nil) 67 | (ess-align-continuations-in-calls . nil) 68 | (ess-align-blocks . (fun-decl bare-blocks)) 69 | (ess-indent-from-lhs . nil) 70 | (ess-indent-from-chain-start . nil) 71 | (ess-indent-with-fancy-comments . t)))) 72 | 73 | (defun ess-test-get-pos-from-undo-elt (e) 74 | "If E represents an edit, return a position value in E, the position 75 | where the edit took place. Return nil if E represents no real change. 76 | \nE is an entry in the buffer-undo-list." 77 | ;; stolen from goto-chg.el 78 | (cond 79 | ;; ((numberp e) e) ; num==changed position 80 | ;; ((atom e) nil) ; nil==command boundary 81 | ((numberp (car e)) (cdr e)) ; (beg . end)==insertion 82 | ((stringp (car e)) (abs (cdr e))) ; (string . pos)==deletion 83 | ;; ((null (car e)) (nthcdr 4 e)) ; (nil ...)==text property change 84 | ;; ((atom (car e)) nil) ; (t ...)==file modification time 85 | (t nil))) ; (marker ...)==marker moved 86 | 87 | (defun not-change-on-indent (buffer) 88 | "Return t if BUFFER wasn't modified on indent." 89 | (with-current-buffer buffer 90 | (setq buffer-undo-list nil) 91 | (indent-region (point-min) (point-max)) 92 | (if (buffer-modified-p buffer) 93 | (progn (switch-to-buffer buffer) nil) 94 | t))) 95 | 96 | (defun ess-test-explain-change-on-indent (buffer) 97 | "Explainer function for `not-change-on-indent'." 98 | (when (buffer-modified-p buffer) 99 | (with-current-buffer buffer 100 | (let ((bul buffer-undo-list) 101 | (change-pos (point-min))) 102 | (while (and bul 103 | (null (setq change-pos (ess-test-get-pos-from-undo-elt (car bul))))) 104 | (pop bul)) 105 | (let ((diff-file (concat (buffer-name) ".diff"))) 106 | (diff-buffer-with-file buffer) 107 | (with-current-buffer "*Diff*" 108 | (write-region (point-min) (point-max) diff-file)) 109 | `(,(buffer-name buffer) was modified on line ,(count-lines 1 change-pos) 110 | (diff was written to ,diff-file))))))) 111 | 112 | (put 'not-change-on-indent 'ert-explainer 'ess-test-explain-change-on-indent) 113 | 114 | ;; Don't overwrite user settings (#911). 115 | (ert-deftest ess-r-no-user-style-overwrite-test () 116 | (let ((ess-style 'RRR) 117 | (ess-r-mode-hook '((lambda () (setq-local ess-indent-offset 1))))) 118 | (with-temp-buffer 119 | (ess-r-mode) 120 | (should (eq ess-indent-offset 1)) 121 | (ess-set-style) 122 | (should (eq ess-indent-offset 1)) 123 | (ess-set-style 'C++) 124 | (should (eq ess-indent-offset 4))))) 125 | 126 | (ert-deftest test-ess-R-indentation-RRR () 127 | (ess-test-R-indentation "styles/RRR.R" 'RRR)) 128 | 129 | (ert-deftest test-ess-R-indentation-RRR+ () 130 | (ess-test-R-indentation "styles/RRR+.R" 'RRR+)) 131 | 132 | (ert-deftest test-ess-R-indentation-RStudio- () 133 | (ess-test-R-indentation "styles/RStudio-.R" 'RStudio-)) 134 | 135 | (ert-deftest test-ess-R-indentation-C++ () 136 | (ess-test-R-indentation "styles/C++.R" 'C++)) 137 | 138 | (ert-deftest test-ess-R-indentation-misc1 () 139 | (ess-test-R-indentation "styles/misc1.R" 'misc1)) 140 | 141 | (etest-deftest test-ess-indent-exp () 142 | :case " 143 | { 144 | fun¶_call( 145 | argument 146 | ) + 147 | stuff1 148 | } + 149 | stuff2 150 | " 151 | 152 | ;; Bound to `ess-indent-exp' 153 | "C-M-q" 154 | :result " 155 | { 156 | fun¶_call( 157 | argument 158 | ) + 159 | stuff1 160 | } + 161 | stuff2 162 | " 163 | 164 | :case reset 165 | "C-u" 166 | "C-M-q" 167 | :result " 168 | { 169 | fun¶_call( 170 | argument 171 | ) + 172 | stuff1 173 | } + 174 | stuff2 175 | ") 176 | 177 | (provide 'ess-test-indentation) 178 | 179 | ;; Local Variables: 180 | ;; etest-local-config: etest-r-config 181 | ;; End: 182 | 183 | ;;; ess-test-indentation.el ends here 184 | -------------------------------------------------------------------------------- /test/ess-test-org.el: -------------------------------------------------------------------------------- 1 | ;; ess-test-org.el --- Test for org-babel integration -*- lexical-binding: t -*- 2 | ;; 3 | ;; This file is free software; you can redistribute it and/or modify 4 | ;; it under the terms of the GNU General Public License as published by 5 | ;; the Free Software Foundation; either version 2, or (at your option) 6 | ;; any later version. 7 | ;; 8 | ;; This file is distributed in the hope that it will be useful, 9 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | ;; GNU General Public License for more details. 12 | ;; 13 | ;; A copy of the GNU General Public License is available at 14 | ;; https://www.r-project.org/Licenses/ 15 | ;; 16 | ;;; Commentary: 17 | ;; Tests for org babel functionality. 18 | 19 | ;;; Code: 20 | 21 | (require 'ert) 22 | (require 'ess-r-mode) 23 | (require 'ess-test-r-utils) 24 | (require 'ob-R) 25 | 26 | ;; ob-R let-binds `ess-local-process-name' to the process of the 27 | ;; session buffer. This session buffer is set to `*R*` by default. It 28 | ;; is safer to pass a dedicated inferior buffer as `:session' keyword 29 | 30 | (defun test-org-R-output (expect input) 31 | (declare (indent 1)) 32 | (let* ((inf-buf (run-ess-test-r-vanilla))) 33 | (setq input (format input (buffer-name inf-buf))) 34 | (ess-test-unwind-protect inf-buf 35 | (with-current-buffer (get-buffer-create "*ess-org-test*") 36 | (let ((org-confirm-babel-evaluate nil) 37 | (ess-ask-for-ess-directory nil) 38 | (inhibit-message ess-inhibit-message-in-tests)) 39 | (erase-buffer) 40 | (insert input) 41 | (org-mode) 42 | (goto-char (point-min)) 43 | (forward-line 1) 44 | (org-ctrl-c-ctrl-c) 45 | (goto-char (point-max)) 46 | (should (re-search-backward expect nil t))))))) 47 | 48 | (ert-deftest test-org-ob-R-output-test () 49 | (test-org-R-output "hello" 50 | "#+BEGIN_SRC R :results output\n \"hello\"\n#+END_SRC")) 51 | 52 | (ert-deftest test-org-ob-R-session-output-test () 53 | (test-org-R-output "hello" 54 | "#+BEGIN_SRC R :session %s :results output\n \"hello\"\n#+END_SRC")) 55 | 56 | (ert-deftest test-org-ob-R-value-test () 57 | (test-org-R-output "hello" 58 | "#+BEGIN_SRC R :results value\n \"hello\"\n#+END_SRC")) 59 | 60 | (ert-deftest test-org-ob-R-session-value-test () 61 | (test-org-R-output "hello" 62 | "#+BEGIN_SRC R :session %s :results value\n \"hello\"\n#+END_SRC")) 63 | 64 | (ert-deftest test-org-ob-R-data-frame-test () 65 | (test-org-R-output "| 3 | c |" 66 | "#+BEGIN_SRC R :session :results value :colnames yes\n data.frame(x=1:3, y=c(\"a\",\"b\",\"c\"))\n#+END_SRC")) 67 | 68 | 69 | (provide 'ess-test-org) 70 | 71 | ;;; ess-test-org.el ends here 72 | -------------------------------------------------------------------------------- /test/ess-test-r-edit.el: -------------------------------------------------------------------------------- 1 | ;;; ess-test-r-edit.el --- ESS tests for R editing -*- lexical-binding: t; -*- 2 | ;; 3 | ;; This file is free software; you can redistribute it and/or modify 4 | ;; it under the terms of the GNU General Public License as published by 5 | ;; the Free Software Foundation; either version 2, or (at your option) 6 | ;; any later version. 7 | ;; 8 | ;; This file is distributed in the hope that it will be useful, 9 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | ;; GNU General Public License for more details. 12 | ;; 13 | ;; A copy of the GNU General Public License is available at 14 | ;; https://www.r-project.org/Licenses/ 15 | ;; 16 | ;;; Commentary: 17 | ;; 18 | 19 | (require 'ert) 20 | (require 'etest "etest/etest") 21 | (require 'ess-r-mode) 22 | (require 'ess-test-r-utils) 23 | 24 | (defun ess-test-init-insert-assign () 25 | (let ((map (make-sparse-keymap))) 26 | (define-key map "_" #'ess-insert-assign) 27 | (use-local-map map))) 28 | 29 | (etest-deftest test-ess-r-edit-keybindings-smart-assign () 30 | (define-key ess-mode-map "_" #'ess-insert-assign) 31 | :case "foo¶" 32 | "_" :result "foo <- ¶" 33 | "_" :result "foo_¶" 34 | "_" :result "foo_ <- ¶" 35 | 36 | (define-key ess-mode-map ";" #'ess-insert-assign) 37 | :case "foo¶" 38 | ";" :result "foo <- ¶" 39 | ";" :result "foo;¶" 40 | ";" :result "foo; <- ¶" 41 | 42 | ;; With `nil` smart key 43 | (setq ess-smart-S-assign-key nil) 44 | :case "foo¶" 45 | ";" :result "foo <- ¶" 46 | ";" :result "foo;¶" 47 | 48 | (define-key ess-mode-map ";" nil) ; Reset 49 | (setq ess-smart-S-assign-key "_") ; Reset 50 | ";" :result "foo;;¶" 51 | 52 | ;; With complex key 53 | (let ((map (make-sparse-keymap))) 54 | (define-key map (kbd "M--") #'ess-insert-assign) 55 | (use-local-map map)) 56 | :case "foo¶" 57 | "M--" :result "foo <- ¶" 58 | "M--" :result "foo-¶") 59 | 60 | (etest-deftest test-ess-r-edit-keybindings-assign-list () 61 | "`ess-insert-assign` uses `ess-assign-list`." 62 | (local-set-key "_" #'ess-insert-assign) 63 | (setq-local ess-assign-list '(" <~ ")) 64 | 65 | :case "foo¶" 66 | "_" :result "foo <~ ¶" 67 | "_" :result "foo_¶" 68 | "_" :result "foo_ <~ ¶") 69 | 70 | (etest-deftest test-ess-r-edit-insert-assign () 71 | "Repeated calls cycle between assignment and self-insert." 72 | :init ((eval . (ess-test-init-insert-assign))) 73 | :case "foo¶" 74 | "_" :result "foo <- ¶" 75 | "_" :result "foo_¶" 76 | "_" :result "foo_ <- ¶") 77 | 78 | (etest-deftest test-ess-r-edit-insert-assign-whitespace () 79 | "Whitespace is cleaned up before insertion." 80 | :init ((eval . (ess-test-init-insert-assign))) 81 | :case "foo ¶" "_" :result "foo <- ¶" 82 | :case "foo ¶" "_" :result "foo <- ¶") 83 | 84 | (etest-deftest test-ess-r-edit-cycle-assign-test () 85 | "Repeated calls cycle trough assignment operators." 86 | :case "foo¶" 87 | "C-c C-=" :result "foo <- ¶" 88 | "C-c C-=" :result "foo <<- ¶" 89 | "C-c C-=" :result "foo = ¶" 90 | "C-c C-=" :result "foo -> ¶" 91 | "C-c C-=" :result "foo ->> ¶" 92 | "C-c C-=" :result "foo <- ¶" 93 | "C-c C-=" :result "foo <<- ¶") 94 | 95 | (etest-deftest test-ess-r-edit-cycle-assign-whitespace-test () 96 | "Whitespace is cleaned up before insertion" 97 | :case "foo ¶" 98 | "C-c C-=" :result "foo <- ¶" 99 | "C-c C-=" :result "foo <<- ¶" 100 | 101 | :case "foo ¶" 102 | "C-c C-=" :result "foo <- ¶" 103 | "C-c C-=" :result "foo <<- ¶") 104 | 105 | "\nfun_call(¶argument1,\n argument2,\n argument3,\n argument4,\n argument5)" 106 | "\nfun_call(¶\n argument1,\n argument2,\n argument3,\n argument4,\n argument5\n)" 107 | 108 | (etest-deftest test-ess-r-edit-call-filling () 109 | "With point in front of parentheses." 110 | (setq-local fill-column 40) 111 | 112 | :case " 113 | fun_call(¶argument1, argument2, argument3, argument4, 114 | argument5)" 115 | 116 | "M-q" 117 | :result " 118 | fun_call(¶argument1, argument2, 119 | argument3, argument4, 120 | argument5)" 121 | 122 | "M-q" 123 | :result " 124 | fun_call(¶argument1, 125 | argument2, 126 | argument3, 127 | argument4, 128 | argument5)" 129 | 130 | "M-q" 131 | :result " 132 | fun_call(¶argument1, argument2, argument3, argument4, 133 | argument5)" 134 | 135 | "M-q" 136 | :result " 137 | fun_call(¶argument1, argument2, 138 | argument3, argument4, 139 | argument5)") 140 | 141 | (etest-deftest test-ess-r-edit-call-filling-middle () 142 | "With point in the middle of the function symbol." 143 | (setq-local fill-column 40) 144 | 145 | :case " 146 | fun¶_call(argument1, argument2, argument3, argument4, 147 | argument5)" 148 | 149 | "M-q" 150 | :result " 151 | fun¶_call(argument1, argument2, 152 | argument3, argument4, 153 | argument5)") 154 | 155 | (etest-deftest test-ess-r-edit-call-filling-before-comment () 156 | "If a comment is in the way we can't do anything." 157 | :case " 158 | fun_call(¶ ## comment 159 | argument1, ## comment 160 | argument2)" 161 | 162 | "M-q" 163 | :result " 164 | fun_call(¶ ## comment 165 | argument1, ## comment 166 | argument2)") 167 | 168 | (etest-deftest test-ess-r-edit-call-filling-multiline-param () 169 | :case " 170 | ¶fun_call(parameter = 171 | 'string')" 172 | 173 | "M-q" 174 | :result " 175 | ¶fun_call(parameter = 'string')") 176 | 177 | (etest-deftest test-ess-r-edit-call-filling-john-doe () 178 | "Not sure what this is testing." 179 | :case " 180 | `fun_call`(¶argument1, argument2)" 181 | 182 | "M-q" 183 | "M-q" 184 | :result " 185 | `fun_call`(¶argument1, 186 | argument2)") 187 | 188 | (etest-deftest test-ess-r-edit-call-filling-empty-arguments () 189 | (setq-local fill-column 42) 190 | 191 | :case " 192 | fun_call¶(argument1, , arg2, , argument3, , argument4)" 193 | 194 | "M-q" 195 | :result " 196 | fun_call¶(argument1, , arg2, , argument3, , 197 | argument4)" 198 | 199 | "M-q" 200 | :result " 201 | fun_call¶(argument1, 202 | , 203 | arg2, 204 | , 205 | argument3, 206 | , 207 | argument4)") 208 | 209 | (etest-deftest test-ess-r-edit-ops-filling () 210 | :case " 211 | lm(outcome¶ ~ pred1 + 212 | pred2 + 213 | pred3 + 214 | pred4, 215 | data)" 216 | 217 | "M-q" 218 | :result " 219 | lm(outcome¶ ~ pred1 + pred2 + pred3 + pred4, 220 | data)" 221 | 222 | "M-q" 223 | :result " 224 | lm(outcome¶ ~ 225 | pred1 + 226 | pred2 + 227 | pred3 + 228 | pred4, 229 | data)" 230 | 231 | "M-q" 232 | :result " 233 | lm(outcome¶ ~ pred1 + 234 | pred2 + 235 | pred3 + 236 | pred4, 237 | data)") 238 | 239 | (etest-deftest test-ess-r-edit-ops-filling-no-rhs () 240 | :case "fun_call(¶argument +)" 241 | "M-q" 242 | :result "fun_call(¶argument +)") 243 | 244 | ;; Local Variables: 245 | ;; etest-local-config: etest-r-config 246 | ;; End: 247 | -------------------------------------------------------------------------------- /test/ess-test-r-eval.el: -------------------------------------------------------------------------------- 1 | ;;; ess-test-rd.el --- ESS tests for Rd-mode -*- lexical-binding: t; -*- 2 | ;; 3 | ;; This file is free software; you can redistribute it and/or modify 4 | ;; it under the terms of the GNU General Public License as published by 5 | ;; the Free Software Foundation; either version 2, or (at your option) 6 | ;; any later version. 7 | ;; 8 | ;; This file is distributed in the hope that it will be useful, 9 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | ;; GNU General Public License for more details. 12 | ;; 13 | ;; A copy of the GNU General Public License is available at 14 | ;; https://www.r-project.org/Licenses/ 15 | ;; 16 | ;;; Commentary: 17 | ;; 18 | 19 | (require 'ert) 20 | (require 'etest "etest/etest") 21 | (require 'ess-r-mode) 22 | (require 'ess-test-r-utils) 23 | 24 | ;; Make sure inferiors have been loaded so that messages etc. do not 25 | ;; interfere with the tests 26 | (ess-r-test-proc-buf 'output) 27 | (ess-r-test-proc-buf 'tracebug) 28 | 29 | (etest-deftest ess-r-eval-visibility-eval-standard-filter-test () 30 | "`ess-eval-region' respects `ess-eval-visibly'. 31 | Standard filter." 32 | :init ((mode . r) 33 | (ess-eval-deactivate-mark . nil) 34 | (eval . (ess-test-r-set-local-process 'output))) 35 | 36 | :case " 37 | ¶1 38 | 2 39 | { 40 | 3 41 | 4 42 | } 43 | 5; 6× 44 | " 45 | 46 | (setq-local ess-eval-visibly t) 47 | "C-c C-r" 48 | 49 | :inf-result "1 50 | [1] 1 51 | > 2 52 | [1] 2 53 | > { 54 | + 3 55 | + 4 56 | + } 57 | [1] 4 58 | > 5; 6 59 | [1] 5 60 | [1] 6 61 | > " 62 | 63 | (setq-local ess-eval-visibly 'nowait) 64 | "C-c C-r" 65 | 66 | :inf-result "1 67 | + 2 68 | + { 69 | + 3 70 | + 4 71 | + } 72 | + 5; 6 73 | [1] 1 74 | > [1] 2 75 | > + + + [1] 4 76 | > [1] 5 77 | [1] 6 78 | > " 79 | 80 | (setq-local ess-eval-visibly nil) 81 | "C-c C-r" 82 | 83 | :inf-result "[1] 1 84 | > [1] 2 85 | > + + + [1] 4 86 | > [1] 5 87 | [1] 6 88 | > ") 89 | 90 | (etest-deftest ess-r-eval-visibility-eval-test () 91 | "`ess-eval-region' respects `ess-eval-visibly'. 92 | Default filter" 93 | :init ((mode . r) 94 | (eval . (ess-test-r-set-local-process 'tracebug)) 95 | (ess-eval-deactivate-mark . nil)) 96 | 97 | :case " 98 | ¶1 99 | 2 100 | { 101 | 3 102 | 4 103 | } 104 | 5; 6× 105 | " 106 | 107 | ;; 'nowait curiously causes sporadic failures with the { block 108 | ;; output. The number of continuation `+` varies. The chance of 109 | ;; failure increases when input has already been sent to the 110 | ;; process. Probably because of the special `nowait` handling in the 111 | ;; tracebug filter. 112 | 113 | ;; (setq-local ess-eval-visibly 'nowait) 114 | ;; "C-c C-r" 115 | ;; :inf-result "1 116 | ;; + 2 117 | ;; + { 118 | ;; + 3 119 | ;; + 4 120 | ;; + } 121 | ;; + 5; 6 122 | ;; [1] 1 123 | ;; > [1] 2 124 | ;; > + + + [1] 4 125 | ;; > [1] 5 126 | ;; [1] 6 127 | ;; > " 128 | 129 | (setq-local ess-eval-visibly t) 130 | "C-c C-r" 131 | 132 | :inf-result "1 133 | [1] 1 134 | > 2 135 | [1] 2 136 | > { 137 | + 3 138 | + 4 139 | + } 140 | [1] 4 141 | > 5; 6 142 | [1] 5 143 | [1] 6 144 | > " 145 | 146 | (setq-local ess-eval-visibly nil) 147 | "C-c C-r" 148 | 149 | :inf-result "[1] 1 150 | > [1] 2 151 | > + + + [1] 4 152 | > [1] 5 153 | [1] 6 154 | > ") 155 | 156 | (etest-deftest ess-r-eval-ns-env-roxy-standard-test () 157 | "Roxygen blocks are not evaluated in current eval-env (#1026). 158 | Standard filter." 159 | :init ((mode . r) 160 | (ess-r-evaluation-env . "base") 161 | (eval . (ess-test-r-set-local-process 'output))) 162 | 163 | :case "#' ¶identical(environment(), globalenv())" 164 | 165 | "C-c C-j" 166 | :inf-result "identical(environment(), globalenv()) 167 | [1] TRUE 168 | > " 169 | ;; Shouldn't mention "[base]" 170 | :messages "Starting evaluation... 171 | Loading line: #' identical(environment(), globalenv())" 172 | 173 | :case " 174 | #' ¶identical(environment(), globalenv()) 175 | NULL×" 176 | 177 | "C-c C-r" 178 | :inf-result "+ > identical(environment(), globalenv()) 179 | [1] FALSE 180 | > NULL 181 | NULL 182 | > " 183 | ;; Mentions "[base]" 184 | :messages "Starting evaluation... 185 | [base] Eval region") 186 | 187 | (etest-deftest ess-r-eval-ns-env-roxy-tracebug-test () 188 | "Roxygen blocks are not evaluated in current eval-env (#1026). 189 | Tracebug filter." 190 | :init ((mode . r) 191 | (eval . (ess-test-r-set-local-process 'tracebug)) 192 | (ess-r-evaluation-env . "base") 193 | (ess-eval-visibly . nil)) 194 | :case "#' ¶identical(environment(), globalenv())" 195 | 196 | "C-c C-j" 197 | :inf-result "[1] TRUE 198 | > " 199 | ;; Shouldn't mention "[base]" 200 | :messages "Starting evaluation... 201 | Loading line: #' identical(environment(), globalenv())" 202 | 203 | :case " 204 | #' ¶identical(environment(), globalenv()) 205 | NULL×" 206 | 207 | "C-c C-r" 208 | :inf-result "+ [1] FALSE 209 | NULL 210 | > " 211 | ;; Mentions "[base]" 212 | :messages "Starting evaluation... 213 | [base] Eval region") 214 | 215 | (ert-deftest ess-rd-eval-ns-env-test () 216 | "Namespaced eval is disabled in doc files (#1026)." 217 | (with-temp-buffer 218 | (find-file-noselect "dummy-pkg/man/doc.Rd") 219 | (Rd-mode) 220 | (should (not ess-r-evaluation-env)))) 221 | 222 | (etest-deftest ess-r-eval-sink-freeze-test () 223 | "Completions don't freeze Emacs when output is sinked. 224 | TODO: Install company-mode dependency in CI." 225 | :init ((mode . r) 226 | (eval ess-test-r-set-local-process)) 227 | 228 | :inf-cleanup 229 | (process-send-string 230 | ess-local-process-name 231 | "if (sink.number() != 0) sink(NULL)\n") 232 | 233 | :case " 234 | ¶file <- tempfile() 235 | sink(file)×" 236 | 237 | (setq-local ess-eval-visibly t) 238 | "C-c C-r" 239 | :inf-result "file <- tempfile() 240 | > sink(file) 241 | > " 242 | 243 | (should (equal (ess-get-words-from-vector "letters[1:3]\n") 244 | '("a" "b" "c"))) 245 | :inf-result "" 246 | 247 | :case "si¶" 248 | (when (require 'company nil 'noerror) 249 | (company-complete-common)) 250 | :inf-result "" 251 | 252 | :case "¶{ 253 | sink(NULL) 254 | if (length(readLines(file))) 255 | stop('sinked output should be empty') 256 | unlink(file) 257 | rm(file) 258 | }×" 259 | 260 | (setq-local ess-eval-visibly nil) 261 | "C-c C-r" 262 | :inf-result "+ + + + + + > ") 263 | 264 | (etest-deftest ess-string-command-test () 265 | "`ess-string-command` handles multiline outputs (#922)." 266 | (should (string= (ess-string-command "quote({ 1 })\n") 267 | "{\n 1\n}")) 268 | (should (string= (ess-string-command "list(1)\n") 269 | "[[1]]\n[1] 1\n"))) 270 | 271 | 272 | ;; Local Variables: 273 | ;; etest-local-config: etest-r-config 274 | ;; End: 275 | -------------------------------------------------------------------------------- /test/ess-test-r-package.el: -------------------------------------------------------------------------------- 1 | ;;; ess-test-r-package.el --- ESS tests for R package functionality -*- lexical-binding: t; -*- 2 | ;; 3 | ;; This file is free software; you can redistribute it and/or modify 4 | ;; it under the terms of the GNU General Public License as published by 5 | ;; the Free Software Foundation; either version 2, or (at your option) 6 | ;; any later version. 7 | ;; 8 | ;; This file is distributed in the hope that it will be useful, 9 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | ;; GNU General Public License for more details. 12 | ;; 13 | ;; A copy of the GNU General Public License is available at 14 | ;; https://www.r-project.org/Licenses/ 15 | ;; 16 | ;;; Commentary: 17 | ;; 18 | 19 | (require 'ert) 20 | (require 'ess-r-mode) 21 | (require 'ess-r-package) 22 | (require 'ess-test-r-utils) 23 | 24 | ;;; Code: 25 | 26 | (ert-deftest ess-r-package-auto-activation-test () 27 | (let ((inhibit-message ess-inhibit-message-in-tests)) 28 | (with-temp-buffer 29 | (text-mode) 30 | (hack-local-variables) 31 | (should (not ess-r-package-mode))) 32 | (with-ess-test-r-file "dummy-pkg/R/test.R" 33 | (hack-local-variables) 34 | (should ess-r-package-mode)))) 35 | 36 | (ert-deftest ess-r-package-auto-activation-in-shell-test () 37 | (skip-unless (executable-find "bash")) 38 | (let ((inhibit-message ess-inhibit-message-in-tests) 39 | (kill-buffer-query-functions nil) 40 | (explicit-shell-file-name "bash") 41 | (explicit-bash-args '("--noediting" "-i" "--norc" "--noprofile"))) 42 | (with-ess-test-r-file "dummy-pkg/R/test.R" 43 | (shell) 44 | (should ess-r-package-mode) 45 | (kill-buffer)) 46 | (with-ess-test-r-file "dummy-pkg/R/test.R" 47 | (let ((ess-r-package-auto-activate t)) 48 | (shell) 49 | (should ess-r-package-mode)) 50 | (kill-buffer)))) 51 | 52 | (ert-deftest ess-r-package-auto-no-activation-in-shell-test () 53 | ;; FIXME: This test fails in batch in Emacs 27. 54 | (skip-unless (and (>= 27 emacs-major-version) 55 | (not noninteractive) 56 | (executable-find "bash"))) 57 | (let ((kill-buffer-query-functions nil) 58 | (explicit-shell-file-name "bash") 59 | (explicit-bash-args '("--noediting" "-i" "--norc" "--noprofile"))) 60 | (with-ess-test-r-file "dummy-pkg/R/test.R" 61 | (let ((ess-r-package-exclude-modes '(shell-mode))) 62 | (shell) 63 | (should (not ess-r-package-mode)) 64 | (kill-buffer))) 65 | (with-ess-test-r-file "dummy-pkg/R/test.R" 66 | (let ((ess-r-package-auto-activate nil)) 67 | (shell) 68 | (should (not ess-r-package-mode)) 69 | (kill-buffer))))) 70 | 71 | (ert-deftest ess-r-package-vars-test () 72 | (with-ess-test-c-file "dummy-pkg/src/test.c" 73 | (let* ((inf-buf (run-ess-test-r-vanilla)) 74 | (inf-proc (get-buffer-process inf-buf)) 75 | (ess-local-process-name (process-name inf-proc))) 76 | (ess-test-unwind-protect inf-buf 77 | (let ((r-setwd-cmd (cdr (assq 'ess-setwd-command ess-r-customize-alist))) 78 | (r-getwd-cmd (cdr (assq 'ess-getwd-command ess-r-customize-alist)))) 79 | (should (string= ess-setwd-command r-setwd-cmd)) 80 | (should (string= ess-getwd-command r-getwd-cmd))) 81 | (let ((pkg-dir (file-truename (cdr (ess-r-package-project)))) 82 | ;; Not sure why this is needed: 83 | ess-ask-for-ess-directory) 84 | (ess-set-working-directory (expand-file-name "src" pkg-dir)) 85 | (ess-r-package-use-dir) 86 | (should (string= pkg-dir (file-truename 87 | (directory-file-name 88 | (ess-get-process-variable 'default-directory))))) 89 | (ess-wait-for-process) 90 | (should (string= pkg-dir (file-truename (ess-get-working-directory)))) 91 | (ess-wait-for-process) 92 | (inferior-ess-reload) 93 | (should (string-match "Process R\\(:.\\)? \\(finished\\|killed\\)" 94 | (with-current-buffer inf-buf 95 | (buffer-string))))))))) 96 | 97 | (ert-deftest ess-r-package-package-info-test () 98 | (let ((kill-buffer-query-functions nil) 99 | (ess-r-package-auto-activate nil)) 100 | (with-ess-test-r-file "dummy-pkg/R/test.R" 101 | (let ((pkg-info (ess-r-package-info))) 102 | (should (string= (plist-get pkg-info :name) "foo")) 103 | (should (string-match-p "dummy-pkg$" (plist-get pkg-info :root))) 104 | (kill-buffer))) 105 | (with-ess-test-c-file "dummy-pkg/src/test.c" 106 | (let ((pkg-info (ess-r-package-info))) 107 | (should (string= (plist-get pkg-info :name) "foo")) 108 | (should (string-match-p "dummy-pkg$" (plist-get pkg-info :root))) 109 | (kill-buffer))))) 110 | 111 | 112 | ;;; Project Tests 113 | (ert-deftest ess-r-project-auto-activation-test () 114 | (let ((inhibit-message ess-inhibit-message-in-tests) 115 | (root (expand-file-name "dummy-pkg"))) 116 | (with-ess-test-r-file "dummy-pkg/R/test.R" 117 | (should (equal (ess-r-project-info) 118 | (list :name "dummy-pkg" :root root))) 119 | (should (equal (cdr (ess-r-project)) root))) 120 | (should (not (ess-r-project-info "~"))) 121 | (should (not (ess-r-project "~"))))) 122 | 123 | 124 | (provide 'ess-test-r-package) 125 | 126 | ;;; ess-test-r-package.el ends here 127 | -------------------------------------------------------------------------------- /test/ess-test-r-syntax.el: -------------------------------------------------------------------------------- 1 | ;;; ess-test-r-syntax.el --- ESS tests for R syntax -*- lexical-binding: t; -*- 2 | ;; 3 | ;; This file is free software; you can redistribute it and/or modify 4 | ;; it under the terms of the GNU General Public License as published by 5 | ;; the Free Software Foundation; either version 2, or (at your option) 6 | ;; any later version. 7 | ;; 8 | ;; This file is distributed in the hope that it will be useful, 9 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | ;; GNU General Public License for more details. 12 | ;; 13 | ;; A copy of the GNU General Public License is available at 14 | ;; https://www.r-project.org/Licenses/ 15 | ;; 16 | ;;; Commentary: 17 | ;; 18 | 19 | (require 'ert) 20 | (require 'etest "etest/etest") 21 | (require 'ess-r-mode) 22 | (require 'ess-test-r-utils) 23 | 24 | (etest-deftest ess-r-syntax-backslash-test () 25 | :case "sapply(x, ¶\\(y) y" 26 | (should (equal (syntax-after (point)) 27 | (string-to-syntax "."))) 28 | :case "c(\"¶\\\"\")" 29 | (should (equal (syntax-after (point)) 30 | (string-to-syntax "\\")))) 31 | 32 | (etest-deftest ess-r-font-lock-boolean-operator-test () 33 | :case "foo ¶| foo ¶|¶| foo ¶& foo ¶&¶& foo" 34 | (ess-with-enabled-font-lock-keyword 'ess-fl-keyword:operators 35 | (font-lock-ensure) 36 | (should (eq (face-at-point) 'ess-operator-face)))) 37 | 38 | (etest-deftest ess-r-font-lock-pipe-operator-test () 39 | :case "a ¶|¶> b" 40 | (ess-with-enabled-font-lock-keyword 'ess-fl-keyword:operators 41 | (font-lock-ensure) 42 | (should (eq (face-at-point) 'ess-operator-face)))) 43 | 44 | (etest-deftest ess-r-tokens-pipe-operator-test () 45 | :case "a ¶|> b" 46 | (should (ess-test-token= "|>")) 47 | :result "a |>¶ b") 48 | 49 | (etest-deftest ess-r-raw-strings-test () 50 | :case " 51 | r¶\"(foo\"bar))¶\" 52 | r¶\"(foo}\"bar))¶\" 53 | r¶\"(foo)'bar))¶\" 54 | r¶\"---[foo\"bar]---¶\" 55 | r¶\"---[foo\"bar]--\"baz]---¶\" 56 | r¶'{foo'bar}¶' 57 | r¶\"---{foobar}-\\--\" 58 | " 59 | (should (equal (syntax-after (point)) 60 | (string-to-syntax "|"))) 61 | 62 | :case " 63 | r\"¶(foo\"¶bar))¶\" 64 | r\"¶(foo}\"¶bar))¶\" 65 | r\"¶(foo)'¶bar))¶\" 66 | r\"¶---[foo\"¶bar]---¶\" 67 | r\"¶---[foo\"¶bar]--\"¶baz]---¶\" 68 | r'¶{foo'¶bar}¶' 69 | r\"¶---{foobar}¶-\\--\"¶ 70 | " 71 | (should (ess-inside-string-p)) 72 | 73 | :case " 74 | ¶r\"(foo\"bar))\"¶, 75 | ¶r\"(foo}\"bar))\"¶, 76 | ¶r\"(foo)'bar))\"¶, 77 | ¶r\"---[foo\"bar]---\"¶, 78 | ¶r\"---[foo\"bar]--\"baz]---\"¶, 79 | ¶r'{foo'bar}'¶, 80 | ¶r\"---{foobar}-\\--\" 81 | " 82 | (should (not (ess-inside-string-p))) 83 | 84 | :case "r\"(foor\"()\"ba¶r))\"" 85 | (should (not (ess-inside-string-p))) 86 | 87 | :case " 88 | r\"(foor¶'()¶'bar))\" 89 | # r¶\"{foo}¶\" 90 | " 91 | (should (not (equal (syntax-after (point)) 92 | (string-to-syntax "|"))))) 93 | 94 | (etest-deftest ess-r-syntax-climb-test () 95 | :case " 96 | stuff1 =, ¶stuff2 97 | stuff1 =; ¶stuff2 98 | stuff1 := ¶stuff2 99 | stuff1 %a?a:a% ¶stuff2 100 | stuff1 %% ¶stuff2 101 | stuff1 => ¶stuff2 102 | " 103 | (ess-climb-operator) 104 | :result " 105 | stuff1 =, ¶stuff2 106 | stuff1 =; ¶stuff2 107 | stuff1¶ := stuff2 108 | stuff1¶ %a?a:a% stuff2 109 | stuff1¶ %% stuff2 110 | stuff1¶ => stuff2 111 | " 112 | 113 | :case " 114 | function_call() 115 | ¶ 116 | " 117 | (ess-climb-block-prefix) 118 | :result " 119 | function_call() 120 | ¶ 121 | " 122 | (ess-climb-block-prefix "function") 123 | :result " 124 | function_call() 125 | ¶ 126 | ") 127 | 128 | (etest-deftest ess-r-syntax-climb-continuations-test () 129 | :case "(!stuff1 ||¶ stuff2)" 130 | (ess-climb-continuations) 131 | :result "(¶!stuff1 || stuff2)" 132 | 133 | :case " 134 | object <- 135 | fun_call() %>% 136 | ¶fun_call() 137 | 138 | object <- 139 | fun_call() %>% fun_call() %>% 140 | ¶fun_call() 141 | 142 | object <- 143 | namespace::fun_call() %>% 144 | ¶fun_call() 145 | 146 | object <- 147 | namespace:::fun_call() %>% 148 | ¶fun_call() 149 | 150 | object <- 151 | object@fun_call() %>% 152 | ¶fun_call() 153 | 154 | object <- 155 | object$fun_call() %>% 156 | ¶fun_call() 157 | " 158 | 159 | (ess-climb-continuations) 160 | :result " 161 | ¶object <- 162 | fun_call() %>% 163 | fun_call() 164 | 165 | ¶object <- 166 | fun_call() %>% fun_call() %>% 167 | fun_call() 168 | 169 | ¶object <- 170 | namespace::fun_call() %>% 171 | fun_call() 172 | 173 | ¶object <- 174 | namespace:::fun_call() %>% 175 | fun_call() 176 | 177 | ¶object <- 178 | object@fun_call() %>% 179 | fun_call() 180 | 181 | ¶object <- 182 | object$fun_call() %>% 183 | fun_call() 184 | ") 185 | 186 | (etest-deftest ess-r-syntax-climb-sticky-ops-test () 187 | :case " 188 | object@field¶ 189 | object$field¶ 190 | namespace::object¶ 191 | namespace:::object¶ 192 | " 193 | 194 | (ess-climb-expression) 195 | :result " 196 | ¶object@field 197 | ¶object$field 198 | ¶namespace::object 199 | ¶namespace:::object 200 | " 201 | 202 | :case reset 203 | (ess-climb-object) 204 | :result " 205 | ¶object@field 206 | ¶object$field 207 | ¶namespace::object 208 | ¶namespace:::object 209 | ") 210 | 211 | (etest-deftest ess-r-syntax-jump-test () 212 | :case " 213 | ¶if (test1) 214 | stuff1 215 | if (test2) 216 | stuff2" 217 | 218 | (ess-jump-expression) 219 | :result " 220 | if (test1) 221 | stuff1¶ 222 | if (test2) 223 | stuff2") 224 | 225 | 226 | ;; Local Variables: 227 | ;; etest-local-config: etest-r-config 228 | ;; End: 229 | -------------------------------------------------------------------------------- /test/ess-test-rd.el: -------------------------------------------------------------------------------- 1 | ;;; ess-test-rd.el --- ESS tests for Rd-mode -*- lexical-binding: t; -*- 2 | ;; 3 | ;; This file is free software; you can redistribute it and/or modify 4 | ;; it under the terms of the GNU General Public License as published by 5 | ;; the Free Software Foundation; either version 2, or (at your option) 6 | ;; any later version. 7 | ;; 8 | ;; This file is distributed in the hope that it will be useful, 9 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | ;; GNU General Public License for more details. 12 | ;; 13 | ;; A copy of the GNU General Public License is available at 14 | ;; https://www.r-project.org/Licenses/ 15 | ;; 16 | ;;; Commentary: 17 | ;; 18 | 19 | (require 'ert) 20 | (require 'etest "etest/etest") 21 | (require 'ess-r-mode) 22 | (require 'ess-test-r-utils) 23 | (require 'ess-rd) 24 | 25 | ;;; Code: 26 | 27 | (defun ess-r-test-rd-init () 28 | (Rd-mode) 29 | (ess-test-r-set-local-process)) 30 | 31 | (etest-deftest ess-rd-eval-linewise-visibly-test () 32 | "C-c C-n always evaluates visibly. 33 | https://github.com/emacs-ess/ESS/issues/725#issuecomment-431781558" 34 | :init ((eval . (ess-r-test-rd-init))) 35 | :case " 36 | \\examples{ 37 | ¶1 38 | 2 39 | 3 40 | } 41 | " 42 | 43 | (setq-local ess-eval-visibly-p 'nowait) 44 | "C-c C-n" 45 | :result " 46 | \\examples{ 47 | 1 48 | ¶2 49 | 3 50 | } 51 | " 52 | :inf-result "1 53 | [1] 1 54 | > " 55 | 56 | (setq-local ess-eval-visibly-p nil) 57 | "C-c C-n" 58 | :result " 59 | \\examples{ 60 | 1 61 | 2 62 | ¶3 63 | } 64 | " 65 | :inf-result "2 66 | [1] 2 67 | > " 68 | ) 69 | -------------------------------------------------------------------------------- /test/ess-test-roxy.el: -------------------------------------------------------------------------------- 1 | ;;; ess-test-roxy.el --- ESS tests for Roxygen -*- lexical-binding: t; -*- 2 | ;; 3 | ;; This file is free software; you can redistribute it and/or modify 4 | ;; it under the terms of the GNU General Public License as published by 5 | ;; the Free Software Foundation; either version 2, or (at your option) 6 | ;; any later version. 7 | ;; 8 | ;; This file is distributed in the hope that it will be useful, 9 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | ;; GNU General Public License for more details. 12 | ;; 13 | ;; A copy of the GNU General Public License is available at 14 | ;; https://www.r-project.org/Licenses/ 15 | ;; 16 | ;;; Commentary: 17 | ;; 18 | 19 | (require 'ert) 20 | (require 'etest "etest/etest") 21 | (require 'ess-r-mode) 22 | 23 | (defun ess-test--faces-at-point () 24 | (let ((face (get-char-property (point) 'face))) 25 | (if (listp face) 26 | face 27 | (list face)))) 28 | 29 | (etest-deftest ess-roxy-fill-paragraph-test () 30 | :case " 31 | ##' Title 32 | ##' 33 | ##' @param¶ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 34 | ¶##' @param Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 35 | " 36 | 37 | "M-q" :result " 38 | ##' Title 39 | ##' 40 | ##' @param¶ Lorem ipsum dolor sit amet, consectetur adipiscing elit, 41 | ##' sed do eiusmod tempor incididunt ut labore et dolore magna 42 | ##' aliqua. Ut enim ad minim veniam, quis nostrud exercitation 43 | ##' ullamco laboris nisi ut aliquip ex ea commodo consequat. 44 | ¶##' @param Lorem ipsum dolor sit amet, consectetur adipiscing elit, 45 | ##' sed do eiusmod tempor incididunt ut labore et dolore magna 46 | ##' aliqua. Ut enim ad minim veniam, quis nostrud exercitation 47 | ##' ullamco laboris nisi ut aliquip ex ea commodo consequat. 48 | ") 49 | 50 | (etest-deftest ess-roxy-ret-test () 51 | :case " 52 | ##' ¶ 53 | " 54 | 55 | "RET" 56 | :result " 57 | ##' 58 | ##' ¶ 59 | " 60 | "RET" 61 | :result " 62 | ##' 63 | ##' 64 | ##' ¶ 65 | " 66 | 67 | (setq-local ess-roxy-insert-prefix-on-newline nil) 68 | "RET" 69 | :result " 70 | ##' 71 | ##' 72 | ##' 73 | ¶ 74 | " 75 | 76 | :case " 77 | ##' ¶ 78 | " 79 | "M-j" 80 | :result " 81 | ##' 82 | ##' ¶ 83 | ") 84 | 85 | (etest-deftest ess-roxy-faces-param-test () 86 | :case " 87 | ##' ¶@param foo 88 | ##' @¶param foo 89 | " 90 | (should (memq 'font-lock-keyword-face (ess-test--faces-at-point))) 91 | 92 | :case " 93 | ##' @param ¶foo 94 | " 95 | (should (not (memq 'font-lock-keyword-face (ess-test--faces-at-point)))) 96 | (should (memq 'font-lock-variable-name-face (ess-test--faces-at-point))) 97 | 98 | ;; Comma-separated params 99 | :case " 100 | ##' @param ¶foo,bar baz 101 | ##' @param foo¶,bar baz 102 | ##' @param foo,¶bar baz 103 | NULL 104 | " 105 | (should (memq 'font-lock-variable-name-face (ess-test--faces-at-point))) 106 | 107 | :case " 108 | ##' @param foo,bar ¶baz 109 | NULL 110 | " 111 | (should (not (memq 'font-lock-variable-name-face (ess-test--faces-at-point))))) 112 | 113 | ;; Local Variables: 114 | ;; etest-local-config: etest-r-config 115 | ;; End: 116 | -------------------------------------------------------------------------------- /test/ess-test.el: -------------------------------------------------------------------------------- 1 | ;;; ess-test.el --- ESS tests -*- lexical-binding: t; -*- 2 | ;; 3 | ;; This file is free software; you can redistribute it and/or modify 4 | ;; it under the terms of the GNU General Public License as published by 5 | ;; the Free Software Foundation; either version 2, or (at your option) 6 | ;; any later version. 7 | ;; 8 | ;; This file is distributed in the hope that it will be useful, 9 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | ;; GNU General Public License for more details. 12 | ;; 13 | ;; A copy of the GNU General Public License is available at 14 | ;; https://www.r-project.org/Licenses/ 15 | ;; 16 | ;;; Commentary: 17 | ;; ESS tests 18 | 19 | (require 'ert) 20 | (require 'ess-site) 21 | 22 | ;;; Code: 23 | 24 | (unless (fboundp 'provided-mode-derived-p) 25 | ;; From dev Emacs 26 | (defun provided-mode-derived-p (mode &rest modes) 27 | (while (and (not (memq mode modes)) 28 | (setq mode (get mode 'derived-mode-parent)))) 29 | mode)) 30 | 31 | (ert-deftest ess-mode-inherits-prog-mode () 32 | (should (unless nil (provided-mode-derived-p 'ess-mode 'prog-mode)))) 33 | 34 | ;; Ensure that major modes can be invoked without errors: 35 | 36 | (ert-deftest R-mode () 37 | (should (string= 'ess-r-mode (with-temp-buffer (R-mode) major-mode)))) 38 | 39 | (ert-deftest ess-jags-mode () 40 | (should (string= 'ess-jags-mode (with-temp-buffer (ess-jags-mode) major-mode)))) 41 | 42 | (ert-deftest ess-bugs-mode () 43 | (should (string= 'ess-bugs-mode (with-temp-buffer (ess-bugs-mode) major-mode)))) 44 | 45 | (ert-deftest ess-julia-mode () 46 | (skip-unless (and (require 'julia-mode nil t) (require 'ess-julia))) 47 | (should (string= 'ess-julia-mode (with-temp-buffer (ess-julia-mode) major-mode)))) 48 | 49 | (ert-deftest sas-mode () 50 | (should (string= 'SAS-mode (with-temp-buffer (SAS-mode) major-mode)))) 51 | 52 | ;; Various tests from e.g. ess-utils.el 53 | 54 | (ert-deftest ess-flatten-list () 55 | (should (equal (list 'a 'b 'c 'd 'e 'f 'g 'h 'i 'j) 56 | (ess-flatten-list '((a . b) c (d . e) (f g h) i . j))))) 57 | 58 | (provide 'ess-test) 59 | 60 | ;;; ess-test.el ends here 61 | -------------------------------------------------------------------------------- /test/etest/.nosearch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/test/etest/.nosearch -------------------------------------------------------------------------------- /test/fixtures/Makevars: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/test/fixtures/Makevars -------------------------------------------------------------------------------- /test/fixtures/Makevars.win: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-ess/ESS/cd85d1e1f0e897b409a948a3a4afdaffe032812e/test/fixtures/Makevars.win -------------------------------------------------------------------------------- /test/fixtures/file.R: -------------------------------------------------------------------------------- 1 | 2 | x <- TRUE 3 | "foo" 4 | -------------------------------------------------------------------------------- /test/fixtures/file.Rout: -------------------------------------------------------------------------------- 1 | test <- function() {} 2 | -------------------------------------------------------------------------------- /test/fixtures/navigation.R: -------------------------------------------------------------------------------- 1 | fn1 <- function(a, b) something(aaa) + 2 | aa / bb %>% 3 | cc ## end of fn1 4 | 5 | 6 | 7 | fn2 <- function(a, b) 8 | something(aaa) + 9 | aa / bb %>% 10 | cc ## end of fn2 11 | 12 | ### Some comments 13 | ## extra comments 14 | 15 | ## more comments 16 | 17 | fn3 <- function() { 18 | ## comment 19 | 20 | a <- 1 21 | 22 | b <- 3 23 | 24 | a + b 25 | 26 | } ## end of fn3 27 | 28 | ## some paragraph 29 | par1 <- 1 30 | par1 <- par1 31 | 32 | setMethod("method1", 33 | function() { 34 | }) ## end of setMethod 35 | 36 | 37 | fn4 <- function() { 38 | ## comment 39 | 40 | inner_fn5 <- function() { 41 | fn5_body 42 | } 43 | 44 | b <- 3 45 | 46 | a + b 47 | 48 | } ## end of fn4 49 | 50 | 51 | f5 <- function(){} ## end of f5 52 | 53 | "after f5" 54 | 55 | funcs <- 56 | list(f6 = function(){ 57 | some_code6 <- here 58 | 59 | }, ## end of f6 60 | 61 | f7 = function(){ 62 | 63 | some_code7 -> there 64 | }) ## end of f7 65 | 66 | 67 | f8 <- 68 | function(aaa, 69 | bb = bbb(), 70 | cc = "cccc") 71 | { 72 | Call <- match.call() 73 | miss.data <- missing(data) || !is.data.frame(data) 74 | 75 | ... 76 | } ## end of f8 77 | 78 | f9 <- function (x, ...) some_code 79 | 80 | 81 | ## navigation.R ends here 82 | -------------------------------------------------------------------------------- /test/generate-indent-cases: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emacs --script 2 | ;; (Re)generate files with test cases for indentation 3 | 4 | (let ((current-directory (file-name-directory load-file-name))) 5 | (setq ess-test-path (expand-file-name "." current-directory)) 6 | (setq ess-styles-path (expand-file-name "./styles/" current-directory)) 7 | (setq ess-root-path (expand-file-name "../lisp/" current-directory)) 8 | (setq etest-path (expand-file-name "etest/" ess-test-path))) 9 | 10 | (add-to-list 'load-path ess-root-path) 11 | (add-to-list 'load-path ess-test-path) 12 | (add-to-list 'load-path etest-path) 13 | 14 | (require 'ess-r-mode) 15 | (load (expand-file-name "ess-test-indentation.el" ess-test-path) nil t) 16 | 17 | ;; The RRR file is taken as a model, so modify this file to add or 18 | ;; adjust test cases. 19 | (let ((ess-style-alist ess-test-style-alist) 20 | (RRR-file (expand-file-name "RRR.R" ess-styles-path))) 21 | 22 | ;; Regenerate indentation in RRR file 23 | (set-buffer (find-file-noselect RRR-file)) 24 | (setq ess-indent-with-fancy-comments t) 25 | (ess-set-style 'RRR) 26 | (indent-region (point-min) (point-max)) 27 | (save-buffer) 28 | 29 | (mapc 30 | (lambda (test-conf) 31 | (let* ((test-name (car test-conf)) 32 | (test-file (expand-file-name 33 | (concat (symbol-name test-name) ".R") 34 | ess-styles-path))) 35 | (set-buffer (find-file-noselect test-file)) 36 | (setq ess-indent-with-fancy-comments t) 37 | (ess-set-style test-name) 38 | (insert-file-contents-literally RRR-file nil nil nil 'replace) 39 | (indent-region (point-min) (point-max)) 40 | (save-buffer))) 41 | (assq-delete-all 'RRR ess-test-style-alist))) 42 | -------------------------------------------------------------------------------- /test/generate-literate-cases: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emacs --script 2 | ;; (Re)generate files with test cases for indentation 3 | 4 | (let ((current-directory (file-name-directory load-file-name))) 5 | (setq ess-test-path (expand-file-name "." current-directory)) 6 | (setq ess-etest-path (expand-file-name "./etest/" current-directory)) 7 | (setq ess-literate-path (expand-file-name "./literate/" current-directory)) 8 | (setq ess-root-path (expand-file-name "../lisp/" current-directory))) 9 | 10 | (add-to-list 'load-path ess-root-path) 11 | (add-to-list 'load-path ess-test-path) 12 | (add-to-list 'load-path ess-etest-path) 13 | 14 | (require 'ert) 15 | (require 'ess-r-mode) 16 | (load (expand-file-name "ess-test-literate.el" ess-test-path) nil t) 17 | 18 | (message "\nStarting literate tests") 19 | 20 | (mapc (lambda (file) 21 | (elt-do 'regenerate (expand-file-name file ess-literate-path))) 22 | '("elt.R" "roxy.R" "code-fill.R" "misc.R" "syntax.R" "tokens.R" 23 | "fontification.R" "keybindings.R")) 24 | -------------------------------------------------------------------------------- /test/manual/R-error-patterns.R: -------------------------------------------------------------------------------- 1 | ## TODO: automate this somehow. 2 | ## 3 | ## For now manually 4 | ## 5 | ## (progn 6 | ## (setq-local compilation-error-regexp-alist ess-error-regexp-alist) 7 | ## (compilation-minor-mode)) 8 | ## 9 | ## and check if everything is highlighted as expected 10 | 11 | ## 1 12 | Error: chunk 7 (label = OP4) 13 | Error in disp.Rnw:656:31: unexpected symbol 14 | 655: par(mgp = c(2.5, 1, 1), mar = c(0, 0, 0, 0), 15 | 656: plt= c(0.08, 0.9, 0.25, 0.p9 16 | )) 17 | 18 | ## 2 19 | Browse[2]> Error in x %*% y (from models.R#46) : 20 | Cholmod error 'X and/or Y have wrong dimensions' at file ../MatrixOps/cholmod_sdmult.c, line 90 21 | 22 | ## 3 23 | Error in source("~/works/protoClasses/R/funcs.R") (from hierarchy.R#6) : 24 | ~/works/protoClasses/R/funcs.R:1797:5: unexpected '[[' 25 | 1796: b[[2]] <- quote(browser()) 26 | 1797: [[ 27 | ^ 28 | ## 4 29 | source("basicModel.R") 30 | Error in source("basicModel.R") : basicModel.R:95:1: unexpected symbol 31 | 94: 32 | 95: ixQ 33 | ^ 34 | 35 | ## 5.a 36 | > + Error in source(file = "/home/vitoshka/works/pbm/R/S4.R") (from #1) : 37 | /home/vitoshka/works/pbm/R/S4.R:36:62: unexpected ')' 38 | 35: }, list(vname = as.name(".pix_v")), 39 | 36: pname = as.name(".pix_p")))) 40 | ^ 41 | 42 | ## 5.b 43 | > + Error in source(file = "/home/vitoshka/works/pbm/R/S4.R") (from #1) : 44 | c:/home/vitoshka/works/pbm/R/S4.R:36:62: unexpected ')' 45 | 35: }, list(vname = as.name(".pix_v")), 46 | 36: pname = as.name(".pix_p")))) 47 | ^ 48 | 49 | ## 6 first line is not a pattern! 50 | + . + Error in base::source(file = file, echo = echo, local = local, print.eval = print.eval, (from #95) : 51 | /tmp/model_mixture.R@4:5:13: unexpected symbol 52 | 4: Mq$DATA$ixs$clust <- data$ixQ 53 | 5: Mq 54 | 55 | ## 7 don't highlight dates 56 | id lat lon obs_date 57 | Min. : 1.00 Min. :21.57 Min. :-179.88 01/02/1997 04:16:53: 1 58 | 1st Qu.: 99.25 1st Qu.:24.36 1st Qu.:-147.38 01/02/1997 05:56:25: 1 59 | Median :197.50 Median :25.64 Median :-119.64 01/04/1997 17:41:54: 1 60 | Mean :197.50 Mean :27.21 Mean : -21.52 01/05/1997 17:20:07: 1 61 | 3rd Qu.:295.75 3rd Qu.:27.41 3rd Qu.: 153.66 01/06/1997 04:31:13: 1 62 | Max. :394.00 Max. :39.84 Max. : 179.93 01/06/1997 06:12:56: 1 63 | (Other) :388 64 | ## 8 valgrind errors 65 | ==25269== Invalid read of size 8 66 | ==25269== at 0x9EC363C: inner_product (stl_numeric.h:183) 67 | ==25269== by 0x9EC363C: distance (rwmd.cpp:21) 68 | ==25269== by 0x9EC90C9: operator()(unsigned long, unsigned long) (rwmd.cpp:137) 69 | 70 | ## 9 testhat new patterns 71 | test_embeddings.R:20: failure: average embedding works 72 | embed_vocab(vocab, embs) not equal to embs[, 1:N]. 73 | Attributes: < Length mismatch: comparison on first 1 components > 74 | 75 | test_embeddings.R:59: error: average embedding works with missing values 76 | no 'dimnames' attribute for array 77 | 1: expect_equal(e[, "dd"], e[, "ee"]) at /store/Dropbox/dev/mlvocab/tests/testthat/test_embeddings.R:59 78 | 2: quasi_label(enquo(object), label) at /tmp/Rtmp6McxD6/R.INSTALL70c948e315c6/testthat/R/expect-equality.R:51 79 | 3: eval_bare(get_expr(quo), get_env(quo)) at /tmp/Rtmp6McxD6/R.INSTALL70c948e315c6/testthat/R/expectation.R:90 80 | 81 | # 10 rlang backtrace 82 | Backtrace: 83 | █ 84 | 1. ├─global::update_orders(self, mm()) 85 | 2. │ └─self$orders(name) ~/dev/foo/bla.R:157:2 86 | 3. │ └─purrr::keep(...) ~/dev/foo/bla.R:85:14 87 | 4. │ └─purrr:::probe(.x, .p, ...) 88 | 5. │ └─purrr::map_lgl(.x, .p, ...) 89 | 6. └─purrr:::stop_bad_type(...) 90 | 91 | # 11 "at" rlang backtrace 92 | 10. └─shapvis::shiny_xdeps_ui(shads, name = "SHAP TS", per_page = per_page) at shiny/R/bootstrap.R:761:2 93 | 11. └─shapvis:::shiny_ui(...) at shapvis/R/app.R:72:2 94 | 12. └─shapvis:::var_groups(shad, exclude_regexp) at shapvis/R/app.R:106:2 95 | 13. ├─base::unique(...) at shapvis/R/app.R:33:2 96 | 14. └─base::colnames(shad$extra) at shapvis/R/app.R:33:2 97 | 15. └─base::is.data.frame(x) 98 | 99 | # 12 testhat failure 100 | Failure (test-kmeans.R:430:3): predict_KMeans returns the correct output if the input is a data frame AND 101 | 102 | # 13 shiny pattern 103 | Warning: Error in *: non-numeric argument to binary operator 104 | 173: plot_shap_deps_internal [/home/joe/proj/R/plot.R#219] 105 | 172: fn [/home/joe/proj/R/plot.R#184] 106 | 107 | ## but not these ranges: 108 | > str(list(1:3)) 109 | List of 1 110 | $ : int [1:3] 1 2 3 111 | > 112 | -------------------------------------------------------------------------------- /test/run-tests: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S emacs --script 2 | ;; -*- mode: emacs-lisp -*- 3 | 4 | ;; This script must be run from the test directory 5 | ;; With no argument, run all tests. Otherwise run only mentioned tests. 6 | ;; Possible arguments: --r --r-indent etc. 7 | 8 | (let ((current-directory (file-name-directory load-file-name))) 9 | (setq ess-root-path (expand-file-name "../lisp/" current-directory)) 10 | (setq ess-test-path (expand-file-name "." current-directory)) 11 | (setq etest-path (expand-file-name "etest/" ess-test-path))) 12 | 13 | (add-to-list 'load-path ess-root-path) 14 | (add-to-list 'load-path ess-test-path) 15 | (add-to-list 'load-path etest-path) 16 | 17 | (require 'ess-test-r-utils) 18 | (setq ess-inhibit-message-in-tests t) 19 | (setq ert-batch-backtrace-right-margin 130) 20 | 21 | ;; lintr probably isn't installed in the test suite and flymake will 22 | ;; complain about that. Disable it during tests. 23 | (setq ess-use-flymake nil) 24 | 25 | (when (= (length argv) 0) 26 | (setq argv '("--ess" "--inf" "--org" "--r-core" "--r-indent" "--r-pkg"))) 27 | 28 | ;; Enable file-local variables while loading 29 | (defun ess-test-load-locally (name &optional dir) 30 | (let ((file (expand-file-name name dir))) 31 | (unless (assoc file load-history) 32 | (with-current-buffer (find-file-noselect file) 33 | (load file nil t))))) 34 | 35 | (put 'etest-local-config 'safe-local-variable #'symbolp) 36 | 37 | (when (member "--ess" argv) 38 | (ess-test-load-locally "ess-test.el" ess-test-path)) 39 | (when (member "--inf" argv) 40 | (ess-test-load-locally "ess-test-inf.el" ess-test-path)) 41 | (when (member "--org" argv) 42 | (ess-test-load-locally "ess-test-org.el" ess-test-path)) 43 | (when (member "--r-core" argv) 44 | (ess-test-load-locally "ess-test-r-eval.el" ess-test-path) 45 | (ess-test-load-locally "ess-test-r-package.el" ess-test-path) 46 | (ess-test-load-locally "ess-test-r-edit.el" ess-test-path) 47 | (ess-test-load-locally "ess-test-r-fontification.el" ess-test-path) 48 | (ess-test-load-locally "ess-test-r-syntax.el" ess-test-path) 49 | (ess-test-load-locally "ess-test-r-token.el" ess-test-path) 50 | (ess-test-load-locally "ess-test-r.el" ess-test-path) 51 | (ess-test-load-locally "ess-test-roxy.el" ess-test-path) 52 | (ess-test-load-locally "ess-test-rd.el" ess-test-path)) 53 | (when (member "--r-indent" argv) 54 | (ess-test-load-locally "ess-test-indentation.el" ess-test-path)) 55 | (when (member "--r-pkg" argv) 56 | (ess-test-load-locally "ess-test-r-package.el" ess-test-path)) 57 | 58 | ;; run tests 59 | (ert-run-tests-batch-and-exit t) 60 | --------------------------------------------------------------------------------