From 73a9a5db475d0b5bc5bd365982e4e259f3b0dd23 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 22 Jan 2019 15:53:50 +0100 Subject: [PATCH] Updated ess. Signed-off-by: Andreas Gerler --- elpa/ess-20181109.703/ess-arc-d.el | 84 - elpa/ess-20181109.703/ess-dde.el | 178 -- elpa/ess-20181109.703/ess-font-lock.el | 151 -- elpa/ess-20181109.703/ess-generics.el | 109 - elpa/ess-20181109.703/ess-lsp-l.el | 65 - elpa/ess-20181109.703/ess-mode.el | 31 - .../ess-noweb-font-lock-mode.el | 393 ---- elpa/ess-20181109.703/ess-noweb-mode.el | 1896 ----------------- elpa/ess-20181109.703/ess-noweb.el | 130 -- elpa/ess-20181109.703/ess-omg-d.el | 113 - elpa/ess-20181109.703/ess-omg-l.el | 326 --- elpa/ess-20181109.703/ess-r-gui.el | 207 -- elpa/ess-20181109.703/ess-rdired.el | 501 ----- elpa/ess-20181109.703/ess-s3-d.el | 79 - elpa/ess-20181109.703/ess-s4-d.el | 277 --- elpa/ess-20181109.703/ess-sp3-d.el | 85 - elpa/ess-20181109.703/ess-sp4-d.el | 419 ---- elpa/ess-20181109.703/ess-sp5-d.el | 106 - elpa/ess-20181109.703/ess-sp6w-d.el | 603 ------ elpa/ess-20181109.703/ess-swv.el | 425 ---- elpa/ess-20181109.703/ess-vst-d.el | 81 - elpa/ess-20181109.703/ess-xls-d.el | 105 - elpa/ess-20181109.703/etc/ESSR.rds | Bin 13189 -> 0 bytes elpa/ess-20181109.703/etc/ESSR/VERSION | 1 - .../.dir-locals.el | 3 +- .../allnews.info | 91 +- .../announc.info | 121 +- .../authors.info | 0 .../bugrept.info | 0 .../credits.info | 0 .../currfeat.info | 0 .../dir | 0 .../ess-autoloads.el | 667 ++---- .../ess-bugs-d.el | 21 +- .../ess-bugs-l.el | 22 +- .../ess-custom.el | 461 ++-- .../ess-defs.info | 0 .../ess-gretl.el | 140 +- .../ess-help.el | 285 +-- .../ess-inf.el | 1596 ++++++-------- .../ess-jags-d.el | 22 +- .../ess-julia.el | 124 +- .../ess.el => ess-20190121.1430/ess-mode.el} | 415 ++-- .../ess-mouse.el | 38 +- .../ess-pkg.el | 8 +- .../ess-r-a.el | 0 .../ess-r-completion.el | 15 +- .../ess-r-flymake.el | 16 +- .../ess-r-mode.el | 596 +++--- .../ess-r-package.el | 138 +- .../ess-r-syntax.el | 13 +- .../ess-r-xref.el | 19 +- .../ess-rd.el | 176 +- elpa/ess-20190121.1430/ess-rdired.el | 279 +++ .../ess-roxy.el | 400 ++-- .../ess-rutils.el | 69 +- .../ess-s-lang.el | 66 +- .../ess-sas-a.el | 64 +- .../ess-sas-d.el | 74 +- .../ess-sas-l.el | 133 +- .../ess-site.el | 21 +- .../ess-sp6-d.el | 32 +- .../ess-stata-lang.el | 49 +- .../ess-stata-mode.el | 90 +- .../ess-toolbar.el | 0 .../ess-tracebug.el | 339 +-- .../ess-trns.el | 160 +- .../ess-utils.el | 809 ++----- elpa/ess-20190121.1430/ess.el | 222 ++ .../ess.info | 444 ++-- .../essd-els.el | 47 +- elpa/ess-20190121.1430/etc/ESSR.rds | Bin 0 -> 13331 bytes .../etc/ESSR/BUILDESSR | 0 .../etc/ESSR/LOADREMOTE | 3 +- .../etc/ESSR/R/.basic.R | 16 +- .../etc/ESSR/R/.load.R | 19 +- .../etc/ESSR/R/completion.R | 15 +- .../etc/ESSR/R/debug.R | 4 - .../etc/ESSR/R/misc.R | 4 - .../etc/ESSR/R/mpi.R | 0 .../etc/ESSR/R/ns-eval.R | 28 +- .../etc/ESSR/R/pkg.R | 0 .../etc/Makefile | 22 +- .../etc/R-ESS-bugs.R | 14 +- .../etc/R-ESS-bugs.el | 0 .../etc/R-error-patterns.R | 0 .../etc/completion_ideas.R | 0 .../etc/ess-julia.jl | 4 +- .../etc/ess-sas-sh-command | 0 .../etc/gpl-check | 0 .../etc/pkg-Maintainers | 0 .../license.info | 0 .../mailing.info | 0 .../make-regexp.el | 0 .../mouseme.el | 8 +- .../news.info | 91 +- .../onews.info | 0 .../readme.info | 120 +- .../requires.info | 2 +- 99 files changed, 3949 insertions(+), 11051 deletions(-) delete mode 100644 elpa/ess-20181109.703/ess-arc-d.el delete mode 100644 elpa/ess-20181109.703/ess-dde.el delete mode 100644 elpa/ess-20181109.703/ess-font-lock.el delete mode 100644 elpa/ess-20181109.703/ess-generics.el delete mode 100644 elpa/ess-20181109.703/ess-lsp-l.el delete mode 100644 elpa/ess-20181109.703/ess-mode.el delete mode 100644 elpa/ess-20181109.703/ess-noweb-font-lock-mode.el delete mode 100644 elpa/ess-20181109.703/ess-noweb-mode.el delete mode 100644 elpa/ess-20181109.703/ess-noweb.el delete mode 100644 elpa/ess-20181109.703/ess-omg-d.el delete mode 100644 elpa/ess-20181109.703/ess-omg-l.el delete mode 100644 elpa/ess-20181109.703/ess-r-gui.el delete mode 100644 elpa/ess-20181109.703/ess-rdired.el delete mode 100644 elpa/ess-20181109.703/ess-s3-d.el delete mode 100644 elpa/ess-20181109.703/ess-s4-d.el delete mode 100644 elpa/ess-20181109.703/ess-sp3-d.el delete mode 100644 elpa/ess-20181109.703/ess-sp4-d.el delete mode 100644 elpa/ess-20181109.703/ess-sp5-d.el delete mode 100644 elpa/ess-20181109.703/ess-sp6w-d.el delete mode 100644 elpa/ess-20181109.703/ess-swv.el delete mode 100644 elpa/ess-20181109.703/ess-vst-d.el delete mode 100644 elpa/ess-20181109.703/ess-xls-d.el delete mode 100644 elpa/ess-20181109.703/etc/ESSR.rds delete mode 100644 elpa/ess-20181109.703/etc/ESSR/VERSION rename elpa/{ess-20181109.703 => ess-20190121.1430}/.dir-locals.el (85%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/allnews.info (95%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/announc.info (84%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/authors.info (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/bugrept.info (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/credits.info (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/currfeat.info (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/dir (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-autoloads.el (52%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-bugs-d.el (97%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-bugs-l.el (93%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-custom.el (88%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-defs.info (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-gretl.el (84%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-help.el (80%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-inf.el (71%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-jags-d.el (96%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-julia.el (82%) rename elpa/{ess-20181109.703/ess.el => ess-20190121.1430/ess-mode.el} (71%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-mouse.el (86%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-pkg.el (77%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-r-a.el (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-r-completion.el (98%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-r-flymake.el (95%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-r-mode.el (84%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-r-package.el (84%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-r-syntax.el (99%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-r-xref.el (88%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-rd.el (78%) create mode 100644 elpa/ess-20190121.1430/ess-rdired.el rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-roxy.el (74%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-rutils.el (90%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-s-lang.el (94%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-sas-a.el (97%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-sas-d.el (85%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-sas-l.el (94%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-site.el (90%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-sp6-d.el (87%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-stata-lang.el (95%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-stata-mode.el (64%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-toolbar.el (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-tracebug.el (91%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-trns.el (56%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess-utils.el (61%) create mode 100644 elpa/ess-20190121.1430/ess.el rename elpa/{ess-20181109.703 => ess-20190121.1430}/ess.info (94%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/essd-els.el (83%) create mode 100644 elpa/ess-20190121.1430/etc/ESSR.rds rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ESSR/BUILDESSR (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ESSR/LOADREMOTE (86%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ESSR/R/.basic.R (94%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ESSR/R/.load.R (79%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ESSR/R/completion.R (95%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ESSR/R/debug.R (99%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ESSR/R/misc.R (98%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ESSR/R/mpi.R (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ESSR/R/ns-eval.R (96%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ESSR/R/pkg.R (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/Makefile (69%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/R-ESS-bugs.R (97%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/R-ESS-bugs.el (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/R-error-patterns.R (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/completion_ideas.R (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ess-julia.jl (96%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/ess-sas-sh-command (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/gpl-check (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/etc/pkg-Maintainers (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/license.info (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/mailing.info (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/make-regexp.el (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/mouseme.el (98%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/news.info (76%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/onews.info (100%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/readme.info (84%) rename elpa/{ess-20181109.703 => ess-20190121.1430}/requires.info (88%) diff --git a/elpa/ess-20181109.703/ess-arc-d.el b/elpa/ess-20181109.703/ess-arc-d.el deleted file mode 100644 index 823e77bb..00000000 --- a/elpa/ess-20181109.703/ess-arc-d.el +++ /dev/null @@ -1,84 +0,0 @@ -;;; ess-arc-d.el --- ARC customization - -;; Copyright (C) 2000 A. J. Rossini -;; Copyright (C) 2001--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: A.J. Rossini -;; Created: 30 Jun 2000 -;; Maintainer: ESS-core - -;; Keywords: languages - -;; This file is part of ESS - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - - -;;; Commentary: - -;; This file extends the XLispStat configuration for ARC, the extension of the -;; R-Code. - -;;; Code: - -(require 'ess-lsp-l) -(require 'ess-inf) -(declare-function ess-write-to-dribble-buffer "ess-utils") -(defvar ess-customize-alist) -(defvar ess-dialect) - -(defvar ARC-customize-alist - '((ess-customize-alist . ARC-customize-alist ) - (ess-language . "XLS" ) - (ess-dialect . "ARC" ) - (ess-object-name-db-file . "ess-xls-namedb.el" ) - (ess-help-sec-regex . " ") - (ess-help-sec-keys-alist . " ") - (inferior-ess-primary-prompt . "> ?" ) - (comint-use-prompt-regexp . t) - (inferior-ess-program . inferior-ARC-program) - (inferior-ess-help-command . "(help '%s)\n" ) - (inferior-ess-objects-command . "(variables)\n" ) - (inferior-ess-exit-command . "(exit)\n" ) - ;;(inferior-ess-start-args . nil) - (inferior-ess-start-file . nil)) ; "~/.ess-ARC") - - "Variables to customize for ARC, a dialect of XLS.") - - -(defun ARC-mode (&optional proc-name) - "Major mode for editing ARC source. NOT EVEN STARTED." - (interactive) - (setq ess-customize-alist ARC-customize-alist) - (lisp-mode)) - - -(defun ARC () - "Call 'ARC', the extend XLispStat statistical system, from Forrest Young." - - (interactive) - (setq ess-customize-alist ARC-customize-alist) - (ess-write-to-dribble-buffer - (format "(ARC): ess-dialect=%s , buf=%s\n" - ess-dialect (current-buffer))) - (inferior-ess)) - -(fset 'arc 'ARC) - - ; Provide package - -(provide 'ess-arc-d) - -;;; ess-arc-d.el ends here diff --git a/elpa/ess-20181109.703/ess-dde.el b/elpa/ess-20181109.703/ess-dde.el deleted file mode 100644 index ecf4ec6a..00000000 --- a/elpa/ess-20181109.703/ess-dde.el +++ /dev/null @@ -1,178 +0,0 @@ -;;; ess-dde.el --- ESS customization for ddeclients under Windows 9x/NT - -;; Copyright (C) 1998--1999 Richard M. Heiberger -;; Copyright (C) 2000--2006 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: Richard M. Heiberger -;; Created: 9 Dec 1998 -;; Maintainer: ESS-core - -;; This file is part of ESS - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - - -;;; Commentary: - -;; Code for dealing with running external processes on Windows 9x/NT -;; through ddeclient. - -;;; Code: - -(require 'ess-custom) -(require 'ess-mode) -(require 'ess-utils) - -(defun ess-ddeclient-p () - "Returns t iff `ess-local-process-name' is associated with an -inferior-ess-ddeclient, and nil if the ess-process is running as an -ordinary inferior process. Alway nil on Unix machines." - (interactive) - (when ess-microsoft-p - ;; Debug: C-c C-l fails (to start R or give good message) in Windows - (ess-write-to-dribble-buffer - (format "*ddeclient-p: ess-loc-proc-name is '%s'" ess-local-process-name)) - (ess-force-buffer-current "Process to load into: ") - (not (equal (ess-get-process-variable 'inferior-ess-ddeclient) - (default-value 'inferior-ess-ddeclient))))) - -;; C-c C-r -(defun ess-dde-send-region (proc start end &optional visibly message) - "Loop through lines in region and send them to ESS via ddeclient. - -PROC, VISIBLY and MESSAGE are ignored." - (setq ;; set the following variables for the current ddeESS process. - inferior-ess-ddeclient (ess-get-process-variable 'inferior-ess-ddeclient) - inferior-ess-client-name (ess-get-process-variable 'inferior-ess-client-name) - inferior-ess-client-command (ess-get-process-variable 'inferior-ess-client-command)) - (narrow-to-region start end) - (goto-char (point-min)) - (let ((beg)) - (while (or (< (point) (point-max)) - (and (= 1 (point-max)) - (bound-and-true-p ess-dde-even-empty))) - (setq beg (point)) - (end-of-line) - ;; call-process-region won't send over a 0-character line. - ;; We go outside the loop to create a 1-character line " " in the - ;; *ESS-temporary* buffer - (if (= beg (point)) ;; do empty line outside loop - (ess-dde-eval-linewise " " nil 'eob t) - ;;(call-process-region start end - ;; "ddeclient" nil nil nil "S-PLUS" "SCommand") - (call-process-region - beg (point) - inferior-ess-ddeclient nil nil nil - inferior-ess-client-name inferior-ess-client-command)) - (forward-line 1)) - (widen))) - -;; C-c C-n -(defun ess-dde-eval-linewise (text-withtabs &optional invisibly eob - even-empty wait-last-prompt &rest args) - (with-current-buffer (get-buffer-create "*ESS-temporary*") - (ess-setq-vars-local ess-customize-alist (current-buffer)) - (erase-buffer) - (insert text-withtabs) - (let ((ess-dde-even-empty even-empty)) - (ess-dde-send-region nil (point-min) (point-max)))) - (when wait-last-prompt - ess-eval-ddeclient-sleep)) ; in addition to timeout-ms - -;; C-c C-v -(defun ess-dde-display-help-on-object (object &rest args) - "Display the ESS documentation for OBJECT in another window. -If prefix arg is given, forces a query of the ESS process for the help -file. Otherwise just pops to an existing buffer if it exists." - (ess-force-buffer-current "Process to load into: ") - (ess-dde-eval-linewise (concat "help(" object ")"))) - -(defun ess-dde-find-help-file (p-string) - (read-string "Help on: ")) - -;; C-c C-l -(defun ess-dde-load-file (filename) - "Load an S source file into an inferior ESS process; alternate behavior for -`ess-load-file', required with S-Plus GUI for Windows: Sends the S-Plus command -source(\"filename\") to S. This version does not guarantee to save .Last.value, -nor offer alternate buffers or editing capability." - (let ((source-buffer (get-file-buffer filename))) - (if (ess-check-source filename) - (error "Buffer %s has not been saved" (buffer-name source-buffer)) - ;; Find the process to load into - (if source-buffer - (with-current-buffer source-buffer - (ess-force-buffer-current "Process to load into: ") - ;; (ess-check-modifications) ;;; not possible with ddeclient - ;; it calls ess-command which requires two-way communication - ;; with the S-Plus process - ))) - (ess-dde-eval-linewise (format ess-load-command filename))) - (widen)) - - -;; C-c C-d -(defun ess-dde-dump-object (object filename) - "Dump the ESS object OBJECT into file FILENAME." - (ess-force-buffer-current "Process to load into: ") - (ess-dde-eval-linewise (concat "dump('" object "','" filename "')")) - (sleep-for 5) - (find-file filename) - (widen)) - -(defun ess-dde-read-object-name (p-string) - (read-string "Object to edit: ")) - -(defun ess-dput-expression-ddeclient (object filename) - "Dump the ESS object found by evaluating OBJECT into file FILENAME." - (ess-force-buffer-current "Process to load into: ") - (ess-dde-eval-linewise (concat "dput(" object ",'" filename "')")) - (sleep-for 2) - (find-file filename)) - -(defun ess-command-ddeclient-proposed (com &optional buf sleep) - "ddeclient version of real `ess-command'. -Send the ESS process command COM and redirect its output to the -temporary file named BUF. The temporary filename is constructed -in emacs, not in the ESS process. The default name for the -temporary buffer is \"ess-temp.st\". The function waits -SLEEP (which defaults to 1) seconds and then brings the temporary -file into an emacs buffer and displays it." - (let (filename bufname) - (if (not buf) (setq buf "ess-temp.st")) - (if (not sleep) (setq sleep 1)) - (setq filename (concat (file-name-as-directory (getenv "TEMP")) buf)) - (ess-dde-eval-linewise - (concat ".old.Last.value <- .Last.value; sink('" - filename - "'); print(" - com - "); sink(); .Last.value <- .old.Last.value")) - (setq bufname (ess-get-file-or-buffer filename)) ;; must follow the eval - (sleep-for sleep) - (if (not bufname) - (find-file filename) - (switch-to-buffer bufname)) - (revert-buffer t t) ;; this allows the user to reuse the BUF name - )) - -;; previous version (ESS-5.2.12 and earlier) -(defun ess-dde-command (com &optional buf sleep) - "ddeclient bypass of real ess-command" - (ess-eval-linewise com)) - -(provide 'ess-dde) - -;;; ess-dde.el ends here diff --git a/elpa/ess-20181109.703/ess-font-lock.el b/elpa/ess-20181109.703/ess-font-lock.el deleted file mode 100644 index 298dfd2f..00000000 --- a/elpa/ess-20181109.703/ess-font-lock.el +++ /dev/null @@ -1,151 +0,0 @@ -;;; ess-font-lock.el --- font-lock color options - -;; Copyright (C) 2000--2006 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: Richard M. Heiberger -;; Created: 06 Feb 2000 - -;; Keywords: languages, faces - -;; This file is part of ESS - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; provides syntax highlighting support. - -;;; Code: - - ; Requires and autoloads - -(require 'font-lock) -(require 'paren) - -;; FIXME: What is this doing here!? -(if (fboundp 'show-paren-mode) (show-paren-mode 1)) - -;;; Emacs 20.x notes: - -;; font-lock faces are defined in /emacs/emacs-20.5/lisp/font-lock.el -;; The font-lock faces are applied to ESS buffers by -;; ess-mode.el ess-inf.el ess-trns.el ess-custom.el -;; The keywords for faces are defined in the ess[dl]*.el files. -;; All faces can be looked at, under Emacs 20.x, with -;; [menu-bar] [Edit] [Text Properties] [Display Faces} - -(defun ess-font-lock-rmh () - "Set font-lock colors to Richard Heiberger's usual choice." - ;; FIXME: Turn it into a Custom theme! - (interactive) - - (set-foreground-color "Black") - (set-background-color "lightcyan") - - (set-face-background 'mode-line "lightskyblue") - (set-face-foreground 'mode-line "midnightblue") - - (set-face-foreground 'font-lock-comment-face "Firebrick") - (set-face-foreground 'font-lock-function-name-face "Blue") - (set-face-foreground 'font-lock-keyword-face "Purple") - (set-face-foreground 'font-lock-constant-face "Brown") - (set-face-foreground 'font-lock-string-face "VioletRed") - (set-face-foreground 'font-lock-type-face "Sienna") - (set-face-foreground 'font-lock-variable-name-face "Black")) - -(defun ess-font-lock-blue () - "Set font-lock colors to Richard Heiberger's blue color scheme." - ;; FIXME: Turn it into a Custom theme! - (interactive) - - (set-foreground-color "Black") - (set-background-color "LightBlue") - - (set-face-foreground 'mode-line "LightBlue") - (set-face-background 'mode-line "DarkSlateBlue") - - (set-face-foreground 'font-lock-comment-face "Firebrick") - (set-face-foreground 'font-lock-function-name-face "Blue") - (set-face-foreground 'font-lock-keyword-face "Purple") - (set-face-foreground 'font-lock-constant-face "Brown") - (set-face-foreground 'font-lock-string-face "VioletRed") - (set-face-foreground 'font-lock-type-face "Sienna") - (set-face-foreground 'font-lock-variable-name-face "Black")) - -(defun ess-font-lock-wheat () - "Set font-lock colors to Richard Heiberger's wheat color scheme." - ;; FIXME: Turn it into a Custom theme! - (interactive) - - (set-foreground-color "Black") - (set-background-color "Wheat") - - (set-face-foreground 'mode-line "Wheat") - (set-face-background 'mode-line "Sienna") - - (set-face-foreground 'font-lock-comment-face "Firebrick") - (set-face-foreground 'font-lock-function-name-face "Blue") - (set-face-foreground 'font-lock-keyword-face "Purple") - (set-face-foreground 'font-lock-constant-face "Brown") - (set-face-foreground 'font-lock-string-face "VioletRed") - (set-face-foreground 'font-lock-type-face "Sienna") - (set-face-foreground 'font-lock-variable-name-face "Black")) - - -(defun ess-font-lock-bw () - "Set font-lock colors to Richard Heiberger's black and white color scheme." - ;; FIXME: Turn it into a Custom theme! - (interactive) - - (set-foreground-color "Black") - (set-background-color "white") - - (set-face-foreground 'mode-line "gray10") - (set-face-background 'mode-line "gray90") - - ;; modify-face is an interactive compiled Lisp function in `faces'. - ;; Sample usage: - - ;;(modify-face FACE FOREGROUND BACKGROUND STIPPLE BOLD-P ITALIC-P UNDERLINE-P &optional INVERSE-P FRAME) - - (modify-face 'mode-line "gray10" "gray90" nil nil t nil ) - (modify-face 'font-lock-comment-face "black" "white" nil nil t nil ) - (modify-face 'font-lock-function-name-face "black" "white" nil t nil nil ) - (modify-face 'font-lock-keyword-face "black" "white" nil nil nil t ) - (modify-face 'font-lock-constant-face "black" "white" nil t nil nil ) - (modify-face 'font-lock-string-face "black" "white" nil nil t t ) - (modify-face 'font-lock-type-face "black" "white" nil t t nil ) - (modify-face 'font-lock-variable-name-face "black" "white" nil nil nil nil ) - (modify-face 'font-lock-builtin-face "black" "white" nil t nil nil ) - (modify-face 'font-lock-warning-face "black" "white" nil t nil nil ) - (modify-face 'show-paren-match-face "gray20" "gray80" nil t nil nil ) - (modify-face 'show-paren-mismatch-face "white" "gray40" nil t t nil )) - -(defun ess-font-lock-db () - "Set font-lock colors (leave fore-/back-ground alone) courtesy David Brahm " - ;; FIXME: Turn it into a Custom theme! - (interactive) - (set-face-foreground 'font-lock-comment-face "Firebrick") ; #... %... - (set-face-foreground 'font-lock-string-face "SeaGreen") ; "..." "..." - (set-face-foreground 'font-lock-keyword-face "MediumBlue") ; if \end - (set-face-foreground 'font-lock-function-name-face "VioletRed") ; talk<- {center} - (set-face-foreground 'font-lock-variable-name-face "Blue") ; xv - (set-face-foreground 'font-lock-type-face "Goldenrod") ; T,F ? - (set-face-foreground 'font-lock-constant-face "Magenta") ; <- {eq1} - ) - -(provide 'ess-font-lock) - -;;; ess-font-lock.el ends here diff --git a/elpa/ess-20181109.703/ess-generics.el b/elpa/ess-20181109.703/ess-generics.el deleted file mode 100644 index 772c2868..00000000 --- a/elpa/ess-20181109.703/ess-generics.el +++ /dev/null @@ -1,109 +0,0 @@ -;;; ess-generics.el --- Mode-generic functions -;; -;; Copyright (C) ESS-core -;; Maintainer: ESS-core -;; -;; This file is part of ESS -;; -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ -;; -;;; Comment -;; -;; Define generic method with `ess-defgeneric' and dialect specific override with -;; `ess-defmethod`. Current implementation is using `{name}-function' and -;; `ess-customize-alist' as the backbone mechanism. This might change in the -;; future. -;; -;;; Code - -(defun ess-generics--override (name args body) - (let ((funname (intern (format "%s-function" name))) - (arg-list (delq '&rest (delq '&optional (copy-alist args))))) - `(if (fboundp ,funname) - ,(if (memq '&rest args) - `(apply ,funname ,@arg-list) - `(funcall ,funname ,@arg-list)) - ,@(or body - `((error (format "`%s' is not implemented for dialect `%s'" - ',name ess-dialect))))))) - -(defun ess-generics--expand-overrides (name args body) - ;; ripped off from `mode-local--expand-overrides' - (let ((forms body) - (ditto t) - form xbody) - (while forms - (setq form (car forms)) - (cond - ((atom form)) - ((eq (car form) :override) - (setq form (ess-generics--override name args (cdr form)))) - ((eq (car form) :override-with-args) - (setq form (ess-generics--override name (cadr form) (cddr form)))) - ((setq form (ess-generics--expand-overrides name args form)))) - (setq ditto (and ditto (eq (car forms) form)) - xbody (cons form xbody) - forms (cdr forms))) - (if ditto body (nreverse xbody)))) - -;;;###autoload -(defmacro ess-defgeneric (name args docstring &rest body) - "Define a new function, as with `defun', which can be overloaded. -NAME is the name of the function to create. ARGS are the -arguments to the function. DOCSTRING is a documentation string to -describe the function. The docstring will automatically have -details about its overload symbol appended to the end. BODY is -code that would be run when there is no override defined. The -default is to signal error if {name}-function is not defined." - (declare (doc-string 3) (indent defun) (debug defun)) - (let ((funname (intern (format "%s-function" name)))) - `(eval-and-compile - (defvar-local ,funname nil ,(format "When defined this function is called by `%s'." name)) - (defun ,name ,args ,(format "%s\n\nUse `ess-defmethod' to define dialect specific overrides." docstring) - ,@(ess-generics--expand-overrides name args body))))) - -(defmacro ess-defmethod (dialect name args &rest body) - "Define a dialect specific override of the method NAME. -If NAME wasn't created with `ess-defgeneric' signal an -error. DIALECT is the dialect name this override is being defined -for. ARGS are the function arguments, which should match those of -the same named function created with `ess-defgeneric'. BODY is the -implementation of this function." - (declare (indent defun) (debug (&define sexp sexp lambda-list def-body))) - (let ((new-name (intern (format "%s:%s" name dialect))) - (fun-name (intern (format "%s-function" name))) - (alist-name (intern (downcase (format "ess-%s-customize-alist" dialect))))) - `(eval-and-compile - (unless (boundp ',alist-name) - (defvar ,alist-name nil - ,(format "Variables to customize dialect '%s'." dialect))) - (add-to-list ',alist-name - '(,fun-name . ',new-name)) - (defun ,new-name ,args - ,(format "%s\nThis is an override for `%s' for `%s' dialect." - ;; fixme: NAME might be undefined as yet. Look at help-fns-describe-function-functions - (or (and (fboundp name) - (documentation name) - ;; hackish - (replace-regexp-in-string "\nUse.*ess-defmethod.*\\." "" (documentation name))) - "") - name dialect) - ;; The body for this implementation - ,@body) - ;; For find-func to locate the definition of NEW-NAME. - (put ',new-name 'definition-name ',name)))) - - - -(provide 'ess-generics) diff --git a/elpa/ess-20181109.703/ess-lsp-l.el b/elpa/ess-20181109.703/ess-lsp-l.el deleted file mode 100644 index 179e1fc8..00000000 --- a/elpa/ess-20181109.703/ess-lsp-l.el +++ /dev/null @@ -1,65 +0,0 @@ -;;; ess-lsp-l.el --- Support for editing Lisp source code - -;; Copyright (C) 1997 A.J. Rossini. -;; Copyright (C) 1998--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: A.J. Rossini -;; Created: 1 Sept 1997 -;; Maintainer: ESS-core - -;; This file is part of ESS. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; Configurations for editing XLispStat source code. Contains any underlying -;; changes that need to be made. - -;;; Code: - - ; Requires and autoloads - -;; Contents "translated" from lisp-mode.el -(require 'lisp-mode) - - ; Configuration variables - - - -(defvar Lisp-editing-alist - '((paragraph-start . (concat "^$\\|" page-delimiter)) - (paragraph-separate . (concat "^$\\|" page-delimiter)) - (paragraph-ignore-fill-prefix . t) - (fill-paragraph-function . 'lisp-fill-paragraph) - (adaptive-fill-mode . nil) - (indent-line-function . 'lisp-indent-line) - (indent-region-function . 'lisp-indent-region) - (require-final-newline . mode-require-final-newline) - (comment-start . ";") - (comment-start-skip . "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") - (comment-column . 40) - (comment-indent-function . 'lisp-comment-indent) - (parse-sexp-ignore-comments . t) - (ess-style . ess-default-style) - (ess-local-process-name . nil) - ;;(ess-keep-dump-files . 'ask) - (ess-mode-syntax-table . lisp-mode-syntax-table) - (font-lock-defaults . '(lisp-font-lock-keywords))) - "General options for editing LispStat, XLispStat, and ViSta source files.") - -(provide 'ess-lsp-l) - -;;; ess-lsp-l.el ends here diff --git a/elpa/ess-20181109.703/ess-mode.el b/elpa/ess-20181109.703/ess-mode.el deleted file mode 100644 index 782a9e6b..00000000 --- a/elpa/ess-20181109.703/ess-mode.el +++ /dev/null @@ -1,31 +0,0 @@ -;;; ess-mode.el -- Emacs Speaks Statistics (ESS). -;; -;; Copyright (C) 1994-2018 ESS Core Team -;; Maintainer: ESS-core -;; -;; Keywords: languages -;; -;; This file is part of ESS -;; -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ -;; -;;; Commentary: -;; -;; A placeholder required by all other mode files. -;; -;;; Code: - -(require 'ess) - -(provide 'ess-mode) diff --git a/elpa/ess-20181109.703/ess-noweb-font-lock-mode.el b/elpa/ess-20181109.703/ess-noweb-font-lock-mode.el deleted file mode 100644 index 04d183c8..00000000 --- a/elpa/ess-20181109.703/ess-noweb-font-lock-mode.el +++ /dev/null @@ -1,393 +0,0 @@ -;;; ess-noweb-font-lock-mode.el --- edit noweb files with GNU Emacs - -;; Copyright (C) 1999 by Adnan Yaqub (AYaqub@orga.com) -;; and Mark Lunt (mark.lunt@mrc-bsu.cam.ac.uk -;; Copyright (C) 2002 by A.J. Rossini -;; Copyright (C) 2003--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Maintainer: ESS-core - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ -;; - -;;; Commentary: - -;; Code-dependent highlighting -;; ***** -;; -;; Adding highlighting to ess-noweb-mode.el -;; -;; Here is a description of how one can add highlighting via the -;; font-lock package to noweb buffers. It uses the hooks provided by -;; ess-noweb-mode.el. The solution provides the following features: -;; 1) The documentation chunks are highlighted in the ess-noweb-doc-mode -;; (e.g., LaTeX). -;; 2) The code chunks without mode comments (-*- mode -*-) are -;; highlighted in the ess-noweb-code-mode. -;; 3) The code chunks with mode comments (-*- mode -*-) on the first -;; line of the first chunk with this name are highlighted in the mode -;; in the comment. -;; -;; For example, given the file: -;; -;; % -*- mode: Noweb; ess-noweb-code-mode: c-mode -*- -;; -;; \begin{itemize} -;; \item a main routine written in C, -;; \item a log configuration file parser written in YACC, and -;; \item a lexical analyzer written in Lex. -;; \end{itemize} -;; -;; <>= -;; /* DO NOT EDIT ME! */ -;; /* This file was automatically generated from %W% (%G%). */ -;; @ -;; -;; <>= -;; .\" -*- nroff -*- -;; .\" DO NOT EDIT ME! -;; .\" This file was automatically generated from %W% (%G%). -;; @ -;; -;; The LaTeX list is highlighted in latex-mode (the default noweb doc -;; mode), the chunk <> is highlighted in c-mode (the -;; default noweb code mode), and the chunk <> is -;; highlighted in nroff-mode due to the "-*- nroff -*-" comment. -;; -;; Chunks are highlighted each time point moves into them from a -;; different mode. They are also fontified 'on the fly', but this is -;; less reliable, since the syntax can depend on the context. It's as -;; good as you would get outside ess-noweb-mode, though. -;; -;; To use it, you must add -;; (require 'ess-noweb-font-lock-mode) to your .emacs file. -;; Then, if you use either global-font-lock or turn-on-font-lock -;; statements, any ess-noweb-mode buffers will be fontified -;; appropriately. (We have to redefine turn-on-font-lock, but it -;; saves breaking other packages (in particular ESS, which I use a -;; lot), that assume that turn-on-font-lock is the way to turn on -;; font locking. - -;; Alternatively, you can turn ess-noweb-font-lock-mode on and off by -;; using M-x ess-noweb-font-lock-mode. However, turning -;; ess-noweb-font-lock-mode off when global-font-lock-mode is t makes it -;; impossible to use font-locking in that buffer subsequently, other -;; than by turning ess-noweb-font-lock-mode back on. - -;; 2) The highlighting sometimes get confused, but this is no longer -;; a noweb problem. Highlighting should work as well within a chunk -;; as it does without ess-noweb-mode. -;; There are some problems with, for example latex-mode: a `$' in a -;; verbatim environment with throw the font-locking out. -;; One slight blemish is that code-quotes are highlighted as comments -;; as they are being entered. They are only highlighted correctly -;; after `ess-noweb-font-lock-fontify-chunk' has been run, either as a -;; command or through changing to a different chunk and back again -;; (unless they lie on a single line, in which case they are -;; fontified correctly once they are completed). - -;;; Code: - -(require 'ess-noweb-mode) -(require 'font-lock) - -(defvar ess-noweb-font-lock-mode nil - "Buffer local variable, t iff this buffer is using `ess-noweb-font-lock-mode'.") - -(defvar ess-noweb-use-font-lock-mode t - "DO NOT CHANGE THIS VARIABLE -If you use `nw-turn-on-font-lock' to turn on font-locking, then turn it -off again, it would come back on again of its own accord when you -changed major-mode. This variable is used internally to stop it.") - -(defvar ess-noweb-font-lock-mode-hook nil - "Hook that is run after entering ess-noweb-font-lock mode.") - -(defvar ess-noweb-font-lock-max-initial-chunks 30 - "Maximum number of chunks to fontify initially. -If nil, will fontify the entire buffer when -ess-noweb-font-lock-initial-fontify-buffer is called" ) - -;; (defvar old-beginning-of-syntax nil -;; "Stores the function used to find the beginning of syntax in the -;; current major mode. ess-noweb-font-lock-mode needs a different one." ) - -(defvar ess-noweb-font-lock-doc-start-face font-lock-reference-face - "Face to use to highlight the `@' at the start of each doc chunk") - -(defvar ess-noweb-font-lock-brackets-face font-lock-reference-face - "Face to use to highlight `<<', `>>' `[[' and `]]' ") - -(defvar ess-noweb-font-lock-chunk-name-face font-lock-keyword-face - "Face to use to highlight the between `<<' and `>>'") - -(defvar ess-noweb-font-lock-code-quote-face font-lock-keyword-face - "Face to use to highlight the between `[[' and `]]'") - -;; Now we add [[ess-noweb-font-lock-mode]] to the list of existing minor -;; modes. The string ``NWFL'' will be added to the mode-line: ugly, but -;; brief. - -(if (not (assq 'ess-noweb-font-lock-mode minor-mode-alist)) - (setq minor-mode-alist (append minor-mode-alist - (list '(ess-noweb-font-lock-mode " NWFL"))))) - -;; An ugly kludge to get around problems with global-font-lock, which -;; fontifies the entire buffer in the new major mode every time you -;; change mode, which is time-consuming and makes a pigs trotters of -;; it. Trying to stop it looks tricky, but using this function as your -;; `font-lock-fontify-buffer' function stops it wasting your time - -(defalias 'nwfl-donowt #'ignore) - -;; The following function is just a wrapper for ess-noweb-font-lock-mode, -;; enabling it to be called as ess-noweb-font-lock-minor-mode instead. - -(define-obsolete-function-alias 'ess-noweb-font-lock-minor-mode - #'ess-noweb-font-lock-mode "ESS-16.11") - -;; Here we get to the meat of the problem -;;;###autoload -(defun ess-noweb-font-lock-mode ( &optional arg) - ;; FIXME: Don't define a new minor mode. Instead, arrange for normal - ;; font-lock to call our functions such as - ;; ess-noweb-font-lock-fontify-chunk-by-number. - "Minor mode for syntax highlighting when using `ess-noweb-mode' to edit noweb files. -Each chunk is fontified in accordance with its own mode." - (interactive "P") - (if (or ess-noweb-mode ess-noweb-font-lock-mode) - (progn - ;; This bit is tricky: copied almost verbatim from bib-cite-mode.el - ;; It seems to ensure that the variable ess-noweb-font-lock-mode is made - ;; local to this buffer. It then sets ess-noweb-font-lock-mode to `t' if - ;; 1) It was called with a prefix argument greater than 0 - ;; or 2) It was called with no argument, and ess-noweb-font-lock-mode is - ;; currently nil - ;; ess-noweb-font-lock-mode is nil if the prefix argument was <= 0 or there - ;; was no prefix argument and ess-noweb-font-lock-mode is currently `t' - (set (make-local-variable 'ess-noweb-font-lock-mode) - (if arg - (> (prefix-numeric-value arg) 0) - (not ess-noweb-font-lock-mode))) - ;; Now, if ess-noweb-font-lock-mode is true, we want to turn - ;; ess-noweb-font-lock-mode on - (cond - (ess-noweb-font-lock-mode ;Setup the minor-mode - (when (and (boundp 'global-font-lock-mode) global-font-lock-mode) - (mapc #'ess-noweb-make-variable-permanent-local - '(font-lock-fontify-buffer-function - font-lock-unfontify-buffer-function)) - (setq font-lock-fontify-buffer-function #'nwfl-donowt) - (setq font-lock-unfontify-buffer-function #'nwfl-donowt)) - (mapc #'ess-noweb-make-variable-permanent-local - '(ess-noweb-font-lock-mode - font-lock-dont-widen - ;; font-lock-beginning-of-syntax-function - syntax-begin-function - ess-noweb-use-font-lock-mode - after-change-functions)) - (setq ess-noweb-font-lock-mode t - font-lock-dont-widen t) - (add-hook 'after-change-functions - #'font-lock-after-change-function nil t) - ;; FIXME: Why add ess-noweb-font-lock-mode-fn to our own hook, - ;; instead of just calling ess-noweb-font-lock-mode-fn directly? - (add-hook 'ess-noweb-font-lock-mode-hook #'ess-noweb-font-lock-mode-fn) - (add-hook 'ess-noweb-changed-chunk-hook - #'ess-noweb-font-lock-fontify-this-chunk) - (run-hooks 'ess-noweb-font-lock-mode-hook) - (message "ess-noweb-font-lock mode: use `M-x ess-noweb-font-lock-describe-mode' for more info")) - ;; If we didn't do the above, then we want to turn ess-noweb-font-lock-mode - ;; off, no matter what (hence the condition `t') - (t - (when (and (boundp 'global-font-lock-mode) global-font-lock-mode) - ;; (setq font-lock-fontify-buffer-function - ;; 'font-lock-default-fontify-buffer) - ;; Get back our unfontify buffer function - (setq font-lock-unfontify-buffer-function - #'font-lock-default-unfontify-buffer)) - (remove-hook 'ess-noweb-font-lock-mode-hook #'ess-noweb-font-lock-mode-fn) - (remove-hook 'ess-noweb-changed-chunk-hook - #'ess-noweb-font-lock-fontify-this-chunk) - (remove-hook 'after-change-functions - #'font-lock-after-change-function ) - (font-lock-default-unfontify-buffer) - (setq ess-noweb-use-font-lock-mode nil) - (message "ess-noweb-font-lock-mode removed")))) - (message "ess-noweb-font-lock-mode can only be used with ess-noweb-mode"))) - -(defun ess-noweb-start-of-syntax () - "Go to the place to start fontifying from" - (interactive) - (goto-char (car (ess-noweb-chunk-region)))) - -(defvar font-latex-extend-region-functions) -(defvar syntax-begin-function) - -(defun ess-noweb-font-lock-fontify-chunk-by-number ( chunk-num ) - "Fontify chunk CHUNK-NUM based on the current major mode." - (save-excursion - (font-lock-set-defaults) - ;; (setq old-beginning-of-syntax font-lock-beginning-of-syntax-function) - (setq syntax-begin-function #'ess-noweb-start-of-syntax) - (setq font-lock-keywords - ;; (append font-lock-keywords - ;; '(("\\(\\[\\[\\)\\([^]]*\\]*\\)\\(\\]\\]\\|\\$\\)" - ;; (1 ess-noweb-font-lock-brackets-face prepend ) - ;; (2 ess-noweb-font-lock-code-quote-face prepend) - ;; (3 ess-noweb-font-lock-brackets-face prepend)) - ;; ("^[ \t\n]*\\(<<\\)\\([^>]*\\)\\(>>=?\\)" - ;; (1 ess-noweb-font-lock-brackets-face prepend ) - ;; (2 ess-noweb-font-lock-chunk-name-face prepend) - ;; (3 ess-noweb-font-lock-brackets-face prepend)) - ;; ("^@[ \t\n]+" - ;; (0 ess-noweb-font-lock-doc-start-face prepend ))))) - (append font-lock-keywords - '(("^[ \t\n]*\\(<<\\)\\([^>]*\\)\\(>>=?\\)" - ;; FIXME: Why not use ess-noweb-font-lock-brackets-face? - (1 font-lock-reference-face prepend ) - ;; FIXME: Why not use ess-noweb-font-lock-chunk-name-face? - (2 font-lock-keyword-face prepend) - (3 font-lock-reference-face prepend)) - ("^@[ \t\n]+" - (0 font-lock-reference-face prepend ))))) - - - (let ((r (cons (marker-position (cdr (aref ess-noweb-chunk-vector - chunk-num))) - (marker-position (cdr (aref ess-noweb-chunk-vector - (1+ chunk-num)))))) - (font-latex-extend-region-functions nil);; don't extend anything - (font-lock-extend-region-functions nil)) ;; this infloops :( - (save-restriction - (narrow-to-region (car r) (cdr r)) - ;; (sit-for 3) - (font-lock-fontify-region (car r) (cdr r))) - t))) - - -(defun ess-noweb-font-lock-fontify-this-chunk () - "Fontify this chunk according to its own major mode. -Since we are in the chunk, the major mode will already have been set -by ess-noweb-mode.el" - (interactive) - (ess-noweb-font-lock-fontify-chunk-by-number (ess-noweb-find-chunk-index-buffer))) - -(defun ess-noweb-font-lock-initial-fontify-buffer () - "Applies syntax highlighting to some or all chunks in a noweb buffer. -The number of chunks is set by `ess-noweb-font-lock-max-initial-chunks': if -this is nil, the entire buffer is fontified. -It is intended to be called when first entering `ess-noweb-font-lock-mode'. -For other purposes, use `ess-noweb-font-lock-fontify-chunks'." - (interactive) - ;; This will be tricky. It will be very slow to go throught the chunks - ;; in order, switching major modes all the time. - ;; So, we will do the documentation in one pass, the code in a second - ;; pass. This could still be a little slow if we have to swap between - ;; different code modes regularly, but it should be bearable. It should - ;; only happen when the file is first read in, anyway - (save-excursion - (let (start-chunk end-chunk this-chunk) - (setq this-chunk (ess-noweb-find-chunk-index-buffer)) - (if ess-noweb-font-lock-max-initial-chunks - (progn - (setq start-chunk - (max 0 - (- this-chunk - (/ ess-noweb-font-lock-max-initial-chunks 2)))) - ;; Don't you just love hairy lisp syntax ? The above means set the - ;; starting chunk to the current chunk minus half of - ;; ess-noweb-font-lock-max-initial-chunks, unless that is negative in - ;; which case set it to 0 - (setq end-chunk (+ start-chunk ess-noweb-font-lock-max-initial-chunks)) - (if (> end-chunk (- (length ess-noweb-chunk-vector) 2)) - (setq end-chunk (- (length ess-noweb-chunk-vector) 2)))) - ;; If ess-noweb-font-lock-max-initial-chunks is nil, do the whole buffer - (progn - (setq start-chunk 0) - (setq end-chunk (- (length ess-noweb-chunk-vector) 2)))) - (ess-noweb-font-lock-fontify-chunks start-chunk end-chunk)))) - -(defun ess-noweb-font-lock-fontify-buffer () - "This function will fontify each chunk in the buffer appropriately." - (interactive) - (let ((start-chunk 0) - (end-chunk (- (length ess-noweb-chunk-vector) 2))) - (ess-noweb-font-lock-fontify-chunks start-chunk end-chunk))) - -(defun ess-noweb-font-lock-fontify-chunks (start-chunk end-chunk) - "Fontify a noweb file from START-CHUNK to END-CHUNK." - (interactive) - (let ((chunk-counter start-chunk)) - (save-excursion - (message "Fontifying from %d to %d" start-chunk end-chunk) - ;; Want to set DOC mode for the first Doc chunk, not for the others - (while (stringp (car (aref ess-noweb-chunk-vector chunk-counter))) - (setq chunk-counter (+ chunk-counter 1))) - (goto-char (cdr (aref ess-noweb-chunk-vector chunk-counter))) - (ess-noweb-select-mode) - ;; Now go through the chunks, fontifying the documentation ones. - (while (<= chunk-counter end-chunk) - (if (not (stringp (car (aref ess-noweb-chunk-vector chunk-counter)))) - (ess-noweb-font-lock-fontify-chunk-by-number chunk-counter)) - (message "Fontifying documentation chunks: chunk %d" chunk-counter) - (setq chunk-counter (+ 1 chunk-counter))) - ;; Go back to the start and go through the chunks, fontifying the code ones. - (setq chunk-counter start-chunk) - (message "About to do code chunks") - (while (<= chunk-counter end-chunk) - (when (stringp (car (aref ess-noweb-chunk-vector chunk-counter))) - ;; It's a code chunk: goto it to set the correct code mode, then - ;; fontify it. - (message "Fontifying code chunks: chunk %d" chunk-counter) - (goto-char (cdr (aref ess-noweb-chunk-vector chunk-counter))) - (ess-noweb-select-mode) - (ess-noweb-font-lock-fontify-this-chunk)) - (setq chunk-counter (1+ chunk-counter)))) - (ess-noweb-select-mode))) - -(defun ess-noweb-font-lock-mode-fn() - "Function that is intended to be attached to ess-noweb-font-lock-mode-hook." - (ess-noweb-font-lock-initial-fontify-buffer)) - -;; This is a wee bit of a hack. If people attach `turn-on-font-lock' -;; to their major mode hook, it will play hell with -;; ess-noweb-font-lock-mode. I had hoped that providing a replacement -;; `nw-turn-on-font-lock' would solve the problem, but it didn't -;; (sometimes turn-on-font-lock appears in places other than -;; `.emacs', such as in ESS). So rather than have it fall over if -;; turn-on-lock was around, I redefined turn-on-font-lock to do the -;; right thing. - -(define-obsolete-function-alias 'nw-turn-on-font-lock - #'turn-on-font-lock "ESS-16.11") - -(defadvice turn-on-font-lock (around ess-noweb-font-lock activate) - ;; FIXME: An advice on turn-on-font-lock is definitely not sufficient, - ;; since font-lock can be enabled without going through turn-on-font-lock! - (if (not ess-noweb-mode) - ad-do-it - (if (and (not ess-noweb-font-lock-mode) ess-noweb-use-font-lock-mode) - (ess-noweb-font-lock-mode)))) - -(provide 'ess-noweb-font-lock-mode) -;; ***** -;; -;; Adnan Yaqub (AYaqub@orga.com) -;; ORGA Kartensysteme GmbH // An der Kapelle 2 // D-33104 Paderborn // Germany -;; Tel. +49 5254 991-823 //Fax. +49 5254 991-749 - - -;;; ess-noweb-font-lock-mode.el ends here diff --git a/elpa/ess-20181109.703/ess-noweb-mode.el b/elpa/ess-20181109.703/ess-noweb-mode.el deleted file mode 100644 index cd10276a..00000000 --- a/elpa/ess-20181109.703/ess-noweb-mode.el +++ /dev/null @@ -1,1896 +0,0 @@ -;;; ess-noweb-mode.el --- edit noweb files with GNU Emacs - -;; Copyright (C) 1995 by Thorsten.Ohl @ Physik.TH-Darmstadt.de -;; with a little help from Norman Ramsey -;; and Mark Lunt -;; and A.J. Rossini -;; Copyright (C) 1999--2010 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. -;; Copyright (C) 2011--2012 A.J. Rossini, Richard M. Heiberger, Martin Maechler, -;; Kurt Hornik, Rodney Sparapani, Stephen Eglen and Vitalie Spinu. - -;; ESS-related Changes first added by Mark Lunt and A.J. Rossini, March, 1999. - -;; Maintainer: ESS-core - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;; See bottom of this file for information on language-dependent -;; highlighting, and recent changes. -;; - -;; BASED ON: (from Mark Lunt). -;; -- Id: ess-noweb-mode.el,v 1.11 1999/03/21 20:14:41 root Exp -- - - -;;; NEWS: - -;; * [tho] M-n q, aka: M-x ess-noweb-fill-chunk -;; -;; * [tho] `M-n TAB', aka: `M-x ess-noweb-complete-chunk' -;; -;; * [tho] ess-noweb-occur -;; -;; * [nr] use `M-n' instead of `C-c n' as default command prefix -;; -;; * [nr] don't be fooled by -;; -;; @ -;; <>= -;; int foo; -;; @ %def foo -;; Here starts a new documentation chunk! -;; <>= -;; int bar; -;; -;; * [nr] switch mode changing commands off during isearch-mode -;; -;; * [tho] ess-noweb-goto-chunk proposes a default -;; -;; * commands for tangling, weaving,.. for Sweave: --> ./ess-swv.el -;; - - -;;; TODO: - -;; * _maybe_ replace our `ess-noweb-chunk-vector' by text properties. We -;; could then use highlighting to jazz up the visual appearance. -;; (Highlighting is sorted: `ess-noweb-chunk-vector' can be -;; ditched. It is simple to determine if we are in a doc or code -;; chunk.) -;; -;; * wrapped `ess-noweb-goto-next' and `ess-noweb-goto-previous' -;; -;; * more range checks and error exits -;; -;; * `ess-noweb-hide-code-quotes' should be superfluous now, and could -;; be removed. For ESS 5.3.10, we disable these, using the new variable -;; ess-noweb-code-quote-handling. If nobody misses that code-protecting -;; behavior, all that should be removed entirely. - -;;; Code: - -(require 'ess-custom) -(require 'ess-utils) - -(defvar weave-process) - - -;;; Variables - -;; (defconst ess-noweb-mode-RCS-Id -;; "Imported to ESS Subversion repository and RCS ids not maintained.") - -;; (defconst ess-noweb-mode-RCS-Name -;; " ") - -(defvar ess-noweb-mode-prefix "\M-n" - "*Prefix key to use for noweb mode commands. -The value of this variable is checked as part of loading noweb mode. -After that, changing the prefix key requires manipulating keymaps.") - -(defvar ess-noweb-mode-load-hook nil - "Hook that is run after noweb mode is loaded.") - -(defvar ess-noweb-mode-hook nil - "Hook that is run after entering noweb mode.") - -(defvar ess-noweb-select-code-mode-hook nil - "Hook that is run after the code mode is selected. -This is the place to overwrite keybindings of the ess-noweb-CODE-MODE.") - -(defvar ess-noweb-select-doc-mode-hook nil - "Hook that is run after the documentation mode is selected. -This is the place to overwrite keybindings of the ess-noweb-DOC-MODE.") - -(defvar ess-noweb-select-mode-hook nil - "Hook that is run after the documentation or the code mode is selected. -This is the place to overwrite keybindings of the other modes.") - -(defvar ess-noweb-changed-chunk-hook nil - "Hook that is run every time point moves from one chunk to another. -It will be run whether or not the major-mode changes.") - -(defvar ess-noweb-default-code-mode 'fundamental-mode - "Default major mode for editing code chunks. -This is set to FUNDAMENTAL-MODE by default, but you might want to -change this in the Local Variables section of your file to something -more appropriate, like C-MODE, FORTRAN-MODE, or even -INDENTED-TEXT-MODE.") - -(defvar ess-noweb-code-mode 'c-mode - "Major mode for editing this particular code chunk. -It defaults to ess-noweb-default-code-mode, but can be reset by a comment -on the first line of the chunk containing the string -\"-*- NEWMODE -*-\" or -\"-*- NEWMODE-mode -*-\" or -\"-*- mode: NEWMODE -*- \" or -\"-*- mode: NEWMODE-mode -*- \" -Option three is recommended, as it is the closest to standard emacs usage.") - -(defvar ess-noweb-default-doc-mode 'latex-mode - "Major mode for editing documentation chunks. -Sensible choices would be tex-mode, latex-mode, sgml-mode, or -html-mode. Maybe others will exist someday.") - -(defvar ess-noweb-doc-mode-syntax-table nil - "A syntax-table syntax table that makes quoted code in doc chunks to -behave.") - -(defvar ess-noweb-last-chunk-index 0 - "This keeps track of the chunk we have just been in. If this is not -the same as the current chunk, we have to check if we need to change -major mode.") - -(defvar ess-noweb-chunk-vector nil - "Vector of the chunks in this buffer.") - -(defvar ess-noweb-narrowing nil - "If not NIL, the display will always be narrowed to the -current chunk pair.") - -(defvar ess-noweb-electric-@-and-< t - "If not nil, the keys `@' and `<' will be bound to ess-noweb-ELECTRIC-@ -and ess-noweb-ELECTRIC-<, respectively.") - -(defvar ess-noweb-use-mouse-navigation t - "If not nil, enables moving between chunks using mouse-1. -Clicking on the '<<' at the beginning of a chunk name takes you to the -previous occurence of that chunk name, clicking on the '>>' takes you -to the next. -Assumes mouse-1 is bound to mouse-set-point, so if you have rebound -mouse-1, this will override your binding.") - -(defvar ess-noweb-code-quotes-handling nil - "If not nil, the function pair \\[ess-noweb-hide-code-quotes] and -\\[ess-noweb-restore-code-quotes] are used to \"protect\" code inside -\"[[\" .. \"]]\" pairs. Note that rarely this has been found to be buggy -with the \"catastrophic\" consequence of whole parts of your document being -replaced by sequences of '*'.") - -(defvar ess-noweb-doc-mode ess-noweb-default-doc-mode - "Default major mode for editing noweb documentation chunks. -It is not possible to have more than one doc-mode in a file. -However, this variable is used to determine whether the doc-mode needs -to by added to the mode-line") - -;; The following is apparently broken -- dangling code that was -;; commented out. Need to see if we can get it working? - -(defvar ess-noweb-weave-options "-delay") -(defvar ess-noweb-latex-viewer "xdvi") -(defvar ess-noweb-html-viewer "netscape") - -(defun ess-noweb-weave (&optional name) - (interactive) - (let ((buffer (get-buffer-create "Weave Buffer"))) - (if (not name) - (progn - ;; Assume latex documentation, but set to html if appropriate - (if (eq ess-noweb-doc-mode 'html-mode) - (setq name (concat (substring (buffer-file-name) 0 - (string-match ".nw" name)) - ".html")) - (setq name (concat (substring (buffer-file-name) 0 - (string-match ".nw" name)) - ".tex"))))) - (setq name (concat "> " name)) - (setq ess-noweb-weave-options (concat ess-noweb-weave-options name)) - (start-process weave-process buffer "noweave" ess-noweb-weave-options))) -;;(defun ess-noweb-view ()) - - -;;; Setup -(defvar ess-noweb-mode nil - "Buffer local variable, T iff this buffer is edited in noweb mode.") - -;; For some reason that I do not understand, `newline' does not do the -;; right thing in quoted code. If point is not preceded by whitespace, -;; it moves to the beginning of the current line, not the beginning of -;; the new line. `newline 1' works fine, hence the kludge. I'd love to -;; understand what's going on, though. Try running M-x newline in the -;; middle of a code quote in a doc chunk to see -;; what I mean: its odd. - -(defun ess-noweb-newline (&optional arg) - "A kludge to get round very odd behaviour of newline in quoted code." - (interactive "p") - (if arg (newline arg) (newline 1)) - (ess-noweb-indent-line)) - -(defvar ess-noweb-mode-prefix-map - (let ((map (make-sparse-keymap))) - (define-key map "\C-\M-x" 'ess-eval-chunk) - (define-key map "\C-c" 'ess-eval-chunk-and-step) - (define-key map "\C-n" 'ess-noweb-next-chunk) - (define-key map "\C-p" 'ess-noweb-previous-chunk) - (define-key map "\M-n" 'ess-noweb-goto-next) - (define-key map "\M-m" 'ess-noweb-insert-default-mode-line) - (define-key map "\M-p" 'ess-noweb-goto-previous) - (define-key map "c" 'ess-noweb-next-code-chunk) - (define-key map "C" 'ess-noweb-previous-code-chunk) - (define-key map "d" 'ess-noweb-next-doc-chunk) - (define-key map "D" 'ess-noweb-previous-doc-chunk) - (define-key map "g" 'ess-noweb-goto-chunk) - (define-key map "\C-l" 'ess-noweb-update-chunk-vector) - (define-key map "\M-l" 'ess-noweb-update-chunk-vector) - (define-key map "w" 'ess-noweb-copy-chunk-as-kill) - (define-key map "W" 'ess-noweb-copy-chunk-pair-as-kill) - (define-key map "k" 'ess-noweb-kill-chunk) - (define-key map "K" 'ess-noweb-kill-chunk-pair) - (define-key map "m" 'ess-noweb-mark-chunk) - (define-key map "M" 'ess-noweb-mark-chunk-pair) - (define-key map "n" 'ess-noweb-narrow-to-chunk) - (define-key map "N" 'ess-noweb-narrow-to-chunk-pair) - (define-key map "t" 'ess-noweb-toggle-narrowing) - (define-key map "\t" 'ess-noweb-complete-chunk) - (define-key map "q" 'ess-noweb-fill-chunk) - (define-key map "i" 'ess-noweb-new-chunk) - (define-key map "o" 'ess-noweb-occur) - ;;(define-key map "v" 'ess-noweb-mode-version) - (define-key map "h" 'ess-noweb-describe-mode) - ;; do *NOT* override C-h (give all keybindings startings with M-n! - map) - "noweb minor-mode prefix keymap") - -(defvar ess-noweb-minor-mode-map - (let ((map (make-sparse-keymap))) - (if ess-noweb-electric-@-and-< - (progn - (define-key map "@" 'ess-noweb-electric-@) - (define-key map "<" 'ess-noweb-electric-<))) - (define-key map "\M-q" 'ess-noweb-fill-paragraph-chunk) - (define-key map [(control meta ?\\)] 'ess-noweb-indent-region) - ;;(define-key map "\C-c\C-n" 'ess-noweb-indent-line) ; Override TeX-normal! - (define-key map "\t" 'ess-noweb-indent-line) - ;; (define-key map [tab] 'ess-noweb-indent-line) ;; interferes with ac - (define-key map "\r" 'ess-noweb-newline) - ;; (define-key map [return] 'ess-noweb-newline) ;; interferes with ac - (define-key map [mouse-1] 'ess-noweb-mouse-first-button) - (define-key map ess-noweb-mode-prefix ess-noweb-mode-prefix-map) - map) - "ESS Noweb minor mode keymap") - -(easy-menu-define - ess-noweb-minor-mode-menu ess-noweb-minor-mode-map - "Menu keymap for noweb." - '("Noweb" - ("Movement" - ["Previous chunk" ess-noweb-previous-chunk t] - ["Next chunk" ess-noweb-next-chunk t] - ["Previous chunk of same name" ess-noweb-goto-previous t] - ["Next chunk of same name" ess-noweb-goto-next t] - ["Goto chunk" ess-noweb-goto-chunk t] - ["Previous code chunk" ess-noweb-previous-code-chunk t] - ["Next code chunk" ess-noweb-next-code-chunk t] - ["Previous documentation chunk" ess-noweb-previous-doc-chunk t] - ["Next documentation chunk" ess-noweb-next-doc-chunk t]) - ("Editing" - ["Copy chunk" ess-noweb-copy-chunk-as-kill t] - ["Copy chunk pair" ess-noweb-copy-chunk-pair-as-kill t] - ["Kill chunk" ess-noweb-kill-chunk t] - ["Kill chunk pair" ess-noweb-kill-chunk-pair t] - ["Mark chunk" ess-noweb-mark-chunk t] - ["Mark chunk pair" ess-noweb-mark-chunk-pair t]) - ("Narrowing" - ["Narrow to chunk" ess-noweb-narrow-to-chunk t] - ["Narrow to chunk pair" ess-noweb-narrow-to-chunk-pair t] - ["Toggle auto narrowing" ess-noweb-toggle-narrowing t] - ["Widen" widen t]) - ("Modes" - ["Set documentation mode" ess-noweb-set-doc-mode t] - ["Set default code mode" ess-noweb-set-code-mode t] - ["Set code mode for this chunk" ess-noweb-set-this-code-mode t] - ["Insert default mode line" ess-noweb-insert-default-mode-line t]) - ("Tangling" - ["Tangle current chunk" ess-noweb-tangle-chunk t] - ["Tangle current thread" ess-noweb-tangle-current-thread t] - ["Tangle named thread" ess-noweb-tangle-thread t]) - ("Miscellaneous" - ["Complete chunk name" ess-noweb-complete-chunk t] - ["Fill current chunk" ess-noweb-fill-chunk t] - ["Insert new chunk" ess-noweb-new-chunk t] - ["Update the chunk vector" ess-noweb-update-chunk-vector t] - ["Chunk occurrences" ess-noweb-occur t]) - "--" - ["Help" ess-noweb-describe-mode t] - ;;["Version" ess-noweb-mode-version t] - )) - -;; Add ess-noweb-mode to the list of minor modes -(if (not (assq 'ess-noweb-mode minor-mode-alist)) - (setq minor-mode-alist (append minor-mode-alist - (list '(ess-noweb-mode " Noweb"))))) -;; Add ess-noweb-minor-mode-map to the list of minor-mode keymaps -;; available. Then, whenever ess-noweb-mode is activated, the keymap is -;; automatically activated -(if (not (assq 'ess-noweb-mode minor-mode-map-alist)) - (setq minor-mode-map-alist - (cons (cons 'ess-noweb-mode ess-noweb-minor-mode-map) - minor-mode-map-alist))) - -(defun ess-noweb-minor-mode (&optional arg) - "Minor meta mode for editing noweb files. See ess-noweb-mode." - (interactive) - (ess-noweb-mode arg)) ; this was ess-noweb-minor-mode??? (truly recursive) - -(declare-function ess-noweb-font-lock-mode "ess-noweb-font-lock-mode") - -;;;###autoload -(defun ess-noweb-mode ( &optional arg ) - "Minor meta mode for editing noweb files. -`Meta' refers to the fact that this minor mode is switching major -modes depending on the location of point. - -The following special keystrokes are available in noweb mode: - -Movement: -\\[ess-noweb-next-chunk] \tgoto the next chunk -\\[ess-noweb-previous-chunk] \tgoto the previous chunk -\\[ess-noweb-goto-previous] \tgoto the previous chunk of the same name -\\[ess-noweb-goto-next] \tgoto the next chunk of the same name -\\[ess-noweb-goto-chunk] \t\tgoto a chunk -\\[ess-noweb-next-code-chunk] \t\tgoto the next code chunk -\\[ess-noweb-previous-code-chunk] \t\tgoto the previous code chunk -\\[ess-noweb-next-doc-chunk] \t\tgoto the next documentation chunk -\\[ess-noweb-previous-doc-chunk] \t\tgoto the previous documentation chunk - -Copying/Killing/Marking/Narrowing: -\\[ess-noweb-copy-chunk-as-kill] \t\tcopy the chunk the point is in into the kill ring -\\[ess-noweb-copy-chunk-pair-as-kill] \t\tcopy the pair of doc/code chunks the point is in -\\[ess-noweb-kill-chunk] \t\tkill the chunk the point is in -\\[ess-noweb-kill-chunk-pair] \t\tkill the pair of doc/code chunks the point is in -\\[ess-noweb-mark-chunk] \t\tmark the chunk the point is in -\\[ess-noweb-mark-chunk-pair] \t\tmark the pair of doc/code chunks the point is in -\\[ess-noweb-narrow-to-chunk] \t\tnarrow to the chunk the point is in -\\[ess-noweb-narrow-to-chunk-pair] \t\tnarrow to the pair of doc/code chunks the point is in -\\[widen] \twiden -\\[ess-noweb-toggle-narrowing] \t\ttoggle auto narrowing - -Filling and Indenting: -\\[ess-noweb-fill-chunk] \tfill (or indent) the chunk at point according to mode -\\[ess-noweb-fill-paragraph-chunk] \tfill the paragraph at point, restricted to chunk -\\[ess-noweb-indent-line] \tindent the line at point according to mode - -Insertion: -\\[ess-noweb-insert-default-mode-line] \tinsert a line to set this file's code mode -\\[ess-noweb-new-chunk] \t\tinsert a new chunk at point -\\[ess-noweb-complete-chunk] \tcomplete the chunk name before point -\\[ess-noweb-electric-@] \t\tinsert a `@' or start a new doc chunk -\\[ess-noweb-electric-<] \t\tinsert a `<' or start a new code chunk - -Modes: -\\[ess-noweb-set-doc-mode] \t\tset the major mode for editing doc chunks -\\[ess-noweb-set-code-mode] \tset the major mode for editing code chunks -\\[ess-noweb-set-this-code-mode] \tset the major mode for editing this code chunk - -Misc: -\\[ess-noweb-occur] \t\tfind all occurrences of the current chunk -\\[ess-noweb-update-chunk-vector] \tupdate the markers for chunks -\\[ess-noweb-describe-mode] \tdescribe ess-noweb-mode -" (interactive "P") - ;; This bit is tricky: copied almost verbatim from bib-cite-mode.el - ;; It seems to ensure that the variable ess-noweb-mode is made - ;; local to this buffer. It then sets ess-noweb-mode to `t' if - ;; 1) It was called with an argument greater than 0 - ;; or 2) It was called with no argument, and ess-noweb-mode is - ;; currently nil - ;; ess-noweb-mode is nil if the argument was <= 0 or there - ;; was no argument and ess-noweb-mode is currently `t' - (kill-all-local-variables) - (set (make-local-variable 'ess-noweb-mode) - (if arg - (> (prefix-numeric-value arg) 0) - (not ess-noweb-mode))) - ;; Now, if ess-noweb-mode is true, we want to turn - ;; ess-noweb-mode on - (cond - (ess-noweb-mode ;Setup the minor-mode - (mapc 'ess-noweb-make-variable-permanent-local - '(ess-noweb-mode - ess-local-process-name ;; also made permanent in ess-mode, but let it be - ess-dialect - ess-language - ess-use-flymake - after-change-functions - before-change-functions - ess-noweb-narrowing - ess-noweb-chunk-vector - post-command-hook - isearch-mode-hook - isearch-mode-end-hook - ess-noweb-doc-mode - ess-noweb-code-mode - ess-noweb-default-code-mode - ess-noweb-last-chunk-index)) - (setq-local ess-use-flymake nil) - (ess-noweb-update-chunk-vector) - (setq ess-noweb-last-chunk-index - (if (equal 0 (ess-noweb-find-chunk-index-buffer)) 1 0)) - (if font-lock-mode - (progn - (font-lock-mode -1) - (ess-noweb-font-lock-mode 1))) - (add-hook 'post-command-hook 'ess-noweb-post-command-function) - - (add-hook 'after-change-functions 'ess-noweb-after-change-function nil t) - (add-hook 'before-change-functions 'ess-noweb-before-change-function nil t) - - (add-hook 'ess-noweb-select-doc-mode-hook 'ess-noweb-auto-fill-doc-mode) - (add-hook 'ess-noweb-select-code-mode-hook 'ess-noweb-auto-fill-code-mode) - (add-hook 'isearch-mode-hook 'ess-noweb-note-isearch-mode) - (add-hook 'isearch-mode-end-hook 'ess-noweb-note-isearch-mode-end) - (setq ess-noweb-doc-mode-syntax-table nil) - (run-hooks 'ess-noweb-mode-hook) - (message - "noweb mode: use `M-x ess-noweb-describe-mode' for further information")) - ;; If we didn't do the above, then we want to turn ess-noweb-mode - ;; off, no matter what (hence the condition `t') - (t - (remove-hook 'post-command-hook 'ess-noweb-post-command-function) - - (remove-hook 'after-change-functions 'ess-noweb-after-change-function t) - (remove-hook 'before-change-functions 'ess-noweb-before-change-function t) - - (remove-hook 'ess-noweb-select-doc-mode-hook 'ess-noweb-auto-fill-doc-mode) - (remove-hook 'ess-noweb-select-code-mode-hook 'ess-noweb-auto-fill-code-mode) - (remove-hook 'isearch-mode-hook 'ess-noweb-note-isearch-mode) - (remove-hook 'isearch-mode-end-hook 'ess-noweb-note-isearch-mode-end) - (if (and (boundp 'ess-noweb-font-lock-mode) - ess-noweb-font-lock-mode) - (progn - (ess-noweb-font-lock-mode -1) - (message "ESS-Noweb and ESS-Noweb-Font-Lock Modes Removed")) - (message "ESS-Noweb mode removed"))))) - -(defun ess-noweb-make-variable-permanent-local (var) - "Declare VAR buffer local, but protect it from beeing killed -by major mode changes." - (make-variable-buffer-local var) - (put var 'permanent-local 't)) - -(defun ess-noweb-note-isearch-mode () - "Take note of an incremental search in progress" - (remove-hook 'post-command-hook 'ess-noweb-post-command-function)) - -(defun ess-noweb-note-isearch-mode-end () - "Take note of an incremental search having ended" - (add-hook 'post-command-hook 'ess-noweb-post-command-function)) - -(defun ess-noweb-post-command-function () - "The hook being run after each command in noweb mode." - (ess-noweb-select-mode)) - -(defvar ess-noweb-chunk-boundary-changed nil - "Whether the current change affects a chunk boundary.") - -(defvar ess-noweb-chunk-boundary-regexp "^\\(@[^@]\\)\\|\\(<<\\)") - -(defun ess-noweb-before-change-function (begin end) - "Record changes to chunk boundaries." - (save-excursion - (goto-char begin) - (setq ess-noweb-chunk-boundary-changed - (re-search-forward ess-noweb-chunk-boundary-regexp end t)))) - -(defun ess-noweb-after-change-function (begin end length) - "Function to run after every change in a noweb buffer. -If the changed region contains a chunk boundary, it will update -the chunk vector" - (save-excursion - (goto-char begin) - (when (or ess-noweb-chunk-boundary-changed - (re-search-forward ess-noweb-chunk-boundary-regexp end t)) - (ess-noweb-update-chunk-vector) - (setq ess-noweb-chunk-boundary-changed nil)))) - - -;;; Chunks - -(defun ess-noweb-update-chunk-vector () - "Scan the whole buffer and place a marker at each \"^@\" and \"^<<\". -Record them in ess-noweb-CHUNK-VECTOR." - (interactive) - (save-excursion - (goto-char (point-min)) - (let ((chunk-list (list (cons 'doc (point-marker))))) - (while (re-search-forward "^\\(@\\( \\|$\\|\\( %def\\)\\)\\|<<\\(.*\\)>>=\\)" nil t) - (goto-char (match-beginning 0)) - ;; If the 3rd subexpression matched @ %def, we're still in a code - ;; chunk (sort of), so don't place a marker here. - (if (not (match-beginning 3)) - (setq chunk-list - ;; If the 4th subexpression matched inside <<...>>, - ;; we're seeing a new code chunk. - (cons (cons (if (match-beginning 4) - ;;buffer-substring-no-properties better - ;;than buffer-substring if highlighting - ;;may be used - (buffer-substring-no-properties - (match-beginning 4) (match-end 4)) - 'doc) - (point-marker)) - chunk-list)) - ;; Scan forward either to !/^@ %def/, which will start a docs chunk, - ;; or to /^<<.*>>=$/, which will start a code chunk. - (progn - (forward-line 1) - (while (looking-at "@ %def") - (forward-line 1)) - (setq chunk-list - ;; Now we can tell code vs docs - (cons (cons (if (looking-at "<<\\(.*\\)>>=") - (buffer-substring-no-properties - (match-beginning 1) (match-end 1)) - 'doc) - (point-marker)) - chunk-list)))) - (forward-line 1)) - (setq chunk-list (cons (cons 'doc (point-max-marker)) chunk-list)) - (setq ess-noweb-chunk-vector (vconcat (reverse chunk-list)))))) - -(defun ess-noweb-find-chunk () - "Return a pair consisting of the name (or 'DOC) and the -marker of the current chunk." - (if (not ess-noweb-chunk-vector) - (ess-noweb-update-chunk-vector)) - (aref ess-noweb-chunk-vector (ess-noweb-find-chunk-index-buffer))) - -(defun ess-noweb-chunk-is-code (index) - "Return t if the chunk 'index' is a code chunk, nil otherwise" - (interactive) - (stringp (car (ess-noweb-chunk-vector-aref index)))) - -(defun ess-noweb-in-code-chunk () - "Return t if we are in a code chunk, nil otherwise." - (interactive) - (ess-noweb-chunk-is-code (ess-noweb-find-chunk-index-buffer))) - -(defun ess-noweb-in-mode-line () - "Return the name of the mode to use if we are in a mode line, nil -otherwise." - (interactive) - (let (beg end mode) - (save-excursion - (beginning-of-line 1) - (and (progn - (ess-write-to-dribble-buffer - (format "(n-i-m-l: 1)")) - (search-forward "-*-" - (save-excursion (end-of-line) (point)) - t)) - (progn - (ess-write-to-dribble-buffer - (format "(n-i-m-l: 2)")) - (skip-chars-forward " \t") - (setq beg (point)) - (search-forward "-*-" - (save-excursion (end-of-line) (point)) - t)) - (progn - (ess-write-to-dribble-buffer - (format "(n-i-m-l: 3)")) - (forward-char -3) - (skip-chars-backward " \t") - (setq end (point)) - (goto-char beg) - (setq mode (concat - (downcase (buffer-substring beg end)) - "-mode")) - (if (and (>= (length mode) 11)) - (progn - (if - (equal (substring mode -10 -5) "-mode") - (setq mode (substring mode 0 -5))) - (if - (equal (substring mode 0 5) "mode:") - (setq mode (substring mode 6)))))) - (progn - (ess-write-to-dribble-buffer - (format "(n-i-m-l: 3) mode=%s" mode)) - (intern mode)))))) - -(defun ess-noweb-find-chunk-index-buffer () - "Return the index of the current chunk in ess-noweb-CHUNK-VECTOR." - (ess-noweb-find-chunk-index 0 (1- (length ess-noweb-chunk-vector)))) - -(defun ess-noweb-find-chunk-index (low hi) - (if (= hi (1+ low)) - low - (let ((med (/ (+ low hi) 2))) - (if (< (point) (cdr (aref ess-noweb-chunk-vector med))) - (ess-noweb-find-chunk-index low med) - (ess-noweb-find-chunk-index med hi))))) - -(defun ess-noweb-chunk-region () - "Return a pair consisting of the beginning and end of the current chunk." - (interactive) - (let ((start (ess-noweb-find-chunk-index-buffer))) - (cons (marker-position (cdr (aref ess-noweb-chunk-vector start))) - (marker-position (cdr (aref ess-noweb-chunk-vector (1+ start))))))) - -(defun ess-noweb-copy-code-chunk () - "Copy the current code chunk to the kill ring, excluding the chunk name. -This will be particularly useful when interfacing with ESS." - (interactive) - (let ((r (ess-noweb-chunk-region))) - (save-excursion - (goto-char (car r)) - (if (ess-noweb-in-code-chunk) - (progn - (beginning-of-line 2) - (copy-region-as-kill (point) (cdr r))))))) - -(defun ess-noweb-extract-code-chunk () - "Create a new buffer with the same name as the current code chunk, -and copy all code from chunks of the same name to it." - (interactive) - (save-excursion - (if (ess-noweb-in-code-chunk) - (progn - (let ((chunk-name (car (ess-noweb-find-chunk))) - (chunk-counter 0) - (copy-counter 0) - (this-chunk) (oldbuf (current-buffer))) - (if (get-buffer chunk-name) - (progn - (set-buffer-modified-p nil) - (kill-buffer chunk-name))) - (get-buffer-create chunk-name) - (message "Created buffer %s" chunk-name) - (while (< chunk-counter (- (length ess-noweb-chunk-vector) 2)) - (setq this-chunk (ess-noweb-chunk-vector-aref - chunk-counter)) - (message "Current buffer is %s" (car this-chunk)) - (if (equal chunk-name (car this-chunk)) - (progn - (setq copy-counter (+ copy-counter 1)) - (goto-char (cdr this-chunk)) - (ess-noweb-copy-code-chunk) - (set-buffer chunk-name) - (goto-char (point-max)) - (yank) - (set-buffer oldbuf))) - (setq chunk-counter (+ chunk-counter 1))) - (message "Copied %d bits" copy-counter) - (set-buffer chunk-name) - (copy-region-as-kill (point-min)(point-max))))))) - -(defun ess-noweb-chunk-pair-region () - "Return a pair consisting of the beginning and end of the current pair of -documentation and code chunks." - (interactive) - (let* ((start (ess-noweb-find-chunk-index-buffer)) - (end (1+ start))) - (if (ess-noweb-chunk-is-code start) - (cons (marker-position (cdr (aref ess-noweb-chunk-vector (1- start)))) - (marker-position (cdr (aref ess-noweb-chunk-vector end)))) - (while (not (ess-noweb-chunk-is-code end)) - (setq end (1+ end))) - (cons (marker-position (cdr (aref ess-noweb-chunk-vector start))) - (marker-position (cdr (aref ess-noweb-chunk-vector (1+ end)))))))) - -(defun ess-noweb-chunk-vector-aref (i) - (if (< i 0) - (error "Before first chunk.")) - (if (not ess-noweb-chunk-vector) - (ess-noweb-update-chunk-vector)) - (if (>= i (length ess-noweb-chunk-vector)) - (error "Beyond last chunk.")) - (aref ess-noweb-chunk-vector i)) - -(defun ess-noweb-complete-chunk () - "Complete the chunk name before point, if any." - (interactive) - (if (ess-noweb-in-code-chunk) - (let ((end (point)) - (beg (save-excursion - (if (re-search-backward "<<" - (save-excursion - (beginning-of-line) - (point)) - t) - (match-end 0) - nil)))) - (if beg - (let* ((pattern (buffer-substring beg end)) - (alist (ess-noweb-build-chunk-alist)) - (completion (try-completion pattern alist))) - (cond ((eq completion t)) - ((null completion) - (message "Can't find completion for \"%s\"" pattern) - (ding)) - ((not (string= pattern completion)) - (delete-region beg end) - (insert completion) - (if (not (looking-at ">>")) - (insert ">>"))) - (t - (message "Making completion list...") - (with-output-to-temp-buffer "*Completions*" - (display-completion-list (all-completions pattern alist))) - (message "Making completion list...%s" "done")))) - (message "Not at chunk name..."))) - (message "Not in code chunk..."))) - - -;;; Filling, etc - -(defun ess-noweb-hide-code-quotes () - "Replace all non blank characters in [[...]] code quotes -in the current buffer (you might want to narrow to the interesting -region first) by `*'. Return a list of pairs with the position and -value of the original strings." - (save-excursion - (let ((quote-list nil)) - (goto-char (point-min)) - (while (re-search-forward "\\[\\[" nil 'move) - (let ((beg (match-end 0)) - (end (if (re-search-forward "\\]\\]" nil t) - (match-beginning 0) - (point-max)))) - (goto-char beg) - (while (< (point) end) - ;; Move on to the next word: - (let ((b (progn - (skip-chars-forward " \t\n" end) - (point))) - (e (progn - (skip-chars-forward "^ \t\n" end) - (point)))) - (if (> e b) - ;; Save the string and a marker to the end of the - ;; replacement text. A marker to the beginning is - ;; useless. See ess-noweb-RESTORE-CODE-QUOTES. - (save-excursion - (setq quote-list (cons (cons (copy-marker e) - (buffer-substring b e)) - quote-list)) - (goto-char b) - (insert-char ?* (- e b) t) - (delete-char (- e b)))))))) - (reverse quote-list)))) - -(defun ess-noweb-restore-code-quotes (quote-list) - "Reinsert the strings modified by `ess-noweb-hide-code-quotes'." - (save-excursion - (mapcar (lambda (q) - (let* ((e (marker-position (car q))) - ;; Slightly inefficient, but correct way to find - ;; the beginning of the word to be replaced. - ;; Using the marker at the beginning will loose - ;; if whitespace has been rearranged - (b (save-excursion - (goto-char e) - (skip-chars-backward "*") - (point)))) - (delete-region b e) - (goto-char b) - (insert (cdr q)))) - quote-list))) - -(defun ess-noweb-fill-chunk () - "Fill the current chunk according to mode. -Run `fill-region' on documentation chunks and `indent-region' on code -chunks." - (interactive) - (save-excursion - (save-restriction - (ess-noweb-narrow-to-chunk) - (if (ess-noweb-in-code-chunk) - (progn - ;; Narrow to the code section proper; w/o the first and any - ;; index declaration lines. - (narrow-to-region (progn - (goto-char (point-min)) - (forward-line 1) - (point)) - (progn - (goto-char (point-max)) - (forward-line -1) - (while (looking-at "@") - (forward-line -1)) - (forward-line 1) - (point))) - (if (or indent-region-function indent-line-function) - (indent-region (point-min) (point-max) nil) - (error "No indentation functions defined in %s!" major-mode))) - (if ess-noweb-code-quotes-handling - (let ((quote-list (ess-noweb-hide-code-quotes))) - (fill-region (point-min) (point-max)) - (ess-noweb-restore-code-quotes quote-list)) - (fill-region (point-min) (point-max))))))) - -(defun ess-noweb-indent-region (beg end) - "If region fits inside current chunk, narrow to chunk and then -indent according to mode." - (interactive "r") - (let* ((inx (ess-noweb-find-chunk-index-buffer)) - (ch-beg (marker-position (cdr (aref ess-noweb-chunk-vector inx)))) - (ch-end (marker-position (cdr (aref ess-noweb-chunk-vector (1+ inx)))))) - - (if (and (< ch-beg beg) (> ch-end end)) - (save-excursion - (save-restriction - (setq beg (max beg (progn (goto-char ch-beg) - (forward-line 1) - (point)))) - (setq end (min end (progn (goto-char ch-end) - (forward-line -1) - (point)))) - (narrow-to-region beg end) - (indent-region beg end))) - (indent-region beg end)))) - - -(defun ess-noweb-indent-line () - "Indent the current line according to mode, after narrowing to this chunk." - (interactive) - (ess-noweb-update-chunk-vector) - (save-restriction - (ess-noweb-narrow-to-chunk) - (if (ess-noweb-in-code-chunk) - (progn - ;; Narrow to the code section proper; w/o the first and any - ;; index declaration lines. - (save-excursion - (narrow-to-region (progn - (goto-char (point-min)) - (forward-line 1) - (point)) - (progn - (goto-char (point-max)) - (forward-line -1) - (while (looking-at "@") - (forward-line -1)) - (forward-line 1) - (point)))))) - (indent-according-to-mode))) - -(defun ess-noweb-fill-paragraph-chunk (&optional justify) - "Fill a paragraph in the current chunk." - (interactive "P") - (ess-noweb-update-chunk-vector) - (save-excursion - (save-restriction - (ess-noweb-narrow-to-chunk) - (if (ess-noweb-in-code-chunk) - (progn - ;; Narrow to the code section proper; w/o the first and any - ;; index declaration lines. - (narrow-to-region (progn - (goto-char (point-min)) - (forward-line 1) - (point)) - (progn - (goto-char (point-max)) - (forward-line -1) - (while (looking-at "@") - (forward-line -1)) - (forward-line 1) - (point))) - (fill-paragraph justify)) - (if ess-noweb-code-quotes-handling - (let ((quote-list (ess-noweb-hide-code-quotes))) - (fill-paragraph justify) - (ess-noweb-restore-code-quotes quote-list)) - (fill-paragraph justify)))))) - -(defun ess-noweb-auto-fill-doc-chunk () - "Replacement for `do-auto-fill'." - (save-restriction - (narrow-to-region (car (ess-noweb-chunk-region)) - (save-excursion - (end-of-line) - (point))) - (if ess-noweb-code-quotes-handling - (let ((quote-list (ess-noweb-hide-code-quotes))) - (do-auto-fill) - (ess-noweb-restore-code-quotes quote-list)) - (do-auto-fill)))) - -(defun ess-noweb-auto-fill-doc-mode () - "Install the improved auto fill function, iff necessary." - (if auto-fill-function - (setq auto-fill-function 'ess-noweb-auto-fill-doc-chunk))) - -(defun ess-noweb-auto-fill-code-chunk () - "Replacement for do-auto-fill. Cancel filling in chunk headers" - (unless (save-excursion - (beginning-of-line) - (looking-at "<<")) - (do-auto-fill))) - -(defun ess-noweb-auto-fill-code-mode () - "Install the default auto fill function, iff necessary." - (if auto-fill-function - (setq auto-fill-function 'ess-noweb-auto-fill-code-chunk))) - -;;; Marking - -(defun ess-noweb-mark-chunk () - "Mark the current chunk." - (interactive) - (let ((r (ess-noweb-chunk-region))) - (goto-char (car r)) - (push-mark (cdr r) nil t))) - -(defun ess-noweb-mark-chunk-pair () - "Mark the current pair of documentation and code chunks." - (interactive) - (let ((r (ess-noweb-chunk-pair-region))) - (goto-char (car r)) - (push-mark (cdr r) nil t))) - - -;;; Narrowing - -(defun ess-noweb-toggle-narrowing (&optional arg) - "Toggle if we should narrow the display to the current pair of -documentation and code chunks after each movement. With argument: -switch narrowing on." - (interactive "P") - (if (or arg (not ess-noweb-narrowing)) - (progn - (setq ess-noweb-narrowing t) - (ess-noweb-narrow-to-chunk-pair)) - (setq ess-noweb-narrowing nil) - (widen))) - -(defun ess-noweb-narrow-to-chunk () - "Narrow the display to the current chunk." - (interactive) - (let ((r (ess-noweb-chunk-region))) - (narrow-to-region (car r) (cdr r)))) - -(defun ess-noweb-narrow-to-chunk-pair () - "Narrow the display to the current pair of documentation and code chunks." - (interactive) - (let ((r (ess-noweb-chunk-pair-region))) - (narrow-to-region (car r) (cdr r)))) - - -;;; Killing - -(defun ess-noweb-kill-chunk () - "Kill the current chunk." - (interactive) - (let ((r (ess-noweb-chunk-region))) - (kill-region (car r) (cdr r)))) - -(defun ess-noweb-kill-chunk-pair () - "Kill the current pair of chunks." - (interactive) - (let ((r (ess-noweb-chunk-pair-region))) - (kill-region (car r) (cdr r)))) - -(defun ess-noweb-copy-chunk-as-kill () - "Place the current chunk on the kill ring." - (interactive) - (let ((r (ess-noweb-chunk-region))) - (copy-region-as-kill (car r) (cdr r)))) - -(defun ess-noweb-copy-chunk-pair-as-kill () - "Place the current pair of chunks on the kill ring." - (interactive) - (let ((r (ess-noweb-chunk-pair-region))) - (copy-region-as-kill (car r) (cdr r)))) - - -;;; Movement - -(defun ess-noweb-sign (n) - "Return the sign of N." - (if (< n 0) -1 1)) - -(defun ess-noweb-next-doc-chunk (&optional cnt) - "Goto to the Nth documentation chunk from point." - (interactive "p") - (widen) - (let ((start (ess-noweb-find-chunk-index-buffer)) - (i 1)) - (while (<= i (abs cnt)) - (setq start (+ (ess-noweb-sign cnt) start)) - (while (ess-noweb-chunk-is-code start) - (setq start (+ (ess-noweb-sign cnt) start))) - (setq i (1+ i))) - (goto-char (marker-position (cdr (ess-noweb-chunk-vector-aref start)))) - (forward-char 1)) - (if ess-noweb-narrowing - (ess-noweb-narrow-to-chunk-pair))) - -(defun ess-noweb-previous-doc-chunk (&optional n) - "Goto to the -Nth documentation chunk from point." - (interactive "p") - (ess-noweb-next-doc-chunk (- n))) - -(defun ess-noweb-next-code-chunk (&optional cnt) - "Goto to the Nth code chunk from point." - (interactive "p") - (widen) - (let ((start (ess-noweb-find-chunk-index-buffer)) - (i 1)) - (while (<= i (abs cnt)) - (setq start (+ (ess-noweb-sign cnt) start)) - (while (not (ess-noweb-chunk-is-code start)) - (setq start (+ (ess-noweb-sign cnt) start))) - (setq i (1+ i))) - (goto-char (marker-position (cdr (ess-noweb-chunk-vector-aref start)))) - (forward-line 1)) - (if ess-noweb-narrowing - (ess-noweb-narrow-to-chunk-pair))) - -(defun ess-noweb-previous-code-chunk (&optional n) - "Goto to the -Nth code chunk from point." - (interactive "p") - (ess-noweb-next-code-chunk (- n))) - -(defun ess-noweb-next-chunk (&optional n) - "If in a documentation chunk, goto to the Nth documentation -chunk from point, else goto to the Nth code chunk from point." - (interactive "p") - (if (ess-noweb-in-code-chunk) - (ess-noweb-next-code-chunk n) - (ess-noweb-next-doc-chunk n))) - -(defun ess-noweb-previous-chunk (&optional n) - "If in a documentation chunk, goto to the -Nth documentation -chunk from point, else goto to the -Nth code chunk from point." - (interactive "p") - (ess-noweb-next-chunk (- n))) - -(defvar ess-noweb-chunk-history nil - "") - -(defun ess-noweb-goto-chunk () - "Goto the named chunk." - (interactive) - (widen) - (let* ((completion-ignore-case t) - (alist (ess-noweb-build-chunk-alist)) - (chunk (ess-completing-read - "Chunk" (delete "" (mapcar 'car alist)) nil t nil - ess-noweb-chunk-history (ess-noweb-goto-chunk-default)))) - (goto-char (cdr (assoc chunk alist)))) - (if ess-noweb-narrowing - (ess-noweb-narrow-to-chunk-pair))) - -(defun ess-noweb-goto-chunk-default () - (save-excursion - (if (re-search-backward "<<" - (save-excursion - (beginning-of-line) - (point)) - 'move) - (goto-char (match-beginning 0))) - (if (re-search-forward "<<\\(.*\\)>>" - (save-excursion - (end-of-line) - (point)) - t) - (buffer-substring (match-beginning 1) (match-end 1)) - nil))) - -(defun ess-noweb-build-chunk-alist () - (if (not ess-noweb-chunk-vector) - (ess-noweb-update-chunk-vector)) - ;; The naive recursive solution will exceed MAX-LISP-EVAL-DEPTH in - ;; buffers w/ many chunks. Maybe there is a tail recursivce solution, - ;; but iterative solutions should be acceptable for dealing with vectors. - (let ((alist nil) - (i (1- (length ess-noweb-chunk-vector)))) - (while (>= i 0) - (let* ((chunk (aref ess-noweb-chunk-vector i)) - (name (car chunk)) - (marker (cdr chunk))) - (if (and (stringp name) - (not (assoc name alist))) - (setq alist (cons (cons name marker) alist)))) - (setq i (1- i))) - alist)) - -(defun ess-noweb-goto-next (&optional cnt) - "Goto the continuation of the current chunk." - (interactive "p") - (widen) - (if (not ess-noweb-chunk-vector) - (ess-noweb-update-chunk-vector)) - (let ((start (ess-noweb-find-chunk-index-buffer))) - (if (not (ess-noweb-chunk-is-code start)) - (setq start (1+ start))) - (if (ess-noweb-chunk-is-code start) - (let ((name (car (ess-noweb-chunk-vector-aref start))) - (i 1)) - (while (<= i (abs cnt)) - (setq start (+ (ess-noweb-sign cnt) start)) - (while (not (equal (car (ess-noweb-chunk-vector-aref start)) - name)) - (setq start (+ (ess-noweb-sign cnt) start))) - (setq i (1+ i))) - (goto-char (marker-position - (cdr (ess-noweb-chunk-vector-aref start)))) - (forward-line 1)))) - (if ess-noweb-narrowing - (ess-noweb-narrow-to-chunk-pair))) - -(defun ess-noweb-goto-previous (&optional cnt) - "Goto the previous chunk." - (interactive "p") - (ess-noweb-goto-next (- cnt))) - -(defun ess-noweb-occur (arg) - "Find all occurences of the current chunk. -This function simply runs OCCUR on \"<>\"." - (interactive "P") - (let ((n (if (and arg - (numberp arg)) - arg - 0)) - (idx (ess-noweb-find-chunk-index-buffer))) - (if (ess-noweb-chunk-is-code idx) - (occur (regexp-quote (concat "<<" - (car (aref ess-noweb-chunk-vector idx)) - ">>")) - n) - (setq idx (1+ idx)) - (while (not (ess-noweb-chunk-is-code idx)) - (setq idx (1+ idx))) - (occur (regexp-quote (concat "<<" - (car (aref ess-noweb-chunk-vector idx)) - ">>")) - n)))) - - -;;; Insertion - -(defun ess-noweb-new-chunk (name) - "Insert a new chunk." - (interactive "sChunk name: ") - (insert "@ \n<<" name ">>=\n") - (save-excursion - (insert "@ %def \n")) - (ess-noweb-update-chunk-vector)) - -(defun ess-noweb-at-beginning-of-line () - (equal (save-excursion - (beginning-of-line) - (point)) - (point))) - -(defun ess-noweb-electric-@ (arg) - "Smart incarnation of `@', starting a new documentation chunk, maybe. -If given an numerical argument, it will act just like the dumb `@'. -Otherwise and if at the beginning of a line in a code chunk: -insert \"@ \" and update the chunk vector." - (interactive "P") - (if arg - (self-insert-command (if (numberp arg) arg 1)) - (if (and (ess-noweb-at-beginning-of-line) - (ess-noweb-in-code-chunk)) - (progn - (insert "@ ") - (ess-noweb-update-chunk-vector)) - (self-insert-command 1)))) - -(defun ess-noweb-electric-< (arg) - "Smart incarnation of `<', starting a new code chunk, maybe. -If given an numerical argument, it will act just like the dumb `<'. -Otherwise and if at the beginning of a line in a documentation chunk: -insert \"<<>>=\", a closing \"@\" and a newline if necessary. Leave point -in the middle and and update the chunk vector." - (interactive "P") - (if arg - (self-insert-command (if (numberp arg) arg 1)) - (if (and (ess-noweb-at-beginning-of-line) - (not (ess-noweb-in-code-chunk))) - (progn - (insert "<<") - (save-excursion - (insert ">>=\n@ ") - (if (not (looking-at "\\s *$")) - (newline))) - (ess-noweb-update-chunk-vector)) - (self-insert-command 1)))) - - -;;; Modes - -(defun ess-noweb-set-chunk-code-mode () - "Set the ess-noweb-code-mode for the current chunk" - (interactive) - (if (ess-noweb-in-code-chunk) - (progn - ;; Reset code-mode to default and then check for a mode comment. - (setq ess-noweb-code-mode ess-noweb-default-code-mode) - (let (mode chunk-name) - (save-excursion - (save-restriction - (end-of-line) - (re-search-backward "^[ \t]*<<\\(.*\\)>>=" nil t) - (setq chunk-name (match-string 1)) - (widen) - (goto-char (point-min)) - (re-search-forward (concat "^<<" (regexp-quote chunk-name) ">>=") nil t) - (beginning-of-line 2) - (setq mode (ess-noweb-in-mode-line)) - (if (functionp mode) - (setq ess-noweb-code-mode mode)))))) - (error "This only makes sense in a code chunk"))) - -(defun ess-noweb-set-doc-syntax-table () - "Sets the doc-mode syntax-table to treat code quotes as comments." - (interactive) - (let ((square-bracket-string (char-to-string (char-syntax ?\[)))) - (if (string= square-bracket-string "(") - (progn - (modify-syntax-entry ?\[ "(]12b" ess-noweb-doc-mode-syntax-table) - (modify-syntax-entry ?\] ")[34b" ess-noweb-doc-mode-syntax-table)) - (progn - (modify-syntax-entry ?\[ - (concat square-bracket-string " 12b") - ess-noweb-doc-mode-syntax-table) - (modify-syntax-entry ?\] - (concat square-bracket-string " 34b") - ess-noweb-doc-mode-syntax-table))))) - -(defun ess-noweb-select-mode () - "Select ess-noweb-DOC-MODE or ess-noweb-CODE-MODE, as appropriate." - (interactive) - (let ((this-chunk-index (ess-noweb-find-chunk-index-buffer))) - ;; Has the last change to the buffer taken us into a different - ;; chunk ? - (if (not (equal this-chunk-index ess-noweb-last-chunk-index)) - (progn - (setq ess-noweb-last-chunk-index this-chunk-index) - (if (ess-noweb-in-code-chunk) - ;; Inside a code chunk - (progn - ;; Find out which code mode to use - (ess-noweb-set-chunk-code-mode) - ;; If we aren't already using it, use it. - (if (not (equal major-mode ess-noweb-code-mode)) - (progn - (funcall ess-noweb-code-mode) - (run-hooks 'ess-noweb-select-mode-hook) - (run-hooks 'ess-noweb-select-code-mode-hook)))) - ;; Inside a documentation chunk - (progn - (if (not (equal major-mode ess-noweb-doc-mode)) - (progn - (funcall ess-noweb-doc-mode))) - (if (not ess-noweb-doc-mode-syntax-table) - (progn - (message "Setting up syntax table") - (setq ess-noweb-doc-mode-syntax-table - (make-syntax-table (syntax-table))) - (ess-noweb-set-doc-syntax-table))) - (set-syntax-table ess-noweb-doc-mode-syntax-table) - (run-hooks 'ess-noweb-select-mode-hook) - (run-hooks 'ess-noweb-select-doc-mode-hook))) - (run-hooks 'ess-noweb-changed-chunk-hook))))) - -(defun ess-noweb-set-doc-mode (mode) - "Change the major mode for editing documentation chunks." - (interactive "CNew major mode for documentation chunks: ") - (setq ess-noweb-doc-mode mode) - (setq ess-noweb-doc-mode-syntax-table nil) - ;;Pretend we've changed chunk, so the mode will be reset if necessary - (setq ess-noweb-last-chunk-index (1- ess-noweb-last-chunk-index)) - (ess-noweb-select-mode)) - -(defun ess-noweb-set-code-mode (mode) - "Change the major mode for editing all code chunks." - (interactive "CNew major mode for all code chunks: ") - (setq ess-noweb-default-code-mode mode) - ;;Pretend we've changed chunk, so the mode will be reset if necessary - (setq ess-noweb-last-chunk-index (1- ess-noweb-last-chunk-index)) - (ess-noweb-select-mode)) - -(defun ess-noweb-set-this-code-mode (mode) - "Change the major mode for editing this code chunk. -The only sensible way to do this is to add a mode line to the chunk" - (interactive "CNew major mode for this code chunk: ") - (if (ess-noweb-in-code-chunk) - (progn - (setq ess-noweb-code-mode mode) - (save-excursion - (save-restriction - (let (chunk-name) - (widen) - (end-of-line) - (re-search-backward "^[ \t]*<<\\(.*\\)>>=" nil t) - (setq chunk-name (match-string 1)) - (goto-char (point-min)) - (re-search-forward (concat "^<<" (regexp-quote chunk-name) ">>=") nil t) - (beginning-of-line 2)) - ;; remove mode-line, if there is one - (if (ess-noweb-in-mode-line) - (progn - (kill-line) - (kill-line))) - (if (not (equal ess-noweb-code-mode ess-noweb-default-code-mode)) - (progn - (setq mode (substring (symbol-name mode) 0 -5)) - ;; Need to set major mode so that we can comment out - ;; the mode line - (funcall ess-noweb-code-mode) - (if (not (boundp 'comment-start)) - (setq comment-start "#")) - (insert comment-start - " -*- " mode - " -*- " comment-end "\n"))) - (setq ess-noweb-last-chunk-index (1- ess-noweb-last-chunk-index))))) - (message "This only makes sense in a code chunk."))) - -;;; Misc - -(defun ess-noweb-mode-version () - "Echo the RCS identification of noweb mode." - (interactive) - (message "Thorsten's ess-noweb-mode, now part of ESS version %s" ess-version)) - -(defun ess-noweb-describe-mode () - "Describe noweb mode." - (interactive) - (describe-function 'ess-noweb-mode)) - -(defun ess-noweb-insert-default-mode-line () - "Insert line that will set the noweb mode of this file in emacs. -The file is set to use the current doc and default-code modes, so -ensure they are set correctly (with ess-noweb-set-code-mode and -ess-noweb-set-doc-mode) before calling this function" - (interactive) - (save-excursion - (goto-char 1) - (if (ess-noweb-in-mode-line) - (progn - (kill-line) - (kill-line))) - (if (not (eq major-mode ess-noweb-doc-mode)) - (ess-noweb-select-mode)) - (insert comment-start " -*- mode: noweb; ess-noweb-default-code-mode: " - (symbol-name ess-noweb-default-code-mode) - (if (not (eq ess-noweb-doc-mode ess-noweb-default-doc-mode)) - (concat "; ess-noweb-doc-mode: " (symbol-name - ess-noweb-doc-mode) ";") - ";") - " -*-" comment-end "\n")) - (ess-noweb-select-mode)) - -(defun ess-noweb-mouse-first-button (event) - (interactive "e") - (mouse-set-point event) - (if (and ess-noweb-use-mouse-navigation - (eq (save-excursion - (end-of-line) - (re-search-backward "^[\t ]*\\(<<\\)\\(.*\\)\\(>>\\)" nil t)) - (save-excursion - (beginning-of-line) (point)))) - (progn - (if (< (point) (match-beginning 2)) - (let ((chunk-name (buffer-substring-no-properties - (match-beginning 2) - (match-end 2)))) - (re-search-backward (concat "<<" (regexp-quote chunk-name) ">>") nil t)) - (if (and (<= (match-end 2) (point)) - (> (+ 2 (match-end 2)) (point))) - (let ((chunk-name (buffer-substring-no-properties - (match-beginning 2) - (match-end 2)))) - (re-search-forward (concat "<<" (regexp-quote chunk-name) ">>") nil t))))))) - - -;;; Debugging - -(defun ess-noweb-log (s) - (let ((b (current-buffer))) - (switch-to-buffer (get-buffer-create "*noweb-log*")) - (goto-char (point-max)) - (setq buffer-read-only nil) - (insert s) - (setq buffer-read-only t) - (switch-to-buffer b))) - - - - - -(defvar ess-noweb-thread-alist nil - "A list of threads in the current buffer. -Each entry in the list contains 5 elements: -1) The name of the threads -2) The name of the immdiate parent thread in which it is used (nil if - it is a \"top-level\" thread which is not used anywhere). -3) The name of the top-level parent thread in which it is used (i.e. a - thread in which it is used but which is not itself used anywhere: - nil if this thread is not used anywhere. -4) The format string to use to define line numbers in the output - file of this thread. Should only be set if this thread is not used - anywhere: if a thread is used as part of another thread, the parent - thread's format string should be used. -5) If this is nil, tabs are converted to spaces in the tangled - file. If it is a number, tabs are copied to the tangled file - unchanged, and tabs are also used for indentation, with the number - of spaces per tab defined by this number. This MUST be set in order - to tangle makefiles, which depend on tabs.Should only be set if - this thread is not used anywhere. otherwise set to nil. " - ) - -(defun ess-noweb-update-thread-alist () - "Updates the list of threads in the current buffer. -Each entry in the list contains 5 elements: -1) The name of the thread -2) The name of the immdiate parent thread in which it is used (nil if - it is a \"top-level\" thread which is not used anywhere). -3) The name of the top-level parent thread in which it is used (i.e. a - thread in which it is used but which is not itself used anywhere: - nil if this thread is not used anywhere. -4) The format string to use to define line numbers in the output - file of this thread. Should only be set if this thread is not used - anywhere: if a thread is used as part of another thread, the parent - thread's format string should be used. -5) If this is nil, tabs are converted to spaces in the tangled - file. If it is a number, tabs are copied to the tangled file - unchanged, and tabs are also used for indentation, with the number - of spaces per tab defined by this number. This MUST be set in order - to tangle makefiles, which depend on tabs.Should only be set if - this thread is not used anywhere. otherwise set to nil. " - (interactive) - (save-excursion - (goto-char (point-min)) - (let ((thread-alist) (thread-list-entry) (chunk-use-name) - (current-thread) (new-thread-alist)) - (while (re-search-forward - "^[ \t]*<<\\(.*\\)>>\\(=\\)?" nil t) - (goto-char (match-beginning 0)) - ;; Is this the definition of a chunk ? - (if (match-beginning 2) - ;;We have a chunk definition - (progn - ;; Get the thread name - (setq current-thread - (buffer-substring-no-properties (match-beginning 1) - (match-end 1))) - ;; Is this thread already in our list ? - (if (assoc current-thread thread-alist) - nil - (progn - ;; If not, create an entry with 4 nils at the end - (setq thread-list-entry - (list (cons current-thread - (make-list 4 nil)))) - ;; And add it to the list - (setq thread-alist - (append thread-alist thread-list-entry))))) - - ;; Not a definition but a use - (progn - ;; Get the thread name - (setq chunk-use-name - (buffer-substring-no-properties (match-beginning 1) - (match-end 1))) - ;; Has the thread already been defined before being used ? - (if (setq thread-list-entry (assoc chunk-use-name - thread-alist)) - ;; If it has, set its parent to be the thread we are in at the moment - (setcar (cdr thread-list-entry) current-thread) - ;; If not, add it to the list, with its parent name and 3 nils - (progn - (setq thread-list-entry - (list (cons chunk-use-name - (cons current-thread - (make-list 3 nil))))) - (setq thread-alist (append thread-alist thread-list-entry))))) - ) - ;;Go to the next line - (beginning-of-line 2)) - ;; Now, the second element of each entry points to that thread's - ;; immediate parent. Need to set it to the thread's ultimate - ;; parent. - (let ((thread-counter 0) - (this-thread) - (this-thread-parent)) - (while (<= thread-counter (1- (length thread-alist))) - (setq this-thread (nth thread-counter thread-alist)) - (setq this-thread-parent (assoc - (car (cdr this-thread)) - thread-alist)) - (while (not (equal nil (car (cdr this-thread-parent)))) - (setq this-thread-parent (assoc - (car (cdr this-thread-parent)) - thread-alist))) - (setq this-thread (cons (car this-thread) - (cons (car (cdr this-thread)) - (cons (car this-thread-parent) - (nthcdr 2 this-thread))))) - (setq new-thread-alist (append new-thread-alist (list this-thread))) - (setq thread-counter (1+ thread-counter)))) - - (setq ess-noweb-thread-alist new-thread-alist)))) - - - ; Option setting functions to go here - -(defun ess-noweb-set-thread-line-format ()) - -(defun ess-noweb-set-thread-tabs ()) - - -(defvar ess-noweb-default-line-number-format nil - "The format string to use to define line numbers in this thread. -If nil, do not use line numbers.") - -(defvar ess-noweb-default-line-number-skip-lines 0 - "The number of initial lines to output before the line number. -This may be useful in shell scripts, where the first line (or two) must have a - specific form.") - -(defvar ess-noweb-default-tab-width 8 - "If a number, convert tabs to that number of spaces in the output. If nil, let tabs through to the output unaltered.") - -(defvar ess-noweb-line-number-format ess-noweb-default-line-number-format - "The format string to use to define line numbers in this thread. -If nil, do not use line numbers.") - -(defvar ess-noweb-line-number-skip-lines ess-noweb-default-line-number-skip-lines - "The number of initial lines to output before the line number. -This may be useful in shell scripts, where the first line (or two) must have a - specific form.") - -(defvar ess-noweb-tab-width ess-noweb-default-tab-width - "If a number, convert tabs to that number of spaces in the output. If nil, let tabs through to the output unaltered.") - -(defun ess-noweb-get-thread-local-variables () - "Get the values of the variables that are local to a thread." - (interactive) - (save-excursion - (save-restriction - (end-of-line) - (re-search-backward "^[ \t]*<<\\(.*\\)>>=" nil t) - (let ((chunk-name (match-string 1))) - (widen) - (goto-char (point-min)) - (re-search-forward (concat "^<<" (regexp-quote chunk-name) ">>=") nil t) - (beginning-of-line 2) - (while (looking-at ".*-\*-.*-\*-") - (let ((this-line (buffer-substring-no-properties - (point) - (progn (end-of-line) (point))))) - (if (string-match - "mode:[ \t]*\\([^\t ]*\\)" this-line) - (setq ess-noweb-code-mode - (match-string-no-properties 1 this-line))) - (if (string-match - "ess-noweb-line-number-format:[ \t]*\"\\([^\"]*\\)\"" this-line) - (setq ess-noweb-line-number-format - (match-string-no-properties 1 this-line))) - (if (string-match - "ess-noweb-line-number-skip-lines:[ \t]*\\([^\t ]*\\)" this-line) - (setq ess-noweb-line-number-skip-lines - (string-to-number - (match-string-no-properties 1 this-line)))) - (if (string-match - "ess-noweb-tab-width:[ \t]*\\([^\t ]*\\)" this-line) - (setq ess-noweb-tab-width - (string-to-number - (match-string-no-properties 1 this-line)))) - (beginning-of-line 2))))))) - -(defun ess-noweb-reset-thread-local-variables () - "Resets the thread-local variables to their default values" - (setq ess-noweb-tab-width ess-noweb-default-tab-width) - (setq ess-noweb-line-number-format ess-noweb-default-line-number-format) - (setq ess-noweb-line-number-skip-lines ess-noweb-default-line-number-skip-lines)) - -(defun ess-noweb-write-line-number (line-number-format buffer) - (if line-number-format - (progn - (let ((this-line (count-lines (point-min)(point)))) - (while (string-match ".*\\(%L\\).*" line-number-format) - (setq line-number-format - (replace-match - (format "%d" this-line) t t line-number-format 1))) - (while (string-match ".*\\(%F\\).*" line-number-format) - (setq line-number-format - (replace-match - (format "%s" (buffer-file-name)) t t line-number-format 1))) - (while (string-match ".*\\(%N\\).*" line-number-format) - (setq line-number-format - (replace-match "\n" t t line-number-format 1))) - (with-current-buffer buffer - (insert line-number-format)))))) - - -(defun ess-noweb-tangle-chunk ( &optional buffer prefix-string) - "Generate the code produced by this chunk, & any threads used in this chunk." - (interactive) - (save-excursion - (ess-noweb-reset-thread-local-variables) - (ess-noweb-get-thread-local-variables) - (ess-noweb-update-chunk-vector) - (let* - ((chunk-end (progn - (end-of-line) - (re-search-forward "^@" nil t) - (beginning-of-line) - (point))) - ;;get name and start point of this chunk - (chunk-start (progn - (re-search-backward "^<<\\([^>]*\\)>>=$" nil t) - (beginning-of-line 2) - (point))) - (chunk-name (buffer-substring-no-properties - (match-end 1) - (match-beginning 1))) - ;; get end of this chunk - ;; Get information we need about this thread - (thread-info (assoc chunk-name ess-noweb-thread-alist)) - (thread-tabs (nth 4 thread-info)) - (line-number-format (nth 3 thread-info)) - (thread-name-re) (post-chunk) (pre-chunk) - (first-line t) - (tangle-buffer (generate-new-buffer "Tangle Buffer"))) - - (progn - (goto-char chunk-start) - ;; If this is a mode-line, ignore it - (while (looking-at ".*-\\*-.*-\\*-") - (beginning-of-line 2)) - ;; If we want to include line numbers, write one - (if line-number-format - (while (> ess-noweb-line-number-skip-lines 0) - (append-to-buffer tangle-buffer - (point) - (save-excursion - (progn - (end-of-line) - (point)))) - (beginning-of-line 2) - (1- ess-noweb-line-number-skip-lines)) - (ess-noweb-write-line-number line-number-format buffer)) - (message "Now at %d" (point)) - - (while (< (point) chunk-end) - (untabify (point) (save-excursion (beginning-of-line 2)(point))) - ;; This RE gave me trouble. Without the `\"', it - ;; recognised itself and so could not copy itself - ;; correctly. - (if (looking-at - "\\([^\n\"@]*\\)<<\\(.*\\)\\(>>\\)\\([^\n\"]*\\)$") - (progn - (save-excursion - (save-restriction - (setq thread-name-re - (concat "<<" - (regexp-quote (match-string 2)) - ">>=")) - (setq pre-chunk (match-string 1)) - (if prefix-string - (setq pre-chunk (concat prefix-string - pre-chunk))) - (setq post-chunk (match-string 4)) - (widen) - (goto-char (point-min)) - (while (re-search-forward thread-name-re nil t) - (ess-noweb-tangle-chunk tangle-buffer pre-chunk) - (forward-line 1))) - (if post-chunk - (with-current-buffer tangle-buffer - (backward-char) - (insert post-chunk) - (beginning-of-line 2))))) - - ;; Otherwise, just copy this line - (setq pre-chunk - (buffer-substring - (point) - (save-excursion - (beginning-of-line 2) - (point)))) - ;; Add a prefix if necessary - (if (and prefix-string - (> (length pre-chunk) 1)) - (setq pre-chunk (concat prefix-string - pre-chunk))) - ;; And copy it to the buffer - (with-current-buffer tangle-buffer - (insert pre-chunk))) - ;; If this is the first line of the chunk, we need to change - ;; prefix-string to consist solely of spaces - (if (and first-line - prefix-string) - (progn - (setq prefix-string - (make-string (length prefix-string) ?\ )) - (setq first-line nil))) - ;; Either way, go to the next line - (beginning-of-line 2)) - - (with-current-buffer tangle-buffer - (goto-char (point-min)) - (while (re-search-forward "\@\<<" nil t) - (replace-match "<<" nil nil) - (forward-char 3)) - (if thread-tabs - (progn - (setq tab-width thread-tabs) - (tabify (point-min)(point-max))) - (untabify (point-min)(point-max)))) - - (if buffer - (with-current-buffer buffer - (insert-buffer-substring tangle-buffer) - (kill-buffer tangle-buffer))) - )))) - -(defun ess-noweb-tangle-thread ( name &optional buffer) - "Given the name of a thread, tangles the thread to buffer. -If no buffer is given, create a new one with the same name as the -thread." - (interactive "sWhich thread ? ") - (if (not buffer) - (progn - (setq buffer (get-buffer-create name)) - (with-current-buffer buffer - (erase-buffer)))) - (save-excursion - (goto-char (point-min)) - (let ((chunk-counter 0)) - (while (re-search-forward - "^<<\\(.*\\)>>=[\t ]*" nil t) - (if (string= (match-string 1) - name) - (progn - (setq chunk-counter (1+ chunk-counter)) - (message "Found %d chunks" chunk-counter) - (ess-noweb-tangle-chunk buffer))))))) - -(defun ess-noweb-tangle-current-thread ( &optional buffer) - (interactive) - (save-excursion - (let* ((chunk-start - (progn - (re-search-backward "^<<\\([^>]*\\)>>=[\t ]*$" - nil t) - (beginning-of-line 2) - (point))) - (chunk-name (buffer-substring-no-properties - (match-end 1) - (match-beginning 1)))) - (ess-noweb-tangle-thread chunk-name buffer)))) - ;menu functions - - -;;; Finale - -(run-hooks 'ess-noweb-mode-load-hook) -(provide 'ess-noweb-mode) - -;; Changes made by Mark Lunt (mark.lunt@mrc-bsu.cam.ac.uk) 22/03/1999 - -;; The possibility of having code chunks using more than one language -;; was added. This was first developed by Adnan Yaqub -;; (AYaqub@orga.com) for syntax highlighting, but even people who hate -;; highlighting may like to maintain their Makefile with their code, -;; or test-scripts with their programs, or even user documentation as -;; latex-mode code chunks. -;; This required quite a few changes to ess-noweb-mode: -;; 1) A new variable `ess-noweb-default-code-mode' was create to do the job -;; `ess-noweb-code-mode' used to. -;; 2) ess-noweb-code-mode now contains the code-mode of the current chunk -;; 3) Each chunk can now have its own mode-line to tell emacs what -;; mode to use to edit it. The function `ess-noweb-in-mode-line' -;; recognises such mode-lines, and the function -;; `ess-noweb-set-this-code-mode' sets the code mode for the current -;; chunk and adds a mode-line if necessary. If several chunks have -;; the same name, the mode-line must appear in the first chunk with -;; that name. -;; 4) The mechanism for deciding whether to change mode was altered, -;; since the old method assumed a single code mode. Now, -;; `ess-noweb-last-chunk-index' keeps track of which chunk we were in -;; last. If we have moved to a different chunk, we have to check -;; which mode we should be in, and change if necessary. - -;; The keymap and menu-map handling was changed. Easymenu was used to -;; define the menu, and it the keymap was attached to the 'official' -;; minor-modes-keymaps list. This means that -;; 1) It was automatically loaded when ess-noweb-mode was active and -;; unloaded when it was inactive. -;; 2) There was no need to worry about the major mode map clobbering -;; it , since it takes precedence over the major mode -;; map. `ess-noweb-setup-keymap' is therefore now superfluous -;; The menu was also reorganised to make it less cluttered, so there -;; would be room for adding tangling and weaving commands (one day). - -;; Mouse navigation (at least under Emacs (AJR)) is supported, in so -;; far as clicking mouse-1 on the '<<' of a chunk name moves to the -;; previous instance of that chunk name, and clicking in the '>>' -;; moves to the next instance. They are not mouse-hightlighted, -;; though: too much hassle for zero added functionality. - -;; ess-noweb-doc-mode has been given its own syntax-table. It is the same -;; as the current doc-mode syntax-table, except that [[ is a comment -;; start and ]] a comment end. Fixes some ugliness in LaTeX-mode if -;; `$' or `%' appear in quoted code (or even `<<', which happens often -;; in C++). -;; (This should make ess-noweb-hide-code-quotes and -;; ess-noweb-restore-code-quotes unnecessary, but I have not yet removed -;; them, nor the calls to them). - -;; A new function `ess-noweb-indent-line' was defined and bound by default -;; to the tab key. This should indent the current line correctly in -;; whichever mode we are currently in. Previously, c-mode in -;; particular did not behave well with indentation (although -;; `ess-noweb-fill-chunk' worked fine). Indentation is only accurate -;; within the chunk: it does not know the syntax at the end of the -;; previous chunk, so it does not know where to start indenting in -;; this chunk. However, provided the indentation within each chunk is correct, -;; notangle will correctly indented code. - -;; (I think it would be good to separate filling and indenting, -;; though, since `indent-region' and `fill-region' have completely -;; different meanings in LaTeX-mode (and both are useful)) - -;; ess-noweb-mode and ess-noweb-minor-mode were given an optional argument, so -;; that (ess-noweb-mode -1) turns it off, (ess-noweb-mode 1) turns it on, and -;; (ess-noweb-mode) toggles it. This is considered normal for minor modes. - -;; buffer-substring changed to buffer-substring-no-properties: -;; comparisons with buffer-substring can be unreliable if highlighting -;; is used. - -;; New functions `ess-noweb-in-code-chunk' & `ess-noweb-chunk-is-code' created -;; to replace (if (stringp (car (ess-noweb-find-chunk)))) and -;; (if (stringp (car (ess-noweb-chunk-vector-aref index)))). - -;; `ess-noweb-insert-mode-line' was renamed -;; `ess-noweb-insert-default-mode-line' and modified to put the mode-line -;; at the start of the file and remove any existing mode-line. - -;; a '<=' in `ess-noweb-find-chunk-index' changed to '<', so we get the -;; right answer if point is on the first character in a chunk - -;; The name of `ess-noweb-post-command-hook' changed to -;; `ess-noweb-post-command-function', since it is a function. - -;; All the highlighting code moved to a separate file: -;; (ess-noweb-font-lock-mode.el) - -;; Menu driven tangling is in the process of being added. It can -;; currently tangle a single chunk or a series of chunks with the -;; same name (which I refer to as a thread) into a separate -;; buffer. This buffer can then be saved to a file, sent to an -;; interpreter, whatever. I haven't tested using line-numbers as yet. - -;;; ess-noweb-mode.el ends here diff --git a/elpa/ess-20181109.703/ess-noweb.el b/elpa/ess-20181109.703/ess-noweb.el deleted file mode 100644 index 09fb32ce..00000000 --- a/elpa/ess-20181109.703/ess-noweb.el +++ /dev/null @@ -1,130 +0,0 @@ -;;; ess-noweb.el --- support for Literate Data Analysis - -;; Copyright (C) 1999 Mark Lunt -;; Copyright (C) 1999--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: Mark Lunt -;; A.J. Rossini -;; Created: April 18, 1999 -;; Maintainer: ESS-core - -;; Keywords: statistics, languages -;; Summary: Noweb support for ESS - -;; This file is part of ESS - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; Code for ESS and Literate Data Analysis. - -;;; Code: - - ; Requires and autoloads - -(require 'ess-custom) -(require 'ess-inf) -(require 'ess-noweb-mode) - - ; Variables - -(defvar ess-noweb-use-font-lock font-lock-mode - "Set to t if you want to use font-locking in ESS noweb buffers.") - -(if ess-noweb-use-font-lock - (require 'ess-noweb-font-lock-mode)) - - ; Functions - -;;*;; Code Chunk evaluation. - -(defun ess-eval-chunk (vis) - "Tangle the current chunk and send it to the inferior ESS process. -Arg has same meaning as for `ess-eval-region'." - (interactive "P") - (let ((process-name ess-local-process-name) - new-process-name - (cbuf (current-buffer)) - (temp-buffer (ess-create-temp-buffer "Tangle Buffer"))) - (save-excursion - (ess-noweb-tangle-chunk temp-buffer) - (set-buffer temp-buffer) - ;; When the temp buffer is created, it does not inherit any value - ;; of ess-local-process-name from the .Rnw buffer, so we have to set it - ;; here. If ess-local-process-name is not set in the .Rnw buffer, - ;; it will inherit the value that is chosen here. - (set (make-local-variable 'ess-local-process-name) process-name) - (ess-eval-region (point-min) (point-max) vis "Eval Chunk") - (if process-name - (kill-buffer temp-buffer) - ;; if process-name was nil, source buffer did not have a local process - ;; so keep value from temp buffer before killing it. - (setq new-process-name ess-local-process-name) - (kill-buffer temp-buffer) - (set-buffer cbuf) - (set (make-local-variable 'ess-local-process-name) new-process-name))))) - - -(defun ess-eval-chunk-and-step (&optional vis) - "Tangle the current chunk and send it to the inferior ESS process and -step to the next chunk" - (interactive) - (ess-eval-chunk vis) - (ess-noweb-next-code-chunk 1)) - -(defun ess-eval-chunk-and-go (vis) - "Tangle the current chunk, send to the ESS process, and go there. -Arg has same meaning as for `ess-eval-region'." - (interactive "P") - (ess-eval-chunk vis) - (ess-switch-to-ESS t)) - -;;*;; Thread code chunk evaluation - -;; -;; Threads are code chunks which fit into the same "buffer" (I'm (AJR) -;; abusing terminology, but what I mean is things like: -;; <>= -;; code for thing1 -;; @ -;; Documentation -;; <>= -;; continuing code for thing1 -;; @ -;; - -(defun ess-eval-thread (vis) - "Tangle all chunks in the current chunk-thread and send to the ESS process. -Arg has same meaning as for `ess-eval-region'." - (interactive "P") - (let ((temp-buffer (ess-create-temp-buffer "Tangle Buffer"))) - (ess-noweb-tangle-current-thread temp-buffer) - (set-buffer temp-buffer) - (ess-eval-region (point-min) (point-max) vis "Eval buffer") - (kill-buffer temp-buffer))) - -(defun ess-eval-thread-and-go (vis) - "Tangle all chunks in the current chunk-thread, send to ESS process, -and go there. Arg has same meaning as for `ess-eval-region'." - (interactive "P") - (ess-eval-thread vis) - (ess-switch-to-ESS t)) - - ; Provide package - -(provide 'ess-noweb) - -;;; ess-noweb.el ends here diff --git a/elpa/ess-20181109.703/ess-omg-d.el b/elpa/ess-20181109.703/ess-omg-d.el deleted file mode 100644 index a1107cd6..00000000 --- a/elpa/ess-20181109.703/ess-omg-d.el +++ /dev/null @@ -1,113 +0,0 @@ -;;; ess-omg-d.el --- Omega customization - -;; Copyright (C) 1999 A. J. Rossini -;; Copyright (C) 2000--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: A.J. Rossini -;; Created: 15 August 1999 -;; Maintainer: ESS-core - -;; Keywords: languages - -;; This file is part of ESS. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; This file defines all the S-PLUS 3.x customizations for ess-mode. - -;;; Code: - -;;; Requires and Autoloads: - -(require 'ess-omg-l) -(require 'ess-trns) - -(defvar OMG-dialect-name "OMG" - "Name of 'dialect' for Omega.") ;easily changeable in a user's .emacs - -(defvar OMG-customize-alist - '((ess-local-customize-alist . 'OMG-customize-alist) - (ess-language . "OMG") - (ess-dialect . "omegahat") - (ess-suffix . "omg") - (ess-loop-timeout . 5000) - (ess-dump-filename-template . (replace-regexp-in-string - "S$" ess-suffix ; in the one from custom: - ess-dump-filename-template-proto)) - (ess-mode-editing-alist . OMG-editing-alist) - (ess-mode-syntax-table . OMG-syntax-table) - (ess-change-sp-regexp . "");fixme (if omegahat ever ..) - (ess-help-sec-regex . ess-help-S+-sec-regex) - (ess-help-sec-keys-alist . ess-help-S+sec-keys-alist) - (ess-object-name-db-file . "ess-omg-namedb.el" ) - (inferior-ess-program . inferior-OMG-program) - (inferior-ess-objects-command . "objects(%d)\n") - (inferior-ess-help-command . "help(\"%s\",pager=\"cat\",window=F)\n") - (inferior-ess-exit-command . "q()\n") - (inferior-ess-primary-prompt . "\\[[0-9]*\\]") - (inferior-ess-secondary-prompt . ".. ?") - (comint-use-prompt-regexp . t) - (inferior-ess-start-file . nil) ;"~/.ess-omg") - (inferior-ess-start-args . "")) - "Variables to customize for OMG (Omegahat)") - - -(defun OMG (&optional start-args) ; proc-name) - "Call Omegahat, from the Omega Group for Statistical Computing." - (interactive "P") - (setq ess-customize-alist OMG-customize-alist) - (ess-write-to-dribble-buffer - (format "\n(OMG): ess-dialect=%s, buf=%s\n" - ess-dialect - (current-buffer))) - (let ((omg-start-args - (concat inferior-ess-start-args - (if start-args (read-string - "Starting Args [possibly -CORBA] ? ") - nil)))) - (inferior-ess omg-start-args))) - - - -(fset 'omegahat 'OMG) - -;;;###autoload -(defun OMG-mode (&optional proc-name) - "Major mode for editing Omegahat source. NOT EVEN STARTED." - (interactive) - (setq ess-customize-alist OMG-customize-alist) - (ess-mode OMG-customize-alist proc-name) - ;;(java-mode) - (setq major-mode 'OMG-mode)) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.omg\\'" . omegahat-mode)) -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.hat\\'" . omegahat-mode)) - -(fset 'omegahat-mode 'OMG-mode) - -(defun OMG-transcript-mode () - "Omegahat transcript mode." - (interactive) - (ess-transcript-mode OMG-customize-alist)) - - ; Provide package - -(provide 'ess-omg-d) - -;;; ess-omg-d.el ends here diff --git a/elpa/ess-20181109.703/ess-omg-l.el b/elpa/ess-20181109.703/ess-omg-l.el deleted file mode 100644 index 92f97dc6..00000000 --- a/elpa/ess-20181109.703/ess-omg-l.el +++ /dev/null @@ -1,326 +0,0 @@ -;;; ess-omg-l.el --- Support for editing Omega source code - -;; Copyright (C) 1999--2001 A.J. Rossini. -;; Copyright (C) 2002--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: A.J. Rossini -;; Created: 15 Aug 1999 -;; Maintainer: ESS-core - -;; This file is part of ESS (Emacs Speaks Statistics). - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; Code for general editing Omega source code. This is initially -;; based upon the similarities between Omega and S, but will need to -;; diverge to incorporate the use of Java-style coding. - -;;; Code: - -(require 'ess-s-lang) - - ; Specialized functions - -(defun OMG-comment-indent () - "Indentation for Omega comments." - - (if (looking-at "////") - (current-column) - (if (looking-at "///") - (let ((tem (ess-calculate-indent))) - (if (listp tem) (car tem) tem)) - (skip-chars-backward " \t") - (max (if (bolp) 0 (1+ (current-column))) - comment-column)))) - -;; (defun OMG-indent-line () -;; "Indent current line as Omega code. -;; Return the amount the indentation changed by." -;; (let ((indent (ess-calculate-indent nil)) -;; beg shift-amt -;; (case-fold-search nil) -;; (pos (- (point-max) (point)))) -;; (beginning-of-line) -;; (setq beg (point)) -;; (cond ((eq indent nil) -;; (setq indent (current-indentation))) -;; (t -;; (skip-chars-forward " \t") -;; (if (and ess-indent-with-fancy-comments (looking-at "////")) -;; (setq indent 0)) -;; (if (and ess-indent-with-fancy-comments -;; (looking-at "//") -;; (not (looking-at "///"))) -;; (setq indent comment-column) -;; (if (eq indent t) (setq indent 0)) -;; (if (listp indent) (setq indent (car indent))) -;; (cond ((and (looking-at "else\\b") -;; (not (looking-at "else\\s_"))) -;; (setq indent (save-excursion -;; (ess-backward-to-start-of-if) -;; (+ ess-else-offset -;; (current-indentation))))) -;; ((= (following-char) ?}) -;; (setq indent -;; (+ indent -;; (- ess-close-brace-offset ess-indent-offset)))) -;; ((= (following-char) ?{) -;; (setq indent (+ indent ess-brace-offset))))))) -;; (skip-chars-forward " \t") -;; (setq shift-amt (- indent (current-column))) -;; (if (zerop shift-amt) -;; (if (> (- (point-max) pos) (point)) -;; (goto-char (- (point-max) pos))) -;; (delete-region beg (point)) -;; (indent-to indent) -;; ;; If initial point was within line's indentation, -;; ;; position after the indentation. -;; ;; Else stay at same point in text. -;; (if (> (- (point-max) pos) (point)) -;; (goto-char (- (point-max) pos)))) -;; shift-amt)) - - -;; (defun OMG-calculate-indent (&optional parse-start) -;; "Return appropriate indentation for current line as Omega code. -;; In usual case returns an integer: the column to indent to. -;; Returns nil if line starts inside a string, t if in a comment." -;; (save-excursion -;; (beginning-of-line) -;; (let ((indent-point (point)) -;; (case-fold-search nil) -;; state -;; containing-sexp) -;; (if parse-start -;; (goto-char parse-start) -;; (beginning-of-defun)) -;; (while (< (point) indent-point) -;; (setq parse-start (point)) -;; (setq state (parse-partial-sexp (point) indent-point 0)) -;; (setq containing-sexp (car (cdr state)))) -;; (cond ((or (nth 3 state) (nth 4 state)) -;; ;; return nil or t if should not change this line -;; (nth 4 state)) -;; ((null containing-sexp) -;; ;; Line is at top level. May be data or function definition, -;; (beginning-of-line) -;; (if (and (/= (following-char) ?\{) -;; (save-excursion -;; (ess-backward-to-noncomment (point-min)) -;; (ess-continued-statement-p))) -;; ess-continued-statement-offset -;; 0)) ; Unless it starts a function body -;; ((/= (char-after containing-sexp) ?{) -;; ;; line is expression, not statement: -;; ;; indent to just after the surrounding open. -;; (goto-char containing-sexp) -;; (let ((bol (save-excursion (beginning-of-line) (point)))) - -;; ;; modified by shiba@isac 7.3.1992 -;; (cond ((and (numberp ess-expression-offset) -;; (re-search-backward "[ \t]*expression[ \t]*" bol t)) -;; ;; This regexp match every "expression". -;; ;; modified by shiba -;; ;;(forward-sexp -1) -;; (beginning-of-line) -;; (skip-chars-forward " \t") -;; ;; End -;; (+ (current-column) ess-expression-offset)) -;; ((and (numberp ess-arg-function-offset) -;; (re-search-backward -;; "=[ \t]*\\s\"*\\(\\w\\|\\s_\\)+\\s\"*[ \t]*" -;; bol -;; t)) -;; (forward-sexp -1) -;; (+ (current-column) ess-arg-function-offset)) -;; ;; "expression" is searched before "=". -;; ;; End - -;; (t -;; (progn (goto-char (1+ containing-sexp)) -;; (current-column)))))) -;; (t -;; ;; Statement level. Is it a continuation or a new statement? -;; ;; Find previous non-comment character. -;; (goto-char indent-point) -;; (ess-backward-to-noncomment containing-sexp) -;; ;; Back up over label lines, since they don't -;; ;; affect whether our line is a continuation. -;; (while (eq (preceding-char) ?\,) -;; (ess-backward-to-start-of-continued-exp containing-sexp) -;; (beginning-of-line) -;; (ess-backward-to-noncomment containing-sexp)) -;; ;; Now we get the answer. -;; (if (ess-continued-statement-p) -;; ;; This line is continuation of preceding line's statement; -;; ;; indent ess-continued-statement-offset more than the -;; ;; previous line of the statement. -;; (progn -;; (ess-backward-to-start-of-continued-exp containing-sexp) -;; (+ ess-continued-statement-offset (current-column) -;; (if (save-excursion (goto-char indent-point) -;; (skip-chars-forward " \t") -;; (eq (following-char) ?{)) -;; ess-continued-brace-offset 0))) -;; ;; This line starts a new statement. -;; ;; Position following last unclosed open. -;; (goto-char containing-sexp) -;; ;; Is line first statement after an open-brace? -;; (or -;; ;; If no, find that first statement and indent like it. -;; (save-excursion -;; (forward-char 1) -;; (while (progn (skip-chars-forward " \t\n") -;; (looking-at "//")) -;; ;; Skip over comments following openbrace. -;; (forward-line 1)) -;; ;; The first following code counts -;; ;; if it is before the line we want to indent. -;; (and (< (point) indent-point) -;; (current-column))) -;; ;; If no previous statement, -;; ;; indent it relative to line brace is on. -;; ;; For open brace in column zero, don't let statement -;; ;; start there too. If ess-indent-offset is zero, -;; ;; use ess-brace-offset + ess-continued-statement-offset instead. -;; ;; For open-braces not the first thing in a line, -;; ;; add in ess-brace-imaginary-offset. -;; (+ (if (and (bolp) (zerop ess-indent-offset)) -;; (+ ess-brace-offset ess-continued-statement-offset) -;; ess-indent-offset) -;; ;; Move back over whitespace before the openbrace. -;; ;; If openbrace is not first nonwhite thing on the line, -;; ;; add the ess-brace-imaginary-offset. -;; (progn (skip-chars-backward " \t") -;; (if (bolp) 0 ess-brace-imaginary-offset)) -;; ;; If the openbrace is preceded by a parenthesized exp, -;; ;; move to the beginning of that; -;; ;; possibly a different line -;; (progn -;; (if (eq (preceding-char) ?\)) -;; (forward-sexp -1)) -;; ;; Get initial indentation of the line we are on. -;; (current-indentation)))))))))) - - - - -(defvar OMG-syntax-table nil "Syntax table for Omegahat code.") -(if S-syntax-table - nil - (setq S-syntax-table (make-syntax-table)) - (modify-syntax-entry ?\\ "\\" S-syntax-table) - (modify-syntax-entry ?+ "." S-syntax-table) - (modify-syntax-entry ?- "." S-syntax-table) - (modify-syntax-entry ?= "." S-syntax-table) - (modify-syntax-entry ?% "." S-syntax-table) - (modify-syntax-entry ?< "." S-syntax-table) - (modify-syntax-entry ?> "." S-syntax-table) - (modify-syntax-entry ?& "." S-syntax-table) - (modify-syntax-entry ?| "." S-syntax-table) - (modify-syntax-entry ?\' "\"" S-syntax-table) - ;;FIXME: This fails (warning in compilation): - ;;F "//" are 2 characters; ?// is invalid - ;;F NEXT LINE IS BOGUS IN XEMACS, AJR - ;;F (modify-syntax-entry ?// "<" S-syntax-table) ; open comment - ;;F (modify-syntax-entry ?\n ">" S-syntax-table) ; close comment - ;;(modify-syntax-entry ?. "w" S-syntax-table) ; "." used in S obj names - (modify-syntax-entry ?. "_" S-syntax-table) ; see above/below, - ; plus consider separation. - (modify-syntax-entry ?$ "_" S-syntax-table) ; foo.bar$hack is 1 symbol - (modify-syntax-entry ?_ "." S-syntax-table) - (modify-syntax-entry ?* "." S-syntax-table) - (modify-syntax-entry ?< "." S-syntax-table) - (modify-syntax-entry ?> "." S-syntax-table) - (modify-syntax-entry ?/ "." S-syntax-table)) - - -(defvar OMG-editing-alist - '((paragraph-start . (concat "^$\\|" page-delimiter)) - (paragraph-separate . (concat "^$\\|" page-delimiter)) - (paragraph-ignore-fill-prefix . t) - (require-final-newline . mode-require-final-newline) - (comment-start . "//") - (comment-start-skip . "//+ *") - (comment-column . 40) - ;;(comment-indent-function . 'S-comment-indent) - ;;(ess-comment-indent . 'S-comment-indent) - ;;(ess-indent-line . 'S-indent-line) - ;;(ess-calculate-indent . 'ess-calculate-indent) - (indent-line-function . 'ess-indent-line) - (parse-sexp-ignore-comments . t) - (ess-style . ess-default-style) - (ess-local-process-name . nil) - ;;(ess-keep-dump-files . 'ask) - (ess-mode-syntax-table . S-syntax-table) - (font-lock-defaults . '(ess-OMG-font-lock-defaults - nil nil ((?\. . "w"))))) - "General options for Omegahat source files.") - -(defvar ess-OMG-font-lock-defaults - (append (list - (cons "\\b[0-9]+\\b" 'font-lock-type-face) ; numbers - (cons (regexp-opt ess-S-keywords 'words) 'font-lock-keyword-face)) - (list - (cons (regexp-opt ess-S-assign-ops) - 'font-lock-constant-face) ; assign - (cons (regexp-opt ess-S-constants 'words) - 'font-lock-type-face) ; constants - (cons (regexp-opt ess-S-modifiers 'words) - 'font-lock-constant-face) ; modify search list or source - - (cons ess-S-function-name-regexp - '(1 font-lock-function-name-face keep)) - ; function name - (cons "\\s.\\|\\s(\\|\\s)" 'font-lock-function-name-face) - ;punctuation and parents (same as function not to cause vidual disturbance) - )) ; keywords - "Font-lock patterns used in `OMG' buffers.") - - -;;; Changes from S to S-PLUS 3.x. (standard S3 should be in ess-s-lang.el !). - -(defconst OMG-help-sec-keys-alist - '((?a . "ARGUMENTS:") - (?b . "BACKGROUND:") - (?B . "BUGS:") - (?d . "DESCRIPTION:") - (?D . "DETAILS:") - (?e . "EXAMPLES:") - (?n . "NOTE:") - (?O . "OPTIONAL ARGUMENTS:") - (?R . "REQUIRED ARGUMENTS:") - (?r . "REFERENCES:") - (?s . "SEE ALSO:") - (?S . "SIDE EFFECTS:") - (?u . "USAGE:") - (?v . "VALUE:")) - "Alist of (key . string) pairs for use in section searching.") -;;; `key' indicates the keystroke to use to search for the section heading -;;; `string' in an S help file. `string' is used as part of a -;;; regexp-search, and so specials should be quoted. - -(defconst ess-help-OMG-sec-regex "^[A-Z. ---]+:$" - "Reg(ular) Ex(pression) of section headers in help file") - -;;; S-mode extras of Martin Maechler, Statistik, ETH Zurich. - -;;>> Moved things into --> ./ess-utils.el - -(provide 'ess-omg-l) - -;;; ess-omg-l.el ends here diff --git a/elpa/ess-20181109.703/ess-r-gui.el b/elpa/ess-20181109.703/ess-r-gui.el deleted file mode 100644 index cebdc69f..00000000 --- a/elpa/ess-20181109.703/ess-r-gui.el +++ /dev/null @@ -1,207 +0,0 @@ -;;; ess-r-gui.el --- Run Rgui on Windows as an inferior Emacs process - -;; Copyright (C) 2008 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: Richard M. Heiberger -;; Created: 10 Mar 2008 -;; Maintainer: ESS-core - -;; This file is part of ESS - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; In Rgui: -;; > library(tcltk2) ## >= 1.0-6 -;; > .ess.command <- function() source("c:/temp/ess-tempfile.R", echo=TRUE) -;; > tclFun(.ess.command) -;; [1] "R_call 0203A04C" - -;;; Code: - -(require 'ess-dde) ;; needed here because we override several definitions -(require 'ess-r-mode) - -(defun ess-ddeclient-p () - "Returns the name of the ddeclient iff `ess-local-process-name' -is associated with an `inferior-ess-ddeclient', and nil if the -ess-process is running as an ordinary inferior process. Alway -nil on Unix machines." - (interactive) - (if ess-microsoft-p - (let ((ess-ddeclient (ess-get-process-variable 'inferior-ess-ddeclient))) - (if (not (equal ess-ddeclient (default-value 'inferior-ess-ddeclient))) - ess-ddeclient)))) - -(defvar ess-command-file "c:/temp/ess-tempfile.R" - "File name for communication with Rgui.") -(defvar inferior-ess-execdde - (concat (getenv "R_HOME") "/site-library/tcltk2/bin/execdde.exe") - "Full pathname to execdde executable.") -(defvar ess-rgui-command " -s TclEval -t R -c .ess.command > NUL" - "Command to `inferior-ess-execdde' that will make Rgui read the command file.") - - -(defun ess-eval-region-execdde (start end even-empty) - "Loop through lines in region and send them to ESS via execdde." - (setq ;; set the following variables for the current ddeESS process. - inferior-ess-ddeclient (ess-get-process-variable 'inferior-ess-ddeclient) - ) - (write-region start end ess-command-file nil nil 'no-message) - (call-process-shell-command - (concat inferior-ess-execdde ess-rgui-command)) - ) - - -(if (not (getenv "R_HOME")) (setenv "R_HOME" "c:/progra~1/R/R-2.6.1")) -;; ^^^^^^^^^ FIXME! do something better -(defvar inferior-Rgui-program "cmd" "Rgui program name") -(defvar Rgui-pager "emacsclientw.exe" "Rgui pager program") -(defvar inferior-ess-language-start-rgui - "options(chmhelp=FALSE, htmlhelp=FALSE, help_type='text'); require(tcltk2)" - "additional arguments to rgui") - -(defun ess-dde-rgui-send-region (proc start end &optional visibly message) - "Loop through lines in region and send them to ESS via ddeclient. - -PROC, VISIBLY and MESSAGE are ignored." - (setq ;; set the following variables for the current ddeESS process. - inferior-ess-ddeclient (ess-get-process-variable 'inferior-ess-ddeclient) - inferior-ess-client-name (ess-get-process-variable 'inferior-ess-client-name) - inferior-ess-client-command (ess-get-process-variable 'inferior-ess-client-command)) - (narrow-to-region start end) - (goto-char (point-min)) - - (if (equal inferior-ess-ddeclient "execdde") - (ess-eval-region-execdde start end 'even-empty) - - (let ((beg)) - (while (or (< (point) (point-max)) - (= 1 (point-max))) - (setq beg (point)) - (end-of-line) - ;; call-process-region won't send over a 0-character line. - ;; We go outside the loop to create a 1-character line " " in the - ;; *ESS-temporary* buffer - (if (= beg (point)) ;; do empty line outside loop - (ess-dde-eval-linewise " " nil 'eob t) - (call-process-region - beg (point) - inferior-ess-ddeclient nil nil nil - inferior-ess-client-name inferior-ess-client-command)) - (forward-line 1)))) - (widen)) - - - -(defvar Rgui-customize-alist - (append - '((ess-local-customize-alist . 'Rgui-customize-alist) - (ess-dialect . "R") - (ess-suffix . "R") - (ess-dump-filename-template . (replace-regexp-in-string - "S$" ess-suffix ; in the one from custom: - ess-dump-filename-template-proto)) - (ess-mode-syntax-table . ess-r-syntax-table) - (ess-mode-editing-alist . ess-r-editing-alist) - (ess-change-sp-regexp . ess-r-change-sp-regexp) - (ess-help-sec-regex . ess-help-r-sec-regex) - (ess-help-sec-keys-alist . ess-help-r-sec-keys-alist) - (ess-function-pattern . ess-r-function-pattern) - (ess-object-name-db-file . "ess-r-namedb.el" ) - (ess-send-region-function . #'ess-dde-rgui-send-region) - (ess-load-file-function . #'ess-dde-load-file) - (ess-command-function . #'ess-dde-command) - (ess-eval-linewise-function . #'ess-dde-eval-linewise) - (ess-dump-object-function . #'ess-dde-dump-object) - (ess-read-object-name-function . #'ess-dde-read-object-name) - (ess-find-help-file-function . #'ess-dde-find-help-file) - (ess-display-help-on-object-function . #'ess-dde-display-help-on-object) - (inferior-ess-program . inferior-Rgui-program) - (inferior-ess-objects-command . inferior-ess-r-objects-command) - (inferior-ess-font-lock-keywords . 'inferior-ess-r-font-lock-keywords) - (inferior-ess-search-list-command . "search()\n") - (inferior-ess-help-command . "help(\"%s\")\n") - (inferior-ess-help-filetype . nil) ;; "chm") ;;? - (inferior-ess-exit-command . "q()") - (inferior-ess-exit-prompt . "Save workspace image? [y/n/c]: ") - (inferior-ess-primary-prompt . "\\([A-Z/][][A-Za-z0-9./]*\\)*[>$] ") - (inferior-ess-secondary-prompt . "+ ?") - ;;harmful for shell-mode's C-a: -- but "necessary" for ESS-help? - (inferior-ess-start-file . nil) ;; "~/.ess-R" - (inferior-ess-start-args . "") - (inferior-ess-ddeclient . "execdde") - (ess-STERM . "ddeSS") - (ess-editor . ess-r-editor) - (ess-pager . Rgui-pager) - ) - S-common-cust-alist) - "Variables to customize for Rgui") - - -(defun Rgui (&optional proc-name) - "Call 'Rgui for Windows'. Put R in an independent MS-Window (R -persists even if the '(ddeESS [R])' window is killed in emacs). -Do this by creating a comint process that calls cmd. This is a -placeholder buffer with mode '(ddeESS [R])'. Commands sent from -an (ESS[S] [R]) buffer to this process will be sourced into the -independent Rgui R Console." - (interactive) - (save-excursion - (setq ess-customize-alist Rgui-customize-alist) - (ess-write-to-dribble-buffer - (format "\n(Rgui): ess-dialect=%s, buf=%s\n" ess-dialect - (current-buffer))) - (setq ess-customize-alist ; change inferior-ess-primary-prompt - (append ess-customize-alist '((inferior-ess-primary-prompt . "^")))) - (when - ;; Silence byte compiler warns about this function - (fboundp 'w32-short-file-name) - (let ((default-ddeclient (default-value 'inferior-ess-ddeclient))) - (cd (w32-short-file-name (directory-file-name default-directory))) - ;; (setenv "S_PROJ" default-directory) - (setq-default inferior-ess-ddeclient "execdde") - (inferior-ess) - (setq-default inferior-ess-ddeclient default-ddeclient) - (sleep-for 2) ; need to wait, else working too fast! - )) - (setq comint-process-echoes nil) - - ;; *R* buffer - (goto-char (point-min)) - (insert - "This is a placeholder buffer. You can't type anything here.\n -You may ignore the 'options' error in this buffer.\n\n") - (goto-char (point-max)) - (set-process-coding-system (get-process ess-local-process-name) 'raw-text-dos 'raw-text-unix) - (setq buffer-read-only t) ; force buffer to be read-only - (setq mode-name "ddeESS") - - ;; initialization - (set-buffer (find-file-noselect ess-command-file 'nowarn)) - (erase-buffer) - (setq ;; set the following variables for the current ddeESS process. - inferior-ess-language-start (ess-get-process-variable 'inferior-ess-language-start)) - (if inferior-ess-language-start - (insert inferior-ess-language-start)) - (if inferior-ess-language-start-rgui - (insert (concat "\n" inferior-ess-language-start-rgui))) - (save-buffer 0) - (call-process-shell-command - (concat inferior-ess-execdde ess-rgui-command)) - )) - -;;; ess-r-gui.el ends here diff --git a/elpa/ess-20181109.703/ess-rdired.el b/elpa/ess-20181109.703/ess-rdired.el deleted file mode 100644 index 90517c7b..00000000 --- a/elpa/ess-20181109.703/ess-rdired.el +++ /dev/null @@ -1,501 +0,0 @@ -;;; ess-rdired.el --- prototype object browser for R, looks like dired mode. - -;; Copyright (C) 2002--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: Stephen Eglen -;; Created: Thu 24 Oct 2002 -;; Maintainer: ESS-core - -;; This file is part of ESS - -;; This file is not part of GNU Emacs. - -;; ess-rdired.el is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; ess-rdired.el is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;; This provides a dired-like buffer for R objects. Instead of -;; operating on files, we operate on R objects in the current -;; environment. Objects can be viewed, edited, deleted, plotted and -;; so on. - -;;; Commentary: - -;; Installation and usage. -;; -;; After loading this file, do "M-x R" to start an R session, then -;; create a few variables: -;; s <- sin(seq(from=0, to=8*pi, length=100)) -;; x <- c(1, 4, 9) -;; y <- rnorm(20) -;; z <- TRUE - -;; Then in Emacs, do "M-x ess-rdired" and you should see the following in -;; the buffer *R dired*: -;; mode length -;; s numeric 100 -;; x numeric 3 -;; y numeric 20 -;; z logical 1 - -;; Type "?" in the buffer to see the documentation. e.g. when the -;; cursor is on the line for `s', type 'p' to plot it, or `v' to view -;; its contents in a buffer. Then type 'd' to mark it for deletion. - -;; How it works. - -;; Most of the hardwork is done by the R routine .rdired.objects(), -;; which, when called, produces the list of objects in a tidy format. -;; This function is stored within the Lisp variable `ess-rdired-objects', -;; and can be altered to provide other information if you so need it. -;; (Martin Maechler suggested providing output from str() here.) - -;; Todo - compare functionality with ess-mouse-me (ess-mous.el). - -;; Todo - How to select alternative environments? Currently only -;; shows objects in the .GlobalEnv? See BrowseEnv() in 1.6.x for way -;; of browsing other environments. - -;; Todo - problem with fix -- have to wait for fix() command to return -;; before *R* buffer can be used again. This can get stuck, umm. not -;; sure what is going wrong here. Maybe add a hook to the temp buffer -;; so that when buffer is killed, we send an instruction to R to -;; update the value of the variable to the contents of the buffer. -;; This way *R* doesn't have to wait. - -;; Todo - small bug in .rdired.objects -- if we have a variable called -;; `my.x', its value is replaced by the value of my.x used in the -;; sapply() calls within .rdired.objects(). - -;;; Code: - -(require 'ess-custom) -(require 'ess-inf) - -(defvar ess-rdired-objects "{.rdired.objects <- function(objs) { - if (length(objs)==0) { - \"No objects to view!\" - } else { - mode <- sapply(objs, function(my.x) { - eval( parse( text=sprintf('data.class(get(\"%s\"))', my.x))) }) - length <- sapply(objs, function(my.x) { - eval( parse( text=sprintf('length(get(\"%s\"))', my.x))) }) - size <- sapply(objs, function(my.x) { - eval( parse( text=sprintf('format(object.size(get(\"%s\")), units=\"auto\")', my.x))) }) - d <- data.frame(mode, length, size) - - var.names <- row.names(d) - - ## If any names contain spaces, we need to quote around them. - quotes = rep('', length(var.names)) - spaces = grep(' ', var.names) - if (any(spaces)) - quotes[spaces] <- '\"' - var.names = paste(quotes, var.names, quotes, sep='') - row.names(d) <- paste(' ', var.names, sep='') - d - } -}; cat('\n'); print(.rdired.objects(ls()))}\n" - "Function to call within R to print information on objects. -The last line of this string should be the instruction to call -the function which prints the output for rdired.") - -(defvar ess-rdired-buffer "*R dired*" - "Name of buffer for displaying R objects.") - -(defvar ess-rdired-mode-map - (let ((ess-rdired-mode-map (make-sparse-keymap))) - (if (require 'hide-lines nil t) - (define-key ess-rdired-mode-map "/" 'hide-lines)) - (define-key ess-rdired-mode-map "?" 'ess-rdired-help) - (define-key ess-rdired-mode-map "d" 'ess-rdired-delete) - (define-key ess-rdired-mode-map "u" 'ess-rdired-undelete) - (define-key ess-rdired-mode-map "x" 'ess-rdired-expunge) - ;; editing requires a little more work. - ;;(define-key ess-rdired-mode-map "e" 'ess-rdired-edit) - (define-key ess-rdired-mode-map "v" 'ess-rdired-view) - (define-key ess-rdired-mode-map "V" 'ess-rdired-View) - (define-key ess-rdired-mode-map "p" 'ess-rdired-plot) - (define-key ess-rdired-mode-map "s" 'ess-rdired-sort) - (define-key ess-rdired-mode-map "r" 'ess-rdired-reverse) - (define-key ess-rdired-mode-map "q" 'ess-rdired-quit) - (define-key ess-rdired-mode-map "y" 'ess-rdired-type) ;what type? - (define-key ess-rdired-mode-map " " 'ess-rdired-next-line) - (define-key ess-rdired-mode-map [backspace] 'ess-rdired-previous-line) - (define-key ess-rdired-mode-map "\C-n" 'ess-rdired-next-line) - (define-key ess-rdired-mode-map "\C-p" 'ess-rdired-previous-line) - ;; (define-key ess-rdired-mode-map "n" 'ess-rdired-next-line) - ;; (define-key ess-rdired-mode-map "p" 'ess-rdired-previous-line) - - ;; R mode keybindings. - (define-key ess-rdired-mode-map "\C-c\C-s" 'ess-rdired-switch-process) - (define-key ess-rdired-mode-map "\C-c\C-y" 'ess-switch-to-ESS) - (define-key ess-rdired-mode-map "\C-c\C-z" 'ess-switch-to-end-of-ESS) - - (define-key ess-rdired-mode-map [down] 'ess-rdired-next-line) - (define-key ess-rdired-mode-map [up] 'ess-rdired-previous-line) - (define-key ess-rdired-mode-map "g" 'revert-buffer) - (define-key ess-rdired-mode-map [mouse-2] 'ess-rdired-mouse-view) - ess-rdired-mode-map)) - -(defun ess-rdired-mode () - "Major mode for output from `ess-rdired'. -`ess-rdired' provides a dired-like mode for R objects. It shows the -list of current objects in the current environment, one-per-line. You -can then examine these objects, plot them, and so on. -\\{ess-rdired-mode-map}" - ;; (kill-all-local-variables) - (make-local-variable 'revert-buffer-function) - (setq revert-buffer-function 'ess-rdired-revert-buffer) - (use-local-map ess-rdired-mode-map) - (setq major-mode 'ess-rdired-mode) - (setq mode-name (concat "RDired " ess-local-process-name)) - (run-mode-hooks 'ess-rdired-mode-hook)) - -(defun ess-rdired-mode-hook nil - "Run upon entering `ess-rdired-mode'.") - -(defvar ess-rdired-sort-num nil) ;silence the compiler. -;; but see following defun -- maybe it should be buffer local. - -;;;###autoload -(defun ess-rdired () - "Run dired-like mode on R objects. -This is the main function. See documentation for `ess-rdired-mode' though -for more information!" - (interactive) - (let ((proc ess-local-process-name) - (buff (get-buffer-create ess-rdired-buffer))) - - (ess-command ess-rdired-objects buff) - (ess-setq-vars-local (symbol-value ess-local-customize-alist) buff) - - (with-current-buffer buff - (setq ess-local-process-name proc) - (ess-rdired-mode) - - ;; When definiting the function .rdired.objects(), a "+ " is printed - ;; for every line of the function definition; these are deleted - ;; here. - (goto-char (point-min)) - (delete-region (point-min) (1+ (point-at-eol))) - - ;; todo: not sure how to make ess-rdired-sort-num buffer local? - ;;(set (make-local-variable 'ess-rdired-sort-num) 2) - ;;(make-variable-buffer-local 'ess-rdired-sort-num) - (setq ess-rdired-sort-num 1) - (ess-rdired-insert-set-properties (save-excursion - (goto-char (point-min)) - (forward-line 1) - (point)) - (point-max)) - (setq buffer-read-only t) - ) - - (pop-to-buffer buff) - )) - - -(defun ess-rdired-object () - "Return name of object on current line. -Handle special case when object contains spaces." - (save-excursion - (beginning-of-line) - (forward-char 2) - - (cond ((looking-at " ") ; First line? - nil) - ((looking-at "\"") ; Object name contains spaces? - (let (beg) - (setq beg (point)) - (forward-char 1) - (search-forward "\"") - (buffer-substring-no-properties beg (point)))) - (t ;should be a regular object. - (let (beg) - (setq beg (point)) - (search-forward " ") ;assume space follows object name. - (buffer-substring-no-properties beg (1- (point)))))))) - -(defun ess-rdired-edit () - "Edit (fix) the object at point." - (interactive) - (let ((objname (ess-rdired-object))) - (ess-command (concat "edit(" objname ")\n")))) - -(defun ess-rdired-view () - "View the object at point." - (interactive) - (let ((objname (ess-rdired-object))) - (ess-execute (ess-rdired-get objname) - nil "R view" ))) - -(defun ess-rdired-get (name) - "Generate R code to get the value of the variable NAME. -This is complicated because some variables might have spaces in their names. -Otherwise, we could just pass the variable name directly to *R*." - (concat "get(" (ess-rdired-quote name) ")") - ) - -(defun ess-rdired-quote (name) - "Quote NAME if not already quoted." - (if (equal (substring name 0 1) "\"") - name - (concat "\"" name "\""))) - - -(defun ess-rdired-View () - "View the object at point in its own buffer. -Like `ess-rdired-view', but the object gets its own buffer name." - (interactive) - (let ((objname (ess-rdired-object))) - (ess-execute (ess-rdired-get objname) - nil (concat "R view " objname )))) - -(defun ess-rdired-plot () - "Plot the object on current line." - (interactive) - (let ((objname (ess-rdired-object))) - (ess-eval-linewise (format "plot(%s)" (ess-rdired-get objname))))) - -(defun ess-rdired-type () - "Run the mode() on command at point. -Named type because of similarity with the dired command bound to -y key." - (interactive) - (let ((objname (ess-rdired-object)) - ;; create a temp buffer, and then show output in echo area - (tmpbuf (get-buffer-create "**ess-rdired-mode**"))) - (if objname - (progn - (ess-command (concat "mode(" (ess-rdired-get objname) ")\n") - tmpbuf ) - (set-buffer tmpbuf) - (message (concat - objname ": " - (buffer-substring (+ 4 (point-min)) (1- (point-max))))) - (kill-buffer tmpbuf))))) - -(defun ess-rdired-delete (arg) - "Mark the current (or next ARG) objects for deletion. -If point is on first line, all objects are marked for deletion." - (interactive "p") - (ess-rdired-mark "D" arg)) - -(defun ess-rdired-undelete (arg) - "Unmark the current (or next ARG) objects. -If point is on first line, all objects will be unmarked." - (interactive "p") - (ess-rdired-mark " " arg)) - -(defun ess-rdired-mark (mark-char arg) - "Mark the object, using MARK-CHAR, on current line (or next ARG lines)." - ;; If we are on first line, mark all lines. - (let ((buffer-read-only nil) - move) - (if (eq (point-min) - (save-excursion (beginning-of-line) (point))) - (progn - ;; we are on first line, so make a note of point, and count - ;; how many objects we want to delete. Then at end of defun, - ;; restore point. - (setq move (point)) - (forward-line 1) - (setq arg (count-lines (point) (point-max))))) - (while (and (> arg 0) (not (eobp))) - (setq arg (1- arg)) - (beginning-of-line) - (progn - (insert mark-char) - (delete-char 1) - (forward-line 1))) - (if move - (goto-char move)))) - - -(defun ess-rdired-expunge () - "Delete the marked objects. -User is queried first to check that objects should really be deleted." - (interactive) - (let ((objs "rm(") - (count 0)) - (save-excursion - (goto-char (point-min)) (forward-line 1) - (while (< (count-lines (point-min) (point)) - (count-lines (point-min) (point-max))) - (beginning-of-line) - (if (looking-at "^D ") - (setq count (1+ count) - objs (concat objs (ess-rdired-object) ", " ))) - (forward-line 1) - )) - (if (> count 0) - ;; found objects to delete - (progn - (setq objs (concat - (substring objs 0 (- (length objs) 2)) - ")\n")) - (if (yes-or-no-p (format "Delete %d %s " count - (if (> count 1) "objects" "object"))) - (progn - (ess-eval-linewise objs nil nil nil 'wait) - (ess-rdired) - ))) - ;; else nothing to delete - (message "no objects set to delete") - ))) - -;; Fancy delete method, based on dired. Bit too much for our needs? -;; (defun ess-rdired-expunge () -;; "Delete the marked objects. -;; User is queried first to check that objects should really be deleted." -;; (interactive) -;; (let ((objs) -;; (cmd "rm(")) -;; (save-excursion -;; (goto-line 2) -;; (while (< (count-lines (point-min) (point)) -;; (count-lines (point-min) (point-max))) -;; (beginning-of-line) -;; (if (looking-at "^D ") -;; (progn -;; (setq objs (cons (ess-rdired-object) objs )) -;; (setq cmd (concat cmd (ess-rdired-object) ", ")) -;; )) -;; (forward-line 1) -;; )) -;; (if (> (length objs) 0) -;; ;; found objects to delete -;; (if -;; (dired-mark-pop-up "*RDired deletions*" 'delete -;; objs dired-deletion-confirmer -;; (format "delete %s " -;; (dired-mark-prompt nil objs))) -;; ;; should delete the objects. -;; (progn -;; (setq cmd (concat (substring cmd 0 (- (length cmd) 2)) -;; ")\n")) -;; (ess-command cmd) -;; (ess-rdired))) -;; ;; else nothing to delete -;; (message "no objects set to delete") -;; ))) - -(defun ess-rdired-quit () - "Quit the R dired buffer." - (interactive) - (kill-buffer ess-rdired-buffer)) - -(defun ess-rdired-revert-buffer (ignore noconfirm) - "Update the buffer list (in case object list has changed). -Arguments IGNORE and NOCONFIRM currently not used." - (ess-rdired)) - -(defun ess-rdired-help () - "Show help for `ess-rdired-mode'." - (interactive) - (describe-function 'ess-rdired-mode)) - -(defun ess-rdired-sort () - "Sort the rdired output according to one of the columns. -Rotate between the alternative sorting methods." - (interactive) - (setq ess-rdired-sort-num (1+ ess-rdired-sort-num)) - (let ((buffer-read-only nil) - (beg (save-excursion - (goto-char (point-min)) - (forward-line 1) - (point))) - (end (point-max))) - (if (> ess-rdired-sort-num 4) - (setq ess-rdired-sort-num 1)) - (cond ((eq ess-rdired-sort-num 1) - (sort-fields 1 beg end)) - ((eq ess-rdired-sort-num 2) - (sort-fields 2 beg end)) - ((eq ess-rdired-sort-num 3) - (sort-numeric-fields 3 beg end)) - ((eq ess-rdired-sort-num 4) - (sort-numeric-fields 4 beg end))))) - -(defun ess-rdired-reverse () - "Reverse the current sort order." - (interactive) - (let ((buffer-read-only nil) - (beg (save-excursion - (goto-char (point-min)) - (forward-line 1) - (point))) - (end (point-max))) - (reverse-region beg end))) - -(defun ess-rdired-next-line (arg) - "Move down lines then position at object. -Optional prefix ARG says how many lines to move; default is one line." - (interactive "p") - (forward-line arg) - (ess-rdired-move-to-object)) - -(defun ess-rdired-previous-line (arg) - "Move up lines then position at object. -Optional prefix ARG says how many lines to move; default is one line." - (interactive "p") - (forward-line (- (or arg 1))) ; -1 if arg was nil - (ess-rdired-move-to-object)) - -(defun ess-rdired-move-to-object () - "Put point at start of object." - (beginning-of-line) - (forward-char 2) - ) - -(defun ess-rdired-mouse-view (event) - "In rdired, visit the object on the line you click on." - (interactive "e") - (let (window pos) - (save-excursion - (setq window (posn-window (event-end event)) - pos (posn-point (event-end event))) - (if (not (windowp window)) - (error "No file chosen")) - (set-buffer (window-buffer window)) - (goto-char pos) - (ess-rdired-view)))) - -(defun ess-rdired-insert-set-properties (beg end) - "Add mouse highlighting to each object name in the R dired buffer." - (save-excursion - (goto-char beg) - (while (< (point) end) - (ess-rdired-move-to-object) - (add-text-properties - (point) - (save-excursion - (search-forward " ") - (1- (point))) - '(mouse-face highlight - help-echo "mouse-2: view object in other window")) - (forward-line 1)))) - -(defun ess-rdired-switch-process () - "Switch to examine different *R* process. -If you have multiple R processes running, e.g. *R*, *R:2*, *R:3*, you can -use this command to choose which R process you would like to examine. -After switching to a new process, the buffer is updated." - (interactive) - (ess-switch-process) - (ess-rdired)) - -(provide 'ess-rdired) - -;;; ess-rdired.el ends here diff --git a/elpa/ess-20181109.703/ess-s3-d.el b/elpa/ess-20181109.703/ess-s3-d.el deleted file mode 100644 index 34056da3..00000000 --- a/elpa/ess-20181109.703/ess-s3-d.el +++ /dev/null @@ -1,79 +0,0 @@ -;;; ess-s3-d.el --- S 3 (AT&T version) customization - -;; Copyright (C) 1997 A. J. Rossini -;; Copyright (C) 1998--2005 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: A.J. Rossini -;; Created: 12 Jun 1997 -;; Maintainer: ESS-core - -;; Keywords: languages - -;; This file is part of ESS. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; This file defines all the S 3 customizations for ess-mode. - -;;; Code: - -(require 'ess-s-lang) - -(defvar S3-customize-alist - (append - '((ess-local-customize-alist . 'S3-customize-alist) - (ess-dialect . "S3") - (ess-change-sp-regexp . ess-S-change-sp-regexp) - (ess-help-sec-keys-alist . ess-help-S3-sec-keys-alist) - (ess-object-name-db-file . "ess-s3-namedb.el" ) - (inferior-ess-program . inferior-S3-program) ; "S") - (inferior-ess-help-command . "help(\"%s\")\n") - (inferior-ess-help-filetype . nil) - (inferior-ess-search-list-command . "search()\n") - (inferior-ess-objects-command . "objects(%d)\n") - (inferior-ess-start-file . nil) ;"~/.ess-S3") - (inferior-ess-start-args . "") - (ess-STERM . "iESS") - ) - S+common-cust-alist); use S+ ones here; partly overwritten above!! - - "Variables to customize for S3") - -(defun S3 (&optional proc-name) - "Call 'S 3.x', the version from AT&T." - (interactive) - (setq ess-customize-alist S3-customize-alist) - (ess-write-to-dribble-buffer - (format "\n(S3): ess-dialect=%s, buf=%s\n" ess-dialect (current-buffer))) - (inferior-ess) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start))) - - -(defun S3-mode (&optional proc-name) - "Major mode for editing S3 source. See `ess-mode' for more help." - (interactive) - (setq ess-customize-alist S3-customize-alist) - (ess-mode S3-customize-alist proc-name) - (if ess-imenu-use-S (ess-imenu-S))) - - - ; Provide package - -(provide 'ess-s3-d) - -;;; ess-s3-d.el ends here diff --git a/elpa/ess-20181109.703/ess-s4-d.el b/elpa/ess-20181109.703/ess-s4-d.el deleted file mode 100644 index 71a12679..00000000 --- a/elpa/ess-20181109.703/ess-s4-d.el +++ /dev/null @@ -1,277 +0,0 @@ -;;; ess-s4-d.el --- S4 customization - -;; Copyright (C) 1997--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: A.J. Rossini -;; Created: 12 Jun 1997 -;; Maintainer: ESS-core - -;; Keywords: languages - -;; This file is part of ESS. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - - -;;; Commentary: - -;; DB contributed the changes from ess-s3-d.el to -;; ess-s4-d.el (removed the old ugly approach). -;; This file defines S4 customizations for ess-mode. Lots of thanks -;; to RMH and JMC for code and suggestions - -;;; Code: - -(require 'ess-s-lang) - -;; Some of this is based on files from: -;; Copyright (C) 1996, John M. Chambers. - -(defvar S4-customize-alist - (append - '((ess-local-customize-alist . 'S4-customize-alist) - (ess-dialect . "S4") - (ess-change-sp-regexp . ess-S-change-sp-regexp) - (ess-help-sec-keys-alist . ess-help-S3-sec-keys-alist) - (ess-object-name-db-file . "ess-s4-namedb.el") - (inferior-ess-program . inferior-S4-program) - (inferior-ess-objects-command . ".SmodeObs(%d, pattern=\"%s\")\n") - ;;(inferior-ess-objects-pattern . ".*") ; for new s4 stuff - (inferior-ess-help-command . "help(\"%s\")\n") - (inferior-ess-help-filetype . nil) - (inferior-ess-search-list-command . ".SmodePaths()\n") - (ess-load-command . ".SmodeLoad(\"%s\")\n") - (inferior-ess-dump-command . ".SmodeDump(\"%s\", \"%s\")\n") - - (inferior-ess-start-file . nil) ;"~/.ess-S3") - (inferior-ess-start-args . "") - (ess-STERM . "iESS") - ) - S+common-cust-alist); use S+ ones here; partly overwritten above!! - - "Variables to customize for S4.") - -;; For loading up the S code required for the above. -;;(add-hook 'ess-post-run-hook -;; (lambda () -;; (ess-command -;; (concat -;; "if(exists(\"Sversion\")) library(emacs) else source(\"" -;; ess-mode-run-file -;; "\")\n")) -;; (if ess-mode-run-file2 -;; (ess-command -;; (concat "source(\"" ess-mode-run-file2 "\")\n"))))) - - -(defun S4 () - "Call 'S version 4', from Bell Labs. New way to do it." - (interactive) - (setq ess-customize-alist S4-customize-alist) - (ess-write-to-dribble-buffer - (format "\n(S4): ess-dialect=%s, buf=%s\n" ess-dialect (current-buffer))) - (inferior-ess) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start))) - - -(defun S4-mode (&optional proc-name) - "Major mode for editing S4 source. See `ess-mode' for more help." - (interactive) - (setq ess-customize-alist S4-customize-alist) - (ess-mode S4-customize-alist proc-name) - (if ess-imenu-use-S (ess-imenu-S))) - - -;; From RMH: ALL THIS SHOULD BE INCORPORATED BY 5.0! - -;;; s4.el startup file -;;; Richard M. Heiberger -;;; rmh@temple.edu -;; -;;(load "S") -;;(setq inferior-S-program "/disk05/s4/betaJun96/S") -;;(setq S-plus nil) ;; needed for non S-plus -;;(add-to-list 'load-path "/disk05/s4/betaJun96") ;; S-namedb.el is here -;;(S) -;;(load-file "/disk05/s4/betaJun96/library/emacs/S-modeadds.el") ;; must come after (S) -;; -;; -;;;;; S4 __Help, no longer S3 .Help -;;(load "S-help") -;; ;; Must follow S-help -;;; S-help.file line 270 -;;(defun S-get-help-files-list nil -;; (mapcar 'list -;; (apply 'append -;; (mapcar (lambda (dirname) -;; (if (file-directory-p dirname) -;; (directory-files dirname))) -;; (mapcar (lambda (str) (concat str "/__Help")) -;; (S-search-list)))))) -;; -;; -;;;;; additional font-lock-keywords for S4 -;; -;;;;*;; based on S-inf.el line 107 -;;;;(add-to-list 'S-inf-font-lock-keywords -;;;; '("\\<\\(^Problem\\|^Warning\\|^Error\\|Debug ?\\|Browsing in frame of\\|Local Variables\\)\\>" . font-lock-reference-face) ; S-inf problems -;;;;) -;;;;(add-to-list 'S-inf-font-lock-keywords -;;;; '("^R>" . font-lock-keyword-face) ; debug prompt -;;;;) -;;(inferior-S-mode) -;; -;;; S-inf.el line 150 -;;(setq inferior-S-search-list-command "searchPaths()\n") -;; -;;;; fontify S-transcript-mode -;;;; overwrites S-trans.el lines 60-69 -;;;;(setq S-trans-font-lock-keywords S-inf-font-lock-keywords) -;; -;;(load "S-mode") -;; ;; Must follow S-mode -;;;;*;; based on S-mode.el line 219 -;;(add-to-list 'S-mode-font-lock-keywords -;; '("\\<\\(setGeneric\\|removeGeneric\\|setMethod\\|unsetMethod\\|setReplaceGeneric\\|setReplaceMethod\\|standardGeneric\\|setIs\\|setClass\\|representation\\)\\>" . font-lock-function-name-face) ; S4 method functions -;;) -;; -;; -;; -;;;;; fix to S-load-file to make C-c C-l work with S4 -;; -;;;When a file sourced into S4 by C-c C-l has a syntax error -;;;without the following changes, the system -;;;freezes until it is released with ^G. The reason is that the error -;;;messages, including the `Debug ?' request, go to the *S-errors* -;;;buffer. The *S-errors* buffer is not switched to, and couldn't accept -;;;a response if it were. -;;; -;;;The fix requires three modification to S-inf.el and two to S-mode.el. -;;;The correction to S-check-source noted in smode.cmt is also necessary. -;;; -;; -;;; S-inf.el line 92 NEW variable -;;(defvar inferior-S-debug-prompt "Debug \\? (y|n): " -;; "The expression S uses to offer to initiate debug tracing.") -;; -;;; S-inf.el line 458 -;;(defun inferior-S-wait-for-prompt () -;; "Wait until the S process is ready for input." -;; (let* ((cbuffer (current-buffer)) -;; (sprocess (get-S-process S-current-process-name)) -;; (sbuffer (process-buffer sprocess)) -;; r -;; (timeout 0)) -;; (set-buffer sbuffer) -;; (while (progn -;; (if (not (eq (process-status sprocess) 'run)) -;; (S-error "S process has died unexpectedly.") -;; (if (> (setq timeout (1+ timeout)) S-loop-timeout) -;; (S-error "Timeout waiting for prompt. Check inferior-S-prompt or S-loop-timeout.")) -;; (accept-process-output) -;; (goto-char (point-max)) -;;(setq end (point)) -;; (beginning-of-line) -;;(setq e (buffer-substring (point) end)) -;;(if (equal e inferior-S-debug-prompt) -;; (S-error "Debug prompt")) -;; (setq r (looking-at inferior-S-prompt)) -;; (not (or r (looking-at ".*\\?\\s *")))))) -;; (goto-char (point-max)) -;; (set-buffer cbuffer) -;; (symbol-value r))) -;; -;; -;; -;;; S-mode.el line 204 -;;(setq S-dump-error-re "Problem") -;; -;;;; S-mode.el line 655 -;;(defun S-parse-errors (showerr) -;; "Jump to error in last loaded S source file. -;;With prefix argument, only shows the errors S reported." -;; (interactive "P") -;; (S-make-buffer-current) -;; (let ((errbuff (get-buffer S-error-buffer-name))) -;; (if (not errbuff) -;; (error "You need to do a load first!") -;; (set-buffer errbuff) -;; (goto-char (point-max)) -;; (if -;; (re-search-backward ", file \"" nil t) -;; (let* ((beg-pos (progn (re-search-forward "\"" nil t) (point))) -;; (end-pos (progn (re-search-forward "\"" nil t) (- (point) 1))) -;; (filename (buffer-substring beg-pos end-pos)) -;; (fbuffer (get-file-buffer filename)) -;; (linenum (string-to-number -;; (progn (re-search-backward "," nil t) -;; (current-word)))) -;; (end-pos (point)) -;; (beg-pos (progn (goto-char (point-min)) -;; (re-search-forward ":" nil t) -;; (1+ (point)))) -;; (errmess (buffer-substring beg-pos end-pos)) -;; ) -;; (if showerr -;; (S-display-temp-buffer errbuff) -;; (if fbuffer nil -;; (setq fbuffer (find-file-noselect filename)) -;; (save-excursion -;; (set-buffer fbuffer) -;; (S-mode))) -;; (pop-to-buffer fbuffer) -;; (goto-line linenum)) -;; (princ errmess t)) -;; (message "Not a syntax error.") -;; (S-display-temp-buffer errbuff))))) -;; -;; -;; -;;;; S-inf.el line 584 -;;(defun S-prompt-wait (proc &optional start-of-output) -;; "Wait for a prompt to appear at BOL of current buffer -;;PROC is the S process. Does not change point" -;; (if start-of-output nil (setq start-of-output (point-min))) -;; (save-excursion -;; (while (progn -;; ;; get output if there is some ready -;; (accept-process-output proc 0 500) -;; (goto-char (marker-position (process-mark proc))) -;; (beginning-of-line) -;; -;; (if (re-search-forward inferior-S-debug-prompt nil t) -;; (if (equal (get-buffer S-error-buffer-name) -;; (get-buffer S-error-buffer-name)) -;; (let* ((sprocess (get-S-process S-current-process-name)) -;; (sbuffer (process-buffer sprocess))) -;; (set-buffer sbuffer) -;; (process-send-string sprocess "n\n") -;; (accept-process-output sprocess) -;; (beginning-of-line); delete inferior-S-debug-prompt -;; (kill-line) -;; (insert "> "))) -;; -;; (if (< (point) start-of-output) (goto-char start-of-output)) -;; (not (looking-at inferior-S-primary-prompt))))))) -;; - - - - ; Provide package - -(provide 'ess-s4-d) - -;;; ess-s4-d.el ends here diff --git a/elpa/ess-20181109.703/ess-sp3-d.el b/elpa/ess-20181109.703/ess-sp3-d.el deleted file mode 100644 index a8438295..00000000 --- a/elpa/ess-20181109.703/ess-sp3-d.el +++ /dev/null @@ -1,85 +0,0 @@ -;;; ess-sp3-d.el --- S-PLUS 3.x customization - -;; Copyright (C) 1997--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: A.J. Rossini -;; Created: 12 Jun 1997 -;; Maintainer: ESS-core - -;; Keywords: languages - -;; This file is part of ESS. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; This file defines all the S-PLUS 3.x customizations for ess-mode. - -;;; Code: - -(require 'ess-s-lang) -(require 'ess-trns) - -(defvar S+3-dialect-name "S+3" - "Name of 'dialect' for S-PLUS 3.x.");easily changeable in a user's .emacs - -(defvar S+3-customize-alist - (append - '((ess-local-customize-alist . 'S+3-customize-alist) - (ess-dialect . S+3-dialect-name) - (ess-object-name-db-file . "ess-s+3-namedb.el" ) - (inferior-ess-program . inferior-S+3-program) - (inferior-ess-help-command . "help(\"%s\", pager=\"cat\", window=FALSE)\n") - (inferior-ess-help-filetype . nil) - (inferior-ess-search-list-command . "search()\n") - (inferior-ess-start-file . nil) ;"~/.ess-S+3") - (inferior-ess-start-args . "") - (ess-STERM . "iESS") - ) - S+common-cust-alist) - - "Variables to customize for S+3.") - - -(defun S+3 (&optional proc-name) - "Call 'S-PLUS 3.x', the 'Real Thing' from StatSci." - (interactive) - (setq ess-customize-alist S+3-customize-alist) - (ess-write-to-dribble-buffer - (format "\n(S+3): ess-dialect=%s, buf=%s\n" ess-dialect (current-buffer))) - (inferior-ess) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start))) - -(defun S+3-mode (&optional proc-name) - "Major mode for editing S+3 source. See `ess-mode' for more help." - (interactive) - (setq ess-customize-alist S+3-customize-alist) - (ess-mode S+3-customize-alist proc-name) - (if ess-imenu-use-S (ess-imenu-S))) - -(defun S+3-transcript-mode () - "S-PLUS 3.x transcript mode." - (interactive) - (ess-transcript-mode S+3-customize-alist)) - - - - ; Provide package - -(provide 'ess-sp3-d) - -;;; ess-sp3-d.el ends here diff --git a/elpa/ess-20181109.703/ess-sp4-d.el b/elpa/ess-20181109.703/ess-sp4-d.el deleted file mode 100644 index cf97e1ab..00000000 --- a/elpa/ess-20181109.703/ess-sp4-d.el +++ /dev/null @@ -1,419 +0,0 @@ -;;; ess-sp4-d.el --- S-PLUS 4.x customization - -;; Copyright (C) 1998--2002 Richard M. Heiberger -;; Copyright (C) 2003--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: Richard M. Heiberger -;; Created: December 1998 -;; Maintainer: ESS-core - -;; Keywords: languages - -;; This file is part of ESS. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; This file defines all the S-PLUS 4.x customizations for ess-mode -;; with ddeclient. - -;;; Code: - -;;; Requires and Autoloads: - -(require 'ess-mode) -(require 'ess-inf) -(require 'ess-s-lang) -(require 'ess-dde) -(require 'ess-trns) - -(defvar ess-S+-startup-delay) - -(defvar S+4-dialect-name "S+4" - "Name of 'dialect' for S-PLUS 4.x.");easily changeable in a user's .emacs - -(defvar inferior-S+4-multipleinstances "/MULTIPLEINSTANCES" - "Default \"/MULTIPLEINSTANCES\" opens up a new instance of S+4 in a -GUI window and connects it to the '(ddeESS [S+4])' window. The -alternative nil uses an existing S+4 GUI (if there is one) and -connects it to the '(ddeESS [S+4])' window.") - -(defvar S+4-customize-alist - (append - '((ess-local-customize-alist . 'S+4-customize-alist) - (ess-dialect . S+4-dialect-name) - (ess-object-name-db-file . "ess-sp4-namedb.el" ) - (inferior-ess-program . inferior-S+4-program) - (inferior-ess-help-command . "help(\"%s\")\n") - (inferior-ess-help-filetype . "chm") - - (ess-send-region-function . #'ess-dde-send-region) - (ess-load-file-function . #'ess-dde-load-file) - (ess-command-function . #'ess-dde-command) - (ess-eval-linewise-function . #'ess-dde-eval-linewise) - (ess-dump-object-function . #'ess-dde-dump-object) - (ess-read-object-name-function . #'ess-dde-read-object-name) - (ess-find-help-file-function . #'ess-dde-find-help-file) - (ess-display-help-on-object-function . #'ess-chm-display-help-on-object) - - (inferior-ess-start-file . nil) ;"~/.ess-S+4") - (inferior-ess-start-args . (concat - inferior-S+4-multipleinstances " " - inferior-S+4-print-command - " S_PROJ=" - (directory-file-name default-directory))) - ;; (inferior-ess-ddeclient . "ddeclient") - ;; (inferior-ess-client-name . "S-PLUS") - ;; (inferior-ess-client-command . "SCommand") - (ess-STERM . "ddeESS") - ) - S+common-cust-alist) - - "Variables to customize for S+4") - -(defvar Sqpe+4-customize-alist - (append - '((ess-local-customize-alist . 'Sqpe+4-customize-alist) - (ess-dialect . S+4-dialect-name) - (ess-loop-timeout . 500000 );fixme: dialect specific custom.v - (ess-object-name-db-file . "ess-sp4-namedb.el" ) - (ess-display-help-on-object-function . #'ess-chm-display-help-on-object) - (inferior-ess-program . inferior-Sqpe+4-program) - (inferior-ess-help-command . "help(\"%s\")\n") - (inferior-ess-help-filetype . "chm") - (inferior-ess-search-list-command . "searchPaths()\n") - (inferior-ess-start-file . nil) ;"~/.ess-S+4") - (inferior-ess-language-start . (concat - "options(" - "STERM='" ess-STERM "'" - (if ess-editor - (concat ", editor='" ess-editor "'")) - (if ess-pager - (concat ", pager='" ess-pager "'")) - ")")) - (ess-STERM . "iESS") - ) - S+common-cust-alist) - - "Variables to customize for Sqpe+4.") - - -;;; There are extra complications in S+4 (compared to S+3) because -;;; -;;; (1) The StatSci supplied Splus.exe doesn't work in an emacs -;;; buffer. It works as as a GUI window and we must send commands -;;; to it through ddeclient. Nonetheless, we need to give it a -;;; process name and be sure that that there is a valid running -;;; process in the '(ddeESS [S+4])' buffer. Therefore we create an -;;; ESS process in the buffer as a placeholder and start a shell -;;; in the ESS buffer. From the shell we start Splus. Once Splus -;;; finishes initializing and kills the original shell, we start -;;; another shell. We have a buffer-local variable -;;; inferior-ess-ddeclient, initialized to nil. When there is a -;;; non-nil value of inferior-ess-ddeclient we send lines to -;;; inferior-ess-ddeclient rather than to the Splus process. -;;; (2) There is no Splus process running in the '(ddeESS [S+4])' -;;; buffer. Therefore inferior-ess will never see a prompt, -;;; unless we first change it to the null prompt "^". Then once -;;; the process has started, we change it back. -;;; (3) When M-x S+4 starts Splus by a shell command, then Splus is an -;;; independent process and will be survive if the '(ddeESS [S+4])' -;;; buffer is killed (or emacs is quit). The '(ddeESS [S+4])' is -;;; made read-only and a warning is placed in it saying that "You -;;; can't type anything here." Actually, if the standalone Splus -;;; is killed and the '(ddeESS [S+4])' is made writable (C-x C-q), -;;; then '(ddeESS [S+4])' becomes a shell buffer. -;;; -(defun S+4 (&optional proc-name) - "Call 'S-PLUS 4.x', the 'GUI Thing' from StatSci. Put S-Plus in an -independent MS-Window (Splus persists even if the '(ddeESS [S+4])' -window is killed in emacs). Do this by creating a comint process that -calls sh. Send a shell command in that sh buffer to call Splus. When -it completes set up a shell as a placeholder in the '(ddeESS [S+4])' -buffer. The S-Plus options are correctly set. In particular, the -S-Plus Commands window is opened if the Options/General -Settings/Startup menu says it should be. There is a 30 second delay -during startup in which the screen will not be refreshed. This delay -is here to allow slow disks to start the Splus program." - (interactive) - (save-excursion - (setq ess-customize-alist S+4-customize-alist) - (ess-write-to-dribble-buffer - (format "\n(S+4): ess-dialect=%s, buf=%s\n" ess-dialect - (current-buffer))) - (setq ess-customize-alist ; change inferior-ess-program - (append ess-customize-alist '((inferior-ess-program . "sh")))) - (setq ess-customize-alist ; change inferior-ess-primary-prompt - (append ess-customize-alist '((inferior-ess-primary-prompt . "^")))) - (setq ess-customize-alist ; change inferior-ess-start-args - (append ess-customize-alist '((inferior-ess-start-args . "-i")))) - (let ((s-proj (getenv "S_PROJ")) - (manpath (getenv "MANPATH"))) - (if (fboundp 'w32-short-file-name) - (cd (w32-short-file-name (directory-file-name default-directory))) - (cd (directory-file-name default-directory))) - (setenv "S_PROJ" default-directory) - ;; I don't know why this PATH/MANPATH game is needed, - ;; except that it doesn't work without it. - (setenv "MANPATH" (getenv "PATH")) - (inferior-ess) - (sleep-for 2) ; need to wait, else working too fast! The Splus - ; command in '(ddeESS [S+4])' should follow the "$" - ; prompt. If not, then increase the sleep-for time! - (setenv "MANPATH" manpath) - (setenv "S_PROJ" s-proj)) - (setq ess-customize-alist S+4-customize-alist) - (ess-setq-vars-local ess-customize-alist) -;;; the next three lines belong in customize-alist, but can't be there -;;; because of the broken ess-setq-vars-default usage in ess-inf.el - (setq inferior-ess-ddeclient "ddeclient") - (setq inferior-ess-client-name "S-PLUS") - (setq inferior-ess-client-command "SCommand") -;;; end of what belongs in customize-alist - (setq comint-process-echoes nil) - (setq comint-input-sender 'comint-simple-send) - (goto-char (point-max)) - (insert (concat inferior-S+4-program " " - inferior-ess-start-args)) ; Note: there is no final "&". - ;; Without the "&", the results of !system.command come to '(ddeESS [S+4])' - ;; With the "&", the results of !system.command in S get lost. - (inferior-ess-send-input) - (sleep-for 30) ; Need to wait, else working too fast! - ; If the ess-current-process-name doesn't appear in the - ; Splus Commands window increase the sleep-for time! - (setq ess-local-process-name ess-current-process-name) - (ess-eval-linewise (concat "#" ess-current-process-name)) - (goto-char (point-min)) - (insert - "This is a placeholder buffer. You can't type anything here. -Use `C-x b RET' to return to your file.\n -Anything sent to this process from an S-mode buffer goes -directly to the associated Splus Commands window.\n -The S-Plus Commands window must be visible. -You may need to open the S-Plus Commands window manually (by clicking on -Splus/Window/Commands Window).\n -Any results of the !system.command typed at the S prompt in the -Splus Commands window appear in this buffer.\n\n") - (goto-char (point-max)) ; comint-mode-map makes '(ddeESS [S+4])' - ;; (use-local-map comint-mode-map) ;a shell buffer after Splus is finished. - (set-process-coding-system (get-process ess-local-process-name) 'raw-text-dos 'raw-text-unix) - (setq buffer-read-only t) ; force buffer to be read-only - (setq mode-name "ddeESS") - ;; (ess-eval-linewise inferior-S+4-editor-pager-command) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start)) - )) - - - - -(defun S+4-existing (&optional proc-name) - "Call 'S-PLUS 4.x', the 'GUI Thing' from StatSci. Do so by finding -an existing S-Plus in an independent MS-Window (if there is one) and -set up a '(ddeESS [S+4])' buffer in emacs. If there is no existing -S-Plus, then a new one will be opened in the default directory, -usually something like c:/Program Files/spls45se/users/yourname. -If you have a HOME environment variable, it will open it there." - (interactive) - (let* ((inferior-S+4-multipleinstances " & # ")) ; Note: there is a final "&". - ;; Without the "&", there is a core dump. - ;; With the "&", the results of !system.command in S get lost. - ;; We are picking up an existing S-Plus process for sending to. - ;; It doesn't know about us, so nothing comes back. - (S+4 proc-name)) - (with-current-buffer (car (buffer-list)) ; get the ESS buffer just created - (setq buffer-read-only nil) ; permit writing in ESS buffer - (goto-char (point-max)) - (beginning-of-line) - (forward-line -1) - (insert - "This is S+4-existing. -Results of the !system.command typed at the S prompt in the -Splus Commands window blink a DOS window and you won't see them.\n\n") - (setq buffer-read-only t) ; restore ESS buffer to be read-only - )) - - -;;; There are extra complications in Sqpe+4 (compared to S+3) because -;;; (1) The StatSci supplied Sqpe.exe won't work without SHOME as an -;;; environment variable and Sqpe does not take command line -;;; arguments and -;;; (2) Sqpe.exe comes up with options(interactive=F), which means it -;;; doesn't provide prompts by default, and we must change it to T so -;;; it will provide prompts. -;;; -(defun Sqpe+4 (&optional proc-name) - "Call 'Sqpe' from 'S-PLUS 4.x', the 'Real Thing' from StatSci." - (interactive) - (setq ess-customize-alist Sqpe+4-customize-alist) - (let* ((shome-nil-p (equal (getenv "SHOME") nil))) - (if shome-nil-p (setenv "SHOME" inferior-Sqpe+4-SHOME-name)) - (ess-write-to-dribble-buffer - (format "\n(Sqpe+4): ess-dialect=%s, buf=%s\n" ess-dialect - (current-buffer))) - (setq ess-customize-alist ; change inferior-ess-primary-prompt - (append ess-customize-alist '((inferior-ess-primary-prompt . "^")))) - (inferior-ess) - (setq ess-customize-alist Sqpe+4-customize-alist) ; restore i-e-p-p in alist - (ess-setq-vars-local ess-customize-alist) ; restore i-e-p-p in buffer - (setq inferior-ess-prompt ; define with correct i-e-p-p - ;; Do not anchor to bol with `^' ; (copied from ess-inf.el) - (concat "\\(" - inferior-ess-primary-prompt - "\\|" - inferior-ess-secondary-prompt - "\\)")) - (setq comint-prompt-regexp (concat "^" inferior-ess-prompt)) - ; define with correct i-e-p-p - (setq comint-input-sender 'inferior-ess-input-sender) - (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t) - (goto-char (point-max)) - (insert "options(interactive=T)") - (inferior-ess-send-input) - (setq mode-name "iESS(Sqpe)") - ;; (ess-eval-linewise inferior-S+4-editor-pager-command) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start)) - (if shome-nil-p (setenv "SHOME" nil)))) - - - -(defun S+4-mode (&optional proc-name) - "Major mode for editing S+4 source. See `ess-mode' for more help." - (interactive) - (setq ess-customize-alist S+4-customize-alist) - (ess-mode S+4-customize-alist proc-name) - (if ess-imenu-use-S (ess-imenu-S))) - -(defun S+4-transcript-mode () - "S-PLUS 4.x transcript mode." - (interactive) - (ess-transcript-mode S+4-customize-alist)) - - -(defun S+4-msdos (&optional proc-name) - "Call 'S-PLUS 4.x', the 'GUI Thing' from StatSci. Put S-Plus in an -independent MS-Window (Splus persists even if the '(ddeESS [S+4])' -window is killed in emacs). Do this by creating a comint process that -calls sh. Send a shell command in that sh buffer to call Splus. When -it completes set up a shell as a placeholder in the '(ddeESS [S+4])' -buffer. The S-Plus options are correctly set. In particular, the -S-Plus Commands window is opened if the Options/General -Settings/Startup menu says it should be. There is a 30 second delay -during startup in which the screen will not be refreshed. This delay -is here to allow slow disks to start the Splus program." - (interactive) - (save-excursion - (setq ess-customize-alist S+4-customize-alist) - (ess-write-to-dribble-buffer - (format "\n(S+4): ess-dialect=%s, buf=%s\n" ess-dialect - (current-buffer))) - (setq ess-customize-alist ; change inferior-ess-program - (append ess-customize-alist '((inferior-ess-program - . (getenv "COMSPEC"))))) - (setq ess-customize-alist ; change inferior-ess-primary-prompt - (append ess-customize-alist '((inferior-ess-primary-prompt . "^")))) - (setq ess-customize-alist ; change inferior-ess-start-args - (append ess-customize-alist '((inferior-ess-start-args . "")))) - (let ((s-proj (getenv "S_PROJ"))) - (if (fboundp 'w32-short-file-name) - (cd (w32-short-file-name (directory-file-name default-directory))) - (cd (directory-file-name default-directory))) - (setenv "S_PROJ" default-directory) - (inferior-ess) - (sleep-for 2) ; need to wait, else working too fast! The Splus - ; command in '(ddeESS [S+4])' should follow the "$" - ; prompt. If not, then increase the sleep-for time! - (setenv "S_PROJ" s-proj)) - (setq ess-customize-alist S+4-customize-alist) - (ess-setq-vars-local ess-customize-alist) -;;; the next three lines belong in customize-alist, but can't be there -;;; because of the broken ess-setq-vars-default usage in ess-inf.el - (setq inferior-ess-ddeclient "ddeclient") - (setq inferior-ess-client-name "S-PLUS") - (setq inferior-ess-client-command "SCommand") -;;; end of what belongs in customize-alist - (setq comint-input-sender 'comint-simple-send) - (setq comint-process-echoes nil) - (set-process-coding-system (get-process ess-local-process-name) 'raw-text-dos 'raw-text-dos) - (goto-char (point-max)) - (insert (concat inferior-S+4-program " " - inferior-ess-start-args)) ; Note: there is no final "&". - ; Without the "&", the results of !system.command come to '(ddeESS [S+4])' - ; With the "&", the results of !system.command in S get lost. - (inferior-ess-send-input) - (sleep-for 30) ; Need to wait, else working too fast! - ; If the ess-current-process-name doesn't appear in the - ; Splus Commands window increase the sleep-for time! -;;; from msdos-minor-mode - (setq comint-process-echoes t) - (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t) -;;; end from msdos-minor-mode - (setq ess-local-process-name ess-current-process-name) - (ess-eval-linewise (concat "#" ess-current-process-name)) - (goto-char (point-min)) - (insert - "This is a placeholder buffer. You can't type anything here. -Use 'C-x b RET' to return to your file.\n -Anything sent to this process from an S-mode buffer goes -directly to the associated Splus Commands window.\n -The S-Plus Commands window must be visible. -You may need to open the S-Plus Commands window manually - (by clicking on Splus/Window/Commands Window).\n There is a 30 -second delay when this program starts during which the emacs -screen will be partially blank.\n Remember to `q()' from S-Plus -and then C-x C-q exit from the `'(ddeESS [S+4])'' buffer, or take -the risk of not being able to shut down your computer and -suffering through scandisk.\n Any results of the !system.command -typed at the S prompt in the Splus Commands window (are supposed -to) appear in this buffer.\n\n") - (goto-char (point-max)) ; comint-mode-map makes '(ddeESS [S+4])' - (use-local-map comint-mode-map) ; a shell buffer after Splus is finished. - (setq buffer-read-only t) ; force buffer to be read-only - (setq mode-name "ddeESS") - ;; (ess-eval-linewise inferior-S+4-editor-pager-command) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start)) - )) - -(defun S+4-msdos-existing (&optional proc-name) - "Call 'S-PLUS 4.x', the 'GUI Thing' from StatSci. Do so by finding -an existing S-Plus in an independent MS-Window (if there is one) and -set up a '(ddeESS [S+4])' buffer in emacs. If there is no existing -S-Plus, then a new one will be opened in the default directory, -usually something like c:/Program Files/spls45se/users/yourname. -If you have a HOME environment variable, it will open it there." - (interactive) - (let* ((inferior-S+4-multipleinstances "")) - (S+4-msdos proc-name)) - (with-current-buffer - (car (buffer-list)) ; get the ESS buffer just created - (setq buffer-read-only nil) ; permit writing in ESS buffer - (goto-char (point-max)) - (beginning-of-line) - (forward-line -1) - (insert - "This is S+4-msdos-existing. -Results of the !system.command typed at the S prompt in the -Splus Commands window blink a DOS window and you won't see them.\n\n") - (setq buffer-read-only t) ; restore ESS buffer to be read-only - )) - - ; Provide package - -(provide 'ess-sp4-d) - -;;; ess-sp4-d.el ends here diff --git a/elpa/ess-20181109.703/ess-sp5-d.el b/elpa/ess-20181109.703/ess-sp5-d.el deleted file mode 100644 index b5cc363e..00000000 --- a/elpa/ess-20181109.703/ess-sp5-d.el +++ /dev/null @@ -1,106 +0,0 @@ -;;; ess-sp5-d.el --- S-plus 5 customization - -;; Copyright (C) 1998 A.J. Rossini -;; Copyright (C) 1999--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: A.J. Rossini -;; Created: 9 Nov 1998 -;; Maintainer: ESS-core - -;; Keywords: languages - -;; This file is part of ESS. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; AJR copied S4 to be S+5. -;; DB contributed the changes from ess-sp3-d.el to -;; ess-s4-d.el. (removed the old ugly approach). -;; This file defines Sp5 customizations for ess-mode. Lots of thanks -;; to RMH and JMC for code and suggestions -;; Thanks to MM for making this sensible. - -;;; Code: - -(require 'ess-s-lang) -(require 'ess-trns) - -;; You now need to make sure you've defined if you are running 5.0 or 5.1. -;; Lots of things are broken between them, GRR... - -(defvar S+5-dialect-name "S+5" - "Name of 'dialect' for S-PLUS 5.");easily changeable in a user's .emacs - -(defvar S+5-customize-alist - (append - '((ess-local-customize-alist . 'S+5-customize-alist) - (ess-dialect . S+5-dialect-name) - (ess-object-name-db-file . "ess-sp5-namedb.el") - (inferior-ess-program . inferior-S+5-program) - ;;(inferior-ess-objects-pattern . ".*") ; for new s4 stuff - (inferior-ess-help-command . "help(\"%s\", pager=\"slynx -dump\", window=FALSE)\n") - (inferior-ess-help-filetype . nil) - (inferior-ess-search-list-command . "searchPaths()\n") - (inferior-ess-start-args . inferior-S+-start-args) - (ess-STERM . "iESS") - ) - S+common-cust-alist) - - "Variables to customize for S+5.") - - -;; For loading up the S code required for the above. -;;(add-hook 'ess-post-run-hook -;; (lambda () -;; (ess-command -;; (concat -;; "if(exists(\"Sversion\")) library(emacs) else source(\"" -;; ess-mode-run-file -;; "\")\n")) -;; (if ess-mode-run-file2 -;; (ess-command -;; (concat "source(\"" ess-mode-run-file2 "\")\n"))))) - - -(defun S+5 (&optional proc-name) - "Call 'Splus5', based on S version 4, from Bell Labs. -New way to do it." - (interactive) - (setq ess-customize-alist S+5-customize-alist) - (ess-write-to-dribble-buffer - (format "\n(S+5): ess-dialect=%s, buf=%s\n" ess-dialect (current-buffer))) - (inferior-ess) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start))) - -(defun S+5-mode (&optional proc-name) - "Major mode for editing S+5 source. See `ess-mode' for more help." - (interactive) - (setq ess-customize-alist S+5-customize-alist) - (ess-mode S+5-customize-alist proc-name) - (if ess-imenu-use-S (ess-imenu-S))) - -(defun S+5-transcript-mode () - "S-PLUS 5 transcript mode." - (interactive) - (ess-transcript-mode S+5-customize-alist)) - - ; Provide package - -(provide 'ess-sp5-d) - -;;; ess-sp5-d.el ends here diff --git a/elpa/ess-20181109.703/ess-sp6w-d.el b/elpa/ess-20181109.703/ess-sp6w-d.el deleted file mode 100644 index 33328a45..00000000 --- a/elpa/ess-20181109.703/ess-sp6w-d.el +++ /dev/null @@ -1,603 +0,0 @@ -;;; ess-sp6w-d.el --- S-PLUS 6.x for Windows customization - -;;; copied and edited from ess-s4-d.el - Richard M. Heiberger, April 2001 - -;; Copyright (C) 2001 Richard M. Heiberger -;; Copyright (C) 2002--2005 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: Richard M. Heiberger -;; Created: April 2001 -;; Maintainer: ESS-core - -;; Keywords: languages - -;; This file is part of ESS. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; This file defines all the S-PLUS 6.x for Windows customizations -;; for ess-mode with ddeclient. - -;;; Code: - -;;; Requires and Autoloads: - -(require 'ess-s-lang) -(require 'ess-trns) -(defvar ess-S+-startup-delay) -(defvar version-function-name) -;;NO: this is autoloaded from other places (require 'ess-dde) - -(defvaralias 'inferior-S+6-multipleinstances 'inferior-S+-multipleinstances) -(defvar inferior-S+-multipleinstances "/MULTIPLEINSTANCES" - "Default \"/MULTIPLEINSTANCES\" opens up a new instance of S+[678] in a -GUI window and connects it to the '(ddeESS [S+])' window. The -alternative nil uses an existing S+ GUI (if there is one) and -connects it to the '(ddeESS [S+])' window.") - -(defvaralias 'S+6-customize-alist 'S+-customize-alist) -(defvar S+-customize-alist - (append - '((ess-local-customize-alist . 'S+-customize-alist) - (ess-dialect . S+-dialect-name) - (ess-object-name-db-file . "ess-sp6-namedb.el" ) - (ess-display-help-on-object-function . #'ess-chm-display-help-on-object) - (inferior-ess-program . inferior-S+-program) - (inferior-ess-help-command . "help(\"%s\")\n") - (inferior-ess-help-filetype . "chm") - (inferior-ess-search-list-command . "searchPaths()\n") - (inferior-ess-start-file . nil) ;"~/.ess-S+") - (inferior-ess-start-args . (concat - inferior-S+-multipleinstances - " " - inferior-S+-start-args - " " - inferior-S+-print-command - " S_PROJ=" - (when (fboundp 'w32-short-file-name) - (w32-short-file-name - (directory-file-name - default-directory))))) - ;; (inferior-ess-ddeclient . "ddeclient") - ;; (inferior-ess-client-name . "S-PLUS") - ;; (inferior-ess-client-command . "SCommand") - (ess-STERM . "ddeESS") - ) - S+common-cust-alist) - "Variables to customize for S+") - -(defvaralias 'Sqpe+6-customize-alist 'Sqpe+-customize-alist) -(defvar Sqpe+-customize-alist - (append - '((ess-local-customize-alist . 'Sqpe+-customize-alist) - (ess-dialect . S+-dialect-name) - (ess-loop-timeout . 500000 );fixme: dialect specific custom.var - (ess-object-name-db-file . "ess-sp6-namedb.el" ) - (ess-display-help-on-object-function . #'ess-chm-display-help-on-object) - (inferior-ess-program . inferior-Sqpe+-program) - (inferior-ess-help-command . "help(\"%s\")\n") - (inferior-ess-help-filetype . "chm") - (inferior-ess-search-list-command . "searchPaths()\n") - (inferior-ess-start-file . nil) ;"~/.ess-S+") - (inferior-ess-start-args . (concat - ;; workaround for bug in S-Plus 6 for Windows: - "ALWAYS_PROMPT=X" - " " - inferior-Sqpe+-start-args ;; e.g. license manager - )) - (ess-STERM . "iESS") - ) - S+common-cust-alist) - "Variables to customize for Sqpe+.") - - - -;;; There are extra complications in S+6 and S+7 and S+8 (compared to S+3) -;;; because -;;; -;;; (1) The StatSci supplied Splus.exe doesn't work in an emacs -;;; buffer. It works as as a GUI window and we must send commands -;;; to it through ddeclient. Nonetheless, we need to give it a -;;; process name and be sure that that there is a valid running -;;; process in the '(ddeESS [S+])' buffer. Therefore we create an -;;; ESS process in the buffer as a placeholder and start a shell -;;; in the ESS buffer. From the shell we start Splus. Once Splus -;;; finishes initializing and kills the original shell, we start -;;; another shell. We have a buffer-local variable -;;; inferior-ess-ddeclient, initialized to nil. When there is a -;;; non-nil value of inferior-ess-ddeclient we send lines to -;;; inferior-ess-ddeclient rather than to the Splus process. -;;; (2) There is no Splus process running in the '(ddeESS [S+])' -;;; buffer. Therefore inferior-ess will never see a prompt, -;;; unless we first change it to the null prompt "^". Then once -;;; the process has started, we change it back. -;;; (3) When M-x S+ starts Splus by a shell command, then Splus is an -;;; independent process and will be survive if the '(ddeESS [S+])' -;;; buffer is killed (or emacs is quit). The '(ddeESS [S+])' is -;;; made read-only and a warning is placed in it saying that "You -;;; can't type anything here." Actually, if thestandalone Splus -;;; is killed and the '(ddeESS [S+])' is made writable (C-x C-q), -;;; then '(ddeESS [S+])' becomes a shell buffer. -;;; -(defalias 'S+6 'S+) -(defun S+ (&optional proc-name) - "Verify that `inferior-S+-program' points to S-Plus 6 or -S-Plus 7 or S-Plus 8. Start normally for S-Plus 6.1 and later. -Inform the user to start S-Plus 6.0 from the icon and then -connect to it with `S+-existing'. Give an error message if -`inferior-S+-program' doesn't point to S-Plus 6 or S-Plus 7 -or S-Plus 8." - (interactive) - (with-current-buffer (find-file-noselect - (concat (executable-find inferior-S+-program) - "/../../versions") t) - (setq buffer-read-only 1) - (forward-line) - (if (not (search-backward-regexp "splus\t[678].[0-9]" (point-min) t)) - (error "The emacs variable `inferior-S+-program' does -not point to S-Plus 6 or 7 or 8. Please add `splus[678]?/cmd' (expand the -`[678]?' to match your setup) to your `exec-path' or specify the complete -path to `Splus.exe' in the variable `inferior-S+-program' in your -`.emacs' file.") - (forward-line) - (if (search-backward "splus\t6.0" (point-min) t) - (error "S-Plus 6.0 for Microsoft Windows has a bug that -prevents it from being started by emacs. Instead, you must start it -by double-clicking an icon. Then you can connect to it with -`S+-existing'. You should consider upgrading to a newer -release of S-Plus.")))) - (S+-initiate proc-name)) ;; normal start ; - -(defalias 'S+6-initiate 'S+-initiate) -(defun S+-initiate (&optional proc-name) - "Call 'S-PLUS [678].x for Windows', the 'GUI Thing' from StatSci. Put -S-Plus in an independent MS-Window (Splus persists even if the -'(ddeESS [S+])' window is killed in emacs). Do this by creating a -comint process that calls sh. Send a shell command in that sh buffer -to call Splus. When it completes set up a shell as a placeholder in -the '(ddeESS [S+])' buffer. The S-Plus options are correctly set. -In particular, the S-Plus Commands window is opened if the -Options/General Settings/Startup menu says it should be. There is a -startup delay of `ess-S+-startup-delay' seconds during which the -screen will not be refreshed. This delay is here to allow slow disks -to start the Splus program." - (interactive) - (save-excursion - (setq ess-customize-alist S+-customize-alist) - (ess-write-to-dribble-buffer - (format "\n(S+): ess-dialect=%s, buf=%s\n" ess-dialect - (current-buffer))) - (setq ess-customize-alist ; change inferior-ess-program - (append ess-customize-alist '((inferior-ess-program . "sh")))) - (setq ess-customize-alist ; change inferior-ess-primary-prompt - (append ess-customize-alist '((inferior-ess-primary-prompt . "^")))) - (setq ess-customize-alist ; change inferior-ess-start-args - (append ess-customize-alist '((inferior-ess-start-args . "-i")))) - (let ((s-proj (getenv "S_PROJ")) - (use-dialog-box (not (or ess-microsoft-p (eq system-type 'cygwin)))) - ) - (cd (when (fboundp 'w32-short-file-name) - (w32-short-file-name (directory-file-name default-directory)))) - (setenv "S_PROJ" (when - (fboundp 'w32-short-file-name) - (w32-short-file-name default-directory))) - (inferior-ess) - (sleep-for 2) ; need to wait, else working too fast! The Splus - ; command in '(ddeESS [S+])' should follow the "$" - ; prompt. If not, then increase the sleep-for time! - (setenv "S_PROJ" s-proj)) - (setq ess-customize-alist S+-customize-alist) - (ess-setq-vars-local ess-customize-alist) -;;; the next three lines belong in customize-alist, but can't be there -;;; because of the broken ess-setq-vars-default usage in ess-inf.el - (setq inferior-ess-ddeclient "ddeclient") - (setq inferior-ess-client-name "S-PLUS") - (setq inferior-ess-client-command "SCommand") -;;; end of what belongs in customize-alist - (setq comint-process-echoes nil) - (setq comint-input-sender 'comint-simple-send) - (goto-char (point-max)) - (insert (concat inferior-S+-program " " - inferior-ess-start-args)) ; Note: there is no final "&". - ;; Without the "&", the results of !system.command come to '(ddeESS [S+])' - ;; With the "&", the results of !system.command in S get lost. - (inferior-ess-send-input) - (sleep-for ess-S+-startup-delay) ; Need to wait, else working too fast! - ; If the ess-current-process-name doesn't appear in the - ; Splus Commands window increase the sleep-for time! - (setq ess-local-process-name ess-current-process-name) - (ess-eval-linewise (concat "#" ess-current-process-name)) - (goto-char (point-min)) - (insert - "This is a placeholder buffer. You can't type anything here. -Use `C-x b RET' to return to your file.\n -Anything sent to this process from an S-mode buffer goes -directly to the associated Splus Commands window.\n -The S-Plus Commands window must be visible. -You may need to open the S-Plus Commands window manually (by clicking on -Splus/Window/Commands Window).\n -Any results of the !system.command typed at the S prompt in the -Splus Commands window appear in this buffer.\n\n") - (goto-char (point-max)) ; comint-mode-map makes '(ddeESS [S+])' - ;; (use-local-map comint-mode-map) ;a shell buffer after Splus is finished. - (set-process-coding-system (get-buffer-process (current-buffer)) - 'raw-text-dos 'raw-text-unix) - (setq buffer-read-only t) ; force buffer to be read-only - (setq mode-name "ddeESS") - ;; (ess-eval-linewise inferior-S+-editor-pager-command) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start)) - )) - - -(defalias 'S+6-existing 'S+-existing) -(defun S+-existing (&optional proc-name) - "Call 'S-PLUS [678].x for Windows', the 'GUI Thing' from StatSci. Do so by -finding an existing S-Plus in an independent MS-Window (if there is one) and -set up a '(ddeESS [S+])' buffer in emacs. If there is no existing -S-Plus, then a new one will be opened in the default directory. The default -is usually something like 'c:/Program Files/Insightful/splus70/users/yourname' -for S-Plus before 8.0.4. Beginning with 8.0.4, S-Plus uses the default directory -'c:/Documents and Settings/yourname/My Documents/S-PLUS Projects/Project1'. -Beginning with TIBCO Spotfire S+ Version 8.1.1 for Microsft Windows, the default -directory is 'c:/DOCUME~1/yourname/MYDOCU~1/SPOTFI~1/Project1'. -If you have a HOME environment variable, it will open it there." - (interactive) - (let* ((inferior-S+-multipleinstances " & # ") ; Note: there is a final "&". - (ess-S+-startup-delay 0)) ;; No delay for existing S-Plus - ;; Without the "&", there is a core dump. - ;; With the "&", the results of !system.command in S get lost. - ;; We are picking up an existing S-Plus process for sending to. - ;; It doesn't know about us, so nothing comes back. - (S+-initiate proc-name)) - (with-current-buffer (car (buffer-list)) ; get the ESS buffer just created - (setq buffer-read-only nil) ; permit writing in ESS buffer - (goto-char (point-max)) - (beginning-of-line) - (forward-line -1) - (insert - "This is S+-existing. -Results of the !system.command typed at the S prompt in the -Splus Commands window blink a DOS window and you won't see them.\n\n") - (setq buffer-read-only t) ; restore ESS buffer to be read-only - )) - - -;;; There are extra complications in Sqpe+6 (compared to S+3) because -;;; (1) The StatSci supplied Sqpe.exe won't work without SHOME as an -;;; environment variable and Sqpe does not take command line -;;; arguments and -;;; (2) Sqpe.exe comes up with options(interactive=FALSE), which means it -;;; doesn't provide prompts by default, and we must change it to T so -;;; it will provide prompts. -;;; -(defalias 'Sqpe+6 'Sqpe+) -(defun Sqpe+ (&optional proc-name) - "Call 'Sqpe' from 'S-PLUS [678].x for Windows', the 'Real Thing' from StatSci." - (interactive) - (setq ess-customize-alist Sqpe+-customize-alist) - (let* ((shome-nil-p (equal (getenv "SHOME") nil)) - (use-dialog-box (not (or ess-microsoft-p (eq system-type 'cygwin)))) - ) - (if shome-nil-p (setenv "SHOME" inferior-Sqpe+-SHOME-name)) - (ess-write-to-dribble-buffer - (format "\n(Sqpe+6): ess-dialect=%s, buf=%s\n" ess-dialect - (current-buffer))) - (setq ess-customize-alist ; change inferior-ess-primary-prompt - (append ess-customize-alist '((inferior-ess-primary-prompt . "^")))) - (inferior-ess) - (setq ess-customize-alist Sqpe+-customize-alist) ; restore i-e-p-p in alist - (ess-setq-vars-local ess-customize-alist) ; restore i-e-p-p in buffer - (setq inferior-ess-prompt ; define with correct i-e-p-p - ;; Do not anchor to bol with `^' ; (copied from ess-inf.el) - (concat "\\(" - inferior-ess-primary-prompt - "\\|" - inferior-ess-secondary-prompt - "\\)")) - (setq comint-prompt-regexp (concat "^" inferior-ess-prompt)) - ; define with correct i-e-p-p - (setq comint-input-sender 'inferior-ess-input-sender) - (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t) - (goto-char (point-max)) - (insert "options(interactive=TRUE)") - (inferior-ess-send-input) - (setq mode-name "iESS(Sqpe)") - ;; (ess-eval-linewise inferior-S+-editor-pager-command) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start)) - (if shome-nil-p (setenv "SHOME" nil)))) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.sp\\'" . S-mode)) -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.[qsS]\\'" . S-mode)) -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.ssc\\'" . S-mode)) -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.SSC\\'" . S-mode)) - -(defalias 'S+6-mode 'S+-mode) -(defun S+-mode (&optional proc-name) - "Major mode for editing S+[678] source. See `ess-mode' for more help." - (interactive) - (setq ess-customize-alist S+-customize-alist) - (ess-mode S+-customize-alist proc-name) - (if ess-imenu-use-S (ess-imenu-S))) - -(defalias 'S+6-transcript-mode 'S+-transcript-mode) -(defun S+-transcript-mode () - "S-PLUS transcript mode." - (interactive) - (ess-transcript-mode S+-customize-alist)) - -(defun S+-msdos (&optional proc-name) - "Verify that `inferior-S+-program' points to S-Plus 6 or -S-Plus 7 or S-Plus 8. Start normally for S-Plus 6.1 and later. -Inform the user to start S-Plus 6.0 from the icon and then -connect to it with `S+-msdos-existing'. Give an error message -if `inferior-S+-program' doesn't point to S-Plus 6 or -S-Plus 7 or S-Plus 8." - (interactive) - (with-current-buffer (find-file-noselect - (concat (executable-find inferior-S+-program) - "/../../versions") t) - (setq buffer-read-only 1) - (forward-line) - (if (not (search-backward-regexp "splus\t[678].[0-9]" (point-min) t)) - (error "The emacs variable `inferior-S+-program' does - not point to S-Plus 6 or 7 or 8. Please add `splus[678]?/cmd' - (expand the `[678]?' to match your setup) to your `exec-path' or - specify the complete path to `Splus.exe' in the variable -`inferior-S+-program' in your `.emacs' file.") ;;; " This comment keeps emacs font-lock from getting out of phase. - - (progn - (forward-line) - (if (search-backward "splus\t6.0" (point-min) t) - (error "S-Plus 6.0 for Microsoft Windows has a bug that -prevents it from being started by emacs. Instead, you must start it -by double-clicking an icon. Then you can connect to it with -`S+-msdos-existing'. You should consider upgrading to a newer -release of S-Plus.") - (S+-msdos-initiate proc-name))) ;; normal start ; - ))) - -(defalias 'S+6-msdos-initiate 'S+-msdos-initiate) -(defun S+-msdos-initiate (&optional proc-name) - "Call 'S-PLUS [678].x for Windows', the 'GUI Thing' from StatSci. Put -S-Plus in an independent MS-Window (Splus persists even if the -'(ddeESS [S+])' window is killed in emacs). Do this by creating a -comint process that calls sh. Send a shell command in that sh buffer -to call Splus. When it completes set up a shell as a placeholder in -the '(ddeESS [S+])' buffer. The S-Plus options are correctly set. -In particular, the S-Plus Commands window is opened if the -Options/General Settings/Startup menu says it should be. There is a -startup delay of `ess-S+-startup-delay' seconds during which the -screen will not be refreshed. This delay is here to allow slow disks -to start the Splus program." - (interactive) - (save-excursion - (setq ess-customize-alist S+-customize-alist) - (ess-write-to-dribble-buffer - (format "\n(S+): ess-dialect=%s, buf=%s\n" ess-dialect - (current-buffer))) - (setq ess-customize-alist ; change inferior-ess-program - (append ess-customize-alist '((inferior-ess-program - . (getenv "COMSPEC"))))) - (setq ess-customize-alist ; change inferior-ess-primary-prompt - (append ess-customize-alist '((inferior-ess-primary-prompt . "^")))) - (setq ess-customize-alist ; change inferior-ess-start-args - (append ess-customize-alist '((inferior-ess-start-args . "")))) - (let ((s-proj (getenv "S_PROJ")) - (use-dialog-box (not (or ess-microsoft-p (eq system-type 'cygwin)))) - ) - (cd (when (fboundp 'w32-short-file-name) - (w32-short-file-name (directory-file-name default-directory)))) - (setenv "S_PROJ" (when - (fboundp 'w32-short-file-name) - (w32-short-file-name default-directory))) - (inferior-ess) - (sleep-for 2) ; need to wait, else working too fast! The Splus - ; command in '(ddeESS [S+])' should follow the "$" - ; prompt. If not, then increase the sleep-for time! - (setenv "S_PROJ" s-proj)) - (setq ess-customize-alist S+-customize-alist) - (ess-setq-vars-local ess-customize-alist) -;;; the next three lines belong in customize-alist, but can't be there -;;; because of the broken ess-setq-vars-default usage in ess-inf.el - (setq inferior-ess-ddeclient "ddeclient") - (setq inferior-ess-client-name "S-PLUS") - (setq inferior-ess-client-command "SCommand") -;;; end of what belongs in customize-alist - (setq comint-input-sender 'comint-simple-send) - (setq comint-process-echoes nil) - (set-process-coding-system (get-buffer-process (current-buffer)) - 'raw-text-dos 'raw-text-dos) - (goto-char (point-max)) - (insert (concat inferior-S+-program " " - inferior-ess-start-args)) ; Note: there is no final "&". - ;; Without the "&", the results of !system.command come to '(ddeESS [S+])' - ;; With the "&", the results of !system.command in S get lost. - (inferior-ess-send-input) - (sleep-for ess-S+-startup-delay) ; Need to wait, else working too fast! - ; If the ess-current-process-name doesn't appear in the - ; Splus Commands window increase the sleep-for time! -;;; from msdos-minor-mode - (setq comint-process-echoes t) - (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t) -;;; end from msdos-minor-mode - (setq ess-local-process-name ess-current-process-name) - (ess-eval-linewise (concat "#" ess-current-process-name)) - (goto-char (point-min)) - (insert - "This is a placeholder buffer. You can't type anything here. -Use `C-x b RET' to return to your file.\n -Anything sent to this process from an S-mode buffer goes -directly to the associated Splus Commands window.\n -The S-Plus Commands window must be visible. -You may need to open the S-Plus Commands window manually - (by clicking on Splus/Window/Commands Window).\n -There is a `ess-S+-startup-delay' second delay when this program starts -during which the emacs screen will be partially blank.\n -Remember to 'q()' from S-Plus and -then C-x C-q exit from the '(ddeESS [S+])' buffer, -or take the risk of not being able to shut down your computer -and suffering through scandisk.\n -Any results of the !system.command typed at the S prompt in the -Splus Commands window (are supposed to) appear in this buffer.\n\n") - (goto-char (point-max)) ; comint-mode-map makes '(ddeESS [S+])' - (use-local-map comint-mode-map) ; a shell buffer after Splus is finished. - (setq buffer-read-only t) ; force buffer to be read-only - (setq mode-name "ddeESS") - ;; (ess-eval-linewise inferior-S+-editor-pager-command) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start)) - )) - -(defalias 'S+6-msdos-existing 'S+-msdos-existing) -(defun S+-msdos-existing (&optional proc-name) - "Call 'S-PLUS [678].x for Windows', the 'GUI Thing' from StatSci. Do so by -finding an existing S-Plus in an independent MS-Window (if there is one) and -set up a '(ddeESS [S+])' buffer in emacs. If there is no existing -S-Plus, then a new one will be opened in the default directory. The default -is usually something like 'c:/Program Files/Insightful/splus70/users/yourname' -for S-Plus before 8.0.4. Beginning with 8.0.4, S-Plus uses the default directory -'c:/Documents and Settings/yourname/My Documents/S-PLUS Projects/Project1'. -Beginning with TIBCO Spotfire S+ Version 8.1.1 for Microsft Windows, the default -directory is 'c:/DOCUME~1/yourname/MYDOCU~1/SPOTFI~1/Project1'. -If you have a HOME environment variable, it will open it there." - (interactive) - (let* ((inferior-S+-multipleinstances "") - (ess-S+-startup-delay 0)) ;; No delay for existing S-Plus - (S+-msdos-initiate proc-name)) - (with-current-buffer (car (buffer-list)) ; get the ESS buffer just created - (setq buffer-read-only nil) ; permit writing in ESS buffer - (goto-char (point-max)) - (beginning-of-line) - (forward-line -1) - (insert - "This is S+-msdos-existing. -Results of the !system.command typed at the S prompt in the -Splus Commands window blink a DOS window and you won't see them.\n\n") - (setq buffer-read-only t) ; restore ESS buffer to be read-only - )) - -(defun ess-sqpe-versions-create (ess-SHOME-versions &optional x64) - "Generate the `M-x splusxy' functions for starting other versions of -Sqpe. `ESS-SHOME-VERSIONS' is normally taken from -`ess-sqpe-versions', a variable that contains strings that determine which -functions are created. This works by creating a temp buffer where the -template function `Sqpe+template' is edited by replacing the string -'Sqpe+template' by the version name. The list of functions actually -created appears in the `ess-dribble-buffer'. If `X64' is not nil, then -modify the function name to show \"-64bit\" in its name. - -The result `ess-sqpe-versions-created' will store a list of the new -Sqpe defuns, if any, that were created. The defuns will normally be -placed on the menubar upon ESS initialisation." - (let ((beg) - (versions) - (version) - (eval-buf (get-buffer-create "*ess-temp-sqpe-evals*")) - (ess-sqpe-versions-created) - ) - ;; - (with-current-buffer eval-buf - ;; clear the buffer. - (delete-region (point-min) (point-max)) - - ;; Find which versions of Sqpe we want. - (setq x64 (if x64 "-64bit")) - (setq versions (ess-uniq-list ess-SHOME-versions)) - ;; Iterate over each string in VERSIONS, creating a new defun each time. - (while versions - (setq version (car versions) - versions (cdr versions)) - (if (file-executable-p version) - (progn - (setq beg (point)) - (setq version-function-name (concat (file-name-nondirectory version) x64)) - (prin1 (symbol-function 'Sqpe+template) eval-buf) - (insert "\n\n") - (goto-char beg) - (while (search-forward "lambda" nil t 1) - (replace-match - (concat "defun " version-function-name) - t t)) - (while (search-forward "ess-SHOME" nil t) - (replace-match version t t)) - (goto-char (point-max)) - (setq ess-sqpe-versions-created - (cons version-function-name - ess-sqpe-versions-created)) - (ess-write-to-dribble-buffer - (format - "(Sqpe): ess-sqpe-versions-create making M-x defun %s for %s \n" - version-function-name version)) - ))) - ;; buffer has now been created with defuns, so eval them! - (eval-buffer) - (kill-buffer eval-buf)) - ess-sqpe-versions-created)) - -;; template function used by ess-sqpe-versions-create -(defun Sqpe+template (&optional proc-name) - "Call 'Sqpe' from 'S-PLUS for Windows ess-SHOME', -the 'Real Thing' from StatSci. -This function was generated by `ess-sqpe-versions-create'." - (interactive) - (setq ess-customize-alist Sqpe+-customize-alist) - (let* ((use-dialog-box) ;; MS dialog box won't return a directory - (shome-old (getenv "SHOME")) - (inferior-Sqpe+-SHOME-name "ess-SHOME") - (inferior-Sqpe+-program (concat "ess-SHOME" "/cmd/sqpe.exe"))) - (setenv "SHOME" "ess-SHOME") - (ess-write-to-dribble-buffer - (format "\n(Sqpe+template): ess-dialect=%s, buf=%s\n" ess-dialect - (current-buffer))) - (setq ess-customize-alist ; change inferior-ess-primary-prompt - (append ess-customize-alist - '((inferior-ess-primary-prompt . "^")))) - (inferior-ess) - (setq ess-customize-alist Sqpe+-customize-alist) ; restore i-e-p-p in alist - (ess-setq-vars-local ess-customize-alist) ; restore i-e-p-p in buffer - (setq inferior-ess-prompt ; define with correct i-e-p-p - ;; Do not anchor to bol with `^' ; (copied from ess-inf.el) - (concat "\\(" - inferior-ess-primary-prompt - "\\|" - inferior-ess-secondary-prompt - "\\)")) - (setq comint-prompt-regexp (concat "^" inferior-ess-prompt)) - ; define with correct i-e-p-p - (setq comint-input-sender 'inferior-ess-input-sender) - (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t) - (goto-char (point-max)) - (insert "options(interactive=TRUE)") - (inferior-ess-send-input) - (setq mode-name "iESS(Sqpe)") - ;; (ess-eval-linewise inferior-S+-editor-pager-command) - (if inferior-ess-language-start - (ess-eval-linewise inferior-ess-language-start)) - (setenv "SHOME" shome-old))) - - - ; Provide package - -(provide 'ess-sp6w-d) - -;;; ess-sp6w-d.el ends here diff --git a/elpa/ess-20181109.703/ess-swv.el b/elpa/ess-20181109.703/ess-swv.el deleted file mode 100644 index d32127f9..00000000 --- a/elpa/ess-20181109.703/ess-swv.el +++ /dev/null @@ -1,425 +0,0 @@ -;;; ess-swv.el --- Some simple functions for ESS and Sweave - -;; Copyright (C) 2005 David Whiting, A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. -;; Copyright (C) 2006-2008 A.J. Rossini, Richard M. Heiberger, Martin Maechler, -;; Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: David Whiting -;; Created: 15 April 2005 -;; Maintainer: ESS-core - -;; Keywords: statistics, tools - -;; This file is part of ESS. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; -;; Some simple functions for ESS and Sweave -;; david.whiting at ncl.ac.uk -;; Wed Sep 1 14:55:52 CEST 2004 - -;; I have written some very simple elisp functions that I have found -;; useful and thought others might like to see. I dabble with elisp -;; occasionally at best so there are probably better ways to do what I -;; have done, but so far this seems to work for me. There are several -;; things that are hard-coded, I use Linux and I think that this would -;; probably not work in Windows (not as it is now anyway). - -;; With these functions and key bindings all I need to do is open a .Rnw -;; file and, assuming R is running, I press: - -;; M-n s to Sweave the file, then -;; M-n l to run latex on the results of Sweave, then -;; M-n p to make and display a postscript file , or -;; M-n P to make and display a PDF version. - -;; David Whiting to Anthony Rossini, Mar 30 -;; On Wed, Mar 30, 2005 at 11:51:26AM +0200, A.J. Rossini wrote: -;; > I'm going to go ahead and add this stuff to the distribution tonight -;; > if you don't mind. I'd forgotten about it! -;; It would make me very happy indeed. -;; > (however, need permission to do so). -;; Permission granted! - -;; Dave -;; -- -;; David Whiting -;; School of Clinical Medical Sciences, The Medical School -;; University of Newcastle upon Tyne, NE2 4HH, UK. - - -;;; TODO: -;;; -;;; 1. I want to be able to send ess-swv-latex a parameter to tell it -;;; the number of times to run LaTeX (to get references updated -;;; correctly). -;;; -;;; 2. Also need to add ess-swv-Bibtex. -;;; -;;; 3. Might be good to have a way to chain commands. -;;; -;;; 4. ADD to the ../doc/ess.texi !! - - -;;; Code: - -;;; Autoloads and Requires - -(eval-when-compile - (require 'ess-custom)) - -(require 'ess-utils) -(require 'ess-noweb-mode) -(require 'ess-r-mode); for Rnw-mode -(require 'easymenu) - -(defvar TeX-command-list) -(defvar TeX-command-default) -(defvar TeX-file-extensions) -(declare-function TeX-normal-mode "tex") - -(defcustom ess-swv-processing-command ".ess_weave(%s, %s)" - "Command used by `ess-swv-run-in-R'. - -First %s is literally replaced by the processing command (for -example: Sweave) second %s is replaced with a string containing a -processed file and possibly additional argument encoding (example: -\"path/to/foo.Rnw\", encoding='utf-8') - -.ess_weave changes the working directory to that of the supplied -file. - -If you want to simply call knitr or Sweave in global environment -set this command to \"%s(%s)\"." - :group 'ess-R - :type 'string) - -;; currently use exactly for "Sweave", "Stangle", "knit", and "purl" -(defun ess-swv-run-in-R (cmd &optional choose-process block) - "Run \\[cmd] on the current .Rnw file. Utility function not called by user." - (let* ((rnw-buf (current-buffer))) - (if choose-process ;; previous behavior - (ess-force-buffer-current "R process to load into: ") - ;; else - (update-ess-process-name-list) - (cond ((= 0 (length ess-process-name-list)) - (message "no ESS processes running; starting R") - (sit-for 1); so the user notices before the next msgs/prompt - (run-ess-r) - (set-buffer rnw-buf) - ) - ((not (string= "R" (ess-make-buffer-current))); e.g. Splus, need R - (ess-force-buffer-current "R process to load into: ")) - )) - - (save-excursion - ;; (ess-execute (format "require(tools)")) ;; Make sure tools is loaded. - (basic-save-buffer); do not Sweave/Stangle old version of file ! - (let* ((sprocess (ess-get-process ess-current-process-name)) - (sbuffer (process-buffer sprocess)) - (rnw-file (buffer-file-name)) - (Rnw-dir (file-name-directory rnw-file)) - (buf-coding (symbol-name buffer-file-coding-system)) - ;; could consider other encodings, but utf-8 is "R standard" for non-ASCII: - (cmd-args (concat "\"" rnw-file "\"" - (if (string-match "^utf-8" buf-coding) - ", encoding = \"utf-8\""))) - (Sw-cmd - (format ess-swv-processing-command cmd cmd-args))) - (message "%s()ing %S" cmd rnw-file) - ;; need to block when we are running ess-swv-weave-PDF so we - ;; know when to start compiling the generated .tex file - (if block - (progn - (ess-eval-linewise (concat Sw-cmd "\n") nil nil nil t) - (message "Finished %s()ing %S" cmd rnw-file)) - (ess-execute Sw-cmd 'buffer nil nil) - (switch-to-buffer rnw-buf) - (ess-show-buffer (buffer-name sbuffer) nil)))))) - -(defcustom ess-swv-processor 'sweave - "Processor to use for weaving and tangling. -Currently 'sweave or 'knitr" - :group 'ess-R - :type '(choice (const sweave) (const knitr))) - - -(defun ess-swv-tangle () - "Run Stangle/purl on the current .Rnw file. -Depending on the `ess-swv-processor' used." - (interactive) - (ess-swv-run-in-R (cond ((eq ess-swv-processor 'sweave) "Stangle") - ((eq ess-swv-processor 'knitr) "purl") - (t (error "Not a valid processor %s" ess-swv-processor))))) - -(defun ess-swv-weave (&optional choose) - "Run Sweave/knit on the current .Rnw file. -Depending on the `ess-swv-processor' used. - -If CHOOSE is non-nil, offer a menu of available weavers. -" - (interactive "P") - (let ((processor (if choose - (ess-completing-read "Weaver" '("sweave" "knitr") nil t) - (symbol-name ess-swv-processor)))) - (ess-swv-run-in-R (cond ((string= processor "sweave") "Sweave") - ((string= processor "knitr") "knit") - (t (error "Not a valid processor %s" processor)))))) - -(defun ess-swv-sweave () - "Run Sweave on the current .Rnw file." - (interactive) - (ess-swv-run-in-R "Sweave")) - -(defun ess-swv-stangle () - "Run Stangle on the current .Rnw file." - (interactive) - (ess-swv-run-in-R "Stangle")) - -(defun ess-swv-knit () - "Run knit on the current .Rnw file." - (interactive) - (ess-swv-run-in-R "knit")) - -(defun ess-swv-purl () - "Run purl on the current .Rnw file." - (interactive) - (ess-swv-run-in-R "purl")) - -(defun ess-swv-weave-PDF (&optional choose) - "Sweave/knit, compile TeX, and display PDF. -Run Sweave or knit depending on `ess-swv-processor' used. - -If CHOOSE is non-nil, offer a menu of available weavers. -" - (interactive "P") - (let ((processor (if choose - (ess-completing-read "Weaver" '("sweave" "knitr") nil t) - (symbol-name ess-swv-processor)))) - (ess-swv-run-in-R (cond ((string= processor "sweave") "Sweave") - ((string= processor "knitr") "knit") - (t (error "Not a valid processor %s" processor))) - nil t) - (ess-swv-PDF nil t))) - - -(defun ess-swv-latex () - "Run LaTeX on the product of Sweave()ing the current file." - (interactive) - (save-excursion - (let* ((namestem (file-name-sans-extension (buffer-file-name))) - (latex-filename (concat namestem ".tex")) - (tex-buf (get-buffer-create " *ESS-tex-output*"))) - (message "Running LaTeX on '%s' ..." latex-filename) - (switch-to-buffer tex-buf) - (call-process "latex" nil tex-buf 1 latex-filename) - (switch-to-buffer (buffer-name)) - (display-buffer tex-buf) - (message "Finished running LaTeX" )))) - - -(defun ess-swv-PS () - "Create a postscript file from a dvi file (name based on the current -Sweave file buffer name) and display it." - (interactive) - (let* ((buf (buffer-name)) - (namestem (file-name-sans-extension (buffer-file-name))) - (dvi-filename (concat namestem ".dvi")) - (psviewer (ess-get-ps-viewer))) - (shell-command (concat "dvips -o temp.ps " dvi-filename)) - (shell-command (concat psviewer " temp.ps & ")) - (switch-to-buffer buf) - )) - -(defun ess-swv-PDF (&optional pdflatex-cmd hide-compile-buffer) - "From LaTeX file, create a PDF (via 'texi2pdf' or 'pdflatex', ...), by -default using the first entry of `ess-swv-pdflatex-commands' and display it." - (interactive) - (setq pdflatex-cmd - (or pdflatex-cmd - (and (eq (length ess-swv-pdflatex-commands) 1) - (car ess-swv-pdflatex-commands)) - (ess-completing-read "pdf latex command" - ess-swv-pdflatex-commands ; <- collection to choose from - nil 'confirm ; or 'confirm-after-completion - nil nil (car ess-swv-pdflatex-commands)))) - (let* ((buf (buffer-name)) - (namestem (file-name-sans-extension (buffer-file-name))) - (latex-filename (concat namestem ".tex")) - (tex-buf (get-buffer-create "*ESS-tex-output*")) - (pdfviewer (ess-get-pdf-viewer)) - (pdf-status) - (cmdstr-win (format "start \"%s\" \"%s.pdf\"" pdfviewer namestem)) - (pdffile (format "%s.pdf" namestem)) - (cmd (if (stringp pdfviewer) - (list pdfviewer pdffile) - (append pdfviewer (list pdffile))))) - - ;;(shell-command (concat "pdflatex " latex-filename)) - (message "Running '%s' on '%s' ..." pdflatex-cmd latex-filename) - (with-current-buffer tex-buf (erase-buffer)) - (setq pdf-status - (call-process pdflatex-cmd nil tex-buf t - (if (string= "texi2" (substring pdflatex-cmd 0 5)) - ;; workaround (bug?): texi2pdf or texi2dvi *fail* to work with full path: - (file-name-nondirectory latex-filename) - latex-filename))) - (if (not (= 0 pdf-status)) - (progn (message "** OOPS: error in '%s' (%d)!" pdflatex-cmd pdf-status) - (display-buffer tex-buf)) - ;; else: pdflatex probably ok - ;; (set-process-sentinel proc 'shell-command-sentinel) - (if (and (and ess-microsoft-p - ;; Silence byte compiler warns about w32-fns - (fboundp 'w32-shell-dos-semantics)) - (w32-shell-dos-semantics)) - (shell-command cmdstr-win) - (message (mapconcat 'identity cmd " ")) - (apply 'start-process (car cmd) nil cmd)) - (unless hide-compile-buffer (display-buffer tex-buf)) - (message "%s finished with status %d" pdflatex-cmd pdf-status)))) - - -(defun ess-insert-Sexpr () - "Insert Sexpr{} into the buffer at point." - (interactive) - (insert "\\Sexpr{}") - (backward-char)) - - -;;; back-compatible wrappers: -(defun ess-makeSweave () "old *DEPRECATED* version of \\[ess-swv-weave]." - (interactive) (ding) - (message - "** warning: ess-makeSweave is deprecated. Do use (ess-swv-weave) instead!") - (ess-swv-weave)) - -(defun ess-makeLatex () "old *DEPRECATED* version of \\[ess-swv-latex]." - (interactive) (ding) - (message - "** warning: ess-makeLatex is deprecated. Do use (ess-swv-latex) instead!") - (ess-swv-latex)) - -(defun ess-makePS () "old *DEPRECATED* version of \\[ess-swv-PS]." - (interactive) (ding) - (message - "** warning: ess-makePS is deprecated. Do use (ess-swv-PS) instead!") - (ess-swv-PS)) - -(defun ess-makePDF () "old *DEPRECATED* version of \\[ess-swv-PDF]." - (interactive) (ding) - (message - "** warning: ess-makePDF is deprecated. Do use (ess-swv-PDF) instead!") - (ess-swv-PDF)) - - -;; AUCTeX integration. This is independent of this library, but it fits -;; here nonetheless since it's an alternative way of Sweave'ing without -;; starting iESS. - -(defun ess-swv-add-TeX-commands () - "Add commands to AUCTeX's \\[TeX-command-list]." - (unless (and (featurep 'tex-site) (featurep 'tex)) - (error "AUCTeX does not seem to be loaded")) - (add-to-list 'TeX-command-list - '("Sweave" "R CMD Sweave %t" - TeX-run-command nil (latex-mode) :help - "Run Sweave") t) - (add-to-list 'TeX-command-list - '("LaTeXSweave" "%l %(mode) %s" - TeX-run-TeX nil (latex-mode) :help - "Run LaTeX after Sweave") t) - (setq TeX-command-default "Sweave") - (mapc (lambda (suffix) - (add-to-list 'TeX-file-extensions suffix)) - '("nw" "Snw" "Rnw"))) - -(defun ess-swv-remove-TeX-commands (x) - "Helper function: check if car of X is one of the Sweave strings" - (let ((swv-cmds '("Sweave" "LaTeXSweave"))) - (unless (member (car x) swv-cmds) x))) - -(defun ess-swv-plug-into-AUCTeX () - "Add commands to AUCTeX's \\[TeX-command-list] to sweave the current noweb -file and latex the result." - (if ess-swv-plug-into-AUCTeX-p - (add-hook 'Rnw-mode-hook 'ess-swv-add-TeX-commands) - (remove-hook 'Rnw-mode-hook 'ess-swv-add-TeX-commands) - (setq TeX-command-list (mapcar 'ess-swv-remove-TeX-commands TeX-command-list) - ;; this will remove the items, leaving nils, so remove them. - TeX-command-list (delq nil TeX-command-list)))) -;; as ess-swv-plug-into-AUCTeX-p is customizable ... : -(if ess-swv-plug-into-AUCTeX-p - (eval-after-load "tex" '(ess-swv-plug-into-AUCTeX))) - -(defun ess-swv-toggle-plug-into-AUCTeX () - "Toggle inclusion of commands to sweave noweb files and latex the results in -\\[TeX-command-list] on and off. Commands are added via \\[Rnw-mode-hook]." - (interactive) - (unless (and (featurep 'tex-site) (featurep 'tex)) - (error "AUCTeX are not available")) - (setq ess-swv-plug-into-AUCTeX-p (not ess-swv-plug-into-AUCTeX-p)) - (ess-swv-plug-into-AUCTeX) - (TeX-normal-mode t) - (if ess-swv-plug-into-AUCTeX-p - (message "Sweave and LaTeXSweave are activated in AUCTeX.") - (message "Sweave and LaTeXSweave are de-activated in AUCTeX."))) - - -;;; Now bind some keys. -(define-key ess-noweb-minor-mode-map "\M-ns" 'ess-swv-sweave) -(define-key ess-noweb-minor-mode-map "\M-nT" 'ess-swv-tangle) -(define-key ess-noweb-minor-mode-map "\M-nl" 'ess-swv-latex) -(define-key ess-noweb-minor-mode-map "\M-np" 'ess-swv-PS) -(define-key ess-noweb-minor-mode-map "\M-nP" 'ess-swv-PDF) -(define-key ess-noweb-minor-mode-map "\M-nr" 'ess-swv-knit) -(define-key ess-noweb-minor-mode-map "\M-nu" 'ess-swv-purl) -(define-key ess-noweb-minor-mode-map "\M-nv" 'ess-swv-weave-PDF) -(define-key ess-noweb-minor-mode-map "\M-nw" 'ess-swv-weave); depends on proc. - -(define-key ess-noweb-minor-mode-map "\M-nx" 'ess-insert-Sexpr) - -;; AND add these to the noweb menu we have anyway ! : -(easy-menu-define ess-swv-menu - ess-noweb-minor-mode-menu - "Submenu for use in `Rnw-mode'." - - '("Sweaving, Tangling, ..." - ["Sweave" ess-swv-sweave t] - ["Tangle" ess-swv-tangle t] - ["LaTeX" ess-swv-latex t] - ["PDF(LaTeX)" ess-swv-PDF t] - ["PS (dvips)" ess-swv-PS t] - ["Knit" ess-swv-knit t] - ["Purl" ess-swv-purl t] - ["View PDF" ess-swv-weave-PDF t] - ["Weave (Sweave/Knit)" ess-swv-weave t] - ["Insert Sexpr" ess-insert-Sexpr t] - ["AUCTeX Interface" ess-swv-toggle-plug-into-AUCTeX - :style toggle :selected ess-swv-plug-into-AUCTeX-p] - )) - -(easy-menu-add-item ess-noweb-minor-mode-menu - nil ;; <= path - ess-swv-menu) - - ; provides - -(provide 'ess-swv) - -;;; ess-swv.el ends here diff --git a/elpa/ess-20181109.703/ess-vst-d.el b/elpa/ess-20181109.703/ess-vst-d.el deleted file mode 100644 index 5a84787f..00000000 --- a/elpa/ess-20181109.703/ess-vst-d.el +++ /dev/null @@ -1,81 +0,0 @@ -;;; ess-vst-d.el --- ViSta customization - -;; Copyright (C) 1997 A. J. Rossini -;; Copyright (C) 1997--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: A.J. Rossini -;; Created: 26 Aug 1997 -;; Maintainer: ESS-core - -;; Keywords: languages - -;; This file is part of ESS - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; This file extends the XLispStat configuration for ViSta. - -;;; Code: - -;;; Requires and Autoloads: - -(require 'ess-custom) -(require 'ess-lsp-l) -(require 'ess-utils) -(require 'ess-inf) - -(defvar VST-customize-alist - '((ess-customize-alist . VST-customize-alist ) - (ess-language . "XLS" ) - (ess-dialect . "ViSta" ) - (ess-object-name-db-file . "ess-xls-namedb.el" ) - (ess-help-sec-regex . " ") - (ess-help-sec-keys-alist . " ") - (inferior-ess-primary-prompt . "> ?" ) - (comint-use-prompt-regexp . t) - (inferior-ess-program . inferior-VST-program) - (inferior-ess-help-command . "(help '%s)\n" ) - (inferior-ess-objects-command . "(variables)\n" ) - (inferior-ess-exit-command . "(exit)\n" ) - (inferior-ess-start-file . nil) ;"~/.ess-VST") - ;;(inferior-ess-start-args . nil) - ) - "Variables to customize for XLS.") - - -(defun VST-mode (&optional proc-name) - "Major mode for editing ViSta source. NOT EVEN STARTED." - (interactive) - (setq ess-customize-alist VST-customize-alist) - (lisp-mode)) - - -(defun ViSta () - "Call 'ViSta', the extend XLispStat statistical system, from Forrest Young." - - (interactive) - (setq ess-customize-alist VST-customize-alist) - (ess-write-to-dribble-buffer - (format "(ViSta): ess-dialect=%s , buf=%s\n" - ess-dialect (current-buffer))) - (inferior-ess)) - - ; Provide package - -(provide 'ess-vst-d) - -;;; ess-vst-d.el ends here diff --git a/elpa/ess-20181109.703/ess-xls-d.el b/elpa/ess-20181109.703/ess-xls-d.el deleted file mode 100644 index 05e29308..00000000 --- a/elpa/ess-20181109.703/ess-xls-d.el +++ /dev/null @@ -1,105 +0,0 @@ -;;; ess-xls-d.el --- XLispStat customization for ESS. - -;; Copyright (C) 1997 A. J. Rossini -;; Copyright (C) 1998--2004 A.J. Rossini, Richard M. Heiberger, Martin -;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. - -;; Author: A.J. Rossini -;; Created: 12 Jun 1997 -;; Maintainer: ESS-core - -;; Keywords: statistics, languages - -;; This file is part of ESS - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; A copy of the GNU General Public License is available at -;; https://www.r-project.org/Licenses/ - -;;; Commentary: - -;; This file defines all the XLispStat customizations for ESS. See -;; ess-lsp-l.el for general Lisp modifications. - -;;; Code: - -;;; Requires and Autoloads: - -(require 'ess-custom) -(require 'ess-lsp-l) -(require 'ess-utils) -(require 'ess-mode) -(require 'ess-inf) -(require 'ess-trns) - -(defvar ess-help-XLS-sec-keys-alist - '((?a . "Args:")) - "Sparse online XLS help.") - -(defvar XLS-editing-alist Lisp-editing-alist) - -(defvar XLS-customize-alist - '((ess-local-customize-alist . 'XLS-customize-alist) - (ess-language . "XLS" ) - (ess-dialect . "XLS" ) - (ess-mode-editing-alist . XLS-editing-alist ) - (ess-object-name-db-file . "ess-xls-namedb.el" ) - (ess-help-sec-regex . "^[A-Z. ---]+:$") - (ess-help-sec-keys-alist . ess-help-XLS-sec-keys-alist) - (inferior-ess-primary-prompt . "> ?" ) - (inferior-ess-secondary-prompt . "^" ) - (comint-use-prompt-regexp . t) - (inferior-ess-program . inferior-XLS-program) - (inferior-ess-help-command . "(help '%s)\n" ) - (inferior-ess-objects-command . "(variables)\n" ) - (inferior-ess-exit-command . "(exit)\n" ) - ;;(inferior-ess-start-args . "")) - (inferior-ess-start-file . nil)) - "Variables to customize for XLS.") - -;;; The functions of interest (mode, inferior mode) - -;;;###autoload -(defun XLS-mode (&optional proc-name) - "Major mode for editing XLispStat source. NOT EVEN STARTED." - (interactive) - (setq ess-customize-alist XLS-customize-alist) - (ess-mode XLS-customize-alist proc-name) - (setq major-mode 'XLS-mode)) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.lsp\\'" . XLS-mode)) - -(fset 'xlispstat-mode 'XLS-mode) - -(defun XLS () - "Call 'XLispStat', the Lisp statistical system from Luke Tierney." - - (interactive) - (setq ess-customize-alist XLS-customize-alist) - (ess-write-to-dribble-buffer - (format "(XLS): ess-dialect=%s , buf=%s\n" - ess-dialect (current-buffer))) - (inferior-ess)) - -(defun xls-transcript-mode () - "Does the right thing." - (interactive) - (ess-transcript-mode XLS-customize-alist)) - -(fset 'XLS-transcript-mode 'xls-transcript-mode) - - ; Provide package - -(provide 'ess-xls-d) - -;;; ess-xls-d.el ends here diff --git a/elpa/ess-20181109.703/etc/ESSR.rds b/elpa/ess-20181109.703/etc/ESSR.rds deleted file mode 100644 index 4ed61c2de13d932fbd5747f17608c089dd47c64e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13189 zcmV;0GkVM)iwFP!000001MPhalq5%SU{y~~&v$2MwI6Bq?cLSvSL*#p2r;LXcC|l! zN2A@8_b6ZFhC6s(NPE2qbLdla1}e7!2GUhk3w(eDVS36XGxi@im7H$8qK( zB;fq~3<3dX8=H5S=k2SkimZyvima-hot5w1yODCMIx90GGBPqU@)vpUu%>ARt*=j&#%GH&t{g*R-SnY>he#V0T)FHu8#dO{3Nz-im zAAGoaS4vQ*obvzuMIv^Vi0!LXDq(bhuY^A7uL(#LBMaAE39&q8z;dge(=my}r3Iti zZk!Ik6uaTGze}VXXtd_6n$dtyW9-unf1~lgGhuwG3-4zL5c&xb&k#8X`jF%Ow zZrUD0f1qKwu7az@TEpExPHj%9l{+p{hI$8hi=E{sq30OG?Se~&olHdER6vUb!PKZu*dO9R;PxLXt)yKejl*qXxb(jNP9^j42ykwW6 zAxl~5#+(%3jrk=Cq^D&!P2Mg9xWz-qjvdWt0AZQyGjr8B(>v}MHM73ot{*gKI&*Vo zJuY)DxgTsBwUfr2&>IQzKRGG4lo`V{rMRIA0+UA{4th@2^$d@)Iz~OeOqM-&41K5M zC}D%N?20eQNYB0!&|X8Ro+L?grtOPuP2$8=a=L-0>CLz5t`t4uSH_VTLLMdz`wFA# z1rN@c#N5b8P?bqmW}G= zvbbK@yg82LUEM8`Tq483J}o67xN#jqw3jwS3>PaKE?BZGCW@_3#+gP*$aZYY<5Jv0 zNq3(cn7kN)7H7FGuf^Zz&DsPhOa&bl%*C{#ihXvo<9dgEn@SUOt=MfY`rW#TB8DqR z8m$?laVU`Zl)9fn?}yR*5qLjFRPF8fTbeNTDidi{pQwSn_Wfuby5DO1J0FjURbRY4Z&XZV9Ew>(7M@bFix0*1zitM%%@V*19IgOBp3`xPwfGfKP zRm!duXsKPOW@N!HPEJlfgrFqU)k8T+lxk}e#kbM6;rM21W!4GhPmy;6mG`{BNM!~N zA0@!>f(iT{VD2UuYGlgL(Bi!1TiSjtCgo&sj2&i zp^j@N#=n}Hd~B##kKhSNuCDKer-fCzYFIQ9NZir-9`BT=npkz}TK*}4K3{U<&xvtB zzt?ItDF&B*c=vkfC%)=Tnha2~hqD)xLcFXZx z-$HSFsQHmv%k~Vvz;^`LAlWb^JB6~2@b@v6U7Yb22|s+-l%`e-MN_0OOa#S!elh)9N!+9&ySWt4f)@n8l8x*A|q_b9oYGs3_U2D}t z-f_g4^G>y9z3QHB&Je{N4l2X)I()?TF9{og99#CYH3dpV4V|ZWh$ z@JX%TAdtmL9rKZn<;e42{R}*z0F!2Ui!wp`eG_!Cp3HtNSwV^dt(3G0B!@(@ACj75v;YI<45kU18PpQNJHKwN&Ft*C|xFTFRgbf4) z;l(|b-B*bSYnXr>qt^EV()V{`#yuewLNb@#R>!HKu9s!|KsOBR{mE_^*!v%J!%&2B zKP3yy$gFYFj6o7J@W~A_!D8WEb}&1z|F+viQ4HqUGIaPgD2^|xrLDq+ z4f$3ux*!z8z|sWUdd7ozuqclD*0k%l*(#TQ==or9AV=GsCR?kk#%)EGoY6pb**=S4 z=*mQiWa>hFMu`Idy6;#acgH7xG4*f$!(T z_e+3Rn}OGiXBWbA4OA>!_S@ozexP>157+u(5b`n_wgXHCdn2O>V2((z=An)@BUr~F zZXKjybnNiMDv6%0kcZQ=67ukL4F75<(^|l>2GXoUbX)*%*8AaVfX}{P1Zg;3YXJ5s zfXT{onIA6oS$7b=mw^Y2rndkM8zKGW@SFfzHUXZ^h!*yKFO=;h#4$SVgE$6zn;(7! zU~dPQSHSa1ps51Ccf#)r055yr1$cHK{EWxHig?Fq*$ZhbKQPVzCO_OCmRY+S;;x4@ zJ`DW;(De$y|4P7lE&P5J{GJ4Uu=jrfxUK;>*P;5m9{9Hp^6y9aZba_~0LBdx3|5ZA zS}13S{O~NI|2V|4`aJ?=xe0iDvmai7{MSMLTm0}%sZMW$=k0+1Rw&ODz`q62!+88{ zEh)zw2bbe%$a5$9ekag*9C&$`7Rm{;BmO}X<>VNY!LJ{E7tnhT(0Ly`Uk%R_nkX;# zYifD97wCEb(O(7J4uUI(5o(CY!c zk7%Jz#WL9OqYS{m4(hW5=@zw6-!UDnp+1)V{`)Wve@ByVUaM`*+I)**ltEWyU<0Mv zyy5r7UNG%kh|@gXg|uhT6T>WsFxSdN_KDxO%HNCP_x1R@j331ZmBBkP`Fk4E`V~AF zSTr0vny-vLkE0}e%!bK^t!}wBTi(LD>Mdns)@NDSn>Wj|mg9QmMXS*$&zNOv&Tcuu z!V$%^l1RiLRcM@kKukZHmR`ji)f3|xOs5NtOia7tN|}c=bxpGG!#RN$+_py6B^uj{PhyJ8|1ni*XWvww)aqysNz_jX1hvLs~P|AnQl%v=V>`5e74m|h{0+x z^P^eKc8!>RA~CJfZn+|Zw{X5-8(q`Hij(=qP_0ej5Bt7O{5~a-{weAAC#m{jaL!NX z-=}1}7l`S%DOh%QSLDNX_|4^dhs+oLm&KR$DfFgj)K5?iK!(rDtHPfqhZm;vF;<2R zOUikXMhexZB@V_NTifvbKFSV1Ki!L|REmfpGo>Qb!*CMGBY|whE znT_dmCem*b(;t?4}{?{xisA%a@uv3Ama6Q%^GLh^rsPBE6 z@F!#6B|`t0jD5HG{eANHJqqdu?K#u$HBR9XBt_#m%CmZ+UT)QD9mg^4nm+=v%M)%& z@-;$oH%c!TQ%1|kzDirVs>Sf5E~VaT8Wwbsq0~JtGF|n=R9&r|J6nUne}&eY!r-=d zo^qs>>l#fh;{M-9p7j8*Ky>*&9!2Nhbaaj!h)SyEZ?iNp2Xl2S#5c8 z8Q}4!&-jnB?>~h&W}veQVe=16z}AFmg2_Gh?1QvmvjldUpS~~1^EhXuP@%%YMYI(H z9iO||uA8S~de(D#iXskSkoHqVOV~t0t@2YXp5Vv$mNqHEpbfyY1kWLOg3|wEj&(5n zJ;HyFB5oEDH#vv;r2M0ZlSPS>dhcBP1cy5k{*D%DaDEtavt-b1f0Acg0nadb*xK3e zmErGa`0rKW???IX)%lA3G)})<#pZZdXvx(fCM1^uem?uo=-Z5F<5dhoABlOE>c$vV5d8m^$2w5K;cbi2eNm6~ zc+v9m@zXi$@#%Af|FgJ_>o68!crFZoU%-D~q9xULazY|UNj`%iE@MeP2PJrn!@n4w zwn?pEX;P@us$p-Rc zT5|J6CcHQNGvVESF7WCwJ;2~@4}X7=|GpBQY-S>o zoqbyL$G+`^X9b?SP+3Mb+S20taW2u+R@UzD_xrjz;B5qW8&lxz34i~2PK_S5pFPXS z>v1WaVzNO_rkZ5nWQ{(q_4>Emq8YJk_cF4J;~mk&(I#IrWpQlF0TY4ah^8XYa+MZ$ zExg%s+D0VW@LvJKQu+0A)yuFZPV@NX_>w#t)_@nUfTuLQBO7X8Ni)(-jYs23U=WOoLc=%dv`Q(?w83Z^fe=lphc$Fr! zi%+~+Z$n|nGKAd_ zwn>50vIoM|C|nAG|K@3UnXfsEuos0JmKYAAa2UcN6gd6-_Ynv;LAV)(>mb~M!mSx$ z3Ib1m2ZWoYFr5;PqHrgK;}GtGa0~@5C;a!_DBQb@;XxE0N(lxEochPkgVa%Rg)qc zCF=9P6Vh8`MU2$PvyQRaqtR?9>bJ{yf3Rq$jx9xsJ)b2di4fw-AO!$QC=YBeI4`<=O)LP;PRT^s3|=Q0`~ z2mb_$!wv?&4)1MQD8@bKbcH#0MNTf|!*48oFlQopy-q7$-#jiB3*Uhx-<6Y&R(v(d z*l^g2e4Z6@9^@}r_4w-rRDBQmQr`&{MQL&#Nr>9f`f+2G95F(xjowZH{tEV}g z;qo0#f1N{n$1=iNv}-Dy-u)F(*MH69RP~j{%zn!=n}|&$KZ`6;IxD}2%J?E;-uJt` z^XmsW`1K-+8oQcd<^?0t)-S0Fno{}L zm%~;_6=z;q_oiy1IlDT=`Nz!y<)0WX69;{AMc<>0L+aaJ`gWB`-pV!b$cb+DUm_o zj}Y~T-J0OG^_MAiiT$fSm(liq(qmIOCrvJ`zA;Dj9XW(S0{C94k_*Gb1o%-Sameu^ z#7fca=WwzNgin3uYouKP7nOMY^A6ybcv9bWYO%+!v~ka8QQQo?|2b+c6Dg&ySxCB1640I>I*TwD0`HK5 z^Hac2;l%3wFePi_;CD>&-YdGC<5-hS#khV(m2W-ITejS?-SW!d?a@@}oFY53O8^?< z=OfCTV|h%Z(THJ!_w@TIQd5eVfIDEG3j9A31z7D5s3LA25|S+y+X}z7-D-%E^1&)j z2Kdc8p1Ju))Utn(#~dHE*c~X2>s7-U3rL5RU==m$ykp}ZqPRQJy9@7Cxx**Aob?zM zO7nS?=75Y((UCq!;madYgF#&g&ba#^%|F5OJ!(GdS~rm|itAER*%zY9B5ODx%T`?f zRCHU8r^yu%A{Gm+b4`+T_QTw$2L59`Uk$Zgjh^UQ;eTUZTWxRpWH7GFeNj&PBpwGg zQCb*r=tV%*V87FRXUAhl9p5TOTI0arUVNbUTkgT=im6iMz*R41;VOoVlaawmF}(!O zK`h`>xzZfNW=hGpU)F=Xe(n%1Cc=$!R4k7^plF=$qXc&B;GyZs3AcP=!hN7zE(;~Y zV@Z9es~Ec#t|$}u(yWlsrBL0Poi!bmU>0U~YsBSuvwPGssu~=<2TCv^DIy*}N+8tMpC)nZD^hS{SU*(I{zEFi!g@WNq*EVB$)Bt%X1|2F331^l??KOEk6-u73w`gc|^f>Uj^&o3|1M+_qV> zuv^#PBy0D?aV1|o>*j2nVj8nTrg5+mO>M9$Ju0g^LL~lz zf-}k*%zpbczbysQehqN1$*4kV(MGnUC~o~wuD)f0yOc5}E}Km2?25C^2I}BknYMIu z%FipCQ`~G?n_}OQ-lL0i(U4OdU2h~J3-@n~KER@A zSRGXj@d_x?6zJcwb;8{iCz_@b6}E=u)z^_AHkK>pjS_E#>>IbK+ZAbE=;fROG~ka@ z#l?xWSX*F{OTx63qT2Qnks1=0QrbElAMo#Y(DE3qaJ1}7&o#HDu)HX-$5XzfC=6`b zx^cqYm=uN}D_Ku{8-t3^Ra5@xUi8}h`-q@-_n^UGEUA-|ri24xi4SBpEs65IS^PS0 zD{Eh6#4S%f=;C48ald|4OQ?uEMqMG9P5DhWoiNyeko{=6bB2fDOdVSVE?lBMcEdXB#e}SmB?l*M*|;xl@^uL4JkO}j<7>giZP_ec#zih@MCn!6z@>X zWBlxqtdKv+>i&ak!h#LF?D}xFSVG^b(P`Ji%fnSZ=1Y#*3@;s07}ZJpb-sm1E`-so zzfvkr#zKm)*uw&!zfA1691jY6@U&l1RticMqyWoXsNRnq>!wd_q_Jx&YipWyt1;(|8MssB3%OTa|*zm}gDouof;e)JC2s?5<8-5Cpmk|J&%?LhC#GifOOs{G z91;&)G~r%4;f5zRbr{m=iHq6gmVF*yyJVN;9E0mkFcY3YdjA9H{Yms5Gm2T4ar{BK zWLg;i!KE0H{cIKk8H;!$6yLGH@1$2v;^0v+ziUtEIH(>sMf2P!X`Y{>G_mppA9=Gx ztxZmc4LR%S}+_W{P2JM8^%5hl+Y;gnS#QFU>F zo0boTdvbq5A_eZP)Ax7d;~4Vf4hGBbO@D$a{t(_!h5+!1m#UmuY774nrDMcA1;p?+ z`GIcSCi#s%Am&JKD&xPgq*cbX=-iMAFOXnwM;ZB z)L`_36rihawtdB9`9klT)@6QRVzOMGV-3YFw`Lypjeh1-E*MJ&?Igt{ zYHPwmC#%zOxV@)gR+yzDU-!wCDW&jo-&Z#hfHzP1)-*Z_A`5U15S&611kv{m8#7Yf2 zcX|veodZkU>X^aEC-Nd23z4x=xh-@&@02y$@NCC7Iptf_GmeA2L8b@uSIaI(Y>hN5 z8{erZwh_B!ckmQ`o+97Ysu{#xk}{DTafUin65dy9#f0g1rPqsocQ=Eak`J!aw0kEA zZ;&VZqZM1jwW7NJKdcq;YSWLS%y4o+zo(l)02KhndofXx-Tg;hrLGH`a7kJpQi#sE zx)~6QH@T&xzz?A=O4Qw<6dlhsF;Txq`(xsXt7nublp7u-4#+t;+H#C=WU z6b0LEm(QY4Au0gxgtok+P#A)z^3a>U*L&2vFtLU9#*z4pL*>4*a zhb?TS*kdHnh}!^CpQCg~7L>Sl&Jql-%^YC#x`JU}B)e3LjlE*v(Av}pFuf@Q4U9Oe zw&Mm8o_-LEI@1k8DpqoKMt_uuT;Z3uZg@sz)`_+=y{@aEXUI?N)8kmDq=Y$i`rnYE zYCEk(8Y%2X&_P}54`txuJ4Q^Mt%^w~kJkhI zMB2PnUKI8I#bTu{akki95a)JBeF2 zyEIKCG^TH6jd%lsoCylRHN5I6S!%4$H~B_w86@fy^pi5JN;B9o+l*;Rtb89;VuPZp z+elWEj)noe0qeq$jS%XXg}#EV#AcR`EYp}MrL@*tW?7}B3fou_NVEuM>Q<& z3@QV!B!c*U$zM+Cda%wQx3l!K<=CxS+_NO=cH87|#&HsYHAj?}C zW}V(v0n&05xFZ!f(UG3XA}kPtlxgHx?jDWpIsKPtX6dI=tRlP@_sggZrj&>A;LdKW zE<~|?q|=hOrzl9*U!$neZ0YoeV}XZ-6eXQ$tS1`1#AFilP}o;YmZikxKIRhcSV&8d zkb)0$NQ!jCu~XPuAddFm52ixerh3J)DSb}$$j%M=VOn9fYgP1}$( zI%_lpw@A!0>#vkn52`DO1KfGDvorMGrNj`=f18)Bhj72ZN6r-*+g`u z)$!ULk4{Yu3*UkVl)4X1bf3fOmI*f2tSvjm?~FnkdFJF?QjuqXwT!vG<6EHgh;r>iZeYAbYisqM6y zZ8(b|YV{fz2AWc|@|SK48bAcg*Kx-`iNvR8$>$gQ?n4UfP$^fC!W4!z6G z!v2nwlcoKve|seUK&qvIm?XhOa!*?A13tInrIkoLIWlaXvwD>YA!#4;Y4;5;%W2t7 z(^eD#tFzxj@06;WikiOFh8B_^Mn>tWNgc06$^?#4zD7Rm#&K-{}Z-e)$Bq#V> zE%G>|zei3_X=q7KR9>J28Cnyl8()U1wa90Bh5^tai5EoT>Db!{%5yGvex+O%5yAp!90LlMyf_$ z%ZKWg?e~)2?WQ;1s;ith4SHv;2)dkA~6Gzc^w zBE*0OHGPs8)5;X5S@%@w5@xB6gqI<=-5JvWJCrnQ@@!;~E z>Pg#@jzHp5Qcq$eN?W>N%{aj>DE8@J(Ph!zg0fOG4LltlV*L)04)~-=37}hO6_p5b?3lM{~^f0?fhTYT1-SYvPTI+%Hbr zycbSS_{O0(kZK4Pj_+q1wHq`*a&O<@gMNYi!ctrOaJs&!L-$BYP-W613@^~}n$OSY8h|8sA^KG>c-O@8hfN;nO@*wKsttorarlOQfb+8%B*3+vncMIGDbm1Tur|5*a;*LzVH)# zPjuskMV;Dv3Kn8`WBH(}!;(sVqoU+F55_KwNTeKwrO);qI$+payfV9Os%)TBu4vAu zTx&UwAKkL+mOaN#jYDG!l9#tcr~P_42TKwEMv3@A94}X|Waw8zl`L@~t0|B8?btV1 zrxa@&rNdSux`E(vL`A|`gMwhZi=nRt3@|(U7nK?W}P?4E6Nk@6=iTTU7mGX&8VqbwjbyCNrTvM9s7##g7pO9?wznjqmVcruK!tA zDp1b$o~#z5(YPZxI86GbYVl9<`sEgEzNnpn>VJ;vWR!?gdANR*NJ}0w7^~Ezlkjp1 z>co9^KZ3NAKbkbA4UgR_fp}C(IiSC)a-2{Zug2T$kaQsm44k%Hw?>8 z2tW@trDOm5V5jR}#`(`Azkfyk-b;Njvcmy>z~l_Fl_X_Wg^wm+>_KxjCk|z?R5+M_ z=-QNtsc7y=F|fnSglshT4vBF{n%Ai4-R39GSo92y~_J{bI`8h z|97)ANJ@M8CQ(PVqt6B=tUtdJpM0O-@AuDwzX`d|!QUw{Z&*h;__!Pv*4freqTlPWUQ{c? zFB0|g;u7lRWy77bC;FZOC+aHcCBcCMw;dCEoqvF=U!js~ak^=QdilE4?<)%O{JAg4 z_m{OGFDeT1+_^8vi%Tv@av3}H6|%pQ2hs8 zHQ6K$7)IY@WxJY(lPREM+bHBnwrv#cBQM-3LOj4 zpN2e3;6=`E@g)ThGA1Wz9t_@o==e?anE9n;?aY6a-I-GZ{hq1*(b-ZRZs5+-SrnTt zz6Kbdn#A+c6gOUwxIs^6Oy7EBQrIsxjk4z~WC{`T={=H&($q1UhUb@shN4J=-Y3Ur zG_xCI?Ti3*uMDG!za=?fhTdC7RITr zuz3p6M;$!5ISF6CMHV5Au2ss92gjGz1fNpC*b49DG3g>ZYcIkUydkQtNlP1h6!5*P zxljG~T~)bS1gyMbrWEWc;ke^9K9mMf!!3vKf)X8eZVU&(HS@ zvda&r<(+zm6d9BYX9wrj!o}Ba46U*nF?npfKy#Chz%6~)Qv})KkMe( z?hyfA(Xkt?+Q}QO;2>EHFs0pTXei7DKFp)&EL6%mCp`U3S3&$pHtFh0Pl_?GbopI2 zelHA+-}=m4b+%#n|FoQHaBWCp0my&J*vx-MvQ9Ka35iBQZoChI)yUO@U zF|yu^(WCgc%khdJG=b3Z+#oAF@+K&GV{5}=( z&CnC=s~}jkIolEG#rT5ZP33zSZROy;c*`xD&9--X!!VKdvQ1^99R3+?wn?*Wn~UYR zOmr3tvV^C1v$KqCDxZWbC#~ovKAhr`O=S~On03nwZo5teIligvKnBM|W)4ns-lnp> zvmKPvTmva1ER=JSj{9Bg zqn+^3o1lst!f!0n2rGnBpk355VqTlVm&efi<`f#Z z(%pvQwxPoF{F}SIZ{nXKV8_PTOgLz|*}cslL7C`QIE|C6?$GpZSCJml?v%bimbWMp zTL@2-`X`{_WL>4H8h<7{Q^x5EnyOqhi=*>nn8k-FcCSXBTSS%%C=^}blG&+%hkRJj zgQcwp4BKYc$Oldo$`4Jr5BWA>xe?G^R(c+0)w5ScheQwMuUgb772mMGak}Ea7DGtU rP+_$nE+Ig_OhF(s^s~msAPc4gHZ5jl-|lE(APD~lN1`8B#0>!eI;Q5l diff --git a/elpa/ess-20181109.703/etc/ESSR/VERSION b/elpa/ess-20181109.703/etc/ESSR/VERSION deleted file mode 100644 index 840ca8cb..00000000 --- a/elpa/ess-20181109.703/etc/ESSR/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.4 \ No newline at end of file diff --git a/elpa/ess-20181109.703/.dir-locals.el b/elpa/ess-20190121.1430/.dir-locals.el similarity index 85% rename from elpa/ess-20181109.703/.dir-locals.el rename to elpa/ess-20190121.1430/.dir-locals.el index af831399..0cefb6e1 100644 --- a/elpa/ess-20181109.703/.dir-locals.el +++ b/elpa/ess-20190121.1430/.dir-locals.el @@ -7,4 +7,5 @@ (sentence-end-double-space)) (emacs-lisp-mode (outline-regexp . "\f\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*") - (indent-tabs-mode))) + (indent-tabs-mode)) + (ess-r-mode . ((ess-style . RRR)))) diff --git a/elpa/ess-20181109.703/allnews.info b/elpa/ess-20190121.1430/allnews.info similarity index 95% rename from elpa/ess-20181109.703/allnews.info rename to elpa/ess-20190121.1430/allnews.info index e3674a7a..7116607a 100644 --- a/elpa/ess-20181109.703/allnews.info +++ b/elpa/ess-20190121.1430/allnews.info @@ -1,7 +1,96 @@ This is allnews.info, produced by makeinfo version 6.5 from allnews.texi. -Bug Fixes in 18.10.2: +Changes and New Features in 19.04 (unreleased): + + * Implement a more reliable check for the process busy state. + Background actions such as completion and directory synchronization + should not block the process and should not cause printing of the + extraneous output to the interpreter. + + * Activate 'goto-address-mode' for url and emal highlighting in + inferior buffers. + + * 'smart-underscore' and 'ess-smart-S-assign-key' have been removed. + Users who liked the previous behavior (i.e. underscore inserting + "<-") should bind 'ess-insert-assign' to the underscore in their + Emacs initialization file. For example, '(define-key + ess-r-mode-map "_" #'ess-insert-assign)' and '(define-key + inferior-ess-r-mode-map "_" #'ess-insert-assign)' will activate it + in all ESS R buffers. + + * ESS major modes are now defined using 'define-derived-mode'. This + makes ESS major modes respect modern conventions such as having + -mode-hook and -mode-map. Users are encouraged + to place customizations under the appropriate mode. + + * New option ess-auto-width controls setting the width option on + window changes. Users can change it to 'frame, 'window, or an + integer. See the docstring for details. 'ess-auto-width-visible' + controls visibility. + + * ESS now respects 'display-buffer-alist'. Users can now use + 'display-buffer-alist' to manage how and where windows appear. See + *Note (ess)Controlling buffer display:: for more information and + examples. + + * 'ess-roxy-mode' can now be enabled in non-R buffers. This is + primarily intended to support roxygen documentation for cpp + buffers. Preview functionality is not supported outside R buffers. + + * ESS[R]: DESCRIPTION files now open in 'conf-colon-mode'. + + * 'ess-style' now has effects when set as a file or directory local + variable. + + * 'ess-default-style' is now obsolete, use 'ess-style' instead. + + * Options for 'ess-gen-proc-buffer-name-function' have been renamed. + ess-gen-proc-buffer-name:projectile-or-simple was renamed to + ess-gen-proc-buffer-name:project-or-simple and + ess-gen-proc-buffer-name:projectile-or-directory was renamed to + ess-gen-proc-buffer-name:project-or-directory. As the name + suggests, these now rely on project.el (included with Emacs) rather + than projectile.el, which is a third-party package. + + * ESS[R] help pages now provide links to other help topics. This is + similar with what you would see with, for example + 'options(help_type = ``html'')' but works with the plain-text + version as well. This only works with 'options(useFancyQuotes = + TRUE)' (the default). + + * 'ess-rdired' buffers now derive from tabulated-list-mode. They + should look better and be a bit faster overall. The size column + now displays object sizes in bytes. + + * ESS removed support for many unused languages. This includes old + versions of S+, ARC, OMG, VST, and XLS. + + The following have been made obsolete or removed, see their +documentation for more detail: + + * Libraries for literate data analysis are obsolete and not loaded by + default. This includes 'ess-noweb', 'ess-swv', and related + functionality like 'Rnw-mode'. Users are encouraged to switch to + one of several other packages that deal with these modes. For + example, polymode , + , or markdown-mode with edit-indirect + . + + * User options for controlling display of buffers. This includes + 'ess-show-buffer-action', 'inferior-ess-same-window', + 'inferior-ess-own-frame', and 'inferior-ess-frame-alist'. See + above about ESS respecting 'display-buffer-alist'. + + * 'inferior-ess-*-start-file' variables. All modes except Stata did + not respect customization of this variable. In order to load a + file on startup, you should put a function on + 'ess-*-post-run-hook'. + + Bug Fixes in 18.10.3: + * More 'Makefile' fixes, notably installing '*.el's. + + Bug Fixes in 18.10.2: * ESS[R] Fix namespace evaluation in non-installed packages. Evaluation is directed into GlobalEnv as originally intended. * 'Makefile' fixes, notably for 'make install' and including full diff --git a/elpa/ess-20181109.703/announc.info b/elpa/ess-20190121.1430/announc.info similarity index 84% rename from elpa/ess-20181109.703/announc.info rename to elpa/ess-20190121.1430/announc.info index d7109458..9eb70b9f 100644 --- a/elpa/ess-20181109.703/announc.info +++ b/elpa/ess-20190121.1430/announc.info @@ -7,7 +7,7 @@ File: announc.info, Node: Announce 1 ANNOUNCING ESS **************** -The ESS Developers proudly announce the release of ESS 18.10.2 +The ESS Developers proudly announce the release of ESS 18.10.3snapshot Emacs Speaks Statistics (ESS) provides an intelligent, consistent interface between the user and the software. ESS interfaces with @@ -42,7 +42,7 @@ File: announc.info, Node: Latest Version, Next: Current Features, Prev: Annou 1.1 Getting the Latest Version ============================== -ESS supports GNU Emacs versions 24.3 and newer. +ESS supports GNU Emacs versions 25.1 and newer. ESS is most likely to work with current/recent versions of the following statistical packages: R/S-PLUS, SAS, Stata, OpenBUGS and JAGS. @@ -213,7 +213,7 @@ File: announc.info, Node: Requirements, Next: Mailing List, Prev: Current Fea 1.7 Requirements ================ -ESS supports GNU Emacs versions 24.3 and newer. +ESS supports GNU Emacs versions 25.1 and newer. ESS is most likely to work with current/recent versions of the following statistical packages: R/S-PLUS, SAS, Stata, OpenBUGS and JAGS. @@ -306,7 +306,96 @@ File: announc.info, Node: New Features, Prev: License, Up: Announce 1.12 New Features ================= -Bug Fixes in 18.10.2: +Changes and New Features in 19.04 (unreleased): + + * Implement a more reliable check for the process busy state. + Background actions such as completion and directory synchronization + should not block the process and should not cause printing of the + extraneous output to the interpreter. + + * Activate 'goto-address-mode' for url and emal highlighting in + inferior buffers. + + * 'smart-underscore' and 'ess-smart-S-assign-key' have been removed. + Users who liked the previous behavior (i.e. underscore inserting + "<-") should bind 'ess-insert-assign' to the underscore in their + Emacs initialization file. For example, '(define-key + ess-r-mode-map "_" #'ess-insert-assign)' and '(define-key + inferior-ess-r-mode-map "_" #'ess-insert-assign)' will activate it + in all ESS R buffers. + + * ESS major modes are now defined using 'define-derived-mode'. This + makes ESS major modes respect modern conventions such as having + -mode-hook and -mode-map. Users are encouraged + to place customizations under the appropriate mode. + + * New option ess-auto-width controls setting the width option on + window changes. Users can change it to 'frame, 'window, or an + integer. See the docstring for details. 'ess-auto-width-visible' + controls visibility. + + * ESS now respects 'display-buffer-alist'. Users can now use + 'display-buffer-alist' to manage how and where windows appear. See + *Note (ess)Controlling buffer display:: for more information and + examples. + + * 'ess-roxy-mode' can now be enabled in non-R buffers. This is + primarily intended to support roxygen documentation for cpp + buffers. Preview functionality is not supported outside R buffers. + + * ESS[R]: DESCRIPTION files now open in 'conf-colon-mode'. + + * 'ess-style' now has effects when set as a file or directory local + variable. + + * 'ess-default-style' is now obsolete, use 'ess-style' instead. + + * Options for 'ess-gen-proc-buffer-name-function' have been renamed. + ess-gen-proc-buffer-name:projectile-or-simple was renamed to + ess-gen-proc-buffer-name:project-or-simple and + ess-gen-proc-buffer-name:projectile-or-directory was renamed to + ess-gen-proc-buffer-name:project-or-directory. As the name + suggests, these now rely on project.el (included with Emacs) rather + than projectile.el, which is a third-party package. + + * ESS[R] help pages now provide links to other help topics. This is + similar with what you would see with, for example + 'options(help_type = ``html'')' but works with the plain-text + version as well. This only works with 'options(useFancyQuotes = + TRUE)' (the default). + + * 'ess-rdired' buffers now derive from tabulated-list-mode. They + should look better and be a bit faster overall. The size column + now displays object sizes in bytes. + + * ESS removed support for many unused languages. This includes old + versions of S+, ARC, OMG, VST, and XLS. + + The following have been made obsolete or removed, see their +documentation for more detail: + + * Libraries for literate data analysis are obsolete and not loaded by + default. This includes 'ess-noweb', 'ess-swv', and related + functionality like 'Rnw-mode'. Users are encouraged to switch to + one of several other packages that deal with these modes. For + example, polymode , + , or markdown-mode with edit-indirect + . + + * User options for controlling display of buffers. This includes + 'ess-show-buffer-action', 'inferior-ess-same-window', + 'inferior-ess-own-frame', and 'inferior-ess-frame-alist'. See + above about ESS respecting 'display-buffer-alist'. + + * 'inferior-ess-*-start-file' variables. All modes except Stata did + not respect customization of this variable. In order to load a + file on startup, you should put a function on + 'ess-*-post-run-hook'. + + Bug Fixes in 18.10.3: + * More 'Makefile' fixes, notably installing '*.el's. + + Bug Fixes in 18.10.2: * ESS[R] Fix namespace evaluation in non-installed packages. Evaluation is directed into GlobalEnv as originally intended. * 'Makefile' fixes, notably for 'make install' and including full @@ -592,17 +681,17 @@ Bug Fixes in 18.10.2:  Tag Table: Node: Announce75 -Node: Latest Version1303 -Node: Installing from a third-party repository2246 -Node: Installing from source3197 -Node: Activating and Loading ESS4793 -Node: Check Installation5871 -Node: Current Features6095 -Node: Requirements7638 -Node: Mailing List8073 -Node: Reporting Bugs8799 -Node: Authors9679 -Node: License10363 -Node: New Features11013 +Node: Latest Version1311 +Node: Installing from a third-party repository2254 +Node: Installing from source3205 +Node: Activating and Loading ESS4801 +Node: Check Installation5879 +Node: Current Features6103 +Node: Requirements7646 +Node: Mailing List8081 +Node: Reporting Bugs8807 +Node: Authors9687 +Node: License10371 +Node: New Features11021  End Tag Table diff --git a/elpa/ess-20181109.703/authors.info b/elpa/ess-20190121.1430/authors.info similarity index 100% rename from elpa/ess-20181109.703/authors.info rename to elpa/ess-20190121.1430/authors.info diff --git a/elpa/ess-20181109.703/bugrept.info b/elpa/ess-20190121.1430/bugrept.info similarity index 100% rename from elpa/ess-20181109.703/bugrept.info rename to elpa/ess-20190121.1430/bugrept.info diff --git a/elpa/ess-20181109.703/credits.info b/elpa/ess-20190121.1430/credits.info similarity index 100% rename from elpa/ess-20181109.703/credits.info rename to elpa/ess-20190121.1430/credits.info diff --git a/elpa/ess-20181109.703/currfeat.info b/elpa/ess-20190121.1430/currfeat.info similarity index 100% rename from elpa/ess-20181109.703/currfeat.info rename to elpa/ess-20190121.1430/currfeat.info diff --git a/elpa/ess-20181109.703/dir b/elpa/ess-20190121.1430/dir similarity index 100% rename from elpa/ess-20181109.703/dir rename to elpa/ess-20190121.1430/dir diff --git a/elpa/ess-20181109.703/ess-autoloads.el b/elpa/ess-20190121.1430/ess-autoloads.el similarity index 52% rename from elpa/ess-20181109.703/ess-autoloads.el rename to elpa/ess-20190121.1430/ess-autoloads.el index af44f7e1..a04d2710 100644 --- a/elpa/ess-20181109.703/ess-autoloads.el +++ b/elpa/ess-20190121.1430/ess-autoloads.el @@ -9,111 +9,17 @@ ;;;### (autoloads nil "ess" "ess.el" (0 0 0 0)) ;;; Generated autoloads from ess.el -(autoload 'ess-mode "ess" "\ -Major mode for editing ESS source. -Optional arg ALIST describes how to customize the editing mode. -Optional arg PROC-NAME is name of associated inferior process. - -\\{ess-mode-map} - -Extra binding to note: 'ESC C-\\' indent-region. - -Entry to this mode runs the hooks in ess-mode-hook. - -You can send text to the inferior ESS process from other buffers containing -ESS source. - `ess-eval-region' sends the current region to the ESS process. - `ess-eval-buffer' sends the current buffer to the ESS process. - `ess-eval-function' sends the current function to the ESS process. - `ess-eval-line' sends the current line to the ESS process. - `ess-beginning-of-function' and `ess-end-of-function' move the point to - the beginning and end of the current ESS function. - `ess-switch-to-ESS' switches the current buffer to the ESS process buffer. - `ess-switch-to-end-of-ESS' switches the current buffer to the ESS process - buffer and puts point at the end of it. - - `ess-eval-region-and-go', `ess-eval-buffer-and-go', - `ess-eval-function-and-go', and `ess-eval-line-and-go' switch to the S - process buffer after sending their text. - - `ess-load-file' sources a file of commands to the ESS process. - -\\[ess-indent-command] indents for ESS code. -\\[backward-delete-char-untabify] converts tabs to spaces as it moves back. -Comments are indented in a similar way to Emacs-lisp mode: - `###' beginning of line - `##' the same level of indentation as the code - `#' the same column on the right, or to the right of such a - column if that is not possible.(default value 40). - \\[indent-for-comment] command automatically inserts such a - `#' in the right place, or aligns such a comment if it is - already inserted. -\\[ess-indent-exp] command indents each line of the syntactic unit following point. - -Variables controlling indentation style: - `ess-tab-always-indent' - Non-nil means TAB in ESS mode should always reindent the current line, - regardless of where in the line point is when the TAB command is used. - `ess-auto-newline' - Non-nil means automatically newline before and after braces inserted in S - code. - `ess-indent-offset' - Indentation of ESS statements within surrounding block. - The surrounding block's indentation is the indentation of the line on - which the open-brace appears. - `ess-offset-block' - Indentation of blocks opened with curly braces or anonymous parentheses. - `ess-offset-arguments' - Indentation of function arguments or bracket indices. - `ess-offset-arguments-newline' - Indentation of function arguments or bracket indices when the opening - delimiter is immediately followed by a newline. - `ess-offset-continued' - Indentation style for continued statements. - `ess-align-nested-calls' - Functions whose nested calls should be aligned. - `ess-align-arguments-in-calls' - Calls in which arguments should be aligned. - `ess-align-continuations-in-calls' - Whether ignore indentation after an operator in calls - `ess-align-blocks' - Blocks that should always be aligned vertically. - `ess-indent-from-lhs' - Whether function calls given as argument should be indented from the - parameter name. - `ess-indent-from-chain-start' - Whether to indent arguments from the first of several consecutive calls. - `ess-indent-with-fancy-comments' - Non-nil means distinguish between #, ##, and ### for indentation. - -Furthermore, \\[ess-set-style] command enables you to set up predefined ess-mode -indentation style. At present, predefined style are `BSD', `GNU', `K&R', `C++', -`CLB' (quoted from C language style). - -\(fn &optional ALIST PROC-NAME IS-DERIVED)" nil nil) - -(autoload 'ess-dump-object-into-edit-buffer "ess" "\ -Edit an ESS OBJECT in its own buffer. -Without a prefix argument, this simply finds the file pointed to by -`ess-source-directory'. If this file does not exist, or if a -prefix argument is given, a dump() command is sent to the ESS process to -generate the source buffer. - -\(fn OBJECT)" t nil) - (autoload 'ess-version "ess" "\ Return a string with ESS version information. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess" '("ess-"))) +(autoload 'ess-submit-bug-report "ess" "\ +Submit a bug report to the ESS maintainers. -;;;*** - -;;;### (autoloads nil "ess-arc-d" "ess-arc-d.el" (0 0 0 0)) -;;; Generated autoloads from ess-arc-d.el +\(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-arc-d" '("ARC"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess" '("ess"))) ;;;*** @@ -121,7 +27,7 @@ Return a string with ESS version information. ;;; Generated autoloads from ess-bugs-d.el (autoload 'ess-bugs-mode "ess-bugs-d" "\ -ESS[BUGS]: Major mode for BUGS. +Major mode for BUGS. \(fn)" t nil) @@ -144,54 +50,19 @@ ESS[BUGS]: Major mode for BUGS. ;;;### (autoloads nil "ess-custom" "ess-custom.el" (0 0 0 0)) ;;; Generated autoloads from ess-custom.el + (put 'ess-style 'safe-local-variable #'symbolp) (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-custom" '("ess-" "inferior-" "comint-highlight-prompt" "SAS-mode-hook" "S+" "S-" "Rnw-mode-hook" "R-"))) -;;;*** - -;;;### (autoloads nil "ess-dde" "ess-dde.el" (0 0 0 0)) -;;; Generated autoloads from ess-dde.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-dde" '("ess-"))) - -;;;*** - -;;;### (autoloads nil "ess-font-lock" "ess-font-lock.el" (0 0 0 0)) -;;; Generated autoloads from ess-font-lock.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-font-lock" '("ess-font-lock-"))) - -;;;*** - -;;;### (autoloads nil "ess-generics" "ess-generics.el" (0 0 0 0)) -;;; Generated autoloads from ess-generics.el - -(autoload 'ess-defgeneric "ess-generics" "\ -Define a new function, as with `defun', which can be overloaded. -NAME is the name of the function to create. ARGS are the -arguments to the function. DOCSTRING is a documentation string to -describe the function. The docstring will automatically have -details about its overload symbol appended to the end. BODY is -code that would be run when there is no override defined. The -default is to signal error if {name}-function is not defined. - -\(fn NAME ARGS DOCSTRING &rest BODY)" nil t) - -(function-put 'ess-defgeneric 'doc-string-elt '3) - -(function-put 'ess-defgeneric 'lisp-indent-function 'defun) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-generics" '("ess-"))) - ;;;*** ;;;### (autoloads nil "ess-gretl" "ess-gretl.el" (0 0 0 0)) ;;; Generated autoloads from ess-gretl.el -(autoload 'gretl-mode "ess-gretl" "\ +(autoload 'ess-gretl-mode "ess-gretl" "\ Major mode for editing gretl source. See `ess-mode' for more help. -\(fn &optional PROC-NAME)" t nil) +\(fn)" t nil) (autoload 'gretl "ess-gretl" "\ Call 'gretl', @@ -202,7 +73,7 @@ to gretl, put them in the variable `inferior-gretl-args'. \(fn &optional START-ARGS)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-gretl" '("ess-gretl-post-run-hook" "inferior-gretl-args" "gretl-"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-gretl" '("ess-gretl-" "inferior-gretl-args" "gretl-"))) ;;;*** @@ -224,25 +95,11 @@ suplied, it is used instead of `inferior-ess-help-command'. (defalias 'ess-help 'ess-display-help-on-object) -(autoload 'ess-helpobjs-at-point "ess-help" "\ -Return a list (def obj fun). -Obj is a name at point, fun is the name of the function call -point is in, and def is either obj or fun (in that order) which -has a a help file, i.e. it is a member of slist (string-list). -nil otherwise. - -\(fn SLIST)" nil nil) - (autoload 'ess-goto-info "ess-help" "\ Display node NODE from `ess-mode' info. \(fn NODE)" nil nil) -(autoload 'ess-submit-bug-report "ess-help" "\ -Submit a bug report to the ESS maintainers. - -\(fn)" t nil) - (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-help" '("ess-"))) ;;;*** @@ -250,105 +107,13 @@ Submit a bug report to the ESS maintainers. ;;;### (autoloads nil "ess-inf" "ess-inf.el" (0 0 0 0)) ;;; Generated autoloads from ess-inf.el -(autoload 'ess-proc-name "ess-inf" "\ -Return name of process N, as a string, with NAME prepended. -If `ess-plain-first-buffername', then initial process is number-free. - -\(fn N NAME)" nil nil) - -(autoload 'inferior-ess "ess-inf" "\ -Start inferior ESS process. - -Without a prefix argument, starts a new ESS process, or switches -to the ESS process associated with the current buffer. With -ESS-START-ARGS (perhaps specified via \\[universal-argument]), -starts the process with those args. The current buffer is used -if it is an `inferior-ess-mode' or `ess-transcript-mode' buffer. - -If `ess-ask-about-transfile' is non-nil, you will be asked for a -transcript file to use. If there is no transcript file, the -buffer name will be like *R* or *R2*, determined by -`ess-gen-proc-buffer-name-function'. - -Takes the program name from the variable `inferior-ess-program'. -An initialization file (dumped into the process) is specified by -`inferior-ess-start-file', and `inferior-ess-start-args' is used -to accompany the call for `inferior-ess-program'. - -When creating a new process, the process buffer replaces the -current window if `inferior-ess-same-window' is non-nil. -Alternatively, it can appear in its own frame if -`inferior-ess-own-frame' is non-nil. - -\(Type \\[describe-mode] in the process buffer for a list of -commands.) - -CUSTOMIZE-ALIST is the list of dialect-specific variables. When -non-nil, NO-WAIT tells ESS not to wait for the process to finish. -This may be useful for debugging. +(autoload 'ess-load-file "ess-inf" "\ +Load FILENAME into an inferior ESS process. +This handles Tramp when working on a remote. -\(fn &optional ESS-START-ARGS CUSTOMIZE-ALIST NO-WAIT)" t nil) +\(fn &optional FILENAME)" t nil) -(ess-defgeneric ess-load-file (&optional filename) "Load a source file into an inferior ESS process.\nThis handles Tramp when working on a remote." (interactive (list (or (and (memq major-mode '(ess-mode ess-julia-mode)) (buffer-file-name)) (expand-file-name (read-file-name "Load source file: " nil nil t))))) (ess-load-file--normalise-buffer filename) (save-selected-window (ess-switch-to-ESS t)) (:override (let ((file (ess-load-file--normalise-file filename))) (let ((command (ess-build-load-command file nil t))) (ess-send-string (ess-get-process) command t))))) - -(autoload 'inferior-ess-mode "ess-inf" "\ -Major mode for interacting with an inferior ESS process. -Runs an S interactive job as a subprocess of Emacs, with I/O through an -Emacs buffer. Variable `inferior-ess-program' controls which S -is run. - -Commands are sent to the ESS process by typing them, and pressing -\\[inferior-ess-send-input]. Pressing \\[complete-dynamic-complete] -completes known object names or filenames, as appropriate. Other -keybindings for this mode are: - -\\{inferior-ess-mode-map} - -When editing S objects, the use of \\[ess-load-file] is advocated. -`ess-load-file' keeps source files (if `ess-keep-dump-files' is non-nil) in -the directory specified by `ess-source-directory', with the -filename chosen according to `ess-dump-filename-template'. When a file is -loaded, `ess-mode' parses error messages and jumps to the appropriate file -if errors occur. The ess-eval- commands do not do this. - -Customization: Entry to this mode runs the hooks on `comint-mode-hook' and -`inferior-ess-mode-hook' (in that order). - -You can send text to the inferior ESS process from other buffers -containing source code. The key bindings of these commands can be -found by typing \\[describe-mode]. - - `ess-eval-region' sends the current region to the ESS process. - `ess-eval-buffer' sends the current buffer to the ESS process. - `ess-eval-function' sends the current function to the ESS process. - `ess-eval-line' sends the current line to the ESS process. - `ess-beginning-of-function' and `ess-end-of-function' move the point to - the beginning and end of the current S function. - `ess-switch-to-ESS' switches the current buffer to the ESS process buffer. - `ess-switch-to-end-of-ESS' switches the current buffer to the ESS process - buffer and puts point at the end of it. - - `ess-eval-region-and-go', `ess-eval-buffer-and-go', - `ess-eval-function-and-go', and `ess-eval-line-and-go' switch to the S - process buffer after sending their text. - `ess-dump-object-into-edit-buffer' moves an S object into a temporary file - and buffer for editing - `ess-load-file' sources a file of commands to the ESS process. - -Commands: -Return after the end of the process' output sends the text from the - end of process to point. -Return before the end of the process' output copies the sexp ending at point - to the end of the process' output, and sends it. -Delete converts tabs to spaces as it moves back. -C-M-q does Tab on each line starting within following expression. -Paragraphs are separated only by blank lines. Crosshatches start comments. -If you accidentally suspend your process, use \\[comint-continue-subjob] -to continue it. - -\(fn)" t nil) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-inf" '("ess-" "inferior-ess-" "update-ess-process-name-list" "with-ess-process-buffer"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-inf" '("ess-" "inferior-ess" "update-ess-process-name-list" "with-ess-process-buffer"))) ;;;*** @@ -356,7 +121,7 @@ to continue it. ;;; Generated autoloads from ess-jags-d.el (autoload 'ess-jags-mode "ess-jags-d" "\ -ESS[JAGS]: Major mode for JAGS. +Major mode for JAGS. \(fn)" t nil) @@ -370,140 +135,120 @@ ESS[JAGS]: Major mode for JAGS. ;;; Generated autoloads from ess-julia.el (autoload 'ess-julia-mode "ess-julia" "\ -Major mode for editing julia source. See `ess-mode' for more help. +Major mode for julia files. \(fn)" t nil) (autoload 'julia "ess-julia" "\ -Call 'julia'. -Optional prefix (C-u) allows to set command line arguments, such as ---load=. This should be OS agnostic. -If you have certain command line arguments that should always be passed -to julia, put them in the variable `inferior-julia-args'. +Start an inferior julia process. +Optional prefix START-ARGS (\\[universal-argument]) allows to set +command line arguments, such as --load=. This should be OS +agnostic. If you have certain command line arguments that should +always be passed to julia, put them in the variable +`inferior-julia-args'. \(fn &optional START-ARGS)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-julia" '("ess-" "company-ess-julia-objects" "ac-source-ess-julia-objects" "inferior-julia-args"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-julia" '("ess-" "inferior-" "company-ess-julia-objects" "ac-source-ess-julia-objects"))) ;;;*** -;;;### (autoloads nil "ess-lsp-l" "ess-lsp-l.el" (0 0 0 0)) -;;; Generated autoloads from ess-lsp-l.el +;;;### (autoloads nil "ess-mode" "ess-mode.el" (0 0 0 0)) +;;; Generated autoloads from ess-mode.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-lsp-l" '("Lisp-editing-alist"))) - -;;;*** - -;;;### (autoloads nil "ess-mouse" "ess-mouse.el" (0 0 0 0)) -;;; Generated autoloads from ess-mouse.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-mouse" '("ess-"))) - -;;;*** - -;;;### (autoloads nil "ess-noweb" "ess-noweb.el" (0 0 0 0)) -;;; Generated autoloads from ess-noweb.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-noweb" '("ess-"))) - -;;;*** - -;;;### (autoloads nil "ess-noweb-font-lock-mode" "ess-noweb-font-lock-mode.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from ess-noweb-font-lock-mode.el - -(autoload 'ess-noweb-font-lock-mode "ess-noweb-font-lock-mode" "\ -Minor mode for syntax highlighting when using `ess-noweb-mode' to edit noweb files. -Each chunk is fontified in accordance with its own mode. +(autoload 'ess-mode "ess-mode" "\ +Major mode for editing ESS source. +Optional arg ALIST describes how to customize the editing mode. +Optional arg PROC-NAME is name of associated inferior process. -\(fn &optional ARG)" t nil) +\\{ess-mode-map} -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-noweb-font-lock-mode" '("ess-noweb-" "nwfl-donowt"))) +You can send text to the inferior ESS process from other buffers containing +ESS source. + `ess-eval-region' sends the current region to the ESS process. + `ess-eval-buffer' sends the current buffer to the ESS process. + `ess-eval-function' sends the current function to the ESS process. + `ess-eval-line' sends the current line to the ESS process. + `ess-switch-to-ESS' switches the current buffer to the ESS process buffer. + `ess-switch-to-end-of-ESS' switches the current buffer to the ESS process + buffer and puts point at the end of it. -;;;*** - -;;;### (autoloads nil "ess-noweb-mode" "ess-noweb-mode.el" (0 0 0 -;;;;;; 0)) -;;; Generated autoloads from ess-noweb-mode.el - -(autoload 'ess-noweb-mode "ess-noweb-mode" "\ -Minor meta mode for editing noweb files. -`Meta' refers to the fact that this minor mode is switching major -modes depending on the location of point. - -The following special keystrokes are available in noweb mode: - -Movement: -\\[ess-noweb-next-chunk] goto the next chunk -\\[ess-noweb-previous-chunk] goto the previous chunk -\\[ess-noweb-goto-previous] goto the previous chunk of the same name -\\[ess-noweb-goto-next] goto the next chunk of the same name -\\[ess-noweb-goto-chunk] goto a chunk -\\[ess-noweb-next-code-chunk] goto the next code chunk -\\[ess-noweb-previous-code-chunk] goto the previous code chunk -\\[ess-noweb-next-doc-chunk] goto the next documentation chunk -\\[ess-noweb-previous-doc-chunk] goto the previous documentation chunk - -Copying/Killing/Marking/Narrowing: -\\[ess-noweb-copy-chunk-as-kill] copy the chunk the point is in into the kill ring -\\[ess-noweb-copy-chunk-pair-as-kill] copy the pair of doc/code chunks the point is in -\\[ess-noweb-kill-chunk] kill the chunk the point is in -\\[ess-noweb-kill-chunk-pair] kill the pair of doc/code chunks the point is in -\\[ess-noweb-mark-chunk] mark the chunk the point is in -\\[ess-noweb-mark-chunk-pair] mark the pair of doc/code chunks the point is in -\\[ess-noweb-narrow-to-chunk] narrow to the chunk the point is in -\\[ess-noweb-narrow-to-chunk-pair] narrow to the pair of doc/code chunks the point is in -\\[widen] widen -\\[ess-noweb-toggle-narrowing] toggle auto narrowing - -Filling and Indenting: -\\[ess-noweb-fill-chunk] fill (or indent) the chunk at point according to mode -\\[ess-noweb-fill-paragraph-chunk] fill the paragraph at point, restricted to chunk -\\[ess-noweb-indent-line] indent the line at point according to mode - -Insertion: -\\[ess-noweb-insert-default-mode-line] insert a line to set this file's code mode -\\[ess-noweb-new-chunk] insert a new chunk at point -\\[ess-noweb-complete-chunk] complete the chunk name before point -\\[ess-noweb-electric-@] insert a `@' or start a new doc chunk -\\[ess-noweb-electric-<] insert a `<' or start a new code chunk - -Modes: -\\[ess-noweb-set-doc-mode] set the major mode for editing doc chunks -\\[ess-noweb-set-code-mode] set the major mode for editing code chunks -\\[ess-noweb-set-this-code-mode] set the major mode for editing this code chunk - -Misc: -\\[ess-noweb-occur] find all occurrences of the current chunk -\\[ess-noweb-update-chunk-vector] update the markers for chunks -\\[ess-noweb-describe-mode] describe ess-noweb-mode + `ess-eval-region-and-go', `ess-eval-buffer-and-go', + `ess-eval-function-and-go', and `ess-eval-line-and-go' switch to the S + process buffer after sending their text. -\(fn &optional ARG)" t nil) + `ess-load-file' sources a file of commands to the ESS process. -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-noweb-mode" '("ess-noweb-"))) +\\[ess-indent-command] indents for ESS code. +\\[backward-delete-char-untabify] converts tabs to spaces as it moves back. +Comments are indented in a similar way to Emacs-lisp mode: + `###' beginning of line + `##' the same level of indentation as the code + `#' the same column on the right, or to the right of such a + column if that is not possible.(default value 40). + \\[indent-for-comment] command automatically inserts such a + `#' in the right place, or aligns such a comment if it is + already inserted. +\\[ess-indent-exp] command indents each line of the syntactic unit following point. -;;;*** - -;;;### (autoloads nil "ess-omg-d" "ess-omg-d.el" (0 0 0 0)) -;;; Generated autoloads from ess-omg-d.el +Variables controlling indentation style: + `ess-tab-always-indent' + Non-nil means TAB in ESS mode should always reindent the current line, + regardless of where in the line point is when the TAB command is used. + `ess-auto-newline' + Non-nil means automatically newline before and after braces inserted in S + code. + `ess-indent-offset' + Indentation of ESS statements within surrounding block. + The surrounding block's indentation is the indentation of the line on + which the open-brace appears. + `ess-offset-block' + Indentation of blocks opened with curly braces or anonymous parentheses. + `ess-offset-arguments' + Indentation of function arguments or bracket indices. + `ess-offset-arguments-newline' + Indentation of function arguments or bracket indices when the opening + delimiter is immediately followed by a newline. + `ess-offset-continued' + Indentation style for continued statements. + `ess-align-nested-calls' + Functions whose nested calls should be aligned. + `ess-align-arguments-in-calls' + Calls in which arguments should be aligned. + `ess-align-continuations-in-calls' + Whether ignore indentation after an operator in calls + `ess-align-blocks' + Blocks that should always be aligned vertically. + `ess-indent-from-lhs' + Whether function calls given as argument should be indented from the + parameter name. + `ess-indent-from-chain-start' + Whether to indent arguments from the first of several consecutive calls. + `ess-indent-with-fancy-comments' + Non-nil means distinguish between #, ##, and ### for indentation. -(autoload 'OMG-mode "ess-omg-d" "\ -Major mode for editing Omegahat source. NOT EVEN STARTED. +Furthermore, \\[ess-set-style] command enables you to set up predefined ess-mode +indentation style. See `ess-style-alist' for predefined styles. -\(fn &optional PROC-NAME)" t nil) +\(fn)" t nil) -(add-to-list 'auto-mode-alist '("\\.omg\\'" . omegahat-mode)) +(autoload 'ess-dump-object-into-edit-buffer "ess-mode" "\ +Edit an ESS OBJECT in its own buffer. +Without a prefix argument, this simply finds the file pointed to by +`ess-source-directory'. If this file does not exist, or if a +prefix argument is given, a dump() command is sent to the ESS process to +generate the source buffer. -(add-to-list 'auto-mode-alist '("\\.hat\\'" . omegahat-mode)) +\(fn OBJECT)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-omg-d" '("OMG"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-mode" '("ess-"))) ;;;*** -;;;### (autoloads nil "ess-omg-l" "ess-omg-l.el" (0 0 0 0)) -;;; Generated autoloads from ess-omg-l.el +;;;### (autoloads nil "ess-mouse" "ess-mouse.el" (0 0 0 0)) +;;; Generated autoloads from ess-mouse.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-omg-l" '("ess-" "OMG-"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-mouse" '("ess-"))) ;;;*** @@ -527,13 +272,6 @@ Major mode for editing Omegahat source. NOT EVEN STARTED. (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-r-flymake" '("ess-r-"))) -;;;*** - -;;;### (autoloads nil "ess-r-gui" "ess-r-gui.el" (0 0 0 0)) -;;; Generated autoloads from ess-r-gui.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-r-gui" '("Rgui" "ess-" "inferior-"))) - ;;;*** ;;;### (autoloads nil "ess-r-mode" "ess-r-mode.el" (0 0 0 0)) @@ -557,48 +295,40 @@ will be prompted to enter arguments interactively. (defalias 'R #'run-ess-r) -(autoload 'R-mode "ess-r-mode" "\ +(autoload 'ess-r-mode "ess-r-mode" "\ Major mode for editing R source. See `ess-mode' for more help. -\(fn &optional PROC-NAME)" t nil) - -(defalias 'r-mode #'R-mode) - -(defalias 'ess-r-mode #'R-mode) - -(add-to-list 'auto-mode-alist '("/R/.*\\.q\\'" . R-mode)) - -(add-to-list 'auto-mode-alist '("\\.[rR]\\'" . R-mode)) +\(fn)" t nil) -(add-to-list 'auto-mode-alist '("\\.[rR]profile\\'" . R-mode)) +(defalias 'R-mode 'ess-r-mode) -(add-to-list 'auto-mode-alist '("NAMESPACE\\'" . R-mode)) +(defalias 'r-mode 'ess-r-mode) -(add-to-list 'auto-mode-alist '("CITATION\\'" . R-mode)) +(add-to-list 'auto-mode-alist '("/R/.*\\.q\\'" . ess-r-mode)) -(autoload 'Rnw-mode "ess-r-mode" "\ -Major mode for editing Sweave(R) source. -See `ess-noweb-mode' and `R-mode' for more help. +(add-to-list 'auto-mode-alist '("\\.[rR]\\'" . ess-r-mode)) -\(fn)" t nil) +(add-to-list 'auto-mode-alist '("\\.[rR]profile\\'" . ess-r-mode)) -(add-to-list 'auto-mode-alist '("\\.[rR]nw\\'" . Rnw-mode)) +(add-to-list 'auto-mode-alist '("NAMESPACE\\'" . ess-r-mode)) -(add-to-list 'auto-mode-alist '("\\.[sS]nw\\'" . Snw-mode)) +(add-to-list 'auto-mode-alist '("CITATION\\'" . ess-r-mode)) -(autoload 'R-transcript-mode "ess-r-mode" "\ -Does the right thing. +(autoload 'ess-r-transcript-mode "ess-r-mode" "\ +A Major mode for R transcript files. \(fn)" t nil) -(add-to-list 'auto-mode-alist '("\\.[Rr]out" . R-transcript-mode)) +(add-to-list 'auto-mode-alist '("\\.[Rr]out" . ess-r-transcript-mode)) -(add-to-list 'interpreter-mode-alist '("Rscript" . R-mode)) +(add-to-list 'interpreter-mode-alist '("Rscript" . ess-r-mode)) -(add-to-list 'interpreter-mode-alist '("r" . R-mode)) +(add-to-list 'interpreter-mode-alist '("r" . ess-r-mode)) (add-to-list 'auto-mode-alist '("/Makevars\\(\\.win\\)?$" . makefile-mode)) +(add-to-list 'auto-mode-alist '("DESCRIPTION$" . conf-colon-mode)) + (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-r-mode" '("ess-" "inferior-ess-r-" "R-"))) ;;;*** @@ -630,47 +360,17 @@ Does the right thing. (autoload 'Rd-mode "ess-rd" "\ Major mode for editing R documentation source files. -This mode makes it easier to write R documentation by helping with -indentation, doing some of the typing for you (with Abbrev mode) and by -showing keywords, strings, etc. in different faces (with Font Lock mode -on terminals that support it). - -Type \\[list-abbrevs] to display the built-in abbrevs for Rd keywords. - -Keybindings -=========== - -\\{Rd-mode-map} - -Variables you can use to customize Rd mode -========================================== +Type \\[list-abbrevs] to display the built-in abbrevs for Rd +keywords.To automatically turn on the abbrev(iate) features, add +the following to your Emacs configuration file: -`Rd-indent-level' - Indentation of Rd code with respect to containing blocks. - Default is 2. - -Turning on Rd mode runs the hook `Rd-mode-hook'. - -To automatically turn on the abbrev(iate) features, add the -following lines to your `.emacs' file: - - (add-hook 'Rd-mode-hook - (lambda () - (abbrev-mode 1))) + (add-hook 'Rd-mode-hook #'abbrev-mode) \(fn)" t nil) (add-to-list 'auto-mode-alist '("\\.Rd\\'" . Rd-mode)) -(autoload 'Rd-preview-help "ess-rd" "\ -Preview the current Rd buffer contents as help. -If optional VIA-SHELL is set, using `Rd-to-help-command'. -If the current buffer is not associated with a file, create a -temporary one in `temporary-file-directory'. - -\(fn &optional VIA-SHELL)" t nil) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-rd" '("Rd-" "ess"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-rd" '("Rd-" "ess-point"))) ;;;*** @@ -678,9 +378,9 @@ temporary one in `temporary-file-directory'. ;;; Generated autoloads from ess-rdired.el (autoload 'ess-rdired "ess-rdired" "\ -Run dired-like mode on R objects. -This is the main function. See documentation for `ess-rdired-mode' though -for more information! +Show R objects from the global environment in a separate buffer. +You may interact with these objects, see `ess-rdired-mode' for +details. \(fn)" t nil) @@ -691,6 +391,11 @@ for more information! ;;;### (autoloads nil "ess-roxy" "ess-roxy.el" (0 0 0 0)) ;;; Generated autoloads from ess-roxy.el +(autoload 'ess-roxy-mode "ess-roxy" "\ +Minor mode for editing ROxygen documentation. + +\(fn &optional ARG)" t nil) + (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-roxy" '("ess-"))) ;;;*** @@ -711,20 +416,6 @@ for more information! (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-s-lang" '("ess-" "S+common-cust-alist" "S-" "inferior-S-language-start"))) -;;;*** - -;;;### (autoloads nil "ess-s3-d" "ess-s3-d.el" (0 0 0 0)) -;;; Generated autoloads from ess-s3-d.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-s3-d" 'nil)) - -;;;*** - -;;;### (autoloads nil "ess-s4-d" "ess-s4-d.el" (0 0 0 0)) -;;; Generated autoloads from ess-s4-d.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-s4-d" 'nil)) - ;;;*** ;;;### (autoloads nil "ess-sas-a" "ess-sas-a.el" (0 0 0 0)) @@ -738,9 +429,9 @@ for more information! ;;; Generated autoloads from ess-sas-d.el (autoload 'SAS-mode "ess-sas-d" "\ -Major mode for editing SAS source. See ess-mode for more help. +Major mode for editing SAS source. See `ess-mode' for more help. -\(fn &optional PROC-NAME)" t nil) +\(fn)" t nil) (add-to-list 'auto-mode-alist '("\\.[Ss][Aa][Ss]\\'" . SAS-mode)) @@ -765,27 +456,6 @@ Start SAS from the menu. (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-site" '("ess-"))) -;;;*** - -;;;### (autoloads nil "ess-sp3-d" "ess-sp3-d.el" (0 0 0 0)) -;;; Generated autoloads from ess-sp3-d.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-sp3-d" '("S+3"))) - -;;;*** - -;;;### (autoloads nil "ess-sp4-d" "ess-sp4-d.el" (0 0 0 0)) -;;; Generated autoloads from ess-sp4-d.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-sp4-d" '("Sqpe+4" "S+4" "inferior-S+4-multipleinstances"))) - -;;;*** - -;;;### (autoloads nil "ess-sp5-d" "ess-sp5-d.el" (0 0 0 0)) -;;; Generated autoloads from ess-sp5-d.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-sp5-d" '("S+5"))) - ;;;*** ;;;### (autoloads nil "ess-sp6-d" "ess-sp6-d.el" (0 0 0 0)) @@ -798,28 +468,13 @@ Major mode for editing S+ source. See `ess-mode' for more help. (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-sp6-d" '("ess-" "S+"))) -;;;*** - -;;;### (autoloads nil "ess-sp6w-d" "ess-sp6w-d.el" (0 0 0 0)) -;;; Generated autoloads from ess-sp6w-d.el - -(add-to-list 'auto-mode-alist '("\\.sp\\'" . S-mode)) - -(add-to-list 'auto-mode-alist '("\\.[qsS]\\'" . S-mode)) - -(add-to-list 'auto-mode-alist '("\\.ssc\\'" . S-mode)) - -(add-to-list 'auto-mode-alist '("\\.SSC\\'" . S-mode)) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-sp6w-d" '("S+" "Sqpe+" "ess-sqpe-versions-create" "inferior-S+"))) - ;;;*** ;;;### (autoloads nil "ess-stata-lang" "ess-stata-lang.el" (0 0 0 ;;;;;; 0)) ;;; Generated autoloads from ess-stata-lang.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-stata-lang" '("ess-" "stata-" "STA-" "ado-set-font-lock-keywords"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-stata-lang" '("ess-" "stata-" "STA-editing-alist" "ado-set-font-lock-keywords"))) ;;;*** @@ -827,23 +482,16 @@ Major mode for editing S+ source. See `ess-mode' for more help. ;;;;;; 0)) ;;; Generated autoloads from ess-stata-mode.el -(autoload 'STA-mode "ess-stata-mode" "\ -Major mode for editing Stata source. See `ess-mode' for more help. +(autoload 'ess-stata-mode "ess-stata-mode" "\ +Major mode for editing Stata source. -\(fn &optional PROC-NAME)" t nil) - -(add-to-list 'auto-mode-alist '("\\.do\\'" . STA-mode)) - -(add-to-list 'auto-mode-alist '("\\.ado\\'" . STA-mode)) +\(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-stata-mode" '("stata" "ess-" "STA-"))) +(add-to-list 'auto-mode-alist '("\\.do\\'" . ess-stata-mode)) -;;;*** - -;;;### (autoloads nil "ess-swv" "ess-swv.el" (0 0 0 0)) -;;; Generated autoloads from ess-swv.el +(add-to-list 'auto-mode-alist '("\\.ado\\'" . ess-stata-mode)) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-swv" '("ess-"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-stata-mode" '("stata" "ess-" "Stata-mode" "STA-" "inferior-ess-stata-mode"))) ;;;*** @@ -865,19 +513,17 @@ Major mode for editing Stata source. See `ess-mode' for more help. ;;; Generated autoloads from ess-trns.el (autoload 'ess-transcript-mode "ess-trns" "\ -Major mode for manipulating {ESS} transcript files. +Major mode for transcript files. Type \\[ess-transcript-send-command] to send a command in the -transcript to the current S process. \\[ess-transcript-copy-command] +transcript to the current inferior process. \\[ess-transcript-copy-command] copies the command but does not execute it, allowing you to edit it in the process buffer first. Type \\[ess-transcript-clean-region] to delete all outputs and prompts -in the region, leaving only the S commands. Other keybindings are: +in the region, leaving only the commands. -\\{ess-transcript-mode-map} - -\(fn ALIST &optional PROC)" nil nil) +\(fn)" t nil) (autoload 'ess-transcript-clean-region "ess-trns" "\ Strip the transcript in the region, leaving only (R/S/Lsp/..) commands. @@ -896,27 +542,6 @@ clean even if the buffer is \\[read-only]. (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-utils" '("ess-"))) -;;;*** - -;;;### (autoloads nil "ess-vst-d" "ess-vst-d.el" (0 0 0 0)) -;;; Generated autoloads from ess-vst-d.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-vst-d" '("VST-" "ViSta"))) - -;;;*** - -;;;### (autoloads nil "ess-xls-d" "ess-xls-d.el" (0 0 0 0)) -;;; Generated autoloads from ess-xls-d.el - -(autoload 'XLS-mode "ess-xls-d" "\ -Major mode for editing XLispStat source. NOT EVEN STARTED. - -\(fn &optional PROC-NAME)" t nil) - -(add-to-list 'auto-mode-alist '("\\.lsp\\'" . XLS-mode)) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ess-xls-d" '("xls-transcript-mode" "XLS" "ess-help-XLS-sec-keys-alist"))) - ;;;*** ;;;### (autoloads nil "essd-els" "essd-els.el" (0 0 0 0)) @@ -965,7 +590,7 @@ Popup a menu of functions to run on selected string or region. ;;;*** -;;;### (autoloads nil nil ("ess-mode.el" "ess-pkg.el") (0 0 0 0)) +;;;### (autoloads nil nil ("ess-pkg.el") (0 0 0 0)) ;;;*** diff --git a/elpa/ess-20181109.703/ess-bugs-d.el b/elpa/ess-20190121.1430/ess-bugs-d.el similarity index 97% rename from elpa/ess-20181109.703/ess-bugs-d.el rename to elpa/ess-20190121.1430/ess-bugs-d.el index e2021281..a2dee0df 100644 --- a/elpa/ess-20181109.703/ess-bugs-d.el +++ b/elpa/ess-20190121.1430/ess-bugs-d.el @@ -29,9 +29,6 @@ (require 'ess-custom) (require 'ess-mode) -(setq auto-mode-alist - (append '(("\\.[bB][uU][gG]\\'" . ess-bugs-mode)) auto-mode-alist)) - (defvar ess-bugs-command "OpenBUGS" "Default BUGS program in PATH.") (make-local-variable 'ess-bugs-command) @@ -246,23 +243,14 @@ ) ;;;###autoload -(defun ess-bugs-mode () - "ESS[BUGS]: Major mode for BUGS." - (interactive) - (kill-all-local-variables) - (ess-setq-vars-local '((comment-start . "#"))) - (setq major-mode 'ess-bugs-mode) - (setq mode-name "ESS[BUGS]") - (use-local-map ess-bugs-mode-map) - (make-local-variable 'font-lock-defaults) +(define-derived-mode ess-bugs-mode ess-mode "ESS[BUGS]" + "Major mode for BUGS." + (setq-local comment-start "#") (setq font-lock-defaults '(ess-bugs-font-lock-keywords nil t)) (setq ess-language "S") ; mimic S for ess-smart-underscore - (run-mode-hooks 'ess-bugs-mode-hook) - (unless (when (fboundp 'w32-shell-dos-semantics) (w32-shell-dos-semantics)) - (add-hook 'comint-output-filter-functions 'ess-bugs-exit-notify-sh)) - ) + (add-hook 'comint-output-filter-functions 'ess-bugs-exit-notify-sh))) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.[Bb][Uu][Gg]\\'" . ess-bugs-mode)) @@ -304,7 +292,6 @@ (replace-match ess-temp-replacement-string)))))) -(setq features (delete 'ess-bugs-d features)) (provide 'ess-bugs-d) ;;; ess-bugs-d.el ends here diff --git a/elpa/ess-20181109.703/ess-bugs-l.el b/elpa/ess-20190121.1430/ess-bugs-l.el similarity index 93% rename from elpa/ess-20181109.703/ess-bugs-l.el rename to elpa/ess-20190121.1430/ess-bugs-l.el index f2a96f3f..a63f837f 100644 --- a/elpa/ess-20181109.703/ess-bugs-l.el +++ b/elpa/ess-20190121.1430/ess-bugs-l.el @@ -67,7 +67,7 @@ Users whose default is not 'sh, but are accessing a remote machine with (defcustom ess-bugs-batch-post-command (if (equal ess-bugs-batch-method 'sh) "&" " ") - "*ESS[BUGS]: Modifiers at the end of the batch BUGS command line." + "ESS[BUGS]: Modifiers at the end of the batch BUGS command line." :group 'ess-bugs :type 'string ) @@ -75,7 +75,7 @@ Users whose default is not 'sh, but are accessing a remote machine with (defcustom ess-bugs-batch-pre-command (if (equal ess-bugs-batch-method 'sh) "nohup nice time" (if ess-microsoft-p "start")) - "*ESS[BUGS]: Modifiers at the beginning of the batch BUGS command line." + "ESS[BUGS]: Modifiers at the beginning of the batch BUGS command line." :group 'ess-bugs :type 'string ) @@ -94,7 +94,7 @@ Users whose default is not 'sh, but are accessing a remote machine with ) (defvar ess-bugs-batch-command ";" - "*ESS[BUGS]: The name of the command to run BUGS in batch mode." + "ESS[BUGS]: The name of the command to run BUGS in batch mode." ) (defvar ess-bugs-file "." @@ -125,7 +125,7 @@ Users whose default is not 'sh, but are accessing a remote machine with ) (defcustom ess-bugs-mode-hook nil - "*ESS[BUGS]: List of functions to call upon entering mode." + "ESS[BUGS]: List of functions to call upon entering mode." :group 'ess-bugs :type 'hook) @@ -183,10 +183,10 @@ and `ess-bugs-file-dir'." "ESS[BUGS]: Detect completion or failure of submitted job and notify the user." (let* ((exit-done "\\[[0-9]+\\]\\ *\\+*\\ *\\(Exit\\|Done\\)[^\r\n]*") (beg (string-match exit-done string))) - (if beg (message (substring string beg (match-end 0)))))) + (if beg (message "%s" (substring string beg (match-end 0)))))) (defun ess-bugs-hot-arrow () - "*ESS[BUGS]: Substitute <- for = key press" + "ESS[BUGS]: Substitute <- for = key press" (interactive) (insert " <- ")) @@ -245,12 +245,12 @@ and `ess-bugs-file-dir'." :prefix "ess-") (defcustom ess-bugs-shell-buffer-name "BUGS" - "*ESS[BUGS-Shell]: The name of the BUGS-Shell buffer." + "ESS[BUGS-Shell]: The name of the BUGS-Shell buffer." :group 'ess-bugs-shell :type 'string) (defcustom ess-bugs-shell-command "OpenBUGS" - "*ESS[BUGS-Shell]: The name of the command to run BUGS interactively. + "ESS[BUGS-Shell]: The name of the command to run BUGS interactively. Set to the name of the batch BUGS script that comes with ESS or to the name of BUGS command. Make sure it is in your PATH or @@ -259,19 +259,19 @@ add path to the command name." :type 'string) (defcustom ess-bugs-shell-default-output-file-root "bugs" - "*ESS[BUGS-Shell]: Default value for the root of output files." + "ESS[BUGS-Shell]: Default value for the root of output files." :group 'ess-bugs-shell :type 'string) (defcustom ess-bugs-shell-mode-hook nil - "*ESS[BUGS-Shell]: List of functions to call upon entering mode." + "ESS[BUGS-Shell]: List of functions to call upon entering mode." :group 'ess-bugs-shell :type 'hook) (defun ess-bugs-shell () "Create a buffer with BUGS running as a subprocess." (interactive) - (switch-to-buffer (concat "*" ess-bugs-shell-buffer-name "*")) + (pop-to-buffer-same-window (concat "*" ess-bugs-shell-buffer-name "*")) (make-comint ess-bugs-shell-buffer-name ess-bugs-shell-command nil ess-bugs-default-bins ess-bugs-shell-default-output-file-root) (comint-mode) diff --git a/elpa/ess-20181109.703/ess-custom.el b/elpa/ess-20190121.1430/ess-custom.el similarity index 88% rename from elpa/ess-20181109.703/ess-custom.el rename to elpa/ess-20190121.1430/ess-custom.el index db05cf3f..8cc5d006 100644 --- a/elpa/ess-20181109.703/ess-custom.el +++ b/elpa/ess-20190121.1430/ess-custom.el @@ -1,4 +1,4 @@ -;;; ess-custom.el --- Customize variables for ESS +;;; ess-custom.el --- Customize variables for ESS -*- lexical-binding: t; -*- ;; Copyright (C) 1997--2010 A.J. Rossini, Richard M. Heiberger, Martin ;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. @@ -106,16 +106,6 @@ :group 'ess :prefix "ess-") -(defgroup ess-XLS nil - "ESS: XLispStat." - :group 'ess - :prefix "ess-") - -(defgroup ess-OMG nil - "ESS: Omegahat." - :group 'ess - :prefix "ess-") - (defgroup ess-mouse nil ;; FIXME: this is not used yet <--> ./ess-mous.el "ESS: Mouse." :group 'ess @@ -129,11 +119,6 @@ :prefix "ess-" ;; << -- added for ESS integration FIXME?? :group 'tools) -(defgroup ess-sweave nil - "Mode for editing Sweave (*.[SR]nw) files." - :group 'ess-S - :prefix "ess-") - (defgroup ess-extras nil "Extra utilities for ESS" :group 'ess @@ -144,15 +129,6 @@ :group 'ess :prefix "ess-") -;; Variables (not user-changeable) - -(defvar ess-version "18.10.2" ;; updated by 'make' - "Version of ESS currently loaded.") - -(defvar ess-revision nil ;; set - "The subversion revision and date of ESS. -Is set by \\[ess-version-string].") - ; User changeable variables @@ -168,12 +144,29 @@ as `ess-imenu-use-S'." :type 'boolean) (defcustom ess-imenu-use-S ess-imenu-use-p - "*Non-nil means include an Imenu menu item in S buffers." + "Non-nil means include an Imenu menu item in S buffers." :group 'ess :type 'boolean) -(defvar ess-imenu-generic-expression nil - "Placeholder for imenu-generic-expression. Dialect specific.") +(defcustom ess-auto-width-visible nil + "When non-nil, echo width setting in the inferior buffer. +See `ess-auto-width'. Be warned that ESS can set the width a +lot." + :group 'ess + :type 'boolean + :package-version '(ess . "19.04")) + +(defcustom ess-auto-width nil + "When non-nil, set the width option when the window configuration changes. +When 'frame, set the width to the frame width. When 'window, set +the width to the window width. If an integer, set the width to +that integer. Anything else is treated as 'window." + :group 'ess + :type '(choice (const :tag "Do nothing" :value nil) + (const :tag "Frame width" :value 'frame) + (const :tag "Window width" :value 'window) + (integer :tag "Integer value")) + :package-version '(ess . "19.04")) (defcustom ess-handy-commands '(("change-directory" . ess-change-directory) ("install.packages" . ess-install-library) @@ -193,14 +186,8 @@ as `ess-imenu-use-S'." :group 'ess :type 'alist) -(defvar ess--local-handy-commands nil - "Store handy commands locally") -(make-variable-buffer-local 'ess--local-handy-commands) - -(defvar ess-install-library-function nil - "Dialect-specific function to install a library.") -(make-variable-buffer-local 'ess-install-library-function) - +(defvar-local ess--local-handy-commands nil + "Store handy commands locally.") (defcustom ess-describe-at-point-method nil "Whether `ess-describe-object-at-point' should use a tooltip. @@ -275,17 +262,15 @@ See also `ess-blink-delay'" :group 'ess :type 'boolean) -(defvar ess-language nil +(defvar-local ess-language nil "Determines the language to use for the current buffer. See also `ess-dialect'.") -(make-variable-buffer-local 'ess-language) -(defvar ess-dialect nil +(defvar-local ess-dialect nil "String version of the dialect being run for the inferior process. This, plus `ess-language', should be able to determine the exact version of the statistical package being executed in the particular buffer.") -(make-variable-buffer-local 'ess-dialect) (defcustom ess-directory-function nil "Function to return the directory that ESS is run from. @@ -392,7 +377,7 @@ aggressive and dangerous). (const t))) (defcustom ess-use-eldoc t - "If t, activate eldoc in ess-mode and inferior-ess-mode buffers. + "If t, activate eldoc in `ess-mode' and `inferior-ess-mode' buffers. If 'script-only activate in ess-mode buffers only. See also `ess-eldoc-show-on-symbol'." @@ -476,22 +461,14 @@ might want to set this to nil. :group 'ess :type 'boolean) - -(defvar ess-ac-sources nil - "Dialect specific, ESS specific list of ac-sources") - -(defvar ess-company-backends nil - "Dialect specific, ESS specific list of `company-backends'") - (defvar ess--completing-hist nil "Variable to store completion history. Used by `ess-completion-read' command.") -(defvar ess-smart-operators () +(defvar-local ess-smart-operators () "List of smart operators to be used in ESS and IESS modes. Not to be set by users. It is redefined by mode specific settings, such as `ess-r-smart-operators'.") -(make-variable-buffer-local 'ess-smart-operators) (defvaralias 'ess-R-smart-operators 'ess-r-smart-operators) (defvar ess-r-smart-operators nil @@ -509,16 +486,6 @@ ess-smart-comma only, but will be enriched in the near future.") Used to avoid annoying jumping by ess-eval.*-and-step to end of buffer or end chunks etc.") -(defcustom ess-smart-S-assign-key "_" - "Key used by `ess-smart-S-assign'. -Should be nil or a \"simple\" key, in other words no key -modifiers. - -This variable is deprecated and will be removed in the future. -Please bind `ess-insert-assign' in `ess-mode-map' to your key of -choice with `define-key' or similar." - :group 'ess-S - :type '(choice (const :tag "Nothing" :value nil) string)) (make-obsolete-variable 'ess-smart-S-assign-key nil "ESS 18.10") (defcustom ess-assign-list (cons (if (boundp 'ess-S-assign) ess-S-assign " <- ") @@ -738,10 +705,9 @@ regardless of where in the line point is when the TAB command is used." :type 'boolean :group 'ess-edit) -(defvar ess-indent-line-function nil +(defvar-local ess-indent-line-function nil "Function to be used for the current dialect nil means to use R/S indentation.") -(make-variable-buffer-local 'ess-indent-line-function) (define-obsolete-variable-alias 'ess-indent-level 'ess-indent-offset "15.09") (defvar ess-indent-offset 2 @@ -1213,7 +1179,7 @@ See `ess-style-alist' for for an overview of ESS indentation." (ess-indent-with-fancy-comments . ,(default-value 'ess-indent-with-fancy-comments)))) "Predefined formatting styles for ESS code. Use -`ess-default-style' to apply a style in all R buffers. The values +`ess-style' to apply a style in all R buffers. The values of all styles except OWN are fixed. To change the value of variables in the OWN group, customize the variable `ess-own-style-list'. DEFAULT style picks default (aka global) @@ -1288,9 +1254,9 @@ Remove any existing entry with the same KEY before adding the new one." (defcustom ess-own-style-list (cdr (assoc 'RRR ess-style-alist)) "Indentation variables for your own style. -Set `ess-default-style' to 'OWN to use these values. To change +Set `ess-style' to 'OWN to use these values. To change these values, use the customize interface. See the documentation -of each variable for its meaning. " +of each variable for its meaning." :group 'ess-edit :type 'alist :initialize 'custom-initialize-set @@ -1298,13 +1264,20 @@ of each variable for its meaning. " (set symbol value) (ess-add-style 'OWN value))) -(defcustom ess-default-style 'RRR - "The default value of `ess-indent-style'. +;;;###autoload (put 'ess-style 'safe-local-variable #'symbolp) + +(define-obsolete-variable-alias 'ess-default-style 'ess-style "ESS 19.04") +(defcustom ess-style 'RRR + "Current ESS indentation style, see `ess-style-alist' for more. See the variable `ess-style-alist' for how these groups (RRR, DEFAULT, GNU, BSD, ...) map onto different settings for variables. OWN style is defined in `ess-own-style-list' and you can customize it to your needs. DEFAULT style picks default (aka -global) values from ESS indentation variables." +global) values from ESS indentation variables. + +This variable only has an effect if set before a buffer is +visited (e.g. in your Emacs initialization file) or as a file or +directory local variable (see Info node `(emacs) File Variables'." :type '(choice (const OWN) (const GNU) (const BSD) @@ -1316,11 +1289,8 @@ global) values from ESS indentation variables." (const RStudio) (const RStudio-) (const DEFAULT)) - :group 'ess-edit) - -;; the real setting of this happens via -editing-alist: -(defvar ess-style ess-default-style - "Current ESS indentation style, see `ess-style-alist' for more.") + :group 'ess-edit + :safe #'symbolp) ;;*;; Variables controlling behaviour of dump files @@ -1383,13 +1353,6 @@ Good for evaluating ESS code." :group 'ess-hooks :type 'hook) -;;; make it possible to save an inferior-ess-mode buffer without losing -;;; the connection to the running ESS process. -(put 'inferior-ess-mode 'mode-class 'special) -;; FIXME AJR: Should the above be there? I don't think so! -;; MM : the functionality should be, right? Move statement to ./ess.el ? -;; AJR: No, we should move the statement to ./ess-inf.el - (defcustom ess-help-mode-hook nil "Functions to call when entering `ess-help-mode'." :group 'ess-hooks @@ -1405,11 +1368,13 @@ Good for evaluating ESS code." :group 'ess-hooks :type 'hook) -(defcustom R-mode-hook nil +(define-obsolete-variable-alias 'R-mode-hook 'ess-r-mode-hook "19.04") +(defcustom ess-r-mode-hook nil "Hook run when entering R mode." :type 'hook :group 'ess-R) + (defcustom Rnw-mode-hook nil "Hook run when entering Rnw mode." :type 'hook @@ -1506,37 +1471,18 @@ the line at point" :group 'ess-roxy :type 'string) -(defcustom ess-roxy-re "^#+'" - "Regular expression to recognize roxygen blocks." - :group 'ess-roxy - :type 'string) - -(defcustom ess-swv-pdflatex-commands '("texi2pdf" "pdflatex" "make") - "Commands to run a version of pdflatex in \\[ess-swv-PDF]; -the first entry is the default command." - :group 'ess-sweave - :type '(repeat string)) - -(defcustom ess-swv-plug-into-AUCTeX-p nil - "Non-nil means add commands to AUCTeX's \\[TeX-command-list] -to sweave the current noweb file and latex the result." - :group 'ess-sweave - :type '(choice (const :tag "Off" nil) - (const :tag "On" t))) - (defvar ess-roxy-insert-prefix-on-newline t - "When non-nil, `ess-newline-and-indent' will make sure the new + "When non-nil, `ess-roxy-newline-and-indent' will make sure the new line starts with the roxy prefix.") ; System variables ;; SJE -- this should not be defcustom - user does not set it. (defvaralias 'ess-current-process-name 'ess-local-process-name) -(defvar ess-local-process-name nil +(defvar-local ess-local-process-name nil "The name of the ESS process associated with the current buffer.") (put 'ess-local-process-name 'risky-local-variable t) (put 'ess-local-process-name 'permanent-local t) -(make-variable-buffer-local 'ess-local-process-name) (defcustom ess-switch-to-end-of-proc-buffer t "If t, `ess-switch-to-inferior-or-script-buffer goes to end of @@ -1544,30 +1490,35 @@ process buffer." :group 'ess :type 'boolean) -(defcustom ess-gen-proc-buffer-name-function 'ess-gen-proc-buffer-name:projectile-or-simple - "Function used for generation of the buffer name of the newly created ESS process. +(defcustom ess-gen-proc-buffer-name-function 'ess-gen-proc-buffer-name:project-or-simple + "Function used for generation of the buffer name of the new ESS processes. It should accept one argument PROC-NAME, a string specifying internal process name (R, R:2, etc). Provided default options are: - `ess-gen-proc-buffer-name:simple' -- *proc* - `ess-gen-proc-buffer-name:directory' -- *proc:dir* - `ess-gen-proc-buffer-name:abbr-long-directory' -- *proc:abbr-long-dir* - `ess-gen-proc-buffer-name:projectile-or-simple' -- *proc:projectile-root* or *proc*. - `ess-gen-proc-buffer-name:projectile-or-directory' -- *proc:projectile-root* or *proc:dir*. +`ess-gen-proc-buffer-name:simple' + *proc* -Strategies based on projectile default to built-in strategies if -projectile.el is not loaded or there is no project root in the -current directory. -" +`ess-gen-proc-buffer-name:directory' + *proc:dir* +`ess-gen-proc-buffer-name:abbr-long-directory' + *proc:abbr-long-dir* +`ess-gen-proc-buffer-name:project-or-simple' + *proc:project-root* or *proc* +`ess-gen-proc-buffer-name:project-or-directory' + *proc:project-root* or *proc:dir* + +Strategies based on projects default to built-in strategies if +there is no project root in the current directory." :group 'ess :type '(choice (const :tag "*proc*" ess-gen-proc-buffer-name:simple) (const :tag "*proc:dir*" ess-gen-proc-buffer-name:directory) (const :tag "*proc:abbr-long-dir*" ess-gen-proc-buffer-name:abbr-long-directory) - (const :tag "*proc:projectile-root* or *proc*" ess-gen-proc-buffer-name:projectile-or-simple) - (const :tag "*proc:projectile-root* or *proc:dir*" ess-gen-proc-buffer-name:projectile-or-directory) - function)) + (const :tag "*proc:project-root* or *proc*" ess-gen-proc-buffer-name:project-or-simple) + (const :tag "*proc:project-root* or *proc:dir*" ess-gen-proc-buffer-name:project-or-directory) + function) + :package-version '(ess . "19.04")) (defcustom ess-kermit-command "gkermit -T" @@ -1609,26 +1560,18 @@ by `ess-function-template'." ; ess-inf: variables for inferior-ess. -(defcustom inferior-ess-own-frame nil +(defvar inferior-ess-own-frame nil "Non-nil means that inferior ESS buffers should start in their own frame. -The parameters of this frame are stored in `inferior-ess-frame-alist'." - :group 'ess-proc - :type 'boolean) - -(defcustom inferior-ess-frame-alist default-frame-alist - "Alist of frame parameters used to create new frames for iESS buffers. -This defaults to `default-frame-alist' and is used only when -the variable `inferior-ess-own-frame' is non-nil." - :group 'ess-proc - :type 'alist) +This variable is deprecated. +please add an entry to `display-buffer-alist' instead. See Info +node `(ess)Customizing startup'. For example: -(defcustom inferior-ess-same-window t - "Non-nil indicates new inferior ESS process appears in current window. -Otherwise, the new inferior ESS buffer is shown in another window in the -current frame. This variable is ignored if `inferior-ess-own-frame' is -non-nil." - :group 'ess-proc - :type 'boolean) +\(add-to-list 'display-buffer-alist + '(\"*R\" + (display-buffer-reuse-window display-buffer-pop-up-frame)))") +(make-obsolete-variable 'inferior-ess-own-frame 'display-buffer-alist "ESS 19.04") +(make-obsolete-variable 'inferior-ess-frame-alist "It is ignored. Use `display-buffer-alist' and `pop-up-frame-alist' instead." "ESS 19.04") +(make-obsolete-variable 'inferior-ess-same-window 'display-buffer-alist "ESS 19.04") (defcustom inferior-ess-jit-lock-chunk-size 10000 "Default for (buffer local) `jit-lock-chunk-size' in inferior ESS buffers." @@ -1663,16 +1606,9 @@ for file name completion. This can mess up ess evaluation completely." :group 'ess-R :type 'boolean) -(defcustom inferior-STA-start-file nil - "Initialization file for Stata." - :group 'ess-Stata - :type '(choice (const nil) string)) - (defcustom inferior-STA-start-args "" "String of switches used when starting stata. -Don't use this to send initialization command to stata, use -`inferior-STA-start-file' instead. Also see -`inferior-STA-program'." +Also see `inferior-STA-program'." :group 'ess-Stata :type 'string) @@ -1692,7 +1628,8 @@ Should contain a formating %s to be replaced by a path (as in 'setwd(%s)\\n'.") (defcustom ess-program-files ;; 32 bit version - (if ess-microsoft-p + (if (and ess-microsoft-p + (fboundp 'w32-short-file-name)) (if (getenv "ProgramW6432") (w32-short-file-name (getenv "ProgramFiles(x86)"));; always 32 on 64 bit OS (w32-short-file-name (getenv "ProgramFiles"))) ;; always 32 on 32 bit OS @@ -1702,9 +1639,8 @@ path (as in 'setwd(%s)\\n'.") :type '(choice (string) (const nil))) (defcustom ess-program-files-64 ;; 64 bit version - (if (and ess-microsoft-p (getenv "ProgramW6432")) - (w32-short-file-name (getenv "ProgramW6432")) - nil) + (when (and ess-microsoft-p (fboundp 'w32-short-file-name) (getenv "ProgramW6432")) + (w32-short-file-name (getenv "ProgramW6432"))) "Safe (no embedded blanks) 8.3 name for 64-bit programs that works across internationalization." :group 'ess :type '(choice (string) (const nil))) @@ -1983,27 +1919,6 @@ ask - ask the user whether the S buffers should be killed." :group 'ess-S :type '(choice (const nil) (const t) (const ask))) -(define-obsolete-variable-alias 'inferior-XLS-program-name - 'inferior-XLS-program "ESS 18.10") -(defcustom inferior-XLS-program "xlispstat" - "Program name for invoking an inferior ESS with \\[XLS]." - :group 'ess-XLS - :type '(choice (string) (file))) - -(define-obsolete-variable-alias 'inferior-VST-program-name - 'inferior-VST-program "ESS 18.10") -(defcustom inferior-VST-program "vista" - "Program name for invoking an inferior ESS with \\[ViSta]." - :group 'ess-XLS - :type '(choice (string) (file))) - -(define-obsolete-variable-alias 'inferior-ARC-program-name - 'inferior-ARC-program "ESS 18.10") -(defcustom inferior-ARC-program "arc" - "Program name for invoking an inferior ESS with \\[ARC]." - :group 'ess-XLS - :type '(choice (string) (file))) - (define-obsolete-variable-alias 'inferior-SAS-program-name 'inferior-SAS-program "ESS 18.10") (defcustom inferior-SAS-program "sas" @@ -2025,13 +1940,6 @@ order for it to work right. And Emacs is too smart for it." :group 'ess-Stata :type 'boolean) -(define-obsolete-variable-alias 'inferior-OMG-program-name - 'inferior-OMG-program "ESS 18.10") -(defcustom inferior-OMG-program "omegahat" - "Program name for invoking an inferior ESS with omegahat()." - :group 'ess-OMG - :type '(choice (string) (file))) - (defvaralias 'R-editor 'ess-r-editor) (defcustom ess-r-editor "emacsclient" "Editor called by R process with 'edit()' command." @@ -2055,23 +1963,15 @@ order for it to work right. And Emacs is too smart for it." :group 'ess :type 'string) -(defvar ess-editor nil - "*Editor by which the process sends information to an emacs buffer +(defvar-local ess-editor nil + "Editor by which the process sends information to an Emacs buffer for editing and then to be returned to the process.") -(defvar ess-pager nil - "*Pager by which the process sends information to an emacs buffer.") - -(defvar inferior-ess-language-start nil - "*Initialization commands sent to the ESS process.") - -(make-variable-buffer-local 'ess-editor) -(make-variable-buffer-local 'ess-pager) -(make-variable-buffer-local 'inferior-ess-language-start) +(defvar-local ess-pager nil + "Pager by which the process sends information to an Emacs buffer.") - - -;;;;; names for S-Plus help files on MS-Windows +(defvar-local inferior-ess-language-start nil + "Initialization commands sent to the ESS process.") (defcustom inferior-ess-help-filetype nil "S-Plus and Sqpe for Windows use the \"chm\" (compiled html) filetype @@ -2080,73 +1980,41 @@ for help files. The default value is nil for other systems." :type '(choice (const nil) (string))) (make-variable-buffer-local 'inferior-ess-help-filetype) -;;;;; names for communication using MS-Windows 9x/NT ddeclient mechanism - -(defcustom inferior-ess-ddeclient nil - "ddeclient is the intermediary between emacs and the stat program." - :group 'ess-proc - :type '(choice (const nil) (string))) - -(defcustom inferior-ess-client-name nil - "Name of ESS program ddeclient talks to." - :group 'ess-proc - :type '(choice (const nil) (string))) - -(defcustom inferior-ess-client-command nil - "ddeclient command sent to the ESS program." - :group 'ess-proc - :type '(choice (const nil) string)) - -(make-variable-buffer-local 'inferior-ess-client-name) -(make-variable-buffer-local 'inferior-ess-ddeclient) -(make-variable-buffer-local 'inferior-ess-client-command) - (defvar inferior-S-program inferior-S+3-program "Program name for invoking an inferior ESS with S.") (define-obsolete-variable-alias 'inferior-ess-program-name 'inferior-ess-program "ESS 18.10") -(defvar inferior-ess-program nil ;inferior-S-program +(defvar-local inferior-ess-program nil ;inferior-S-program "Default program name for invoking `inferior-ess'. The other variables ...-program should be changed, for the corresponding program.") -(make-variable-buffer-local 'inferior-ess-program) (defvar inferior-ess-start-args "" "String of arguments passed to the ESS process. If you wish to pass arguments to a process, see e.g. `inferior-R-args'.") -(defcustom inferior-ess-start-file nil - "File dumped into process, if non-nil." - :group 'ess-proc - :type '(choice (const nil) file)) - (defcustom inferior-ess-pager (if ess-microsoft-p "console" "cat") "Pager to use for reporting help files and similar things." :group 'ess-proc :type 'string) -(defvar inferior-ess-primary-prompt "> " +(defvar-local inferior-ess-primary-prompt "> " "Regular expression used by `ess-mode' to detect the primary prompt.") -(make-variable-buffer-local 'inferior-ess-primary-prompt) -(defvar inferior-ess-secondary-prompt nil +(defvar-local inferior-ess-secondary-prompt nil "Regular expression used by ess-mode to detect the secondary prompt. This is issued by S to continue an incomplete expression. Set to nil if language doesn't support secondary prompt.") -(make-variable-buffer-local 'inferior-ess-secondary-prompt) (defvar ess-traceback-command nil "Command to generate error traceback.") -;; need this to recognise + + + > > > -;; and "+ . + " in tracebug prompt -;; VS[17-08-2012]: all of the occurrences in the code should should eventually -;; go away, (once we are sure this doesn't break anything) -(defvaralias 'inferior-ess-S-prompt 'inferior-S-prompt) -(defvar inferior-S-prompt "[]a-zA-Z0-9.[]*\\(?:[>+.] \\)+" +;; Need this to recognize prompts of the form + + + > > > +;; and "+ . + ", but not "Abcd. " +(defvar inferior-S-prompt "[]a-zA-Z0-9.[]*[>+] \\(?:[>+.] \\)*" "Regexp used in S and R inferior and transcript buffers for prompt navigation. -Must be anchored to BOL.") +Must not be anchored to BOL.") ;;*;; Variables controlling interaction with the ESS process @@ -2193,15 +2061,8 @@ the process output, otherwise not. :group 'ess-proc :type 'boolean) -(defcustom ess-eval-ddeclient-sleep 0.06 - "If non-nil, a number specifying *seconds* to wait after certain -\\[ess-eval-linewise-ddeclient] calls, such as those at startup." - ;; i.e this currently only applies to (if microsoft-p ...) ! - :group 'ess-proc - :type '(choice (const nil) number)) - (defcustom ess-sleep-for-shell (if ess-microsoft-p 5 1) - "*Pause before sending output to the shell." + "Pause before sending output to the shell." :group 'ess-proc :type 'number) @@ -2210,7 +2071,7 @@ the process output, otherwise not. ;;*;; Variables relating to multiple processes -(defvar ess--mode-line-process-indicator '("" ess-local-process-name) +(defvar-local ess--mode-line-process-indicator '("" ess-local-process-name) "List of ESS mode-line indicators. Local in process buffers and must start with a string. Changes of this variable are automatically reflected in mode-lines of the @@ -2228,30 +2089,28 @@ customize this variable to indicate changes in the process status. ") (put 'ess--mode-line-process-indicator 'risky-local-variable t) -(make-variable-buffer-local 'ess--mode-line-process-indicator) -(defvar ess--local-mode-line-process-indicator '("") +(defvar-local ess--local-mode-line-process-indicator '("") "List of local process indicators. See `ess--mode-line-process-indicator' for how to set it. This is an internal varialbe used by tools like `ess-developer' and `ess-tracebug'.") (put 'ess--local-mode-line-process-indicator 'risky-local-variable t) -(make-variable-buffer-local 'ess--local-mode-line-process-indicator) (defvar ess-process-name-list nil "Alist of active ESS processes.") ;;*;; Inferior ESS commands -(defvar ess-load-command "source('%s')\n" +(defvar-local ess-load-command "source('%s')\n" "Dialect specific format-string for building the ess command to load a file. This format string should use %s to substitute a file name and should result in an ESS expression that will command the inferior ESS to load that file.") -(defvar ess-eval-command nil +(defvar-local ess-eval-command nil "Dialect specific format-string for building the command to evaluate a string. It is usually faster to send a string to remote processes than a @@ -2267,13 +2126,9 @@ The resulting command should not echo code or print any transitory output. See also `ess-eval-visibly-command' and `ess-eval-visibly-noecho-command'.") -(defvar ess-build-eval-message-function nil +(defvar-local ess-build-eval-message-function nil "Dialect-specific function for formatting an evaluation message.") -(make-variable-buffer-local 'ess-eval-command) -(make-variable-buffer-local 'ess-load-command) -(make-variable-buffer-local 'ess-build-eval-message-function) - (defcustom inferior-ess-dump-command "dump(\"%s\",file=\"%s\")\n" "Format-string for building the ess command to dump an object into a file. @@ -2282,11 +2137,10 @@ Use second %s to substitute the dump file name." :group 'ess-command :type 'string) -(defvar inferior-ess-help-command "help(\"%s\")\n" +(defvar-local inferior-ess-help-command "help(\"%s\")\n" "Format-string for building the ESS command to ask for help on an object. This format string should use %s to substitute an object name.") -(make-variable-buffer-local 'inferior-ess-help-command) (defcustom inferior-ess-r-help-command ".ess.help('%s')\n" "Format-string for building the R command to ask for help on an object. @@ -2296,35 +2150,29 @@ If set, changes will take effect when next R session is started." :group 'ess-command :type 'string) -(defvar ess-get-help-topics-function nil +(defvar-local ess-get-help-topics-function nil "Dialect specific help topics retrieval") -(defvar ess-display-help-on-object-function nil +(defvar-local ess-display-help-on-object-function nil "Dialect specific function for displaying help on object.") -(defvar ess-find-help-file-function nil +(defvar-local ess-find-help-file-function nil "Dialect specific function for displaying help on object.") -(defvar ess-build-help-command-function nil +(defvar-local ess-build-help-command-function nil "Dialect specific function for building an help command.") -(make-variable-buffer-local 'ess-get-help-topics-function) -(make-variable-buffer-local 'ess-display-help-on-object-function) -(make-variable-buffer-local 'ess-find-help-file-function) -(make-variable-buffer-local 'ess-build-help-command-function) - (defvar-local inferior-ess-exit-command "q()\n" "Format-string for building the ess command to exit. This format string should use %s to substitute an object name.") -(defvar inferior-ess-search-list-command nil +(defvar-local inferior-ess-search-list-command nil "`ess-language' command that prints out the search list; i.e. the list of directories and (recursive) objects that `ess-language' uses when it searches for objects. Really set in -customize-alist in ess[dl]-*.el") -(make-variable-buffer-local 'inferior-ess-search-list-command) (defcustom inferior-ess-safe-names-command "tryCatch(base::print(base::names(%s), max=1e6), error=function(e){})\n" @@ -2341,7 +2189,7 @@ Really set in -customize-alist in ess[dl]-*.el") :type 'string) ;;*;; Regular expressions -(defvar inferior-ess-prompt nil +(defvar-local inferior-ess-prompt nil "The regular expression used for recognizing prompts. It is always used in transcript mode. In inferior ess mode it is @@ -2350,11 +2198,9 @@ used only if `comint-use-prompt-regexp' is t. If not set in language's customise-alist it is constructed at run time from `inferior-ess-primary-prompt' and `inferior-ess-secondary-prompt'.") -(make-variable-buffer-local 'inferior-ess-prompt) -(defvar ess-change-sp-regexp "" +(defvar-local ess-change-sp-regexp "" "The regexp for matching the S/R/.. commands that change the search path.") -(make-variable-buffer-local 'ess-change-sp-regexp) (defvar ess-S+-change-sp-regexp "\\(attach(\\([^)]\\|$\\)\\|detach(\\|collection(\\|library(\\|module(\\|source(\\)" @@ -2375,36 +2221,28 @@ from `inferior-ess-primary-prompt' and `inferior-ess-secondary-prompt'.") "Deprecated. Use (ess-search-list) or (ess-process-get 'search-list) instead.") (make-obsolete-variable 'ess-search-list nil "ESS[12.09]") -(defvar ess-sl-modtime-alist nil +(defvar-local ess-sl-modtime-alist nil "Alist of modification times for all ess directories accessed this session.") -(make-variable-buffer-local 'ess-sl-modtime-alist) (defvar ess-sp-change nil "Variable not used. Use (ess-process-get 'sp-for-help-changed?) instead.") (make-obsolete-variable 'ess-sp-change nil "ESS[12.09]") ;; (make-variable-buffer-local 'ess-sp-change) -(defvar ess-prev-load-dir/file nil +(defvar-local ess-prev-load-dir/file nil "This symbol saves the (directory . file) pair used in the last `ess-load-file' command. Used for determining the default in the next one.") -(make-variable-buffer-local 'ess-prev-load-dir/file) - -(defvar ess-object-list nil +(defvar-local ess-object-list nil ;; This is a list of the currently known object names. It is ;; current only for one command entry; it exists under the ;; assumption that the list of objects doesn't change while entering ;; a command. - "Cache of object names") - -(make-variable-buffer-local 'ess-object-list) + "Cache of object names.") -(defvar ess-help-topics-list nil +(defvar-local ess-help-topics-list nil ;; List of currently known help topics. - "Cache of help topics") - -(make-variable-buffer-local 'ess-help-topics-list) - + "Cache of help topics.") ;;*;; Miscellaneous system variables @@ -2420,13 +2258,11 @@ from `inferior-ess-primary-prompt' and `inferior-ess-secondary-prompt'.") (defvar ess-object-name-db-file-loaded '() "List of programs whose name-db file has been loaded.") -(defvar ess-object-name-db nil +(defvar-local ess-object-name-db nil "Alist of lists of object names, with directory names as keys. The file ess-namedb.el is loaded (if it exists) to define this variable. See also function `ess-create-object-name-db'.") -(make-variable-buffer-local 'ess-object-name-db) - ;;;*;;; Font-lock support ;; "Reserved Words" -- part 1 -- @@ -2491,7 +2327,6 @@ See also function `ess-create-object-name-db'.") "Internal. Holds a name of the dialect sepcific font-lock keywords in the current buffer. See `ess-R-font-lock-keywords' for an example.") -(make-variable-buffer-local 'ess-font-lock-keywords) (defvar ess-fl-keyword:fun-calls (cons "\\(\\sw+\\)[\t ]*(" '(1 ess-function-call-face keep)) @@ -2607,12 +2442,6 @@ should be t or nil to indicate if the keyword is active or not." :group 'ess-faces :type '(repeat (cons symbol boolean))) -(defvar inferior-ess-font-lock-keywords nil - "Internal. Holds a name of the dialect sepcific font-lock -keywords in the current buffer. See -`inferior-ess-r-font-lock-keywords' for an example.") -(make-variable-buffer-local 'inferior-ess-font-lock-keywords) - (defvar ess-S-fl-keyword:prompt (cons (concat "^" inferior-S-prompt) 'comint-highlight-prompt) "Highlight prompts missed by comint.") @@ -2643,7 +2472,7 @@ keywords in the current buffer. See (ess-fl-keyword:delimiters) (ess-fl-keyword:=) (ess-R-fl-keyword:F&T)) - "Font-lock patterns used in inferior-R-mode buffers. + "Font-lock patterns used in `inferior-ess-r-mode' buffers. The key of each cons cell is a name of the keyword. The value should be t or nil to indicate if the keyword is active or not." :group 'ess-R @@ -2721,7 +2550,6 @@ the variable `ess-help-own-frame' is non-nil." :type 'alist :package-version '(ess . "18.10")) - ; Faces ;;;===================================================== @@ -2781,7 +2609,7 @@ and others. See `ess-R-modifiers'." (defface ess-constant-face '((default (:inherit font-lock-type-face))) "Font lock face used to highlight constants. -In `R-mode', for example, this includes TRUE, FALSE, Inf and +In `ess-r-mode', for example, this includes TRUE, FALSE, Inf and others. See `ess-R-constants'." :group 'ess-faces) @@ -2795,7 +2623,7 @@ others. See `ess-R-constants'." (defface ess-keyword-face '((default (:inherit font-lock-keyword-face))) "Font lock face used to highlight reserved keywords. -In `R-mode', for example, this includes \"while,\" \"if/else\", +In `ess-r-mode', for example, this includes \"while,\" \"if/else\", \"function,\" and others. See `ess-R-keywords'." :group 'ess-faces) @@ -2817,30 +2645,22 @@ highlighted with the same face as `ess-R-keywords'" (defvar ess-execute-screen-options-command nil "Dialect specific command run by `ess-execute-screen-options'.") -(defvar ess-help-web-search-command nil +(defvar-local ess-help-web-search-command nil "Dialect specific command web help search. Passed to `ess-execute-dialect-specific' which see.") -(make-variable-buffer-local 'ess-help-web-search-command) -(defvar ess-manual-lookup-command nil +(defvar-local ess-manual-lookup-command nil "Dialect specific command manual lookup. Passed to `ess-execute-dialect-specific' which see.") -(make-variable-buffer-local 'ess-manual-lookup-command) -(defvar ess-reference-lookup-command nil +(defvar-local ess-reference-lookup-command nil "Dialect specific command for reference lookup. Passed to `ess-execute-dialect-specific' which see.") -(make-variable-buffer-local 'ess-reference-lookup-command) -(defvar ess-funargs-command nil +(defvar-local ess-funargs-command nil "Dialect specific command to return a list of function arguments. See `ess-function-arguments' and .ess_funargs command in R and S+ for details of the format that should be returned.") -(make-variable-buffer-local 'ess-funargs-command) - -(defvar ess-eldoc-function nil - "Holds a dialect specific eldoc function. -See `ess-r-eldoc-function' and `ess-julia-eldoc-function' for examples.") ; System variables ;;;===================================================== @@ -2851,16 +2671,12 @@ See `ess-r-eldoc-function' and `ess-julia-eldoc-function' for examples.") ;;-- ess-help-S-.. and ess-help-R-.. : in ess-s-lang.el (are used in ess-inf). -(defvar ess-help-sec-keys-alist nil +(defvar-local ess-help-sec-keys-alist nil "Alist of (key . string) pairs for use in section searching.") -(defvar ess-help-sec-regex nil +(defvar-local ess-help-sec-regex nil "Reg(ular) Ex(pression) of section headers in help file.") -(make-variable-buffer-local 'ess-help-sec-keys-alist) -(make-variable-buffer-local 'ess-help-sec-regex) - - ; julia-mode (define-obsolete-variable-alias 'inferior-julia-program-name 'inferior-julia-program "ESS 18.10") @@ -2871,18 +2687,8 @@ Should be an absolute path to the julia executable." :group 'ess-Julia :type '(choice (string) (file))) - ; ess-mode: editing S source - -;;; This syntax table is required by ess-mode.el, ess-inf.el and -;;; ess-trns.el, so we provide it here. -(defvar ess-mode-syntax-table nil "Syntax table for `ess-mode'.") -(defvar ess-mode-completion-syntax-table nil "Completion and help syntax table for `ess-mode'.") -(make-variable-buffer-local 'ess-mode-syntax-table) -(make-variable-buffer-local 'ess-mode-completion-syntax-table) - -(defvar inferior-ess-mode-syntax-table nil "Syntax table for `inferior-ess-mode'.") -(make-variable-buffer-local 'inferior-ess-mode-syntax-table) - +;; FIXME +(defvar-local ess-mode-completion-syntax-table nil "Completion and help syntax table for `ess-mode'.") ; Buffer local customization stuff @@ -2917,25 +2723,19 @@ Not buffer local!") ;; (make-variable-buffer-local 'ess-customize-alist) ;; (defvaralias 'ess-local-customize-alist 'ess-customize-alist) -(defvar ess-local-customize-alist nil +(defvar-local ess-local-customize-alist nil "Buffer local settings for proper behavior. Used to store the values for passing on to newly created buffers.") -(make-variable-buffer-local 'ess-local-customize-alist) - (defvar ess-mode-editing-alist nil "Variable settings for `ess-mode'.") -(defvar ess-transcript-minor-mode nil +(defvar-local ess-transcript-minor-mode nil "Non-nil if using `ess-transcript-mode' as a minor mode of some other mode.") -(make-variable-buffer-local 'ess-transcript-minor-mode) - -(defvar ess-listing-minor-mode nil +(defvar-local ess-listing-minor-mode nil "Non-nil if using `ess-listing-minor-mode'.") -(make-variable-buffer-local 'ess-listing-minor-mode) - (defvar ess--enable-experimental-projects nil "Enable experimental project support in ESS.") @@ -2943,7 +2743,6 @@ Used to store the values for passing on to newly created buffers.") "Placeholder for dialect-specific STERM.") (make-obsolete-variable 'ess-S-loop-timeout "It is ignored." "ESS 18.10") -(make-obsolete-variable 'ess-XLS-loop-timeout "It is ignored." "ESS 18.10") (make-obsolete-variable 'ess-mode-load-hook "It is ignored." "ESS 18.10") (make-obsolete-variable 'ess-speedbar-use-p "It is ignored." "ESS 18.10") (make-obsolete-variable 'ess-synchronize-evals "It is ignored." "ESS 18.10") diff --git a/elpa/ess-20181109.703/ess-defs.info b/elpa/ess-20190121.1430/ess-defs.info similarity index 100% rename from elpa/ess-20181109.703/ess-defs.info rename to elpa/ess-20190121.1430/ess-defs.info diff --git a/elpa/ess-20181109.703/ess-gretl.el b/elpa/ess-20190121.1430/ess-gretl.el similarity index 84% rename from elpa/ess-20181109.703/ess-gretl.el rename to elpa/ess-20190121.1430/ess-gretl.el index b2c04b01..e65d5860 100644 --- a/elpa/ess-20181109.703/ess-gretl.el +++ b/elpa/ess-20190121.1430/ess-gretl.el @@ -39,10 +39,8 @@ (require 'compile); for compilation-* below (require 'ess-r-mode) - ;;; Code: -(defvar gretl-mode-hook nil) -(add-to-list 'auto-mode-alist '("\\.inp$" . gretl-mode)) +(add-to-list 'auto-mode-alist '("\\.inp$" . ess-gretl-mode)) (defvar gretl-syntax-table @@ -78,16 +76,16 @@ (modify-syntax-entry ?\# "<" table) (modify-syntax-entry ?\n ">" table) table) - "Syntax table for `gretl-mode'.") + "Syntax table for `ess-gretl-mode'.") ;; syntax table that holds within strings -(defvar gretl-mode-string-syntax-table +(defvar ess-gretl-mode-string-syntax-table (let ((table (make-syntax-table))) table) - "Syntax table for `gretl-mode' that holds within strings.") + "Syntax table for `ess-gretl-mode' that holds within strings.") (defcustom gretl-continuation-offset 4 - "*Extra indentation applied to Gretl continuation lines." + "Extra indentation applied to Gretl continuation lines." :type 'integer :group 'ess-gretl) @@ -95,7 +93,7 @@ "[^#%\n]*\\(\\\\\\|\\.\\.\\.\\)\\s-*\\(\\s<.*\\)?$") (defcustom gretl-continuation-string "\\" - "*Character string used for Gretl continuation lines. Normally \\." + "Character string used for Gretl continuation lines. Normally \\." :type 'string :group 'ess-gretl) @@ -384,60 +382,35 @@ end keywords as associated values.") (defun gretl-indent-line () - "Indent current line of gretl code" + "Indent current line of gretl code." (interactive) ; (save-excursion - (end-of-line) - (indent-line-to - (or (and (ess-inside-string-p (point-at-bol)) 0) - (save-excursion (ignore-errors (gretl-form-indent))) - (save-excursion - (let ((endtok (progn - (beginning-of-line) - (forward-to-indentation 0) - (gretl-at-keyword gretl-block-end-keywords)))) - (ignore-errors (+ (gretl-last-open-block (point-min)) - (if endtok (- gretl-basic-offset) 0))))) - ;; previous line ends in = - (save-excursion - (if (and (not (equal (point-min) (line-beginning-position))) - (progn - (forward-line -1) - (end-of-line) (backward-char 1) - (equal (char-after (point)) ?=))) - (+ gretl-basic-offset (current-indentation)) - nil)) - ;; take same indentation as previous line - (save-excursion (forward-line -1) - (current-indentation)) - 0)) - (when (gretl-at-keyword gretl-block-end-keywords) - (forward-word 1))) - - -(defvar gretl-editing-alist - '((paragraph-start . (concat "\\s-*$\\|" page-delimiter)) - (paragraph-separate . (concat "\\s-*$\\|" page-delimiter)) - (paragraph-ignore-fill-prefix . t) - (require-final-newline . mode-require-final-newline) - (comment-start . "# ") - (comment-add . 1) - (comment-start-skip . "\\s<+\\s-*") - (comment-column . 40) - ;;(comment-indent-function . 'S-comment-indent) - ;;(ess-comment-indent . 'S-comment-indent) - ;;(ess-indent-line . 'S-indent-line) - (ess-calculate-indent . 'ess-calculate-indent) - (ess-indent-line-function . 'gretl-indent-line) - (parse-sexp-ignore-comments . t) - (ess-style . ess-default-style) ;; ignored - (ess-local-process-name . nil) - ;;(ess-keep-dump-files . 'ask) - (ess-mode-syntax-table . gretl-syntax-table) - ;; (add-log-current-defun-header-regexp . "^.*function[ \t]*\\([^ \t(]*\\)[ \t]*(") - ) - "General options for gretl source files.") - + (end-of-line) + (indent-line-to + (or (and (ess-inside-string-p (point-at-bol)) 0) + (save-excursion (ignore-errors (gretl-form-indent))) + (save-excursion + (let ((endtok (progn + (beginning-of-line) + (forward-to-indentation 0) + (gretl-at-keyword gretl-block-end-keywords)))) + (ignore-errors (+ (gretl-last-open-block (point-min)) + (if endtok (- gretl-basic-offset) 0))))) + ;; previous line ends in = + (save-excursion + (if (and (not (equal (point-min) (line-beginning-position))) + (progn + (forward-line -1) + (end-of-line) (backward-char 1) + (equal (char-after (point)) ?=))) + (+ gretl-basic-offset (current-indentation)) + nil)) + ;; take same indentation as previous line + (save-excursion (forward-line -1) + (current-indentation)) + 0)) + (when (gretl-at-keyword gretl-block-end-keywords) + (forward-word 1))) ;; (defun gretl-send-string-function (process string visibly) ;; (let ((gretl-process (get-process "gretlcli"))) @@ -492,7 +465,6 @@ end keywords as associated values.") (ess-local-customize-alist . 'gretl-customize-alist) (inferior-ess-program . "gretlcli") (ess-get-help-topics-function . 'gretl-get-help-topics-function) - (font-lock-defaults . '(gretl-font-lock-keywords)) (ess-load-command . "open \"%s\"\n") ;; (ess-dump-error-re . "in \\w* at \\(.*\\):[0-9]+") ;; (ess-error-regexp . "\\(^\\s-*at\\s-*\\(?3:.*\\):\\(?2:[0-9]+\\)\\)") @@ -505,10 +477,8 @@ end keywords as associated values.") (ess-dialect . "gretl") (ess-suffix . "inp") (ess-dump-filename-template . (replace-regexp-in-string - "S$" ess-suffix ; in the one from custom: - ess-dump-filename-template-proto)) - (ess-mode-syntax-table . gretl-syntax-table) - (ess-mode-editing-alist . gretl-editing-alist) + "S$" ess-suffix ; in the one from custom: + ess-dump-filename-template-proto)) (ess-change-sp-regexp . nil );ess-r-change-sp-regexp) (ess-help-sec-regex . ess-help-r-sec-regex) (ess-help-sec-keys-alist . ess-help-r-sec-keys-alist) @@ -516,15 +486,13 @@ end keywords as associated values.") (ess-object-name-db-file . "ess-r-namedb.el" ) ;; (ess-imenu-mode-function . nil) (ess-smart-operators . ess-r-smart-operators) - (inferior-ess-help-filetype . nil) (inferior-ess-exit-command . "exit\n") ;;harmful for shell-mode's C-a: -- but "necessary" for ESS-help? - (inferior-ess-start-file . nil) ;; "~/.ess-R" (inferior-ess-start-args . "") (inferior-ess-language-start . nil) (ess-STERM . "iESS") ) - "Variables to customize for Gretl -- set up later than emacs initialization.") + "Variables to customize for Gretl -- set up later than Emacs initialization.") ;; (defcustom inferior-gretl-program "gretlcli" ;; "*The program to use for running gretl scripts." @@ -545,31 +513,26 @@ been created using the variable `ess-r-versions'." :type 'string) ;;;###autoload -(defun gretl-mode (&optional proc-name) +(define-derived-mode ess-gretl-mode ess-mode "ESS[gretl]" "Major mode for editing gretl source. See `ess-mode' for more help." - (interactive "P") ;; (setq ess-customize-alist gretl-customize-alist) ;;(setq imenu-generic-expression R-imenu-generic-expression) - (ess-mode gretl-customize-alist proc-name) - ;; for emacs < 24 - ;; (add-hook 'comint-dynamic-complete-functions 'ess-complete-object-name nil 'local) - ;; for emacs >= 24 - ;; (remove-hook 'completion-at-point-functions 'ess-filename-completion 'local) ;; should be first - ;; (add-hook 'completion-at-point-functions 'ess-object-completion nil 'local) - ;; (add-hook 'completion-at-point-functions 'ess-filename-completion nil 'local) - (if (fboundp 'ess-add-toolbar) (ess-add-toolbar)) - (set (make-local-variable 'end-of-defun-function) 'ess-end-of-function) - ;; (local-set-key "\t" 'gretl-indent-line) ;; temp workaround - ;; (set (make-local-variable 'indent-line-function) 'gretl-indent-line) - ;; (ess-imenu-gretl) - (run-mode-hooks 'gretl-mode-hook)) + (ess-setq-vars-local gretl-customize-alist) + (setq font-lock-defaults `(,gretl-font-lock-keywords)) + (setq-local paragraph-start (concat "\\s-*$\\|" page-delimiter)) + (setq-local paragraph-separate (concat "\\s-*$\\|" page-delimiter)) + (setq-local paragraph-ignore-fill-prefix t) + (setq-local comment-start "# ") + (setq-local comment-add 1) + (setq-local comment-start-skip "\\s<+\\s-*") + (setq-local comment-column 40) + (setq-local ess-indent-line-function 'gretl-indent-line) + (setq-local ess-local-customize-alist gretl-customize-alist) + (when (fboundp 'ess-add-toolbar) (ess-add-toolbar))) (defvar ess-gretl-post-run-hook nil - "Functions run in process buffer after the initialization of - Gretl process.") - - + "Functions run in process buffer after Gretl starts.") ;;;###autoload (defun gretl (&optional start-args) @@ -642,9 +605,6 @@ to gretl, put them in the variable `inferior-gretl-args'." ;; (imenu-add-to-menubar "Imenu-jl")) -(provide 'ess-gretl) -;; (provide 'ess-gretl) - (provide 'ess-gretl) ;;; ess-gretl.el ends here diff --git a/elpa/ess-20181109.703/ess-help.el b/elpa/ess-20190121.1430/ess-help.el similarity index 80% rename from elpa/ess-20181109.703/ess-help.el rename to elpa/ess-20190121.1430/ess-help.el index 70afa2a3..7d4c7f26 100644 --- a/elpa/ess-20181109.703/ess-help.el +++ b/elpa/ess-20190121.1430/ess-help.el @@ -1,4 +1,4 @@ -;;; ess-help.el --- Support for viewing ESS help files +;;; ess-help.el --- Support for viewing ESS help files -*- lexical-binding: t; -*- ;; Copyright (C) 1989-1994, 2017 Bates, Kademan, Ritter and Smith ;; Copyright (C) 1997, A.J. Rossini @@ -38,13 +38,16 @@ ; Requires and autoloads (require 'cl-lib) (eval-when-compile - (require 'tramp) - (require 'reporter)) + (require 'tramp)) +(require 'easymenu) (require 'info) (require 'ess-mode) (require 'ess-inf) (require 'ess-utils) +(declare-function ess-r-help-mode 'ess-r-mode) +(declare-function ess-stata-help-mode "ess-stata-lang") + (defvar ess--help-frame nil "Stores the frame used for displaying R help buffers.") @@ -56,6 +59,14 @@ ;;;; * The major mode ess-help-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun ess--help-major-mode (&optional dialect) + "Determine which help major mode to call, and call it. +DIALECT defaults to `ess-dialect'." + (let ((ess-dialect (or dialect ess-dialect))) + (cond ((string= ess-dialect "R") (require 'ess-r-mode) (ess-r-help-mode)) + ((string= ess-dialect "stata") (require 'ess-stata-lang) (ess-stata-help-mode)) + (t (ess-help-mode))))) + (defun ess--help-get-bogus-buffer-substring (buffer &optional nr-first) "Return non-nil if BUFFER looks like a bogus ESS help buffer. Return the pair (match-beg. match-end) which can be used in error @@ -99,16 +110,15 @@ the first 150 characters of the buffer are searched." buffer))) (buffer-list))) -(defvar ess-help-type nil +(defvar-local ess-help-type nil "Type of help file, help, index, vingettes etc. Local in `ess-help' buffers.") -(make-variable-buffer-local 'ess-help-type) -(defvar ess-help-object nil +(defvar-local ess-help-object nil "Name of the object the help is displayed for. Is name of the package for package index. Local in `ess-help' buffers.") -(make-variable-buffer-local 'ess-help-object) +(put 'ess-help-object 'permanent-local t) ;;;###autoload (defun ess-display-help-on-object (object &optional command) @@ -137,10 +147,11 @@ suplied, it is used instead of `inferior-ess-help-command'." current-prefix-arg (ess--help-get-bogus-buffer-substring old-hb-p)) (ess-with-current-buffer tbuffer - (setq ess-help-object object - ess-help-type 'help) - (setq buffer-read-only t) - (ess--flush-help-into-current-buffer object command))) + (ess--flush-help-into-current-buffer object command) + (setq ess-help-object object) + (ess--help-major-mode) + (setq truncate-lines nil + ess-help-type 'help))) (unless (ess--help-kill-bogus-buffer-maybe tbuffer) (ess--switch-to-help-buffer tbuffer))))) @@ -153,11 +164,10 @@ suplied, it is used instead of `inferior-ess-help-command'." ;; TODO-CLEANUP: Remove the inferior- prefix for consistency (format inferior-ess-help-command object))) -(defun ess--flush-help-into-current-buffer (object &optional command dont-ask) +(defun ess--flush-help-into-current-buffer (object &optional command) (let ((inhibit-modification-hooks t) (inhibit-read-only t)) (delete-region (point-min) (point-max)) - (ess-help-mode) (let ((command (if (and command (string-match-p "%s" command)) (format command object) command))) @@ -166,8 +176,7 @@ suplied, it is used instead of `inferior-ess-help-command'." (unless (string= ess-language "STA") (ess-nuke-help-bs)) (goto-char (point-min)) - (set-buffer-modified-p 'nil) - (setq truncate-lines nil))) + (set-buffer-modified-p 'nil))) (defun ess--help-kill-bogus-buffer-maybe (buffer) "Internal, try to kill bogus BUFFER with message. Return t if killed." @@ -227,79 +236,66 @@ if necessary. It is bound to RET and C-m in R-index pages." (funcall ess-build-help-command-function string)))) (ess-display-help-on-object string command))) +(cl-defgeneric ess-help-commands () + "Return an alist of dialect specific retriever commands. +Currently understood commands: + - package-for-object - command to get the package of current help object + - packages - command to get a list of available packages (REQUIRED) + - package-index - command to get the package index (REQUIRED) + - index-keyword-reg - regexp used to find keywords for linking in index listing + only (1st subexpression is used) + - index-start-reg - regexp from where to start searching for keywords in index listing" + (user-error "Not implemented for %s " ess-dialect)) + +(cl-defmethod ess-help-commands (&context ((string= ess-dialect "R") (eql t))) + '((package-for-object . "sub('package:', '', .ess.findFUN('%s'))\n") + (packages . ".packages(all.available=TRUE)\n") + (package-index . ".ess.help(package='%s', help.type='text')\n") + (index-keyword-reg . "^\\([^ \t\n:]+\\)") + (index-start-reg . "^Index:"))) + (defun ess-display-package-index () "Prompt for package name and display its index." (interactive) - (let ((object (buffer-name)) - (alist ess-local-customize-alist) - (pname ess-local-process-name) - pack buff all-packs not-implemented - ;; Available customization for ess languages/dialects: - com-package-for-object ;command to get the package of current help object - com-packages ;command to get a list of available packages (REQUIRED) - com-package-index ;command to get the package index (REQUIRED) - reg-keyword ;regexp used to find keywords for linking in index listing - ; only (1st subexpression is used) - reg-start ;regexp from where to start searching for keywords in index listing - ) - (cond - ((string-match "^R" ess-dialect) - ;; carefully using syntax to be parsed in old R versions (no '::', '_'): - (setq com-package-for-object "sub('package:', '', .ess.findFUN('%s'))\n" - com-packages ".packages(all.available=TRUE)\n" - com-package-index ".ess.help(package='%s', help.type='text')\n" - reg-keyword "^\\([^ \t\n:]+\\)" - reg-start "^Index:")) - ((string-match "julia" ess-dialect) - (setq com-packages "_ess_list_categories()\n" - com-package-index "_ess_print_index(\"%s\")\n" - reg-keyword "^\\(.*+\\):$*" - reg-start ":" - )) - (t (error "Not implemented for %s " ess-dialect))) - (when (and com-package-for-object - ess-help-object - (eq ess-help-type 'help)) - (setq pack (car (ess-get-words-from-vector - (format com-package-for-object ess-help-object))))) - (setq all-packs (ess-get-words-from-vector com-packages)) - (unless pack ;try symbol at point - (setq pack (car (member (ess-read-object-name-default) all-packs)))) - (setq pack (ess-completing-read "Index of" - all-packs nil nil nil nil pack)) + (let* ((coms (ess-help-commands)) + (all-packs (ess-get-words-from-vector (cdr (assoc 'packages coms)))) + (pack (or (when (and ess-help-object + (cdr (assoc 'package-for-object coms)) + (eq ess-help-type 'help)) + (car (ess-get-words-from-vector + (format (cdr (assoc 'package-for-object coms)) + ess-help-object)))) + (car (member (ess-read-object-name-default) all-packs))))) + (setq pack (ess-completing-read "Index of" all-packs nil nil nil nil pack)) (ess--display-indexed-help-page - (format com-package-index pack) - reg-keyword + (format (cdr (assoc 'package-index coms)) pack) + (cdr (assoc 'index-keyword-reg coms)) (format "*help[%s](index:%s)*" ess-dialect pack) - 'index nil nil reg-start pack))) - -(defalias 'ess-display-index 'ess-display-package-index) -(make-obsolete 'ess-display-index 'ess-display-package-index "ESS[12.09]") + 'index nil nil (cdr (assoc 'index-start-reg coms)) pack))) (defun ess--display-indexed-help-page (command item-regexp title help-type &optional action help-echo reg-start help-object) - "Internal function to display help pages with linked actions - ;; COMMAND to produce the indexed help page - ;; ITEM-REGEXP -- first subexpression is highlighted - ;; TITLE of the help page - ;; HELP-TYPE to be stored in `ess-help-type' local variable - ;; ACTION is a function with no argument (default is `ess--button-action') - ;; HELP-ECHO - ;; REG-START gives the start location from where to search linkifying" + "Internal function to display help pages with linked actions. +COMMAND to produce the indexed help page, +ITEM-REGEXP -- first subexpression is highlighted, +TITLE of the help page, +HELP-TYPE to be stored in `ess-help-type' local variable, +ACTION is a function with no argument (default is `ess--button-action'), +HELP-ECHO if given becomes the help-echo property of the button, +REG-START gives the start location from where to search linkifying, and HELP-OBJECT becomes `ess-help-object'." (interactive) (let ((inhibit-modification-hooks t) - (object (buffer-name)) (alist ess-local-customize-alist) (pname ess-local-process-name) (buff (get-buffer-create title))) (with-current-buffer buff - (setq ess-help-object help-object) - (ess-setq-vars-local (eval alist)) - (setq ess-help-sec-regex "\\(^\\s-.*\n\\)\\|\\(^\n\\)" - ess-local-process-name pname) (setq buffer-read-only nil) (delete-region (point-min) (point-max)) - (ess-help-mode) + (setq ess-local-process-name pname) + (ess--help-major-mode) + (ess-setq-vars-local (eval alist)) + (setq ess-help-object help-object + ess-help-sec-regex "\\(^\\s-.*\n\\)\\|\\(^\n\\)") (ess-command command buff) (ess-help-underline) (set-buffer-modified-p 'nil) @@ -396,15 +392,16 @@ With (prefix) ALL non-nil, use `vignette(*, all=TRUE)`, i.e., from all installed (alist ess-local-customize-alist) (remote (file-remote-p default-directory)) (buff (get-buffer-create (format "*[%s]vignettes*" ess-dialect))) - (inhibit-modification-hooks t)) + (inhibit-modification-hooks t) + (inhibit-read-only t)) (with-current-buffer buff (setq buffer-read-only nil) (delete-region (point-min) (point-max)) (ess-setq-vars-local (eval alist)) + (setq ess-local-process-name proc-name) + (ess--help-major-mode) (setq ess-help-sec-regex "^\\w+:$" - ess-help-type 'vignettes - ess-local-process-name proc-name) - (ess-help-mode) + ess-help-type 'vignettes) (set-buffer-modified-p 'nil) (goto-char (point-min)) (dolist (el vslist) @@ -454,9 +451,9 @@ With (prefix) ALL non-nil, use `vignette(*, all=TRUE)`, i.e., from all installed (defun ess--action-open-in-emacs (pos) (display-buffer (find-file-noselect (get-text-property pos 'help-echo)))) (defun ess--action-R-open-vignette (pos) - (ess-command (format "vignette('%s', package='%s')\n" - (get-text-property pos 'vignette) - (get-text-property pos 'package)))) + (ess-eval-linewise (format "vignette('%s', package='%s')\n" + (get-text-property pos 'vignette) + (get-text-property pos 'package)))) (defalias 'ess-help-quit 'quit-window) (make-obsolete 'ess-help-quit 'quit-window "16.04") @@ -466,8 +463,7 @@ With (prefix) ALL non-nil, use `vignette(*, all=TRUE)`, i.e., from all installed (dolist (f (frame-list)) (when (frame-visible-p f) (dolist (w (window-list f)) - (when (eq (buffer-local-value 'major-mode (window-buffer w)) - 'ess-help-mode) + (when (with-current-buffer (window-buffer w) (derived-mode-p 'ess-help-mode)) (throw 'win w))))))) (defun ess--switch-to-help-buffer (buff) @@ -532,10 +528,6 @@ For internal use. Take into account variable `ess-help-own-frame'." (interactive) (ess-execute-dialect-specific ess-reference-lookup-command)) -(defvar ess-help-sec-map nil "Sub-keymap for ESS help mode.") -;; this breaks "s ?" rather than to fix any (unbroken !) thing: -;; (make-variable-buffer-local 'ess-help-sec-map) - (defvar ess-doc-map (let (ess-doc-map) (define-prefix-command 'ess-doc-map) @@ -564,20 +556,12 @@ For internal use. Take into account variable `ess-help-own-frame'." (defvar ess-help-mode-map (let ((map (make-keymap))); Full keymap, in order to - (suppress-keymap map) ; suppress all usual "printing" characters - (when (boundp 'special-mode-map) - (set-keymap-parent map (make-composed-keymap - button-buffer-map - special-mode-map))) - (define-key map "q" 'quit-window) (define-key map "\C-m" 'next-line) - ;; (define-key map "s" ess-help-sec-map) (define-key map "h" 'ess-display-help-on-object) (define-key map "w" 'ess-display-help-in-browser) (define-key map "i" 'ess-display-package-index) (define-key map "a" 'ess-display-help-apropos) (define-key map "v" 'ess-display-vignettes) - ;; TODO: `electric mouse-2' ;; (define-key map [mouse-2] 'ess-display-help-on-object) (define-key map "l" 'ess-eval-line-visibly-and-step) (define-key map "r" 'ess-eval-region-and-go) @@ -587,7 +571,6 @@ For internal use. Take into account variable `ess-help-own-frame'." (define-key map "/" 'isearch-forward) (define-key map "x" 'ess-kill-buffer-and-go) (define-key map "k" 'kill-this-buffer) - (define-key map "?" 'ess-describe-help-mode) ;;-- those should be "inherited" from ess-mode-map ( ./ess-mode.el ) (define-key map "\C-c\C-s" 'ess-switch-process) (define-key map "\C-c\C-r" 'ess-eval-region) @@ -640,47 +623,18 @@ For internal use. Take into account variable `ess-help-own-frame'." ["Kill Buffer" kill-this-buffer t] ["Kill Buffer & Go" ess-kill-buffer-and-go t] "-" - ["Handy commands" ess-handy-commands t] - ["Describe ESS-help Mode" ess-describe-help-mode t]) - "Menu used in `ess-help-mode'.") - -(defun ess-help-mode () -;;; Largely ripped from more-mode.el, -;;; originally by Wolfgang Rupprecht wolfgang@mgm.mit.edu - "Mode for viewing ESS help files. -Use SPC and DEL to page back and forth through the file. -Use `n' and `p' to move to next and previous section, - `s' to jump to a particular section; `s ?' for help. -Use `q' to return to your ESS session; `x' to kill this buffer first. -The usual commands for evaluating ESS source are available. -Other keybindings are as follows: -\\{ess-help-mode-map}" - (interactive) - (setq major-mode 'ess-help-mode) - (setq mode-name "ESS Help") - (setq font-lock-mode nil) - (use-local-map ess-help-mode-map) - ;;; Keep out of the code. - (make-local-variable 'indent-tabs-mode) - (setq indent-tabs-mode nil) - (if ess-mode-syntax-table ;;set in advance by ess-setq-local - (set-syntax-table ess-mode-syntax-table)) - (require 'easymenu) - (easy-menu-define ess-help-mode-menu-map ess-help-mode-map - "Menu keymap for ess-help mode." ess-help-mode-menu) - ;; Add the keys for navigating among sections; this is done - ;; dynamically since different languages (e.g. S vs R) have different - ;; section headings. - (setq ess-help-sec-map (make-sparse-keymap)) - (setq-local show-trailing-whitespace nil) - (dolist (pair ess-help-sec-keys-alist) - (define-key ess-help-sec-map (char-to-string (car pair)) - 'ess-skip-to-help-section)) - (define-key ess-help-sec-map "?" 'ess-describe-sec-map) - (define-key ess-help-sec-map ">" 'end-of-buffer) - (define-key ess-help-sec-map "<" 'beginning-of-buffer) - (define-key ess-help-mode-map "s" ess-help-sec-map) - (run-mode-hooks 'ess-help-mode-hook)) + ["Handy commands" ess-handy-commands t]) + "Menu used in ess-help mode.") + +(easy-menu-define ess-help-mode-menu-map ess-help-mode-map + "Menu keymap for ess-help mode." ess-help-mode-menu) + +(define-derived-mode ess-help-mode special-mode "ESS Help" + "Mode for viewing ESS help files." + ;; FIXME + ;; (if ess-mode-syntax-table ;;set in advance by ess-setq-local + ;; (set-syntax-table ess-mode-syntax-table)) + (setq show-trailing-whitespace nil)) ;;*;; User commands defined in ESS help mode @@ -717,11 +671,6 @@ sections." (if (re-search-backward ess-help-sec-regex nil 'no-error) nil (message "No previous section.")))) -(defun ess-describe-help-mode nil - "Display help for `ess-mode'." - (interactive) - (describe-function 'ess-help-mode)) - (defun ess-kill-buffer-and-go nil "Kill the current buffer and switch back to the ESS process." (interactive) @@ -746,10 +695,7 @@ Keystroke Section (insert " " (car cs) " " - (cdr cs) "\n")) - (insert "\nFull list of key definitions:\n" - (substitute-command-keys - "\\{ess-help-sec-map}"))))) + (cdr cs) "\n"))))) (defun ess-helpobjs-at-point--read-obj () (let* ((obj (ess-read-object-name-default))) @@ -762,7 +708,6 @@ Keystroke Section (substring object (match-end 0)) object)) -;;;###autoload (defun ess-helpobjs-at-point (slist) "Return a list (def obj fun). Obj is a name at point, fun is the name of the function call @@ -876,10 +821,9 @@ Note that we can't search SAS, Stata or XLispStat for additional information." ;; describe object at point -(defvar ess-describe-object-at-point-commands nil +(defvar-local ess-describe-object-at-point-commands nil "Commands cycled by `ess-describe-object-at-point'. Dialect specific.") -(make-variable-buffer-local 'ess-describe-at-point-commands) (defvar ess--descr-o-a-p-commands nil) @@ -906,7 +850,7 @@ other dialects)." (objname (or (and (use-region-p) (buffer-substring-no-properties (point) (mark))) (ess-symbol-at-point))) - bs ess--descr-o-a-p-commands) ;; used in ess--describe-object-at-point + ess--descr-o-a-p-commands) ;; used in ess--describe-object-at-point (unless objname (error "No object at point ")) (define-key map (vector last-command-event) 'ess--describe-object-at-point) ;; todo: put digits into the map @@ -926,7 +870,7 @@ other dialects)." (setq unread-command-events (append keys unread-command-events)))))) -(defun ess--describe-object-at-point (ev objname) +(defun ess--describe-object-at-point (_ev objname) (setq ess--descr-o-a-p-commands (or ess--descr-o-a-p-commands (symbol-value ess-describe-object-at-point-commands))) (let* ((com (format (car (pop ess--descr-o-a-p-commands)) objname)) @@ -952,48 +896,5 @@ other dialects)." (set-window-point (get-buffer-window buf) pos) ;; don't move window point buf))) - -;;; Bug Reporting - -;;;###autoload -(defun ess-submit-bug-report () - "Submit a bug report to the ESS maintainers." - (interactive) - (require 'ess-mode) - (require 'reporter) - (let ((reporter-prompt-for-summary-p 't)) - (reporter-submit-bug-report - "ess-bugs@r-project.org" - (concat "ess-mode " (ess-version-string)) - (list 'ess-language - 'ess-dialect - 'ess-ask-for-ess-directory - 'ess-ask-about-transfile - 'default-directory - 'ess-keep-dump-files - 'ess-source-directory - 'ess-use-ido - 'ess-use-eldoc - 'ess-use-tracebug - 'ess-use-auto-complete - 'ess-use-company - 'ess-eval-visibly-p - 'ess-can-eval-in-background - 'ess-local-process-name) - nil - (lambda () - ;;(goto-char (point-max)) - (rfc822-goto-eoh) - (forward-line 1) - (insert "\n\n-------------------------------------------------------\n") - (insert "This bug report will be sent to the ESS bugs email list\n") - (insert "Press C-c C-c when you are ready to send your message.\n") - (insert "-------------------------------------------------------\n\n") - (insert (with-current-buffer ess-dribble-buffer - (goto-char (point-max)) - (forward-line -100) - (buffer-substring-no-properties (point) (point-max)))))))) - - (provide 'ess-help) ;;; ess-help.el ends here diff --git a/elpa/ess-20181109.703/ess-inf.el b/elpa/ess-20190121.1430/ess-inf.el similarity index 71% rename from elpa/ess-20181109.703/ess-inf.el rename to elpa/ess-20190121.1430/ess-inf.el index ee18cb50..873d6e70 100644 --- a/elpa/ess-20181109.703/ess-inf.el +++ b/elpa/ess-20190121.1430/ess-inf.el @@ -1,4 +1,4 @@ -;;; ess-inf.el --- Support for running S as an inferior Emacs process +;;; ess-inf.el --- Support for running S as an inferior Emacs process -*- lexical-binding: t; -*- ;; Copyright (C) 1989-1994 Bates, Kademan, Ritter and Smith ;; Copyright (C) 1997-1999 A.J. Rossini , @@ -33,14 +33,16 @@ ;;; Code: - ; Requires and autoloads (eval-when-compile - (require 'tramp)) -(require 'ess-generics) + (require 'cl-lib) + (require 'tramp) + (require 'subr-x)) (require 'ess-utils) -(require 'newcomment) + +(require 'ansi-color) (require 'comint) (require 'overlay) +(require 'project) (require 'compile) (require 'format-spec) (require 'ess-tracebug) @@ -51,12 +53,49 @@ (declare-function tramp-sh-handle-expand-file-name "tramp-sh") (declare-function tramp-dissect-file-name "tramp") (declare-function tramp-tramp-file-p "tramp") - -;; TODO: refactor and remove file-local variable -;; byte-compile-warnings. See ess-r-mode.el also -(defvar proc) -(defvar start) -(defvar end) +(declare-function inferior-ess-r-mode "ess-r-mode") +(declare-function inferior-ess-julia-mode "ess-julia") +(declare-function inferior-ess-stata-mode "ess-stata-mode") + +(declare-function ess-mode "ess") +(declare-function ess-complete-object-name "ess-r-completion") + +(defvar add-log-current-defun-header-regexp) + +;; The following declares can be removed once we drop Emacs 25 +(declare-function tramp-file-name-method "tramp") +(declare-function tramp-file-name-user "tramp") +(declare-function tramp-file-name-host "tramp") +(declare-function tramp-file-name-localname "tramp") +(declare-function tramp-file-name-hop "tramp") + +(defvar inferior-ess-mode-syntax-table + (let ((tab (copy-syntax-table comint-mode-syntax-table))) + tab) + "Syntax table for `inferior-ess-mode'.") + +(defun ess--inferior-major-mode (dialect) + "Set major mode according to DIALECT." + (cond ((string= "R" dialect) + (progn (require 'ess-r-mode) + (inferior-ess-r-mode))) + ((string= "julia" dialect) + (progn (require 'ess-julia) + (inferior-ess-julia-mode))) + ((string= "stata" dialect) + (progn (require 'ess-stata-mode) + (inferior-ess-stata-mode))) + ;; FIXME: we need this horrible hack so that + ;; inferior-ess-mode-syntax-table gets set for + ;; languages that still rely on the old way of doing + ;; things (before we used define-derived-mode for + ;; inferior modes). + (t + (progn + (setq-local inferior-ess-mode-syntax-table + (eval (or (alist-get 'inferior-ess-mode-syntax-table ess-customize-alist) + (alist-get 'ess-mode-syntax-table ess-customize-alist)))) + (inferior-ess-mode))))) ;;*;; Process handling @@ -70,7 +109,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;*;; Starting a process -;;;###autoload (defun ess-proc-name (n name) "Return name of process N, as a string, with NAME prepended. If `ess-plain-first-buffername', then initial process is number-free." @@ -79,7 +117,6 @@ If `ess-plain-first-buffername', then initial process is number-free." (= n 1))) ; if not both first and plain-first add number (concat ":" (number-to-string n))))) -;;;###autoload (defun inferior-ess (&optional ess-start-args customize-alist no-wait) "Start inferior ESS process. @@ -95,14 +132,12 @@ buffer name will be like *R* or *R2*, determined by `ess-gen-proc-buffer-name-function'. Takes the program name from the variable `inferior-ess-program'. -An initialization file (dumped into the process) is specified by -`inferior-ess-start-file', and `inferior-ess-start-args' is used -to accompany the call for `inferior-ess-program'. +Arguments to `inferior-ess-program' can be given with +`inferior-ess-start-args'. -When creating a new process, the process buffer replaces the -current window if `inferior-ess-same-window' is non-nil. -Alternatively, it can appear in its own frame if -`inferior-ess-own-frame' is non-nil. +See Info node `(ess)Customizing startup' and +`display-buffer-alist' to control where and how the buffer is +displayed. \(Type \\[describe-mode] in the process buffer for a list of commands.) @@ -110,26 +145,13 @@ commands.) CUSTOMIZE-ALIST is the list of dialect-specific variables. When non-nil, NO-WAIT tells ESS not to wait for the process to finish. This may be useful for debugging." - ;; Use the current buffer if it is in inferior-ess-mode or ess-trans-mode ;; If not, maybe ask about starting directory and/or transcript file. ;; If no transfile, use buffer *S* - ;; ;; This function is primarily used to figure out the Process and ;; buffer names to use for inferior-ess. - - ;; Once, long ago, it was used for switching buffers, but we don't - ;; do that any more (at least not from here). - - (interactive) - - (let* ((ess-customize-alist (or customize-alist - ess-customize-alist)) - (temp-ess-dialect (eval (cdr (assoc 'ess-dialect - ess-customize-alist)))) - (temp-ess-lang (eval (cdr (assoc 'ess-language - ess-customize-alist))))) - + (let* ((ess-customize-alist (or customize-alist ess-customize-alist)) + (temp-ess-dialect (eval (cdr (assoc 'ess-dialect ess-customize-alist))))) (run-hooks 'ess-pre-run-hook) (ess-write-to-dribble-buffer (format "(inf-ess 1): lang=%s, dialect=%s, tmp-dialect=%s, buf=%s\n" @@ -141,7 +163,6 @@ This may be useful for debugging." (file-name-nondirectory inferior-ess-r-program) temp-ess-dialect) temp-ess-dialect)) - (temp-lang temp-ess-lang) ;; Find the next non-existent process N (*R:N*) (procname (let ((ntry 1)) (while (get-process (ess-proc-name ntry temp-dialect)) @@ -158,7 +179,7 @@ This may be useful for debugging." (cond ;; 1) try to use current buffer, if inferior-ess-mode but no process ((and (not (comint-check-proc (current-buffer))) - (eq major-mode 'inferior-ess-mode)) + (derived-mode-p 'inferior-ess-mode)) (setq buf (current-buffer)) ;; don't change existing buffer name in this case; It is very ;; commong to restart the process in the same buffer. @@ -189,6 +210,8 @@ This may be useful for debugging." (set-buffer buf) (set 'default-directory cur-dir) + ;; TODO: Get rid of this, we should rely on modes to set the + ;; variables they need. (ess-setq-vars-local ess-customize-alist) (ess-write-to-dribble-buffer @@ -203,98 +226,62 @@ This may be useful for debugging." (progn ;; fixme: when does this happen? -> log: (ess-write-to-dribble-buffer (format "(inf-ess ..): popping to proc\n")) (pop-to-buffer (process-buffer proc))) - ;; Otherwise, crank up a new process - (let* ((symbol-string - (concat "inferior-" inferior-ess-program "-args")) - (switches-symbol (intern-soft symbol-string)) - (switches - (when (and switches-symbol (boundp switches-symbol)) - (symbol-value switches-symbol)))) - - (inferior-ess-mode) - (ess-write-to-dribble-buffer - (format "(inf-ess 3.0): prog=%s, start-args=%s, echoes=%s\n" - inferior-ess-program infargs comint-process-echoes)) - (setq ess-local-process-name procname) - (goto-char (point-max)) - - (when ess-history-file - ;; Load past history - (when (eq t ess-history-file) - (setq-local ess-history-file (concat "." ess-dialect "history"))) - (let ((histfile (expand-file-name ess-history-file - (or ess-history-directory cur-dir)))) - (when (file-readable-p histfile) - (setq comint-input-ring-file-name histfile) - (comint-read-input-ring)))) - - (with-current-buffer buf - (rename-buffer buf-name-str t)) - - ;; before the start, display the buffer depending on user settings: - (cond (inferior-ess-own-frame - (progn - (make-frame inferior-ess-frame-alist) - (switch-to-buffer buf))) - (inferior-ess-same-window - (switch-to-buffer buf)) - (t (pop-to-buffer buf))) - - ;; create the process - (setq buf - (if switches - (inferior-ess-make-comint buf-name-str - procname - infargs - switches) - (inferior-ess-make-comint buf-name-str - procname - infargs))) - - (set-buffer buf) - (set 'default-directory cur-dir) - - (setq proc (get-buffer-process buf)) - - ;; set the process sentinel to save the history - (set-process-sentinel proc 'ess-process-sentinel) - ;; add this process to ess-process-name-list, if needed - (let ((conselt (assoc procname ess-process-name-list))) - (unless conselt - (setq ess-process-name-list - (cons (cons procname nil) ess-process-name-list)))) - (ess-make-buffer-current) - (goto-char (point-max)) - (setq ess-sl-modtime-alist nil) - - ;; add the process filter to catch certain output - (set-process-filter proc 'inferior-ess-output-filter) - (inferior-ess-mark-as-busy proc) - - (unless no-wait - (ess-write-to-dribble-buffer "(inferior-ess: waiting for process to start (before hook)\n") - (ess-wait-for-process proc nil 0.01 t)) - - (unless (and proc (eq (process-status proc) 'run)) - (error "Process %s failed to start" procname)) - - ;; don't font-lock strings over process prompt - (set (make-local-variable 'syntax-begin-function) ;; fixme: obsolete in emacs 25.1 - #'inferior-ess-last-prompt-end) - (set (make-local-variable 'font-lock-fontify-region-function) - #'inferior-ess-fontify-region) - - (when ess-setwd-command - (ess-set-working-directory cur-dir)) - - (run-hooks 'ess-post-run-hook) - (ess-load-extras t) - - ;; user initialization can take some time ... - (unless no-wait - (ess-write-to-dribble-buffer "(inferior-ess 3): waiting for process after hook") - (ess-wait-for-process proc)))))))) + (ess--inferior-major-mode ess-dialect) + (setq ess-local-process-name procname) + (with-current-buffer buf + (rename-buffer buf-name-str t)) + ;; Show the buffer + ;; TODO: Remove inferior-ess-own-frame after ESS 19.04, then just have: + ;; (pop-to-buffer buf) + (pop-to-buffer buf (with-no-warnings + (when inferior-ess-own-frame + '(display-buffer-pop-up-frame)))) + ;; create the process + (setq buf + (inferior-ess-make-comint buf-name-str + procname + infargs)) + + (set-buffer buf) + (set 'default-directory cur-dir) + + (setq proc (get-buffer-process buf)) + + ;; set the process sentinel to save the history + (set-process-sentinel proc 'ess-process-sentinel) + ;; add this process to ess-process-name-list, if needed + (let ((conselt (assoc procname ess-process-name-list))) + (unless conselt + (setq ess-process-name-list + (cons (cons procname nil) ess-process-name-list)))) + (ess-make-buffer-current) + (goto-char (point-max)) + (setq ess-sl-modtime-alist nil) + + ;; add the process filter to catch certain output + (set-process-filter proc 'inferior-ess-output-filter) + (inferior-ess-mark-as-busy proc) + + (unless no-wait + (ess-write-to-dribble-buffer "(inferior-ess: waiting for process to start (before hook)\n") + (ess-wait-for-process proc nil 0.01 t)) + + (unless (and proc (eq (process-status proc) 'run)) + (error "Process %s failed to start" procname)) + + (set (make-local-variable 'font-lock-fontify-region-function) + #'inferior-ess-fontify-region) + + (when ess-setwd-command + (ess-set-working-directory cur-dir)) + + (run-hooks 'ess-post-run-hook) + + ;; user initialization can take some time ... + (unless no-wait + (ess-write-to-dribble-buffer "(inferior-ess 3): waiting for process after hook") + (ess-wait-for-process proc))))))) (defun ess--accumulation-buffer (proc) (let ((abuf (process-get proc :accum-buffer))) @@ -307,29 +294,18 @@ This may be useful for debugging." (setq-local inhibit-modification-hooks t)) abuf)))) -(defvar inferior-ess-objects-command nil +(defvar-local inferior-ess-objects-command nil "The language/dialect specific command for listing objects. It is initialized from the corresponding inferior--objects-command and then made buffer local."); and the *--* ones are customized! -(make-variable-buffer-local 'inferior-ess-objects-command) -(defvar ess-save-lastvalue-command nil +(defvar-local ess-save-lastvalue-command nil "The command to save the last value. See S section for more details. Default depends on the ESS language/dialect and hence made buffer local") -(make-variable-buffer-local 'ess-save-lastvalue-command) -(defvar ess-retr-lastvalue-command nil +(defvar-local ess-retr-lastvalue-command nil "The command to retrieve the last value. See S section for more details. Default depends on the ESS language/dialect and hence made buffer local") -(make-variable-buffer-local 'ess-retr-lastvalue-command) - -(defun inferior-ess-last-prompt-end (&optional pos limit) - "Move to the end of last prompt from POS, but not further than LIMIT." - (let ((pos (or pos (point)))) - (goto-char pos) - (end-of-line) - (when (re-search-backward inferior-ess-prompt limit t) - (goto-char (match-end 0))))) (defvar compilation--parsed) (defvar ess--tb-last-input) @@ -340,7 +316,6 @@ Default depends on the ESS language/dialect and hence made buffer local") (inhibit-point-motion-hooks t) (font-lock-dont-widen t) (font-lock-extend-region-functions nil) - (buff (current-buffer)) (pos1 beg) (pos2)) (when (< beg end) @@ -378,53 +353,84 @@ name. Abbreviation is performed by `abbreviate-file-name'. See `ess-gen-proc-buffer-name-function'." (format "*%s:%s*" proc-name (abbreviate-file-name default-directory))) -(defun ess-gen-proc-buffer-name:projectile-or-simple (proc-name) - "Function to generate buffer name in the form *PROC-NAME:PROJECTILE-ROOT*. -PROC-NAME is a string representing an internal process -name. PROJECTILE-ROOT is directory name returned by -`projectile-project-p' if defined. If -`projectile-project-p' is undefined or no project directory -has been found use `ess-gen-proc-buffer-name:simple'. See +(defun ess-gen-proc-buffer-name:project-or-simple (proc-name) + "Function to generate buffer name in the form *PROC-NAME:PROJECT-ROOT*. +PROC-NAME is a string representing an internal process name. +PROJECT-ROOT is directory name returned by `project-roots'. If no +project directory has been found use +`ess-gen-proc-buffer-name:simple'. See `ess-gen-proc-buffer-name-function'." - (let ((proj (and (fboundp 'projectile-project-p) - (projectile-project-p)))) - (if proj - (format "*%s:%s*" proc-name (file-name-nondirectory - (directory-file-name proj))) - (ess-gen-proc-buffer-name:simple proc-name)))) - -(defun ess-gen-proc-buffer-name:projectile-or-directory (proc-name) - "Function to generate buffer name in the form *PROC-NAME:PROJECTILE-ROOT*. -PROC-NAME is a string representing an internal process -name. PROJECTILE-ROOT is directory name returned by -`projectile-project-p' if defined. If -`projectile-project-p' is undefined, or no project directory -has been found, use `ess-gen-proc-buffer-name:directory'. See + (if-let ((p (project-current)) + (proj (car (project-roots p)))) + (format "*%s:%s*" proc-name (file-name-nondirectory + (directory-file-name proj))) + (ess-gen-proc-buffer-name:simple proc-name))) + +(defun ess-gen-proc-buffer-name:project-or-directory (proc-name) + "Function to generate buffer name in the form *PROC-NAME:PROJECT-ROOT*. +PROC-NAME is a string representing an internal process name. +PROJECT-ROOT is directory name returned by `project-roots' if +defined. If no project directory has been found, use +`ess-gen-proc-buffer-name:directory'. See `ess-gen-proc-buffer-name-function'." - (let ((proj (and (fboundp 'projectile-project-p) - (projectile-project-p)))) - (if proj - (format "*%s:%s*" proc-name (file-name-nondirectory - (directory-file-name proj))) - (ess-gen-proc-buffer-name:directory proc-name)))) - -(defun inferior-ess-set-status (proc string &optional no-timestamp) + (if-let ((p (project-current)) + (proj (car (project-roots p)))) + (format "*%s:%s*" proc-name (file-name-nondirectory + (directory-file-name proj))) + (ess-gen-proc-buffer-name:directory proc-name))) + +;; This ensures that people who have this set in their init file don't +;; get errors about undefined functions after upgrading ESS: +(define-obsolete-function-alias 'ess-gen-proc-buffer-name:projectile-or-simple + 'ess-gen-proc-buffer-name:project-or-simple "ESS 19.04") +(define-obsolete-function-alias 'ess-gen-proc-buffer-name:projectile-or-directory + 'ess-gen-proc-buffer-name:project-or-directory "ESS 19.04") + +(defun inferior-ess-available-p (&optional proc) + "Return non-nil if PROC is not busy." + (when-let ((proc (or proc (and ess-local-process-name + (get-process ess-local-process-name))))) + (unless (process-get proc 'busy) + (or (ess-debug-active-p proc) ; don't send empty lines in debugger + (when-let ((last-check (process-get proc 'last-availability-check))) + (time-less-p (process-get proc 'last-eval) last-check)) + (progn + ;; Send an empty string and waiting a bit to make sure we are not busy. + (process-send-string proc "\n") + (inferior-ess-mark-as-busy proc) + (process-put proc 'availability-check t) + ;; Start with a very conservative waiting time and quickly average + ;; down to the actual response. + (let ((avresp (or (process-get proc 'average-response-time) 0.1)) + (ts (current-time))) + (when (accept-process-output proc (max 0.005 (* 2.0 avresp))) + (let ((avresp (/ (+ (* 2.0 avresp) + (float-time (time-subtract (current-time) ts))) + 3.0))) + (process-put proc 'average-response-time avresp))) + (process-put proc 'last-availability-check ts)) + (not (process-get proc 'busy))))))) + +(defun inferior-ess--set-status (proc string) "Internal function to set the satus of the PROC. -If no-timestamp, don't set the last-eval timestamp. -Return the 'busy state." +Return non-nil if the process is in a ready (aka not busy) +state." ;; todo: do it in one search, use starting position, use prog1 - (let ((busy (not (string-match (concat "\\(" inferior-ess-primary-prompt "\\)\\'") string)))) - (process-put proc 'busy-end? (and (not busy) - (process-get proc 'busy))) - (when (not busy) + (let ((ready (string-match-p (concat "\\(" inferior-ess-primary-prompt "\\)\\'") string))) + (process-put proc 'busy-end? (and ready (process-get proc 'busy))) + ;; When "\n" inserted from inferior-ess-available-p, delete the prompt. + (when (and ready + (process-get proc 'availability-check) + (string-match-p (concat "^" inferior-ess-primary-prompt "\\'") string)) + (process-put proc 'suppress-next-output? t)) + (process-put proc 'availability-check nil) + (when ready (process-put proc 'running-async? nil)) - (process-put proc 'busy busy) + (process-put proc 'busy (not ready)) (process-put proc 'sec-prompt (when inferior-ess-secondary-prompt (string-match (concat "\\(" inferior-ess-secondary-prompt "\\)\\'") string))) - (unless no-timestamp - (process-put proc 'last-eval (current-time))) - busy)) + ready)) (defun inferior-ess-mark-as-busy (proc) (process-put proc 'busy t) @@ -449,7 +455,7 @@ Return the 'busy state." (when suppress (process-put proc 'suppress-next-output? t)) (process-put proc 'callbacks nil) - (condition-case err + (condition-case-unless-debug err (funcall cb proc string) (error (message "%s" (error-message-string err)))))))) @@ -479,7 +485,7 @@ Return the 'busy state." Ring Emacs bell if process output starts with an ASCII bell, and pass the rest to `comint-output-filter'. Taken from octave-mod.el." - (inferior-ess-set-status proc string) + (inferior-ess--set-status proc string) (ess--if-verbose-write-process-state proc string) (inferior-ess-run-callback proc string) (if (process-get proc 'suppress-next-output?) @@ -501,26 +507,28 @@ flash or you'll hear a beep. Taken from octave-mod.el." (defun ess-process-sentinel (proc message) "Sentinel for use with ESS processes. This marks the process with a message, at a particular time point." - (save-excursion - (let ((abuf (process-get proc :accum-buffer))) - (when (buffer-live-p abuf) - (kill-buffer abuf))) - (setq message (substring message 0 -1)) ; strip newline - (set-buffer (process-buffer proc)) - (comint-write-input-ring) - (goto-char (point-max)) - (insert-before-markers - (format "\nProcess %s %s at %s\n" - (process-name proc) message (current-time-string))))) - -(defun inferior-ess-make-comint (bufname procname infargs &rest switches) - "Make an S comint process in buffer BUFNAME with process PROCNAME." -;;; This function is a modification of make-comint from the comint.el -;;; code of Olin Shivers. + (let ((abuf (process-get proc :accum-buffer))) + (when (buffer-live-p abuf) + (kill-buffer abuf))) + (let ((pbuf (process-buffer proc))) + (when (buffer-live-p pbuf) + (with-current-buffer pbuf + (save-excursion + (setq message (substring message 0 -1)) ; strip newline + (set-buffer (process-buffer proc)) + (comint-write-input-ring) + (goto-char (point-max)) + (insert-before-markers + (format "\nProcess %s %s at %s\n" + (process-name proc) message (current-time-string)))))))) + +(defun inferior-ess-make-comint (bufname procname switches) + "Make a comint process in buffer BUFNAME with process PROCNAME. +SWITCHES is passed to `comint-exec'." (let* ((buffer (get-buffer-create bufname)) (proc (get-process procname))) - ;; If no process, or nuked process, crank up a new one and put buffer in - ;; comint mode. Otherwise, leave buffer and existing process alone. + ;; If no process, or nuked process, crank up a new one Otherwise, + ;; leave buffer and existing process alone. (cond ((or (not proc) (not (memq (process-status proc) '(run stop)))) (with-current-buffer buffer (if (eq (buffer-size) 0) nil @@ -537,20 +545,12 @@ This marks the process with a message, at a particular time point." (copy-sequence tramp-remote-process-environment)) (list "STATATERM=emacs" (format "PAGER=%s" inferior-ess-pager))))) - (ess-write-to-dribble-buffer "Making Process...") - (ess-write-to-dribble-buffer - (format "Buf %s, :Proc %s, :Prog %s\n :Args= %s\nStart File=%s\n" - buffer - procname - inferior-ess-program - infargs - inferior-ess-start-file)) (comint-exec buffer procname inferior-ess-program - inferior-ess-start-file + nil (ess-line-to-list-of-words - infargs))))) + switches))))) buffer)) @@ -597,9 +597,8 @@ the language dialect (e.g. \"R\")." (defmacro with-ess-process-buffer (no-error &rest body) "Execute BODY in the process buffer of `ess-current-process-name'. If NO-ERROR is t don't trigger error when there is not current -process. - -Symbol *proc* is bound to the current process during the evaluation of BODY." +process. Symbol *proc* is bound to the current process during the +evaluation of BODY." (declare (indent 1) (debug t)) `(let ((*proc* (and ess-local-process-name (get-process ess-local-process-name)))) (if *proc* @@ -635,41 +634,41 @@ running (anymore), try to connect to another if there is one. By default (USE-ANOTHER is nil), the connection to another process happens interactively (when possible)." (setq name (or name ess-local-process-name)) - (if (null name) ; should almost never happen at this point - (error "No ESS process is associated with this buffer now")) - (update-ess-process-name-list) - (if (assoc name ess-process-name-list) - (get-process name) - ;; else : - ;; was (error "Process %s is not running" name) - (ess-write-to-dribble-buffer - (format "ess-get-process: process '%s' not running" name)) - (if (= 0 (length ess-process-name-list)) - (save-current-buffer - (ess-write-to-dribble-buffer - (format " .. restart proc %s for language %s (buf %s)\n" - name ess-language (current-buffer))) - (message "trying to (re)start process %s for language %s ..." - name ess-language) - (ess-start-process-specific ess-language ess-dialect) - ;; and return the process: "call me again" - (ess-get-process name)) - - ;; else: there are other running processes - (if use-another ; connect to another running process : the first one - (let ((other-name (car (elt ess-process-name-list 0)))) - ;; "FIXME": try to find the process name that matches *closest* - (message "associating with *other* process '%s'" other-name) - (ess-get-process other-name)) - ;; else - (ding) - (if (y-or-n-p - (format "Process %s is not running, but others are. Switch? " name)) - (progn - (ess-force-buffer-current - (concat ess-dialect " process to use: ") 'force) - (ess-get-process ess-current-process-name)) - (error "Process %s is not running" name)))))) + (if (null name) + (error "No ESS process is associated with this buffer now") + (update-ess-process-name-list) + (if (assoc name ess-process-name-list) + (get-process name) + ;; else : + ;; was (error "Process %s is not running" name) + (ess-write-to-dribble-buffer + (format "ess-get-process: process '%s' not running" name)) + (if (= 0 (length ess-process-name-list)) + (save-current-buffer + (ess-write-to-dribble-buffer + (format " .. restart proc %s for language %s (buf %s)\n" + name ess-language (current-buffer))) + (message "trying to (re)start process %s for language %s ..." + name ess-language) + (ess-start-process-specific ess-language ess-dialect) + ;; and return the process: "call me again" + (ess-get-process name)) + + ;; else: there are other running processes + (if use-another ; connect to another running process : the first one + (let ((other-name (car (elt ess-process-name-list 0)))) + ;; "FIXME": try to find the process name that matches *closest* + (message "associating with *other* process '%s'" other-name) + (ess-get-process other-name)) + ;; else + (ding) + (if (y-or-n-p + (format "Process %s is not running, but others are. Switch? " name)) + (progn + (ess-force-buffer-current + (concat ess-dialect " process to use: ") 'force) + (ess-get-process ess-current-process-name)) + (error "Process %s is not running" name))))))) (defun inferior-ess-default-directory () (ess-get-process-variable 'default-directory)) @@ -707,28 +706,28 @@ Returns the name of the process, or nil if the current buffer has none." (with-current-buffer (process-buffer (ess-get-process ess-local-process-name)) (set var val))) -(defun ess-process-live-p () +(defun ess-process-live-p (&optional proc) "Check if the local ess process is alive. Return nil if current buffer has no associated process, or -process was killed." - (and ess-local-process-name - (let ((proc (get-process ess-local-process-name))) +process was killed. PROC defaults to `ess-local-process-name'" + (and (or proc ess-local-process-name) + (let ((proc (or proc (get-process ess-local-process-name)))) (and (processp proc) (process-live-p proc))))) -(defun ess-process-get (propname) - "Return the variable PROPNAME (symbol) from the plist of the current ESS process." - (process-get (get-process ess-local-process-name) propname)) +(defun ess-process-get (propname &optional proc) + "Return the variable PROPNAME (symbol) from the plist of the current ESS process. +PROC defaults to process with name `ess-local-process-name'." + (process-get (or proc (get-process ess-local-process-name)) propname)) -(defun ess-process-put (propname value) - "Set the variable PROPNAME (symbol) to VALUE in the plist of the current ESS process." - (process-put (get-process ess-local-process-name) propname value)) +(defun ess-process-put (propname value &optional proc) + "Set the variable PROPNAME (symbol) to VALUE in the plist of the current ESS process. +PROC defaults to the process given by `ess-local-process-name'" + (process-put (or proc (get-process ess-local-process-name)) propname value)) (defun ess-start-process-specific (language dialect) "Start an ESS process. Typically from a language-specific buffer, using LANGUAGE (and DIALECT)." - (unless dialect - (error "The value of `dialect' is nil")) (save-current-buffer (let ((dsymb (intern dialect))) (ess-write-to-dribble-buffer @@ -748,9 +747,7 @@ Typically from a language-specific buffer, using LANGUAGE (and DIALECT)." ;; ess-force-buffer-current("Process to load into: ") ;; \--> ess-request-a-process("Process to load into: " no-switch) (error "No ESS processes running; not yet implemented to start (%s,%s)" - language dialect))) - ;; save excursion is not working here !!! bad bad bad !! - ))) + language dialect)))))) (defun ess-request-a-process (message &optional noswitch ask-if-1) "Ask for a process, and make it the current ESS process. @@ -785,7 +782,6 @@ Returns the name of the selected process." (when (assoc ess-local-process-name ess-process-name-list) (list ess-local-process-name))))) (num-processes (length pname-list)) - (inferior-ess-same-window nil) ;; this should produce the inferior process in other window (auto-started?)) (if (or (= 0 num-processes) (and (= 1 num-processes) @@ -833,8 +829,8 @@ Returns the name of the selected process." )) ))) (if noswitch - (pop-to-buffer (current-buffer)) ;; VS: this is weired, but is necessary - (pop-to-buffer (buffer-name (process-buffer (get-process proc))) t)) + (pop-to-buffer (current-buffer)) ;; VS: this is weird, but is necessary + (pop-to-buffer (buffer-name (process-buffer (get-process proc))))) proc))) (defun ess-force-buffer-current (&optional prompt force no-autostart ask-if-1) @@ -857,12 +853,8 @@ there is only one process running." (if (and ess-local-process-name (not force) no-autostart) (error "Process %s has died" ess-local-process-name) ;; ess-local-process-name is nil -- which process to attach to - (let ((proc (ess-request-a-process prompt 'no-switch ask-if-1)) - temp-ess-help-filetype dialect) - (with-current-buffer (process-buffer (get-process proc)) - (setq temp-ess-help-filetype inferior-ess-help-filetype)) - (setq ess-local-process-name proc) - (setq inferior-ess-help-filetype temp-ess-help-filetype)))))) + (let ((proc (ess-request-a-process prompt 'no-switch ask-if-1))) + (setq ess-local-process-name proc)))))) (defalias 'inferior-ess-force #'ess-force-buffer-current) @@ -888,7 +880,7 @@ no such process has been found." (equal dialect (buffer-local-value 'ess-dialect (process-buffer proc))) (or ignore-busy - (not (process-get proc 'busy)))) + (inferior-ess-available-p proc))) (throw 'found proc)))))))) @@ -896,20 +888,12 @@ no such process has been found." (defun ess-switch-to-ESS (eob-p) "Switch to the current inferior ESS process buffer. -With (prefix) EOB-P non-nil, positions cursor at end of buffer. -This function should follow the description in `ess-show-buffer' -for showing the iESS buffer, except that the iESS buffer is also -made current." +With (prefix) EOB-P non-nil, positions cursor at end of buffer." (interactive "P") (ess-force-buffer-current) - (if (and ess-current-process-name (get-process ess-current-process-name)) - (progn - (ess-show-buffer - (buffer-name (process-buffer (get-process ess-current-process-name))) - t) - (if eob-p (goto-char (point-max)))) - (message "No inferior ESS process") - (ding))) + (pop-to-buffer (buffer-name (process-buffer (get-process ess-current-process-name))) + '(nil . ((inhibit-same-window . t)))) + (when eob-p (goto-char (point-max)))) (defun ess-switch-to-ESS-deprecated (eob-p) (interactive "P") @@ -936,8 +920,8 @@ toggled." (not ess-switch-to-end-of-proc-buffer) ess-switch-to-end-of-proc-buffer))) (define-key map (vector last-command-event) - (lambda (ev eob) (interactive) - (if (not (eq major-mode 'inferior-ess-mode)) + (lambda (_ev eob) (interactive) + (if (not (derived-mode-p 'inferior-ess-mode)) (ess-switch-to-ESS eob) (let ((dialect ess-dialect) (loc-proc-name ess-local-process-name) @@ -945,16 +929,15 @@ toggled." (while (and blist (with-current-buffer (car blist) (not (or (and - (memq major-mode '(ess-mode ess-julia-mode)) + (ess-derived-mode-p) (equal dialect ess-dialect) (null ess-local-process-name)) (and - (memq major-mode '(ess-mode ess-julia-mode)) - (equal loc-proc-name ess-local-process-name)) - )))) + (ess-derived-mode-p) + (equal loc-proc-name ess-local-process-name)))))) (pop blist)) (if blist - (ess-show-buffer (car blist) t) + (pop-to-buffer (car blist)) (message "Found no buffers for ess-dialect %s associated with process %s" dialect loc-proc-name)))))) (ess--execute-electric-command map nil nil nil EOB))) @@ -976,108 +959,32 @@ toggled." (if (eq (length ess-process-name-list) 0) (setq ess-current-process-name nil))) -(defcustom ess-show-buffer-action - '((display-buffer-pop-up-window display-buffer-use-some-window)) - "Actions for `ess-show-buffer', passed to `display-buffer'." - :group 'ess - :type '(list (repeat function))) - -(defun ess-show-buffer (buf &optional visit) - "Ensure the ESS buffer BUF is visible. -The buffer, specified as a string, is typically an iESS (e.g. -*R*) buffer. This handles several cases: - -1. If BUF is visible in the current frame, nothing is done. -2. If BUF is visible in another frame, then we ensure that frame is -visible (it may have been iconified). -3. If buffer is not visible in any frame, simply show it in another window -in the current frame. - -If VISIT is non-nil, as well as making BUF visible, we also select it -as the current buffer." - (let ((frame)) - (if (ess-buffer-visible-this-frame buf) - ;;1. Nothing to do, BUF visible in this frame; just return window - ;; where this buffer is. - t - ;; 2. Maybe BUF visible in another frame. - (setq frame (ess-buffer-visible-other-frame buf)) - (if frame - ;; BUF is visible in frame, so just check frame is raised. - (if (not (eq (frame-visible-p frame) t)) - ;; frame is not yet visible, so raise it. - (raise-frame frame)) - ;; 3. else BUF not visible in any frame, so show it (but do - ;; not select it) in another window in current frame. - (display-buffer buf ess-show-buffer-action))) - ;; At this stage, the buffer should now be visible on screen, - ;; although it won't have been made current. - (when visit - ;; Need to select the buffer. - ;; - ;; First of all, check case 2 if buffer is in another frame - ;; but that frame may not be selected. - (if frame - (ess-select-frame-set-input-focus frame)) - (select-window (get-buffer-window buf 0))))) - -(defvar ess-bufs-in-frame nil) ;silence the compiler. -;; The next few functions are copied from my (SJE) iswitchb library. -(defun ess-get-bufname (win) - "Used by `ess-get-buffers-in-frames' to walk through all windows." - (let ((buf (buffer-name (window-buffer win)))) - (if (not (member buf ess-bufs-in-frame)) - ;; Only add buf if it is not already in list. - ;; This prevents same buf in two different windows being - ;; put into the list twice. - (setq ess-bufs-in-frame - (cons buf ess-bufs-in-frame))))) - -(defun ess-get-buffers-in-frames (&optional current) - "Return the list of buffers that are visible in the current frame. -If optional argument CURRENT is given, restrict searching to the -current frame, rather than all frames." - (let ((ess-bufs-in-frame nil)) - (walk-windows 'ess-get-bufname nil (if current nil 0)) - ess-bufs-in-frame)) - -(defun ess-buffer-visible-this-frame (buf) - "Return t if BUF is visible in current frame." - (member buf (ess-get-buffers-in-frames t))) - -(defun ess-buffer-visible-other-frame (buf) - "Return t if BUF is visible in another frame. -Assumes that buffer has not already been in found in current frame." - (if (member (buffer-name (get-buffer buf)) (ess-get-buffers-in-frames)) - (window-frame (get-buffer-window buf 0)) - nil)) - - ;;; Functions for evaluating code ;;*;; Utils for evaluation -(ess-defgeneric ess-build-eval-command (string &optional visibly output file &rest args) +(defun ess-build-eval-command (string &optional visibly output file &rest args) "Format an evaluation command. -Wrap STRING with `ess-quote-special-chars' and dispatch on the -dialect-specific `ess-build-eval-command' function and -`ess-eval-command', in that order. If none of the above is -defined, return nil." +Wrap STRING with `ess-quote-special-chars' and dispatch on +`ess-build-eval-command--override'." (setq string (ess-quote-special-chars string)) - (:override - (and ess-eval-command - (format-spec ess-eval-command - `((?s . ,string) - (?f . ,file)))))) + (ess-build-eval-command--override string visibly output file args)) + +(cl-defgeneric ess-build-eval-command--override + (string &optional _visibly _output file &rest _args) + "Default method to build eval command." + (and ess-eval-command + (format-spec ess-eval-command + `((?s . ,string) + (?f . ,file))))) -(ess-defgeneric ess-build-load-command (file &optional visibly output &rest args) +(cl-defgeneric ess-build-load-command (file &optional _visibly _output &rest _args) "Format a loading command. Dispatches on the dialect-specific `ess-build-load-command' and `ess-load-command', in that order." - (:override - (and ess-load-command - (format ess-load-command file)))) + (and ess-load-command + (format ess-load-command file))) (defun ess-wait-for-process (&optional proc sec-prompt wait force-redisplay timeout) "Wait for 'busy property of the process to become nil. @@ -1111,11 +1018,10 @@ non-nil stop waiting for output after TIMEOUT seconds." (setq wait .3)))))) (defun inferior-ess-ordinary-filter (proc string) - (inferior-ess-set-status proc string t) + (inferior-ess--set-status proc string) (ess--if-verbose-write-process-state proc string "ordinary-filter") (inferior-ess-run-callback proc string) (with-current-buffer (process-buffer proc) - ;; (princ (format "%s:" string)) (insert string))) (defvar ess-presend-filter-functions nil @@ -1205,7 +1111,7 @@ Hide all the junk output in temporary buffer." ;;*;; Evaluation primitives -(ess-defgeneric ess-send-string (process string &optional visibly message type) +(defun ess-send-string (process string &optional visibly message _type) "ESS wrapper for `process-send-string'. Run `comint-input-filter-functions' and current buffer's and PROCESS' `ess-presend-filter-functions' hooks on the input @@ -1214,7 +1120,8 @@ the behavior is as with 'nowait with the differences that inserted string is VISIBLY instead of STRING (evaluated command is still STRING). In all other cases the behavior is as described in `ess-eval-visibly'. STRING need not end with -\\n. TYPE is a symbol indicating type of the string." +\\n. TYPE is a symbol indicating type of the string. +MESSAGE is a message to display." ;; No support of `visibly' when there's no secondary prompt (let ((visibly (if (and (eq visibly t) (null inferior-ess-secondary-prompt)) @@ -1223,31 +1130,31 @@ described in `ess-eval-visibly'. STRING need not end with (string (ess--run-presend-hooks process string))) (inferior-ess--interrupt-subjob-maybe process) (inferior-ess-mark-as-busy process) - (:override - (cond - ;; Wait after each line - ((eq visibly t) - (let ((ess--inhibit-presend-hooks t)) - (ess-eval-linewise string))) - ;; Insert command and eval invisibly - ((or (stringp visibly) - (eq visibly 'nowait)) - (with-current-buffer (process-buffer process) - (save-excursion - (goto-char (process-mark process)) - (insert-before-markers - (propertize (format "%s\n" - (replace-regexp-in-string - "\n" "\n+ " - (if (stringp visibly) visibly string))) - 'font-lock-face 'comint-highlight-input))) - (process-send-string process (ess--concat-new-line-maybe string)))) - (t - (process-send-string process (ess--concat-new-line-maybe string)))) - (when message - (message "%s" message))))) - -(ess-defgeneric ess-send-region (process start end &optional visibly message type) + (process-put process 'last-eval (current-time)) + (cond + ;; Wait after each line + ((eq visibly t) + (let ((ess--inhibit-presend-hooks t)) + (ess-eval-linewise string))) + ;; Insert command and eval invisibly + ((or (stringp visibly) + (eq visibly 'nowait)) + (with-current-buffer (process-buffer process) + (save-excursion + (goto-char (process-mark process)) + (insert-before-markers + (propertize (format "%s\n" + (replace-regexp-in-string + "\n" "\n+ " + (if (stringp visibly) visibly string))) + 'font-lock-face 'comint-highlight-input))) + (process-send-string process (ess--concat-new-line-maybe string)))) + (t + (process-send-string process (ess--concat-new-line-maybe string)))) + (when message + (message "%s" message)))) + +(defun ess-send-region (process start end &optional visibly message type) "Low level ESS version of `process-send-region'. If VISIBLY call `ess-eval-linewise', else call `ess-send-string'. If MESSAGE is supplied, display it at the @@ -1256,9 +1163,11 @@ end. Run current buffer's and PROCESS' type of the region." (cond ((ess-tracebug-p) - (ess-tracebug-send-region proc start end visibly message type)) - (t (:override - (ess-send-string process (buffer-substring start end) visibly message type))))) + (ess-tracebug-send-region process start end visibly message type)) + (t (ess-send-region--override process start end visibly message type)))) + +(cl-defgeneric ess-send-region--override (process start end visibly message type) + (ess-send-string process (buffer-substring start end) visibly message type)) ;;*;; Evaluation commands @@ -1286,10 +1195,10 @@ type of the region." (ess-force-buffer-current "Process to load into: ")))) ;;;###autoload -(ess-defgeneric ess-load-file (&optional filename) - "Load a source file into an inferior ESS process. +(defun ess-load-file (&optional filename) + "Load FILENAME into an inferior ESS process. This handles Tramp when working on a remote." - (interactive (list (or (and (memq major-mode '(ess-mode ess-julia-mode)) + (interactive (list (or (and (ess-derived-mode-p) (buffer-file-name)) (expand-file-name (read-file-name "Load source file: " nil nil t))))) @@ -1297,10 +1206,12 @@ This handles Tramp when working on a remote." ;; Pop up an inferior window (save-selected-window (ess-switch-to-ESS t)) - (:override - (let ((file (ess-load-file--normalise-file filename))) - (let ((command (ess-build-load-command file nil t))) - (ess-send-string (ess-get-process) command t))))) + (ess-load-file--override filename)) + +(cl-defgeneric ess-load-file--override (filename) + (let ((file (ess-load-file--normalise-file filename))) + (let ((command (ess-build-load-command file nil t))) + (ess-send-string (ess-get-process) command t)))) ;; C-c C-l *used to* eval code: (defun ess-msg-and-comint-dynamic-list-input-ring () @@ -1317,26 +1228,22 @@ This handles Tramp when working on a remote." ;; (lambda (proc) (message "done"))) ;; (process-get (get-process "R") 'running-async?) -(defun ess-command--normalise-proc (proc no-prompt-check) - (let ((proc (cond - (proc - ;; This lets external functions call this command - (unless ess-local-process-name - (setq ess-local-process-name (process-name proc))) - proc) - (t - (ess-get-process ess-local-process-name))))) - (unless no-prompt-check - (when (process-get proc 'busy) - (user-error "ESS process not ready. Finish your command before trying again"))) - proc)) - -(ess-defgeneric ess-command (cmd &optional out-buffer sleep no-prompt-check wait proc force-redisplay) - "Send the ESS process command CMD and delete the output from -the ESS process buffer. If an optional second argument -OUT-BUFFER exists save the output in that buffer. OUT-BUFFER is -erased before use. CMD should have a terminating newline. -Guarantees that the value of `.Last.value' will be preserved. +(defun ess-command--get-proc (proc no-prompt-check) + (if proc + (unless ess-local-process-name + (setq ess-local-process-name (process-name proc))) + (setq proc (ess-get-process ess-local-process-name))) + (unless no-prompt-check + (when (process-get proc 'busy) + (user-error "ESS process not ready. Finish your command before trying again"))) + proc) + +(defun ess-command (cmd &optional out-buffer _sleep no-prompt-check wait proc force-redisplay) + "Send the ESS process CMD and delete the output from the ESS process buffer. +If an optional second argument OUT-BUFFER exists save the output +in that buffer. OUT-BUFFER is erased before use. CMD should have +a terminating newline. Guarantees that the value of `.Last.value' +will be preserved. SLEEP is deprecated and no longer has any effect. WAIT and FORCE-REDISPLAY are as in `ess-wait-for-process' and are passed @@ -1354,44 +1261,43 @@ wrapping the code into: on.exit(options(olderr)) ... })" - (:override - (let ((out-buffer (or out-buffer (get-buffer-create " *ess-command-output*"))) - (proc (ess-command--normalise-proc proc no-prompt-check))) - (with-current-buffer (process-buffer proc) - (let ((primary-prompt inferior-ess-primary-prompt) - (oldpb (process-buffer proc)) - (oldpf (process-filter proc)) - (oldpm (marker-position (process-mark proc)))) - (ess-if-verbose-write (format "(ess-command %s ..)" cmd)) - ;; Swap the process buffer with the output buffer before - ;; sending the command - (unwind-protect - (progn - (set-process-buffer proc out-buffer) - (set-process-filter proc 'inferior-ess-ordinary-filter) - (with-current-buffer out-buffer - (setq inferior-ess-primary-prompt primary-prompt) - (setq buffer-read-only nil) - (erase-buffer) - (set-marker (process-mark proc) (point-min)) - (inferior-ess-mark-as-busy proc) - (process-send-string proc cmd) - ;; Need time for ess-create-object-name-db on PC - (if no-prompt-check - (sleep-for 0.02) ; 0.1 is noticeable! - (ess-wait-for-process proc nil wait force-redisplay) - (ess-mpi-handle-messages (current-buffer)) - ;; Remove prompt - ;; If output is cat(..)ed this deletes the output - (goto-char (point-max)) - (delete-region (point-at-bol) (point-max))) - (ess-if-verbose-write " .. ok{ess-command}"))) - (ess-if-verbose-write " .. exiting{ess-command}\n") - ;; Restore the process buffer in its previous state - (set-process-buffer proc oldpb) - (set-process-filter proc oldpf) - (set-marker (process-mark proc) oldpm)))) - out-buffer))) + (let ((out-buffer (or out-buffer (get-buffer-create " *ess-command-output*"))) + (proc (ess-command--get-proc proc no-prompt-check))) + (with-current-buffer (process-buffer proc) + (let ((primary-prompt inferior-ess-primary-prompt) + (oldpb (process-buffer proc)) + (oldpf (process-filter proc)) + (oldpm (marker-position (process-mark proc)))) + (ess-if-verbose-write (format "(ess-command %s ..)" cmd)) + ;; Swap the process buffer with the output buffer before + ;; sending the command + (unwind-protect + (progn + (set-process-buffer proc out-buffer) + (set-process-filter proc 'inferior-ess-ordinary-filter) + (with-current-buffer out-buffer + (setq inferior-ess-primary-prompt primary-prompt) + (setq buffer-read-only nil) + (erase-buffer) + (set-marker (process-mark proc) (point-min)) + (inferior-ess-mark-as-busy proc) + (process-send-string proc cmd) + ;; Need time for ess-create-object-name-db on PC + (if no-prompt-check + (sleep-for 0.02) ; 0.1 is noticeable! + (ess-wait-for-process proc nil wait force-redisplay) + (ess-mpi-handle-messages (current-buffer)) + ;; Remove prompt + ;; If output is cat(..)ed this deletes the output + (goto-char (point-max)) + (delete-region (point-at-bol) (point-max))) + (ess-if-verbose-write " .. ok{ess-command}"))) + (ess-if-verbose-write " .. exiting{ess-command}\n") + ;; Restore the process buffer in its previous state + (set-process-buffer proc oldpb) + (set-process-filter proc oldpf) + (set-marker (process-mark proc) oldpm)))) + out-buffer)) (defun ess-boolean-command (com &optional buf wait) "Like `ess-command' but expects COM to print TRUE or FALSE. @@ -1408,16 +1314,7 @@ Example (ess-boolean-command \"2>1\n\")" (ess-kill-last-line) (buffer-substring (point-min) (point-max)))) -;; (ess-async-command "{cat(1:5);Sys.sleep(5);cat(2:6)}\n" nil (get-process "R") -;; (lambda (proc) (message "done"))) -;; (ess-async-command "{cat(1:5);Sys.sleep(5);cat(2:6)}\n" nil (get-process "R") -;; (lambda (proc) (message "done")) -;; t) -;; (ess-async-command "{cat(1:5);Sys.sleep(5);cat(2:6)}\n" nil (get-process "R") -;; (lambda (proc) (message "done")) -;; (lambda (proc2) (message "name: %s" (process-name proc2)))) - -(defun ess-async-command (com &optional buf proc callback interrupt-callback ) +(defun ess-async-command (com &optional buf proc callback interrupt-callback) "Asynchronous version of `ess-command'. COM, BUF, WAIT and PROC are as in `ess-command'. @@ -1431,20 +1328,20 @@ NOTE: Currently this function should be used only for background jobs like caching. ESS tries to suppress any output from the asynchronous command, but long output of COM will most likely end up in user's main buffer." - (let ((proc (or proc (get-process ess-local-process-name)))) - (if (not (and proc - (eq (process-status proc) 'run))) - (error "Process %s is dead" ess-local-process-name) - (if (or (process-get proc 'busy) - (process-get proc 'running-async?)) - (error "Process %s is busy or already running an async command" ess-local-process-name) - (when (eq interrupt-callback t) - (setq interrupt-callback (lambda (proc)))) - (process-put proc 'callbacks (list (cons callback 'suppress-output) - interrupt-callback)) - (process-put proc 'interruptable? (and interrupt-callback t)) - (process-put proc 'running-async? t) - (ess-command com buf nil 'no-prompt-check .01 proc))))) + (setq proc (or proc (get-process ess-local-process-name))) + (cond ((not (and proc (eq (process-status proc) 'run))) + (error "Process %s is dead" proc)) + ((process-get proc 'busy) + (error "Process %s is busy" proc)) + ((process-get proc 'running-async?) + (error "Process %s is already running an async command" proc))) + (when (eq interrupt-callback t) + (setq interrupt-callback (lambda (_proc)))) + (process-put proc 'callbacks (list (cons callback 'suppress-output) + interrupt-callback)) + (process-put proc 'interruptable? (and interrupt-callback t)) + (process-put proc 'running-async? t) + (ess-command com buf nil 'no-prompt-check .01 proc)) (defun ess-async-command-delayed (com &optional buf proc callback delay) "Delayed asynchronous ess-command. @@ -1459,8 +1356,7 @@ leading to unpredictable consequences. This function is a wrapper of `ess-async-command' with an explicit interrupt-callback." (unless proc (error "You must provide PROC argument to ess-async-command-delayed")) - (let* ((timer (make-symbol "timer")) - (delay (or delay + (let* ((delay (or delay (+ ess-idle-timer-interval 3))) (int-cb `(lambda (proc) (ess-async-command-delayed ,com ,buf proc ,callback ,delay))) @@ -1474,11 +1370,32 @@ of `ess-async-command' with an explicit interrupt-callback." (ess-async-command ,com ,buf ,proc ,callback ',int-cb))))) (run-with-idle-timer delay nil com-fun))) +(defun ess-load-library () + "Prompt and load dialect specific library/package/module. +Note that add-ons in R are called 'packages' and the name of this +function has nothing to do with R package mechanism, but it +rather serves a generic, dialect independent purpose. It is also +similar to `load-library' Emacs function." + (interactive) + (let ((ess-eval-visibly-p t) + (packs (ess-installed-packages)) + pack) + (setq pack (ess-completing-read "Load" packs)) + (ess-load-library--override pack) + (ess--mark-search-list-as-changed) + (display-buffer (buffer-name (process-buffer (get-process ess-current-process-name)))))) + +(cl-defgeneric ess-installed-packages () + "Return a list of installed packages.") + +(cl-defgeneric ess-load-library--override (pack) + "Load library/package PACK.") + ;;*;; Evaluating lines, paragraphs, regions, and buffers. -(ess-defgeneric ess-eval-linewise - (text &optional invisibly eob even-empty wait-last-prompt sleep-sec wait-sec) +(defun ess-eval-linewise + (text &optional invisibly eob even-empty wait-last-prompt sleep-sec wait-sec) "Evaluate TEXT in the ESS process buffer as if typed in w/o tabs. Waits for prompt after each line of input, so won't break on large texts. @@ -1499,73 +1416,69 @@ TEXT." (unless (numberp wait-sec) (setq wait-sec 0.001)) (ess-force-buffer-current "Process to use: ") - (:override - ;; Use this to evaluate some code, but don't wait for output. - (let* ((deactivate-mark) ; keep local {do *not* deactivate wrongly} - (cbuffer (current-buffer)) - (sprocess (ess-get-process ess-current-process-name)) - (sbuffer (process-buffer sprocess)) - (win (get-buffer-window sbuffer t))) - (setq text (ess--concat-new-line-maybe - (ess--run-presend-hooks sprocess text))) - (with-current-buffer sbuffer - (setq text (propertize text 'field 'input 'front-sticky t)) - (goto-char (marker-position (process-mark sprocess))) - (if (stringp invisibly) - (insert-before-markers (concat "*** " invisibly " ***\n"))) - ;; dbg: - ;; dbg (ess-write-to-dribble-buffer - ;; dbg (format "(eval-visibly 2): text[%d]= '%s'\n" (length text) text)) - (while (or (> (length text) 0) even-empty) - (setq even-empty nil) - (let* ((pos (string-match "\n\\|$" text)) - (input (if (= (length text) 0) - "\n" - (concat (substring text 0 pos) "\n")))) - (setq text (substring text (min (length text) (1+ pos)))) - (goto-char (marker-position (process-mark sprocess))) - (if win (set-window-point win (process-mark sprocess))) - (unless invisibly - ;; for consistency with comint :( - (insert (propertize input 'font-lock-face 'comint-highlight-input)) - (set-marker (process-mark sprocess) (point))) - (inferior-ess-mark-as-busy sprocess) - (process-send-string sprocess input)) - (when (or (> (length text) 0) - wait-last-prompt) - (ess-wait-for-process sprocess t wait-sec))) - (if eob (ess-show-buffer (buffer-name sbuffer) nil)) - (goto-char (marker-position (process-mark sprocess))) - (when win - (with-selected-window win - (goto-char (point)) - ;; this is crucial to avoid reseting window-point - (recenter (- -1 scroll-margin))))))) + ;; Use this to evaluate some code, but don't wait for output. + (let* ((deactivate-mark) ; keep local {do *not* deactivate wrongly} + (sprocess (ess-get-process ess-current-process-name)) + (sbuffer (process-buffer sprocess)) + (win (get-buffer-window sbuffer t))) + (setq text (ess--concat-new-line-maybe + (ess--run-presend-hooks sprocess text))) + (with-current-buffer sbuffer + (setq text (propertize text 'field 'input 'front-sticky t)) + (goto-char (marker-position (process-mark sprocess))) + (if (stringp invisibly) + (insert-before-markers (concat "*** " invisibly " ***\n"))) + ;; dbg: + ;; dbg (ess-write-to-dribble-buffer + ;; dbg (format "(eval-visibly 2): text[%d]= '%s'\n" (length text) text)) + (while (or (> (length text) 0) even-empty) + (setq even-empty nil) + (let* ((pos (string-match "\n\\|$" text)) + (input (if (= (length text) 0) + "\n" + (concat (substring text 0 pos) "\n")))) + (setq text (substring text (min (length text) (1+ pos)))) + (goto-char (marker-position (process-mark sprocess))) + (if win (set-window-point win (process-mark sprocess))) + (unless invisibly + ;; for consistency with comint :( + (insert (propertize input 'font-lock-face 'comint-highlight-input)) + (set-marker (process-mark sprocess) (point))) + (inferior-ess-mark-as-busy sprocess) + (process-send-string sprocess input)) + (when (or (> (length text) 0) + wait-last-prompt) + (ess-wait-for-process sprocess t wait-sec))) + (if eob (with-temp-buffer (buffer-name sbuffer))) + (goto-char (marker-position (process-mark sprocess))) + (when win + (with-selected-window win + (goto-char (point)) + ;; this is crucial to avoid reseting window-point + (recenter (- -1 scroll-margin)))))) (if (numberp sleep-sec) (sleep-for sleep-sec))) ;;;*;;; Evaluate only -(defun ess-eval-region--normalise-region () - "Clean the region for evaluation. +(defun ess-eval-region--normalise-region (start end) + "Clean the region from START to END for evaluation. This trims newlines at beginning and end of the region because they might throw off the debugger." (save-excursion (goto-char start) (skip-chars-forward "\n\t ") (setq start (point)) - (unless mark-active (ess-blink-region start end)) - (goto-char end) (skip-chars-backward "\n\t ") (setq end (point)))) -(defun ess-eval-region (start end toggle &optional message type) +(defun ess-eval-region (start end vis &optional message type) "Send the region from START to END to the inferior ESS process. -TOGGLE switches the meaning of `ess-eval-visibly'. If given, +VIS switches the meaning of `ess-eval-visibly'. If given, MESSAGE is `message'ed. TYPE is a symbol indicating what type of region this is. If command `rectangle-mark-mode' is active, send the lines of the rectangle separately to the inferior process." @@ -1585,15 +1498,15 @@ the lines of the rectangle separately to the inferior process." ;; rectangle. Send them separately. (let ((reclines (extract-rectangle-bounds (min (mark) (point)) (max (mark) (point))))) (mapc (lambda (l) - (ess--eval-region (car l) (cdr l) toggle message type)) + (ess--eval-region (car l) (cdr l) vis message type)) reclines)) - (ess--eval-region start end toggle message type))) + (ess--eval-region start end vis message type))) -(defun ess--eval-region (start end toggle &optional message type) +(defun ess--eval-region (start end vis &optional message type) "Helper function for `ess-eval-region', which see. -START, END, TOGGLE, MESSAGE, and TYPE described there." - (ess-eval-region--normalise-region) - (let ((visibly (if toggle (not ess-eval-visibly) ess-eval-visibly)) +START, END, VIS, MESSAGE, and TYPE described there." + (ess-eval-region--normalise-region start end) + (let ((visibly (if vis (not ess-eval-visibly) ess-eval-visibly)) (message (or message "Eval region")) (proc (ess-get-process))) (save-excursion @@ -1602,112 +1515,92 @@ START, END, TOGGLE, MESSAGE, and TYPE described there." (ess-deactivate-mark)) (list start end)) -(defun ess-eval-buffer (vis) +(defun ess-eval-buffer (&optional vis) "Send the current buffer to the inferior ESS process. VIS has same meaning as for `ess-eval-region'." (interactive "P") (ess-eval-region (point-min) (point-max) vis "Eval buffer" 'buffer)) -(defun ess-eval-buffer-from-beg-to-here (vis) +(defun ess-eval-buffer-from-beg-to-here (&optional vis) "Send region from beginning to point to the inferior ESS process. VIS has same meaning as for `ess-eval-region'." (interactive "P") (ess-eval-region (point-min) (point) vis "Eval buffer till point")) -(defun ess-eval-buffer-from-here-to-end (vis) +(defun ess-eval-buffer-from-here-to-end (&optional vis) "Send region from point to end of buffer to the inferior ESS process. VIS has same meaning as for `ess-eval-region'." (interactive "P") (ess-eval-region (point) (point-max) vis "Eval buffer till end")) -(defun ess-eval-function (vis &optional no-error) +(defun ess-eval-function (&optional vis) "Send the current function to the inferior ESS process. -Prefix argument VIS toggles the meaning of `ess-eval-visibly'. If -NO-ERROR is non-nil and the function was successfully evaluated, -return '(beg end) representing the beginning and end of the -current function, otherwise (in case of an error) return nil." +Prefix arg VIS toggles visibility of ess-code as for +`ess-eval-region'. Returns nil if not inside a function." (interactive "P") - (ess-force-buffer-current "Process to use: ") (save-excursion (ignore-errors ;; Evaluation is forward oriented (forward-line -1) (ess-next-code-line 1)) - (let ((beg-end (ess-end-of-function nil no-error))) - (when beg-end - (let* ((beg (nth 0 beg-end)) - (end (nth 1 beg-end)) - (proc (get-process ess-local-process-name)) - ;; FIXME: func names starting with . are not recognized?? - (name (progn (goto-char beg) - (forward-word) - (ess-read-object-name-default))) - (msg (format "Eval function %s" - (propertize (or name "???") - 'face 'font-lock-function-name-face))) - (visibly (if vis (not ess-eval-visibly) ess-eval-visibly))) - (ess-blink-region beg end) - (cond - ((ess-tracebug-p) - (ess-tracebug-send-function proc beg end visibly msg)) - (t - (ess-send-region proc beg end visibly msg))) - beg-end))))) - -;; This is from Mary Lindstrom -;; 31 Aug 1995 14:11:43 To: S-mode@stat.math.ethz.ch -(defun ess-eval-paragraph (vis) + (let ((pos (point)) + beg end msg) + (end-of-defun) + (beginning-of-defun) + ;; While we are the beginning of the function, get the function + ;; name + (setq msg (format "Eval function: %s" + (propertize (if (looking-at-p add-log-current-defun-header-regexp) + (add-log-current-defun) + (buffer-substring-no-properties (point) (point-at-eol))) + 'face 'font-lock-function-name-face))) + (setq beg (point)) + (end-of-defun) + (setq end (point)) + (when (or (< pos beg) + (< end pos)) + (error "Not in a function")) + (if (ess-tracebug-p) + (ess-tracebug-send-function (get-process ess-local-process-name) beg end vis msg) + (ess-eval-region beg end vis msg))))) + +(defun ess-eval-paragraph (&optional vis) "Send the current paragraph to the inferior ESS process. Prefix arg VIS toggles visibility of ess-code as for `ess-eval-region'." (interactive "P") (save-excursion - (forward-paragraph) - ;; Skip blank code to avoid sending surrounding comments - (ess-skip-blanks-backward 'multiline) - (let ((end (point))) - (backward-paragraph) - (ess-skip-blanks-forward 'multiline) - (ess-eval-region (point) end vis "Eval paragraph")))) - -;; ;; Experimental - after suggestion from Jenny Brian for an 'eval-multiline' -;; ;; 'sentence' is too much : almost like 'paragraph' -;; ;; 'sexp' is close, but too little [when point is inside function call; -;; ;; it moves all the way to the end - which is fine] -;; (defun ess-eval-sexp (vis) -;; "Send the current sexp to the inferior ESS process. -;; Prefix arg VIS toggles visibility of ess-code as for `ess-eval-region'." -;; (interactive "P") -;; (save-excursion -;; (forward-sexp) -;; (let ((end (point))) -;; (backward-sexp) -;; (ess-eval-region (point) end vis "Eval sexp")))) - -(defun ess-eval-function-or-paragraph (vis) + (ignore-errors + ;; Evaluation is forward oriented + (forward-line -1) + (ess-next-code-line 1)) + (let ((beg (progn (backward-paragraph) (point))) + (end (progn (forward-paragraph) (point)))) + (ess-eval-region beg end vis)))) + +(defun ess-eval-function-or-paragraph (&optional vis) "Send the current function if \\[point] is inside one. Otherwise send the current paragraph to the inferior ESS process. Prefix arg VIS toggles visibility of ess-code as for -`ess-eval-region'." +`ess-eval-region'. Returns 'function if a function was evaluated +or 'paragraph if a paragraph." (interactive "P") - (let ((beg-end (ess-eval-function vis 'no-error))) - (if (null beg-end) ; not a function - (ess-eval-paragraph vis)))) - -(defun ess-eval-function-or-paragraph-and-step (vis) + (condition-case nil + (progn (ess-eval-function vis) + 'function) + ;; TODO: Maybe be smarter than just catching all errors? + (error (ess-eval-paragraph vis) + 'paragraph))) + +(defun ess-eval-function-or-paragraph-and-step (&optional vis) "Send the current function if \\[point] is inside one. Otherwise send the current paragraph to the inferior ESS process. Prefix arg VIS toggles visibility of ess-code as for `ess-eval-region'." (interactive "P") - (let ((beg-end (ignore-errors (ess-eval-function vis 'no-error)))) ;; ignore-errors is a hack, ess-eval-function gives stupid errors sometimes - (if (null beg-end) ; not a function - (ess-eval-paragraph-and-step vis) - (goto-char (cadr beg-end)) - (if ess-eval-empty - (forward-line 1) - (ess-next-code-line 1))))) - -(defun ess-eval-region-or-function-or-paragraph (vis) + (ess-skip-thing (ess-eval-function-or-paragraph vis)) + (ess-next-code-line)) + +(defun ess-eval-region-or-function-or-paragraph (&optional vis) "Send the region, function, or paragraph depending on context. Send the region if it is active. If not, send function if `point' is inside one, otherwise the current paragraph. Treats @@ -1718,7 +1611,7 @@ toggles visibility of ess-code as for `ess-eval-region'." (ess-eval-region (region-beginning) (region-end) vis) (ess-eval-function-or-paragraph vis))) -(defun ess-eval-region-or-function-or-paragraph-and-step (vis) +(defun ess-eval-region-or-function-or-paragraph-and-step (&optional vis) "Send the region, function, or paragraph depending on context. Send the region if it is active. If not, send function if `point' is inside one, otherwise the current paragraph. Treats @@ -1727,18 +1620,13 @@ step to the next code line or to the end of region if region was active. Prefix arg VIS toggles visibility of ess-code as for `ess-eval-region'." (interactive "P") - (if (use-region-p) - (let ((end (region-end))) - (ess-eval-region (region-beginning) end vis) - (goto-char end)) - (ess-eval-function-or-paragraph-and-step vis))) + (ess-skip-thing (ess-eval-region-or-function-or-paragraph vis)) + (ess-next-code-line)) (defun ess-eval-region-or-line-and-step (&optional vis) - "Evaluate region if active, otherwise the current line and step. -Prefix arg VIS toggles visibility of ess-code when evaluating the -region (as for `ess-eval-region') and has no effect for -evaluation of the line. Treats rectangular regions as -`ess-eval-region' does." + "Evaluate region if active, otherwise `ess-eval-line-and-step'. +See `ess-eval-region' for the meaning of VIS. Treats rectangular +regions as `ess-eval-region' does." (interactive "P") (if (use-region-p) (ess-eval-region (region-beginning) (region-end) vis) @@ -1753,7 +1641,7 @@ place (see `ess-r-set-evaluation-env') evaluation of multiline input will fail." (interactive) (ess-force-buffer-current) - (ess-show-buffer (ess-get-process-buffer)) + (display-buffer (ess-get-process-buffer)) (let ((ess-eval-visibly t)) (ess-eval-region-or-line-and-step))) @@ -1767,30 +1655,31 @@ VIS has same meaning as for `ess-eval-region'." (ess-eval-region beg end vis msg))) (defun ess-eval-line-and-step (&optional vis) - "Evaluate the current line and step to the \"next\" line." + "Evaluate the current line and step to the \"next\" line. +See `ess-eval-region' for VIS." (interactive "P") (ess-eval-line vis) - (ess-next-code-line 1)) + (ess-skip-thing 'line) + (ess-next-code-line)) -(defun ess-eval-line-visibly-and-step (&optional simple-next even-empty) +(defun ess-eval-line-visibly-and-step (&optional simple-next) "Evaluate the current line visibly and step to the \"next\" line. If SIMPLE-NEXT is non-nil, possibly via prefix arg, first skip -empty and commented lines. If 2nd arg EVEN-EMPTY [prefix as -well], also send empty lines. When the variable `ess-eval-empty' +empty and commented lines. When the variable `ess-eval-empty' is non-nil both SIMPLE-NEXT and EVEN-EMPTY are interpreted as true. Note that when inside a package and namespaced evaluation is in -place (see `ess-r-set-evaluation-env') evaluation of multiline -input will fail." - (interactive "P\nP"); prefix sets BOTH! +place (see `ess-r-set-evaluation-env'), the evaluation of +multiline input will fail." + (interactive "P") (ess-force-buffer-current) - (ess-show-buffer (ess-get-process-buffer)) - (let ((ess-eval-visibly t)) - (ess-eval-line)) - (if (or simple-next ess-eval-empty even-empty) - (forward-line 1) - (ess-next-code-line 1))) + (display-buffer (ess-get-process-buffer)) + (let ((ess-eval-visibly t) + (ess-eval-empty (or ess-eval-empty simple-next))) + (ess-eval-line) + (ess-skip-thing 'line) + (ess-next-code-line))) (defun ess-eval-line-invisibly-and-step () "Evaluate the current line invisibly and step to the next line. @@ -1800,42 +1689,10 @@ Evaluate all comments and empty lines." (ess-eval-line-and-step))) (define-obsolete-function-alias 'ess-eval-line-and-step-invisibly 'ess-eval-line-invisibly-and-step "18.10") -(defun ess-next-code-line (&optional arg skip-to-eob) - "Move ARG lines of code forward (backward if ARG is negative). -Skips past all empty and comment lines. Default for ARG is 1. -Don't skip the last empty and comment lines in the buffer unless -SKIP-TO-EOB is non-nil. On success, return 0. Otherwise, go as -far as possible and return -1." - (interactive "p") - (or arg (setq arg 1)) - (beginning-of-line) - (let ((pos (point)) - (n 0) - (inc (if (> arg 0) 1 -1))) - (while (and (/= arg 0) (= n 0)) - (setq n (forward-line inc)); n=0 is success - (if (not (fboundp 'comment-beginning)) - (while (and (= n 0) - (looking-at "\\s-*\\($\\|\\s<\\)")) - (setq n (forward-line inc))) - (comment-beginning) - (beginning-of-line) - (forward-comment (* inc (buffer-size))) ;; as suggested in info file - ) - (if (or skip-to-eob - (not (looking-at ess-no-skip-regexp))) ;; don't go to eob or whatever - (setq arg (- arg inc)) - (goto-char pos) - (setq arg 0) - (forward-line 1));; stop at next empty line - (setq pos (point))) - (goto-char pos) - n)) - ;;;*;;; Evaluate and switch to S -(defun ess-eval-region-and-go (start end vis) +(defun ess-eval-region-and-go (start end &optional vis) "Send region from START to END to the inferior process buffer. START and END default to the current region, and rectangular regions are treated as `ess-eval-region'. VIS has same meaning as @@ -1844,46 +1701,44 @@ for `ess-eval-region'." (ess-eval-region start end vis) (ess-switch-to-ESS t)) -(defun ess-eval-buffer-and-go (vis) +(defun ess-eval-buffer-and-go (&optional vis) "Send the current buffer to the inferior S and switch to the process buffer. VIS has same meaning as for `ess-eval-region'." (interactive "P") (ess-eval-buffer vis) (ess-switch-to-ESS t)) -(defun ess-eval-function-and-go (vis) +(defun ess-eval-function-and-go (&optional vis) "Send the current function, then switch to the inferior process buffer. VIS has same meaning as for `ess-eval-region'." (interactive "P") (ess-eval-function vis) (ess-switch-to-ESS t)) -(defun ess-eval-line-and-go (vis) +(defun ess-eval-line-and-go (&optional vis) "Send the current line, then switch to the inferior process buffer. VIS has same meaning as for `ess-eval-region'." (interactive "P") (ess-eval-line vis) (ess-switch-to-ESS t)) -(defun ess-eval-paragraph-and-go (vis) +(defun ess-eval-paragraph-and-go (&optional vis) "Send the current paragraph, then switch to the inferior process buffer. VIS has same meaning as for `ess-eval-region'." (interactive "P") (ess-eval-paragraph vis) (ess-switch-to-ESS t)) -(defun ess-eval-paragraph-and-step (vis) +(defun ess-eval-paragraph-and-step (&optional vis) "Evaluate the current paragraph and move point to the next line. If not inside a paragraph, evaluate the next one. VIS has same meaning as for `ess-eval-region'." (interactive "P") - (let ((beg-end (ess-eval-paragraph vis))) - (goto-char (cadr beg-end)) - (if ess-eval-empty - (forward-line 1) - (ess-next-code-line 1)))) + (ess-eval-paragraph vis) + (ess-skip-thing 'paragraph) + (ess-next-code-line)) - ; Inferior S mode + ; Inferior ESS mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; In this section: ;;;; @@ -1896,7 +1751,6 @@ meaning as for `ess-eval-region'." (defvar inferior-ess-mode-map (let ((map (make-sparse-keymap))) - (set-keymap-parent map comint-mode-map) (define-key map "\C-y" 'ess-yank) (define-key map "\r" 'inferior-ess-send-input) (define-key map "\C-a" 'comint-bol) @@ -1926,9 +1780,6 @@ meaning as for `ess-eval-region'." (define-key map "\C-c\C-d" 'ess-doc-map) (define-key map "\C-c\C-e" 'ess-extra-map) (define-key map "\C-c\C-t" 'ess-dev-map) - (with-no-warnings ; Obsolete key variable - (when ess-smart-S-assign-key - (define-key map ess-smart-S-assign-key 'ess-smart-S-assign))) map) "Keymap for `inferior-ess' mode.") @@ -1970,7 +1821,7 @@ meaning as for `ess-eval-region'." ("end-dev" :visible nil) "------" ("Font Lock" - :active inferior-ess-font-lock-keywords + :active ess-font-lock-keywords :filter ess--generate-font-lock-submenu) "------" ["Describe" describe-mode t] @@ -1989,81 +1840,34 @@ meaning as for `ess-eval-region'." map) "Keymap used in `ess-execute'.") -;;;###autoload -(defun inferior-ess-mode () +(define-derived-mode inferior-ess-mode comint-mode "iESS" "Major mode for interacting with an inferior ESS process. -Runs an S interactive job as a subprocess of Emacs, with I/O through an -Emacs buffer. Variable `inferior-ess-program' controls which S -is run. - -Commands are sent to the ESS process by typing them, and pressing -\\[inferior-ess-send-input]. Pressing \\[complete-dynamic-complete] -completes known object names or filenames, as appropriate. Other -keybindings for this mode are: - -\\{inferior-ess-mode-map} - -When editing S objects, the use of \\[ess-load-file] is advocated. -`ess-load-file' keeps source files (if `ess-keep-dump-files' is non-nil) in -the directory specified by `ess-source-directory', with the -filename chosen according to `ess-dump-filename-template'. When a file is -loaded, `ess-mode' parses error messages and jumps to the appropriate file -if errors occur. The ess-eval- commands do not do this. - -Customization: Entry to this mode runs the hooks on `comint-mode-hook' and -`inferior-ess-mode-hook' (in that order). - -You can send text to the inferior ESS process from other buffers -containing source code. The key bindings of these commands can be -found by typing \\[describe-mode]. - - `ess-eval-region' sends the current region to the ESS process. - `ess-eval-buffer' sends the current buffer to the ESS process. - `ess-eval-function' sends the current function to the ESS process. - `ess-eval-line' sends the current line to the ESS process. - `ess-beginning-of-function' and `ess-end-of-function' move the point to - the beginning and end of the current S function. - `ess-switch-to-ESS' switches the current buffer to the ESS process buffer. - `ess-switch-to-end-of-ESS' switches the current buffer to the ESS process - buffer and puts point at the end of it. - - `ess-eval-region-and-go', `ess-eval-buffer-and-go', - `ess-eval-function-and-go', and `ess-eval-line-and-go' switch to the S - process buffer after sending their text. - `ess-dump-object-into-edit-buffer' moves an S object into a temporary file - and buffer for editing - `ess-load-file' sources a file of commands to the ESS process. - -Commands: -Return after the end of the process' output sends the text from the - end of process to point. -Return before the end of the process' output copies the sexp ending at point - to the end of the process' output, and sends it. -Delete converts tabs to spaces as it moves back. -C-M-q does Tab on each line starting within following expression. -Paragraphs are separated only by blank lines. Crosshatches start comments. -If you accidentally suspend your process, use \\[comint-continue-subjob] -to continue it." - (interactive) - (delay-mode-hooks - (comint-mode)) - (set (make-local-variable 'comint-input-sender) 'inferior-ess-input-sender) - (set (make-local-variable 'process-connection-type) t) +To learn more about how to use inferior ess modes, see Info +node `(ess)Top'. If you accidentally suspend your process, use +\\[comint-continue-subjob] to continue it." ;; initialize all custom vars: - (ess-setq-vars-local ess-customize-alist) ; (current-buffer)) + (when ess-customize-alist + (ess-setq-vars-local ess-customize-alist)) + (setq-local comint-input-sender 'inferior-ess-input-sender) + + (when ess-history-file + (setq comint-input-ring-file-name + (expand-file-name (if (eql t ess-history-file) + (concat "." ess-dialect "history") + ess-history-file) + ess-history-directory)) + (comint-read-input-ring)) + + (setq-local font-lock-fontify-region-function + #'inferior-ess-fontify-region) - ;; If comint-process-echoes is t inferior-ess-input-sender - ;; recopies the input, otherwise not. VS[03-09-2012]: should be in customize-alist - (set (make-local-variable 'comint-process-echoes) - (not (member ess-language '("SAS" "XLS" "OMG" "julia")))) ;; these don't echo - (when (and (member ess-dialect '("R")) ;; S+ echoes!! - (not (eq ess-eval-visibly t))) - ;; when 'nowait or nil, don't wait for process - (setq comint-process-echoes nil)) + ;; If comint-process-echoes is t inferior-ess-input-sender + ;; recopies the input, otherwise not + (setq-local comint-process-echoes (not (member ess-language '("SAS" "XLS" "OMG" "julia")))) (when comint-use-prompt-regexp ;; why comint is not setting this? bug? - (set (make-local-variable 'inhibit-field-text-motion) t)) + (setq-local inhibit-field-text-motion t)) (unless inferior-ess-prompt ;; build when unset (setq inferior-ess-prompt @@ -2073,70 +1877,33 @@ to continue it." inferior-ess-secondary-prompt "\\)"))) (setq comint-prompt-regexp (concat "^" inferior-ess-prompt)) - (setq comint-get-old-input 'inferior-ess-get-old-input) ;; todo: this is R specific - (add-hook 'comint-input-filter-functions 'ess-search-path-tracker nil 'local) ;; R and S specific - (setq major-mode 'inferior-ess-mode) - (setq mode-name "iESS") ;(concat "iESS:" ess-dialect)) (setq mode-line-process '(" [" ess--mode-line-process-indicator ess--local-mode-line-process-indicator "]: %s")) - (use-local-map inferior-ess-mode-map) - (let ((inf-syntax-table (or inferior-ess-mode-syntax-table - ess-mode-syntax-table))) - (when inf-syntax-table - (set-syntax-table inf-syntax-table))) - - (ess-write-to-dribble-buffer - (format "(i-ess 1): buf=%s, lang=%s, comint..echo=%s, comint..sender=%s,\n" - (current-buffer) ess-language - comint-process-echoes comint-input-sender)) - - (when (string= ess-language "S") ;; todo: what is this doing here? - (local-set-key "\M-\r" 'ess-dirs)) - - ;; SJE 2007-06-28: Emacs 22.1 has a bug in that comint-mode will set - ;; this variable to t, when we need it to be nil. The Emacs 22 - ;; solution to this bug is to use define-derived-mode to derive - ;; inferior-ess-mode from comint-mode. Not sure if we can go down - ;; that route yet. I've used the when condition so that if the var - ;; is nil, don't bother setting it -- as setting it will make a new - ;; local var. - (when font-lock-keywords-only - (setq font-lock-keywords-only nil)) ;;; Completion support ---------------- (remove-hook 'completion-at-point-functions 'comint-completion-at-point t) ;; reset the hook (add-hook 'completion-at-point-functions 'comint-c-a-p-replace-by-expanded-history nil 'local) (add-hook 'completion-at-point-functions 'ess-filename-completion nil 'local) - ;; (setq comint-completion-addsuffix nil) ; To avoid spaces after filenames - ;; KH: next 2 lines solve. - (set (make-local-variable 'comint-completion-addsuffix) - (cons "/" "")) + + ;; hyperlinks support + (goto-address-mode t) + + ;; Avoid spaces after filenames + (setq-local comint-completion-addsuffix (cons "/" "")) + (setq comint-input-autoexpand t) ; Only for completion, not on input. - ;; timers - ;; (add-hook 'ess-idle-timer-functions 'ess-cache-search-list nil 'local) - ;; (add-hook 'ess-idle-timer-functions 'ess-synchronize-dirs nil 'local) - ;;; Keep out of the code. - (set (make-local-variable 'indent-tabs-mode) nil) - (set (make-local-variable 'paragraph-start) - (concat inferior-ess-primary-prompt "\\|\^L")) - (set (make-local-variable 'paragraph-separate) "\^L") - (if (featurep 'jit-lock) - (setq-local jit-lock-chunk-size inferior-ess-jit-lock-chunk-size)) - (make-local-variable 'kill-buffer-hook) - (add-hook 'kill-buffer-hook 'ess-kill-buffer-function) - (run-mode-hooks 'inferior-ess-mode-hook) - (ess-write-to-dribble-buffer - (format "(i-ess end): buf=%s, lang=%s, comint..echo=%s, comint..sender=%s,\n" - (current-buffer) ess-language - comint-process-echoes comint-input-sender)) - (message - (concat (substitute-command-keys - "Type \\[describe-mode] for help on ESS version ") - ess-version))) + + (add-hook 'window-configuration-change-hook #'ess-set-width nil t) + (setq-local indent-tabs-mode nil) + + (setq-local paragraph-start (concat inferior-ess-primary-prompt "\\|\^L")) + (setq-local paragraph-separate "\^L") + (setq-local jit-lock-chunk-size inferior-ess-jit-lock-chunk-size)) + ;;*;; Commands used exclusively in inferior-ess-mode @@ -2328,27 +2095,54 @@ in `ess-r-post-run-hook' or `ess-S+-post-run-hook'." (interactive) (if (null ess-execute-screen-options-command) (message "Not implemented for '%s'" ess-dialect) - ;; We cannot use (window-width) here because it returns sizes in default - ;; (frame) characters which leads to incorrect sizes with scaled fonts.To - ;; solve this we approximate font width in pixels and use window-pixel-width - ;; to compute the approximate number of characters that fit into line. - (let* ((wedges (window-inside-pixel-edges)) - (wwidth (- (nth 2 wedges) (nth 0 wedges))) - (nchars (if (fboundp 'default-font-width) - (floor (/ wwidth (default-font-width))) - ;; emacs 24 - (if (display-graphic-p) - (let* ((r (/ (float (frame-char-height)) (frame-char-width))) - (charh (aref (font-info (face-font 'default)) 3)) - (charw (/ charh r))) - (- (floor (/ wwidth charw)) 1)) - ;; e.g., no X11 as in 'emacs -nw' - (- (window-width) 2)))) - (command (format ess-execute-screen-options-command nchars))) + (let ((command (ess-calculate-width 'window))) (if invisibly (ess-command command) (ess-eval-linewise command nil nil nil 'wait-prompt))))) +(defun ess-calculate-width (opt) + "Calculate width command given OPT. +OPT can be 'window, 'frame, or an integer. Return a command +suitable to send to the inferior process (e.g. \"options(width=80, length=999999)\")." + (when (null ess-execute-screen-options-command) + (error "Not implemented for %s" ess-dialect)) + (let (command) + (cond ((integerp opt) + (setq command (format ess-execute-screen-options-command opt))) + ((eql 'window opt) + ;; We cannot use (window-width) here because it returns sizes + ;; in default (frame) characters which leads to incorrect + ;; sizes with scaled fonts.To solve this we approximate font + ;; width in pixels and use window-pixel-width to compute the + ;; approximate number of characters that fit into line. + (let* ((wedges (window-inside-pixel-edges)) + (wwidth (- (nth 2 wedges) (nth 0 wedges))) + (nchars (floor (/ wwidth (default-font-width))))) + (setq command (format ess-execute-screen-options-command + nchars)))) + ((eql 'frame opt) + (setq command + (format ess-execute-screen-options-command (frame-width)))) + (t (error "OPT (%s) not 'window, 'frame or an integer" opt))) + command)) + +(defun ess-set-width () + "Set the width option. +A part of `window-configuration-change-hook' in inferior ESS +buffers." + (when (and ess-auto-width + ess-execute-screen-options-command) + ;; `window-configuration-change-hook' runs with the window selected. + (let ((proc (get-buffer-process (window-buffer))) + command) + ;; TODO: Set the width once the process is no longer busy. + (when (and (process-live-p proc) + (not (process-get proc 'busy))) + (setq command (ess-calculate-width ess-auto-width)) + (if ess-auto-width-visible + (ess-eval-linewise command nil nil nil 'wait-prompt) + (ess-command command)))))) + (defun ess-execute (command &optional invert buff message) "Send a command to the ESS process. A newline is automatically added to COMMAND. Prefix arg (or second arg @@ -2379,6 +2173,7 @@ to the command if BUFF is not given.)" (let ((buff (ess-create-temp-buffer buff-name))) (ess-command the-command buff);; sleep? (with-current-buffer buff + (ansi-color-apply-on-region (point-min) (point-max)) (goto-char (point-min)) (if message (insert message) (if buff nil @@ -2391,19 +2186,23 @@ to the command if BUFF is not given.)" ;;;*;;; Quitting -(ess-defgeneric ess-quit (&rest args) - "Issue an exiting command to the inferior process, additionally -also running \\[ess-cleanup]." - (interactive) +(cl-defgeneric ess-quit--override (_arg) + "Stops the inferior process" + (let ((proc (ess-get-process))) + (ess-cleanup) + (goto-char (marker-position (process-mark proc))) + (insert inferior-ess-exit-command) + (process-send-string proc inferior-ess-exit-command))) + +(defun ess-quit (&optional arg) + "Issue an exiting command to the inferior process. +Runs `ess-cleanup'. ARG gets passed to a language specific +method, see `ess-quit--override'." + (interactive "P") (ess-force-buffer-current "Process to quit: " nil 'no-autostart) (ess-interrupt) (ess-make-buffer-current) - (:override - (let ((proc (ess-get-process))) - (ess-cleanup) - (goto-char (marker-position (process-mark proc))) - (insert inferior-ess-exit-command) - (process-send-string proc inferior-ess-exit-command)))) + (ess-quit--override arg)) (defun ess-interrupt () "Interrupt the inferior process. @@ -2462,8 +2261,10 @@ before you quit. It is run automatically by \\[ess-quit]." (kill-buffer buf))))) (ess-switch-to-ESS nil))) -(ess-defgeneric inferior-ess-reload (&optional start-args) - "Reload the inferior process." +(defun inferior-ess-reload (&optional start-args) + "Reload the inferior process. +START-ARGS gets passed to the dialect-specific +`inferior-ess-reload-override'." (interactive) (inferior-ess-force) ;; Interrupt early so we can get working directory @@ -2477,8 +2278,10 @@ before you quit. It is run automatically by \\[ess-quit]." (ess-ask-for-ess-directory nil)) (ess-quit 'no-save) (inferior-ess--wait-for-exit (ess-get-process)) - (:override - (error "Unimplemented for this dialect"))))) + (inferior-ess-reload--override start-args)))) + +(cl-defmethod inferior-ess-reload--override (start-args) + (user-error "Reloading not implemented for %s %s" ess-dialect start-args)) (defun inferior-ess--wait-for-exit (proc) "Wait for process exit. @@ -2490,12 +2293,10 @@ after issuing a quit command as the latter assumes a live process." (when (> (- (float-time) start-time) 1) (error "Timeout while quitting process"))))) -(defun ess-kill-buffer-function () - "Function run just before an ESS process buffer is killed." - ;; This simply deletes the buffers process to avoid an Emacs bug - ;; where the sentinel is run *after* the buffer is deleted - (let ((proc (get-buffer-process (current-buffer)))) - (if (processp proc) (delete-process proc)))) +(defun ess-list-object-completions nil + "List all possible completions of the object name at point." + (interactive) + (ess-complete-object-name)) ;;;*;;; Support functions @@ -2572,7 +2373,7 @@ If exclude-first is non-nil, don't return objects in first positon (.GlobalEnv). (append result (ess-extract-onames-from-alist alist i))) (setq i (1+ i))) - (setq ess-object-list (ess-uniq-list result)))))) + (setq ess-object-list (delete-dups result)))))) (defun ess-get-words-from-vector (command &optional no-prompt-check wait proc) "Evaluate the S command COMMAND, which returns a character vector. @@ -2597,11 +2398,7 @@ print(out, max=1e6) })\n\"." "\\( \\|$\\)"; space or end )) words) - (ess-if-verbose-write - (format "(ess-get-words-* command=%s full-word-regexp=%S)\n" - command full-word-regexp)) (ess-command command tbuffer 'sleep no-prompt-check wait proc) - (ess-if-verbose-write " [ok] ..") (with-current-buffer tbuffer (goto-char (point-min)) (while (re-search-forward full-word-regexp nil t) @@ -2704,8 +2501,8 @@ name that contains :,$ or @." (when (re-search-forward "(list" nil t) (goto-char (match-beginning 0)) (setq args (ignore-errors (eval (read (current-buffer))))) - (if args - (setcar args (cons (car args) (current-time))))) + (when args + (setcar args (cons (car args) (current-time))))) ;; push even if nil (puthash (substring-no-properties funname) args cache))))))) @@ -2728,8 +2525,7 @@ directory in the `load-path'." (pos 2) name (buffer (get-buffer-create " *ess-db*")) - (temp-object-name-db nil) - (temp-object-name-db-file ess-object-name-db-file)) + (temp-object-name-db nil)) (ess-write-to-dribble-buffer (format "(object db): search-list=%s \n " search-list)) @@ -2766,11 +2562,10 @@ directory in the `load-path'." (ess-get-modtime-list)) (defun ess-filename-completion () - ;; > emacs 24 "Return completion only within string or comment." (save-restriction ;; explicitely handle inferior-ess (ignore-errors - (when (and (eq major-mode 'inferior-ess-mode) + (when (and (derived-mode-p 'inferior-ess-mode) (> (point) (process-mark (get-buffer-process (current-buffer))))) (narrow-to-region (process-mark (get-buffer-process (current-buffer))) (point-max)))) @@ -2781,7 +2576,7 @@ directory in the `load-path'." "Do file completion only within strings." (save-restriction ;; explicitely handle inferior-ess (ignore-errors - (when (and (eq major-mode 'inferior-ess-mode) + (when (and (derived-mode-p 'inferior-ess-mode) (> (point) (process-mark (get-buffer-process (current-buffer))))) (narrow-to-region (process-mark (get-buffer-process (current-buffer))) (point-max)))) @@ -2906,16 +2701,15 @@ backward compatibility only." ;;; Miscellaneous routines ;;;*;;; Routines for reading object names -(ess-defgeneric ess-read-object-name (p-string) +(defun ess-read-object-name (p-string) "Read an object name from the minibuffer with completion, and return it. P-STRING is the prompt string." - (:override - (let* ((default (ess-read-object-name-dump)) - (object-list (ess-get-object-list ess-local-process-name)) - (spec (ess-completing-read p-string object-list nil nil nil nil default))) - (list (cond - ((string= spec "") default) - (t spec)))))) + (let* ((default (ess-read-object-name-dump)) + (object-list (ess-get-object-list ess-local-process-name)) + (spec (ess-completing-read p-string object-list nil nil nil nil default))) + (list (cond + ((string= spec "") default) + (t spec))))) (defun ess-read-object-name-default () "Return the object name at point, or nil if none." @@ -2980,7 +2774,7 @@ list." (progn (delete-horizontal-space) (insert ", ") - (unless (eq major-mode 'inferior-ess-mode) + (unless (derived-mode-p 'inferior-ess-mode) (indent-according-to-mode))) (insert ","))))) @@ -3010,12 +2804,10 @@ NO-ERROR prevents errors when this has not been implemented for (define-obsolete-function-alias 'ess-use-dir 'ess-set-working-directory "ESS 18.10") -(defun ess-use-this-dir (&optional no-force-current) +(defun ess-use-this-dir (&rest _ignore) "Set the current process directory to the directory of this file. -`default-directory' is used as a fallback. If that buffer has no -associated *R* process, use \\[ess-force-buffer-current], unless -prefix argument NO-FORCE-CURRENT is non-nil." - (interactive "P") +`default-directory' is used as a fallback." + (interactive) (let ((dir (if buffer-file-name (file-name-directory buffer-file-name) default-directory))) @@ -3032,7 +2824,8 @@ prefix argument NO-FORCE-CURRENT is non-nil." "Set Emacs' current directory to be the same as the subprocess directory. To be used in `ess-idle-timer-functions'." (when (and ess-can-eval-in-background - ess-getwd-command) + ess-getwd-command + (inferior-ess-available-p)) (ess-when-new-input last-sync-dirs (ess-if-verbose-write "\n(ess-synchronize-dirs)\n") (setq default-directory @@ -3202,9 +2995,9 @@ Returns t if the buffer existed and was modified, but was not saved." ;;*;; Error messages -(defun ess-parse-errors (&optional showerr reset) +(defun ess-parse-errors (&optional showerr _reset) "Jump to error in last loaded ESS source file. -With prefix argument, only shows the errors ESS reported. RESET +With prefix argument SHOWERR, only show the errors ESS reported. RESET is for compatibility with `next-error' and is ignored." (interactive "P") (ess-make-buffer-current) @@ -3228,7 +3021,10 @@ is for compatibility with `next-error' and is ignored." (if fbuffer nil (setq fbuffer (find-file-noselect filename)) (with-current-buffer fbuffer - (ess-mode))) + ;; TODO: ess-mode is surely wrong here, but I don't + ;; think we need this whole function anymore? + (when (fboundp 'ess-mode) + (ess-mode)))) (pop-to-buffer fbuffer) (ess-goto-line linenum)) (princ errmess t))) @@ -3246,7 +3042,3 @@ Display the S buffer, and cause an error displaying MSG." (provide 'ess-inf) ;;; ess-inf.el ends here - -;; Local Variables: -;; byte-compile-warnings: (not lexical) -;; End: diff --git a/elpa/ess-20181109.703/ess-jags-d.el b/elpa/ess-20190121.1430/ess-jags-d.el similarity index 96% rename from elpa/ess-20181109.703/ess-jags-d.el rename to elpa/ess-20190121.1430/ess-jags-d.el index 51da0009..a5797765 100644 --- a/elpa/ess-20181109.703/ess-jags-d.el +++ b/elpa/ess-20190121.1430/ess-jags-d.el @@ -24,13 +24,11 @@ ;;; Code: (require 'ess-bugs-l) +(require 'ess-bugs-d) (require 'ess-utils) (require 'ess-inf) (require 'ess-mode) -(setq auto-mode-alist - (append '(("\\.[jJ][aA][gG]\\'" . ess-jags-mode)) auto-mode-alist)) - (defvar ess-jags-command "jags" "Default JAGS program in PATH.") (make-local-variable 'ess-jags-command) @@ -239,19 +237,11 @@ ) ;;;###autoload -(defun ess-jags-mode () - "ESS[JAGS]: Major mode for JAGS." - (interactive) - (kill-all-local-variables) - (ess-setq-vars-local '((comment-start . "#"))) - (setq major-mode 'ess-jags-mode) - (setq mode-name "ESS[JAGS]") - (use-local-map ess-bugs-mode-map) - (make-local-variable 'font-lock-defaults) +(define-derived-mode ess-jags-mode ess-bugs-mode "ESS[JAGS]" + "Major mode for JAGS." + (setq-local comment-start "#") (setq font-lock-defaults '(ess-jags-font-lock-keywords nil t)) (setq ess-language "S") ; mimic S for ess-smart-underscore - (run-mode-hooks 'ess-bugs-mode-hook) - (unless (and (fboundp 'w32-shell-dos-semantics) (w32-shell-dos-semantics)) (add-hook 'comint-output-filter-functions 'ess-bugs-exit-notify-sh)) @@ -260,9 +250,7 @@ ;;;###autoload (add-to-list 'auto-mode-alist '("\\.[Jj][Aa][Gg]\\'" . ess-jags-mode)) -(defvaralias 'ess-jags-mode-hook 'ess-bugs-mode-hook) -(defvaralias 'ess-jags-mode-map 'ess-bugs-mode-map) - +;; FIXME: What is this doing here!? (setq features (delete 'ess-bugs-d features)) (provide 'ess-jags-d) diff --git a/elpa/ess-20181109.703/ess-julia.el b/elpa/ess-20190121.1430/ess-julia.el similarity index 82% rename from elpa/ess-20181109.703/ess-julia.el rename to elpa/ess-20190121.1430/ess-julia.el index 7c944000..b4f4bfcc 100644 --- a/elpa/ess-20181109.703/ess-julia.el +++ b/elpa/ess-20190121.1430/ess-julia.el @@ -1,4 +1,4 @@ -;; ess-julia.el --- ESS julia mode and inferior interaction +;; ess-julia.el --- ESS julia mode and inferior interaction -*- lexical-binding: t; -*- ;; ;; Copyright (C) 2012-2015 Vitalie Spinu and the ESS Core team. ;; @@ -44,7 +44,9 @@ (require 'compile) (require 'ess-utils) (require 'ess-r-mode) +(require 'ess-help) (require 'julia-mode) +(require 'ess-inf) (defvar ac-prefix) (declare-function company-in-string-or-comment "company") @@ -58,7 +60,7 @@ (eval-when-compile (require 'cl-lib)) -(defun ess-julia-send-string-function (process string visibly) +(defun ess-julia-send-string-function (process string _visibly) "Send the Julia STRING to the PROCESS. VISIBLY is not currently used." (let ((file (concat temporary-file-directory "julia_eval_region.jl"))) @@ -86,9 +88,9 @@ VISIBLY is not currently used." (nreverse out)))) (defvar ess-julia--manual-topics nil) -(defun ess-julia-manual-lookup-function (&rest args) ; args are not used +(defun ess-julia-manual-lookup-function (&rest _args) + "Look up topics at https://docs.julialang.org/en/latest/manual/." (interactive) - "Look up topics at https://docs.julialang.org/en/latest/manual/" ;;
  • Introduction
  • (let* ((pages (or ess-julia--manual-topics (setq ess-julia--manual-topics @@ -97,6 +99,8 @@ VISIBLY is not currently used." (browse-url (get-text-property 1 :manual page)))) (defun ess-julia-input-sender (proc string) + "Function to send PROC STRING submitted by user. +See `comint-input-sender'." (save-current-buffer (let* ((help-?-regexp "^ *\\(?:\\(?1: *?\\? *\\)\\(?2:.+\\)\\)") (help-?-match (string-match help-?-regexp string))) @@ -106,27 +110,25 @@ VISIBLY is not currently used." (t ;; normal command (inferior-ess-input-sender proc string)))))) -;; julia 0.3.0 doesn't provide categories. Thus we don't support this anymore. -;; (defun ess-julia-reference-lookup-function (&rest args) ; args are not used -;; (interactive) -;; "Look up reference topics" -;; ;;
  • Introduction
  • -;; (let* ((pages (ess-get-words-from-vector "ESS.help_categories()\n"))) -;; (ess-display-help-on-object -;; (ess-completing-read "Category" pages nil t)))) +(cl-defmethod ess-installed-packages (&context ((string= ess-dialect "julia") (eql t))) + "Return list of installed julia packages." + ;; FIXME: This doesn't work if the user hasn't done "using Pkg" yet + (ess-get-words-from-vector "keys(Pkg.installed())\n")) +(cl-defmethod ess-load-library--override (pack &context ((string= ess-dialect "julia") (eql t))) + (ess-eval-linewise (format "using %s\n" pack))) ;;; COMPLETION (defun ess-julia-latexsub-completion () - "Complete latex input, and returns in a format required by `completion-at-point-functions'." + "Complete latex input, and return format required by `completion-at-point-functions'." (if (julia-latexsub) ; julia-latexsub returns nil if it performed a completion, the point otherwise nil (lambda () t) ;; bypass other completion methods )) (defun ess-julia-object-completion () - "Return completions at point in a format required by `completion-at-point-functions'. " + "Return completions at point in a format required by `completion-at-point-functions'." (let ((proc (ess-get-next-available-process ess-dialect t)) (beg (ess-symbol-start))) (if proc @@ -213,7 +215,7 @@ objects from that MODULE." (let ((buf (get-buffer-create " *ess-command-output*"))) (with-current-buffer (process-buffer proc) (ess-with-current-buffer buf - (ess--flush-help-into-current-buffer sym nil t))) + (ess--flush-help-into-current-buffer sym nil))) (with-current-buffer buf (ess-help-underline) (goto-char (point-min)) @@ -224,7 +226,7 @@ objects from that MODULE." (requires . 2) (candidates . ess-ac-julia-objects) (document . ess-julia-get-object-help-string)) - "Auto-completion source for julia objects") + "Auto-completion source for julia objects.") (defun ess-ac-julia-objects () (require 'auto-complete) @@ -300,9 +302,7 @@ to look up any doc strings." ;;; CORE (defvar ess-julia-customize-alist - '((comint-use-prompt-regexp . t) - (ess-eldoc-function . 'ess-julia-eldoc-function) - (inferior-ess-primary-prompt . "a> ") ;; from julia> + '((inferior-ess-primary-prompt . "a> ") ;; from julia> (inferior-ess-secondary-prompt . nil) (inferior-ess-prompt . "\\w*> ") (ess-local-customize-alist . 'ess-julia-customize-alist) @@ -316,8 +316,6 @@ to look up any doc strings." (ess-dump-error-re . "in \\w* at \\(.*\\):[0-9]+") (ess-error-regexp . "\\(^\\s-*at\\s-*\\(?3:.*\\):\\(?2:[0-9]+\\)\\)") (ess-error-regexp-alist . ess-julia-error-regexp-alist) - (ess-imenu-generic-expression . ess-julia-imenu-generic-expression) - (ess-mode-syntax-table . julia-mode-syntax-table) (ess-mode-completion-syntax-table . ess-julia-completion-syntax-table) ;; (inferior-ess-objects-command . inferior-ess-r-objects-command) ;; (inferior-ess-search-list-command . "search()\n") @@ -326,8 +324,6 @@ to look up any doc strings." (ess-language . "julia") (ess-dialect . "julia") (ess-suffix . "jl") - (ess-ac-sources . '(ac-source-ess-julia-objects)) - (ess-company-backends . '(company-ess-julia-objects)) (ess-dump-filename-template . (replace-regexp-in-string "S$" ess-suffix ; in the one from custom: ess-dump-filename-template-proto)) @@ -338,22 +334,19 @@ to look up any doc strings." (ess-function-pattern . ess-r-function-pattern) (ess-object-name-db-file . "ess-jl-namedb.el" ) (ess-smart-operators . ess-r-smart-operators) - (inferior-ess-help-filetype . nil) (inferior-ess-exit-command . "exit()\n") ;;harmful for shell-mode's C-a: -- but "necessary" for ESS-help? - (inferior-ess-start-file . nil) ;; "~/.ess-R" (inferior-ess-start-args . "") (inferior-ess-language-start . nil) (ess-STERM . "iESS") (ess-editor . ess-r-editor) (ess-pager . ess-r-pager) (ess-getwd-command . "pwd()\n") - (ess-setwd-command . "cd(expanduser(\"%s\"))\n") - ) - "Variables to customize for Julia -- set up later than emacs initialization.") + (ess-setwd-command . "cd(expanduser(\"%s\"))\n")) + "Variables to customize for Julia.") (defvar ess-julia-completion-syntax-table - (let ((table (make-syntax-table ess-r-syntax-table))) + (let ((table (copy-syntax-table ess-r-mode-syntax-table))) (modify-syntax-entry ?. "_" table) ;; (modify-syntax-entry ?: "_" table) ;; (modify-syntax-entry ?$ "_" table) @@ -362,19 +355,65 @@ to look up any doc strings." "Syntax table used for completion and help symbol lookup. It makes underscores and dots word constituent chars.") +(cl-defmethod ess-help-commands (&context ((string= ess-dialect "julia") (eql t))) + '((packages . "_ess_list_categories()\n") + (package-index . "_ess_print_index(\"%s\")\n") + (index-keyword-reg . "^\\(.*+\\):$*") + (index-start-reg . ":"))) + +(defvar ess-julia-mode-syntax-table (copy-syntax-table julia-mode-syntax-table)) + +(defvar ess-julia-mode-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map ess-mode-map) + map) + "Keymap for `ess-julia-mode'.") + ;;;###autoload (define-derived-mode ess-julia-mode julia-mode "ESS[julia]" - "Major mode for editing julia source. See `ess-mode' for more help." - (ess-mode ess-julia-customize-alist nil t) + "Major mode for julia files." + (setq-local ess-local-customize-alist ess-julia-customize-alist) + (setq ess-dialect "julia") + (ess-setq-vars-local ess-julia-customize-alist) + ;; eldoc + (add-function :before-until (local 'eldoc-documentation-function) + #'ess-julia-eldoc-function) + (when ess-use-eldoc (eldoc-mode)) + ;; auto-complete + (ess--setup-auto-complete '(ac-source-ess-julia-objects)) + ;; company + (ess--setup-company '(company-ess-julia-objects)) ;; for emacs >= 24 (remove-hook 'completion-at-point-functions 'ess-filename-completion 'local) ;; should be first (add-hook 'completion-at-point-functions 'ess-julia-object-completion nil 'local) (add-hook 'completion-at-point-functions 'ess-filename-completion nil 'local) (if (fboundp 'ess-add-toolbar) (ess-add-toolbar)) - (set (make-local-variable 'end-of-defun-function) 'ess-end-of-function) (setq imenu-generic-expression ess-julia-imenu-generic-expression) - (imenu-add-to-menubar "Imenu-jl") - (run-mode-hooks 'ess-julia-mode-hook)) + (imenu-add-to-menubar "Imenu-jl")) + +;; Inferior mode +(defvar inferior-ess-julia-mode-syntax-table + (copy-syntax-table ess-julia-mode-syntax-table) + "Syntax table for `inferior-ess-julia-mode'.") + +(define-derived-mode inferior-ess-julia-mode inferior-ess-mode "iESS[julia]" + "Major mode for inferior julia processes." + (ess-setq-vars-local ess-julia-customize-alist) + (setq-local comint-use-prompt-regexp t) + (setq ess-dialect "julia") + ;; eldoc + (add-function :before-until (local 'eldoc-documentation-function) + #'ess-julia-eldoc-function) + (when ess-use-eldoc (eldoc-mode)) + ;; auto-complete + (ess--setup-auto-complete '(ac-source-ess-julia-objects) t) + ;; company + (ess--setup-company '(company-ess-julia-objects) t) + (remove-hook 'completion-at-point-functions 'ess-filename-completion 'local) ;; should be first + (add-hook 'completion-at-point-functions 'ess-julia-object-completion nil 'local) + (add-hook 'completion-at-point-functions 'ess-filename-completion nil 'local) + (add-hook 'completion-at-point-functions 'ess-julia-latexsub-completion nil 'local) + (setq comint-input-sender #'ess-julia-input-sender)) (defvar ess-julia-mode-hook nil) (defvar ess-julia-post-run-hook nil @@ -382,11 +421,12 @@ It makes underscores and dots word constituent chars.") ;;;###autoload (defun julia (&optional start-args) - "Call 'julia'. -Optional prefix (C-u) allows to set command line arguments, such as ---load=. This should be OS agnostic. -If you have certain command line arguments that should always be passed -to julia, put them in the variable `inferior-julia-args'." + "Start an inferior julia process. +Optional prefix START-ARGS (\\[universal-argument]) allows to set +command line arguments, such as --load=. This should be OS +agnostic. If you have certain command line arguments that should +always be passed to julia, put them in the variable +`inferior-julia-args'." (interactive "P") ;; get settings, notably inferior-julia-program : (if (null inferior-julia-program) @@ -407,12 +447,6 @@ to julia, put them in the variable `inferior-julia-args'." nil)))) (inferior-ess jl-start-args) - (remove-hook 'completion-at-point-functions 'ess-filename-completion 'local) ;; should be first - (add-hook 'completion-at-point-functions 'ess-julia-object-completion nil 'local) - (add-hook 'completion-at-point-functions 'ess-filename-completion nil 'local) - (add-hook 'completion-at-point-functions 'ess-julia-latexsub-completion nil 'local) - (setq comint-input-sender 'ess-julia-input-sender) - (ess--tb-start) ;; remove ` from julia's logo (goto-char (point-min)) diff --git a/elpa/ess-20181109.703/ess.el b/elpa/ess-20190121.1430/ess-mode.el similarity index 71% rename from elpa/ess-20181109.703/ess.el rename to elpa/ess-20190121.1430/ess-mode.el index b9eac350..0c2c34c3 100644 --- a/elpa/ess-20181109.703/ess.el +++ b/elpa/ess-20190121.1430/ess-mode.el @@ -1,23 +1,11 @@ -;;; ess.el --- Emacs Speaks Statistics +;;; ess-mode.el -- Emacs Speaks Statistics root mode. -*- lexical-binding: t; -*- ;; -;; Author: David Smith -;; A.J. Rossini -;; Richard M. Heiberger -;; Kurt Hornik -;; Martin Maechler -;; Rodney A. Sparapani -;; Stephen Eglen -;; Sebastian P. Luque -;; Henning Redestig -;; Vitalie Spinu -;; Lionel Henry -;; J. Alexander Branham +;; Copyright (C) 1994-2018 ESS Core Team +;; Maintainer: ESS-core ;; -;; Maintainer: ESS Core Team -;; Copyright (C) 1997-2018 ESS Core Team -;; Created: 7 Jan 1994 -;; Version: 18.10.2 -;; Package-Requires: ((julia-mode "0.3")) +;; Keywords: languages +;; +;; This file is part of ESS ;; ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -33,50 +21,29 @@ ;; https://www.r-project.org/Licenses/ ;; ;;; Commentary: -;; -;; Emacs Speaks Statistics (ESS) is a package designed to support editing of -;; scripts and interaction with various statistical analysis programs such as R, -;; S-Plus, SAS, Stata and OpenBUGS/JAGS. For more details please visit ESS home -;; page at https://ess.r-project.org/ -;; +;; ;;; Code: +(require 'ess) + (eval-when-compile - (require 'cl) - (require 'cl-lib)) + (require 'cl-lib) + (require 'subr-x)) (require 'ess-custom) (require 'ess-utils) -(require 'ess-generics) (require 'ess-inf) -;; FIXME: should this be optional? -(require 'ess-noweb-mode) - ;; Silence the byte compiler (declare-function run-ess-r "ess-r-mode") -(declare-function S+ "ess-sp6w-d") +(declare-function S+ "ess-sp6-d") (declare-function SAS "ess-sas-d") - ; ESS mode - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;; In this section: -;;;; -;;;; * The major mode ess-mode -;;;; * Commands for ess-mode -;;;; * Code evaluation commands -;;;; * Indenting code and commands -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;*;; Major mode definition +;; ESS mode +;; Major mode definition (defvar ess-mode-map (let ((map (make-sparse-keymap))) - - ;; By popular demand: - (define-key map (kbd "RET") 'ess-newline-and-indent) (define-key map [remap yank] 'ess-yank) - (define-key map "\C-c\C-r" 'ess-eval-region) (define-key map "\C-c\M-r" 'ess-eval-region-and-go) (define-key map "\C-c\C-b" 'ess-eval-buffer) @@ -121,9 +88,6 @@ (define-key map "\C-c\C-d" 'ess-doc-map) (define-key map "\C-c\C-e" 'ess-extra-map) (define-key map "\C-c\C-t" 'ess-dev-map) - (with-no-warnings ; Obsolete key variable - (when ess-smart-S-assign-key - (define-key map ess-smart-S-assign-key 'ess-smart-S-assign))) (define-key map (kbd "C-c C-=") 'ess-cycle-assign) map) "Keymap for `ess-mode'.") @@ -258,25 +222,19 @@ ["Send bug report" ess-submit-bug-report t])) ;;;###autoload -(defun ess-mode (&optional alist proc-name is-derived) +(define-derived-mode ess-mode prog-mode "ESS" "Major mode for editing ESS source. Optional arg ALIST describes how to customize the editing mode. Optional arg PROC-NAME is name of associated inferior process. \\{ess-mode-map} -Extra binding to note: 'ESC C-\\' indent-region. - -Entry to this mode runs the hooks in ess-mode-hook. - You can send text to the inferior ESS process from other buffers containing ESS source. `ess-eval-region' sends the current region to the ESS process. `ess-eval-buffer' sends the current buffer to the ESS process. `ess-eval-function' sends the current function to the ESS process. `ess-eval-line' sends the current line to the ESS process. - `ess-beginning-of-function' and `ess-end-of-function' move the point to - the beginning and end of the current ESS function. `ess-switch-to-ESS' switches the current buffer to the ESS process buffer. `ess-switch-to-end-of-ESS' switches the current buffer to the ESS process buffer and puts point at the end of it. @@ -336,41 +294,15 @@ Variables controlling indentation style: Non-nil means distinguish between #, ##, and ### for indentation. Furthermore, \\[ess-set-style] command enables you to set up predefined ess-mode -indentation style. At present, predefined style are `BSD', `GNU', `K&R', `C++', -`CLB' (quoted from C language style)." - (setq alist (or alist - (buffer-local-value 'ess-local-customize-alist (current-buffer)) - (error "Customise alist is not specified, nor ess-local-customize-alist is set"))) - (unless is-derived - (kill-all-local-variables)) ;; NOTICE THIS! *** NOTICE THIS! *** NOTICE THIS! *** - (ess-setq-vars-local alist) - (ess-write-to-dribble-buffer - (format "(ess-mode-1): ess-language=%s, ess-dialect=%s buf=%s \n" - ess-language - ess-dialect - (current-buffer))) - ;; (ess-write-to-dribble-buffer - ;; (format "(ess-mode-1.2): ess-process=%s \n" - ;; (ess-local-process-name ess-local-process-name "none"))) - (ess-write-to-dribble-buffer - (format "(ess-mode-1.5): alist=%s \n" alist)) - (unless is-derived - (setq major-mode 'ess-mode) - (setq mode-name (concat "ESS[" (or ess-dialect ess-language) "]"))) - ;; The following line does the next 20 or so :-). - (ess-write-to-dribble-buffer - (format "(ess-mode-1.6): editing-alist=%s \n" - ess-mode-editing-alist)) - (ess-setq-vars-local ess-mode-editing-alist) - - (ess-set-style ess-style t) - (use-local-map ess-mode-map) - (when ess-mode-syntax-table - (set-syntax-table ess-mode-syntax-table)) +indentation style. See `ess-style-alist' for predefined styles." + ;; TODO: get rid of these and rely on modes to set variables properly + (when-let ((alist (buffer-local-value 'ess-local-customize-alist (current-buffer)))) + (ess-setq-vars-local alist)) + (when-let ((alist ess-mode-editing-alist)) + (ess-setq-vars-local alist)) ;; Keep out of the code. - (make-local-variable 'indent-tabs-mode) - (setq indent-tabs-mode nil) + (setq-local indent-tabs-mode nil) (put 'ess-local-process-name 'permanent-local t) ; protect from RCS (setq mode-line-process @@ -383,16 +315,15 @@ indentation style. At present, predefined style are `BSD', `GNU', `K&R', `C++', (delq t comint-dynamic-complete-functions) (set (make-local-variable 'comint-completion-addsuffix) (cons "/" "")) + (add-hook 'hack-local-variables-hook #'ess--set-style-in-buffer nil t) + (add-hook 'ess-idle-timer-functions 'ess-synchronize-dirs nil 'local)) - (add-hook 'ess-idle-timer-functions 'ess-synchronize-dirs nil 'local) - (ess-load-extras) - (run-mode-hooks 'prog-mode-hook) - (run-mode-hooks 'ess-mode-hook) - (ess-write-to-dribble-buffer "\nFinished setting up ESS-mode.\n")) - -;; Set parent to `prog-mode' -(put 'ess-mode 'derived-mode-parent 'prog-mode) -(set-keymap-parent ess-mode-map prog-mode-map) +(defun ess--set-style-in-buffer () + "Set `ess-style' taking into account file and directory local variables. +This is added to `hack-local-variables-hook'." + (setq-local ess-style (or (alist-get 'ess-style file-local-variables-alist) + ess-style)) + (ess-set-style ess-style t)) (defun ess--get-mode-line-indicator () "Get `ess--mode-line-process-indicator' from process buffer. @@ -407,38 +338,64 @@ Internal function to be used for dynamic mode-line dysplay in "none")) -;;*;; User commands in ess-mode +;;; User commands in ess-mode -;;;*;;; Miscellaneous +(defun ess-install-library (&optional update package) + "Install PACKAGE for current dialect. +With UPDATE, update cached package list." + (interactive "P") + (ess-install-library--override update package)) -(defun ess-install-library () - "Install library/package for current dialect. -Currently works only for R." - (interactive) - (cond - ((fboundp ess-install-library-function) - (funcall ess-install-library-function)) - (t - (error "Sorry, not available for %s" ess-dialect)))) +(cl-defgeneric ess-install-library--override (update package) + "See `ess-install-library' for UPDATE, PACKAGE." + (when update (message "Don't know how to update for %s" ess-dialect)) + (error "Cannot install %s, not available for %s" package ess-dialect)) -;;;*;;; Motion / manipulation commands +;; Motion / manipulation commands (defun ess-goto-beginning-of-function-or-para () "If inside a function go to the beginning of it. Otherwise go to the beginning of paragraph." (interactive) - (or (ess-beginning-of-function 'no-error) - (backward-paragraph)) - (point)) + (let ((pos (point)) + beg end) + (beginning-of-defun) + (setq beg (point)) + (end-of-defun) + (setq end (point)) + (goto-char beg) + (when (or (< beg pos) + (> end pos)) + (let ((par-pos (save-excursion + (goto-char pos) + (forward-comment most-negative-fixnum) + (backward-paragraph) + (forward-comment most-positive-fixnum) + (point)))) + (when (<= end par-pos) + (goto-char par-pos)))))) (defun ess-goto-end-of-function-or-para () "If inside a function go to end of it. Otherwise go to the end of paragraph." (interactive) - (or (ess-end-of-function nil 'no-error) - (forward-paragraph)) - (point)) + (let ((pos (point)) + beg end) + (end-of-defun) + (setq end (point)) + (beginning-of-defun) + (setq beg (point)) + (goto-char end) + (when (or (< beg pos) + (> end pos)) + (let ((par-pos (save-excursion + (goto-char pos) + (forward-comment most-positive-fixnum) + (forward-paragraph) + (point)))) + (when (<= par-pos beg) + (goto-char par-pos)))))) (defun ess-mark-function-or-para () "Put mark at end of ESS function, point at beginning." @@ -455,7 +412,6 @@ Otherwise go to the end of paragraph." If text is already narrowed, this is removed before narrowing to the current function." (interactive) - ;; if point is not in a function, ess-end-of-function catches the error. (save-excursion (widen) (let* ((beg (ess-goto-beginning-of-function-or-para)) @@ -464,15 +420,6 @@ current function." (define-obsolete-function-alias 'ess-narrow-to-defun 'ess-narrow-to-defun-or-para "15.09") -(defun ess-newline-and-indent () - "Like `newline-and-indent' but accounts for roxygen comments." - (interactive) - (cond ((and (fboundp 'ess-roxy-newline-and-indent) - (string= ess-dialect "R")) - (ess-roxy-newline-and-indent)) - (t - (newline-and-indent)))) - (defun ess-indent-new-comment-line () "Like `indent-new-comment-line' but accounts for roxygen comments." (interactive) @@ -482,8 +429,8 @@ current function." (t (indent-new-comment-line)))) - -;;;*;;; Formatting / indentation + +;;; Formatting / indentation (defun ess-set-style (&optional style quiet) "Set up the `ess-mode' style variables from the `ess-style' variable. @@ -495,7 +442,7 @@ suppresses messaging." (unless style (setq style (intern (ess-completing-read "Set ESS mode indentation style" - ess-styles nil t nil nil ess-default-style)))) + ess-styles nil t nil nil ess-style)))) (setq style (or style ess-style)) (make-local-variable 'ess-style) (if (memq (symbol-name style) ess-styles) @@ -511,8 +458,6 @@ suppresses messaging." (cdr (assq ess-style ess-style-alist))) ess-style)) -;; FIXME: Move into ess-indent-or-complete, indentation functions are overly -;; scattered around (defun ess-indent-command (&optional whole-exp) "Indent current line as ESS code, or in some cases insert a tab character. If `ess-tab-always-indent' is non-nil (the default), always indent @@ -521,39 +466,48 @@ the left margin or in the line's indentation; otherwise insert a tab. A numeric argument, regardless of its value, means indent rigidly all the lines of the expression starting after point so that this line becomes properly indented. The relative indentation among the lines -of the expression are preserved." +of the expression are preserved. + +If in a roxygen block at the beginning of the line with +`ess-roxy-hide-show-p' non-nil, call `ess-roxy-toggle-hiding' +instead of indenting." (interactive "P") - (if whole-exp - ;; If arg, always indent this line as S - ;; and shift remaining lines of expression the same amount. - (let ((shift-amt (ess-indent-line)) - beg end) - (save-excursion - (if ess-tab-always-indent - (beginning-of-line)) - (setq beg (point)) - (backward-up-list 1) - (forward-list 1) - (setq end (point)) - (goto-char beg) - (forward-line 1) - (setq beg (point))) - (if (> end beg) - (indent-code-rigidly beg end shift-amt))) - (if (and (not ess-tab-always-indent) - (save-excursion - (skip-chars-backward " \t") - (not (bolp)))) - (insert-tab) - ;; call ess-indent-line - (funcall indent-line-function)))) + (cond ((and (fboundp 'ess-roxy-entry-p) + (fboundp 'ess-roxy-toggle-hiding) + (bolp) + (ess-roxy-entry-p) + ess-roxy-hide-show-p) + (ess-roxy-toggle-hiding)) + (whole-exp + ;; If arg, always indent this line as S + ;; and shift remaining lines of expression the same amount. + (let ((shift-amt (ess-indent-line)) + beg end) + (save-excursion + (if ess-tab-always-indent + (beginning-of-line)) + (setq beg (point)) + (backward-up-list 1) + (forward-list 1) + (setq end (point)) + (goto-char beg) + (forward-line 1) + (setq beg (point))) + (if (> end beg) + (indent-code-rigidly beg end shift-amt)))) + ((and (not ess-tab-always-indent) + (save-excursion + (skip-chars-backward " \t") + (not (bolp)))) + (insert-tab)) + ;; call ess-indent-line + (t (funcall indent-line-function)))) (defun ess-indent-or-complete () "When region is selected indent the region. Otherwise, if `ess-tab-complete-in-script' is non-nil, try to -indent, if code is already indented, complete instead. - -The default of `ess-tab-complete-in-script' is nil. Also see +indent, if code is already indented, complete instead. The +default of `ess-tab-complete-in-script' is nil. Also see `ess-first-tab-never-complete'." (interactive) (if (use-region-p) @@ -600,7 +554,8 @@ Return the amount the indentation changed by." (t (funcall indent-line-function)))) -;;*;; Creating and manipulating dump buffers +;;; Dump Objects + ;;;###autoload (defun ess-dump-object-into-edit-buffer (object) "Edit an ESS OBJECT in its own buffer. @@ -612,7 +567,6 @@ generate the source buffer." (progn (ess-force-buffer-current "Process to dump from: ") (ess-read-object-name "Object to edit"))) - (let* ((dirname (file-name-as-directory (if (stringp ess-source-directory) ess-source-directory @@ -622,20 +576,17 @@ generate the source buffer." (apply ess-source-directory nil))))) (filename (concat dirname (format ess-dump-filename-template object))) (old-buff (get-file-buffer filename))) - ;; If the directory doesn't exist, offer to create it (if (file-exists-p (directory-file-name dirname)) nil (if (y-or-n-p ; Approved (format "Directory %s does not exist. Create it? " dirname)) (make-directory (directory-file-name dirname)) (error "Directory %s does not exist" dirname))) - ;; Three options: ;; (1) Pop to an existing buffer containing the file in question ;; (2) Find an existing file ;; (3) Create a new file by issuing a dump() command to S ;; Force option (3) if there is a prefix arg - (if current-prefix-arg (ess-dump-object object filename) (if old-buff @@ -650,59 +601,47 @@ generate the source buffer." ;; No buffer and no file (ess-dump-object object filename)))))) -(ess-defgeneric ess-dump-object (object filename) +(defun ess-dump-object (object filename) "Dump the ESS object OBJECT into file FILENAME." - (let ((complete-dump-command (format inferior-ess-dump-command - object filename))) - (if (file-writable-p filename) nil - (error "Can't dump %s as %f is not writeable" object filename)) - - (:override - ;; Make sure we start fresh - (when (get-file-buffer filename) - (kill-buffer (get-file-buffer filename))) - - (ess-command complete-dump-command) - (message "Dumped in %s" filename) - - (ess-find-dump-file-other-window filename) - - ;; PD, 1Apr97 - ;;This ensures that the object gets indented according to ess-mode, - ;;not as the R/S deparser does it. At the same time, it gets rid - ;;of the mess generated by sending TAB characters to the readline - ;;functions in R when you eval-buffer-*. - (indent-region (point-min-marker) (point-max-marker) nil) - (set-buffer-modified-p nil) ; no need to safe just because of indenting - - ;; Don't make backups for temporary files; it only causes clutter. - ;; The ESS object itself is a kind of backup, anyway. - (unless ess-keep-dump-files - (make-local-variable 'make-backup-files) - (setq make-backup-files nil)) - - ;; Don't get confirmation to delete dumped files when loading - (when (eq ess-keep-dump-files 'check) - (setq ess-keep-dump-files nil)) - - ;; Delete the file if necessary - (when ess-delete-dump-files - (delete-file (buffer-file-name)))))) + (unless (file-writable-p filename) + (error "Can't dump %s as %f is not writeable" object filename)) + (let ((dump-cmd (format inferior-ess-dump-command object filename))) + ;; Make sure we start fresh + (when (get-file-buffer filename) + (kill-buffer (get-file-buffer filename))) + (ess-command dump-cmd) + (message "Dumped in %s" filename) + (ess-find-dump-file-other-window filename) + ;; PD, 1Apr97 + ;;This ensures that the object gets indented according to ess-mode, + ;;not as the R/S deparser does it. At the same time, it gets rid + ;;of the mess generated by sending TAB characters to the readline + ;;functions in R when you eval-buffer-*. + (indent-region (point-min-marker) (point-max-marker) nil) + (set-buffer-modified-p nil) ; no need to safe just because of indenting + ;; Don't make backups for temporary files; it only causes clutter. + ;; The ESS object itself is a kind of backup, anyway. + (unless ess-keep-dump-files + (make-local-variable 'make-backup-files) + (setq make-backup-files nil)) + ;; Don't get confirmation to delete dumped files when loading + (when (eq ess-keep-dump-files 'check) + (setq ess-keep-dump-files nil)) + ;; Delete the file if necessary + (when ess-delete-dump-files + (delete-file (buffer-file-name))))) (defun ess-find-dump-file-other-window (filename) "Find ESS source file FILENAME in another window." - (if (file-exists-p filename) nil (ess-write-to-dribble-buffer (format "%s does not exist. Bad dump, starting fresh." filename))) - ;; Generate a buffer with the dumped data (find-file-other-window filename) - (ess-mode ess-customize-alist) - + (setq-local ess-local-customize-alist ess-customize-alist) + (ess-mode) (auto-save-mode 1) ; Auto save in this buffer (setq ess-local-process-name ess-current-process-name) - (if ess-function-template (progn (goto-char (point-max)) @@ -716,14 +655,18 @@ generate the source buffer." (down-list 1) (error nil))))))) + + +;;; Runners + (defun ess-define-runner (name dialect &optional path) "Create a function NAME. This function starts the inferior process with the specified version. DIALECT can be \"R,\" \"S,\", \"SAS.\" If given, PATH should be the absolute path to the program. It defaults to NAME." - (lexical-let ((name name) - (dialect dialect) - (path path)) + (let ((name name) + (dialect dialect) + (path path)) (fset (intern name) (lambda (&optional start-args) "Start this process version in an inferior ESS buffer. @@ -741,49 +684,9 @@ Function defined using `ess-define-runner'." (let ((inferior-SAS-program (or path name))) (require 'ess-sas-d) (SAS)))))))) -;;;###autoload -(defun ess-version () - "Return a string with ESS version information." - (interactive) - (message (format "ess-version: %s (loaded from %s)" - (ess-version-string) - (file-name-directory ess-lisp-directory)))) - -(defun ess-version-string () - (let* ((ess-dir (file-name-directory ess-lisp-directory)) ; if() the top-level 'ess/' - (is-release (file-exists-p (concat ess-etc-directory ".IS.RELEASE"))) - (rel-string (if is-release "Released ")) - (git-ref-fn (concat ess-dir ".git/HEAD")) - (git-ref (when (file-exists-p git-ref-fn) - (with-current-buffer (find-file-noselect git-ref-fn) - (goto-char (point-min)) - (when (re-search-forward "ref: \\(.*\\)\n" nil t) - (match-string 1))))) - (git-fname (if git-ref - (concat ess-dir ".git/" git-ref) - ;; For release - (concat ess-etc-directory "git-ref"))) - (git-rev (when (file-exists-p git-fname) - (with-current-buffer (find-file-noselect git-fname) - (goto-char (point-min)) - (concat "git: "(buffer-substring 1 (point-at-eol)))))) - (elpa-fname (concat ess-dir "ess-pkg.el")) - (elpa-rev (when (file-exists-p elpa-fname) - ;; Get it from ELPA dir name, (probably won't work if installed manually) - (concat "elpa: " - (replace-regexp-in-string "ess-" "" - (file-name-nondirectory - (substring ess-dir 1 -1))))))) - ;; Set the "global" ess-revision: - (setq ess-revision (format "%s%s%s" - (or rel-string "") - (or git-rev "") - (or elpa-rev ""))) - (when (string= ess-revision "") - (setq ess-revision "")) - (concat ess-version " [" ess-revision "]"))) - - -(provide 'ess) - -;;; ess.el ends here + + + +(provide 'ess-mode) + +;;; ess-mode.el ends here diff --git a/elpa/ess-20181109.703/ess-mouse.el b/elpa/ess-20190121.1430/ess-mouse.el similarity index 86% rename from elpa/ess-20181109.703/ess-mouse.el rename to elpa/ess-20190121.1430/ess-mouse.el index a33e5322..88e877f5 100644 --- a/elpa/ess-20181109.703/ess-mouse.el +++ b/elpa/ess-20190121.1430/ess-mouse.el @@ -37,7 +37,6 @@ ;;*;; Requires (require 'mouseme) -(require 'ess-dde) (require 'ess-trns) ;;(if (or (equal window-system 'w32) ;; (equal window-system 'win32) @@ -117,7 +116,7 @@ "----" ("Browser on" . ess-mouse-me-browser-on) ("Browser off" . ess-mouse-me-browser-off)) - "*Command menu used by `mouse-me-build-menu'. + "Command menu used by `mouse-me-build-menu'. A alist of elements where each element is either a cons cell or a string. If a cons cell the car is a string to be displayed in the menu and the cdr is either a function to call passing a string to, or a list which evals @@ -138,15 +137,15 @@ the symbol `string' it will be called with one string argument." (ess-mouse-me-eval-expanded string "Edit.data(" ")" nil nil nil)) (defun ess-mouse-me-print (string) - (ess-mouse-me-eval-expanded string "" "" nil (ess-ddeclient-p) t)) + (ess-mouse-me-eval-expanded string "" "" nil nil t)) (defun ess-mouse-me-summary (string) - (ess-mouse-me-eval-expanded string "summary(" ")" nil (ess-ddeclient-p) t)) + (ess-mouse-me-eval-expanded string "summary(" ")" nil nil t)) (defun ess-mouse-me-plot (string) (ess-mouse-me-eval-expanded string "plot(" ")") nil nil nil) (defun ess-mouse-me-show (string) (ess-mouse-me-eval-expanded string "show(" ")") nil nil nil) (defun ess-mouse-me-args (string) - (ess-mouse-me-eval-expanded string "args(" ")" nil (ess-ddeclient-p) t)) + (ess-mouse-me-eval-expanded string "args(" ")" nil nil t)) (defun ess-mouse-me-browser-on (string) (if (equal (substring ess-dialect 0 1) "R") @@ -164,9 +163,9 @@ the symbol `string' it will be called with one string argument." page value-returned) "Send the expanded STRING to the inferior-ess process using `ess-command' after first concating the HEAD and TAIL. Put answer in COMMANDS-BUFFER if -specified and not using ddeclient, otherwise in \"tmp-buffer\". In either +specified, otherwise in \"tmp-buffer\". In either case the buffer containing the answer is renamed to the value of the -constructed command. If PAGE is non-nil and using ddeclient, expand +constructed command. If PAGE is non-nil, expand the string one more time by embedding it in a \"page()\" command." (interactive) (let* (scommand @@ -179,29 +178,18 @@ the string one more time by embedding it in a \"page()\" command." (get-buffer-create "tmp-buffer"))) (setq scommand (concat head string tail)) - (if (ess-ddeclient-p) - (progn - (setq page-scommand (if page - (concat "page(" scommand ")") - scommand)) - (set-buffer-file-coding-system 'undecided-dos) - (ess-command page-scommand commands-buffer) - (if (not value-returned) - nil - (sleep-for 2) - (switch-to-buffer (car (buffer-list))))) - (ess-make-buffer-current) - (switch-to-buffer commands-buffer) - (ess-setq-vars-local (eval ess-mouse-customize-alist) (current-buffer)) - (setq ess-local-process-name lproc-name) - (ess-command (concat scommand "\n") commands-buffer) - (if (not value-returned) (switch-to-buffer (nth 1 (buffer-list))))) + (ess-make-buffer-current) + (pop-to-buffer-same-window commands-buffer) + (ess-setq-vars-local (eval ess-mouse-customize-alist) (current-buffer)) + (setq ess-local-process-name lproc-name) + (ess-command (concat scommand "\n") commands-buffer) + (if (not value-returned) (pop-to-buffer-same-window (nth 1 (buffer-list)))) (if (not value-returned) nil (if ess-microsoft-p ;; there ought to be a filter (while (search-forward "\r" nil t) ;; function to keep the ^M (replace-match "" nil t))) ;; from showing up at all - (ess-transcript-mode (eval ess-mouse-customize-alist)) + (ess-transcript-mode) (setq ess-local-process-name lproc-name) (rename-buffer scommand)))) diff --git a/elpa/ess-20181109.703/ess-pkg.el b/elpa/ess-20190121.1430/ess-pkg.el similarity index 77% rename from elpa/ess-20181109.703/ess-pkg.el rename to elpa/ess-20190121.1430/ess-pkg.el index 5555b949..b78a11f6 100644 --- a/elpa/ess-20181109.703/ess-pkg.el +++ b/elpa/ess-20190121.1430/ess-pkg.el @@ -1,5 +1,6 @@ -(define-package "ess" "20181109.703" "Emacs Speaks Statistics" - '((julia-mode "0.3")) +(define-package "ess" "20190121.1430" "Emacs Speaks Statistics" + '((emacs "25.1") + (julia-mode "0.3")) :authors '(("David Smith" . "dsmith@stats.adelaide.edu.au") ("A.J. Rossini" . "blindglobe@gmail.com") @@ -14,7 +15,8 @@ ("Lionel Henry" . "lionel.hry@gmail.com") ("J. Alexander Branham" . "alex.branham@gmail.com")) :maintainer - '("ESS Core Team" . "ESS-core@r-project.org")) + '("ESS Core Team" . "ESS-core@r-project.org") + :url "https://ess.r-project.org/") ;; Local Variables: ;; no-byte-compile: t ;; End: diff --git a/elpa/ess-20181109.703/ess-r-a.el b/elpa/ess-20190121.1430/ess-r-a.el similarity index 100% rename from elpa/ess-20181109.703/ess-r-a.el rename to elpa/ess-20190121.1430/ess-r-a.el diff --git a/elpa/ess-20181109.703/ess-r-completion.el b/elpa/ess-20190121.1430/ess-r-completion.el similarity index 98% rename from elpa/ess-20181109.703/ess-r-completion.el rename to elpa/ess-20190121.1430/ess-r-completion.el index 55080a20..42ae394e 100644 --- a/elpa/ess-20181109.703/ess-r-completion.el +++ b/elpa/ess-20190121.1430/ess-r-completion.el @@ -1,4 +1,4 @@ -;;; ess-r-completion.el --- R completion +;;; ess-r-completion.el --- R completion -*- lexical-binding: t; -*- ;; ;; Copyright (C) 2015 A.J. Rossini, Richard M. Heiberger, Martin Maechler, Kurt ;; Hornik, Rodney Sparapani, Stephen Eglen and Vitalie Spinu. @@ -86,8 +86,7 @@ to look up any doc strings." ;; Subtract 1 from window width since will cause a wraparound and ;; resize of the echo area. (W (1- (- (window-width (minibuffer-window)) - (+ 2 (length funname))))) - newdoc) + (+ 2 (length funname)))))) (setq doc (if (or (<= (length doc) W) (null ess-eldoc-abbreviation-style) @@ -277,7 +276,7 @@ To be used instead of ESS' completion engine for R versions >= 2.7.0." (defvar ess--cached-sp-objects nil) -(defun ess--get-cached-completions (prefix &optional point) +(defun ess--get-cached-completions (prefix &optional _point) (if (string-match-p "[]:$@[]" prefix) ;; call proc for objects (cdr (ess-r-get-rcompletions nil nil prefix)) @@ -302,7 +301,7 @@ To be used instead of ESS' completion engine for R versions >= 2.7.0." ;; reread new package, but not rda, much faster and not needed anyways (process-put *proc* 'sp-for-ac-changed? nil))) (apply 'append - (cddar ess-sl-modtime-alist) ; .GlobalEnv + (cl-cddar ess-sl-modtime-alist) ; .GlobalEnv (mapcar 'cddr ess--cached-sp-objects))))) @@ -311,7 +310,7 @@ To be used instead of ESS' completion engine for R versions >= 2.7.0." (define-obsolete-variable-alias 'ess-ac-R-argument-suffix 'ess-R-argument-suffix "15.3") (defcustom ess-R-argument-suffix " = " "Suffix appended by `ac-source-R' and `ac-source-R-args' to candidates." - :group 'R + :group 'ess-R :type 'string) (defvar ess-r--funargs-pre-cache @@ -348,7 +347,7 @@ To be used instead of ESS' completion engine for R versions >= 2.7.0." (setq sym (match-string 1 sym))) (with-current-buffer (process-buffer proc) (ess-with-current-buffer buf - (ess--flush-help-into-current-buffer sym nil t))) + (ess--flush-help-into-current-buffer sym nil))) (with-current-buffer buf (ess-help-underline) (goto-char (point-min)) @@ -434,7 +433,7 @@ packages are installed." (interactive (list 'interactive)) (cl-case command (interactive (company-begin-backend 'company-R-library)) - (prefix (and (member (car (ess--fn-name-start 'symbol)) + (prefix (and (member (car (ess--fn-name-start)) '("library" "require")) (let ((start (ess-symbol-start))) (and start (buffer-substring start (point)))))) diff --git a/elpa/ess-20181109.703/ess-r-flymake.el b/elpa/ess-20190121.1430/ess-r-flymake.el similarity index 95% rename from elpa/ess-20181109.703/ess-r-flymake.el rename to elpa/ess-20190121.1430/ess-r-flymake.el index 71b01f0d..0e70f629 100644 --- a/elpa/ess-20181109.703/ess-r-flymake.el +++ b/elpa/ess-20190121.1430/ess-r-flymake.el @@ -24,7 +24,7 @@ ;;; Commentary: ;; ;; Flymake is the built-in Emacs package that supports on-the-fly -;; syntax checking. This file adds support for this in R-mode by +;; syntax checking. This file adds support for this in ess-r-mode by ;; relying on the lintr package, available on CRAN and currently ;; hosted at https://github.com/jimhester/lintr. ;; @@ -36,8 +36,13 @@ (require 'ess-custom) (require 'ess-inf) (require 'flymake) -;; TODO: When remove support for Emacs 24, remove the nil t: -(require 'project nil t) +(require 'project) + +;; Appease the byte compiler for Emacs 25. Remove after dropping +;; support for Emacs 25. +(declare-function flymake-diag-region "flymake") +(declare-function flymake-make-diagnostic "flymake") +(declare-function flymake--overlays "flymake") (defcustom ess-r-flymake-linters '("closed_curly_linter = NULL" @@ -81,7 +86,7 @@ each element is passed as argument to 'lintr::with_defaults'." if (!suppressWarnings(require(lintr, quietly=T))) { cat('@@error: @@`lintr` package not installed') } else { - if (packageVersion('lintr') <= '1.0.2') { + if (packageVersion('lintr') <= '1.0.3') { cat('@@error: @@Need `lintr` version > v1.0.2') } else { tryCatch(lintr::lint(commandArgs(TRUE), ...), @@ -102,8 +107,7 @@ the user's home directory. Return nil if we couldn't find a .lintr file." ;; Project root ((and (fboundp 'ess-r-package-project) (ess-r-package-project)) (expand-file-name ".lintr" (cdr (ess-r-package-project)))) - ((and (fboundp 'project-roots) ; checking that project-roots is defined can be removed when drop Emacs 24 - (project-current) + ((and (project-current) (project-roots (project-current))) (expand-file-name ".lintr" (car (project-roots (project-current))))) ;; Home directory diff --git a/elpa/ess-20181109.703/ess-r-mode.el b/elpa/ess-20190121.1430/ess-r-mode.el similarity index 84% rename from elpa/ess-20181109.703/ess-r-mode.el rename to elpa/ess-20190121.1430/ess-r-mode.el index 4016a8c4..c8b9dae8 100644 --- a/elpa/ess-20181109.703/ess-r-mode.el +++ b/elpa/ess-20190121.1430/ess-r-mode.el @@ -33,10 +33,13 @@ ;;; Code: +(eval-when-compile + (require 'subr-x)) (require 'cl-lib) (require 'compile) (require 'easymenu) (require 'eldoc) +(require 'seq) (require 'ess-mode) (require 'ess-help) (require 'ess-s-lang) @@ -45,11 +48,12 @@ (require 'ess-r-syntax) (require 'ess-r-package) (require 'ess-trns) -(when (>= emacs-major-version 25) (require 'ess-r-xref)) ;; Xref API was added in Emacs 25.1 -;; TODO: Remove when we drop support for Emacs 24: -(declare-function ess-r-xref-backend "ess-r-xref") +(require 'ess-r-xref) (when (>= emacs-major-version 26) (require 'ess-r-flymake)) ; Flymake rewrite in Emacs 26 +;; Silence the byte compiler +(defvar add-log-current-defun-header-regexp) + ;; TODO: Refactor so as to not rely on dynamic scoping. After that ;; refactor, also remove the file-local-variable byte-compile-warnings ;; (not lexical) at the bottom. @@ -217,31 +221,23 @@ (easy-menu-add-item inferior-ess-mode-menu nil ess-r-package-menu "end-dev") (easy-menu-add-item inferior-ess-mode-menu nil ess-tracebug-menu "end-dev") +(defvar ess-r-mode-syntax-table + (let ((table (copy-syntax-table S-syntax-table))) + ;; Letting Emacs treat backquoted names and %ops% as strings solves + ;; many problems with regard to nested strings and quotes + (modify-syntax-entry ?` "\"" table) + (modify-syntax-entry ?% "\"" table) + ;; Underscore is valid in R symbols + (modify-syntax-entry ?_ "_" table) + (modify-syntax-entry ?: "." table) + (modify-syntax-entry ?@ "." table) + (modify-syntax-entry ?$ "." table) + table) + "Syntax table for `ess-r-mode'.") -;; Inherit from the S syntax table: -(defvar ess-r-syntax-table (copy-syntax-table S-syntax-table)) - -;; Letting Emacs treat backquoted names and %ops% as strings solves -;; many problems with regard to nested strings and quotes -(modify-syntax-entry ?` "\"" ess-r-syntax-table) -(modify-syntax-entry ?% "\"" ess-r-syntax-table) - -;; Underscore is valid in R symbols -(modify-syntax-entry ?_ "_" ess-r-syntax-table) -(modify-syntax-entry ?: "." ess-r-syntax-table) -(modify-syntax-entry ?@ "." ess-r-syntax-table) -(modify-syntax-entry ?$ "." ess-r-syntax-table) - -;; TOTHINK: Prevent string delimiting characters from messing up output in the -;; inferior buffer -(defvar inferior-ess-r-syntax-table (copy-syntax-table ess-r-syntax-table)) -(modify-syntax-entry ?\' "." inferior-ess-r-syntax-table) -;; (modify-syntax-entry ?\" "." inferior-ess-r-syntax-table) -;; (modify-syntax-entry ?` "." inferior-ess-r-syntax-table) -(modify-syntax-entry ?% "." inferior-ess-r-syntax-table) (defvar ess-r-completion-syntax-table - (let ((table (make-syntax-table ess-r-syntax-table))) + (let ((table (copy-syntax-table ess-r-mode-syntax-table))) (modify-syntax-entry ?. "_" table) (modify-syntax-entry ?: "_" table) (modify-syntax-entry ?$ "_" table) @@ -340,25 +336,13 @@ To be used as part of `font-lock-defaults' keywords." '((ess-local-customize-alist . 'ess-r-customize-alist) (ess-dialect . "R") (ess-suffix . "R") - (ess-ac-sources . ess-r-ac-sources) - (ess-company-backends . ess-r-company-backends) - (ess-build-tags-command . ess-r-build-tags-command) (ess-traceback-command . ess-r-traceback-command) (ess-call-stack-command . ess-r-call-stack-command) (ess-mode-completion-syntax-table . ess-r-completion-syntax-table) (ess-build-eval-message-function . #'ess-r-build-eval-message) - (ess-format-eval-command-function . #'ess-r-format-eval-command) - (ess-format-load-command-function . #'ess-r-format-load-command) - (ess-send-region-function . #'ess-r-send-region) - (ess-load-file-function . #'ess-r-load-file) - (ess-make-source-refd-command-function . #'ess-r-make-source-refd-command) - (ess-format-eval-message-function . #'ess-r-format-eval-message) - (ess-install-library-function . #'ess-r-install-library) - (ess-eldoc-function . #'ess-r-eldoc-function) (ess-help-web-search-command . #'ess-r-sos) (ess-build-help-command-function . #'ess-r-build-help-command) (ess-dump-filename-template . ess-r-dump-filename-template) - (ess-mode-editing-alist . ess-r-editing-alist) (ess-change-sp-regexp . ess-r-change-sp-regexp) (ess-help-sec-regex . ess-help-r-sec-regex) (ess-help-sec-keys-alist . ess-help-r-sec-keys-alist) @@ -369,31 +353,18 @@ To be used as part of `font-lock-defaults' keywords." (inferior-ess-objects-command . inferior-ess-r-objects-command) (inferior-ess-search-list-command . "search()\n") (inferior-ess-help-command . inferior-ess-r-help-command) - (inferior-ess-help-filetype . nil) (inferior-ess-exit-command . "q()") - (inferior-ess-exit-prompt . "Save workspace image? [y/n/c]: ") - (inferior-ess-start-file . nil) (inferior-ess-start-args . "") - (inferior-ess-mode-syntax-table . inferior-ess-r-syntax-table) (ess-error-regexp-alist . ess-r-error-regexp-alist) (ess-describe-object-at-point-commands . 'ess-r-describe-object-at-point-commands) (ess-STERM . "iESS") (ess-editor . ess-r-editor) - (ess-pager . ess-r-pager) - (ess-mode-syntax-table . ess-r-syntax-table) - (font-lock-syntactic-face-function . #'ess-r-font-lock-syntactic-face-function) - (prettify-symbols-alist . ess-r-prettify-symbols)) + (ess-pager . ess-r-pager)) S-common-cust-alist) - "Variables to customize for R -- set up later than Emacs initialization.") + "Variables to customize for R.") -;; VS[24-08-2018]: FIXME: make initialization of custom-alist tail-to-top and -;; put this into the above alist -(setcdr (assoc 'ess-font-lock-keywords ess-r-customize-alist) - (quote 'ess-R-font-lock-keywords)) -(setcdr (assoc 'inferior-ess-font-lock-keywords ess-r-customize-alist) - (quote 'inferior-ess-r-font-lock-keywords)) - -(defvar ess-r-build-tags-command +(cl-defmethod ess-build-tags-command (&context ((string= ess-dialect "R") (eql t))) + "Return tags command for R." "rtags('%s', recursive = TRUE, pattern = '\\\\.[RrSs](rw)?$',ofile = '%s')") (defvar ess-r-traceback-command @@ -413,14 +384,6 @@ fill=TRUE); try(traceback(), silent=TRUE)})\n") (defvar ess-r-company-backends '((company-R-library company-R-args company-R-objects :separate))) -(defvar ess-r-editing-alist - ;; copy the S-alist and modify : - (let ((S-alist (copy-alist S-editing-alist))) - (setcdr (assoc 'ess-mode-syntax-table S-alist) - (quote ess-r-syntax-table)) - S-alist) - "General options for editing R source files.") - (defconst ess-help-r-sec-regex "^[A-Z][A-Za-z].+:$" "Reg(ular) Ex(pression) of section headers in help file.") @@ -481,7 +444,7 @@ file \"R-1.8.1\" is found and this variable includes the string version of R. If duplicate versions of the same program are found (which happens if the same path is listed on `exec-path' more than once), they are -ignored by calling `ess-uniq-list'. +ignored by calling `delete-dups'. Set this variable to nil to disable searching for other versions of R. If you set this variable, you need to restart Emacs (and set this variable before ess-site is loaded) for it to take effect.") @@ -497,13 +460,6 @@ before ess-site is loaded) for it to take effect.") (defvar ess-r-post-run-hook nil "Functions run in process buffer after the initialization of R process.") -(defun ess-r-mode-p () - "Check whether we have a buffer running in R mode. - -This is to get around the lack of proper derived modes in ESS." - (and (eq major-mode 'ess-mode) - (string= ess-dialect "R"))) - ;;;###autoload (defun run-ess-r (&optional start-args) "Call 'R', the 'GNU S' system from the R Foundation. @@ -564,8 +520,7 @@ will be prompted to enter arguments interactively." (remove-hook 'completion-at-point-functions 'ess-filename-completion 'local) ;; should be first (add-hook 'completion-at-point-functions 'ess-r-object-completion nil 'local) (add-hook 'completion-at-point-functions 'ess-filename-completion nil 'local) - (when (>= emacs-major-version 25) - (add-hook 'xref-backend-functions #'ess-r-xref-backend nil 'local)) + (add-hook 'xref-backend-functions #'ess-r-xref-backend nil 'local) (setq comint-input-sender 'inferior-ess-r-input-sender) (if gdbp @@ -615,64 +570,126 @@ Executed in process buffer." (inferior-ess-r-load-ESSR) (when inferior-ess-language-start (ess-command (concat inferior-ess-language-start "\n"))) + ;; tracebug + (when ess-use-tracebug (ess-tracebug 1)) (with-ess-process-buffer nil (add-hook 'ess-presend-filter-functions 'ess-R-scan-for-library-call nil 'local) (run-mode-hooks 'ess-r-post-run-hook))) +(defun ess-r--skip-function () + ;; Assumes the point is at function start + (if (looking-at-p ess-r-set-function-start) + (forward-list 1) ; get over the entire setXyz(...) + (forward-list 1) ; get over arguments + (if (looking-at-p "[ \t\n]*{") + (forward-sexp 1) ;; move over {...} + ;; {..}-less case + (skip-chars-forward " \t\n") + (goto-char (cadr (ess-continuations-bounds)))))) + +(defun ess-r-beginning-of-function (&optional arg) + "Leave (and return) the point at the beginning of the current ESS function. +When ARG is positive, search for beginning of function backward, +otherwise forward. Value of ARG is currently ignored. Return the +new position." + (interactive) + (setq arg (or arg 1)) + (let ((init-point (point)) + done) + ;; ;; in case we are at the start of a function, skip past new lines + (when (> arg 0) + (skip-chars-backward " \t\n")) + ;; start search from eol to capture current function start + (end-of-line 1) + (while (and (not done) + (re-search-backward ess-function-pattern nil t arg)) + (unless (ess-inside-string-or-comment-p) + ;; capture top level forms only + (when (= (car (syntax-ppss (match-beginning 0))) 0) + (setq done t)))) + (if done + (point) + (goto-char init-point)))) + +(defun ess-r-end-of-function (&optional arg) + "Leave the point at the end of the current function. +When ARG is positive, search for end of function forward, +otherwise backward. Value of ARG is currently ignored. Return the +new position." + (interactive) + (setq arg (or arg 1)) + (let* ((start-pos (point)) + (search-fn (lambda () + (let ((foundp nil)) + (while (and (not foundp) + (re-search-forward ess-r-function-pattern nil t)) + (setq foundp (not (ess-inside-string-or-comment-p)))) + (if foundp + (progn (goto-char (match-beginning 0)) + (ess-r--skip-function)) + (goto-char start-pos)))))) + (ess-r-beginning-of-function) + (if (< (point) start-pos) + ;; Moved back. We were either inside a function or after a function. + (progn + (ess-r--skip-function) + (when (and (> arg 0) + (<= (point) start-pos)) + (funcall search-fn))) + (funcall search-fn)) + (point))) + ;;;###autoload -(defun R-mode (&optional proc-name) +(define-derived-mode ess-r-mode ess-mode "ESS[R]" "Major mode for editing R source. See `ess-mode' for more help." - (interactive "P") - (setq ess-customize-alist ess-r-customize-alist) - ;;(setq imenu-generic-expression R-imenu-generic-expression) - (ess-mode ess-r-customize-alist proc-name) - ;; for emacs >= 24 + (ess-setq-vars-local ess-r-customize-alist) + (setq-local ess-font-lock-keywords 'ess-R-font-lock-keywords) + (setq-local paragraph-start (concat "\\s-*$\\|" page-delimiter)) + (setq-local paragraph-separate (concat "\\s-*$\\|" page-delimiter)) + (setq-local paragraph-ignore-fill-prefix t) + (setq-local indent-line-function 'ess-indent-line) + (setq-local comment-indent-function #'ess-calculate-indent) + (setq-local add-log-current-defun-header-regexp "^\\(.+\\)\\s-+<-[ \t\n]*function") + (setq-local font-lock-syntactic-face-function #'ess-r-font-lock-syntactic-face-function) + ;; eldoc + (add-function :before-until (local 'eldoc-documentation-function) + #'ess-r-eldoc-function) + (when ess-use-eldoc (eldoc-mode)) + ;; auto-complete + (ess--setup-auto-complete ess-r-ac-sources) + ;; company + (ess--setup-company ess-r-company-backends) + (setq-local prettify-symbols-alist ess-r-prettify-symbols) + (setq font-lock-defaults '(ess-build-font-lock-keywords nil nil ((?\. . "w") (?\_ . "w")))) (remove-hook 'completion-at-point-functions 'ess-filename-completion 'local) ;; should be first (add-hook 'completion-at-point-functions 'ess-r-object-completion nil 'local) (add-hook 'completion-at-point-functions 'ess-filename-completion nil 'local) - (when (>= emacs-major-version 25) - (add-hook 'xref-backend-functions #'ess-r-xref-backend nil 'local)) + (add-hook 'xref-backend-functions #'ess-r-xref-backend nil 'local) (if (fboundp 'ess-add-toolbar) (ess-add-toolbar)) + ;; imenu is needed for `which-function' + (setq imenu-generic-expression ess-imenu-S-generic-expression) (when ess-imenu-use-S - (setq imenu-generic-expression ess-imenu-S-generic-expression) (imenu-add-to-menubar "Imenu-R")) - - ;; useful for swankr/slime: - (set (make-local-variable 'beginning-of-defun-function) - (lambda (&optional arg) - (skip-chars-backward " \t\n") - (ess-beginning-of-function 'no-error))) - (set (make-local-variable 'end-of-defun-function) - 'ess-end-of-function) - - (ess-roxy-mode t) - (ad-activate 'fill-paragraph) - (ad-activate 'move-beginning-of-line) - (ad-activate 'back-to-indentation) - (ad-activate 'ess-eval-line-and-step) - - ;; FIXME: Why advice our own function? - (when ess-roxy-hide-show-p - (ad-activate 'ess-indent-command)) - - (run-mode-hooks 'R-mode-hook)) - + (setq-local beginning-of-defun-function #'ess-r-beginning-of-function) + (setq-local end-of-defun-function #'ess-r-end-of-function) + (ess-roxy-mode)) ;;;###autoload -(defalias 'r-mode #'R-mode) +(defalias 'R-mode 'ess-r-mode) ;;;###autoload -(defalias 'ess-r-mode #'R-mode) +(defalias 'r-mode 'ess-r-mode) + ;;;###autoload -(add-to-list 'auto-mode-alist '("/R/.*\\.q\\'" . R-mode)) +(add-to-list 'auto-mode-alist '("/R/.*\\.q\\'" . ess-r-mode)) ;;;###autoload -(add-to-list 'auto-mode-alist '("\\.[rR]\\'" . R-mode)) +(add-to-list 'auto-mode-alist '("\\.[rR]\\'" . ess-r-mode)) ;;;###autoload -(add-to-list 'auto-mode-alist '("\\.[rR]profile\\'" . R-mode)) +(add-to-list 'auto-mode-alist '("\\.[rR]profile\\'" . ess-r-mode)) ;;;###autoload -(add-to-list 'auto-mode-alist '("NAMESPACE\\'" . R-mode)) +(add-to-list 'auto-mode-alist '("NAMESPACE\\'" . ess-r-mode)) ;;;###autoload -(add-to-list 'auto-mode-alist '("CITATION\\'" . R-mode)) +(add-to-list 'auto-mode-alist '("CITATION\\'" . ess-r-mode)) ;;*;; Miscellaneous @@ -723,24 +740,24 @@ as `ess-r-created-runners' upon ESS initialization." (if ess-microsoft-p (mapcar (lambda (v) (car (ess-rterm-arch-version v 'give-cons))) ess-rterm-version-paths) - (ess-uniq-list + (delete-dups (mapcar #'file-name-nondirectory (apply #'nconc (mapcar #'ess-find-exec-completions ess-r-versions))))))) ;; Iterate over each string in VERSIONS, creating a new defun each time. (setq ess-r-created-runners versions) - (if ess-microsoft-p - (cl-mapcar (lambda (v p) (ess-define-runner v "R" p)) versions ess-rterm-version-paths) - (mapc (lambda (v) (ess-define-runner v "R")) versions)) - ;; Add to menu - (when ess-r-created-runners - ;; new-menu will be a list of 3-vectors, of the form: - ;; ["R-1.8.1" R-1.8.1 t] - (let ((new-menu (mapcar (lambda(x) (vector x (intern x) t)) - ess-r-created-runners))) - (easy-menu-add-item ess-mode-menu '("Start Process") - (cons "Other" new-menu))))))) + (if ess-microsoft-p + (cl-mapcar (lambda (v p) (ess-define-runner v "R" p)) versions ess-rterm-version-paths) + (mapc (lambda (v) (ess-define-runner v "R")) versions)) + ;; Add to menu + (when ess-r-created-runners + ;; new-menu will be a list of 3-vectors, of the form: + ;; ["R-1.8.1" R-1.8.1 t] + (let ((new-menu (mapcar (lambda(x) (vector x (intern x) t)) + ess-r-created-runners))) + (easy-menu-add-item ess-mode-menu '("Start Process") + (cons "Other" new-menu))))))) (define-obsolete-function-alias 'ess-r-versions-create 'ess-r-define-runners "ESS 18.10") @@ -763,15 +780,15 @@ Return the list of candidates for being `R-newest'. Filtering is done iff `ess-prefer-higher-bit' is non-nil. This is used only by Windows when running `ess-find-newest-R'." (if ess-prefer-higher-bit - ;; filter out 32 bit elements - (let ((filtered - (delq nil - (mapcar (lambda (x) (unless (string-match "/i386/Rterm.exe" x) x)) - ess-rterm-version-paths)))) - (if (null filtered) - ;; if none survived filtering, keep the original list - ess-rterm-version-paths - filtered)) + ;; filter out 32 bit elements + (let ((filtered + (delq nil + (mapcar (lambda (x) (unless (string-match "/i386/Rterm.exe" x) x)) + ess-rterm-version-paths)))) + (if (null filtered) + ;; if none survived filtering, keep the original list + ess-rterm-version-paths + filtered)) ess-rterm-version-paths)) @@ -781,9 +798,7 @@ Once the value is found, cache it in the variable `ess-newest-R' for future use as finding the newest version of R can be potentially time-consuming." (or ess-newest-R - (progn (message "Finding all versions of R on your system...") - ;;(sleep-for 3) - nil) + (message "Finding all versions of R on your system...") (setq ess-newest-R (ess-newest-r (if ess-microsoft-p @@ -791,17 +806,6 @@ potentially time-consuming." (add-to-list 'ess-r-created-runners inferior-ess-r-program)))))) -(defun ess-check-R-program () - "Check if `inferior-ess-r-program' points to an executable version of R. -If not, try to find the newest version of R elsewhere on the system, and -update `inferior-ess-r-program' accordingly." - (unless (executable-find inferior-ess-r-program) - ;; need to check if we can find another name. - (let ((newest (ess-find-newest-R))) - (if newest - (setq inferior-ess-r-program newest) - (message "Sorry, no version of R could be found on your system."))))) - (defun R-newest (&optional start-args) "Find the newest version of R available, and run it. Subsequent calls to `R-newest' will run that version, rather than searching @@ -813,7 +817,7 @@ prompt for command line arguments." (error "No version of R could be found") ;; Else: we have a working version of R. ;; Have to be careful to avoid recursion... - (message (concat "Newest version of R is " rnewest)) + (message "%s" (concat "Newest version of R is " rnewest)) (fset 'R-newest (intern (if ess-microsoft-p @@ -863,16 +867,10 @@ Examples: (ess-current-R-at-least '2.7.0) (car (ess-get-words-from-vector (format "as.character(.ess.Rversion >= \"%s\")\n" version))))) -(defvar ess-temp-newest nil) - (defun ess-newest-r (rvers) "Check all the versions of RVERS to see which is the newest. Return the name of the newest version of R." (let ((rtimes (mapcar 'ess-r-version-date rvers))) - ;; SJE: 2007-07-13 -- following line is a temp var to check that - ;; the newest version of R is found correctly. - ;; (nowadays gives a compile warning) - (setq ess-temp-newest rtimes) (ess-find-newest-date rtimes))) (defun ess-find-newest-date (rvers) @@ -931,46 +929,33 @@ use \"bin/Rterm.exe\"." (if (file-exists-p R-path) R-path))) R-ver)))) -;;;###autoload -(defun Rnw-mode () - "Major mode for editing Sweave(R) source. -See `ess-noweb-mode' and `R-mode' for more help." - (interactive) - (require 'ess-noweb);; << probably someplace else - (setq ess--make-local-vars-permanent t) - (ess-noweb-mode 1); turn it on - (ess-noweb-set-doc-mode 'latex-mode) - (ess-noweb-set-code-mode 'R-mode) - (setq ess--local-handy-commands - (append '(("weave" . ess-swv-weave) - ("tangle" . ess-swv-tangle)) - ess-handy-commands) - ess-dialect "R" - ess-language "S") - (put 'ess--local-handy-commands 'permanent-local t) - (run-mode-hooks 'Rnw-mode-hook)) - -(fset 'Snw-mode 'Rnw-mode); just a synonym (for now or ever) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.[rR]nw\\'" . Rnw-mode)) -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.[sS]nw\\'" . Snw-mode)) +(cl-defmethod ess-font-lock-keywords (&context (major-mode ess-r-transcript-mode)) + 'ess-R-font-lock-keywords) ;;;###autoload -(defun R-transcript-mode () - "Does the right thing." - (interactive) - (ess-transcript-mode ess-r-customize-alist)) - -(fset 'r-transcript-mode 'R-transcript-mode) +(define-derived-mode ess-r-transcript-mode ess-transcript-mode "ESS R Transcript" + "A Major mode for R transcript files." + :syntax-table ess-r-mode-syntax-table + (ess-setq-vars-local ess-r-customize-alist) + (setq-local ess-font-lock-keywords 'ess-R-font-lock-keywords) + (setq-local paragraph-start (concat "\\s-*$\\|" page-delimiter)) + (setq-local paragraph-separate (concat "\\s-*$\\|" page-delimiter)) + (setq-local paragraph-ignore-fill-prefix t) + (setq-local indent-line-function 'ess-indent-line) + (setq-local add-log-current-defun-header-regexp "^\\(.+\\)\\s-+<-[ \t\n]*function") + (setq-local font-lock-syntactic-face-function #'ess-r-font-lock-syntactic-face-function) + (setq-local prettify-symbols-alist ess-r-prettify-symbols) + (setq font-lock-defaults '(ess-build-font-lock-keywords + nil nil ((?\. . "w") (?\_ . "w") (?' . "."))))) + +(fset 'r-transcript-mode 'ess-r-transcript-mode) ;;;###autoload -(add-to-list 'auto-mode-alist '("\\.[Rr]out" . R-transcript-mode)) +(add-to-list 'auto-mode-alist '("\\.[Rr]out" . ess-r-transcript-mode)) ;;;###autoload -(add-to-list 'interpreter-mode-alist '("Rscript" . R-mode)) +(add-to-list 'interpreter-mode-alist '("Rscript" . ess-r-mode)) ;;;###autoload -(add-to-list 'interpreter-mode-alist '("r" . R-mode)) +(add-to-list 'interpreter-mode-alist '("r" . ess-r-mode)) (defun ess-r-fix-T-F (&optional from quietly) "Change T/F into TRUE and FALSE cautiously. @@ -995,25 +980,25 @@ Used by `ess-r-install-library'.") (defvar ess--CRAN-mirror nil "CRAN mirror name cache.") -(defun ess-r-install-library (&optional update pack) - "Prompt and install R package PACK. +(cl-defmethod ess-install-library--override + (update package &context ((string= ess-dialect "R") (eql t))) + "Prompt and install R PACKAGE. With argument UPDATE, update cached packages list." - (interactive "P") (inferior-ess-r-force) (when (equal "@CRAN@" (car (ess-get-words-from-vector "getOption('repos')[['CRAN']]\n"))) (ess-set-CRAN-mirror ess--CRAN-mirror) (ess-wait-for-process (get-process ess-current-process-name)) - (unless pack (setq update t))) + (unless package (setq update t))) (when (or update (not ess--packages-cache)) (message "Fetching R packages ... ") (setq ess--packages-cache (ess-get-words-from-vector "print(rownames(available.packages()), max=1e6)\n"))) (let* ((ess-eval-visibly-p t) - (pack (or pack - (ess-completing-read "Package to install" ess--packages-cache)))) + (package (or package + (ess-completing-read "Package to install" ess--packages-cache)))) (process-send-string (get-process ess-current-process-name) - (format "install.packages('%s')\n" pack)) + (format "install.packages('%s')\n" package)) (display-buffer (buffer-name (process-buffer (get-process ess-current-process-name)))))) (defun ess-setRepositories () @@ -1029,16 +1014,12 @@ With argument UPDATE, update cached packages list." (let ((mirror-cmd "local({r <- getOption('repos'); r['CRAN'] <- '%s';options(repos=r)})\n")) (if mirror (ess-command (format mirror-cmd mirror)) - (let* ((M1 (ess-get-words-from-vector "local({out <- getCRANmirrors(local.only=TRUE); print(paste(out$Name,'[',out$URL,']', sep=''))})\n")) - (M2 (mapcar (lambda (el) - (string-match "\\(.*\\)\\[\\(.*\\)\\]$" el) - (propertize (match-string 1 el) 'URL (match-string 2 el))) - M1)) - (mirror (ess-completing-read "Choose CRAN mirror" M2 nil t))) - (when mirror - (setq mirror (get-text-property 0 'URL mirror)) - (setq ess--CRAN-mirror mirror) - (ess-command (format mirror-cmd mirror)))))) + (when-let ((M1 (ess-get-words-from-vector "local({out <- getCRANmirrors(local.only=TRUE); print(paste(out$Name,'[',out$URL,']', sep=''))})\n")) + (mirror (ess-completing-read "Choose CRAN mirror" M1 nil t)) + (url (seq-contains M1 mirror #'string=))) + (setq ess--CRAN-mirror (progn (string-match "\\(.*\\)\\[\\(.*\\)\\]$" url) + (match-string 2 url))) + (ess-command (format mirror-cmd ess--CRAN-mirror))))) (message "CRAN mirror: %s" (car (ess-get-words-from-vector "getOption('repos')[['CRAN']]\n")))) (define-obsolete-function-alias 'ess-setCRANMiror 'ess-set-CRAN-mirror "ESS 18.10") @@ -1047,8 +1028,7 @@ With argument UPDATE, update cached packages list." (unless (ess-boolean-command (format "print(requireNamespace('%s', quietly = TRUE))\n" pkg)) (if (y-or-n-p (format "Package '%s' is not installed. Install? " pkg)) (ess-eval-linewise (format "install.packages('%s')\n" pkg)) - (signal 'quit nil)) - (message nil))) + (signal 'quit nil)))) (defun ess-r-sos (cmd) "Interface to findFn in the library sos." @@ -1063,24 +1043,13 @@ Placed into `ess-presend-filter-functions' for R dialects." (ess--mark-search-list-as-changed)) string) -(defun ess-load-library () - "Prompt and load dialect specific library/package/module. +(cl-defmethod ess-installed-packages (&context ((string= ess-dialect "R") (eql t))) + ;;; FIXME? .packages() does not cache; installed.packages() does but is slower first time + (ess-get-words-from-vector "print(.packages(T), max=1e6)\n")) -Note that add-ons in R are called 'packages' and the name of this -function has nothing to do with R package mechanism, but it -rather serves a generic, dialect independent purpose. It is also -similar to `load-library' Emacs function." - (interactive) - (if (not (string-match "^R" ess-dialect)) - (message "Sorry, not available for %s" ess-dialect) - (let ((ess-eval-visibly-p t) -;;; FIXME? .packages() does not cache; installed.packages() does but is slower first time - (packs (ess-get-words-from-vector "print(.packages(T), max=1e6)\n")) - pack) - (setq pack (ess-completing-read "Load" packs)) - (ess-eval-linewise (format "library('%s')\n" pack)) - (ess--mark-search-list-as-changed) - (display-buffer (buffer-name (process-buffer (get-process ess-current-process-name))))))) +(cl-defmethod ess-load-library--override (pack &context ((string= ess-dialect "R") (eql t))) + "Load an R package." + (ess-eval-linewise (format "library('%s')\n" pack))) (define-obsolete-function-alias 'ess-library 'ess-load-library "ESS[12.09-1]") @@ -1108,19 +1077,24 @@ similar to `load-library' Emacs function." (ess-r-arg "verbose" "TRUE")))) (concat visibly output pkg verbose))) -(ess-defmethod R ess-build-eval-command (string &optional visibly output file namespace) - (let* ((namespace (unless ess-debug-minor-mode +(cl-defmethod ess-build-eval-command--override + (string &context ((string= ess-dialect "R") (eql t)) + &optional visibly output file &rest args) + "R method to build eval command." + (let* ((namespace (caar args)) + (namespace (unless ess-debug-minor-mode (or namespace (ess-r-get-evaluation-env)))) (cmd (if namespace ".ess.ns_eval" ".ess.eval")) (file (when file (ess-r-arg "file" file t))) - (args (ess-r-build-args visibly output namespace))) - (concat cmd "(\"" string "\"" args file ")\n"))) + (rargs (ess-r-build-args visibly output namespace))) + (concat cmd "(\"" string "\"" rargs file ")\n"))) -(ess-defmethod R ess-build-load-command (file &optional visibly output namespace) - (let* ((namespace (or namespace (ess-r-get-evaluation-env))) +(cl-defmethod ess-build-load-command (string &context ((string= ess-dialect "R") (eql t)) + &optional visibly output file &rest args) + (let* ((namespace (or file (ess-r-get-evaluation-env))) (cmd (if namespace ".ess.ns_source" ".ess.source")) - (args (ess-r-build-args visibly output namespace))) - (concat cmd "('" file "'" args ")\n"))) + (rargs (ess-r-build-args visibly output namespace))) + (concat cmd "('" string "'" rargs ")\n"))) (defun ess-r-build-eval-message (message) (let ((env (cond (ess-debug-minor-mode @@ -1182,7 +1156,7 @@ attached packages." (defvar ess-r-namespaced-load-only-existing t "Whether to load only objects already existing in a namespace.") -(ess-defmethod R ess-load-file (file) +(cl-defmethod ess-load-file--override (file &context ((string= ess-dialect "R") (eql t))) (cond ;; Namespaced evaluation ((ess-r-get-evaluation-env) @@ -1203,14 +1177,15 @@ selected (see `ess-r-set-evaluation-env')." (command (ess-build-load-command file nil t pkg-name))) (ess-send-string (ess-get-process) command))) -(ess-defmethod R ess-send-region (proc start end visibly message type) +(cl-defmethod ess-send-region--override (process start end visibly message type + &context ((string= ess-dialect "R") (eql t))) (cond ;; Namespaced evaluation ((ess-r-get-evaluation-env) - (ess-r-send-region-namespaced proc start end visibly message)) + (ess-r-send-region-namespaced process start end visibly message)) ;; Evaluation into current env (t - (ess-send-string proc (buffer-substring start end) visibly message type)))) + (ess-send-string process (buffer-substring start end) visibly message type)))) (defun ess-r-send-region-namespaced (proc beg end &optional visibly message) "Ask for for the package and devSource region into it." @@ -1290,7 +1265,7 @@ If it changes, we flush the cache.") (switch-to-buffer-other-window (ess-command (concat page-match "\n") (get-buffer-create (concat page-match ".rt")))) - (R-transcript-mode) + (ess-r-transcript-mode) (process-send-string proc "\n"))) t))) @@ -1346,42 +1321,40 @@ If it changes, we flush the cache.") (message (format "load ESSR: %s" msg))))))) (defun inferior-ess-r-load-ESSR--remote (pkg-dir src-dir) - (let* ((verfile (expand-file-name "VERSION" pkg-dir)) - (loadremote (expand-file-name "LOADREMOTE" pkg-dir)) - (version (if (file-exists-p verfile) - (with-temp-buffer - (insert-file-contents verfile) - (buffer-string)) - (error "Cannot find ESSR source code"))) - (r-load-code (with-temp-buffer - (insert-file-contents loadremote) - (buffer-string)))) - (ess-write-to-dribble-buffer (format "version file: %s\nloadremote file: %s\n" - verfile loadremote)) - (unless (ess-boolean-command (format r-load-code version) nil 0.1) + (let* ((loadremote (expand-file-name "LOADREMOTE" pkg-dir)) + (r-load-code (if (file-exists-p loadremote) + (with-temp-buffer + (insert-file-contents loadremote) + (buffer-string)) + (error "Cannot find ESSR source code")))) + (unless (ess-boolean-command (format r-load-code essr-version) nil 0.1) (let ((errmsg (with-current-buffer " *ess-command-output*" (buffer-string))) (files (directory-files src-dir t "\\.R$"))) (ess-write-to-dribble-buffer (format "error loading ESSR.rda: \n%s\n" errmsg)) ;; should not happen, unless extrem conditions (ancient R or failed download)) (message "Failed to download ESSR.rda (see *ESS* buffer). Injecting ESSR code from local machine") - (ess-command (format ".ess.ESSRversion <- '%s'\n" version)) ; cannot do this at R level + ;; For this case we cannot do it at R level + (ess-command (format ".ess.ESSRversion <- '%s'\n" essr-version)) (mapc #'ess--inject-code-from-file files))))) -(ess-defmethod R ess-quit (&optional no-save) - (let (cmd +(cl-defmethod ess-quit--override (arg &context ((string= ess-dialect "R") (eql t))) + "With ARG, do not offer to save the workspace." + (let ((cmd (format "base::q('%s')\n" (if arg "no" "default"))) (sprocess (ess-get-process ess-current-process-name))) (when (not sprocess) (error "No ESS process running")) (ess-cleanup) - (setq cmd (format "base::q('%s')\n" (if no-save "no" "default"))) (goto-char (marker-position (process-mark sprocess))) - (process-send-string sprocess cmd))) + (ess-send-string sprocess cmd t))) (defcustom inferior-ess-r-reload-hook nil "Hook run when reloading the R inferior buffer." :type 'hook :group 'ess-R) -(ess-defmethod R inferior-ess-reload (&optional start-args) +(cl-defmethod inferior-ess-reload--override (start-args + &context ((string= ess-dialect "R") (eql t))) + "Call `run-ess-r' with START-ARGS. +Then run `inferior-ess-r-reload-hook'." (run-ess-r start-args) (run-hooks 'inferior-ess-r-reload-hook)) @@ -1478,7 +1451,7 @@ Returns nil if line starts inside a string, t if in a comment." (state (syntax-ppss)) (containing-sexp (cadr state)) (prev-containing-sexp (car (last (butlast (nth 9 state)))))) - (ess-back-to-indentation) + (back-to-indentation) (cond ;; Strings ((ess-inside-string-p) @@ -1620,7 +1593,7 @@ Returns nil if line starts inside a string, t if in a comment." (looking-at "{") (progn (forward-line) - (ess-back-to-indentation) + (back-to-indentation) (/= (line-number-at-pos) start-line)) (not (looking-at "[ \t]*\\(#\\|$\\)")) (save-excursion @@ -1636,7 +1609,7 @@ Returns nil if line starts inside a string, t if in a comment." (goto-char containing-sexp) (ess-block-opening-p) (equal (point) (save-excursion - (ess-back-to-indentation) + (back-to-indentation) (point)))) (+ (current-column) offset)))))) @@ -1836,7 +1809,7 @@ Returns nil if line starts inside a string, t if in a comment." max-col) (while (< (line-number-at-pos) to-line) (forward-line) - (ess-back-to-indentation) + (back-to-indentation) ;; Ignore the line with the function call, the line to be ;; indented, and empty lines. (unless (or (>= (line-number-at-pos) to-line) @@ -1877,7 +1850,7 @@ Returns nil if line starts inside a string, t if in a comment." (looking-at "### ")) (setq max-col (min max-col (current-column)))) (forward-line) - (ess-back-to-indentation))) + (back-to-indentation))) max-col)) (defun ess-calculate-indent--prefixed-block-curly () @@ -2119,7 +2092,7 @@ state.") ;; at `=' sign (while (looking-at "[ \t]*[\n#]") (forward-line) - (ess-back-to-indentation)) + (back-to-indentation)) (setq start-pos (point)) (while (and (< (current-column) fill-column) (not (looking-at "[])]")) @@ -2219,12 +2192,113 @@ state.") +;;;*;;; Inferior R mode + +(defvar inferior-ess-r-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\M-\r" 'ess-dirs) + map) + "Keymap for `inferior-ess-r-mode'.") + +;; TOTHINK: Prevent string delimiting characters from messing up output in the +;; inferior buffer +(defvar inferior-ess-r-mode-syntax-table + (let ((table (copy-syntax-table ess-r-mode-syntax-table))) + (modify-syntax-entry ?% "." table) + (modify-syntax-entry ?\' "." table) + table) + "Syntax table for `inferior-ess-r-mode'.") + +(define-derived-mode inferior-ess-r-mode inferior-ess-mode "iESS" + "Major mode for interacting with inferior R processes." + (setq-local ess-font-lock-keywords 'inferior-ess-r-font-lock-keywords) + (setq-local comint-process-echoes (eql ess-eval-visibly t)) + ;; eldoc + (add-function :before-until (local 'eldoc-documentation-function) + #'ess-r-eldoc-function) + (when ess-use-eldoc (eldoc-mode)) + ;; auto-complete + (ess--setup-auto-complete ess-r-ac-sources t) + ;; company + (ess--setup-company ess-r-company-backends t) + (setq comint-get-old-input #'inferior-ess-get-old-input) + (add-hook 'comint-input-filter-functions 'ess-search-path-tracker nil 'local)) + + + +;;;*;;; R Help mode + +(defvar ess-r-help-mode-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map (make-composed-keymap button-buffer-map + ess-help-mode-map)) + (define-key map "s<" 'beginning-of-buffer) + (define-key map "s>" 'end-of-buffer) + (define-key map "sa" 'ess-skip-to-help-section) + (define-key map "sd" 'ess-skip-to-help-section) + (define-key map "sD" 'ess-skip-to-help-section) + (define-key map "st" 'ess-skip-to-help-section) + (define-key map "se" 'ess-skip-to-help-section) + (define-key map "sn" 'ess-skip-to-help-section) + (define-key map "sr" 'ess-skip-to-help-section) + (define-key map "ss" 'ess-skip-to-help-section) + (define-key map "su" 'ess-skip-to-help-section) + (define-key map "sv" 'ess-skip-to-help-section) + map) + "Keymap for `ess-r-help-mode'.") + +(define-derived-mode ess-r-help-mode ess-help-mode "R Help" + "Major mode for help buffers." + (setq ess-dialect "R" + ess-help-web-search-command #'ess-r-sos + ess-build-help-command-function #'ess-r-build-help-command + ess-help-sec-regex ess-help-r-sec-regex + ess-help-sec-keys-alist ess-help-r-sec-keys-alist ; TODO: Still necessary? + inferior-ess-help-command inferior-ess-r-help-command + ess-get-help-topics-function #'ess-s-get-help-topics-function) + (ess-r-help-add-links)) + +(define-button-type 'ess-r-help-link + 'follow-link t + 'action (lambda (_) (ess-r-help-button-action))) + +(defun ess-r-help-button-action () + "Display help for button at point." + (let ((text (get-text-property (point) 'ess-r-help-link-text))) + (ess-display-help-on-object text))) + +(defun ess-r-help-add-links () + "Add links to the help buffer." + (let ((help-topics (when (ess-process-live-p) + (ess-s-get-help-topics-function ess-local-process-name))) + (inhibit-read-only t)) + (save-excursion + ;; Search for fancy quotes only. If users have + ;; options(useFancyQuotes) set to something other than TRUE this + ;; probably won't work. If it's FALSE, R outputs ascii ', but + ;; searching through the whole buffer takes too long. + (while (re-search-forward "‘\\([^[:space:]]+?\\)’" nil t) + (let* ((text (match-string 1)) + (text (if (string-match-p ".*()\\'" text) + (substring text nil (- (length text) 2)) + text))) + (when (and (member text help-topics) + (not (string= text ess-help-object))) + (delete-region (match-beginning 0) (match-end 0)) + (insert-text-button text + 'ess-r-help-link-text text + 'type 'ess-r-help-link + 'help-echo (format "mouse-2, RET: Help on %s" text)))))))) + + + + ;; Create functions that can be called for running different versions ;; of R. ;; FIXME: Should be set in ess-custom (setq ess-rterm-version-paths (ess-flatten-list - (ess-uniq-list + (delete-dups (if (not ess-directory-containing-R) (if (getenv "ProgramW6432") (let ((P-1 (getenv "ProgramFiles(x86)")) @@ -2258,6 +2332,8 @@ state.") ;;;###autoload (add-to-list 'auto-mode-alist '("/Makevars\\(\\.win\\)?$" . makefile-mode)) +;;;###autoload +(add-to-list 'auto-mode-alist '("DESCRIPTION$" . conf-colon-mode)) (provide 'ess-r-mode) diff --git a/elpa/ess-20181109.703/ess-r-package.el b/elpa/ess-20190121.1430/ess-r-package.el similarity index 84% rename from elpa/ess-20181109.703/ess-r-package.el rename to elpa/ess-20190121.1430/ess-r-package.el index 77a116b0..3b5155bf 100644 --- a/elpa/ess-20181109.703/ess-r-package.el +++ b/elpa/ess-20190121.1430/ess-r-package.el @@ -1,4 +1,4 @@ -;;; ess-r-package.el --- Package development mode for R. +;;; ess-r-package.el --- Package development mode for R. -*- lexical-binding: t; -*- ;; Copyright (C) 2011-2015 Lionel Henry, Vitalie Spinu, A.J. Rossini, Richard ;; M. Heiberger, Martin Maechler, Kurt Hornik, Rodney Sparapani, and @@ -29,10 +29,14 @@ ;; see apropriate documentation section of ESS user manual ;;; Code: - +(require 'cl-lib) +(require 'project) (require 'ess-custom) (require 'ess-inf) (require 'ess-utils) + +(eval-when-compile + (require 'subr-x)) ;; Silence the byte compiler, OK because this file is only loaded by ;; ess-r-mode and has no autoloads. (defvar ess-r-customize-alist) @@ -52,11 +56,9 @@ See also `ess-r-set-evaluation-env' and `ess-r-evaluation-env'." :group 'ess-r-package :type 'boolean) -(defvar-local ess-r-package--project-cache nil +(defvar-local ess-r-package--info-cache nil "Current package info cache. - -Cons cell of two strings. CAR is the package name active in the -current buffer. CDR is the path to its source directory.") +See `ess-r-package-info' for its structure.") (define-obsolete-variable-alias 'ess-r-package-library-path 'ess-r-package-library-paths "v18.04") (defcustom ess-r-package-library-paths nil @@ -95,33 +97,38 @@ all source dirs recursively within the current package.") (defun ess-r-package-project (&optional dir) "Return the current package as an Emacs project instance. -A project instance is a cons cell of the project name as symbol +A project instance is a cons cell of the project type as symbol and the project path as string. If DIR is provided, the package is searched from that directory instead of `default-directory'." - (if (car ess-r-package--project-cache) - ess-r-package--project-cache - (let* ((pkg-path (ess-r-package--find-package-path (or dir default-directory))) - (project (when pkg-path - (cons (ess-r-package--find-package-name pkg-path) pkg-path)))) - ;; Cache info for better performance on remotes - (setq-local ess-r-package--project-cache (or project (list nil))) - (when (car project) - (cons 'r-package (cdr project)))))) + (let ((pkg-info (ess-r-package-info dir))) + (when (car pkg-info) + (cons 'ess-r-package (alist-get :root pkg-info))))) + +(cl-defmethod project-roots ((project (head ess-r-package))) + "Return the project root for ESS R packages" + (list (cdr project))) (defun ess-r-package-name (&optional dir) "Return the name of the current package as a string." - (let ((project (ess-r-package-project dir))) - (when project - (symbol-name (car ess-r-package--project-cache))))) - -(defun ess-r-package-get-info () - "Deprecated function to get package info. -Please use `ess-r-package-project' instead." - (let ((project (ess-r-package-project))) - (if project - (cons (ess-r-package-name) (cdr project)) - (list nil)))) -(make-obsolete 'ess-r-package-get-info 'ess-r-package-project "17.11") + (alist-get :name (ess-r-package-info dir))) + +(defun ess-r-package-info (&optional dir) + "Get the description of the R project in directory DIR. +Return an alist with the keys :name and :root. When not in a +package return '(nil). This value is cached buffer-locally for +efficiency reasons." + (if (and (null dir) (car ess-r-package--info-cache)) + ess-r-package--info-cache + (let* ((path (ess-r-package--find-package-path (or dir default-directory))) + (name (when path + (ess-r-package--find-package-name path))) + (info (if name + `((:name . ,name) (:root . ,path)) + '(nil)))) + ;; If DIR was supplied we cannot cache in the current buffer. + (if dir + info + (setq-local ess-r-package--info-cache info))))) (defun ess-r-package--all-source-dirs (dir) (when (file-directory-p dir) @@ -134,7 +141,7 @@ Please use `ess-r-package-project' instead." Return nil if not in a package. Search sub-directories listed in `ess-r-package-source-roots' are searched recursively and return all physically present directories." - (let ((pkg-root (cdr (ess-r-package-project)))) + (let ((pkg-root (alist-get :root (ess-r-package-info)))) (when pkg-root (let ((files (directory-files-and-attributes pkg-root t "^[^.]"))) (cl-loop for f in files @@ -194,7 +201,7 @@ Root is determined by locating `ess-r-package-root-file'." (insert-file-contents file) (goto-char (point-min)) (when (re-search-forward "package: \\(.*\\)" nil t) - (intern (match-string 1))))))) + (match-string 1)))))) ;;;*;;; UI @@ -202,27 +209,10 @@ Root is determined by locating `ess-r-package-root-file'." (defun ess-r-package-use-dir () "Set process directory to current package directory." (interactive) - (let ((dir (cdr (ess-r-package-project)))) - (ess-set-working-directory (abbreviate-file-name dir)))) - -(defun ess-r-package-set-package () - "Set a package for ESS r-package commands." - (interactive) - (let* ((pkg-path (read-directory-name - "Path: " (or (ess-r-package--find-package-path) - (if (stringp ess-r-package-library-paths) - ess-r-package-library-paths - (car ess-r-package-library-paths))) - nil t)) - (pkg-name (ess-r-package--find-package-name pkg-path)) - (pkg-info (cons pkg-name pkg-path))) - (unless (and pkg-name pkg-path - (file-exists-p (expand-file-name ess-r-package-root-file pkg-path))) - (error "Not a valid package. No '%s' found in `%s'" ess-r-package-root-file pkg-path)) - (message (format "%s selected and added to file-local variables" pkg-name)) - (save-excursion - (add-file-local-variable 'ess-r-package--project-cache pkg-info)) - (setq ess-r-package--project-cache pkg-info))) + (let ((pkg-root (alist-get :root (ess-r-package-info)))) + (if pkg-root + (ess-set-working-directory (abbreviate-file-name pkg-root)) + (user-error "Not in a project")))) ;;;*;;; Evaluation @@ -232,20 +222,20 @@ Root is determined by locating `ess-r-package-root-file'." Namespaced evaluation is enabled if `ess-r-package-auto-enable-namespaced-evaluation' is non-nil." (when ess-r-package-auto-enable-namespaced-evaluation - (let ((path (cdr (ess-r-package-project)))) + (let ((root (alist-get :root (ess-r-package-info)))) ;; Check that we are in a file within R/ - (when (and path + (when (and root default-directory - (> (length default-directory) (1+ (length path))) + (> (length default-directory) (1+ (length root))) (let ((subpath (substring default-directory - (1+ (length path)) + (1+ (length root)) (length default-directory)))) (string= (directory-file-name subpath) "R"))) (ess-r-set-evaluation-env (ess-r-package-name)))))) -(add-hook 'R-mode-hook 'ess-r-package-enable-namespaced-evaluation) +(add-hook 'ess-r-mode-hook 'ess-r-package-enable-namespaced-evaluation) -(defun ess-r-package-eval-linewise (command &optional msg p actions pkg-path) +(defun ess-r-package-eval-linewise (command &optional msg p actions) "Send COMMAND to R process. COMMAND is a command string with %s placeholder for the arguments. MSG is the message displayed in minibuffer with %s @@ -256,16 +246,14 @@ action, if 1 or (4) second if 2 or (16) third etc. ACTIONS is a list of strings (R arguments), or functions which return R arguments, or expressions which return R arguments." (inferior-ess-r-force) - (let* ((pkg-info (or (ess-r-package-project) - (ess-r-package-set-package))) - (pkg-name (ess-r-package-name)) - (pkg-path (or pkg-path (concat "'" (abbreviate-file-name (cdr pkg-info)) "'"))) - (args (ess-r-command--build-args p actions))) - (message msg pkg-name) - (with-ess-process-buffer nil - (setq ess-r-package--project-cache ess-r-package--project-cache)) - (ess-show-buffer (ess-get-process-buffer)) - (ess-eval-linewise (format command (concat pkg-path args))))) + (let ((pkg-info (ess-r-package-info)) + (args (ess-r-command--build-args p actions))) + (unless (car pkg-info) + (user-error "Not in a package")) + (message msg (alist-get :name pkg-info)) + (display-buffer (ess-get-process-buffer)) + (let ((pkg-path (concat "'" (abbreviate-file-name (alist-get :root pkg-info)) "'"))) + (ess-eval-linewise (format command (concat pkg-path args)))))) (defun ess-r-command--build-args (ix &optional actions) (let* ((n (cond ((null ix) 0) @@ -410,7 +398,7 @@ re-installation when called with a prefix ARG." (ess-r-command--build-args 0 '((read-string "Arguments: " "force = TRUE"))) ""))) (inferior-ess-r-force) - (ess-show-buffer (ess-get-process-buffer)) + (display-buffer (ess-get-process-buffer)) (message "Installing %s from github" repo) (ess-eval-linewise (format command repo args)))) @@ -498,8 +486,9 @@ Set this variable to nil to disable the mode line entirely." ess-getwd-command ess-quit-function inferior-ess-reload-function))) - (mapc (lambda (var) (set (make-local-variable var) - (eval (cdr (assq var ess-r-customize-alist))))) + (mapc (lambda (var) + (set (make-local-variable var) + (eval (cdr (assq var ess-r-customize-alist))))) vars)) (add-hook 'project-find-functions #'ess-r-package-project) (run-hooks 'ess-r-package-enter-hook)) @@ -522,9 +511,8 @@ Set this variable to nil to disable the mode line entirely." (if ess-r-package-exclude-modes (not (apply #'derived-mode-p ess-r-package-exclude-modes)) t))) - (let ((pkg-info (ess-r-package-project))) - (when pkg-info - (ess-r-package-mode 1))))) + (when (car (ess-r-package-info)) + (ess-r-package-mode 1)))) (defun ess-r-package-re-activate () "Restart `ess-r-package-mode'. @@ -533,7 +521,7 @@ package mode. Use this function if state of the buffer such as `default-directory' has changed." (when ess-r-package-mode (ess-r-package-mode -1)) - (setq ess-r-package--project-cache nil) + (setq ess-r-package--info-cache nil) (ess-r-package-auto-activate)) (defvar-local ess-r--old-default-dir nil) @@ -553,7 +541,7 @@ package mode. Use this function if state of the buffer such as ;;;*;;; Deprecated variables and functions -(defun ess-developer (&optional val) +(defun ess-developer (&optional _val) (error "As of ESS 16.04, `ess-developer' is deprecated. Use `ess-r-set-evaluation-env' instead")) (defalias 'ess-toggle-developer 'ess-developer) diff --git a/elpa/ess-20181109.703/ess-r-syntax.el b/elpa/ess-20190121.1430/ess-r-syntax.el similarity index 99% rename from elpa/ess-20181109.703/ess-r-syntax.el rename to elpa/ess-20190121.1430/ess-r-syntax.el index 576f4d35..be660afe 100644 --- a/elpa/ess-20181109.703/ess-r-syntax.el +++ b/elpa/ess-20190121.1430/ess-r-syntax.el @@ -79,15 +79,6 @@ If POS is nil, return nil. Otherwise return position itself." (ess-skip-blanks-forward newlines) (looking-at regex))) -(defun ess-back-to-indentation () - "Move point to the first non-whitespace character on this line. -This non-interactive version of (back-to-indentation) should not -be advised" - (beginning-of-line 1) - (skip-syntax-forward " " (line-end-position)) - ;; Move back over chars that have whitespace syntax but have the p flag. - (backward-prefix-chars)) - (defmacro ess-save-excursion-when-nil (&rest body) (declare (indent 0) (debug (&rest form))) @@ -111,7 +102,7 @@ be advised" (debug (&rest form))) `(save-excursion (goto-char indent-point) - (ess-back-to-indentation) + (back-to-indentation) (progn ,@body))) (defvar containing-sexp) @@ -820,7 +811,7 @@ nil, return the prefix." ;; Handles corner cases such as point being on last line (let ((orig-point (point))) (forward-line) - (ess-back-to-indentation) + (back-to-indentation) (> (point) orig-point))) (skip-chars-forward " \t") t)))))) diff --git a/elpa/ess-20181109.703/ess-r-xref.el b/elpa/ess-20190121.1430/ess-r-xref.el similarity index 88% rename from elpa/ess-20181109.703/ess-r-xref.el rename to elpa/ess-20190121.1430/ess-r-xref.el index 08ccdaa4..456df45f 100644 --- a/elpa/ess-20181109.703/ess-r-xref.el +++ b/elpa/ess-20190121.1430/ess-r-xref.el @@ -5,7 +5,6 @@ ;; Maintainer: ESS-core ;; ;; Keywords: languages, statistics, xref -;; Package-Requires: ((emacs "25")) ;; ;; This file is part of ESS. ;; @@ -24,17 +23,11 @@ ;;; Commentary: -;; This file contains an xref backend for `R-mode'. +;; This file contains an xref backend for `ess-r-mode'. ;;; Code: -(when (>= emacs-major-version 25) - (require 'subr-x) - (require 'xref)) -;; Cludge to silence the byte compiler until we drop support for Emacs 24. -(declare-function xref-make "xref") -(declare-function xref-make-buffer-location "xref") -(declare-function xref-make-file-location "xref") +(require 'xref) (require 'ess-inf) (require 'ess-utils) (require 'ess-r-package) @@ -51,7 +44,7 @@ associations, but could be used by the users for a more refined control of package locations than `ess-r-package-library-paths'.") (defun ess-r-xref-backend () - "An `xref-backend-functions' implementation for `R-mode'. + "An `xref-backend-functions' implementation for `ess-r-mode'. R's xref backend searches for `ess-r-package-library-paths' when srcrefs point to temporary locations." 'ess-r) @@ -91,7 +84,7 @@ srcrefs point to temporary locations." "Look in the source directory of the R package containing symbol SYMBOL for R-SRC-FILE." (let* ((env-name (ess-string-command (format ".ess_fn_pkg(\"%s\")\n" symbol))) (pkg (if (string-equal env-name "") - (error "Can't find package for symbol %s" symbol) + (user-error "Can't find package for symbol %s" symbol) env-name)) (dir (or (assoc-default pkg ess-r-xref-pkg-sources) (cond ((stringp ess-r-package-library-paths) @@ -100,11 +93,11 @@ srcrefs point to temporary locations." (cl-loop for d in ess-r-package-library-paths for p = (expand-file-name pkg d) when (file-exists-p p) return p)) - (t (error "Invalid value of `ess-r-package-library-paths'"))))) + (t (user-error "Invalid value of `ess-r-package-library-paths'"))))) (file (when dir (expand-file-name r-src-file dir)))) (when file (unless (file-readable-p file) - (error "Can't read %s" file)) + (user-error "Can't read %s" file)) ;; Cache package's source directory. (unless (assoc pkg ess-r-xref-pkg-sources) (push `(,pkg . ,dir) ess-r-xref-pkg-sources)) diff --git a/elpa/ess-20181109.703/ess-rd.el b/elpa/ess-20190121.1430/ess-rd.el similarity index 78% rename from elpa/ess-20181109.703/ess-rd.el rename to elpa/ess-20190121.1430/ess-rd.el index a3e5c81b..24a92d53 100644 --- a/elpa/ess-20181109.703/ess-rd.el +++ b/elpa/ess-20190121.1430/ess-rd.el @@ -1,4 +1,4 @@ -;; ess-rd.el --- Support for editing R documentation (Rd) source +;; ess-rd.el --- Support for editing R documentation (Rd) source -*- lexical-binding: t; -*- ;; Copyright (C) 1997--2005 A.J. Rossini, Richard M. Heiberger, Martin ;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. @@ -36,16 +36,8 @@ ;; Silence the byte compiler, see TODO below; can we remove these? (defvar ess-help-r-sec-regex) (defvar ess-help-r-sec-keys-alist) - (defvar ess-r-customize-alist) -(defvar essddr-version "0.9-1" - "Current version of ess-rd.el.") - -(defvar essddr-maintainer-address - "ESS Core Team " - "Current maintainer of ess-rd.el.") - (defvar Rd-mode-abbrev-table nil "Abbrev table for R documentation keywords. All Rd mode abbrevs start with a grave accent (`).") @@ -83,40 +75,37 @@ All Rd mode abbrevs start with a grave accent (`).") (define-abbrev Rd-mode-abbrev-table "`us" "\\usage") (define-abbrev Rd-mode-abbrev-table "`va" "\\value")) -(defvar Rd-mode-syntax-table nil - "Syntax table for Rd mode.") -(if Rd-mode-syntax-table - () - (setq Rd-mode-syntax-table (copy-syntax-table text-mode-syntax-table)) - (modify-syntax-entry ?\\ "\\" Rd-mode-syntax-table) - (modify-syntax-entry ?\{ "(}" Rd-mode-syntax-table) - (modify-syntax-entry ?\} "){" Rd-mode-syntax-table) - ;; Nice for editing, not for parsing ... - (modify-syntax-entry ?\( "()" Rd-mode-syntax-table) - (modify-syntax-entry ?\) ")(" Rd-mode-syntax-table) - (modify-syntax-entry ?\[ "(]" Rd-mode-syntax-table) - (modify-syntax-entry ?\] ")[" Rd-mode-syntax-table) - ;; To get strings right - ;; (modify-syntax-entry ?\' "\"" Rd-mode-syntax-table) - (modify-syntax-entry ?\" "\"" Rd-mode-syntax-table) - ;; To make abbrevs starting with a grave accent work ... - (modify-syntax-entry ?\` "w" Rd-mode-syntax-table) - ;; Comments - (modify-syntax-entry ?\% "<" Rd-mode-syntax-table) - (modify-syntax-entry ?\n ">" Rd-mode-syntax-table)) - -(defvar Rd-mode-parse-syntax-table nil +(defvar Rd-mode-syntax-table + (let ((tab (copy-syntax-table text-mode-syntax-table))) + (modify-syntax-entry ?\\ "\\" tab) + (modify-syntax-entry ?\{ "(}" tab) + (modify-syntax-entry ?\} "){" tab) + ;; Nice for editing, not for parsing ... + (modify-syntax-entry ?\( "()" tab) + (modify-syntax-entry ?\) ")(" tab) + (modify-syntax-entry ?\[ "(]" tab) + (modify-syntax-entry ?\] ")[" tab) + ;; To get strings right + ;; (modify-syntax-entry ?\' "\"" Rd-mode-syntax-table) + (modify-syntax-entry ?\" "\"" tab) + ;; To make abbrevs starting with a grave accent work ... + (modify-syntax-entry ?\` "w" tab) + ;; Comments + (modify-syntax-entry ?\% "<" tab) + (modify-syntax-entry ?\n ">" tab) + tab) + "Syntax table for `Rd-mode'.") + +(defvar Rd-mode-parse-syntax-table + (let ((tab (copy-syntax-table Rd-mode-syntax-table))) + ;; To make parse-partial-sexps do the thing we want for computing + ;; indentations + (modify-syntax-entry ?\( "_" tab) + (modify-syntax-entry ?\) "_" tab) + (modify-syntax-entry ?\[ "_" tab) + (modify-syntax-entry ?\] "_" tab) + tab) "Syntax table for parsing Rd mode.") -(if Rd-mode-parse-syntax-table - () - (setq Rd-mode-parse-syntax-table - (copy-syntax-table Rd-mode-syntax-table)) - ;; To make parse-partial-sexps do the thing we want for computing - ;; indentations - (modify-syntax-entry ?\( "_" Rd-mode-parse-syntax-table) - (modify-syntax-entry ?\) "_" Rd-mode-parse-syntax-table) - (modify-syntax-entry ?\[ "_" Rd-mode-parse-syntax-table) - (modify-syntax-entry ?\] "_" Rd-mode-parse-syntax-table)) (defvar Rd-section-names '("Rdversion" "arguments" "alias" "author" "concept" "describe" "description" @@ -147,13 +136,6 @@ All Rd mode abbrevs start with a grave accent (`).") "packageMaintainer" "packageDESCRIPTION" "packageIndices" )) -;; Need to fix Rd-bold-face problem. -;; -;; (defvar Rd-bold-face 'bold) - ;(defvar Rd-bold-face nil) - ;(make-face Rd-bold-face "R documentation bold face") - ;(make-face-bold Rd-bold-face - (defvar Rd-font-lock-keywords (list (cons @@ -173,7 +155,7 @@ All Rd mode abbrevs start with a grave accent (`).") "Additional Rd expressions to highlight.") (defvar Rd-indent-level 2 - "*Indentation of Rd code with respect to containing blocks.") + "Indentation of Rd code with respect to containing blocks.") (defvar Rd-mode-map (let ((map (make-sparse-keymap))) @@ -248,71 +230,36 @@ point.") ;;;###autoload -(defun Rd-mode () +(define-derived-mode Rd-mode text-mode "Rd" "Major mode for editing R documentation source files. -This mode makes it easier to write R documentation by helping with -indentation, doing some of the typing for you (with Abbrev mode) and by -showing keywords, strings, etc. in different faces (with Font Lock mode -on terminals that support it). - -Type \\[list-abbrevs] to display the built-in abbrevs for Rd keywords. - -Keybindings -=========== - -\\{Rd-mode-map} - -Variables you can use to customize Rd mode -========================================== - -`Rd-indent-level' - Indentation of Rd code with respect to containing blocks. - Default is 2. +Type \\[list-abbrevs] to display the built-in abbrevs for Rd +keywords.To automatically turn on the abbrev(iate) features, add +the following to your Emacs configuration file: -Turning on Rd mode runs the hook `Rd-mode-hook'. + (add-hook 'Rd-mode-hook #'abbrev-mode)" + (setq ess-language "S" ess-dialect "R") + (ess-setq-vars-local ess-r-customize-alist) -To automatically turn on the abbrev(iate) features, add the -following lines to your `.emacs' file: - - (add-hook 'Rd-mode-hook - (lambda () - (abbrev-mode 1)))" - - (interactive) - (text-mode) - (kill-all-local-variables) - (ess-setq-vars-local ess-r-customize-alist) ;same functionality is available as in R buffers - (use-local-map Rd-mode-map) - (setq mode-name "Rd") - (setq major-mode 'Rd-mode) - (setq local-abbrev-table Rd-mode-abbrev-table) - (set-syntax-table Rd-mode-syntax-table) - - (set (make-local-variable 'indent-line-function) 'Rd-mode-indent-line) - (set (make-local-variable 'fill-column) 72) - (set (make-local-variable 'comment-start-skip) "\\s<+\\s-*") - (set (make-local-variable 'comment-start) "% ") - (set (make-local-variable 'comment-end) "") - (set (make-local-variable 'font-lock-defaults) - '(Rd-font-lock-keywords nil nil)) - ;; (set (make-local-variable 'parse-sexp-ignore-comments) t) + (setq-local indent-line-function 'Rd-mode-indent-line) + (setq fill-column 72) + (setq-local comment-start-skip "\\s<+\\s-*") + (setq-local comment-start "% ") + (setq-local comment-end "") + (setq font-lock-defaults + '(Rd-font-lock-keywords nil nil)) ;; Here is a workaround for an Emacs bug related to indirect buffers and ;; spurious lockfiles that rears its ugly head with .Rd files ;; https://lists.gnu.org/archive/html/bug-gnu-emacs/2013-02/msg01368.html ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=14328 - (make-local-variable 'create-lockfiles) - (setq create-lockfiles nil) + (setq-local create-lockfiles nil) (require 'easymenu) (easy-menu-define Rd-mode-menu-map Rd-mode-map "Menu keymap for Rd mode." Rd-mode-menu) - (turn-on-auto-fill) - (message "Rd mode version %s" essddr-version) - (setq ess-language "S" ess-dialect "R"); (buffer local) - (run-mode-hooks 'Rd-mode-hook)) + (turn-on-auto-fill)) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.Rd\\'" . Rd-mode)) @@ -473,7 +420,7 @@ WHAT determines the font to use, as specified by `Rd-font-list'." (insert before) (save-excursion (insert after)))))) -;;;###autoload + (defun Rd-preview-help (&optional via-shell) "Preview the current Rd buffer contents as help. If optional VIA-SHELL is set, using `Rd-to-help-command'. @@ -506,12 +453,12 @@ temporary one in `temporary-file-directory'." ;; (ess--flush-help-into-current-buffer file "tools::Rd2txt(\"%s\")\n") ;; instead of all this : (ess-setq-vars-local ess-r-customize-alist) + ;; mostly cut'n'paste from ess--flush-help* (see FIXME(2)): + (ess-help-underline) + (ess--help-major-mode) ;; FIXME: Is this really needed? (setq ess-help-sec-regex ess-help-r-sec-regex ess-help-sec-keys-alist ess-help-r-sec-keys-alist) - ;; mostly cut'n'paste from ess--flush-help* (see FIXME(2)): - (ess-help-underline) - (ess-help-mode) (goto-char (point-min)) (set-buffer-modified-p 'nil) (setq buffer-read-only t) @@ -520,23 +467,8 @@ temporary one in `temporary-file-directory'." (unless (get-buffer-window pbuf 'visible) (display-buffer pbuf t)))) -;; Bug reporting -(defun Rd-submit-bug-report () - "Submit a bug report on Rd mode via mail." - (interactive) - (require 'reporter) - (and - (y-or-n-p "Do you want to submit a bug report? ") - (reporter-submit-bug-report - essddr-maintainer-address - (concat "Emacs version " emacs-version) - (list - 'essddr-version - 'Rd-indent-level)))) - - -;; Legacy feature -(provide 'essddr) +(define-obsolete-function-alias 'Rd-submit-bug-report 'ess-submit-bug-report "2018-08-16") + (provide 'ess-rd) ;;; ess-rd.el ends here diff --git a/elpa/ess-20190121.1430/ess-rdired.el b/elpa/ess-20190121.1430/ess-rdired.el new file mode 100644 index 00000000..e226d9ca --- /dev/null +++ b/elpa/ess-20190121.1430/ess-rdired.el @@ -0,0 +1,279 @@ +;;; ess-rdired.el --- prototype object browser for R, looks like dired mode. -*- lexical-binding: t; -*- + +;; Copyright (C) 2002--2019 A.J. Rossini, Richard M. Heiberger, Martin +;; Maechler, Kurt Hornik, Rodney Sparapani, Stephen Eglen, and J. Alexander Branham. + +;; Author: Stephen Eglen +;; Created: Thu 24 Oct 2002 +;; Maintainer: ESS-core + +;; This file is part of ESS + +;; This file is not part of GNU Emacs. + +;; ess-rdired.el is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; ess-rdired.el is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; A copy of the GNU General Public License is available at +;; https://www.r-project.org/Licenses/ + +;; This provides a dired-like buffer for R objects. Instead of +;; operating on files, we operate on R objects in the current +;; environment. Objects can be viewed, edited, deleted, plotted and +;; so on. + +;;; Commentary: + +;; Do "M-x R" to start an R session, then create a few variables: +;; +;; s <- sin(seq(from=0, to=8*pi, length=100)) +;; x <- c(1, 4, 9) +;; y <- rnorm(20) +;; z <- TRUE + +;; Then in Emacs, do "M-x ess-rdired" and you should see the following in +;; the buffer *R dired*: +;; Name Class Length Size +;; s numeric 100 848 bytes +;; x numeric 3 80 bytes +;; y numeric 20 208 bytes +;; z logical 1 56 bytes + +;; Type "?" in the buffer to see the documentation. e.g. when the +;; cursor is on the line for `s', type 'p' to plot it, or `v' to view +;; its contents in a buffer. Then type 'd' to delete it. + +;; How it works. + +;; Most of the hardwork is done by the R routine .rdired.objects(), +;; which, when called, produces the list of objects in a tidy format. +;; This function is stored within the Lisp variable `ess-rdired-objects'. + +;; Todo - How to select alternative environments? Currently only +;; shows objects in the .GlobalEnv? See BrowseEnv() in 1.6.x for way +;; of browsing other environments. + +;; Todo - problem with fix -- have to wait for fix() command to return +;; before *R* buffer can be used again. This can get stuck, umm. not +;; sure what is going wrong here. Maybe add a hook to the temp buffer +;; so that when buffer is killed, we send an instruction to R to +;; update the value of the variable to the contents of the buffer. +;; This way *R* doesn't have to wait. + +;; Todo - small bug in .rdired.objects -- if we have a variable called +;; `my.x', its value is replaced by the value of my.x used in the +;; sapply() calls within .rdired.objects(). + +;;; Code: + +(require 'ess-custom) +(require 'ess-inf) + +(defvar ess-rdired-objects "local({.rdired.objects <- function(objs) { + if (length(objs)==0) { + \"No objects to view!\" + } else { + mode <- sapply(objs, function(my.x) { + eval( parse( text=sprintf('data.class(get(\"%s\"))', my.x))) }) + length <- sapply(objs, function(my.x) { + eval( parse( text=sprintf('length(get(\"%s\"))', my.x))) }) + size <- sapply(objs, function(my.x) { + eval( parse( text=sprintf('format(object.size(get(\"%s\")), units=\"b\")', my.x))) }) + d <- data.frame(mode, length, size) + + var.names <- row.names(d) + + ## If any names contain spaces, we need to quote around them. + quotes = rep('', length(var.names)) + spaces = grep(' ', var.names) + if (any(spaces)) + quotes[spaces] <- '\"' + var.names = paste(quotes, var.names, quotes, sep='') + row.names(d) <- paste(' ', var.names, sep='') + d + } +}; cat('\n'); print(.rdired.objects(ls(envir = .GlobalEnv)))})\n" + "Function to call within R to print information on objects. +The last line of this string should be the instruction to call +the function which prints the output for rdired.") + +(defvar ess-rdired-buffer "*R dired*" + "Name of buffer for displaying R objects.") + +(defvar ess-rdired-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "d" 'ess-rdired-delete) + (define-key map "x" 'ess-rdired-delete) + (define-key map "v" 'ess-rdired-view) + (define-key map "V" 'ess-rdired-View) + (define-key map "p" 'ess-rdired-plot) + (define-key map "y" 'ess-rdired-type) + (define-key map "\C-c\C-s" 'ess-rdired-switch-process) + (define-key map "\C-c\C-y" 'ess-switch-to-ESS) + (define-key map "\C-c\C-z" 'ess-switch-to-end-of-ESS) + map)) + +(define-derived-mode ess-rdired-mode tabulated-list-mode "Rdired" + "Major mode for output from `ess-rdired'. +`ess-rdired' provides a dired-like mode for R objects. It shows the +list of current objects in the current environment, one-per-line. You +can then examine these objects, plot them, and so on." + (setq mode-name (concat "RDired " ess-local-process-name)) + (setq tabulated-list-format + `[("Name" 18 t) + ("Class" 10 t) + ("Length" 10 ess-rdired--length-predicate) + ("Size" 10 ess-rdired--size-predicate)]) + (add-hook 'tabulated-list-revert-hook #'ess-rdired nil t) + (tabulated-list-init-header) + (tabulated-list-print)) + +;;;###autoload +(defun ess-rdired () + "Show R objects from the global environment in a separate buffer. +You may interact with these objects, see `ess-rdired-mode' for +details." + (interactive) + (let ((proc ess-local-process-name) + (buff (get-buffer-create ess-rdired-buffer))) + (ess-command ess-rdired-objects buff nil nil nil (get-buffer-process proc)) + (with-current-buffer buff + (setq ess-local-process-name proc) + (goto-char (point-min)) + (let ((buffer-read-only nil) + text) + ;; Delete two lines. One filled with +'s from R's prompt + ;; printing, the other with the header info from the data.frame + (delete-region (point-min) (1+ (point-at-eol 2))) + (setq text (split-string (buffer-string) "\n" t "\n")) + (delete-region (point-min) (point-max)) + (setq tabulated-list-entries + (mapcar #'ess-rdired--tabulated-list-entries text)) + (ess-rdired-mode))) + (pop-to-buffer buff))) + +(defun ess-rdired--tabulated-list-entries (text) + "Return a value suitable for `tabulated-list-entries' from TEXT." + (let (name class length size) + (if (not (string-match-p " +\"" text)) + ;; Normal-world + (setq text (split-string text " " t) + name (nth 0 text) + text (cdr text)) + ;; Else, someone has spaces in their variable names + (string-match "\"\\([^\"]+\\)" text) + (setq name (substring (match-string 0 text) 1) + text (split-string (substring text (1+ (match-end 0))) " " t))) + (setq class (nth 0 text) + length (nth 1 text) + size (nth 2 text)) + (list name + `[(,name + help-echo "mouse-2, RET: View this object" + action ess-rdired-view) + ,class + ,length + ,size]))) + +(defun ess-rdired-edit () + "Edit the object at point." + (interactive) + (ess-command (concat "edit(" (tabulated-list-get-id) ")\n"))) + +(defun ess-rdired-view (&optional _button) + "View the object at point." + (interactive) + (ess-execute (ess-rdired-get (tabulated-list-get-id)) + nil "R view" )) + +(defun ess-rdired-get (name) + "Generate R code to get the value of the variable NAME. +This is complicated because some variables might have spaces in their names. +Otherwise, we could just pass the variable name directly to *R*." + (concat "get(" (ess-rdired-quote name) ")") + ) + +(defun ess-rdired-quote (name) + "Quote NAME if not already quoted." + (if (equal (substring name 0 1) "\"") + name + (concat "\"" name "\""))) + +(defun ess-rdired-View () + "View the object at point in its own buffer. +Like `ess-rdired-view', but the object gets its own buffer name." + (interactive) + (let ((objname (tabulated-list-get-id))) + (ess-execute (ess-rdired-get objname) + nil (concat "R view " objname )))) + +(defun ess-rdired-plot () + "Plot the object on current line." + (interactive) + (let ((objname (tabulated-list-get-id))) + (ess-eval-linewise (format "plot(%s)" (ess-rdired-get objname))))) + +(defun ess-rdired-type () + "Run the mode() on command at point." + (interactive) + (let ((objname (tabulated-list-get-id)) + ;; create a temp buffer, and then show output in echo area + (tmpbuf (get-buffer-create "**ess-rdired-mode**"))) + (if objname + (progn + (ess-command (concat "mode(" (ess-rdired-get objname) ")\n") + tmpbuf ) + (set-buffer tmpbuf) + (message (concat + objname ": " + (buffer-substring (+ 4 (point-min)) (1- (point-max))))) + (kill-buffer tmpbuf))))) + +(defalias 'ess-rdired-expunge #'ess-rdired-delete) + +(defun ess-rdired-delete () + "Delete the object at point." + (interactive) + (let ((objname (tabulated-list-get-id))) + (when (yes-or-no-p (format "Really delete %s? " objname)) + (ess-eval-linewise (format "rm(%s)" (ess-rdired-quote objname)) nil nil nil t) + (revert-buffer)))) + +(defun ess-rdired-switch-process () + "Switch to examine different *R* process. +If you have multiple R processes running, e.g. *R*, *R:2*, *R:3*, you can +use this command to choose which R process you would like to examine. +After switching to a new process, the buffer is updated." + (interactive) + (ess-switch-process) + (ess-rdired)) + +(defun ess-rdired--length-predicate (A B) + "Enable sorting by length in `ess-rdired' buffers. +Return t if A's length is < than B's length." + (let ((lenA (aref (cadr A) 2)) + (lenB (aref (cadr B) 2))) + (< (string-to-number lenA) (string-to-number lenB)))) + +(defun ess-rdired--size-predicate (A B) + "Enable sorting by size in `ess-rdired' buffers. +Return t if A's size is < than B's size." + (let ((lenA (aref (cadr A) 3)) + (lenB (aref (cadr B) 3))) + (< (string-to-number lenA) (string-to-number lenB)))) + +(define-obsolete-function-alias 'ess-rdired-quit #'quit-window "ESS 19.04") +(define-obsolete-function-alias 'ess-rdired-next-line #'forward-to-indentation "ESS 19.04") +(define-obsolete-function-alias 'ess-rdired-previous-line #'backward-to-indentation "ESS 19.04") +(define-obsolete-function-alias 'ess-rdired-move-to-object #'back-to-indentation "ESS 19.04") + +(provide 'ess-rdired) + +;;; ess-rdired.el ends here diff --git a/elpa/ess-20181109.703/ess-roxy.el b/elpa/ess-20190121.1430/ess-roxy.el similarity index 74% rename from elpa/ess-20181109.703/ess-roxy.el rename to elpa/ess-20190121.1430/ess-roxy.el index 86e15704..007395b3 100644 --- a/elpa/ess-20181109.703/ess-roxy.el +++ b/elpa/ess-20190121.1430/ess-roxy.el @@ -1,8 +1,8 @@ ;;; ess-roxy.el --- convenient editing of in-code roxygen documentation ;; -;; Copyright (C) 2009--2017 Henning Redestig, A.J. Rossini, Richard +;; Copyright (C) 2009--2018 Henning Redestig, A.J. Rossini, Richard ;; M. Heiberger, Martin Maechler, Kurt Hornik, Rodney Sparapani, Stephen -;; Eglen and Vitalie Spinu. +;; Eglen, Vitalie Spinu, and J. Alexander Branham. ;; ;; Author: Henning Redestig ;; Keywords: convenience, tools @@ -36,7 +36,7 @@ ;; - C-c C-o C-o :: update template ;; - navigating and filling roxygen fields ;; - C-c TAB, M-q, C-a, ENTER, M-h :: advised tag completion, fill-paragraph, -;; move-beginning-of-line, newline-and-indent +;; ess-roxy-move-beginning-of-line, newline-and-indent ;; - C-c C-o n,p :: next, previous roxygen entry ;; - C-c C-o C-c :: Unroxygen region. Convenient for editing examples. ;; - folding visibility using hs-minor-mode @@ -57,8 +57,6 @@ ;; a replacement for hideshow. ;; - only limited functionality for S4 documentation. -;; this *is* enabled now via ess-mode-hook in ./ess-site.el - ;;; Code: (require 'ess-utils) @@ -67,83 +65,106 @@ (require 'hideshow) (require 'outline) (eval-when-compile - (require 'cl-lib)) -(require 'essddr "ess-rd.el") + (require 'cl-lib) + (require 'subr-x)) +(require 'ess-rd) +(require 'ess-r-syntax) (defvar roxy-str) +(defvar ess-r-mode-syntax-table) +(declare-function ess-fill-args "ess-r-mode") +(declare-function ess-fill-continuations "ess-r-mode") + +(defvar-local ess-roxy-re nil + "Regular expression to recognize roxygen blocks.") ;;*;; Roxy Minor Mode (defvar ess-roxy-mode-map (let ((map (make-sparse-keymap))) - (if ess-roxy-hide-show-p - (define-key map (kbd "C-c C-o h") 'ess-roxy-hide-all)) - ;; short version (*first*: -> key binding shown in menu): + (define-key map (kbd "C-c C-o h") 'ess-roxy-hide-all) (define-key map (kbd "C-c C-o n") 'ess-roxy-next-entry) (define-key map (kbd "C-c C-o p") 'ess-roxy-previous-entry) - ;; For consistency (e.g. C-c C-o C-h !): kept here *in* addition to above (define-key map (kbd "C-c C-o C-o") 'ess-roxy-update-entry) (define-key map (kbd "C-c C-o C-r") 'ess-roxy-preview-Rd) (define-key map (kbd "C-c C-o C-w") 'ess-roxy-preview-HTML) (define-key map (kbd "C-c C-o C-t") 'ess-roxy-preview-text) (define-key map (kbd "C-c C-o C-c") 'ess-roxy-toggle-roxy-region) + (define-key map [remap back-to-indentation] 'ess-roxy-goto-end-of-roxy-comment) + (define-key map [remap newline] 'ess-roxy-newline-and-indent) + (define-key map [remap newline-and-indent] 'ess-roxy-newline-and-indent) + (define-key map [remap ess-indent-command] 'ess-roxy-ess-indent-command) + (define-key map [remap move-beginning-of-line] 'ess-roxy-move-beginning-of-line) + (define-key map [remap beginning-of-visual-line] 'ess-roxy-move-beginning-of-line) map)) -(defvar ess-roxy-font-lock-keywords - `((,(concat ess-roxy-re " *\\([@\\]" - (regexp-opt ess-roxy-tags-param t) - "\\)\\>") - (1 'font-lock-keyword-face prepend)) - (,(concat ess-roxy-re " *\\(@" - (regexp-opt '("param" "importFrom" "importClassesFrom" - "importMethodsFrom") - 'words) - "\\)\\(?:[ \t]+\\(\\(?:\\sw+,?\\)+\\)\\)") - (1 'font-lock-keyword-face prepend) - (3 'font-lock-variable-name-face prepend)) - (,(concat "[@\\]" (regexp-opt ess-roxy-tags-noparam t) "\\>") - (0 'font-lock-variable-name-face prepend)) - (,(concat ess-roxy-re) - (0 'bold prepend)))) +(defvar ess-roxy-font-lock-keywords nil + "Cache set by `ess-roxy-generate-keywords'. +Used to remove keywords added by function `ess-roxy-mode'.") + +(defun ess-roxy-generate-keywords () + "Generate a list of keywords suitable for `font-lock-add-keywords'." + (setq-local ess-roxy-font-lock-keywords + `((,(concat ess-roxy-re " *\\([@\\]" + (regexp-opt ess-roxy-tags-param t) + "\\)\\>") + (1 'font-lock-keyword-face prepend)) + (,(concat ess-roxy-re " *\\(@" + (regexp-opt '("param" "importFrom" "importClassesFrom" + "importMethodsFrom") + 'words) + "\\)\\(?:[ \t]+\\(\\(?:\\sw+,?\\)+\\)\\)") + (1 'font-lock-keyword-face prepend) + (3 'font-lock-variable-name-face prepend)) + (,(concat "[@\\]" (regexp-opt ess-roxy-tags-noparam t) "\\>") + (0 'font-lock-variable-name-face prepend)) + (,(concat ess-roxy-re) + (0 'bold prepend))))) (defvar ess-roxy-fold-examples nil "Whether to fold `@examples' when opening a buffer. Use you regular key for `outline-show-entry' to reveal it.") +;;;###autoload (define-minor-mode ess-roxy-mode "Minor mode for editing ROxygen documentation." :keymap ess-roxy-mode-map (if ess-roxy-mode + ;; Turn on `ess-roxy-mode': (progn - (font-lock-add-keywords nil ess-roxy-font-lock-keywords) + (setq-local ess-roxy-re (concat "^" (string-trim comment-start) "+'")) + (font-lock-add-keywords nil (ess-roxy-generate-keywords)) (add-hook 'completion-at-point-functions #'ess-roxy-complete-tag 'local) ;; should be first ;; Hideshow Integration - (when (and ess-roxy-hide-show-p (featurep 'hideshow)) + (when ess-roxy-hide-show-p (hs-minor-mode 1) (when ess-roxy-start-hidden-p (ess-roxy-hide-all))) ;; Outline Integration (when ess-roxy-fold-examples - (ess-roxy-hide-all-examples))) - (when (and ess-roxy-hide-show-p - (bound-and-true-p hs-minor-mode)) + (ess-roxy-hide-all-examples)) + ;; Autofill + (setq-local paragraph-start (concat "\\(" ess-roxy-re "\\)*" paragraph-start)) + (setq-local paragraph-separate (concat "\\(" ess-roxy-re "\\)*" paragraph-separate)) + (setq-local adaptive-fill-function 'ess-roxy-adaptive-fill-function) + ;; Hooks + (add-hook 'ess-presend-filter-functions 'ess-roxy-remove-roxy-re nil t)) + ;; Turn off `ess-roxy-mode': + ;; Hideshow + (when (and ess-roxy-hide-show-p hs-minor-mode) (hs-show-all) (hs-minor-mode)) + ;; Hooks + (remove-hook 'ess-presend-filter-functions 'ess-roxy-remove-roxy-re t) (font-lock-remove-keywords nil ess-roxy-font-lock-keywords) - (setq-local syntax-propertize-function nil) - (setq-local font-lock-fontify-region-function nil) - (setq-local font-lock-unfontify-region-function nil)) + ;; (setq-local syntax-propertize-function nil) + ;; (setq-local font-lock-fontify-region-function nil) + ;; (setq-local font-lock-unfontify-region-function nil) + ) + ;; Regardless of turning on or off we need to re-fontify the buffer: (when font-lock-mode - (if (fboundp 'font-lock-flush) - (font-lock-flush) - ;; font-lock-fontify-buffer call can be removed when we drop - ;; support for Emacs older than 25.1 - (with-no-warnings (font-lock-fontify-buffer)))) - ;; Autofill - (setq-local paragraph-start (concat "\\(" ess-roxy-re "\\)*" paragraph-start)) - (setq-local paragraph-separate (concat "\\(" ess-roxy-re "\\)*" paragraph-separate)) - (setq-local adaptive-fill-function 'ess-roxy-adaptive-fill-function)) + (font-lock-flush))) @@ -201,10 +222,9 @@ Use you regular key for `outline-show-entry' to reveal it.") (defun ess-back-to-roxy () "Go to roxy prefix." - (progn - (end-of-line) - (re-search-backward (concat ess-roxy-re " ?") (point-at-bol)) - (goto-char (match-end 0)))) + (end-of-line) + (re-search-backward (concat ess-roxy-re " ?") (point-at-bol)) + (goto-char (match-end 0))) (defun ess-roxy-beg-of-entry () "Get point number at start of current entry, 0 if not in entry." @@ -292,10 +312,13 @@ Use you regular key for `outline-show-entry' to reveal it.") end))) (defun ess-roxy-entry-p (&optional field) - "True if point is in a roxy entry." - (and (save-excursion + "Non-nil if point is in a roxy entry. +FIELD allows checkinf for a specific field with +`ess-roxy-current-field'." + (and ess-roxy-mode + (save-excursion (beginning-of-line) - (looking-at ess-roxy-re)) + (looking-at-p ess-roxy-re)) (or (null field) (string= (ess-roxy-current-field) field)))) @@ -309,8 +332,10 @@ Use you regular key for `outline-show-entry' to reveal it.") (defun ess-roxy-extract-field () (let ((field (buffer-substring (ess-roxy-beg-of-entry) (ess-roxy-end-of-entry))) - (prefix-re (ess-roxy-guess-str))) + (prefix-re (ess-roxy-guess-str)) + (roxy-re ess-roxy-re)) (with-temp-buffer + (setq ess-roxy-re roxy-re) (insert field) (goto-char (point-min)) (while (re-search-forward prefix-re (point-max) 'noerror) @@ -360,7 +385,7 @@ roxygen entry, error otherwise" (ess-roxy-goto-end-of-entry) (forward-line 1) (beginning-of-line)) - (goto-char (car (ess-end-of-function))))) + (beginning-of-defun))) (defun ess-roxy-get-args-list-from-def () "Get args list for current function." @@ -422,6 +447,8 @@ available. The template can be customized via the variable `ess-roxy-template-alist'. The parameter descriptions can are filled if `ess-roxy-fill-param-p' is non-nil." (interactive) + (unless (derived-mode-p 'ess-r-mode) + (user-error "%s mode not yet supported" major-mode)) (save-excursion (let* ((args-fun (ess-roxy-get-args-list-from-def)) (args-ent (ess-roxy-get-args-list-from-entry)) @@ -458,18 +485,18 @@ filled if `ess-roxy-fill-param-p' is non-nil." (setq line-break "\n")))))) (defun ess-roxy-goto-end-of-entry () - "Put point at the top of the current entry or above the function at point. + "Put point at the bottom of the current entry or above the function at point. Return t if the point is left in a roxygen entry, otherwise nil. Error if point is not in function or roxygen entry." - (if (not (ess-roxy-entry-p)) - (progn - (goto-char (nth 0 (ess-end-of-function))) - (forward-line -1))) + (when (not (ess-roxy-entry-p)) + (beginning-of-defun) + (forward-line -1)) (if (ess-roxy-entry-p) - (progn - (goto-char (ess-roxy-end-of-entry)) - t) - (forward-line) nil)) + (progn (goto-char (ess-roxy-end-of-entry)) + t) + (forward-line) + nil) + (ess-roxy-entry-p)) (defun ess-roxy-goto-beg-of-entry () "Put point at the top of the entry at point or above the function at point. @@ -478,7 +505,7 @@ entry, otherwise nil. Error if point is not in function or roxygen entry." (if (not (ess-roxy-entry-p)) (progn - (goto-char (nth 0 (ess-end-of-function))) + (goto-char (nth 0 (end-of-defun))) (forward-line -1))) (if (ess-roxy-entry-p) (progn @@ -548,12 +575,14 @@ the last deletion ended" nil)))) (defun ess-roxy-toggle-roxy-region (beg end) - "Remove prefix roxy string in this region if point is in a roxy -region, otherwise prefix all lines with the roxy -string. Convenient for editing example fields." + "Toggle prefix roxygen string from BEG to END. +Add the prefix if missing, remove if found. BEG and END default +to the region, if active, and otherwise the entire line. This is +convenient for editing example fields." (interactive "r") - (unless (use-region-p) - (error "Region is not active")) + (unless (and beg end) + (setq beg (line-beginning-position) + end (line-end-position))) (ess-roxy-roxy-region beg end (ess-roxy-entry-p))) (defun ess-roxy-roxy-region (beg end &optional on) @@ -572,9 +601,12 @@ string. Convenient for editing example fields." (widen)))) (defun ess-roxy-preview () - "Use a (possibly newly) connected R session and the roxygen package -`ess-roxy-package' to generate the Rd code for entry at point, place it -in a temporary buffer and return that buffer." + "Generate documentation for roxygen entry at point. +Use a connected R session (starting one if necessary) and +`ess-roxy-package' to generate the Rd code for the entry at +point. Place it in a buffer and return that buffer." + (unless (derived-mode-p 'ess-r-mode) + (user-error "Preview only supported in R buffers, try `ess-r-devtools-document-package' instead")) (let* ((beg (ess-roxy-beg-of-entry)) (tmpf (make-temp-file "ess-roxy")) (roxy-buf (get-buffer-create " *RoxygenPreview*")) @@ -595,15 +627,17 @@ in a temporary buffer and return that buffer." R-old-roxy "} else {" R-new-roxy "} })")) (t (error "Need to hard code the roclet output call for roxygen package '%s'" ess-roxy-package))))) - (if (= beg 0) - (error "Point is not in a Roxygen entry")) + (when (= beg 0) + (error "Point is not in a Roxygen entry")) (save-excursion (goto-char (ess-roxy-end-of-entry)) (forward-line 1) - (if (ess-end-of-function nil t) + (if (end-of-defun) (append-to-file beg (point) tmpf) - (while (and (forward-line 1) (not (looking-at "^$")) - (not (looking-at ess-roxy-re)))) + (while (and (forward-line 1) + (not (looking-at-p "^$")) + (not (eobp)) + (not (looking-at-p ess-roxy-re)))) (append-to-file beg (point) tmpf)) (ess-force-buffer-current) (unless (ess-boolean-command (concat "print(suppressWarnings(require(" ess-roxy-package @@ -670,10 +704,7 @@ facilitate saving that file." (Rd-mode) ;; why should the following be needed here? [[currently has no effect !!]] ;; usually in a *.Rd file fontification happens automatically - (if (fboundp 'font-lock-ensure) - (font-lock-ensure) - ;; emacs <= 24.x.y: - (with-no-warnings (font-lock-fontify-buffer))))) + (font-lock-ensure))) (defun ess-roxy-guess-str (&optional not-here) @@ -689,7 +720,9 @@ block before the point." (search-backward-regexp ess-roxy-re))) (if (or not-here (ess-roxy-entry-p)) (match-string 0) - ess-roxy-str))) + (if (derived-mode-p 'ess-r-mode) + ess-roxy-str + (concat (string-trim comment-start) "'"))))) (defun ess-roxy-hide-block () "Hide current roxygen comment block." @@ -716,6 +749,8 @@ See `hs-show-block' and `ess-roxy-hide-block'." (defun ess-roxy-hide-all (&optional show) "Hide all Roxygen entries in current buffer." (interactive) + (when (not ess-roxy-hide-show-p) + (user-error "First enable hide-show with `ess-roxy-hide-show-p'")) (hs-life-goes-on (save-excursion (goto-char (point-min)) @@ -752,7 +787,7 @@ See `hs-show-block' and `ess-roxy-hide-block'." (save-excursion (let ((args-txt (progn - (ess-beginning-of-function) + (beginning-of-defun) (buffer-substring-no-properties (progn (search-forward-regexp "\\([=,-]+ *function *\\|^\s*function\\)" nil nil 1) @@ -797,13 +832,20 @@ placed in `ess-presend-filter-functions'." ;; Only strip the prefix in the @examples field, and only when ;; STRING is entirely contained inside it. This allows better ;; behaviour for evaluation of regions. - (if (and (ess-roxy-entry-p "examples") - (with-temp-buffer - (insert string) - (ess-roxy-entry-p))) - (replace-regexp-in-string (concat ess-roxy-re "\\s-*") "" string) - string)) -(add-hook 'ess-presend-filter-functions 'ess-roxy-remove-roxy-re nil) + (let ((roxy-re ess-roxy-re)) + (if (and (ess-roxy-entry-p "examples") + ;; don't send just @examples if we're looking at a line + ;; like: ##' @examples + (not (string-match-p (concat roxy-re "[[:space:]]*@") string)) + ;; (with-temp-buffer + ;; ;; Need to carry the buffer-local value of + ;; ;; `ess-roxy-re' into the temp buffer: + ;; (setq ess-roxy-re roxy-re) + ;; (insert string) + ;; (ess-roxy-entry-p)) + ) + (replace-regexp-in-string (concat ess-roxy-re "\\s-*") "" string) + string))) (defun ess-roxy-find-par-end (stop-point &rest stoppers) (mapc #'(lambda (stopper) @@ -818,17 +860,18 @@ placed in `ess-presend-filter-functions'." ;;*;; Advices - (defmacro ess-roxy-with-filling-context (examples &rest body) - (declare (indent 0) (debug (&rest form))) - `(let ((comment-start "#+'[ \t]+#") - (comment-start-skip "#+'[ \t]+# *") + "Setup context (e.g. `comment-start') for filling roxygen BODY. +EXAMPLES should be non-nil if filling an example block." + (declare (indent 2) (debug (&rest form))) + `(let ((comment-start (concat ess-roxy-re "[ \t]+#")) + (comment-start-skip (concat ess-roxy-re "[ \t]+# *")) (comment-use-syntax nil) (adaptive-fill-first-line-regexp (concat ess-roxy-re "[ \t]*")) (paragraph-start (concat "\\(" ess-roxy-re "\\(" paragraph-start "\\|[ \t]*@" "\\)" "\\)\\|\\(" paragraph-start "\\)")) (temp-table (if ,examples - (make-syntax-table S-syntax-table) + (make-syntax-table ess-r-mode-syntax-table) Rd-mode-syntax-table))) (when ,examples ;; Prevent the roxy prefix to be interpreted as comment or string @@ -842,36 +885,63 @@ placed in `ess-presend-filter-functions'." (with-syntax-table temp-table ,@body)))) -(defadvice ess-eval-line-and-step (around ess-eval-line-and-step-roxy) - "Evaluate line but do not skip over comment (roxy) lines." - (if (ess-roxy-entry-p) - (let ((simple-next t)) - ad-do-it) - ad-do-it)) - -(defadvice ess-indent-command (around ess-roxy-toggle-hiding) - "Hide this block if we are at the beginning of the line." - (if (and (= (point) (point-at-bol)) (ess-roxy-entry-p) 'ess-roxy-hide-show-p) +(defun ess-roxy-ess-indent-command (&optional whole-exp) + "Hide this block if we are at the beginning of the line. +Else call `ess-indent-command'." + (interactive "P") + (if (and (bolp) (ess-roxy-entry-p) ess-roxy-hide-show-p) (progn (ess-roxy-toggle-hiding)) - ad-do-it)) - -(defadvice fill-paragraph (around ess-roxy-fill-advise) - "Fill roxygen paragraphs." + (ess-indent-command whole-exp))) + +(defun ess--roxy-fill-block (fun &optional args) + "Fill a roxygen block. +FUN should be a filling function and ARGS gets passed to it." + (let* ((saved-pos (point)) + (saved-line (line-number-at-pos)) + (saved-col (current-column)) + (buffer (current-buffer)) + (par-start (save-excursion + (if (save-excursion + (and (backward-paragraph) + (forward-paragraph) + (<= (point) saved-pos))) + (line-beginning-position) + (progn (backward-paragraph) (point))))) + (par-end (ess-roxy-find-par-end + (save-excursion + (forward-paragraph) + (point)) + (concat ess-roxy-re "[ \t]*@examples\\b") "^[^#]"))) + ;; Refill the whole structural paragraph sequentially, field by + ;; field, stopping at @examples + (ess-roxy-with-filling-context nil + (save-excursion + (save-restriction + (narrow-to-region par-start par-end) + (goto-char (point-min)) + (while (< (point) (point-max)) + (ess-roxy-maybe-indent-line) + (apply fun args) + (forward-paragraph))))))) + +(defun ess-r--fill-paragraph (orig-fun &rest args) + "ESS fill paragraph for R mode. +Overrides `fill-paragraph' which is ORIG-FUN when necessary and +passes ARGS to it." (cond ;; Regular case - ((not (and (eq major-mode 'ess-mode) - (string= ess-dialect "R"))) - ad-do-it) + ((not (derived-mode-p 'ess-r-mode)) + (apply orig-fun args)) ;; Filling of code comments in @examples roxy field ((and (ess-roxy-entry-p) (save-excursion - (back-to-indentation) + (ess-roxy-goto-end-of-roxy-comment) (looking-at "#"))) (ess-roxy-with-filling-context t - ad-do-it)) + (apply orig-fun args))) ((and (not (ess-roxy-entry-p)) (ess-inside-comment-p)) - ad-do-it) + (apply orig-fun args)) ;; Filling of call arguments with point on call name ((and ess-fill-calls (ess-inside-call-name-p)) @@ -889,58 +959,35 @@ placed in `ess-presend-filter-functions'." (ess-fill-args)) ;; Filling of roxy blocks ((ess-roxy-entry-p) - (save-excursion - (let* ((saved-pos (point)) - (saved-line (line-number-at-pos)) - (saved-col (current-column)) - (buffer (current-buffer)) - (par-start (save-excursion - (if (save-excursion - (and (backward-paragraph) - (forward-paragraph) - (<= (point) saved-pos))) - (line-beginning-position) - (progn (backward-paragraph) (point))))) - (par-end (ess-roxy-find-par-end - (save-excursion - (forward-paragraph) - (point)) - (concat ess-roxy-re "[ \t]*@examples\\b") "^[^#]"))) - ;; Refill the whole structural paragraph sequentially, field by - ;; field, stopping at @examples - (ess-roxy-with-filling-context nil - (save-excursion - (save-restriction - (narrow-to-region par-start par-end) - (goto-char 0) - (while (< (point) (point-max)) - (ess-roxy-maybe-indent-line) - ad-do-it - (forward-paragraph)))))))) + (ess--roxy-fill-block orig-fun args)) (t - ad-do-it))) - -(defadvice move-beginning-of-line (around ess-roxy-beginning-of-line) - "Move to start." + (apply orig-fun args)))) +(advice-add 'fill-paragraph :around #'ess-r--fill-paragraph) + +(defun ess-roxy-move-beginning-of-line (arg) + "Move point to the beginning of the current line or roxygen comment. +If not in a roxygen comment, call `move-beginning-of-line', which +see for ARG. If in a roxygen field, leave point at the end of a +roxygen comment. If already there, move to the beginning of the +line." + (interactive "^p") (if (ess-roxy-entry-p) - (let ((new-pos (save-excursion - (end-of-line) - (and (re-search-backward (concat ess-roxy-re " ?") (point-at-bol) t) - (match-end 0))))) - (if (or (bolp) - (< new-pos (point))) - (goto-char new-pos) - ad-do-it)) - ad-do-it)) - -(defadvice back-to-indentation (around ess-roxy-back-to-indentation) - "Handle `back-to-indentation' in roxygen doc." + (let ((pos (point))) + (ess-roxy-goto-end-of-roxy-comment) + (when (eql (point) pos) + (move-beginning-of-line nil))) + (move-beginning-of-line arg))) + +(defun ess-roxy-goto-end-of-roxy-comment () + "Leave point at the end of a roxygen comment. +If not in a roxygen entry, call `back-to-indentation'." + (interactive) (if (ess-roxy-entry-p) (progn (end-of-line) (re-search-backward (concat ess-roxy-re " *") (point-at-bol) t) (goto-char (match-end 0))) - ad-do-it)) + (back-to-indentation))) (defun ess-roxy-indent-new-comment-line () (if (not (ess-roxy-entry-p)) @@ -948,10 +995,14 @@ placed in `ess-presend-filter-functions'." (ess-roxy-indent-on-newline))) (defun ess-roxy-newline-and-indent () - (if (or (not (ess-roxy-entry-p)) - (not ess-roxy-insert-prefix-on-newline)) - (newline-and-indent) - (ess-roxy-indent-on-newline))) + "Start a newline and insert the roxygen prefix. +Only do this if in a roxygen block and +`ess-roxy-insert-prefix-on-newline' is non-nil." + (interactive) + (if (and (ess-roxy-entry-p) + ess-roxy-insert-prefix-on-newline) + (ess-roxy-indent-on-newline) + (newline-and-indent))) (defun ess-roxy-indent-on-newline () "Insert a newline in a roxygen field." @@ -970,6 +1021,29 @@ placed in `ess-presend-filter-functions'." (newline-and-indent) (insert (concat (ess-roxy-guess-str t) " "))))) +(defun ess-roxy-cpp-fill-paragraph (&rest _args) + "Advice for `c-fill-paragraph' that accounts for roxygen comments." + (cond + ;; Fill roxy @example's. + ((ess-roxy-entry-p "examples") + (ess--roxy-fill-block 'fill-paragraph) nil) + ;; Fill roxy entries. + ((ess-roxy-entry-p) + (ess--roxy-fill-block 'fill-paragraph) nil) + ;; Return t to signal to go on to `c-fill-paragraph'. + (t t))) + +(advice-add 'c-fill-paragraph :before-while 'ess-roxy-cpp-fill-paragraph) + +(defun ess-roxy-enable-in-cpp () + "Enable `ess-roxy-mode' in C++ buffers in R packages." + (when (and (fboundp 'ess-r-package-project) + (ess-r-package-project)) + (ess-roxy-mode))) + +(with-eval-after-load "cc-mode" + (add-hook 'c++-mode-hook #'ess-roxy-enable-in-cpp)) + (provide 'ess-roxy) ;;; ess-roxy.el ends here diff --git a/elpa/ess-20181109.703/ess-rutils.el b/elpa/ess-20190121.1430/ess-rutils.el similarity index 90% rename from elpa/ess-20181109.703/ess-rutils.el rename to elpa/ess-20190121.1430/ess-rutils.el index b0f4d12e..ed5bb541 100644 --- a/elpa/ess-20181109.703/ess-rutils.el +++ b/elpa/ess-20190121.1430/ess-rutils.el @@ -60,34 +60,26 @@ (defvar ess-rutils-buf "*R temp*" "Name of temporary R buffer.") -(defvar ess-rutils-mode-map nil +(defvar ess-rutils-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "l" 'ess-rutils-loadpkg) + (define-key map "i" 'ess-rutils-mark-install) + (define-key map "I" 'ess-rutils-install) + (define-key map "u" 'ess-rutils-unmark) + (define-key map "q" 'ess-rutils-quit) + map) "Keymap for the *R temp* buffer.") -(unless ess-rutils-mode-map - (setq ess-rutils-mode-map (make-sparse-keymap)) - (define-key ess-rutils-mode-map "l" 'ess-rutils-loadpkg) - (define-key ess-rutils-mode-map "i" 'ess-rutils-mark-install) - (define-key ess-rutils-mode-map "I" 'ess-rutils-install) - (define-key ess-rutils-mode-map "u" 'ess-rutils-unmark) - (define-key ess-rutils-mode-map "q" 'ess-rutils-quit) - (define-key ess-rutils-mode-map "?" 'ess-rutils-help)) - -(defun ess-rutils-mode () +(define-derived-mode ess-rutils-mode special-mode "R utils" "Major mode for output from `ess-rutils-local-pkgs' and `ess-rutils-repos-pkgs'. -Useful bindings to handle package loading and installing. -\\{ess-rutils-mode-map}" - (kill-all-local-variables) - (use-local-map ess-rutils-mode-map) - (setq major-mode 'ess-rutils-mode) - (setq mode-name (concat "R utils " ess-local-process-name))) +Useful bindings to handle package loading and installing." + (setq ess-dialect "R")) (defun ess-rutils-local-pkgs () "List all packages in all libraries." (interactive) - (if (get-buffer ess-rutils-buf) - (progn - (set-buffer ess-rutils-buf) - (setq buffer-read-only nil))) + (with-current-buffer (get-buffer-create ess-rutils-buf) + (setq buffer-read-only nil)) (ess-execute "writeLines(paste(' ', sort(.packages(all.available=TRUE)), sep=''))" nil @@ -96,10 +88,7 @@ Useful bindings to handle package loading and installing. (save-excursion (beginning-of-line) (open-line 1) (insert "**Available packages in all local R libraries**")) - (setq buffer-read-only t) - (ess-rutils-mode) - (if (fboundp 'fit-frame) - (fit-frame))) + (ess-rutils-mode)) (defun ess-rutils-namepkg () "Return name of the package on current line." @@ -133,10 +122,8 @@ Useful bindings to handle package loading and installing. Use the repositories as listed by getOptions(\"repos\") in the current R session." (interactive) - (if (get-buffer ess-rutils-buf) - (progn - (set-buffer ess-rutils-buf) - (setq buffer-read-only nil))) + (with-current-buffer (get-buffer-create ess-rutils-buf) + (setq buffer-read-only nil)) (ess-execute (concat "writeLines(paste(' \"', " "rownames(available.packages()), '\"', sep=''))") nil @@ -145,10 +132,7 @@ current R session." (save-excursion (kill-line 5) (insert "**packages available to install**\n")) - (setq buffer-read-only t) - (ess-rutils-mode) - (if (fboundp 'fit-frame) - (fit-frame))) + (ess-rutils-mode)) (defun ess-rutils-mark-install (arg) "Mark the current package for installing. @@ -251,15 +235,12 @@ packages if needed." (defun ess-rutils-apropos (string) "Search for STRING using apropos." (interactive "sApropos search for? ") - (if (get-buffer ess-rutils-buf) - (progn - (set-buffer ess-rutils-buf) - (setq buffer-read-only nil))) + (with-current-buffer (get-buffer-create ess-rutils-buf) + (setq buffer-read-only nil)) (ess-execute (concat "apropos('" string "')") nil (substring ess-rutils-buf 1 (- (length ess-rutils-buf) 1))) (pop-to-buffer ess-rutils-buf) - (setq buffer-read-only t) (ess-rutils-mode)) (defun ess-rutils-rm-all () @@ -351,23 +332,15 @@ given field. Options should be separated by value of (browse-url (concat site okstring "&max=20&result=normal&sort=score" "&idxname=Rhelp02a&idxname=functions&idxname=docs"))))) -(defun ess-rutils-help () - "Show help on `ess-rutils-mode'." - (interactive) - (describe-function 'ess-rutils-mode)) - (defun ess-rutils-help-search (string) "Search for STRING using help.search()." (interactive "sString to search for? ") - (if (get-buffer ess-rutils-buf) - (progn - (set-buffer ess-rutils-buf) - (setq buffer-read-only nil))) + (with-current-buffer (get-buffer-create ess-rutils-buf) + (setq buffer-read-only nil)) (ess-execute (concat "help.search('" string "')") nil (substring ess-rutils-buf 1 (- (length ess-rutils-buf) 1))) (pop-to-buffer ess-rutils-buf) - (setq buffer-read-only t) (ess-rutils-mode)) ;; Customizable variable to allow ess-rutils-keys to activate default key bindings. diff --git a/elpa/ess-20181109.703/ess-s-lang.el b/elpa/ess-20190121.1430/ess-s-lang.el similarity index 94% rename from elpa/ess-20181109.703/ess-s-lang.el rename to elpa/ess-20190121.1430/ess-s-lang.el index 4d74594c..f7c697f8 100644 --- a/elpa/ess-20181109.703/ess-s-lang.el +++ b/elpa/ess-20190121.1430/ess-s-lang.el @@ -75,16 +75,12 @@ '((paragraph-start . (concat "\\s-*$\\|" page-delimiter)) (paragraph-separate . (concat "\\s-*$\\|" page-delimiter)) (paragraph-ignore-fill-prefix . t) - (require-final-newline . mode-require-final-newline) ;;(comment-indent-function . 'S-comment-indent) ;;(ess-comment-indent . 'S-comment-indent) ;;(ess-indent-line . 'S-indent-line) ;;(ess-calculate-indent . 'ess-calculate-indent) (indent-line-function . 'ess-indent-line) - (parse-sexp-ignore-comments . t) - (ess-style . ess-default-style) ;;(ess-keep-dump-files . 'ask) - (ess-mode-syntax-table . S-syntax-table) ;; For Changelog add, require ' ' before <- : "attr<-" is a function name : (add-log-current-defun-header-regexp . "^\\(.+\\)\\s-+<-[ \t\n]*function")) "General options for S and S+ source files.") @@ -111,7 +107,6 @@ ;; (inferior-ess-secondary-prompt . "[+:] ") ;; catch Selection: and alike (inferior-ess-secondary-prompt . "+ ") ;; catch Selection: and alike (comment-start . "#") - (ess-imenu-generic-expression . ess-imenu-S-generic-expression) (comment-add . 1) (comment-start-skip . "#+ *") (comment-use-syntax . t) ; see log for bug report 2013-06-07 @@ -125,10 +120,7 @@ (ess-setwd-command . "setwd('%s')\n") (ess-funargs-command . ".ess_funargs(\"%s\")\n") (fill-nobreak-predicate . 'ess-inside-string-p) - (normal-auto-fill-function . 'ess-do-auto-fill) (ess-execute-screen-options-command . "options(width=%d, length=99999)\n") - (inferior-ess-font-lock-keywords . 'inferior-S-font-lock-keywords) - (ess-font-lock-keywords . 'ess-S-font-lock-keywords) (font-lock-defaults . '(ess-build-font-lock-keywords nil nil ((?\. . "w") (?\_ . "w"))))) "S-language common settings for all -customize-alist s") @@ -136,7 +128,6 @@ (defconst S+common-cust-alist (append '((ess-suffix . "S") - (ess-mode-syntax-table . S-syntax-table) (ess-help-sec-regex . ess-help-S+-sec-regex) (ess-help-sec-keys-alist . ess-help-S+sec-keys-alist) (ess-change-sp-regexp . ess-S+-change-sp-regexp) @@ -422,7 +413,6 @@ and ensure space before subsequent text." (defun ess-dump-to-src (&optional dont-query verbose) "Make the changes in an S - dump() file to improve human readability." (interactive "P") - (ess-mode) (ess-replace-regexp-dump-to-src "^\"\\([a-z.][a-z.0-9]*\\)\" *<-\n" "\n\\1 <- " dont-query verbose)) @@ -433,7 +423,6 @@ and ensure space before subsequent text." (interactive "P") (save-excursion (goto-char (point-min)) - (let ((num 0) (str "") (rgxp "000000+[1-9]?[1-9]?\\>") @@ -441,7 +430,6 @@ and ensure space before subsequent text." (if dont-query (ess-rep-regexp rgxp to nil nil verbose) (query-replace-regexp rgxp to nil)) - (while (< num 9) (setq str (concat (int-to-string num) "999999+[0-8]*")) (if (and (numberp verbose) (> verbose 1)) @@ -484,7 +472,6 @@ nil (as by default) !" (ess-replace-regexp-dump-to-src "^\\( *[a-z.][_a-z.0-9]*\\) *= *\\(function *(\\)" "\\1 <- \\2" dont-query verbose) - (unless not-all ;; "too" aggressive {proposing to replace function argument specs}: (ess-replace-regexp-dump-to-src ;; all those *not* ending in "," @@ -492,8 +479,7 @@ nil (as by default) !" ;; but not `names(x) = "..."' for that is "confused" with plot(x=x,..) "^\\( *[a-z.][][, \"_a-z.0-9]*\\) *= *\\([a-z.0-9({]\\(.*[^,]\\)? *$\\)" "\\1 <- \\2" nil ;; always query - often has many "false positives" - verbose) - )) + verbose))) ;;; All of the above three : (defun ess-MM-fix-src (&optional dont-query verbose) @@ -506,8 +492,7 @@ and one that is well formatted in emacs ess-mode." (ess-fix-comments dont-query) (ess-num-var-round dont-query verbose) (ess-fix-dot-more dont-query verbose) - (ess-fix-EQ-assign dont-query verbose 'not-all) - ) + (ess-fix-EQ-assign dont-query verbose 'not-all)) (defun ess-fix-miscellaneous (&optional from verbose) "Fix Miscellaneous S/R `ill-formation's from current \\[point]. @@ -603,9 +588,9 @@ keypress to repeat it, so if it is bound to \"C-c C-=\" pressing (defun ess-insert-assign (arg) "Insert the first element of `ess-assign-list' unless in string or comment. If the character before point is the first element of -`ess-assign-list', replace it with the last character typed. If -`ess-smart-S-assign-key' is nil, do `self-insert-command' using -ARG as the number of times to insert." +`ess-assign-list', replace it with the last character typed. + +If `ess-language' is not \"S\", call `self-insert-command' with ARG." (interactive "p") (if (string= ess-language "S") (let* ((assign (car ess-assign-list)) @@ -620,22 +605,9 @@ ARG as the number of times to insert." (t (insert assign)))) (funcall #'self-insert-command arg))) -(defun ess-smart-S-assign (arg) - "Insert `ess-smart-S-assign-key'. -Please use `ess-insert-assign'." - (interactive "p") - (with-no-warnings ; Obsolete key variable - (if ess-smart-S-assign-key - (ess-insert-assign arg) - (self-insert-command arg)))) - -(make-obsolete 'ess-smart-S-assign 'ess-insert-assign "ESS 18.10") - -(defun ess-disable-smart-S-assign (&rest _ignore) - "Disable `ess-insert-assign'." - (declare (obsolete "Use ess-smart-S-assign-key instead." "ESS 18.10")) - (with-no-warnings ; Obsolete key variable - (setq ess-smart-S-assign-key nil))) +;; In case people had this in their config don't cause errors: +(define-obsolete-function-alias 'ess-smart-S-assign 'ess-insert-assign "ESS 18.10") +(define-obsolete-function-alias 'ess-disable-smart-S-assign #'ignore "ESS 18.10") (defun ess-add-MM-keys () "Define MM's user keys, currently \\\\[ess-insert-function-outline], and @@ -660,19 +632,14 @@ Currently, this needs to: 2. format the statement, 3. c/function/Sfunc/ and I need to relearn emacs lisp (but I had to, anyway." - (interactive "sFunction ? ") (let* ((buffname "ess-complete.R") (buf (ess-execute (format "args(%s)" Sfunc) t buffname))) (pop-to-buffer buf) - (message "here yet?") (while (search-forward "function" nil t) (replace-match Sfunc nil t)) - (ess-setq-vars-local ess-customize-alist); (current-buffer)) - (setq major-mode 'ess-mode) - (use-local-map ess-mode-map) - (set-syntax-table ess-mode-syntax-table) - )) + (when (fboundp 'ess-r-mode) + (ess-r-mode)))) (defun ess-chm-display-help-on-object (object &rest args) (ess-eval-linewise (concat "help(" object ")"))) @@ -682,7 +649,7 @@ and I need to relearn emacs lisp (but I had to, anyway." ;; don't use syntax classes, bad for etags (defvar ess-imenu-S-generic-expression - '(("Functions" "^\\(.+\\)[ \t\n]*<-[ \t\n]*function[ ]*(" 1) + '(("Functions" "^\\([^ \t\n]+\\)[ \t\n]*<-[ \t\n]*function[ ]*(" 1) ("Classes" "^.*setClass(\\(.*\\)," 1) ("Coercions" "^.*setAs(\\([^,]+,[^,]*\\)," 1) ; show from and to ("Generics" "^.*setGeneric(\\([^,]*\\)," 1) @@ -690,16 +657,15 @@ and I need to relearn emacs lisp (but I had to, anyway." ;;[ ]*\\(signature=\\)?(\\(.*,?\\)*\\)," 1) ;; ;;("Other" "^\\(.+\\)\\s-*<-[ \t\n]*[^\\(function\\|read\\|.*data\.frame\\)]" 1) - ("Package" "^.*\\(library\\|require\\)(\\(.*\\)" 2) + ("Package" "^.*\\(library\\|require\\)(\\([^)]*\\)" 2) ("Data" "^\\(.+\\)[ \t\n]-*<-[ \t\n]*\\(read\\|.*data\.frame\\).*(" 1))) (defun ess-imenu-S (&optional arg) "S Language Imenu support for ESS." - (interactive) - (setq imenu-generic-expression ess-imenu-generic-expression) + (declare (obsolete "It is set automatically in major modes" "ESS 19.04")) (imenu-add-to-menubar "Imenu-S")) -(defalias 'ess-imenu-R 'ess-imenu-S) +(define-obsolete-function-alias 'ess-imenu-R 'ess-imenu-S "ESS 19.04") ;;; Speedbar stuff. @@ -743,8 +709,6 @@ If 'sp-for-help-changed?' process variable is non-nil or `ess-help-topics-list' is nil, (re)-populate the latter and return it. Otherwise, return `ess-help-topics-list'." (with-ess-process-buffer nil - (ess-write-to-dribble-buffer - (format "(ess-get-help-topics-list %s) .." name)) (when (fboundp 'ess-help-r--check-last-help-type) (ess-help-r--check-last-help-type)) (cond @@ -753,7 +717,7 @@ return it. Otherwise, return `ess-help-topics-list'." (ess-process-get 'sp-for-help-changed?)) (ess-process-put 'sp-for-help-changed? nil) (setq ess-help-topics-list - (ess-uniq-list + (delete-dups (append (ess-get-object-list name 'exclude-1st) (ess-get-help-files-list) (ess-get-help-aliases-list))))) diff --git a/elpa/ess-20181109.703/ess-sas-a.el b/elpa/ess-20190121.1430/ess-sas-a.el similarity index 97% rename from elpa/ess-20181109.703/ess-sas-a.el rename to elpa/ess-20190121.1430/ess-sas-a.el index 468e8a98..c961b32c 100644 --- a/elpa/ess-20181109.703/ess-sas-a.el +++ b/elpa/ess-20190121.1430/ess-sas-a.el @@ -46,7 +46,7 @@ "Full path-name of the sas file to perform operations on.") (defcustom ess-sas-data-view-libname " " - "*SAS code to define a library for `ess-sas-data-view-fsview' + "SAS code to define a library for `ess-sas-data-view-fsview' or `ess-sas-data-view-insight'." :group 'ess-sas :type 'string) @@ -54,30 +54,31 @@ or `ess-sas-data-view-insight'." (defcustom ess-sas-data-view-submit-options (if ess-microsoft-p "-noenhancededitor -nosysin -log NUL:" "-nodms -nosysin -log /dev/null -terminal") - "*The command-line options necessary for your OS with respect to + "The command-line options necessary for your OS with respect to `ess-sas-data-view-fsview' and `ess-sas-data-view-insight'." :group 'ess-sas :type 'string) (defcustom ess-sas-data-view-fsview-command "; proc fsview data=" - "*SAS code to open a SAS dataset with `ess-sas-data-view-fsview'." + "SAS code to open a SAS dataset with `ess-sas-data-view-fsview'." :group 'ess-sas :type 'string) (defcustom ess-sas-data-view-fsview-statement " " - "*SAS code to perform a PROC FSVIEW statement with `ess-sas-data-view-fsview'." + "SAS code to perform a PROC FSVIEW statement with `ess-sas-data-view-fsview'." :group 'ess-sas :type 'string) + (make-variable-buffer-local 'ess-sas-data-view-fsview-statement) (defcustom ess-sas-data-view-insight-command "; proc insight data=" - "*SAS code to open a SAS dataset with `ess-sas-data-view-insight'." + "SAS code to open a SAS dataset with `ess-sas-data-view-insight'." :group 'ess-sas :type 'string) (defcustom ess-sas-data-view-insight-statement " " - "*SAS code to perform a PROC FSVIEW statement with `ess-sas-data-view-insight'." + "SAS code to perform a PROC FSVIEW statement with `ess-sas-data-view-insight'." :group 'ess-sas :type 'string) @@ -85,7 +86,7 @@ or `ess-sas-data-view-insight'." (defcustom ess-sas-graph-view-suffix-regexp "[.]\\([eE]?[pP][sS]\\|[pP][dD][fF]\\|[gG][iI][fF]\\|[jJ][pP][eE]?[gG]\\|[tT][iI][fF][fF]?\\)" - "*GSASFILE suffix regexp." + "GSASFILE suffix regexp." :group 'ess-sas :type 'string) @@ -115,17 +116,12 @@ or `ess-sas-data-view-insight'." (setq ess-tmp-alist (list (cons "[eE]?[pP][sS]" ess-tmp-ps) (cons "[pP][dD][fF]" ess-tmp-ps)))))) - "*Associate file name extensions with graphics image file viewers." + "Associate file name extensions with graphics image file viewers." :group 'ess-sas :type '(choice (const nil) (alist))) -;;(defcustom ess-sas-smart-back-tab nil -;; "*Set to t to make C-TAB insert an end/%end; statement to close a block." -;; :group 'ess-sas -;;) - (defcustom ess-sas-log-max 0 - "*If >0 and .log file exceeds this many bytes, just \"refresh\" this many bytes." + "If >0 and .log file exceeds this many bytes, just \"refresh\" this many bytes." :group 'ess-sas :type 'integer) @@ -135,28 +131,28 @@ or `ess-sas-data-view-insight'." :type 'string) (defcustom ess-sas-shell-buffer "*shell*" - "*Name that you want to use for the shell buffer; buffer-local." + "Name that you want to use for the shell buffer; buffer-local." :group 'ess-sas :type 'string) (make-variable-buffer-local 'ess-sas-shell-buffer) (defcustom ess-sas-shell-buffer-remote-host nil - "*Remote host that you want to open a shell on." + "Remote host that you want to open a shell on." :group 'ess-sas :type '(choice (const nil) string)) (make-variable-buffer-local 'ess-sas-shell-buffer-remote-host) (defcustom ess-sas-shell-buffer-remote-init "ssh" - "*Command to open a shell on a remote host." + "Command to open a shell on a remote host." :group 'ess-sas :type 'string) (make-variable-buffer-local 'ess-sas-shell-buffer-remote-init) (defcustom ess-sas-submit-mac-virtual-pc nil - "*Non-nil means that you want to run Windows SAS in a + "Non-nil means that you want to run Windows SAS in a Virtual PC emulator on your Mac; buffer-local." :group 'ess-sas :type 'boolean) @@ -164,25 +160,25 @@ Virtual PC emulator on your Mac; buffer-local." (make-variable-buffer-local 'ess-sas-submit-mac-virtual-pc) (defcustom sas-program "sas" - "*Command to invoke SAS, default for buffer-local `ess-sas-submit-command'." + "Command to invoke SAS, default for buffer-local `ess-sas-submit-command'." :group 'ess-sas :type 'string) (defcustom ess-sas-submit-command sas-program - "*Command to invoke SAS in batch; buffer-local." + "Command to invoke SAS in batch; buffer-local." :group 'ess-sas :type 'string) (make-variable-buffer-local 'ess-sas-submit-command) (defcustom ess-sas-submit-command-options "-rsasuser" - "*Options to pass to SAS in batch; buffer-local." + "Options to pass to SAS in batch; buffer-local." :group 'ess-sas :type 'string) (make-variable-buffer-local 'ess-sas-submit-command-options) -(defvar ess-sas-submit-method +(defvar-local ess-sas-submit-method (if (and (and ess-microsoft-p (fboundp 'w32-shell-dos-semantics)) (w32-shell-dos-semantics)) @@ -203,19 +199,17 @@ Users accessing a remote machine with `telnet', `rlogin', `ssh', etc., should set this variable to 'sh regardless of their local shell (since their remote shell is 'sh).") -(make-variable-buffer-local 'ess-sas-submit-method) - (defcustom ess-sas-graph-view-viewer-default (if ess-microsoft-p "explorer" (if (equal ess-sas-submit-method 'sh) "sdtimage")) - "*Default graphics image file viewer." + "Default graphics image file viewer." :group 'ess-sas :type 'string) (defcustom ess-sas-submit-post-command (if (equal ess-sas-submit-method 'sh) "&" (if ess-microsoft-p "-icon")) - "*Command-line statement to post-modify SAS invocation" + "Command-line statement to post-modify SAS invocation." :group 'ess-sas :type 'string) @@ -250,17 +244,17 @@ should set this variable to 'sh regardless of their local shell "nohup nice +6") (t "nohup nice"))) (if ess-microsoft-p "start")) - "*Command-line statement to precede SAS invocation, e.g. start or nohup" + "Command-line statement to precede SAS invocation, e.g. start or nohup." :group 'ess-sas :type 'string) (defcustom ess-sas-suffix-1 "txt" - "*The first suffix to associate with SAS." + "The first suffix to associate with SAS." :group 'ess-sas :type 'string) (defcustom ess-sas-suffix-2 "csv" - "*The second suffix to associate with SAS." + "The second suffix to associate with SAS." :group 'ess-sas :type 'string) @@ -271,7 +265,7 @@ should set this variable to 'sh regardless of their local shell (if ess-sas-suffix-2 (concat "\\|" (downcase ess-sas-suffix-2) "\\|" (upcase ess-sas-suffix-2))) "\\)") - "*Regular expression for SAS suffixes." + "Regular expression for SAS suffixes." :group 'ess-sas :type 'string) @@ -282,7 +276,7 @@ should set this variable to 'sh regardless of their local shell :group 'ess-sas) (defcustom ess-sas-temp-root "-temp" - "*Appended to root name of the temporary .sas file for `ess-sas-submit-region'." + "Appended to root name of the temporary .sas file for `ess-sas-submit-region'." :group 'ess-sas :type 'string) @@ -296,7 +290,7 @@ file \"sas8\" is found and this variable includes the string version of SAS. If duplicate versions of the same program are found (which happens if the same path is listed on `exec-path' more than once), they are -ignored by calling `ess-uniq-list'. +ignored by calling `delete-dups'. If you set this variable, you need to restart Emacs (and set this variable before ess-site is loaded) for it to take effect.") @@ -315,7 +309,7 @@ in SAS-mode and related modes.") (defun ess-ebcdic-to-ascii-search-and-replace () - "*Search and replace EBCDIC text with ASCII equivalents." + "Search and replace EBCDIC text with ASCII equivalents." (interactive) (let ((ess-tmp-dd (executable-find "dd")) (ess-tmp-recode (executable-find "recode")) (ess-tmp-util nil) (ess-tmp-util-args nil)) @@ -339,7 +333,7 @@ in SAS-mode and related modes.") (let* ((exit-done "\\[[0-9]+\\]\\ *\\+*\\ *\\(Exit\\|Done\\)[^\r\n]*") ; GNU Emacs needs this (beg (string-match exit-done string))) (if beg - (message (substring string beg (match-end 0)))))) + (message "%s" (substring string beg (match-end 0)))))) (defun ess-sas-append-log () @@ -1195,7 +1189,7 @@ be placed on the menubar upon ESS initialization." (let ((versions ;; Find which versions of SAS we want. Remove the pathname, ;; leaving just the name of the executable. - (ess-uniq-list + (delete-dups (mapcar #'file-name-nondirectory (apply #'nconc (mapcar #'ess-find-exec-completions diff --git a/elpa/ess-20181109.703/ess-sas-d.el b/elpa/ess-20190121.1430/ess-sas-d.el similarity index 85% rename from elpa/ess-20181109.703/ess-sas-d.el rename to elpa/ess-20190121.1430/ess-sas-d.el index 1ef53a1b..7929e070 100644 --- a/elpa/ess-20181109.703/ess-sas-d.el +++ b/elpa/ess-20190121.1430/ess-sas-d.el @@ -40,12 +40,34 @@ (require 'ess-sas-l) (defvar inferior-SAS-args "-stdio -linesize 80 -noovp -nosyntaxcheck" - "*Arguments to use for starting SAS.") + "Arguments to use for starting SAS.") (defvar inferior-SAS-args-temp nil "Hack variable, needed for args preprocessing. Better logic needed! (see 2 uses, in this file).") +(defvar SAS-mode-syntax-table + (let ((tab (make-syntax-table))) + (modify-syntax-entry ?\\ "." tab) ;; backslash is punctuation + (modify-syntax-entry ?+ "." tab) + (modify-syntax-entry ?- "." tab) + (modify-syntax-entry ?= "." tab) + (modify-syntax-entry ?% "w" tab) + (modify-syntax-entry ?< "." tab) + (modify-syntax-entry ?> "." tab) + (modify-syntax-entry ?& "w" tab) + (modify-syntax-entry ?| "." tab) + (modify-syntax-entry ?\' "\"" tab) + (modify-syntax-entry ?* ". 23" tab) ; comment character + (modify-syntax-entry ?\; "." tab) + (modify-syntax-entry ?_ "w" tab) + (modify-syntax-entry ?< "." tab) + (modify-syntax-entry ?> "." tab) + (modify-syntax-entry ?/ ". 14" tab) ; comment character + (modify-syntax-entry ?. "w" tab) + tab) + "Syntax table for `SAS-mode'.") + (defun ess-SAS-pre-run-hook (temp-ess-dialect) "Set up log and list files for interactive SAS." @@ -157,8 +179,6 @@ Better logic needed! (see 2 uses, in this file).") '((ess-local-customize-alist . 'SAS-customize-alist) (ess-language . "SAS") (ess-dialect . "SAS") - (ess-mode-editing-alist . SAS-editing-alist) ; from ess-sas-l.el - (ess-mode-syntax-table . SAS-syntax-table) (inferior-ess-program . inferior-SAS-program) (ess-help-sec-regex . "^[A-Z. ---]+:$") (ess-help-sec-keys-alist . " ") @@ -170,7 +190,6 @@ Better logic needed! (see 2 uses, in this file).") (inferior-ess-primary-prompt . "^") (inferior-ess-secondary-prompt . "^") (comint-use-prompt-regexp . t) - (inferior-ess-start-file . nil) ;"~/.ess-SAS") (inferior-ess-start-args . inferior-SAS-args-temp) ;; (ess-pre-run-hook . 'ess-SAS-pre-run-hook) ;; (ess-local-process-name . nil) @@ -180,15 +199,27 @@ Better logic needed! (see 2 uses, in this file).") ;;; The functions of interest (mode, inferior mode) ;;;###autoload -(defun SAS-mode (&optional proc-name) - "Major mode for editing SAS source. See ess-mode for more help." - (interactive) +(define-derived-mode SAS-mode ess-mode "[SAS]" + "Major mode for editing SAS source. See `ess-mode' for more help." + (ess-setq-vars-local SAS-customize-alist) (setq ess-customize-alist SAS-customize-alist) - (ess-mode SAS-customize-alist proc-name) - + (setq ess-local-customize-alist SAS-customize-alist) + (setq-local sentence-end ";[\t\n */]*") + (setq-local paragraph-start "^[ \t]*$") + (setq-local paragraph-separate "^[ \t]*$") + (setq-local paragraph-ignore-fill-prefix t) + (setq-local adaptive-fill-mode nil) + (setq-local indent-line-function 'sas-indent-line) + (setq-local comment-start "/*") + (setq-local comment-start-skip "/[*]") + (setq-local comment-end "*/") + (setq-local comment-end-skip "[*]/") + (setq-local comment-column 40) + (setq-local ess-local-process-name nil) + (setq-local tab-stop-list ess-sas-tab-stop-list) + (setq-local font-lock-keywords-case-fold-search t) ;; Local map settings, AFTER initialization (only if not yet defined) - (if sas-mode-local-map - nil + (unless sas-mode-local-map (setq sas-mode-local-map (copy-keymap (current-local-map))) (ess-sas-edit-keys-set ess-sas-edit-keys-toggle) (if ess-sas-local-unix-keys (ess-sas-local-unix-keys)) @@ -196,7 +227,7 @@ Better logic needed! (see 2 uses, in this file).") (if ess-sas-global-unix-keys (ess-sas-global-unix-keys)) (if ess-sas-global-pc-keys (ess-sas-global-pc-keys))) (define-key sas-mode-local-map ";" 'ess-electric-run-semicolon) - + (define-key sas-mode-local-map (kbd "\C-c\C-w") 'ess-multi-frame-SAS) ;; this is a mess ;; interactive and batch commands share sas-mode-local-map, ;; but the associated commands are very different @@ -216,14 +247,9 @@ Better logic needed! (see 2 uses, in this file).") (use-local-map sas-mode-local-map) - (set (make-local-variable 'font-lock-defaults) - ;; KEYWORDS KEYWORDS-ONLY CASE-FOLD ..... - '(SAS-mode-font-lock-defaults nil t)) - ;; ^^ this *should* set - ;; font-lock-keywords-case-fold-search, but it fails for Emacs 22.[23] - ;; hence : - (setq font-lock-keywords-case-fold-search t) - (run-mode-hooks 'SAS-mode-hook)) + (setq font-lock-defaults + ;; KEYWORDS KEYWORDS-ONLY CASE-FOLD ..... + '(SAS-mode-font-lock-defaults nil t))) ;;;###autoload @@ -298,14 +324,8 @@ their own frames." (with-current-buffer "*SAS.lst*" (make-frame))) - -(add-hook 'ess-mode-hook - (lambda () - (when (string= ess-language "SAS") ;; e.g. not for R-only users - (local-set-key "\C-c\C-w" 'ess-multi-frame-SAS)))) - (defun ess-num-or-zero (arg) - "*If a number, then return that number, otherwise return 0." + "If a number, then return that number, otherwise return 0." (or (and (numberp arg) arg) 0)) ; Provide package diff --git a/elpa/ess-20181109.703/ess-sas-l.el b/elpa/ess-20190121.1430/ess-sas-l.el similarity index 94% rename from elpa/ess-20181109.703/ess-sas-l.el rename to elpa/ess-20190121.1430/ess-sas-l.el index c3720485..dcec9252 100644 --- a/elpa/ess-20181109.703/ess-sas-l.el +++ b/elpa/ess-20190121.1430/ess-sas-l.el @@ -137,25 +137,18 @@ A .lst file is a SAS listing file when: (add-to-list 'magic-mode-alist '(ess-SAS-listing-mode-p . SAS-listing-mode)) -(defun SAS-log-mode () -"`ess-transcript-mode' for SAS." -(interactive) -(SAS-mode) -(setq mode-name "ESS[LOG]") -(ess-transcript-minor-mode 1) -(setq buffer-read-only t) ;; to protect the buffer. -(buffer-disable-undo)) +(define-derived-mode SAS-log-mode SAS-mode "ESS[LOG]" + "`ess-transcript-mode' for SAS." + (ess-transcript-minor-mode 1) + (setq buffer-read-only t) ;; to protect the buffer. + (buffer-disable-undo)) (defvar sas-mode-local-map nil "contains modified local keymap for SAS") -(defun SAS-listing-mode() -"Fundamental mode with `ess-listing-minor-mode' and read-only." -(interactive) -(fundamental-mode) -(setq mode-name "ESS[LST]") -(ess-listing-minor-mode 1) -(use-local-map sas-mode-local-map) -(setq buffer-read-only t) ;; to protect the buffer. -(buffer-disable-undo)) +(define-derived-mode SAS-listing-mode special-mode "ESS[LST]" + "Fundamental mode with `ess-listing-minor-mode' and read-only." + :keymap sas-mode-local-map + (ess-listing-minor-mode 1) + (buffer-disable-undo)) (fset 'sas-log-mode 'SAS-log-mode) (fset 'SAS-transcript-mode 'SAS-log-mode) @@ -164,17 +157,17 @@ A .lst file is a SAS listing file when: (fset 'sas-listing-mode 'SAS-listing-mode) (defcustom sas-indent-width 4 - "*Amount to indent sas statements." + "Amount to indent sas statements." :group 'ess-sas :type 'integer) (defcustom sas-indent-ignore-comment "*" - "*Comments that start with this string are ignored in indentation." + "Comments that start with this string are ignored in indentation." :group 'ess-sas :type 'string) (defcustom sas-require-confirmation t - "*Require confirmation when revisiting a modified sas-output file." + "Require confirmation when revisiting a modified sas-output file." :group 'ess-sas :type 'boolean) @@ -183,19 +176,13 @@ A .lst file is a SAS listing file when: :group 'ess-sas :type 'hook) - ;never used--see ess-sas-submit-command-options in ess-sas-a.el - ;(defcustom sas-options-string "" - ; "*Options to be passed to sas as if typed on the command line." - ; :group 'ess-sas - ; :type 'string) - (defcustom sas-notify t - "*Beep and display message when job is done." + "Beep and display message when job is done." :group 'ess-sas :type 'boolean) (defcustom sas-error-notify t - "*If `sas-notify' t, indicate errors in log file upon completion." + "If `sas-notify' t, indicate errors in log file upon completion." :group 'ess-sas :type 'boolean) @@ -211,23 +198,23 @@ A .lst file is a SAS listing file when: :group 'ess-sas) (defcustom sas-page-number-max-line 3 - "*Number of lines from the page break, to search for the page + "Number of lines from the page break, to search for the page number." :group 'ess-sas :type 'integer) (defcustom sas-notify-popup nil - "*If this and sas-notify are t), popup a window when SAS job ends." + "If this and `sas-notify' are t), popup a window when SAS job ends." :group 'ess-sas :type 'boolean) (defcustom sas-tmp-libname "_tmp_" - "*Libname to use for sas-get-dataset." + "Libname to use for sas-get-dataset." :group 'ess-sas :type 'string) (defcustom sas-file-name nil - "*The name of the current sas file." + "The name of the current sas file." :group 'ess-sas :type '(choice (const nil) file)) @@ -252,39 +239,6 @@ number." (defvar sas-file-root nil) (defvar sas-submitable nil) (defvar sas-dataset nil) -(defvar SAS-syntax-table nil "Syntax table for SAS code.") - -(if SAS-syntax-table nil - (setq SAS-syntax-table (make-syntax-table)) - - ;; (if (equal system-type 'windows-nt) - ;; ;; backslash is punctuation (used in MS file names) - ;; (modify-syntax-entry ?\\ "." SAS-syntax-table) - ;; ;; backslash is an escape character - ;; (modify-syntax-entry ?\\ "\\" SAS-syntax-table)) - (modify-syntax-entry ?\\ "." SAS-syntax-table) ;; backslash is punctuation - (modify-syntax-entry ?+ "." SAS-syntax-table) - (modify-syntax-entry ?- "." SAS-syntax-table) - (modify-syntax-entry ?= "." SAS-syntax-table) - (modify-syntax-entry ?% "w" SAS-syntax-table) - (modify-syntax-entry ?< "." SAS-syntax-table) - (modify-syntax-entry ?> "." SAS-syntax-table) - (modify-syntax-entry ?& "w" SAS-syntax-table) - (modify-syntax-entry ?| "." SAS-syntax-table) - (modify-syntax-entry ?\' "\"" SAS-syntax-table) - (modify-syntax-entry ?* ". 23" SAS-syntax-table) ; comment character - (modify-syntax-entry ?\; "." SAS-syntax-table) - (modify-syntax-entry ?_ "w" SAS-syntax-table) - (modify-syntax-entry ?< "." SAS-syntax-table) - (modify-syntax-entry ?> "." SAS-syntax-table) - (modify-syntax-entry ?/ ". 14" SAS-syntax-table) ; comment character - (modify-syntax-entry ?. "w" SAS-syntax-table)) - -(require 'font-lock); fontification also works in terminals! -;; (if (or window-system -;; noninteractive) ; compilation! -;;; ... - (defvar SAS-mode-font-lock-defaults (if ess-sas-run-regexp-opt @@ -827,34 +781,6 @@ number." )) "Font Lock regexs for SAS.") - -(defvar SAS-editing-alist - '((sentence-end . ";[\t\n */]*") - (paragraph-start . "^[ \t]*$") - (paragraph-separate . "^[ \t]*$") - (paragraph-ignore-fill-prefix . t) - ;;(fill-paragraph-function . 'lisp-fill-paragraph) - (adaptive-fill-mode . nil) - (indent-line-function . 'sas-indent-line) - ;;(indent-region-function . 'sas-indent-region) - (require-final-newline . mode-require-final-newline) - (comment-start . "/*") - (comment-start-skip . "/[*]") - (comment-end . "*/") - (comment-end-skip . "[*]/") - (comment-column . 40) - ;;(comment-indent-function . 'lisp-comment-indent) - (parse-sexp-ignore-comments . t) - (ess-style . ess-default-style) - (ess-local-process-name . nil) - ;;(ess-keep-dump-files . 'ask) - (tab-stop-list . ess-sas-tab-stop-list) - (ess-mode-syntax-table . SAS-syntax-table) - (font-lock-keywords-case-fold-search . t) - (font-lock-defaults . '(SAS-mode-font-lock-defaults))) - "General options for editing SAS source files.") - - (defun beginning-of-sas-statement (arg &optional comment-start) "Move point to beginning of current sas statement." (interactive "P") @@ -1585,13 +1511,10 @@ page ; ;; variables section (defvar sas-dir-mode-map nil) -(defvar sas-directory-name nil +(defvar-local sas-directory-name nil "Name of directory associated with this buffer.") -(make-variable-buffer-local 'sas-directory-name) -(defvar sas-dir-buf-end nil) -(make-variable-buffer-local 'sas-dir-buf-end) -(defvar sas-sorted-by-num nil) -(make-variable-buffer-local 'sas-sorted-by-num) +(defvar-local sas-dir-buf-end nil) +(defvar-local sas-sorted-by-num nil) ;; user variables ;; keymaps etc... @@ -1626,17 +1549,9 @@ page ; '("Submit File " . submit-sas)) ) - ;(require 'sas) - -(defun sas-dir-mode () +(define-derived-mode sas-dir-mode special-mode "SAS" "Major mode for managing sas files." - (interactive) - (kill-all-local-variables) - (use-local-map sas-dir-mode-map) - (setq major-mode 'sas-dir-mode) - (setq mode-name "SAS") - (setq sas-directory-name (expand-file-name default-directory)) - (setq buffer-read-only 1)) + (setq sas-directory-name (expand-file-name default-directory))) ;;(defun sas-make-library (directory &optional update) diff --git a/elpa/ess-20181109.703/ess-site.el b/elpa/ess-20190121.1430/ess-site.el similarity index 90% rename from elpa/ess-20181109.703/ess-site.el rename to elpa/ess-20190121.1430/ess-site.el index 7130a180..45b74867 100644 --- a/elpa/ess-20181109.703/ess-site.el +++ b/elpa/ess-20190121.1430/ess-site.el @@ -95,18 +95,13 @@ for ESS, such as icons.") ;;; Loading popular dialects (they should become optional in the future) ;; R and Julia +(require 'ess-sp6-d) (require 'ess-r-mode) (when (require 'julia-mode nil 'no-error) (require 'ess-julia)) -;; S-PLUS (MathSoft/StatSci/Insightful/TIBCO) -(require 'ess-sp3-d) -(if ess-microsoft-p - (require 'ess-sp6w-d) - (require 'ess-sp6-d)) - -;; S-elsewhere, on another machine by telnet +;; ess-remote (require 'essd-els) ;; Stata, SAS, BUGS, and JAGS @@ -115,18 +110,6 @@ for ESS, such as icons.") (require 'ess-bugs-d) (require 'ess-jags-d) -(ess-write-to-dribble-buffer - (format "[ess-site.el]: ess-customize-alist=%s \n" - ess-customize-alist)) - -;;; Literate Data Analysis -(require 'ess-noweb) -(require 'ess-swv) - -(ess-write-to-dribble-buffer - (format "[ess-site.el _2_]: ess-customize-alist=%s \n" - ess-customize-alist)) - ;;; Speedbar and mouse (require 'ess-mouse) diff --git a/elpa/ess-20181109.703/ess-sp6-d.el b/elpa/ess-20190121.1430/ess-sp6-d.el similarity index 87% rename from elpa/ess-20181109.703/ess-sp6-d.el rename to elpa/ess-20190121.1430/ess-sp6-d.el index c2937d12..6fe58c6a 100644 --- a/elpa/ess-20181109.703/ess-sp6-d.el +++ b/elpa/ess-20190121.1430/ess-sp6-d.el @@ -39,7 +39,6 @@ (require 'ess-mode) (require 'ess-inf) (require 'ess-s-lang) -(require 'ess-dde) (require 'ess-trns) @@ -76,18 +75,8 @@ (ess-object-name-db-file . "ess-sp6-namedb.el") (inferior-ess-program . inferior-S+-program) (inferior-ess-help-command . "help(\"%s\", pager=\"slynx -dump\", window=FALSE)\n") - (inferior-ess-help-filetype . nil) (inferior-ess-search-list-command . "searchPaths()\n") - (ess-send-region-function . #'ess-dde-send-region) - (ess-load-file-function . #'ess-dde-load-file) - (ess-command-function . #'ess-dde-command) - (ess-eval-linewise-function . #'ess-dde-eval-linewise) - (ess-dump-object-function . #'ess-dde-dump-object) - (ess-read-object-name-function . #'ess-dde-read-object-name) - (ess-find-help-file-function . #'ess-dde-find-help-file) - (ess-display-help-on-object-function . #'ess-dde-display-help-on-object) - (ess-directory-function . S+-directory-function) (ess-setup-directory-function . S+-setup-directory-function) (inferior-ess-start-args . inferior-S+-start-args) @@ -141,15 +130,16 @@ New way to do it." "Major mode for editing S+ source. See `ess-mode' for more help." (interactive) (setq ess-customize-alist S+-customize-alist) - (ess-mode S+-customize-alist proc-name) + (setq-local ess-local-customize-alist S+-customize-alist) + (ess-mode) (if (fboundp 'ess-add-toolbar) (ess-add-toolbar)) - (if ess-imenu-use-S (ess-imenu-S))) + (setq imenu-generic-expression ess-imenu-S-generic-expression) + (when ess-imenu-use-S (imenu-add-to-menubar "Imenu-S"))) (defalias 'S+6-transcript-mode 'S+-transcript-mode) -(defun S+-transcript-mode () +(define-derived-mode S+-transcript-mode ess-transcript-mode "ESS S Transcript" "S-PLUS 6 transcript mode." - (interactive) - (ess-transcript-mode S+-customize-alist)) + :syntax-table S-syntax-table) (defvar ess-s-versions '("Splus") "List of partial strings for versions of S to access within ESS. @@ -161,7 +151,7 @@ file \"Splus7\" is found and this variable includes the string version of S. If duplicate versions of the same program are found (which happens if the same path is listed on `exec-path' more than once), they are -ignored by calling `ess-uniq-list'. +ignored by calling `delete-dups'. Set this variable to nil to disable searching for other versions of S using this method. If you set this variable, you need to restart Emacs (and set this variable @@ -179,7 +169,7 @@ created. The functions will normally be placed on the menubar upon ESS initialization." (when ess-s-versions (let ((versions - (ess-uniq-list + (delete-dups (mapcar #'file-name-nondirectory (apply #'nconc (mapcar #'ess-find-exec-completions @@ -197,11 +187,7 @@ ESS initialization." (easy-menu-add-item ess-mode-menu '("Start Process") (cons "Other" new-menu))))))) ;; Define the runners -(if ess-microsoft-p - (nconc - (ess-sqpe-versions-create ess-SHOME-versions) ;; 32-bit - (ess-sqpe-versions-create ess-SHOME-versions-64 "-64-bit")) ;; 64-bit - (ess-s-define-runners)) +(ess-s-define-runners) (define-obsolete-function-alias 'ess-s-versions-create 'ess-s-define-runners "ESS 18.10") diff --git a/elpa/ess-20181109.703/ess-stata-lang.el b/elpa/ess-20190121.1430/ess-stata-lang.el similarity index 95% rename from elpa/ess-20181109.703/ess-stata-lang.el rename to elpa/ess-20190121.1430/ess-stata-lang.el index 9ef2a446..806cf1b9 100644 --- a/elpa/ess-20181109.703/ess-stata-lang.el +++ b/elpa/ess-20190121.1430/ess-stata-lang.el @@ -47,19 +47,15 @@ ;;; Code: +(declare-function ess-help-mode "ess-help") + (require 'make-regexp) ; it's now local to the directory. ;;(load-library "make-regexp") ;; this is necessary for ;; ado-set-font-lock-keywords ;; only needed in Emacs >= 22.x -(unless (boundp 'c-emacs-features) - (require 'cc-vars));; for syntax-table (require 'comint) (require 'ess-trns) - ;(setq max-lisp-eval-depth 500) -(eval-when-compile - (setq max-lisp-eval-depth (max 600 max-lisp-eval-depth))) - (defconst ess-help-STA-sec-keys-alist '((?d . "Description") (?e . "Examples") @@ -77,32 +73,6 @@ regexp-search, and so specials should be quoted. (defconst ess-help-STA-sec-regex "^[A-Z a-z]+:?\n-+\\|http:" "Reg(ular) Ex(pression) of section headers in help file.") -(defvar STA-syntax-table - (let ((tbl (make-syntax-table))) - (modify-syntax-entry ?\\ "." tbl) ;nullify escape meaning - (modify-syntax-entry ?\$ "." tbl) - (modify-syntax-entry ?` "(\'" tbl) - (modify-syntax-entry ?\' ")`" tbl) - ;;--------- begin cut-and-paste from lisp/progmodes/c-langs.el - (modify-syntax-entry ?/ ". 124b" tbl) - (modify-syntax-entry ?* ". 23" tbl) - (modify-syntax-entry ?\n "> b" tbl) - ;; Give CR the same syntax as newline, for selective-display - (modify-syntax-entry ?\^m "> b" tbl) - ;;--------- end cut-and-paste ------------------ - (modify-syntax-entry ?+ "." tbl) - (modify-syntax-entry ?- "." tbl) - (modify-syntax-entry ?= "." tbl) - (modify-syntax-entry ?% "." tbl) - (modify-syntax-entry ?< "." tbl) - (modify-syntax-entry ?> "." tbl) - (modify-syntax-entry ?& "." tbl) - (modify-syntax-entry ?| "." tbl) - (modify-syntax-entry ?~ "." tbl) - - tbl) - "Syntax table for Stata code.") - (defun ado-set-font-lock-keywords () "Create font lock keywords for Stata syntax. This is from the ado-mode of Bill Rising , and uses make-regexp." @@ -1122,18 +1092,14 @@ ado-mode of Bill Rising , and uses make-regexp." '((paragraph-start . (concat "[ \t\f]*$\\|" page-delimiter)) (paragraph-separate . (concat "[ \t\f]*$\\|" page-delimiter)) (paragraph-ignore-fill-prefix . t) - (require-final-newline . mode-require-final-newline) (comment-column . 40) ;;(comment-indent-function . 'S-comment-indent) ;;(ess-comment-indent . 'S-comment-indent) ;;(ess-indent-line . 'S-indent-line) ;;(ess-calculate-indent . 'ess-calculate-indent) (indent-line-function . 'ess-indent-line) - (parse-sexp-ignore-comments . t) - (ess-style . ess-default-style) (ess-local-process-name . nil) ;;(ess-keep-dump-files . 'ask) - (ess-mode-syntax-table . STA-syntax-table) (font-lock-defaults . '(ess-STA-mode-font-lock-defaults nil nil ((?\. . "w"))))) "General options for editing Stata do and ado source files.") @@ -1168,7 +1134,7 @@ ado-mode of Bill Rising , and uses make-regexp." ;;;;;;;;; Things to change (defvar stata-switches "-q" - "*Switches to apply to stata invocation.") + "Switches to apply to stata invocation.") (defvar stata-profile "~/.stataprofile" "File to read on startup (nil for no file).") @@ -1249,15 +1215,10 @@ PROC is the stata process. Does not change point." (if (< (point) start-of-output) (goto-char start-of-output)) (not (looking-at "^. ")))))) -(defun stata-help-mode () +(define-derived-mode ess-stata-help-mode ess-help-mode "Stata help" "Major mode for displaying Stata help in a read-only buffer. Active commands are Help (\\[stata-help]) and hyperlink -(\\[stata-rehelp] or mouse-2)." - (interactive) - (setq major-mode 'stata-help-mode) - (setq mode-name "Stata help") - ;;(use-local-map stata-help-mode-map) - (setq buffer-read-only t)) +(\\[stata-rehelp] or mouse-2).") ;;; Suggested function from Brendan Halpin: (defvar ess-STA-delimit-do-file "delimit-do.do") diff --git a/elpa/ess-20181109.703/ess-stata-mode.el b/elpa/ess-20190121.1430/ess-stata-mode.el similarity index 64% rename from elpa/ess-20181109.703/ess-stata-mode.el rename to elpa/ess-20190121.1430/ess-stata-mode.el index 646ccf47..c99a00a5 100644 --- a/elpa/ess-20181109.703/ess-stata-mode.el +++ b/elpa/ess-20190121.1430/ess-stata-mode.el @@ -38,14 +38,37 @@ (defvar STA-dialect-name "stata" "Name of 'dialect' for Stata.");easily changeable in a user's .emacs +(defvar ess-stata-mode-syntax-table + (let ((tbl (copy-syntax-table ess-mode-syntax-table))) + (modify-syntax-entry ?\\ "." tbl) ;nullify escape meaning + (modify-syntax-entry ?\$ "." tbl) + (modify-syntax-entry ?` "(\'" tbl) + (modify-syntax-entry ?\' ")`" tbl) + ;;--------- begin cut-and-paste from lisp/progmodes/c-langs.el + (modify-syntax-entry ?/ ". 124b" tbl) + (modify-syntax-entry ?* ". 23" tbl) + (modify-syntax-entry ?\n "> b" tbl) + ;; Give CR the same syntax as newline, for selective-display + (modify-syntax-entry ?\^m "> b" tbl) + ;;--------- end cut-and-paste ------------------ + (modify-syntax-entry ?+ "." tbl) + (modify-syntax-entry ?- "." tbl) + (modify-syntax-entry ?= "." tbl) + (modify-syntax-entry ?% "." tbl) + (modify-syntax-entry ?< "." tbl) + (modify-syntax-entry ?> "." tbl) + (modify-syntax-entry ?& "." tbl) + (modify-syntax-entry ?| "." tbl) + (modify-syntax-entry ?~ "." tbl) + tbl) + "Syntax table for `ess-stata-mode'.") + (defvar STA-customize-alist '((ess-local-customize-alist . 'STA-customize-alist) (ess-language . "STA") (ess-dialect . STA-dialect-name) (ess-suffix . "ado") (ess-mode-editing-alist . STA-editing-alist) - (ess-mode-syntax-table . STA-syntax-table) - (ess-mode-edit . 'STA-mode) (ess-help-sec-regex . ess-help-STA-sec-regex) (ess-help-sec-keys-alist . ess-help-STA-sec-keys-alist) (ess-loop-timeout . 500000 ) @@ -60,7 +83,6 @@ (inferior-ess-primary-prompt . "[.:] \\|--more--") (inferior-ess-secondary-prompt . "--more--") (comint-use-prompt-regexp . t) - (inferior-ess-start-file . inferior-STA-start-file) ;"~/.ess-stata") (inferior-ess-start-args . inferior-STA-start-args) (ess-get-help-topics-function . 'ess-get-STA-help-topics) (inferior-ess-search-list-command . "set more off\n search()\n") @@ -76,19 +98,29 @@ ;;;###autoload -(defun STA-mode (&optional proc-name) - "Major mode for editing Stata source. See `ess-mode' for more help." - (interactive) - (setq ess-customize-alist STA-customize-alist) - (ess-mode STA-customize-alist proc-name)) - -(fset 'stata-mode 'STA-mode) -(fset 'Stata-mode 'STA-mode) +(define-derived-mode ess-stata-mode ess-mode "ESS[STA]" + "Major mode for editing Stata source." + (ess-setq-vars-local STA-customize-alist) + (setq-local comint-use-prompt-regexp t) + (setq-local comment-column 40) + (setq-local comment-end " \*/") + (setq-local comment-start "/\* ") + (setq-local comment-start-skip "/\\*+ *") + (setq-local comment-use-syntax t) + (setq-local indent-line-function 'ess-indent-line) + (setq-local paragraph-ignore-fill-prefix t) + (setq-local paragraph-separate (concat "[ \t\f]*$\\|" page-delimiter)) + (setq-local paragraph-start (concat "[ \t\f]*$\\|" page-delimiter)) + (setq font-lock-defaults '(ess-STA-mode-font-lock-defaults nil nil ((?\. . "w"))))) + +(defalias 'STA-mode 'ess-stata-mode) +(defalias 'stata-mode 'ess-stata-mode) +(defalias 'Stata-mode 'ess-stata-mode) ;;;###autoload -(add-to-list 'auto-mode-alist '("\\.do\\'" . STA-mode)) +(add-to-list 'auto-mode-alist '("\\.do\\'" . ess-stata-mode)) ;;;###autoload -(add-to-list 'auto-mode-alist '("\\.ado\\'" . STA-mode)) +(add-to-list 'auto-mode-alist '("\\.ado\\'" . ess-stata-mode)) (defun ess-sta-remove-comments (string) @@ -134,11 +166,35 @@ This function is placed in `ess-presend-filter-functions'. (add-hook 'ess-presend-filter-functions 'ess-sta-remove-comments nil 'local) (run-mode-hooks 'ess-stata-post-run-hook))))) +(defvar inferior-ess-stata-mode-syntax-table + (let ((tab (copy-syntax-table ess-stata-mode-syntax-table))) + tab) + "Syntax table for `inferior-ess-stata-mode'.") -(defun STA-transcript-mode () +(define-derived-mode inferior-ess-stata-mode inferior-ess-mode "iESS" + "Inferior `stata' mode." + (ess-setq-vars-local STA-customize-alist) + (setq-local comint-use-prompt-regexp t) + (setq font-lock-defaults '(ess-STA-mode-font-lock-defaults nil nil ((?\. . "w"))))) + + +(define-derived-mode ess-stata-transcript-mode ess-transcript-mode "ESS Transcript" + :syntax-table ess-stata-mode-syntax-table "Stata transcript mode." - (interactive) - (ess-transcript-mode STA-customize-alist)) + (ess-setq-vars-local STA-customize-alist) + (setq-local comint-use-prompt-regexp t) + (setq-local comment-column 40) + (setq-local comment-end " \*/") + (setq-local comment-start "/\* ") + (setq-local comment-start-skip "/\\*+ *") + (setq-local comment-use-syntax t) + (setq-local indent-line-function 'ess-indent-line) + (setq-local paragraph-ignore-fill-prefix t) + (setq-local paragraph-separate (concat "[ \t\f]*$\\|" page-delimiter)) + (setq-local paragraph-start (concat "[ \t\f]*$\\|" page-delimiter)) + (setq font-lock-defaults '(ess-STA-mode-font-lock-defaults nil nil ((?\. . "w"))))) + +(defalias 'STA-transcript-mode 'ess-stata-mode-syntax-table) (defun ess--STA-retrive-topics-from-search () (with-current-buffer (ess-command inferior-ess-search-list-command) @@ -167,8 +223,6 @@ This function is placed in `ess-presend-filter-functions'. text))) (apply #'ess-eval-linewise text t args))) - ; Provide package - (provide 'ess-stata-mode) ;;; ess-stata-mode.el ends here diff --git a/elpa/ess-20181109.703/ess-toolbar.el b/elpa/ess-20190121.1430/ess-toolbar.el similarity index 100% rename from elpa/ess-20181109.703/ess-toolbar.el rename to elpa/ess-20190121.1430/ess-toolbar.el diff --git a/elpa/ess-20181109.703/ess-tracebug.el b/elpa/ess-20190121.1430/ess-tracebug.el similarity index 91% rename from elpa/ess-20181109.703/ess-tracebug.el rename to elpa/ess-20190121.1430/ess-tracebug.el index bed3b14e..a0380b63 100644 --- a/elpa/ess-20181109.703/ess-tracebug.el +++ b/elpa/ess-20190121.1430/ess-tracebug.el @@ -1,4 +1,4 @@ -;; ess-tracebug.el --- Tracing and debugging facilities for ESS. +;; ess-tracebug.el --- Tracing and debugging facilities for ESS. -*- lexical-binding: t; -*- ;; ;; Copyright (C) 2011--2017 A.J. Rossini, Richard M. Heiberger, Martin Maechler, ;; Kurt Hornik, Rodney Sparapani, Stephen Eglen and Vitalie Spinu. @@ -25,14 +25,6 @@ ;; A copy of the GNU General Public License is available at ;; https://www.r-project.org/Licenses/ -;; -;; Features that might be required by this library: -;; -;; ESS - required -;; ido, face-remap, cl - desirable and are part of default emacs -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; ;;; Commentary: ;; Ess-tracebug is a package for interactive debugging of R code from ;; ESS and provides such features as: @@ -43,9 +35,8 @@ ;; - highlighting of error source references and easy error navigation ;; - interactive traceback. ;; -;; For a complete description please see the documentation at -;; https://code.google.com/p/ess-tracebug/ and a brief tutorial at -;; https://code.google.com/p/ess-tracebug/wiki/GettingStarted +;; For a complete description please see the documentation in the ESS +;; manual. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -54,7 +45,8 @@ (eval-when-compile (require 'cl) (require 'cl-lib) - (require 'tramp)) + (require 'tramp) + (require 'subr-x)) (require 'comint) (require 'compile) (require 'overlay) @@ -71,6 +63,7 @@ (defvar ess--dbg-del-empty-p) (defvar inferior-ess-mode-map) (defvar ess-mode-map) +(defvar ess--inhibit-presend-hooks) (declare-function ess--accumulation-buffer "ess-inf") (declare-function ess--if-verbose-write-process-state "ess-inf") (declare-function ess--run-presend-hooks "ess-inf") @@ -87,11 +80,11 @@ (declare-function ess-process-live-p "ess-inf") (declare-function ess-process-put "ess-inf") (declare-function ess-send-string "ess-inf") -(declare-function ess-show-buffer "ess-inf") (declare-function ess-switch-to-ESS "ess-inf") (declare-function ess-wait-for-process "ess-inf") +(declare-function ess-eval-region--normalise-region "ess-inf" ) (declare-function inferior-ess-run-callback "ess-inf") -(declare-function inferior-ess-set-status "ess-inf") +(declare-function inferior-ess--set-status "ess-inf") (declare-function ess-helpobjs-at-point--read-obj "ess-help") (declare-function ess-r-get-evaluation-env "ess-r-mode") (declare-function ess-r-package--all-source-dirs "ess-r-package") @@ -103,6 +96,12 @@ ;; here. (declare-function tramp-dissect-file-name "tramp") (declare-function tramp-get-remote-tmpdir "tramp") +;; The following declares can be removed once we drop Emacs 25 +(declare-function tramp-file-name-method "tramp") +(declare-function tramp-file-name-user "tramp") +(declare-function tramp-file-name-host "tramp") +(declare-function tramp-file-name-localname "tramp") +(declare-function tramp-file-name-hop "tramp") (defgroup ess-tracebug nil @@ -115,16 +114,8 @@ Currently only R is supported." "String to be displayed in mode-line alongside the process name. Indicates that ess-tracebug-mode is turned on.") -;; (defvar ess--tracebug-p nil -;; "Non nil if ess-tracebug is turned on for current process. -;; Function `ess-tracebug' toggles on/off this variable.") -;; (make-variable-buffer-local 'ess--tracebug-p) -;; (add-to-list 'minor-mode-alist '(ess--tracebug-p ess-tracebug-indicator)) - (defvar ess-watch-mode-map (let ((map (make-sparse-keymap))) - (set-keymap-parent map special-mode-map) - (define-key map "?" 'ess-watch-help) (define-key map "k" 'ess-watch-kill) ;; (define-key ess-watch-mode-map "u" 'ess-watch-undelete) ;; editing requires a little more work. @@ -143,13 +134,11 @@ Indicates that ess-tracebug-mode is turned on.") (define-key map "\C-c\C-y" 'ess-switch-to-ESS) (define-key map "\C-c\C-z" 'ess-switch-to-end-of-ESS) map) - "Keymap for the *R watch* buffer. - -\\{ess-watch-mode-map}") + "Keymap for `ess-watch-mode'.") (defcustom ess-tracebug-prefix nil - "*Key to be used as prefix for all `ess-tracebug' commands. + "Key to be used as prefix for all `ess-tracebug' commands. Set this to a key cominbation you don't use often, like: (setq ess-tracebug-prefix \"\\M-t\") @@ -159,10 +148,6 @@ The postfix keys are defined in `ess-tracebug-map': :type '(choice (const nil) (string)) :group 'ess-tracebug) -;; (make-obsolete-variable 'ess-tracebug-prefix "ess-tracebug-prefix will be removed in future versions. -;; Electric debug keys are now on C-c and ess-dev maps." "ESS 13.05") -;; (define-obsolete-variable-alias 'ess-tracebug-command-prefix 'ess-tracebug-prefix) - (defcustom ess-tracebug-search-path nil "List of directories to search for source files. Elements should be directory names, not file names of directories." @@ -197,9 +182,8 @@ of steps decreases the height by the same amount)" :group 'ess-debug :type 'integer) -(defvar ess-watch-current-block-overlay nil +(defvar-local ess-watch-current-block-overlay nil "The overlay for currently selected block in the R watch buffer .") -(make-variable-buffer-local 'ess-watch-current-block-overlay) (defcustom ess-inject-source 'function-and-buffer "Control the source injection into evaluated code. @@ -340,6 +324,7 @@ command conforms to VISIBLY." (defun ess-tracebug-send-region (process start end &optional visibly message type) "Send region to process adding source references as specified by `ess-inject-source' variable." + (ess-eval-region--normalise-region start end) (let* ((inject-p (cond ((eq type 'function) ess-inject-source) ((eq type 'buffer) @@ -416,7 +401,7 @@ by `ess-inject-source' variable." ;; I . Goto input event marker backwards . `ess-debug-goto-input-event-marker' -(defun ess-tracebug-show-help (&optional ev) +(defun ess-tracebug-show-help () "Show help for `ess-tracebug'." (interactive) (describe-variable 'ess-tracebug-help)) @@ -554,9 +539,8 @@ Local in iESS buffers with `ess-tracebug' mode enabled.") "Overlay to highlight the position of last input in iESS buffer. Local in iESS buffers.") -(defvar ess--busy-count 0 +(defvar-local ess--busy-count 0 "Used to compute the busy indicator.") -(make-variable-buffer-local 'ess--busy-count) ;; (unless (boundp 'ess--busy-slash) ;; (defvar ess--busy-slash '(32 ?\u2014 92 47)) @@ -711,7 +695,6 @@ You can bind 'no-select' versions of this commands: (if (re-search-forward "No traceback available" nil t) (message "No traceback available") (ess-dirs) - (message nil) (make-local-variable 'compilation-error-regexp-alist) (when (boundp 'ess-r-error-regexp-alist) (setq compilation-error-regexp-alist ess-r-error-regexp-alist)) @@ -758,13 +741,11 @@ This is the value of `next-error-function' in iESS buffers." ;; Modified version of `compilation-next-error-function'. (interactive "p") (if reset (goto-char (point-max))) - (let* ((columns compilation-error-screen-columns) ; buffer's local value + (let* (;; (columns compilation-error-screen-columns) ; buffer's local value ;; (proc (or (get-buffer-process (current-buffer)) ;; (error "Current buffer has no process"))) (pbuff-p (get-buffer-process (current-buffer))) - (last 1) (n (or n 1)) - timestamp (beg-pos ; from where the search for next error starts (if (and pbuff-p (>= n 0) @@ -773,7 +754,7 @@ This is the value of `next-error-function' in iESS buffers." (point))) (at-error t) (msg - (condition-case err + (condition-case nil (compilation-next-error n nil beg-pos) (error (when pbuff-p @@ -790,7 +771,7 @@ This is the value of `next-error-function' in iESS buffers." (message "Beyond last-input marker") (setq at-error nil))) (marker (point-marker)) - loc end-loc) + loc) (when at-error (setq compilation-current-error (point-marker) overlay-arrow-position (if (bolp) @@ -798,10 +779,7 @@ This is the value of `next-error-function' in iESS buffers." (copy-marker (line-beginning-position))) loc (if (fboundp 'compilation--message->loc) (compilation--message->loc msg) - (car msg)) - end-loc (if (fboundp 'compilation--message->end-loc) ;; emacs 24 - (compilation--message->end-loc msg) - (nth 2 msg))) + (car msg))) (let* ((file (caar (nth 2 loc))) (col (car loc)) (line (cadr loc)) @@ -844,17 +822,14 @@ help ?options for more details." (defvar ess--dbg-output-buf-prefix " *ess.dbg" "The prefix of the buffer name the R debug output is directed to." ) -(defvar ess--dbg-current-ref (make-marker) +(defvar-local ess--dbg-current-ref (make-marker) "Current debug reference in *ess.dbg* buffers (a marker).") -(make-variable-buffer-local 'ess--dbg-current-ref) -(defvar ess--dbg-last-ref-marker (make-marker) +(defvar-local ess--dbg-last-ref-marker (make-marker) "Last debug reference in *ess.dbg* buffer (a marker).") -(make-variable-buffer-local 'ess--dbg-last-ref-marker) -(defvar ess--dbg-buf-p nil +(defvar-local ess--dbg-buf-p nil "This is t in ess.dbg buffers.") -(make-variable-buffer-local 'ess--dbg-buf-p) ;; (defcustom ess--dbg-auto-single-key-p t ;; "If t entering the debug state triggers single-key mode. @@ -976,8 +951,7 @@ The SPEC should be one of the components of The action list is in `ess-debug-error-action-alist'." (interactive) (ess-force-buffer-current) - (let* ((alist ess-debug-error-action-alist) - (ev last-command-event) + (let* ((ev last-command-event) (com-char (event-basic-type ev)) (cur-action (or (ess-process-get 'on-error-action) "")) actions act) @@ -1039,7 +1013,7 @@ See the more info at https://code.google.com/p/ess-tracebug/#Work-Flow" (ring-insert ess--dbg-backward-ring (point-marker)) ;; insert in backward ring ;;todo: check if the marker to this (close by?) position is already in the ring (setq input-point (ring-ref ess--dbg-forward-ring 0))) (when (marker-buffer input-point) ;; todo: give a message here if buff is not found - (switch-to-buffer (marker-buffer input-point)) + (pop-to-buffer-same-window (marker-buffer input-point)) (when (marker-position input-point) (goto-char (marker-position input-point)))) (while (eq (event-basic-type (event-basic-type (setq ev (read-event)))) com-char) @@ -1051,7 +1025,7 @@ See the more info at https://code.google.com/p/ess-tracebug/#Work-Flow" ;; get it from forward-ring (setq input-point (ring-ref ess--dbg-forward-ring ring-el)) ) (when (marker-buffer input-point) - (switch-to-buffer (marker-buffer input-point)) + (pop-to-buffer-same-window (marker-buffer input-point)) (when (marker-position input-point) (goto-char (marker-position input-point))))) (push ev unread-command-events))) @@ -1070,10 +1044,10 @@ of the ring." (ring-el 0)) (if (ess--dbg-is-active-p) (progn - (switch-to-buffer (marker-buffer ess--dbg-current-debug-position)) + (pop-to-buffer-same-window (marker-buffer ess--dbg-current-debug-position)) (goto-char (marker-position ess--dbg-current-debug-position )) (back-to-indentation)) - (switch-to-buffer (marker-buffer debug-point)) + (pop-to-buffer-same-window (marker-buffer debug-point)) (goto-char (marker-position debug-point))) (while (eq (event-basic-type (setq ev (read-event))) com-char) (if (memq 'shift (event-modifiers ev)) @@ -1081,7 +1055,7 @@ of the ring." (setq ring-el (1+ ring-el))) (setq debug-point (ring-ref ess--dbg-backward-ring ring-el)) (when (marker-buffer debug-point) - (switch-to-buffer (marker-buffer debug-point)) + (pop-to-buffer-same-window (marker-buffer debug-point)) (when (marker-position debug-point) (goto-char (marker-position debug-point))))) (push ev unread-command-events))) @@ -1199,7 +1173,6 @@ Kill the *ess.dbg.[R_name]* buffer." (redisplay)) (setq ess--busy-count (1+ (mod ess--busy-count (1- (length ess-busy-strings))))) (force-mode-line-update) - ;; looks like redisplay is necessary for emacs > 24.4 (redisplay))))))) ;; (ess--make-busy-prompt-function (get-process "R")) @@ -1214,10 +1187,10 @@ Kill the *ess.dbg.[R_name]* buffer." (and (ess-process-live-p) (ess-process-get 'is-recover))) -(defun ess-debug-active-p () - (and (ess-process-live-p) - (or (ess-process-get 'dbg-active) - (ess-process-get 'is-recover)))) +(defun ess-debug-active-p (&optional proc) + (and (ess-process-live-p proc) + (or (ess-process-get 'dbg-active proc) + (ess-process-get 'is-recover proc)))) (defvar ess--dbg-regexp-reference "debug \\w+ +\\(.+\\)#\\([0-9]+\\):") (defvar ess--dbg-regexp-jump "debug \\w+ ") ;; debug at ,debug bei ,etc @@ -1311,8 +1284,7 @@ value as it might be a continuation prompt." "> ")) ((eq inferior-ess-replace-long+ t) (let ((prompt (replace-regexp-in-string "\\(\\+ \\)\\{2\\}\\(\\+ \\)+" - ess-long+replacement prompt)) - (len (length prompt))) + ess-long+replacement prompt))) (if (and last+ (not is-final)) ;; append > for aesthetic reasons (concat prompt "> ") @@ -1346,6 +1318,7 @@ prompts." (when (timerp flush-timer) (cancel-timer flush-timer)) (if (eq (buffer-local-value 'major-mode pbuf) 'fundamental-mode) + ;; FIXME: this cannot be, ess-command changes the filter ;; Just in case if we are in *ess-command* buffer; restart the timer. (process-put proc 'flush-timer (run-at-time .02 nil #'ess--flush-accumulated-output proc)) @@ -1354,7 +1327,7 @@ prompts." (goto-char (point-min)) (let ((case-fold-search nil)) (when (re-search-forward "Error\\(:\\| +in\\)" nil t) - (ess-show-buffer (process-buffer proc)))) + (display-buffer (process-buffer proc)))) (goto-char (point-min)) ;; First long + + in the output mirrors the sent input by the user and ;; is unnecessary in nowait case. A single + can be a continuation in @@ -1377,8 +1350,7 @@ prompts." ;; > and 2+ spaces "\\(^\\([+>] \\)\\{2,\\}\\)\\|\\(> \\) +" "^\\([+>] \\)+")) - (prev-prompt (process-get proc 'prev-prompt)) - (eol (point-at-eol))) + (prev-prompt (process-get proc 'prev-prompt))) (while (re-search-forward regexp nil t) (setq pos1 (match-beginning 0) tpos (if nowait @@ -1415,12 +1387,14 @@ prompts." (erase-buffer))))))) (defun inferior-ess-tracebug-output-filter (proc string) - "Standard output filter for the inferior ESS process when `ess-debug' is active. -Call `inferior-ess-output-filter'. Check for debug + "Standard output filter for the inferior ESS process. +When `ess-debug' is active, this is the filter. Call +`inferior-ess-output-filter'. Check for debug reg-expressions (see `ess--dbg-regexp-debug',...), when found puts iESS in the debugging state. If in debugging state, mirrors the output into *ess.dbg* buffer." - (let* ((is-iess (member major-mode (list 'inferior-ess-mode 'ess-watch-mode))) + (let* ((is-iess (or (derived-mode-p 'ess-watch-mode) + (derived-mode-p 'inferior-ess-mode))) (pbuf (process-buffer proc)) (abuf (ess--accumulation-buffer proc)) (dbuff (process-get proc 'dbg-buffer)) @@ -1436,7 +1410,7 @@ the output into *ess.dbg* buffer." (string-match ess--dbg-regexp-skip string) (not (string-match ess--dbg-regexp-no-skip string)))) (match-dbg (or match-skip (and match-input (not match-selection)))) - (is-ready (not (inferior-ess-set-status proc string))) + (is-ready (inferior-ess--set-status proc string)) (new-time (float-time)) (last-time (process-get proc 'flush-time)) (flush-timer (process-get proc 'flush-timer))) @@ -1530,7 +1504,7 @@ the output into *ess.dbg* buffer." (ess--debug-keys-message-string)) (unless match-jump ;; no source reference, simply show the inferiro - (ess-show-buffer pbuf))) + (display-buffer pbuf))) (when match-selection ;(and (not was-in-recover) match-selection) (ess-electric-selection t)))) @@ -1600,19 +1574,19 @@ associated buffer. If FILE is nil return nil." (lpn ess-local-process-name)) (when mrk (let ((buf (marker-buffer mrk))) - (if (not other-window) - (switch-to-buffer buf) - (let ((this-frame (window-frame (get-buffer-window (current-buffer))))) - (display-buffer buf) - ;; simple save-frame-excursion - (unless (eq this-frame (window-frame (get-buffer-window buf t))) - (ess-select-frame-set-input-focus this-frame)))) - ;; set or re-set to lpn as this is the process with debug session on - (with-current-buffer buf - (setq ess-local-process-name lpn) - (goto-char mrk) + (if (not other-window) + (pop-to-buffer-same-window buf) + (let ((this-frame (window-frame (get-buffer-window (current-buffer))))) + (display-buffer buf) + ;; simple save-frame-excursion + (unless (eq this-frame (window-frame (get-buffer-window buf t))) + (ess-select-frame-set-input-focus this-frame)))) + ;; set or re-set to lpn as this is the process with debug session on + (with-current-buffer buf + (setq ess-local-process-name lpn) + (goto-char mrk) (set-window-point (get-buffer-window buf) mrk)) - buf)))) + buf)))) ;; temporary, hopefully org folks implement something similar (defvar org-babel-tangled-file nil) @@ -1665,7 +1639,7 @@ If FILENAME is not found at all, ask the user where to find it if (ess-r-package-source-dirs) (cl-loop for d in ess-tracebug-search-path append (ess-r-package--all-source-dirs d)))) - buffsym buffer fmts name buffername) + buffer name) (setq dirs (cons default-directory dirs)) ;; TODO: should be R working dir ;; 1. search already open buffers for match (associated file might not even exist yet) (dolist (bf (buffer-list)) @@ -1752,7 +1726,7 @@ This is the value of `next-error-function' in *ess.dbg* buffers." (set-marker ess--dbg-current-ref (line-end-position)) (set-marker overlay-arrow-position (line-beginning-position)) (setq dbuff (ess--dbg-find-buffer (car loc))) - (switch-to-buffer dbuff) + (pop-to-buffer-same-window dbuff) (save-restriction (widen) (goto-char 1) @@ -1763,22 +1737,6 @@ This is the value of `next-error-function' in *ess.dbg* buffers." (error "Moved past first debug line") (error "Moved past last debug line"))))) - -;; not used; remove in 13.09 -(defvar ess-electric-debug-map - (let ((map (make-sparse-keymap))) - (define-key map "c" 'ess-debug-command-continue) - (define-key map "C" 'ess-debug-command-continue-multi) - (define-key map "n" 'ess-debug-command-next) - (define-key map "N" 'ess-debug-command-next-multi) - (define-key map "q" 'ess-debug-command-quit) - (define-key map "u" 'ess-debug-command-up) - map) - "Keymap used to define commands for single key input mode. -This commands are triggered by `ess-electric-debug' . -\\{ess-electric-debug-map}") -(make-obsolete-variable 'ess-electric-debug-map nil "ESS 13.05") - (defun ess--debug-keys-message-string (&optional map) (let ((overriding-local-map (or map ess-debug-minor-mode-map))) (substitute-command-keys @@ -1791,48 +1749,18 @@ This commands are triggered by `ess-electric-debug' . "(\\[ess-debug-command-quit])quit") " ")))) -;; not used anywhere; remove in ESS 13.09 -(defun ess-electric-debug (&optional wait) - "Call commands defined in `ess-electric-debug-map'. -Single-key input commands are those that once invoked do not -requre the prefix command for subsequent invocation. - -For example, if the prefix key is 'C-c C-t' and -`ess-debug-command-next' is bound to 'n' and `ess-debug-command-continue' is -bound to 'c' then 'C-c C-t n n c' executes `ess-debug-command-next' -twice and `ess-debug-command-continue' once. Any other input not defined -in `ess-electric-debug-map' will cause the exit from single-key -input mode. - -If WAIT is t, wait for next input and ignore the keystroke which -triggered the command." - (interactive) - (let ((help-mess (ess--debug-keys-message-string - ess-electric-debug-map))) - (ess--execute-electric-command - ess-electric-debug-map help-mess wait - (not (ess-process-get 'dbg-active))))) - -(define-obsolete-function-alias - 'ess-singlekey-debug 'ess-electric-debug "ESS 13.05") -(make-obsolete 'ess-electric-debug nil "ESS 13.05") - (defun ess-electric-selection (&optional wait) "Call commands defined in `ess-electric-selection-map'. Single-key input commands are those, which once executed do not -requre the prefix command for subsequent invocation. See -`ess-electric-debug' for more. +requre the prefix command for subsequent invocation. If WAIT is t, wait for next input and ignore the keystroke which triggered the command." - (interactive) (ess--execute-electric-command ess-electric-selection-map "Selection: " wait (not (ess-process-get 'is-recover)))) -(make-obsolete 'ess-singlekey-selection 'ess-electric-selection "ESS 13.05") - (defun ess-debug-command-digit (&optional ev) "Digit commands in selection mode. If supplied, EV must be a proper key event or a string representing the digit." @@ -1863,7 +1791,7 @@ If supplied, EV must be a proper key event or a string representing the digit." (ess-send-string proc ev-char) (move-marker (process-mark proc) (max-char))))) -(defun ess-debug-command-next (&optional ev) +(defun ess-debug-command-next () "Step next in debug mode. Equivalent to 'n' at the R prompt." (interactive) @@ -1874,7 +1802,7 @@ Equivalent to 'n' at the R prompt." (ess-send-string (ess-get-process) "0") (ess-send-string (ess-get-process) "n"))) -(defun ess-debug-command-next-multi (&optional ev N) +(defun ess-debug-command-next-multi (&optional N) "Ask for N and step (n) N times in debug mode." (interactive) (ess-force-buffer-current) @@ -1888,7 +1816,7 @@ Equivalent to 'n' at the R prompt." (setq N (1- N)))) (ess-debug-command-next)) -(defun ess-debug-command-continue-multi (&optional ev N) +(defun ess-debug-command-continue-multi (&optional N) "Ask for N, and continue (c) N times in debug mode." (interactive) (ess-force-buffer-current) @@ -1902,7 +1830,7 @@ Equivalent to 'n' at the R prompt." (setq N (1- N)))) (ess-debug-command-continue)) -(defun ess-debug-command-up (&optional ev) +(defun ess-debug-command-up () "Step up one call frame. Equivalent to 'n' at the R prompt." (interactive) @@ -1919,7 +1847,7 @@ Equivalent to 'n' at the R prompt." ;; (interactive) ;; (previous-error)) -(defun ess-debug-command-quit (&optional ev) +(defun ess-debug-command-quit () "Quits the browser/debug in R process. Equivalent of `Q' at the R prompt." (interactive) @@ -1933,7 +1861,7 @@ Equivalent of `Q' at the R prompt." (t (error "Debugger is not active")))) -(defun ess-debug-command-continue (&optional ev) +(defun ess-debug-command-continue () "Continue the code execution. Equivalent of `c' at the R prompt." (interactive) @@ -1945,7 +1873,7 @@ Equivalent of `c' at the R prompt." (t (error "Debugger is not active")))) -(defun ess-tracebug-set-last-input (&rest ARGS) +(defun ess-tracebug-set-last-input (&rest _args) "Move `ess--tb-last-input' marker to the process mark. ARGS are ignored to allow using this function in process hooks." (let* ((last-input-process (get-process ess-local-process-name)) @@ -2078,9 +2006,7 @@ Returns the beginning position of the hidden text." (setq ess--bp-identifier (1+ ess--bp-identifier)))) (bp-command (concat (format (nth 1 bp-specs) bp-id) "##:ess-bp-end:##\n")) - (bp-length (length bp-command)) (dummy-string (format "##:ess-bp-start::%s@%s:##\n" (car bp-specs) condition)) - (dummy-length (length dummy-string)) insertion-pos) (when bp-specs (set-marker init-pos (1+ init-pos)) @@ -2173,7 +2099,7 @@ Returns the beginning position of the hidden text." ;; 'bp-substring 'comment))) )))))))) -(add-hook 'R-mode-hook 'ess-bp-recreate-all) +(add-hook 'ess-r-mode-hook 'ess-bp-recreate-all) (defun ess-bp-get-bp-position-nearby () @@ -2190,7 +2116,7 @@ commands like `ess-bp-toggle-state' and `ess-bp-kill'. Use (pos-start (if (get-char-property (point) 'ess-bp) ;;check for bobp (point) (next-single-property-change (point) 'ess-bp nil (window-end)))) - pos dist-up dist-down) + dist-up dist-down) (unless (eq pos-end (window-start)) (setq dist-up (- (line-number-at-pos (point)) (line-number-at-pos pos-end)))) @@ -2321,7 +2247,7 @@ If there is no active R session, this command triggers an error." (let ((pos (ess-bp-get-bp-position-nearby)) (fringe-face (nth 3 ess-bp-inactive-spec)) (inhibit-point-motion-hooks t) ;; deactivates intangible property - bp-id beg-pos-dummy end-pos-comment bp-specs beg-pos-command) + bp-id bp-specs beg-pos-command) (if (null pos) (message "No breakpoints in the visible region") (goto-char (car pos)) @@ -2362,13 +2288,11 @@ If there is no active R session, this command triggers an error." (defun ess-bp-next nil "Goto next breakpoint." (interactive) - (let ((cur-pos (point)) - (bp-pos (next-single-property-change (point) 'ess-bp))) - (when bp-pos - (save-excursion - (goto-char bp-pos) - (when (get-text-property (1- (point)) 'ess-bp) - (setq bp-pos (next-single-property-change bp-pos 'ess-bp))))) + (when-let ((bp-pos (next-single-property-change (point) 'ess-bp))) + (save-excursion + (goto-char bp-pos) + (when (get-text-property (1- (point)) 'ess-bp) + (setq bp-pos (next-single-property-change bp-pos 'ess-bp)))) (if bp-pos (goto-char bp-pos) (message "No breakpoints found")))) @@ -2377,13 +2301,10 @@ If there is no active R session, this command triggers an error." (defun ess-bp-previous nil "Goto previous breakpoint." (interactive) - (let ((cur-pos (point)) - (bp-pos (previous-single-property-change (point) 'ess-bp))) - (if bp-pos - (goto-char (or (previous-single-property-change bp-pos 'ess-bp) - bp-pos)) - ;; - (message "No breakpoints before the point found")))) + (if-let ((bp-pos (previous-single-property-change (point) 'ess-bp))) + (goto-char (or (previous-single-property-change bp-pos 'ess-bp) + bp-pos)) + (message "No breakpoints before the point found"))) ;;;_ + WATCH @@ -2402,37 +2323,28 @@ If there is no active R session, this command triggers an error." (setq left-margin-width 1) (set-window-buffer (selected-window) (current-buffer))))) -(defun ess-watch-mode () - "Major mode in `ess-watch' window. -\\{ess-watch-mode-map}" +(define-derived-mode ess-watch-mode special-mode "ESS watch" + "Major mode in `ess-watch' window." (let ((cur-block (max 1 (ess-watch-block-at-point))) (dummy-string (ess-tracebug--propertize "|" 'current-watch-bar 'font-lock-keyword-face))) - (kill-all-local-variables) (ess-tracebug--set-left-margin) - (make-local-variable 'revert-buffer-function) - (setq revert-buffer-function 'ess-watch-revert-buffer) - (use-local-map ess-watch-mode-map) - (setq major-mode 'ess-watch-mode) - (setq mode-name (concat "watch " ess-current-process-name)) + (setq-local revert-buffer-function 'ess-watch-revert-buffer) (turn-on-font-lock) (setq ess-watch-current-block-overlay (make-overlay (point-min) (point-max))) (overlay-put ess-watch-current-block-overlay 'line-prefix dummy-string) (overlay-put ess-watch-current-block-overlay 'face 'ess-watch-current-block-face) (ess-watch-set-current cur-block) ;; - (when (require 'face-remap nil t) - ;; scale the font - (setq text-scale-mode-amount ess-watch-scale-amount) - (text-scale-mode 1) ; (text-scale-mode -1) ;;restore to default - ))) + (require 'face-remap) + ;; scale the font + (setq text-scale-mode-amount ess-watch-scale-amount) + (text-scale-mode))) (defun ess-watch () - "Run `ess-watch' mode on R objects. + "Run `ess-watch-mode' on R objects. This is the trigger function. See documentation of -`ess-watch-mode' for more information. - -\\{ess-watch-mode-map}" +`ess-watch-mode' for more information." (interactive) (ess-force-buffer-current) (let ((wbuf (get-buffer-create ess-watch-buffer)) @@ -2498,7 +2410,7 @@ respectively." ))))) -(defun ess-watch-revert-buffer (ignore noconfirm) +(defun ess-watch-revert-buffer (_ignore _noconfirm) "Update the watch buffer. Arguments IGNORE and NOCONFIRM currently not used." (ess-watch) @@ -2522,16 +2434,6 @@ Arguments IGNORE and NOCONFIRM currently not used." ;; :type 'string ) -(defvar ess-watch-help nil - "Keymap for the *R watch* buffer. - -\\{ess-watch-mode-map}") - -(defun ess-watch-help () - "Help on `ess-watch'." - (interactive) - (describe-variable 'ess-watch-help)) - (defun ess-watch-block-limits-at-point () "Return start and end positions of the watch block." (interactive) @@ -2769,12 +2671,12 @@ Optional N if supplied gives the number of backward steps." (defun ess--dbg-get-signatures (method) "Get signatures for the method METHOD." (let ((tbuffer (get-buffer-create " *ess-command-output*")); initial space: disable-undo - signatures curr-point) + signatures) (save-excursion (ess-if-verbose-write (format "ess-get-signatures*(%s).. " method)) (ess-command (concat "showMethods(\"" method "\")\n") tbuffer) - (message ess-local-process-name) - (message ess-current-process-name) + (message "%s" ess-local-process-name) + (message "%s" ess-current-process-name) (ess-if-verbose-write " [ok] ..\n") (set-buffer tbuffer) (goto-char (point-min)) @@ -2815,7 +2717,7 @@ for signature and trace it with browser tracer." (car (sort matches (lambda (a b) (< (length a) (length b)))))))) (ufunc (ess-completing-read "Debug" all-functions nil nil nil nil (or default obj-at-point))) - signature default-string out-message) + signature) ;; FIXME: Most of the following logic should be in R (if (ess-boolean-command (format "as.character(isGeneric('%s'))\n" ufunc)) @@ -2832,7 +2734,7 @@ for signature and trace it with browser tracer." (ess-command (format "trace('%s', tracer = browser, signature = c('%s'))\n" ufunc signature) tbuffer)) (with-current-buffer tbuffer ;; give appropriate message or error - (message (buffer-substring-no-properties (point-min) (point-max))))) + (message "%s" (buffer-substring-no-properties (point-min) (point-max))))) ;;else, not an S4 generic (when (ess-boolean-command (format "as.character(.knownS3Generics['%s'])\n" ufunc)) @@ -2875,14 +2777,14 @@ for signature and trace it with browser tracer." (setq out-message (format "Undebugged '%s' " fun)) (setq out-message (buffer-substring-no-properties (point-min) (point-max))) ;; untrace info or warning, or error occurred ))) - (message out-message))) + (message "%s" out-message))) ;;;_ * Kludges and Fixes ;;; delete-char and delete-backward-car do not delete whole intangible text (defadvice delete-char (around ess-delete-backward-char-intangible activate) "When deleting an intangible char, delete the whole intangible region. Only do this when #chars is 1" - (if (and (eq major-mode 'ess-mode) + (if (and (ess-derived-mode-p) (= (ad-get-arg 0) 1) (get-text-property (point) 'intangible)) (progn @@ -2894,7 +2796,7 @@ Only do this when #chars is 1" (defadvice delete-backward-char (around ess-delete-backward-char-intangible activate) "When deleting an intangible char, delete the whole intangible region. Only do this when called interactively and #chars is 1" - (if (and (eq major-mode 'ess-mode) + (if (and (ess-derived-mode-p) (= (ad-get-arg 0) 1) (> (point) (point-min)) (get-text-property (1- (point)) 'intangible)) @@ -2904,47 +2806,6 @@ Only do this when called interactively and #chars is 1" (kill-region beg (point)))) ad-do-it)) -;; reported as bug#21368 - -;; ;; previous-line gets stuck if next char is intangible -;; reported -;; (defadvice previous-line (around ess-fix-cursor-stuck-at-intangible-text activate) -;; "When about to move to previous line when next char is -;; intangible, step char backward first" -;; (when (and (eq major-mode 'ess-mode) -;; (or (null (ad-get-arg 0)) -;; (= (ad-get-arg 0) 1)) -;; (get-text-property (point) 'intangible)) -;; (goto-char (1- (point)))) -;; ad-do-it) - -;; (ad-remove-advice 'previous-line 'around 'ess-fix-cursor-stuck-at-intangible-text) - -(make-obsolete-variable 'ess-dbg-blink-ref-not-found-face 'ess-debug-blink-ref-not-found-face "ESS 13.05") -(make-obsolete-variable 'ess-dbg-blink-same-ref-face 'ess-debug-blink-same-ref-face "ESS 13.05") -(make-obsolete-variable 'ess-dbg-current-debug-line-face 'ess-debug-current-debug-line-face "ESS 13.05") -(make-obsolete-variable 'ess-dbg-error-action nil "ESS 13.05") -(make-obsolete-variable 'ess-dbg-error-action-alist 'ess-debug-error-action-alist "ESS 13.05") -(make-obsolete-variable 'ess-dbg-blink-interval 'ess-debug-blink-interval "ESS 13.05") -(make-obsolete-variable 'ess-dbg-indicator 'ess-debug-indicator "ESS 13.05") -(make-obsolete-variable 'ess-dbg-ask-for-file 'ess-debug-ask-for-file "ESS 13.05") -(make-obsolete 'ess-dbg-set-error-action 'ess-debug-set-error-action "ESS 13.05") -(make-obsolete 'ess-dbg-toggle-error-action 'ess-debug-toggle-error-action "ESS 13.05") -(make-obsolete 'ess-dbg-goto-input-event-marker 'ess-debug-goto-input-event-marker "ESS 13.05") -(make-obsolete 'ess-dbg-goto-debug-point 'ess-debug-goto-debug-point "ESS 13.05") -(make-obsolete 'ess-dbg-insert-in-forward-ring 'ess-debug-insert-in-forward-ring "ESS 13.05") -(make-obsolete 'ess-dbg-start 'ess-debug-start "ESS 13.05") -(make-obsolete 'ess-dbg-stop 'ess-debug-stop "ESS 13.05") -(make-obsolete 'ess-dbg-command-digit 'ess-debug-command-digit "ESS 13.05") -(make-obsolete 'ess-dbg-command-n 'ess-debug-command-next "ESS 13.05") -(make-obsolete 'ess-dbg-command-Q 'ess-debug-command-quit "ESS 13.05") -(make-obsolete 'ess-dbg-command-c 'ess-debug-command-continue "ESS 13.05") -(make-obsolete 'ess-dbg-flag-for-debugging 'ess-debug-flag-for-debugging "ESS 13.05") -(make-obsolete 'ess-dbg-unflag-for-debugging 'ess-debug-unflag-for-debugging "ESS 13.05") -(make-obsolete-variable 'ess-tb-last-input-fringe-face 'ess-tracebug-last-input-fringe-face "ESS 13.05") -(make-obsolete-variable 'ess-tb-next-error-function 'ess-tracebug-next-error-function "ESS 13.05") - -(ess-if-verbose-write "\n<- debug done") (provide 'ess-tracebug) ;;; ess-tracebug.el ends here diff --git a/elpa/ess-20181109.703/ess-trns.el b/elpa/ess-20190121.1430/ess-trns.el similarity index 56% rename from elpa/ess-20181109.703/ess-trns.el rename to elpa/ess-20190121.1430/ess-trns.el index 80d3f915..3ceef730 100644 --- a/elpa/ess-20181109.703/ess-trns.el +++ b/elpa/ess-20190121.1430/ess-trns.el @@ -1,4 +1,4 @@ -;;; ess-trns.el --- Support for manipulating S transcript files +;;; ess-trns.el --- Support for manipulating S transcript files -*- lexical-binding: t; -*- ;; Copyright (C) 1989--1994 Bates, Kademan, Ritter and Smith ;; Copyright (C) 1997--2010 A.J. Rossini, Richard M. Heiberger, Martin @@ -46,51 +46,40 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;*;; Major mode definition -(defvar ess-transcript-mode-map nil "Keymap for `ess-transcript-mode'.") -(unless ess-transcript-mode-map - (setq ess-transcript-mode-map (make-sparse-keymap)) - - (define-key ess-transcript-mode-map "\C-c\C-s" 'ess-switch-process) - (define-key ess-transcript-mode-map "\C-c\C-r" 'ess-eval-region) - (define-key ess-transcript-mode-map "\C-c\M-r" 'ess-eval-region-and-go) - ;; (define-key ess-transcript-mode-map "\M-\C-x" 'ess-eval-function) - ;; (define-key ess-transcript-mode-map "\C-c\M-f" 'ess-eval-function-and-go) - ;; (define-key ess-transcript-mode-map "\C-c\C-j" 'ess-eval-line) - ;; (define-key ess-transcript-mode-map "\C-c\M-j" 'ess-eval-line-and-go) - - (define-key ess-transcript-mode-map "\C-c\C-k" 'ess-force-buffer-current) - (define-key ess-transcript-mode-map "\C-c\C-q" 'ess-quit) - - (define-key ess-transcript-mode-map "\C-c\C-j" 'ess-transcript-send-command) - (define-key ess-transcript-mode-map "\C-c\M-j" 'ess-transcript-send-command-and-move) - (define-key ess-transcript-mode-map "\M-\C-a" 'ess-goto-end-of-function-or-para) - (define-key ess-transcript-mode-map "\M-\C-e" 'ess-goto-end-of-function-or-para) - (define-key ess-transcript-mode-map "\C-c\C-y" 'ess-switch-to-ESS) - (define-key ess-transcript-mode-map "\C-c\C-z" 'ess-switch-to-end-of-ESS) - (define-key ess-transcript-mode-map "\C-c\C-v" 'ess-display-help-on-object) - (define-key ess-transcript-mode-map "\C-c\C-d" 'ess-dump-object-into-edit-buffer) - (define-key ess-transcript-mode-map "\C-c\t" 'ess-complete-object-name-deprecated) - (define-key ess-transcript-mode-map "\C-a" 'comint-bol) - (define-key ess-transcript-mode-map "\M-\t" 'comint-replace-by-expanded-filename) - (define-key ess-transcript-mode-map "\M-?" 'comint-dynamic-list-completions) - (define-key ess-transcript-mode-map "\C-c\C-k" 'ess-request-a-process) - (define-key ess-transcript-mode-map "{" 'skeleton-pair-insert-maybe) - (define-key ess-transcript-mode-map "}" 'skeleton-pair-insert-maybe) - (define-key ess-transcript-mode-map "\e\C-h" 'ess-mark-function) - (define-key ess-transcript-mode-map "\e\C-q" 'ess-indent-exp) - ;(define-key ess-transcript-mode-map "\177" 'backward-delete-char-untabify) - (define-key ess-transcript-mode-map "\t" 'ess-indent-command) - - (define-key ess-transcript-mode-map "\C-c\C-p" 'comint-previous-prompt) - (define-key ess-transcript-mode-map "\C-c\C-n" 'comint-next-prompt) - ;; (define-key ess-transcript-mode-map "\C-c\C-n" 'ess-eval-line-and-step) - - (define-key ess-transcript-mode-map "\r" 'ess-transcript-send-command-and-move) - (define-key ess-transcript-mode-map "\M-\r" 'ess-transcript-send-command) - (define-key ess-transcript-mode-map "\C-c\r" 'ess-transcript-copy-command) - (define-key ess-transcript-mode-map "\C-c\C-w" 'ess-transcript-DO-clean-region) - (define-key ess-transcript-mode-map "\C-c\M-c" 'ess-transcript-clean-buffer) - ) +(defvar ess-transcript-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-c\C-s" 'ess-switch-process) + (define-key map "\C-c\C-r" 'ess-eval-region) + (define-key map "\C-c\M-r" 'ess-eval-region-and-go) + (define-key map "\C-c\C-k" 'ess-force-buffer-current) + (define-key map "\C-c\C-q" 'ess-quit) + (define-key map "\C-c\C-j" 'ess-transcript-send-command) + (define-key map "\C-c\M-j" 'ess-transcript-send-command-and-move) + (define-key map "\M-\C-a" 'ess-goto-end-of-function-or-para) + (define-key map "\M-\C-e" 'ess-goto-end-of-function-or-para) + (define-key map "\C-c\C-y" 'ess-switch-to-ESS) + (define-key map "\C-c\C-z" 'ess-switch-to-end-of-ESS) + (define-key map "\C-c\C-v" 'ess-display-help-on-object) + (define-key map "\C-c\C-d" 'ess-dump-object-into-edit-buffer) + (define-key map "\C-c\t" 'ess-complete-object-name-deprecated) + (define-key map "\C-a" 'comint-bol) + (define-key map "\M-\t" 'comint-replace-by-expanded-filename) + (define-key map "\M-?" 'comint-dynamic-list-completions) + (define-key map "\C-c\C-k" 'ess-request-a-process) + (define-key map "{" 'skeleton-pair-insert-maybe) + (define-key map "}" 'skeleton-pair-insert-maybe) + (define-key map "\e\C-h" 'ess-mark-function) + (define-key map "\e\C-q" 'ess-indent-exp) + (define-key map "\t" 'ess-indent-command) + (define-key map "\C-c\C-p" 'comint-previous-prompt) + (define-key map "\C-c\C-n" 'comint-next-prompt) + (define-key map "\r" 'ess-transcript-send-command-and-move) + (define-key map "\M-\r" 'ess-transcript-send-command) + (define-key map "\C-c\r" 'ess-transcript-copy-command) + (define-key map "\C-c\C-w" 'ess-transcript-DO-clean-region) + (define-key map "\C-c\M-c" 'ess-transcript-clean-buffer) + map) + "Keymap for `ess-transcript-mode'.") (easy-menu-define ess-transcript-mode-menu ess-transcript-mode-map @@ -113,39 +102,21 @@ ["Switch S process" ess-switch-process t] )) -(if (featurep 'ess-trans) - (define-key ess-transcript-mode-map [menu-bar ess-trans] - (cons "ess-trans" ess-transcript-mode-menu)) - (eval-after-load "ess-trans" - '(define-key ess-transcript-mode-map - [menu-bar ess-trans] - (cons "ess-trans" - ess-transcript-mode-menu)))) ;;;###autoload -(defun ess-transcript-mode (alist &optional proc) - "Major mode for manipulating {ESS} transcript files. +(define-derived-mode ess-transcript-mode ess-mode "ESS Transcript" + "Major mode for transcript files. Type \\[ess-transcript-send-command] to send a command in the -transcript to the current S process. \\[ess-transcript-copy-command] +transcript to the current inferior process. \\[ess-transcript-copy-command] copies the command but does not execute it, allowing you to edit it in the process buffer first. Type \\[ess-transcript-clean-region] to delete all outputs and prompts -in the region, leaving only the S commands. Other keybindings are: - -\\{ess-transcript-mode-map}" - (kill-all-local-variables) - (setq buffer-read-only t) ;; to protect the buffer. - (ess-setq-vars-local alist); (current-buffer)) - (setq major-mode 'ess-transcript-mode) - (setq mode-name "ESS Transcript") - (use-local-map ess-transcript-mode-map) - (set-syntax-table (or inferior-ess-mode-syntax-table - ess-mode-syntax-table)) - (setq mode-line-process - '(" [" ess-local-process-name "]")) - (make-local-variable 'ess-local-process-name) - (setq ess-local-process-name nil) +in the region, leaving only the commands." + (setq buffer-read-only t + ess-local-process-name nil + mode-line-process '(" [" ess-local-process-name "]")) + ;; TODO: Set this more normally in various major modes (unless inferior-ess-prompt ;; For S languages it is set in custom-alist (setq inferior-ess-prompt ;; Do not anchor to bol with `^' @@ -154,23 +125,12 @@ in the region, leaving only the S commands. Other keybindings are: "\\|" inferior-ess-secondary-prompt "\\)"))) - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat "^" inferior-ess-prompt "\\|^\^L")) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate "^\^L") - (make-local-variable 'comint-use-prompt-regexp) - (setq comint-use-prompt-regexp t) - (make-local-variable 'comint-prompt-regexp) - (setq comint-prompt-regexp (concat "^" inferior-ess-prompt)) - (setq inferior-ess-font-lock-keywords 'inferior-ess-r-font-lock-keywords) + (setq-local paragraph-start (concat "^" inferior-ess-prompt "\\|^\^L")) + (setq-local paragraph-separate "^\^L") + (setq-local comint-use-prompt-regexp t) + (setq-local comint-prompt-regexp (concat "^" inferior-ess-prompt)) (setq font-lock-defaults '(ess-build-font-lock-keywords - nil nil ((?\. . "w") (?\_ . "w") (?' . ".")))) - - ;;; Keep out of the code. - (make-local-variable 'indent-tabs-mode) - (setq indent-tabs-mode nil) - - (run-mode-hooks 'ess-transcript-mode-hook)) + nil nil ((?\. . "w") (?\_ . "w") (?' . "."))))) ;;*;; Commands used in S transcript mode @@ -258,30 +218,6 @@ clean even if the buffer is \\[read-only]." (if do-toggle (setq buffer-read-only t))))) - -;; unfinished idea :----------------------- - -;; (defun ess-clean-region-in-new-transcript (beg end) -;; "Copy the region into a new ess-transcript buffer, and clean it there, -;; using \\[ess-transcript-clean-region]." -;; (interactive "r") - -;; (let ((bname (buffer-file-name))) -;; (setq bname (if bname .. ..)) -;; (let -;; (fbase (if fname (file-name-sans-extension (file-name-nondirectory fname)) -;; (buffer-name))) -;; -;; ;; the buffer name should be like a file name -;; (buf-nam ....) -;; (trns-buf (get-buffer-create fbase)) -;; (pop-to-buffer trns-buf) -;; (ess-transcript-mode .....) -;; ))) - - - - (defun ess-transcript-DO-clean-region (beg end) "Clean the current via \\[ess-transcript-clean-region] even if the buffer is read-only." (interactive "r") diff --git a/elpa/ess-20181109.703/ess-utils.el b/elpa/ess-20190121.1430/ess-utils.el similarity index 61% rename from elpa/ess-20181109.703/ess-utils.el rename to elpa/ess-20190121.1430/ess-utils.el index cf1a2657..9e7e874c 100644 --- a/elpa/ess-20181109.703/ess-utils.el +++ b/elpa/ess-20190121.1430/ess-utils.el @@ -1,4 +1,4 @@ -;;; ess-utils.el --- General Emacs utility functions used by ESS +;;; ess-utils.el --- General Emacs utility functions used by ESS -*- lexical-binding: t; -*- ;; Copyright (C) 1998--2010 A.J. Rossini, Richard M. Heiberger, Martin ;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen. @@ -33,56 +33,26 @@ (eval-when-compile (require 'tramp)) ;; The only ESS file this file should depend on is ess-custom.el +(require 'cl-lib) (require 'comint) +(require 'ess) (require 'ess-custom) (require 'ido) +(require 'newcomment) (defvar ac-modes) +(declare-function ess-eval-linewise "ess-inf") (declare-function evil-visual-state-p "evil") (declare-function evil-normal-state "evil") (declare-function color-lighten-name "color") (declare-function tramp-dissect-file-name "tramp") - - -;;*;; Internal ESS tools and variables - -(defvar ess-lisp-directory - (directory-file-name - (file-name-directory - (if load-file-name - (file-truename load-file-name) - (locate-library "ess-utils") ))) - "Directory containing ess-site.el(c) and other ESS Lisp files.") - -(defvar ess-etc-directory nil - "Location of the ESS etc/ directory. -The ESS etc directory stores various auxillary files that are useful -for ESS, such as icons.") - -;; Try to detect the `etc' folder only if not alread set up by distribution -(unless ess-etc-directory - (let ((path-list '("../etc/ess/" "../etc/" "../../etc/ess/" "./etc/"))) - (while (and (listp path-list) (consp path-list)) - (setq ess-etc-directory - (expand-file-name (concat ess-lisp-directory "/" - (car path-list)))) - (if (file-directory-p ess-etc-directory) - (setq path-list nil) - (setq ess-etc-directory nil) - (setq path-list (cdr path-list)) - (when (null path-list) - (beep 0) (beep 0) - (message (concat - "ERROR:ess-etc-directory\n" - "Relative to ess-lisp-directory, one of the following must exist:\n" - "../etc/ess, ../etc, ../../etc/ess or ./etc")) - (sit-for 4)))))) - -(defvar ess--make-local-vars-permanent nil - "If this variable is non-nil in a buffer make all variable permannet. -Used in noweb modes.") -(make-variable-buffer-local 'ess--make-local-vars-permanent) -(put 'ess--make-local-vars-permanent 'permanent-local t) - +;; The following declares can be removed once we drop Emacs 25 +(declare-function tramp-file-name-method "tramp") +(declare-function tramp-file-name-user "tramp") +(declare-function tramp-file-name-host "tramp") +(declare-function tramp-file-name-localname "tramp") +(declare-function tramp-file-name-hop "tramp") + +;;; FIXME: Used in ./obsolete/xyz.el only; remove once gone. (defun ess-message (format-string &rest args) "Shortcut for \\[message] only if `ess-show-load-messages' is non-nil." (when (bound-and-true-p ess-show-load-messages) @@ -91,12 +61,52 @@ Used in noweb modes.") ;;*;; elisp tools +(defun ess-next-code-line (&optional arg skip-to-eob) + "Move ARG lines of code forward (backward if ARG is negative). +If `ess-eval-empty' is non-nil, skip past all empty and comment +lines. Default for ARG is 1. Don't skip the last empty and +comment lines in the buffer unless SKIP-TO-EOB is non-nil. On +success, return 0. Otherwise, go as far as possible and return +-1." + (interactive "p") + (or arg (setq arg 1)) + (if (or ess-eval-empty + (and (fboundp 'ess-roxy-entry-p) + (ess-roxy-entry-p))) + (forward-line arg) + (beginning-of-line) + (let ((pos (point)) + (n 0) + (inc (if (> arg 0) 1 -1))) + (while (and (/= arg 0) (= n 0)) + (setq n (forward-line inc)) ; n=0 is success + (comment-beginning) + (beginning-of-line) + (forward-comment (* inc (buffer-size))) ;; as suggested in info file + (if (or skip-to-eob + (not (looking-at ess-no-skip-regexp))) ;; don't go to eob or whatever + (setq arg (- arg inc)) + (goto-char pos) + (setq arg 0) + (forward-line 1)) ;; stop at next empty line + (setq pos (point))) + (goto-char pos) + n))) + (defun ess-goto-line (line) (save-restriction (widen) (goto-char (point-min)) (forward-line (1- line)))) +(defun ess-skip-thing (thing) + "Leave point at the end of THING. +THING can be 'function, 'paragraph, or 'line." + (cond + ((eql thing 'line) (goto-char (line-end-position))) + ((eql thing 'paragraph) (forward-paragraph)) + ((eql thing 'function) (end-of-defun) (skip-chars-backward " \t\n")))) + (defun ess-line-end-position (&optional N) "Return the 'point' at the end of N lines. N defaults to 1, i.e., current line." (save-excursion @@ -108,7 +118,6 @@ Used in noweb modes.") Optionally ignore strings that match exceptions." (interactive) (let ((continue t) (exit nil)) - (while continue (if (or (and backward (search-backward-regexp regexp nil t)) (and (not backward) (search-forward-regexp regexp nil t))) @@ -117,21 +126,17 @@ Optionally ignore strings that match exceptions." (setq continue (and except (string-match except exit))) (if continue (setq exit nil))) ;;else - (setq continue nil)) - ) - + (setq continue nil))) exit)) (defun ess-save-and-set-local-variables () "If buffer was modified, save file and set Local Variables if defined. Return t if buffer was modified, nil otherwise." (interactive) - (let ((ess-temp-point (point)) (ess-temp-return-value (buffer-modified-p))) ;; if buffer has changed, save buffer now (before potential revert) (if ess-temp-return-value (save-buffer)) - ;; If Local Variables are defined, update them now ;; since they may have changed since the last revert ;; (save-excursion @@ -141,7 +146,6 @@ Return t if buffer was modified, nil otherwise." ;; save-excursion doesn't save point in the presence of a revert ;; so you need to do it yourself (goto-char ess-temp-point) - ess-temp-return-value)) (defun ess-get-file-or-buffer (file-or-buffer) @@ -154,43 +158,23 @@ nil." (if (bufferp file-or-buffer) file-or-buffer (find-buffer-visiting file-or-buffer)))) -(defun ess-set-local-variables (alist &optional file-or-buffer) - "Set local variables from ALIST in current buffer. -If FILE-OR-BUFFER is specified, perform action in that buffer." - (interactive) - (if file-or-buffer (set-buffer (ess-get-file-or-buffer file-or-buffer))) - - (mapcar (lambda (pair) - (make-local-variable (car pair)) - (set (car pair) (eval (cdr pair)))) - alist)) - (defun ess-return-list (ess-arg) "If ESS-ARG is a list return it, else return ESS-ARG in a list." (if (listp ess-arg) ess-arg (list ess-arg))) -;; Copyright (C) 1994 Simon Marshall. -;; Author: Simon Marshall -;; LCD Archive Entry: -;; unique|Simon Marshall|Simon.Marshall@mail.esrin.esa.it| -;; Functions and commands to uniquify lists or buffer text (cf. sort). -;; 23-Apr-1994|1.00|~/packages/unique.el.Z| -;; -;; MM: renamed from 'unique' to 'ess-unique', then (defun ess-uniq (list predicate) "Uniquify LIST, stably, deleting elements using PREDICATE. Return the list with subsequent duplicate items removed by side effects. PREDICATE is called with an element of LIST and a list of elements from LIST, and should return the list of elements with occurrences of the element removed. -This function will work even if LIST is unsorted. See also `ess-uniq-list'." +This function will work even if LIST is unsorted. See also `delete-dups'." + (declare (obsolete 'delete-dups "ESS 19.04")) (let ((list list)) (while list (setq list (setcdr list (funcall predicate (car list) (cdr list)))))) list) -(defun ess-uniq-list (items) - "Delete all duplicate entries in ITEMS list, calling `ess-uniq'." - (ess-uniq items 'delete)) +(define-obsolete-function-alias 'ess-uniq-list 'delete-dups "ESS 19.04") (defun ess-flatten-list (&rest list) "Take the arguments and flatten them into one long LIST. @@ -199,9 +183,6 @@ Drops 'nil' entries." ;; `lpr-flatten-list' is defined here (copied from "message.el" and ;; enhanced to handle dotted pairs as well) until we can get some ;; sensible autoloads, or `flatten-list' gets put somewhere decent. - - ;; (ess-flatten-list '((a . b) c (d . e) (f g h) i . j)) - ;; => (a b c d e f g h i j) (ess-flatten-list-1 list)) (defun ess-flatten-list-1 (list) @@ -212,15 +193,8 @@ Drops 'nil' entries." (ess-flatten-list-1 (cdr list)))) (t (list list)))) -(defun ess-delete-blank-lines () - "Convert 2 or more lines of white space into one." - (interactive) - (save-excursion - (goto-char (point-min)) - (save-match-data - (while (search-forward-regexp "^[ \t]*\n[ \t]*\n" nil t) - ;;(goto-char (match-beginning 0)) - (delete-blank-lines))))) +(define-obsolete-function-alias 'ess-delete-blank-lines + 'delete-blank-lines "ESS 19.04") ;; Parse a line into its constituent parts (words separated by ;; whitespace). Return a list of the words. @@ -244,36 +218,18 @@ Drops 'nil' entries." (defun ess-revert-wisely () "Revert from disk if file and buffer last modification times are different." (interactive) - - ; whether or not a revert is needed, force load local variables - ; for example, suppose that you change the local variables and then - ; save the file, a revert is unneeded, but a force load is + ;; whether or not a revert is needed, force load local variables + ;; for example, suppose that you change the local variables and then + ;; save the file, a revert is unneeded, but a force load is (hack-local-variables) + (unless (verify-visited-file-modtime (current-buffer)) + (progn + (let ((ess-temp-store-point (point))) + (revert-buffer t t) + (goto-char ess-temp-store-point)) + t))) - (if (not (verify-visited-file-modtime (current-buffer))) (progn - (let ((ess-temp-store-point (point))) - (revert-buffer t t) - (goto-char ess-temp-store-point)) - t) - nil)) - - -(defun ess-find-exec (ess-root-arg ess-root-dir) - "Given a root directory and the root of an executable file name, -find it's full name and path, if it exists, anywhere in the sub-tree." - (let* ((ess-tmp-dirs (directory-files ess-root-dir t "^[^.]")) - (ess-tmp-return (ess-find-exec-completions ess-root-arg ess-root-dir)) - (ess-tmp-dir nil)) - - (while ess-tmp-dirs - (setq ess-tmp-dir (car ess-tmp-dirs) - ess-tmp-dirs (cdr ess-tmp-dirs)) - (if (file-accessible-directory-p ess-tmp-dir) - (setq ess-tmp-return - (nconc ess-tmp-return - (ess-find-exec ess-root-arg ess-tmp-dir))))) - ess-tmp-return)) - +(define-obsolete-function-alias 'ess-find-exec 'ess-find-exec-completions "ESS 19.04") (defun ess-find-exec-completions (ess-root-arg &optional ess-exec-dir) "Given the root of an executable file name, find all possible completions. Search for the executables in ESS-EXEC-DIR (which defaults to @@ -281,11 +237,9 @@ Search for the executables in ESS-EXEC-DIR (which defaults to (let* ((ess-exec-path (if ess-exec-dir (ess-return-list ess-exec-dir) exec-path)) (ess-tmp-exec nil) - (ess-tmp-path-count (length ess-exec-path)) (ess-tmp-dir nil) (ess-tmp-files nil) (ess-tmp-file nil)) - (while ess-exec-path (setq ess-tmp-dir (car ess-exec-path) ess-exec-path (cdr ess-exec-path)) @@ -296,7 +250,6 @@ Search for the executables in ESS-EXEC-DIR (which defaults to ;; problematic with Tramp. (setq ess-tmp-files (file-name-all-completions ess-root-arg ess-tmp-dir)) - (while ess-tmp-files (setq ess-tmp-file (concat (file-name-as-directory ess-tmp-dir) @@ -375,8 +328,8 @@ to `ess-completing-read'." `(if (null ,command) (message "Not implemented for dialect %s" ess-dialect) (let* ((com (if (symbolp ,command) - (symbol-function ,command) - ,command)) + (symbol-function ,command) + ,command)) (prompt ',prompt) (resp (and prompt (if (stringp prompt) @@ -398,43 +351,15 @@ to `ess-completing-read'." (t (error "Argument COMMAND must be either a function or a string")))))) -(defcustom ess-idle-timer-interval 1 - "Number of idle seconds to wait before running function in `ess-idle-timer-functions'." - :type '(integer) - :group 'ess) - -(defvar ess-idle-timer-functions nil - "A list of functions to run each `ess-idle-timer-interval' idle seconds. - -If your function calls the process, you better use -`ess-when-new-input' to wrap your call. If you call the -subprocess please respect `ess-can-eval-in-background' variable. - -These functions are run with `run-hooks'. Use `add-hook' to add -symbols to this variable. - -Most likely you will need a local hook. Then you should specify -the LOCAL argument to `add-hook' and initialise it in -`ess-mode-hook' or `ess-post-run-hook', or one of the more -specialised hooks `ess-r-post-run-hook',`ess-stata-post-run-hook' -etc.") - -(defun ess--idle-timer-function nil - "Internal function executed by `ess--idle-timer'." - ;; (while-no-input - (run-hooks 'ess-idle-timer-functions)) - -(require 'timer) -(defvar ess--idle-timer - (run-with-idle-timer ess-idle-timer-interval 'repeat 'ess--idle-timer-function) - "Timer used to run `ess-idle-timer-functions'.") - -;;*;; Emacs Integration +;;; Emacs Integration -;;;*;;; Menus +(defun ess-derived-mode-p () + "Non-nil if the current major mode is an ESS major mode." + (or (derived-mode-p 'ess-mode) + (derived-mode-p 'ess-julia-mode))) -(defun ess--generate-eval-visibly-submenu (menu) +(defun ess--generate-eval-visibly-submenu (_menu) '(["yes" (lambda () (interactive) (setq ess-eval-visibly t)) :style radio :enable t :selected (eq ess-eval-visibly t)] ["nowait" (lambda () (interactive) (setq ess-eval-visibly 'nowait)) @@ -442,20 +367,17 @@ etc.") ["no" (lambda () (interactive) (setq ess-eval-visibly nil)) :style radio :enable t :selected (eq ess-eval-visibly nil) ])) -;;;*;;; Font Lock +;; Font Lock (defun ess--fl-keywords-values () "Return a cons (STANDARD-VALUE . CUSTOM-VALUE) of `ess-font-lock-keywords'." - (let ((sym (if (derived-mode-p 'ess-mode) - ess-font-lock-keywords - ;; also in transcript mode - inferior-ess-font-lock-keywords))) + (let ((sym ess-font-lock-keywords)) (if (and (symbolp sym) (custom-variable-p sym)) (cons (eval (car (get sym 'standard-value))) (symbol-value sym)) - (error "(inferior-)`ess-font-lock-keywords' must be a symbol of a custom variable")))) + (error "`ess-font-lock-keywords' must be a symbol of a custom variable")))) (defun ess--extract-fl-keywords () (let ((values (ess--fl-keywords-values))) @@ -470,9 +392,8 @@ etc.") "Retrieve `font-lock-keywords' from ess-[dialect]-font-lock-keywords. Merge the customized values of that variable on top of the standard values and return the new list. For this to work, -`ess-font-lock-keywords' and `inferior-ess-font-lock-keywords' -should hold a name of the ess-[dialect]-font-lock-keywords -variable." +`ess-font-lock-keywords' should be a name of the +ess-[dialect]-font-lock-keywords variable." (delq nil (mapcar (lambda (c) (when (cdr c) @@ -497,9 +418,7 @@ variable." ;; we add new keywords but the user has the old value saved in ;; .emacs-custom.el) ((let ((kwd (assoc keyword (car values))) - (sym (if (derived-mode-p 'ess-mode) - ess-font-lock-keywords - inferior-ess-font-lock-keywords))) + (sym ess-font-lock-keywords)) (when kwd (set sym (cons kwd (symbol-value sym))) kwd))) @@ -515,8 +434,8 @@ variable." (font-lock-refresh-defaults)))) (buffer-list))))) -(defun ess--generate-font-lock-submenu (menu) - "Generate ESS font-lock submenu in MENU." +(defun ess--generate-font-lock-submenu (_menu) + "Generate ESS font-lock submenu." (append (mapcar (lambda (el) `[,(symbol-name (car el)) (lambda () (interactive) @@ -528,14 +447,19 @@ variable." (list "-----" ["Save to custom" (lambda () (interactive) - (customize-save-variable (if (derived-mode-p 'ess-mode) - ess-font-lock-keywords - inferior-ess-font-lock-keywords) + (customize-save-variable ess-font-lock-keywords (ess--extract-fl-keywords))) t]))) + +;;; External modes -;;;*;;; External modes +;; Define these here for the byte compiler since ido dynamically +;; let-binds them: +(defvar ido-choice-list) +(defvar ido-context-switch-command) +(defvar ido-directory-too-big) +(defvar ido-directory-nonreadable) (defun ess-completing-read (prompt collection &optional predicate require-match initial-input hist def) @@ -543,10 +467,8 @@ variable." Use `ido-completing-read' if IDO interface is present, or fall back on classical `completing-read' otherwise. Meaning of arguments is as in `completing-read' (PROMPT is automatically -suffixed with ': ' and (default %s) when needed). If HIST -is null use `ess--completing-hist' as history. - -See also `ess-use-ido'." +suffixed with ': ' and (default %s) when needed). If HIST is null +use `ess--completing-hist' as history. See also `ess-use-ido'." (let ((use-ido (and ess-use-ido (featurep 'ido)))) (setq hist (or hist 'ess--completing-hist)) (when (and def (not use-ido)) ;; ido places in front and highlights the default @@ -563,9 +485,6 @@ See also `ess-use-ido'." sel) (unwind-protect (progn - ;; Can remove this call when we drop support for Emacs - ;; < 25.1, as it is aliased to ignore then - (ido-init-completion-maps) (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup) (add-hook 'choose-completion-string-functions 'ido-choose-completion-string) (setq sel (ido-read-internal 'list prompt hist def require-match initial-input)) @@ -579,59 +498,42 @@ See also `ess-use-ido'." ;; else usual completion (completing-read prompt collection predicate require-match initial-input hist def)))) -(defun ess-load-extras (&optional inferior) - "Load all the extra features depending on custom settings." - - (let ((mode (if inferior 'inferior-ess-mode 'ess-mode)) - (isR (string-match "^R" ess-dialect))) - - ;; auto-complete - (when (and (boundp 'ac-sources) - (if inferior - (eq ess-use-auto-complete t) - ess-use-auto-complete)) - (add-to-list 'ac-modes mode) - ;; files should be in front; ugly, but needed - (when ess-ac-sources - (setq ac-sources - (delq 'ac-source-filename ac-sources)) - (mapc (lambda (el) (add-to-list 'ac-sources el)) - ess-ac-sources) - (add-to-list 'ac-sources 'ac-source-filename))) - - ;; company - (when (and (boundp 'company-backends) - (if inferior - (eq ess-use-company t) - ess-use-company)) - (when ess-company-backends - (set (make-local-variable 'company-backends) - (cl-copy-list (append ess-company-backends company-backends))) - (delq 'company-capf company-backends))) - - ;; eldoc) - (require 'eldoc) - (when (and ess-eldoc-function ;; if mode provide this, it suports eldoc - (or (and (not inferior) ess-use-eldoc) - (and inferior (eq ess-use-eldoc t)))) - (when (> eldoc-idle-delay 0.4) ;; default is too slow for paren help - (set (make-local-variable 'eldoc-idle-delay) 0.1)) - (set (make-local-variable 'eldoc-documentation-function) ess-eldoc-function) - (eldoc-mode 1)) - - ;; tracebug - (when (and ess-use-tracebug inferior isR (fboundp 'ess-tracebug)) - (ess-tracebug 1)))) +(defun ess--setup-auto-complete (sources &optional inferior) + "Setup auto-complete depending on user settings. +SOURCES gets added to `ac-sources', INFERIOR should be t for +inferior buffers." + ;; auto-complete + (when (and (boundp 'ac-sources) + (if inferior + (eq ess-use-auto-complete t) + ess-use-auto-complete)) + (add-to-list 'ac-modes major-mode) + ;; files should be in front; ugly, but needed + (setq ac-sources + (delq 'ac-source-filename ac-sources)) + (mapc (lambda (el) (add-to-list 'ac-sources el)) + sources) + (add-to-list 'ac-sources 'ac-source-filename))) + +(defun ess--setup-company (sources &optional inferior) + "Setup company depending on user settings. +SOURCES gets added to `company-backends', and when t, INFERIOR +specifies inferior buffers." + ;; company + (when (and (boundp 'company-backends) + (if inferior + (eq ess-use-company t) + ess-use-company)) + (setq-local company-backends + (cl-copy-list (append sources company-backends))) + (delq 'company-capf company-backends))) (defmacro ess--execute-electric-command (map &optional prompt wait exit-form &rest args) "Execute single-key comands defined in MAP till a key is pressed which is not part of map. - -Return the value of the lastly executed command. - Single-key input commands are those that once executed do not -requre the prefix command for subsequent invocation. - -PROMPT is passed to `read-event'. +require the prefix command for subsequent invocation. Return the +value of the lastly executed command. PROMPT is passed to +`read-event'. If WAIT is t, wait for next input and ignore the keystroke which triggered the command. @@ -663,21 +565,21 @@ t. See examples in the tracebug code." (push ev unread-command-events)) out))) -(defvar ess-build-tags-command nil +(cl-defgeneric ess-build-tags-command () "Command passed to generate tags. - If nil, `ess-build-tags-for-directory' uses the mode's imenu -regexpresion. Othersiwe, it should be a string with two %s -formats: one for directory and another for the output file.") +expression. Otherwise, it should be a string with two %s +formats: one for directory and another for the output file." + nil) -;;;*;;; Emacs itself + +;;; Emacs itself (defun ess-yank-cleaned-commands () "Yank and strip the code, leaving only (R/S/Lsp/..) commands. Deletes any lines not beginning with a prompt, and then removes -the prompt from those lines that remain. - -Invoke this command with C-u C-u C-y." +the prompt from those lines that remain. Invoke this command with +C-u C-u C-y." (setq yank-window-start (window-start)) (let ((beg (point))) (push-mark beg) @@ -688,8 +590,7 @@ Invoke this command with C-u C-u C-y." (if (eq (point) beg) (message "No commands found")) (if (eq this-command t) - (setq this-command 'yank)) - )) + (setq this-command 'yank)))) (defun ess-yank (&optional arg) "With double prefix ARG (C-u C-u) call `ess-yank-cleaned-commands'." @@ -706,7 +607,6 @@ Invoke this command with C-u C-u C-y." (defun ess-build-tags-for-directory (dir tagfile) "Ask for directory and tag file and build tags for current dialect. - If the current language defines `ess-build-tags-command' use it and ask the subprocess to build the tags. Otherwise use imenu regexp and call find .. | etags .. in a shell command. You must @@ -730,10 +630,10 @@ GTags file (default TAGS): ") (when (file-remote-p dir) (require 'tramp) (setq dir (with-parsed-tramp-file-name dir foo foo-localname))) - (if (and ess-build-tags-command (null current-prefix-arg)) - (ess-eval-linewise (format ess-build-tags-command dir tagfile)) + (if (and (ess-build-tags-command) (null current-prefix-arg)) + (ess-eval-linewise (format (ess-build-tags-command) dir tagfile)) ;; else generate from imenu - (unless (or imenu-generic-expression ess-imenu-generic-expression) ;; need both!! + (unless imenu-generic-expression (error "No ess-tag-command found, and no imenu-generic-expression defined")) (let* ((find-cmd (format "find %s -type f -size 1M \\( -regex \".*\\.\\(cpp\\|jl\\|[RsrSch]\\(nw\\)?\\)$\" \\)" dir)) @@ -750,8 +650,8 @@ GTags file (default TAGS): ") (when (= 0 (shell-command (format "%s | %s" find-cmd tags-cmd))) (message "Building tags .. ok!"))))) - -;;;*;;; System + +;;; System ;; trying different viewers; thanks to an original patch for ;; ess-swv.el from Leo : @@ -788,7 +688,7 @@ Otherwise try a list of fixed known viewers." viewer)) -;;*;; UI +;;; UI (defvar ess-current-region-overlay (let ((overlay (make-overlay (point) (point)))) @@ -822,7 +722,6 @@ and y-offsets for the toolbar from point." (fw (frame-pixel-width)) (fh (frame-pixel-height)) frame-left frame-top my-x-offset my-y-offset) - ;; The following comment was found before code looking much like that ;; of frame-left and frame-top below in the file ;; tooltip-help.el. I include it here for acknowledgement, and I did observe @@ -835,34 +734,28 @@ and y-offsets for the toolbar from point." ;; least on Windows XP. The handling code is "shamelessly ;; stolen" from cedet/speedbar/dframe.el ;; (contributed by Andrey Grigoriev) - (setq frame-left (if (not (consp fx)) fx (if (eq (car fx) '-) - (- (x-display-pixel-width) (car (cdr fx)) fw) + (- (display-pixel-width) (car (cdr fx)) fw) (car (cdr fx))))) - (setq frame-top (if (not (consp fy)) fy (if (eq (car fy) '-) - (- (x-display-pixel-height) (car (cdr fy)) fh) + (- (display-pixel-height) (car (cdr fy)) fh) (car (cdr fy))))) - ;; calculate the offset from point, use xo and yo to adjust to preference (setq my-x-offset (+ (car(window-inside-pixel-edges)) (car(posn-x-y (posn-at-point))) frame-left xo)) - (setq my-y-offset (+ (cadr(window-inside-pixel-edges)) (cdr(posn-x-y (posn-at-point))) frame-top yo)) - (let ((tooltip-frame-parameters (cons (cons 'top my-y-offset) (cons (cons 'left my-x-offset) tooltip-frame-parameters)))) - (tooltip-show text)) - )) + (tooltip-show text)))) (defun ess-select-frame-set-input-focus (frame) "Select FRAME, raise it, and set input focus, if possible. @@ -886,143 +779,10 @@ Copied almost verbatim from gnus-utils.el (but with test for mac added)." (when focus-follows-mouse (set-mouse-position frame (1- (frame-width frame)) 0))) -(defun ess-do-auto-fill () - "This is the same as \\[do-auto-fill] in GNU emacs 21.3, with one major -difference: if we could not find a suitable place to break the line, -we simply do not break it (instead of breaking after the first word)." - (let (fc justify bol give-up - (fill-prefix fill-prefix)) - (if (or (not (setq justify (current-justification))) - (null (setq fc (current-fill-column))) - (and (eq justify 'left) - (<= (current-column) fc)) - (save-excursion (beginning-of-line) - (setq bol (point)) - (and auto-fill-inhibit-regexp - (looking-at auto-fill-inhibit-regexp)))) - nil ;; Auto-filling not required - (if (memq justify '(full center right)) - (save-excursion (unjustify-current-line))) - - ;; Choose a fill-prefix automatically. - (if (and adaptive-fill-mode - (or (null fill-prefix) (string= fill-prefix ""))) - (let ((prefix - (fill-context-prefix - (save-excursion (backward-paragraph 1) (point)) - (save-excursion (forward-paragraph 1) (point))))) - (and prefix (not (equal prefix "")) - (setq fill-prefix prefix)))) - - (while (and (not give-up) (> (current-column) fc)) - ;; Determine where to split the line. - (let* (after-prefix - (fill-point - (let ((opoint (point)) - bounce - (first t)) - (save-excursion - (beginning-of-line) - (setq after-prefix (point)) - (and fill-prefix - (looking-at (regexp-quote fill-prefix)) - (setq after-prefix (match-end 0))) - (move-to-column (1+ fc)) - ;; Move back to the point where we can break the line. - ;; We break the line between word or - ;; after/before the character which has character - ;; category `|'. We search space, \c| followed by - ;; a character, or \c| following a character. If - ;; not found, place the point at beginning of line. - (while (or first - ;; If this is after period and a single space, - ;; move back once more--we don't want to break - ;; the line there and make it look like a - ;; sentence end. - (and (not (bobp)) - (not bounce) - sentence-end-double-space - (save-excursion (forward-char -1) - (and (looking-at "\\. ") - (not (looking-at "\\. "))))) - (and (not (bobp)) - (not bounce) - fill-nobreak-predicate - (funcall fill-nobreak-predicate))) - (setq first nil) - (re-search-backward "[ \t]\\|\\c|.\\|.\\c|\\|^") - ;; If we find nowhere on the line to break it, - ;; do not break it. Set bounce to t - ;; so we will not keep going in this while loop. - (if (<= (point) after-prefix) - (setq bounce t) - (if (looking-at "[ \t]") - ;; Break the line at word boundary. - (skip-chars-backward " \t") - ;; Break the line after/before \c|. - (forward-char 1)))) - (if enable-multibyte-characters - ;; If we are going to break the line after or - ;; before a non-ascii character, we may have - ;; to run a special function for the charset - ;; of the character to find the correct break - ;; point. - (if (not (and (eq (charset-after (1- (point))) 'ascii) - (eq (charset-after (point)) 'ascii))) - (fill-find-break-point after-prefix))) - - ;; Let fill-point be set to the place where we end up. - ;; But move back before any whitespace here. - (skip-chars-backward " \t") - (point))))) - - ;; See whether the place we found is any good. - (if (save-excursion - (goto-char fill-point) - (and (not (bolp)) - ;; There is no use breaking at end of line. - (not (save-excursion (skip-chars-forward " ") (eolp))) - ;; It is futile to split at the end of the prefix - ;; since we would just insert the prefix again. - (not (and after-prefix (<= (point) after-prefix))) - ;; Don't split right after a comment starter - ;; since we would just make another comment starter. - (not (and comment-start-skip - (let ((limit (point))) - (beginning-of-line) - (and (re-search-forward comment-start-skip - limit t) - (eq (point) limit))))))) - ;; Ok, we have a useful place to break the line. Do it. - (let ((prev-column (current-column))) - ;; If point is at the fill-point, do not `save-excursion'. - ;; Otherwise, if a comment prefix or fill-prefix is inserted, - ;; point will end up before it rather than after it. - (if (save-excursion - (skip-chars-backward " \t") - (= (point) fill-point)) - (funcall comment-line-break-function t) - (save-excursion - (goto-char fill-point) - (funcall comment-line-break-function t))) - ;; Now do justification, if required - (if (not (eq justify 'left)) - (save-excursion - (end-of-line 0) - (justify-current-line justify nil t))) - ;; If making the new line didn't reduce the hpos of - ;; the end of the line, then give up now; - ;; trying again will not help. - (if (>= (current-column) prev-column) - (setq give-up t))) - ;; No good place to break => stop trying. - (setq give-up t)))) - ;; Justify last line. - (justify-current-line justify t t) - t))) +(define-obsolete-function-alias 'ess-do-auto-fill 'do-auto-fill "ESS 19.04") -;;*;; Syntax +;;; Syntax (defun ess-containing-sexp-position () (cadr (syntax-ppss))) @@ -1052,74 +812,71 @@ we simply do not break it (instead of breaking after the first word)." (concat "\\(" ess-r-symbol-pattern "+\\|\\(`\\).+`\\)") "The regular expression for matching a R name.") -(let* ((Q "\\s\"") ; quote - (repl "\\(<-\\)?") ; replacement (function) - (Sym-0 "\\(\\sw\\|\\s_\\)") ; symbol - (Symb (concat Sym-0 "+")) - (xSymb "[^ \t\n\"']+") ;; (concat "\\[?\\[?" Sym-0 "*")); symbol / [ / [[ / [symbol / [[symbol - ;; FIXME: allow '%foo%' but only when quoted; don't allow [_0-9] at beg. - (_or_ "\\)\\|\\(") ; OR - (space "\\(\\s-\\|\n\\)*") ; white space - - (part-1 (concat - "\\(" ;;--------outer Either------- - "\\(\\(" ; EITHER - Q xSymb Q ; any function name between quotes - _or_ - "\\(^\\|[ ]\\)" Symb ; (beginning of name) + ess-r-symbol-pattern - "\\)\\)")) ; END EITHER OR - - (set-S4-exp - (concat - "^set\\(As\\|Method\\|Generic\\|GroupGeneric\\|ReplaceMethod\\)(" ; S4 ... - Q xSymb Q "," space - ;; and now often `` signature(......), : '' - ".*" ;; <<< FIXME ??? - )) - - (part-2 (concat - "\\|" ;;--------outer Or --------- - set-S4-exp - "\\)" ;;--------end outer Either/Or------- - - "\\(" space "\\s<.*\\s>\\)*" ; whitespace, comment - ;; FIXME: in principle we should skip 'definition *= *' here - space "function\\s-*(" ; whitespace, function keyword, parenthesis - ))) - - (defvar ess-r-function-pattern - (concat part-1 - "\\s-*\\(<-\\|=\\)" ; whitespace, assign - part-2) - "The regular expression for matching the beginning of an R function.") - - (defvar ess-s-function-pattern - (concat part-1 - "\\s-*\\(<-\\|_\\|=\\)" ; whitespace, assign (incl. "_") - part-2) - "The regular expression for matching the beginning of an S function.")) - +(defvar ess--r-s-function-pattern + (let* ((Q "\\s\"") ; quote + (Sym-0 "\\(\\sw\\|\\s_\\)") ; symbol + (Symb (concat Sym-0 "+")) + (xSymb "[^ \t\n\"']+") ;; (concat "\\[?\\[?" Sym-0 "*")); symbol / [ / [[ / [symbol / [[symbol + ;; FIXME: allow '%foo%' but only when quoted; don't allow [_0-9] at beg. + (regex-or "\\)\\|\\(") ; OR + (space "\\(\\s-\\|\n\\)*") ; white space + + (part-1 (concat + "\\(" ;;--------outer Either------- + "\\(\\(" ; EITHER + Q xSymb Q ; any function name between quotes + regex-or + "\\(^\\|[ ]\\)" Symb ; (beginning of name) + ess-r-symbol-pattern + "\\)\\)")) ; END EITHER OR + + (set-S4-exp + (concat + "^set\\(As\\|Method\\|Generic\\|GroupGeneric\\|ReplaceMethod\\)(" ; S4 ... + Q xSymb Q "," space + ;; and now often `` signature(......), : '' + ".*" ;; <<< FIXME ??? + )) + + (part-2 (concat + "\\|" ;;--------outer Or --------- + set-S4-exp + "\\)" ;;--------end outer Either/Or------- + + "\\(" space "\\s<.*\\s>\\)*" ; whitespace, comment + ;; FIXME: in principle we should skip 'definition *= *' here + space "function\\s-*(" ; whitespace, function keyword, parenthesis + ))) + `(,part-1 ,part-2)) + "Placeholder for use in constructing `ess-r-function-pattern' and `ess-s-function-pattern'.") + +(defvar ess-r-function-pattern + (concat (car ess--r-s-function-pattern) + "\\s-*\\(<-\\|=\\)" ; whitespace, assign + (nth 1 ess--r-s-function-pattern)) + "The regular expression for matching the beginning of an R function.") + +(defvar ess-s-function-pattern + (concat (car ess--r-s-function-pattern) + "\\s-*\\(<-\\|_\\|=\\)" ; whitespace, assign (incl. "_") + (nth 1 ess--r-s-function-pattern)) + "The regular expression for matching the beginning of an S function.") (defvar ess--fn-name-start-cache nil) -(defun ess--fn-name-start (&optional look-back) +(defun ess--fn-name-start () "Return (FN-NAME . START-POS). FN-NAME is a function name located before the pointer. START-POS -is the position where FN-NAME starts. LOOK-BACK is a number of -characters to look back; defaults to 2000. Store this cons in -variable `ess--fn-name-start-cache'." +is the position where FN-NAME starts. Store this cons in variable +`ess--fn-name-start-cache'." (save-excursion (save-restriction (let* ((proc (get-buffer-process (current-buffer))) (mark (and proc (process-mark proc)))) - (if (and mark (>= (point) mark)) (narrow-to-region mark (point))) - (and (fboundp 'ess-noweb-narrow-to-chunk) (bound-and-true-p ess-noweb-mode) (ess-noweb-narrow-to-chunk)) - (unless (ess-inside-string-p) (setq ess--fn-name-start-cache (condition-case nil ;; check if it is inside a functon @@ -1135,128 +892,11 @@ variable `ess--fn-name-start-cache'." (cons funname (- (point) (length funname)))))) (error nil)))))))) -(defun ess-beginning-of-function (&optional no-error) - "Leave (and return) the point at the beginning of the current ESS function. -If the optional argument NO-ERROR is non-nil, the function returns nil when -it cannot find a function beginning." - ;; FIXME: should not throw error in accordance with beginning-of-defun and - ;; beginning-of-defun-function specification - ;; FIXME: should __WORK__ in the crucial case: large function w/ internal function defs - (interactive) - (let ((init-point (point)) - (in-set-S4 nil) - beg end done) - - ;; Note that we must be sure that we are past the 'function (' text, - ;; such that ess-function-pattern is found in BACKwards later. - ;; In case we're sitting in a function or setMethod() header, - ;; we need to move further. - ;; But not too far! {wrongly getting into next function} - (if (search-forward "(" - (ess-line-end-position 2) t) ; at most end of next line - (forward-char 1)) - ;; TODO: replace the above by hopefully more sucessful logic: - ;; 1. If we have 'function *(' in the same line, move to end of that line - ;; 2. if *not*, skip all comment lines (concat space comment-char .* "\n") - ;; and only* then do something like the - ;; (search-forward '(' .. (..line-end.. 2) ) above - - (setq end (point)) ; = init-point when nothing found - - (ess-write-to-dribble-buffer - (format "ess-BEG-of-fun after 'search-FWD (': Ini-pt %d, (p)-Ini-pt = %d\n" - init-point (- end init-point))) - (if (and (> end 1) - (re-search-backward ;; in case of setMethod() etc .. - ess-r-set-function-start - ;; at most 1 line earlier {2 is too much: finds previous sometimes} - (+ 1 (ess-line-end-position -1)) t)) - - (progn ;; yes we *have* an S4 setMethod(..)-like - (setq in-set-S4 t - beg (point)) - (ess-write-to-dribble-buffer - (format " set*() function start at position %d" beg)) - ;; often need to move even further to have 'function(' to our left - ;; (if (search-forward "function" end t) - ;; (ess-write-to-dribble-buffer - ;; (format " -> 'function' already at pos %d\n" (point))) - ;; ;; else need to move further - (goto-char end) - ;; search 4 lines, we are pretty sure now: - (search-forward - "function" (ess-line-end-position 4) t) - ;; ) - (search-forward "(" (ess-line-end-position) t)) - ;; else: regular function; no set*Method(..) - (ess-write-to-dribble-buffer "ELSE not in setMethod() header ...\n")) - - (while (not done) - ;; Need this while loop to skip over local function definitions - - ;; In the case of non-success, it is inefficiently - ;; going back in the buffer through all function definitions... - (unless - (and (re-search-backward ess-function-pattern (point-min) t) - (not (ess-inside-string-or-comment-p (point)))) - (goto-char init-point) - (if no-error - (setq done t beg nil) - ;; else [default]: - (error "Point is not in a function according to 'ess-function-pattern'"))) - (unless done - (setq beg (point)) - (ess-write-to-dribble-buffer - (format "\tMatch,Pt:(%d,%d),%d\n" - (match-beginning 0) (match-end 0) beg)) - (setq in-set-S4 (looking-at ess-r-set-function-start)) - (forward-list 1) ; get over arguments - - ;; The following used to bomb "Unbalanced parentheses", n1, n2 - ;; when the above (search-forward "(" ..) wasn't delimited : - (unless in-set-S4 (forward-sexp 1)) ; move over braces - ;;DBG (ess-write-to-dribble-buffer "|") - (setq end (point)) - (goto-char beg) - ;; current function must begin and end around point - (setq done (and (>= end init-point) (<= beg init-point))))) - beg)) - -(defun ess-end-of-function (&optional beginning no-error) - "Leave the point at the end of the current ESS function. -Optional argument for location of BEGINNING. Return '(beg end)." - (interactive) - (if beginning - (goto-char beginning) - (setq beginning (ess-beginning-of-function no-error))) - (if beginning - ;; *hack* only for S (R || S+): are we in setMethod(..) etc? - (let ((in-set-S4 (looking-at ess-r-set-function-start)) - (end-pos) (npos)) - (ess-write-to-dribble-buffer - (format "ess-END-of-fun: S4=%s, beginning = %d\n" in-set-S4 beginning)) - (forward-list 1) ; get over arguments || whole set*(..) - (unless in-set-S4 (forward-sexp 1)) ; move over braces - (ess-write-to-dribble-buffer - (format "ess-END-of-fun: found #1 : %d\n" (point))) - - ;; For one-line functions withOUT '{ .. }' body -- added 2008-07-23 -- - ;; particularly helpful for C-c C-c (ess-eval-function-or-paragraph-and-step): - (setq end-pos (ess-line-end-position)) - (while (< (point) end-pos) ; if not at end of line, move further forward - (goto-char ;; careful not to move too far; e.g. *not* over empty lines: - (min (save-excursion (forward-sexp 1) (point)) - (save-excursion (forward-paragraph 1) (point))))) - (list beginning (point))) - ;; else: 'no-error': we are not in a function - nil)) - (defun ess-symbol-at-point () "Like `symbol-at-point' but consider fully qualified names. Fully qualified names include accessor symbols (like aaa$bbb and aaa@bbb in R)." (with-syntax-table (or ess-mode-completion-syntax-table - ess-mode-syntax-table (syntax-table)) (symbol-at-point))) @@ -1264,7 +904,6 @@ aaa@bbb in R)." "Get bounds of symbol at point. Intended for completion." (let ((bounds (with-syntax-table (or ess-mode-completion-syntax-table - ess-mode-syntax-table (syntax-table)) (bounds-of-thing-at-point 'symbol)))) (and bounds @@ -1323,7 +962,7 @@ also return t if inside curly brackets." r))) -;;*;; String manipulation +;;; String manipulation (defun ess-quote-special-chars (string) (replace-regexp-in-string @@ -1331,16 +970,6 @@ also return t if inside curly brackets." (replace-regexp-in-string ;; replace backslashes "\\\\" "\\\\" string nil t))) -;; simple alternative to ess-read-object-name-default of ./ess-inf.el : -;; is "wrongly" returning "p1" for word "p1.part2" : -(defun ess-extract-word-name () - "Get the word you're on (cheap algorithm). -Use `ess-read-object-name-default' for a better but slower -version." - (save-excursion - (re-search-forward "\\<\\w+\\>" nil t) - (buffer-substring (match-beginning 0) (match-end 0)))) - (defun ess-rep-regexp (regexp to-string &optional fixedcase literal verbose) "Instead of (replace-regexp..) -- do NOT replace in strings or comments. If FIXEDCASE is non-nil, do *not* alter case of replacement text. @@ -1358,12 +987,7 @@ If VERBOSE is non-nil, (message ..) about replacements." (let ((beg (match-beginning 0))) (message "buffer in (match-beg.,p)=(%d,%d) is '%s'" beg p (buffer-substring beg p)))) - (replace-match to-string fixedcase literal) - ;;or (if verbose (setq pl (append pl (list p)))) - ))) - ;;or (if (and verbose pl) - ;;or (message "s/%s/%s/ at %s" regexp to-string pl)) - ) ) + (replace-match to-string fixedcase literal)))))) (defun ess-replace-regexp-dump-to-src (regexp to-string &optional dont-query verbose) "Replace REGEXP matches from beginning of buffer with TO-STRING. @@ -1385,9 +1009,7 @@ Start at from FROM, which defaults to point." "\\1 \\2" nil nil verbose) (goto-char from) (ess-rep-regexp (concat "\\(\\<" word "\\>\\)\\([^ \t\n]\\)") - "\\1 \\2" nil nil verbose) - ) - ) + "\\1 \\2" nil nil verbose))) (defun ess-time-string (&optional clock) "Return a string for use as a timestamp, like \"13 Mar 1992\". @@ -1463,7 +1085,7 @@ Otherwise treat \\ in NEWTEXT string as special: ;; (add-hook 'local-write-file-hooks 'nuke-trailing-whitespace))) (defvar ess-nuke-trailing-whitespace-p nil;disabled by default 'ask - "*[Dis]activates (ess-nuke-trailing-whitespace). + "[Dis]activates (ess-nuke-trailing-whitespace). Disabled if nil; if t, it works unconditionally, otherwise, the user is queried. Note that setting the default to t may not be a good idea when you edit @@ -1473,19 +1095,17 @@ binary files!") ;;; -- but no customization like nuke-trailing-whitespace-p .. (defun ess-nuke-trailing-whitespace () "Nuke all trailing whitespace in the buffer. -Whitespace in this case is just spaces or tabs. -This is a useful function to put on `write-file-hooks'. - -If the variable `ess-nuke-trailing-whitespace-p' is nil, this function is -disabled. If t, unreservedly strip trailing whitespace. -If not nil and not t, query for each instance." +Whitespace in this case is just spaces or tabs. This is a useful +function to put on `write-file-hooks'. If the variable +`ess-nuke-trailing-whitespace-p' is nil, this function is +disabled. If t, unreservedly strip trailing whitespace. If not +nil and not t, query for each instance." (interactive) (let ((bname (buffer-name))) (cond ((or (string= major-mode "rmail-mode") (string= bname "RMAIL") nil)); do nothing.. - (t (and (not buffer-read-only) ess-nuke-trailing-whitespace-p @@ -1504,7 +1124,7 @@ If not nil and not t, query for each instance." nil)) -;;*;; Debugging tools +;;; Debugging tools (defun ess-write-to-dribble-buffer (text) "Write TEXT to `ess-dribble-buffer'." @@ -1517,7 +1137,6 @@ If not nil and not t, query for each instance." "Write TEXT to `ess-dribble-buffer' only if `ess-verbose' is non-nil." (when ess-verbose (ess-write-to-dribble-buffer text))) - (defun ess-kill-last-line () (save-excursion (goto-char (point-max)) @@ -1587,16 +1206,12 @@ Adds the `ess-face-adjusted' property so we only adjust face once." (put (car pair) 'permanent-local t))) ;; hack for Rnw alist)) -(defun ess-setq-vars-default (alist &optional buf) - "Set language variables from ALIST, in buffer BUF, if desired." - (when buf (set-buffer buf)) - (mapc (lambda (pair) - (set-default (car pair) (eval (cdr pair)))) - alist)) - (defvar ess-error-regexp "^\\(Syntax error: .*\\) at line \\([0-9]*\\), file \\(.*\\)$" "Regexp to search for errors.") +(define-obsolete-function-alias 'ess-beginning-of-function 'beginning-of-defun "ESS 19.04") +(define-obsolete-function-alias 'ess-end-of-function 'end-of-defun "ESS 19.04") + (provide 'ess-utils) ;;; ess-utils.el ends here diff --git a/elpa/ess-20190121.1430/ess.el b/elpa/ess-20190121.1430/ess.el new file mode 100644 index 00000000..fc69a9bd --- /dev/null +++ b/elpa/ess-20190121.1430/ess.el @@ -0,0 +1,222 @@ +;;; ess.el --- Emacs Speaks Statistics -*- lexical-binding: t; -*- +;; +;; Author: David Smith +;; A.J. Rossini +;; Richard M. Heiberger +;; Kurt Hornik +;; Martin Maechler +;; Rodney A. Sparapani +;; Stephen Eglen +;; Sebastian P. Luque +;; Henning Redestig +;; Vitalie Spinu +;; Lionel Henry +;; J. Alexander Branham +;; +;; Maintainer: ESS Core Team +;; Copyright (C) 1997-2018 ESS Core Team +;; Created: 7 Jan 1994 +;; Version: 18.10.3snapshot +;; URL: https://ess.r-project.org/ +;; Package-Requires: ((emacs "25.1") (julia-mode "0.3")) +;; ESSR-Version: 1.5 +;; +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; A copy of the GNU General Public License is available at +;; https://www.r-project.org/Licenses/ +;; +;;; Commentary: +;; +;; Emacs Speaks Statistics (ESS) is a package designed to support editing of +;; scripts and interaction with various statistical analysis programs such as R, +;; S-Plus, SAS, Stata and OpenBUGS/JAGS. For more details please visit ESS home +;; page at https://ess.r-project.org/ +;; +;;; Code: + +(require 'ess-custom) + +(defvar reporter-prompt-for-summary-p) + + +;;*;; Internal ESS tools and variables + +(defvar ess-lisp-directory + (directory-file-name + (file-name-directory + (if load-file-name + (file-truename load-file-name) + (locate-library "ess-utils") ))) + "Directory containing ess-site.el(c) and other ESS Lisp files.") + +(defvar ess-etc-directory nil + "Location of the ESS etc/ directory. +The ESS etc directory stores various auxillary files that are useful +for ESS, such as icons.") +;; Try to detect the `etc' folder only if not alread set up by distribution +(unless ess-etc-directory + (let ((path-list '("../etc/ess/" "../etc/" "../../etc/ess/" "./etc/"))) + (while (and (listp path-list) (consp path-list)) + (setq ess-etc-directory + (expand-file-name (concat ess-lisp-directory "/" + (car path-list)))) + (if (file-directory-p ess-etc-directory) + (setq path-list nil) + (setq ess-etc-directory nil) + (setq path-list (cdr path-list)) + (when (null path-list) + (beep 0) (beep 0) + (message (concat + "ERROR:ess-etc-directory\n" + "Relative to ess-lisp-directory, one of the following must exist:\n" + "../etc/ess, ../etc, ../../etc/ess or ./etc")) + (sit-for 4)))))) + +(defvar-local ess--make-local-vars-permanent nil + "If this variable is non-nil in a buffer make all variable permannet. +Used in noweb modes.") +(put 'ess--make-local-vars-permanent 'permanent-local t) + + +;; Versions + +;; updated by 'make'! +(defconst ess-version "18.10.3snapshot" + "Version of ESS currently loaded.") + +;; updated by 'make'! +(defconst essr-version "1.5" + "Version of ESSR package.") + +(defvar ess-revision nil + "The revision and date of ESS. +Is set by \\[ess-version-string].") + +;;;###autoload +(defun ess-version () + "Return a string with ESS version information." + (interactive) + (message (format "ess-version: %s (loaded from %s)" + (ess-version-string) + (file-name-directory ess-lisp-directory)))) + +(defun ess-version-string () + (let* ((ess-dir (file-name-directory ess-lisp-directory)) ; if() the top-level 'ess/' + (is-release (file-exists-p (concat ess-etc-directory ".IS.RELEASE"))) + (rel-string (if is-release "Released ")) + (git-ref-fn (concat ess-dir ".git/HEAD")) + (git-ref (when (file-exists-p git-ref-fn) + (with-current-buffer (find-file-noselect git-ref-fn) + (goto-char (point-min)) + (when (re-search-forward "ref: \\(.*\\)\n" nil t) + (match-string 1))))) + (git-fname (if git-ref + (concat ess-dir ".git/" git-ref) + ;; For release + (concat ess-etc-directory "git-ref"))) + (git-rev (when (file-exists-p git-fname) + (with-current-buffer (find-file-noselect git-fname) + (goto-char (point-min)) + (concat "git: "(buffer-substring 1 (point-at-eol)))))) + (elpa-fname (concat ess-dir "ess-pkg.el")) + (elpa-rev (when (file-exists-p elpa-fname) + ;; Get it from ELPA dir name, (probably won't work if installed manually) + (concat "elpa: " + (replace-regexp-in-string "ess-" "" + (file-name-nondirectory + (substring ess-dir 1 -1))))))) + ;; Set the "global" ess-revision: + (setq ess-revision (format "%s%s%s" + (or rel-string "") + (or git-rev "") + (or elpa-rev ""))) + (when (string= ess-revision "") + (setq ess-revision "")) + (concat ess-version " [" ess-revision "]"))) + + +;;; Bug Reporting + +;;;###autoload +(defun ess-submit-bug-report () + "Submit a bug report to the ESS maintainers." + (interactive) + (let ((reporter-prompt-for-summary-p 't)) + (reporter-submit-bug-report + "ess-bugs@r-project.org" + (concat "ess-mode " (ess-version-string)) + (list 'ess-language + 'ess-dialect + 'ess-ask-for-ess-directory + 'ess-ask-about-transfile + 'default-directory + 'ess-keep-dump-files + 'ess-source-directory + 'ess-use-ido + 'ess-use-eldoc + 'ess-use-tracebug + 'ess-use-auto-complete + 'ess-use-company + 'ess-eval-visibly-p + 'ess-can-eval-in-background + 'ess-local-process-name) + nil + (lambda () + ;;(goto-char (point-max)) + (rfc822-goto-eoh) + (forward-line 1) + (insert "\n\n-------------------------------------------------------\n") + (insert "This bug report will be sent to the ESS bugs email list\n") + (insert "Press C-c C-c when you are ready to send your message.\n") + (insert "-------------------------------------------------------\n\n") + (insert (with-current-buffer ess-dribble-buffer + (goto-char (point-max)) + (forward-line -100) + (buffer-substring-no-properties (point) (point-max)))))))) + + + +;;; Timer + +(defcustom ess-idle-timer-interval 1 + "Number of idle seconds to wait before running function in `ess-idle-timer-functions'." + :type '(integer) + :group 'ess) + +(defvar ess-idle-timer-functions nil + "A list of functions to run each `ess-idle-timer-interval' idle seconds. +If your function calls the process, you better use +`ess-when-new-input' to wrap your call. If you call the +subprocess please respect `ess-can-eval-in-background' variable. + +These functions are run with `run-hooks'. Use `add-hook' to add +symbols to this variable. + +Most likely you will need a local hook. Then you should specify +the LOCAL argument to `add-hook' and initialise it in +`ess-mode-hook' or `ess-post-run-hook', or one of the more +specialised hooks `ess-r-post-run-hook',`ess-stata-post-run-hook' +etc.") + +(defun ess--idle-timer-function nil + "Internal function executed by `ess--idle-timer'." + (run-hooks 'ess-idle-timer-functions)) + +(require 'timer) +(defvar ess--idle-timer + (run-with-idle-timer ess-idle-timer-interval 'repeat 'ess--idle-timer-function) + "Timer used to run `ess-idle-timer-functions'.") + + +(provide 'ess) + +;;; ess.el ends here diff --git a/elpa/ess-20181109.703/ess.info b/elpa/ess-20190121.1430/ess.info similarity index 94% rename from elpa/ess-20181109.703/ess.info rename to elpa/ess-20190121.1430/ess.info index 199e0af9..cbc3baaa 100644 --- a/elpa/ess-20181109.703/ess.info +++ b/elpa/ess-20190121.1430/ess.info @@ -14,7 +14,7 @@ File: ess.info, Node: Top, Next: Introduction, Up: (dir) ESS: Emacs Speaks Statistics **************************** -ESS version 18.10.2 +ESS version 18.10.3snapshot by A.J. Rossini, R.M. Heiberger, @@ -249,7 +249,96 @@ File: ess.info, Node: New features, Next: Credits, Prev: Features, Up: Intro 1.2 New features in ESS ======================= -Bug Fixes in 18.10.2: +Changes and New Features in 19.04 (unreleased): + + * Implement a more reliable check for the process busy state. + Background actions such as completion and directory synchronization + should not block the process and should not cause printing of the + extraneous output to the interpreter. + + * Activate 'goto-address-mode' for url and emal highlighting in + inferior buffers. + + * 'smart-underscore' and 'ess-smart-S-assign-key' have been removed. + Users who liked the previous behavior (i.e. underscore inserting + "<-") should bind 'ess-insert-assign' to the underscore in their + Emacs initialization file. For example, '(define-key + ess-r-mode-map "_" #'ess-insert-assign)' and '(define-key + inferior-ess-r-mode-map "_" #'ess-insert-assign)' will activate it + in all ESS R buffers. + + * ESS major modes are now defined using 'define-derived-mode'. This + makes ESS major modes respect modern conventions such as having + -mode-hook and -mode-map. Users are encouraged + to place customizations under the appropriate mode. + + * New option ess-auto-width controls setting the width option on + window changes. Users can change it to 'frame, 'window, or an + integer. See the docstring for details. 'ess-auto-width-visible' + controls visibility. + + * ESS now respects 'display-buffer-alist'. Users can now use + 'display-buffer-alist' to manage how and where windows appear. See + *Note (ess)Controlling buffer display:: for more information and + examples. + + * 'ess-roxy-mode' can now be enabled in non-R buffers. This is + primarily intended to support roxygen documentation for cpp + buffers. Preview functionality is not supported outside R buffers. + + * ESS[R]: DESCRIPTION files now open in 'conf-colon-mode'. + + * 'ess-style' now has effects when set as a file or directory local + variable. + + * 'ess-default-style' is now obsolete, use 'ess-style' instead. + + * Options for 'ess-gen-proc-buffer-name-function' have been renamed. + ess-gen-proc-buffer-name:projectile-or-simple was renamed to + ess-gen-proc-buffer-name:project-or-simple and + ess-gen-proc-buffer-name:projectile-or-directory was renamed to + ess-gen-proc-buffer-name:project-or-directory. As the name + suggests, these now rely on project.el (included with Emacs) rather + than projectile.el, which is a third-party package. + + * ESS[R] help pages now provide links to other help topics. This is + similar with what you would see with, for example + 'options(help_type = ``html'')' but works with the plain-text + version as well. This only works with 'options(useFancyQuotes = + TRUE)' (the default). + + * 'ess-rdired' buffers now derive from tabulated-list-mode. They + should look better and be a bit faster overall. The size column + now displays object sizes in bytes. + + * ESS removed support for many unused languages. This includes old + versions of S+, ARC, OMG, VST, and XLS. + + The following have been made obsolete or removed, see their +documentation for more detail: + + * Libraries for literate data analysis are obsolete and not loaded by + default. This includes 'ess-noweb', 'ess-swv', and related + functionality like 'Rnw-mode'. Users are encouraged to switch to + one of several other packages that deal with these modes. For + example, polymode , + , or markdown-mode with edit-indirect + . + + * User options for controlling display of buffers. This includes + 'ess-show-buffer-action', 'inferior-ess-same-window', + 'inferior-ess-own-frame', and 'inferior-ess-frame-alist'. See + above about ESS respecting 'display-buffer-alist'. + + * 'inferior-ess-*-start-file' variables. All modes except Stata did + not respect customization of this variable. In order to load a + file on startup, you should put a function on + 'ess-*-post-run-hook'. + + Bug Fixes in 18.10.3: + * More 'Makefile' fixes, notably installing '*.el's. + + Bug Fixes in 18.10.2: * ESS[R] Fix namespace evaluation in non-installed packages. Evaluation is directed into GlobalEnv as originally intended. * 'Makefile' fixes, notably for 'make install' and including full @@ -669,7 +758,7 @@ File: ess.info, Node: Installation, Next: Interactive ESS, Prev: Introduction 2 Installing ESS on your system ******************************* -ESS supports GNU Emacs versions 24.3 and newer. +ESS supports GNU Emacs versions 25.1 and newer. ESS is most likely to work with current/recent versions of the following statistical packages: R/S-PLUS, SAS, Stata, OpenBUGS and JAGS. @@ -815,6 +904,7 @@ statistical programs. * Multiple ESS processes:: * ESS processes on Remote Computers:: * Customizing startup:: +* Controlling buffer display::  File: ess.info, Node: Starting up, Next: Multiple ESS processes, Up: Interactive ESS @@ -948,7 +1038,7 @@ convert it to an ESS buffer and allow you to use the ESS commands with it.  -File: ess.info, Node: Customizing startup, Prev: ESS processes on Remote Computers, Up: Interactive ESS +File: ess.info, Node: Customizing startup, Next: Controlling buffer display, Prev: ESS processes on Remote Computers, Up: Interactive ESS 3.4 Changing the startup actions ================================ @@ -973,6 +1063,12 @@ default) then the value determined by the above rules provides the default when prompting for the starting directory. Incidentally, 'ess-directory' is an ideal variable to set in 'ess-pre-run-hook'. + You may also customize 'ess-post-run-hook' and the dialect-specific +'ess-*-post-run-hook' variables. For example, you may want to use +'ess-load-file' to load a file when ESS starts R: + + (add-hook 'ess-r-post-run-hook (lambda () (ess-load-file "foo.R"))) + If you like to keep a record of your R actions, set the variable 'ess-ask-about-transfile' to 't', and you will be asked for a filename for the transcript before the ESS process starts. @@ -997,11 +1093,55 @@ normally necessary to pass arguments to the iESS program; in particular do not pass the '-e' option to 'Splus', since ESS provides its own command history mechanism. - By default, the new process will be displayed in the same window in -the current frame. If you wish your iESS process to appear in a -separate frame, customize the variable 'inferior-ess-own-frame'. -Alternatively, change 'inferior-ess-same-window' if you wish the process -to appear within another window of the current frame. + ESS can set the width option of inferior processes automatically when +the window configuration changes. To do so, set 'ess-auto-width' to a +non-nil value. By default, the change will not be shown in the inferior +buffer. If you want it to be shown, set 'ess-auto-width-visible' to a +non-nil value. + + +File: ess.info, Node: Controlling buffer display, Prev: Customizing startup, Up: Interactive ESS + +3.5 Controlling buffer display +============================== + +Users can control how buffers are displayed by customizing +'display-buffer-alist', *Note (emacs)Window Choice::. This section +provides examples of how to achieve certain setups. + + Users coming from RStudio may want the R process to appear at the +bottom left of the frame, help buffers to appear at the bottom right, +and ess-rdired buffers at the top right. To achieve that, you could +this. Note that the order matters; '*R Dired*' would match '*R' if it +came before in the alist. + + (setq display-buffer-alist + `(("*R Dired" + (display-buffer-reuse-window display-buffer-in-side-window) + (side . right) + (slot . -1) + (window-width . 0.33) + (reusable-frames . nil)) + ("*R" + (display-buffer-reuse-window display-buffer-at-bottom) + (window-width . 0.5) + (reusable-frames . nil)) + ("*Help" + (display-buffer-reuse-window display-buffer-in-side-window) + (side . right) + (slot . 1) + (window-width . 0.33) + (reusable-frames . nil)))) + + Some users prefer working with multiple frames where one frame has +the source code and the other frame has the inferior process. To +achieve this, use this example. *Note (elisp)Buffer Display Action +Alists:: for a detailed description of 'reusable-frames'. + + (setq 'display-buffer-alist + '("*R" + (display-buffer-reuse-window display-buffer-pop-up-frame) + (reusable-frames . 0)))  File: ess.info, Node: Entering commands, Next: Evaluating code, Prev: Interactive ESS, Up: Top @@ -1949,24 +2089,23 @@ indentation variable per style (and its documentation contains more). variables; The 'OWN' style allows you to use your own private values of the indentation variable, see below. - -- User Option: ess-default-style - The default value of 'ess-style'. See the variable - 'ess-style-alist' for how these groups (DEFAULT, OWN, GNU, RRR, - ...) map onto different settings for variables. You can set this - in your Emacs configuration file: + -- User Option: ess-style + The style to use. See the variable 'ess-style-alist' for how these + groups (DEFAULT, OWN, GNU, RRR, ...) map onto different settings + for variables. You can set this in your Emacs configuration file: - (setq ess-default-style 'C++) + (setq ess-style 'C++) -- User Option: ess-style-alist Predefined formatting styles for ESS code. Values for all groups, except OWN, are fixed. To change the value of variables in the OWN group, customize the variable 'ess-own-style-list'. The default - style in use is controlled by 'ess-default-style'. + style in use is controlled by 'ess-style'. The styles 'DEFAULT' and 'OWN' are initially identical. If you wish -to edit some of the default values, set 'ess-default-style' to ''OWN' -and change 'ess-own-style-list'. *Note Customization::, for convenient -ways to set both these variables. +to edit some of the default values, set 'ess-style' to ''OWN' and change +'ess-own-style-list'. *Note Customization::, for convenient ways to set +both these variables. If you prefer not to use the customization facility, you can change individual indentation variables within a hook, for example: @@ -1979,7 +2118,7 @@ individual indentation variables within a hook, for example: style of your own, copy the definition of 'ess-own-style-list' to a new variable and ensure that the last line of the ':set' declaration calls 'ess-add-style' with a unique name for your style (e.g. ''MINE'). -Finally, add '(setq ess-default-style 'MINE)' to use your new style. +Finally, add '(setq ess-style 'MINE)' to use your new style.  File: ess.info, Node: Other edit buffer commands, Next: Source Files, Prev: Indenting, Up: Editing objects @@ -2879,8 +3018,9 @@ make Roxygen editing more intuitive: 'fill-paragraph' Fill the Roxygen field at point. 'C-a' - 'move-beginning-of-line' Move to the point directly to the right of - the Roxygen start string. + 'ess-roxy-move-beginning-of-line' Move to the point directly to the + right of the Roxygen start string. If already there, move to the + beginning of the line. 'RET' 'newline-and-indent' Insert a new line and the Roxygen prefix @@ -3318,8 +3458,16 @@ File: ess.info, Node: Sweave and AUCTeX, Prev: Org, Up: Extras 11.13 Support for Sweave in ESS and AUCTeX ========================================== -ESS provides support for writing and processing Sweave -(), building up on Emacs' +Libraries for literate data analysis are obsolete and not loaded by +default. This includes 'ess-noweb', 'ess-swv', and related +functionality like 'Rnw-mode'. Users are encouraged to switch to one of +several other packages that deal with these modes. For example, +polymode , +, or markdown-mode with edit-indirect +. + + ESS provides support for writing and processing Sweave +(), building up on Emacs' ess-noweb-mode for literate programming. When working on an Sweave document, the following key bindings are available: @@ -4434,9 +4582,9 @@ Key index * M-;: Indenting. (line 69) * M-?: Object names. (line 34) * M-C-q: Indenting. (line 53) -* M-n l: Sweave and AUCTeX. (line 16) -* M-n P: Sweave and AUCTeX. (line 22) -* M-n s: Sweave and AUCTeX. (line 12) +* M-n l: Sweave and AUCTeX. (line 24) +* M-n P: Sweave and AUCTeX. (line 30) +* M-n s: Sweave and AUCTeX. (line 20) * M-RET: Resubmit. (line 10) * RET: Command-line editing. (line 10) * RET <1>: Resubmit. (line 18) @@ -4528,6 +4676,7 @@ Function and program index (line 18) * ess-resynch: Object names. (line 53) * ess-roxy-hide-all: Roxygen. (line 71) +* ess-roxy-move-beginning-of-line: Roxygen. (line 97) * ess-roxy-next-entry: Roxygen. (line 68) * ess-roxy-preview-HTML: Roxygen. (line 58) * ess-roxy-preview-Rd: Roxygen. (line 50) @@ -4552,10 +4701,10 @@ Function and program index * ess-submit-bug-report: Reporting Bugs. (line 6) * ess-switch-to-end-of-ESS: Help. (line 117) * ess-switch-to-inferior-or-script-buffer: Other. (line 12) -* ess-swv-latex: Sweave and AUCTeX. (line 15) -* ess-swv-PDF: Sweave and AUCTeX. (line 21) -* ess-swv-PS: Sweave and AUCTeX. (line 18) -* ess-swv-weave: Sweave and AUCTeX. (line 11) +* ess-swv-latex: Sweave and AUCTeX. (line 23) +* ess-swv-PDF: Sweave and AUCTeX. (line 29) +* ess-swv-PS: Sweave and AUCTeX. (line 26) +* ess-swv-weave: Sweave and AUCTeX. (line 19) * ess-tracebug: ESS tracebug. (line 6) * ess-transcript-clean-region: Clean. (line 10) * ess-transcript-copy-command: Resubmit. (line 13) @@ -4569,8 +4718,7 @@ Function and program index * inferior-ess-send-input: Command-line editing. (line 9) * mark-paragraph: Roxygen. (line 85) -* move-beginning-of-line: Roxygen. (line 97) -* newline-and-indent: Roxygen. (line 101) +* newline-and-indent: Roxygen. (line 102) * objects(): Hot keys. (line 24) * printer(): printer. (line 11) * q(): Hot keys. (line 71) @@ -4598,10 +4746,12 @@ Variable index * comint-delimiter-argument-list: History expansion. (line 28) * comint-input-ring-size: Command History. (line 9) * comment-column: Indenting. (line 24) -* ess-ask-about-transfile: Customizing startup. (line 30) +* ess-ask-about-transfile: Customizing startup. (line 36) * ess-ask-about-transfile <1>: Saving transcripts. (line 12) * ess-ask-for-ess-directory: Customizing startup. (line 7) -* ess-default-style: Styles. (line 21) +* ess-ask-for-ess-directory <1>: Customizing startup. (line 21) +* ess-auto-width: Customizing startup. (line 56) +* ess-auto-width-visible: Customizing startup. (line 56) * ess-delete-dump-files: Source Files. (line 12) * ess-directory: Source Directories. (line 48) * ess-dump-filename-template: Source Directories. (line 9) @@ -4618,19 +4768,22 @@ Variable index * ess-keep-dump-files: Source Files. (line 26) * ess-plain-first-buffername: Multiple ESS processes. (line 14) +* ess-post-run-hook: Customizing startup. (line 26) +* ess-pre-run-hook: Customizing startup. (line 21) * ess-r-flymake-linters: ESS Flymake. (line 16) * ess-r-flymake-lintr-cache: ESS Flymake. (line 23) * ess-R-font-lock-keywords: Highlighting. (line 19) * ess-search-list: Source Directories. (line 62) * ess-source-directory: Source Directories. (line 22) -* ess-style-alist: Styles. (line 29) +* ess-style: Styles. (line 21) +* ess-style-alist: Styles. (line 28) * ess-switch-to-end-of-proc-buffer: Other. (line 21) -* ess-swv-pdflatex-commands: Sweave and AUCTeX. (line 27) +* ess-swv-pdflatex-commands: Sweave and AUCTeX. (line 35) * ess-tab-complete-in-script: Indenting. (line 42) * ess-use-eldoc: ESS ElDoc. (line 13) * ess-use-flymake: ESS Flymake. (line 12) -* iESS program arguments: Customizing startup. (line 42) -* inferior-ess-program: Customizing startup. (line 42) +* iESS program arguments: Customizing startup. (line 48) +* inferior-ess-program: Customizing startup. (line 48) * inferior-R-font-lock-keywords: Highlighting. (line 12) * Rd-indent-level: R documentation files. (line 85) @@ -4650,8 +4803,8 @@ Concept Index * aborting R commands: Other. (line 9) * aborting S commands: Other. (line 9) -* arguments to R program: Customizing startup. (line 45) -* arguments to S program: Customizing startup. (line 45) +* arguments to R program: Customizing startup. (line 51) +* arguments to S program: Customizing startup. (line 51) * authors: Credits. (line 6) * auto-complete: Auto-complete. (line 6) * autosaving: Source Files. (line 83) @@ -4779,7 +4932,7 @@ Concept Index * tramp support: ESS processes on Remote Computers. (line 9) * transcript: Transcript. (line 9) -* transcript file: Customizing startup. (line 34) +* transcript file: Customizing startup. (line 40) * transcript file names: Saving transcripts. (line 13) * transcript mode motion: Transcript Mode. (line 17) * transcripts of R sessions: Introduction. (line 38) @@ -4797,108 +4950,109 @@ Concept Index  Tag Table: Node: Top268 -Node: Introduction2906 -Node: Features5659 -Node: Current Features6495 -Node: New features9946 -Node: Credits23693 -Node: Manual27310 -Node: Installation29976 -Node: Installing from a third-party repository30913 -Node: Installing from source31860 -Node: Activating and Loading ESS33452 -Node: Check Installation34526 -Node: Interactive ESS34746 -Node: Starting up35560 -Node: Multiple ESS processes36304 -Node: ESS processes on Remote Computers37385 -Node: Customizing startup41488 -Node: Entering commands44105 -Node: Command-line editing45263 -Node: Transcript46496 -Node: Last command48265 -Node: Process buffer motion49691 -Node: Transcript resubmit51194 -Node: Saving transcripts53159 -Node: Command History54949 -Node: Saving History58358 -Node: History expansion59119 -Node: Hot keys62330 -Node: Statistical Process running in ESS?66400 -Node: Emacsclient67679 -Node: Other68471 -Node: Evaluating code69490 -Node: Transcript Mode73171 -Node: Resubmit74324 -Node: Clean75387 -Node: Editing objects76383 -Node: Edit buffer77501 -Node: Loading79547 -Node: Error Checking80574 -Node: Indenting81623 -Node: Styles84812 -Node: Other edit buffer commands87247 -Node: Source Files88903 -Node: Source Directories93507 -Node: Help96660 -Node: Completion100758 -Node: Object names100991 -Node: Function arguments103664 -Node: Minibuffer completion104203 -Node: Auto-complete104683 -Node: Company106230 -Node: Icicles106609 -Node: Developing with ESS107929 -Node: ESS tracebug108375 -Node: Getting started with tracebug111382 -Node: Editing documentation113540 -Node: R documentation files114090 -Node: Roxygen118017 -Node: Namespaced Evaluation122352 -Node: Extras124350 -Node: ESS ElDoc125374 -Node: ESS Flymake126870 -Node: Handy commands127964 -Node: Highlighting129161 -Node: Parens130196 -Node: Graphics130672 -Node: printer131343 -Node: X11132099 -Node: winjava132438 -Node: Imenu132850 -Node: Toolbar133697 -Node: Xref134105 -Node: Rdired134428 -Node: Rutils135482 -Node: Org137876 -Node: Sweave and AUCTeX138821 -Node: ESS for R140947 -Node: ESS(R)--Editing files141247 -Node: iESS(R)--Inferior ESS processes141766 -Node: Philosophies for using ESS(R)146515 -Node: Example ESS usage147442 -Node: ESS for SAS149663 -Node: ESS(SAS)--Design philosophy150386 -Node: ESS(SAS)--Editing files151339 -Node: ESS(SAS)--TAB key153193 -Node: ESS(SAS)--Batch SAS processes154559 -Node: ESS(SAS)--Function keys for batch processing159585 -Node: iESS(SAS)--Interactive SAS processes169071 -Node: iESS(SAS)--Common problems172825 -Node: ESS(SAS)--Graphics174348 -Node: ESS(SAS)--Windows175131 -Node: ESS for BUGS175709 -Node: ESS for JAGS177465 -Node: Mailing lists/bug reports180817 -Node: Bugs181081 -Node: Reporting Bugs182706 -Node: Mailing Lists183599 -Node: Help with Emacs184346 -Node: Customization184878 -Node: Indices185652 -Node: Key index185827 -Node: Function and program index191105 -Node: Variable index200744 -Node: Concept index204232 +Node: Introduction2914 +Node: Features5667 +Node: Current Features6503 +Node: New features9954 +Node: Credits27847 +Node: Manual31464 +Node: Installation34130 +Node: Installing from a third-party repository35067 +Node: Installing from source36014 +Node: Activating and Loading ESS37606 +Node: Check Installation38680 +Node: Interactive ESS38900 +Node: Starting up39745 +Node: Multiple ESS processes40489 +Node: ESS processes on Remote Computers41570 +Node: Customizing startup45673 +Node: Controlling buffer display48563 +Node: Entering commands50289 +Node: Command-line editing51447 +Node: Transcript52680 +Node: Last command54449 +Node: Process buffer motion55875 +Node: Transcript resubmit57378 +Node: Saving transcripts59343 +Node: Command History61133 +Node: Saving History64542 +Node: History expansion65303 +Node: Hot keys68514 +Node: Statistical Process running in ESS?72584 +Node: Emacsclient73863 +Node: Other74655 +Node: Evaluating code75674 +Node: Transcript Mode79355 +Node: Resubmit80508 +Node: Clean81571 +Node: Editing objects82567 +Node: Edit buffer83685 +Node: Loading85731 +Node: Error Checking86758 +Node: Indenting87807 +Node: Styles90996 +Node: Other edit buffer commands93370 +Node: Source Files95026 +Node: Source Directories99630 +Node: Help102783 +Node: Completion106881 +Node: Object names107114 +Node: Function arguments109787 +Node: Minibuffer completion110326 +Node: Auto-complete110806 +Node: Company112353 +Node: Icicles112732 +Node: Developing with ESS114052 +Node: ESS tracebug114498 +Node: Getting started with tracebug117505 +Node: Editing documentation119663 +Node: R documentation files120213 +Node: Roxygen124140 +Node: Namespaced Evaluation128543 +Node: Extras130541 +Node: ESS ElDoc131565 +Node: ESS Flymake133061 +Node: Handy commands134155 +Node: Highlighting135352 +Node: Parens136387 +Node: Graphics136863 +Node: printer137534 +Node: X11138290 +Node: winjava138629 +Node: Imenu139041 +Node: Toolbar139888 +Node: Xref140296 +Node: Rdired140619 +Node: Rutils141673 +Node: Org144067 +Node: Sweave and AUCTeX145012 +Node: ESS for R147564 +Node: ESS(R)--Editing files147864 +Node: iESS(R)--Inferior ESS processes148383 +Node: Philosophies for using ESS(R)153132 +Node: Example ESS usage154059 +Node: ESS for SAS156280 +Node: ESS(SAS)--Design philosophy157003 +Node: ESS(SAS)--Editing files157956 +Node: ESS(SAS)--TAB key159810 +Node: ESS(SAS)--Batch SAS processes161176 +Node: ESS(SAS)--Function keys for batch processing166202 +Node: iESS(SAS)--Interactive SAS processes175688 +Node: iESS(SAS)--Common problems179442 +Node: ESS(SAS)--Graphics180965 +Node: ESS(SAS)--Windows181748 +Node: ESS for BUGS182326 +Node: ESS for JAGS184082 +Node: Mailing lists/bug reports187434 +Node: Bugs187698 +Node: Reporting Bugs189323 +Node: Mailing Lists190216 +Node: Help with Emacs190963 +Node: Customization191495 +Node: Indices192269 +Node: Key index192444 +Node: Function and program index197722 +Node: Variable index207361 +Node: Concept index211214  End Tag Table diff --git a/elpa/ess-20181109.703/essd-els.el b/elpa/ess-20190121.1430/essd-els.el similarity index 83% rename from elpa/ess-20181109.703/essd-els.el rename to elpa/ess-20190121.1430/essd-els.el index 6f81cc11..8940cd22 100644 --- a/elpa/ess-20181109.703/essd-els.el +++ b/elpa/ess-20190121.1430/essd-els.el @@ -32,24 +32,13 @@ ;;; Code: -(require 'ess-arc-d) (require 'ess-julia) -(require 'ess-omg-d) (require 'ess-s-lang) -(require 'ess-s3-d) -(require 'ess-s4-d) -(require 'ess-sas-d) -(require 'ess-sp3-d) -(require 'ess-sp4-d) -(require 'ess-sp5-d) (require 'ess-sp6-d) -(require 'ess-sp6w-d) +(require 'ess-sas-d) (require 'ess-stata-mode) (require 'ess-trns) (require 'ess-utils) -(require 'ess-vst-d) -(require 'ess-xls-d) - (defvar S+elsewhere-dialect-name "S+6" "Name of 'dialect' for S-PLUS at another location.") ;easily changeable in a user's .emacs @@ -68,8 +57,6 @@ The default value is nil." (ess-object-name-db-file . "ess-spelsewhere-namedb.el" ) (inferior-ess-program . inferior-S-elsewhere-program) (inferior-ess-help-command . "help(\"%s\", pager=\"cat\", window=F)\n") - - (inferior-ess-start-file . nil) ;"~/.ess-S+3") (inferior-ess-start-args . "-i") (ess-STERM . "iESS") ) @@ -93,12 +80,10 @@ The default value is nil." "Major mode for editing S+3 source. See `ess-mode' for more help." (interactive) (setq ess-customize-alist S+elsewhere-customize-alist) - (ess-mode S+elsewhere-customize-alist proc-name)) + (setq-local ess-local-customize-alist S+elsewhere-customize-alist) + (ess-mode)) -(defun S+elsewhere-transcript-mode () - "S-PLUS 3.x transcript mode." - (interactive) - (ess-transcript-mode S+elsewhere-customize-alist)) +(define-obsolete-function-alias 'S+elsewhere-transcript-mode #'S-transcript-mode "2000") ;; This REALLY shouldn't need an editing mode. Just a transcript and ;; an inferior process handler. @@ -112,23 +97,10 @@ The default value is nil." (ess-completing-read "Dialect" dialects nil t)))) (cond ((string= dialect "julia") ess-julia-customize-alist) - ((string= dialect "arc") ARC-customize-alist) - ((string= dialect "vst") VST-customize-alist) - ((string= dialect "omg") OMG-customize-alist) - ((string= dialect "s3") S3-customize-alist) - ((string= dialect "s4") S4-customize-alist) ((string= dialect "stata") STA-customize-alist) ((string= dialect "R") ess-r-customize-alist) - ((string= dialect "sp3") S+3-customize-alist) - ((string= dialect "sp4") S+4-customize-alist) - ((string= dialect "sqpe4") Sqpe+4-customize-alist) - ((string= dialect "sp5") S+5-customize-alist) - ((string= dialect "S+") S+-customize-alist) - ((string= dialect "sqpe") Sqpe+-customize-alist) - ((string= dialect "XLS") XLS-customize-alist) - ((string= dialect "SAS") SAS-customize-alist);was S+elsewhere-customize-alist? - (t S+elsewhere-customize-alist) - ))) + ((string= dialect "SAS") SAS-customize-alist) + (t S+elsewhere-customize-alist)))) (defun ess-add-ess-process () "Execute this command from within a buffer running a process to add @@ -198,7 +170,12 @@ DIALECT is the desired ess-dialect. If nil, ask for dialect" (setq buffer-read-only nil) (font-lock-mode 1)) - (ess-load-extras) + (ess-process-put 'funargs-cache (make-hash-table :test 'equal)) + (ess-process-put 'funargs-pre-cache nil) + ;; auto-complete + (ess--setup-auto-complete ess-r-ac-sources t) + ;; company + (ess--setup-company ess-r-company-backends t) (when inferior-ess-language-start (ess-eval-linewise inferior-ess-language-start diff --git a/elpa/ess-20190121.1430/etc/ESSR.rds b/elpa/ess-20190121.1430/etc/ESSR.rds new file mode 100644 index 0000000000000000000000000000000000000000..5fbb48fe5d75f6075dbc1d9a8c9ba234721307e3 GIT binary patch literal 13331 zcmV+uH0;YCiwFP!000001MPhalpI%eU{y~~&sU?-*OtF6$s>&S zJl4oRB-5_xuAV8YySi0XJtHj!n-ET%#YqT%_JmDXV8K~uIlFrd1Tf*hge+{r22LOb zV+i>GHsO=qu*s_Ty{h-B?t67#RrP3O_UzfQpQ`%Rd-vXV-+lMp_q*@@K~2+gT2DT& z<$B1gme+#6U$AG6#0-#UZ`-r#F8^^&>Dtn@qyv3GUmurX9)&Mrt6kZnP!W8 zAaM1Llpt3+L;n4zSZoc6?J1Q?L9~yr06yuj_DK{Yb2sc}u{@^Fa?766Hj%`IMWfZK zpAEj`JHfNJgQV=MH|MR2QD>h<=%<_hUgLk~g7`v*y`Mus=qE%x128cNLh;v8UY4w? zX?qm?;kx0v3a;iWb$1`aK^ngwi63Y=mhIhY*P7(Vp#LE%3?aM^@S&f-hn#ckP0vRs z7juAqnKl}xi+t>@1O=cUM&$A*fphbdV)i7#9)&?KfFmUTTBA7&G zfhJ z=^`23EdiHNEu2tYuQ|3=ow{KzcGs3#1dQut7t@vG?0c%+f|4d z!??@jxKIquGnVVIf^O>|Wy?33RoX+0;-V>}?YHa&)3H3r22QagK)i%P{!w42A1f^w zZYk(k1$GK)FZYFE$?z%*WuiH)dAn?$X*nd4(4`WMUb9Y$s}_!kF9Ap`uB0{syaGa+ zvebzcCGw@GX*W#XE(EywsoB|MDGeYfb9HXMJa2l(9iw7a582g8bFMu28^kKi}lwHs8FsozOBW1Ge`C0HClcSgo z(zHuNkb$0kIYWCLqI%*a&6_q6+ls`AYvgo&4bxj_R$VE2h*ZYW2tpPn3=)M=_WTM& zilbK&%Gy(FIubP9LedSm=IOFgZ`$+0$5(XIZ|4a|piuz0F%c_ERD1==xf3S<4di(f z*7*CFAO)EZqpI?t2xk(M=_XjysXBKvCPkK8vfI2jI)q40GS3=8zmtV$8wk(t420=O z)0wo~7S$&aG7Nd#`cn!}p=~og7yDuYv*VVSxn^90>X*R5vOXGTO z+qNi{cXhW(atRCr`>d1%;l>RB(E;2LFq3)-_`w{Sdl)cX)ReLA=mL!bb%0yDt$7&#}eLq}f-EX;dYCcMLJ3dSSt#3a_ zaXEXJ6ym9QDq>p9(oY_9*_bsuWVrs&lPFo%7+#r0$MiBongt4M{x~9T1^mL26o#C_Pz_MISrA96iI>2fGfLKsgzy8 z*HU{y&B%hEpO~0<2tbLctA{d@DAm?hjBmp&!y#sBspbUor^ve*%e&S$QmKK%M+t0r zK?Qz4WA0Wq)JT<~fu#kDSlXl(<8rcDAt(L-Hj8)=TlDN<*7LG&4}o+Bd%vP1j*n2= zyw`Lb-!fAQt=y2IY+;q9ibGAbcwd_*@Jw$S&&#`epuh(qW zTU=$_$8dz)lgu?44^{^(ykA&$3Bo zZWoJm5G_$Pon$%^hqP<_A;0aGTTZiO%=_a$d{(D9_ppY{;YK~AC=*tr)pR_USSW56 zH9u5o+MYoQe3y@nB^zYP&VZ~#{C$LG7iYXh!jIfDt*O;Q-V`ZJ(pUL0%N`5jm%#VC z+54+8D^k$}A3!9L7w;?-JE4)4__TeUqu&!fmg3qf=#F@^m;a|ZB z(Z`X<+~xxkSrFAQN5v*)k{a4zFmGiVi%JexnvI5GGes#1Y0au*t*qa)E6r-aJB~PY z-l@{4mff?BIi$FQeq~r*n~&Ij4Y3i>v1Kn^Q@~Wzz$x4E9%;3mI+CleY7$F_Pip-u z1X+~SF;BNGN1p%crQi_-7&ptCmzmOYrD{1$N0LvE zXEXYpFau3cNvQ-rnEQ2=b(=RA4UGMTxzp{YFcT;=h>}z-EYUkUNLkKBCfZx2^lt;C zzP%$N?c7Qt$GBpSbyMK+1XSuERvctRWPS~>k{FzY@Y4Q8@r z9TF$(S+;j$oh+dAQox7}os6i4Ew|KitcK+UhPI4LHVR-3=YjG^@J?r?VTjNGmK+r% zyn$u=U5u2WW95W-p+1;3tyEfEP&1XHr($?rB=2+mb;=sZ0;%X3a|c1SV#8@wOY)_= z6i7GPjtZgGA@{0%i?~5)-g-0GD4;L`u-@V+l^B4=^ppa|xLl8`f|WzIfdC;qzrVEa z8WCXy5|Clk`aXvA1D%L*k4uG+%w@OPb}FFjrP)5%2?Bk8vJ(XQ{`;LE5~@W;Pew_XGHDE zvV&#;G=JKJVdjaT9?v<8L~jBt^yi)Lau_dz#C&2%n9YI=lJ@|lD33oNFnZRpe5)v3 zEaZbg)A-wZM*VnZQ5+-Iv`gA-nM*(G`Pkqi??+KMbW!@lg&eHQ-Em5NMG z7RLP2g25KjY5Y!3mAHB%sx^jLQ!A}umkitMW@)MERI$Aj8%Vez;Eg`VzF)+?U(R^7 zjq#fD>=O1|&nlKK`)wzomr>hC!u2Hdv%HjsoeU<0y@k@mU=B&J7FZo^1F(*>xQ#3g zrDGQfYb1KcSsqT$YLzEurwA4RP(=ygp)y;wR>6IjVuj; zp&w>+y^P_1Im3B9`~3>`dxG(UzW)n`>pBMK22g)DGX5Q8`4547H-q=X48~0o3|fvO zS|DdrBzy|cf1Jh9`aR0Zatq_}tt33l^54Mn-$ue;NOgJ#d)~?L-_FW2&EVe#=%GCR zmKK*|j)Tkb49jyj_Jz5|q)Qcr*z=X_c|sHA z<)o&Tm-`uA4+8qj4EKY8{)ZCir}~DE!d4_+1;b(o8KcZd3 z-uG#u%yK*y;}e~KgfdLbEB%lr$}ly#xC~P`R979-0v*KR+Kk>N$$vkix5emn*wbb7 zdW_!FTA)**47N#>!SHWn_1R|Wmb5_MQ5~&;K9>Iec@PJ`gUL6q*|KUj-=Y|1&=ncz zK&i4|kiOXSr=4?Anx{J~?K$v-Fmocz4Kk5E;`ed+dtUs$34WLHgLuC(cqb-*PhwiH zf(Ly|hGU2GmEq@6kYvAEH|em|EjDY#?X;`jUNmZiWkqknEY>W?^@>YYyclFnynxemE(;iaDw$#M7Tl7Z{nCcFC184`}L|q~8ZK0?)ZE4XsNs z$TJPcUuf&5a6=jK_gLYa56?O*W*w5Uemt#_tjdUbu(DuQPLB4)gt&CC2%*%bvdfxH4|>{!6Z?|u`JDYjiy#J31ktc5g@I!%p^_%k?gqFZ?f!FPjqRP0*;H#2SDMpO;sKKS>TRN#;QcxqWI#GIXyj*_d zaQTrV8MsZV4Ssl>HNtOT32 z?rLUBGM%yXTgCK8>`tS8kIVjoK`J!nXEDd#pZ zr)+tCHmy_Nt|d#(xTaRQ^!pC+`?!Svi*iXuG*R`*G-(R8our0#X5?NUHAza%Q&RR_ zV)n~Ys-A2A718#Pj;oW4@kP1VyEVK~_qgqbnDvj-q@biFOTiums@#oGf5=4AKfk^Y zYQmq4eXj`pV>0%A;`jH<-}fu1>$m4k(rcW7BS?(KQIKcdShd)!RN9VX+7&VavWsJG zLh|)OayLvb7gI({$-YKgzN&@r!!D)TY#0{nA_J*=Ok}$138}hPyKuG!h5s_GJB7h* z?=0m=D%W+ITExlUhvnLNxrPhXfa^K!ir04J!OitzhKDf*0mA&9Sv21(w64V9lWA>v zVg=ywCt>_Y>Gz+pIBKBN3Ze54RKV5;Y5d7O`s`t8na$$cX(WA*pXV{oNTEW7g^O@2 z1UNo-t6eqEMD%Rp^yEbx!XWKufR><%1X|^1S~S5A@hxvsghK0M&jNc6uqRXcALm&6 zgWp5^_b}jQ9&nR$s7J~_3^F?FS?~m}`Yl7d8@ZamQ75izJex-`d@vhS1t3y;su4MT6>^r4z8=#F>F%x=!%#xuj zA#c{NY!&)rC7lg|INVhXZkK=E;{G%*(^~f2$etU5?>qSSi?i|QX_$Vc>pM%`tR!BY z*@hYL@4P_xcX7BEv8ObH5H;}=q3aL%Q}0f%(b}oSdv!2C6=n_q{Qs84I#9vkZHv-< zX_xhQ>B{o)Ga2jg=?jGabFhu;Y%D_YToU}gnE$?9i>vSWghYmtd=^4n!IFHQmEchh z|1$P02JxT3Iv{!CfTq8aJ+ENTE$n$!m*u-^19!{kDTWw+G)Y<9T;=$dI9bDwY2E&dPg?Y{xr!@<8UV5S zfUs)?!af#uNP*L`pM`5dxPk@#o2TJrzV1B20T6ClW|#!w2n$mnaQgZ0qb%IQ!mS|O zz`|`H+@2DqS>WmKV&PUP%p`BA`kV#i zY}0~SZ;1y=d@rvtZ>lt1$vfL(p1q__@j~7pJ3;eyZrJ9W7cdDd1;X zzS=<$=Ght|D6^dJ&j2iV%!C(Pg*U{}S8bLmktc;hg0)oF~0cDpHg#a`Gkk z*M*BkQcIKBHGQrF+-ajN=CVrH-9nGL`ul%IK;D4CUi z4a)epfO&t@>7HMImw{h@3*v^QxWCIHMR~$!P;Sg)8^nQnxyhMSQAce+I3Gtg^-MCA*{ZjOg@Oj zg(RhPub5xSOO^vKL)*S735Jw5JYs;E3?SX57`sJF zMS-&jbJ6z>DL6l6_%WPNy&u73ZIt;Plf3teF6TJbI8!06|ACcn6VF?;+@js|ip<-i zsnR)ldS({^G{VnE6gkJTm`KAR!vyc?CoxhJiW!63XP)u>KOzNKM+Q_OH>ZST%f+^e z)V5m=P+~q<#mNBDyrY?${{>q1KV>n;hb?*sisO3aV8()_gG#Ur8gjj8D;#egngoMWXusx)7Xk_pmhon?2vF=CiJKV)??j4knd7 z0je~z27R(@#r02lx9NDATmb=MvCul#Byndy)Qzg|Kh`5^sO4(-MAs_vje2dhy_r+~ zxGwWWIjvK09M}M9*@#2WGh}u8JIQx;G6Uerm>;y9NN<(3PY2US_ed@}HE22uX(E`jbAU?YLX&Pd}I#T?AY17LiZoBn3 zKU?Dk_A|u7lIpMrrg>Rjo@jwg9ew!{7)v03y}% zUYIv)CG@#1vtmKFu1}z~dt&0MgC`zT6N1?vh*7Ms>xQ@j5znewi&D%$R>(B=m%^zH zTBXNib%%(=pJQ-_X@farpXIluu(V%exYwstA+~5ETT&Reejr!h3c+1Y8Dp1CCUtiC zTB8m+I9H}E*_ilgf-NM!EhmJoz~5ym9_B%1AHg!!iu zrK)M*EYrhr-q1QK8{!pEs4399eSFN_5ha?z66MB&^6DE=5L=3+;ueXwLiQ~?)a?p2 zFZ5zY0qP^;RB>@)1Jo9fDeg37Lb_DQt4M_Wk-Pko4Nfc4s9=ZpTk53-YkJ(MZ~p; z^>%%(>CvH>kVM~{VkK^p)5(P_gp)h^6(H^>2n^v0V&D2!ukOr2Cd(`dcccWxNE+4@ zTrwQ+J-MgcUHId;^(hRbxbG0`{wh?IE)Zk3B+!91+Q>d&w|j*%u3Hh_@m%OyVBu9K zOTvbu+X4Nm2_PE(d8xajagQqO8=>~p*Y2(h5Fkqci`KkNeS=7Y*v$xSscIm%h)vt| zkv>1Vw_W(Odd_Jsx#qoq28MgH%x$U7ZU=M>BXMx$_cH1GrkMO_(O(t~HPA4;{ibL- z;eVi65|{xh~;bJQ>Fo93p+n^U&@GZ5aU>CQz3`4IV(Gq7pP$5~f;CZcy zJ$v@;e|c#y`ETC@AYB6R3k<;Zl9Y_^D6;i;*Y^^1%kkqgMb~r|sn?(;^%Uf^?Z6qc zxB-@K^Dk*hi(pZmBgXFa7;)?ORGXDOlwEr)dP1Wl?tiBQ&@Bw8T;~@|gDy<}6LMrB zP2T!i#@Tw)0PEU(o``SXk4^39SH#PfIwbD9bj-bC%neR_>TF1-$1Zl4TlQMM_DL_> znPu0bKqfp6^!^9I`;*{3VidJ5qxea=WLgmaq2(Bny>u1?7>jTt72ol|@3dD<0>M!+ zzpGE^IItc!LG#=!X`WwzG?DUUKK5!ztxe1X4LRr**(MU+c@z!1N+OCj-)|9YXCwbQ zMazqq_{$+%9~0Y*#8Pxz(`TDY!JtM|*uiiI6g7GD8UcsJ9Oep3yhUtMVjm5Bj&MS* z|4}mVK1}&?mwkv`q{;J!IAxWGR9#fyhDE?|PwgQ87T^pZIE5$(r0*V=9k1lspAcJ>ZIB>|m z{bRy6tY3sm{3MpQi~NzIn)fI0#hGP=(tkGqz!uBH(OlB38oCJ3GrnU`OrEkkC3d%> za*_nJgV?$gJw-dqDxCw1-BFps$j7rH8wrrnIRabg2H!2~*}+H|;iDP{>l`JDL>(xfxR?k|R!0&Pu|2D$R&6{odqy(c#Hp zl$-(q*KXL|69l*WqrKy*@nGeuO8#dnSG?Nvdq8G(4nx1clR^L%7>xHpqNGv4f9@!C zUC@LJ(rT4LbS~6AhfuuH4Kg`?q;^Tt29Qd4g>ht{u&b-(k+Xk{T~%*G?cf5#adG;p z3uOVPyAES?^}C+qw(8uxU&6?sx34JoHe`@f^fJ&wv;$dSCI%~^fGwneVIjJ1(8SC~ z`K6x#XyEC+VT8|@q@YhcVHe~5*7M^%T>bEG#f;b{&JfZOj^R7e)=#FG1lTx)z8?q7 zpuq3NnzUTN0iP;k4xX2$9DfiKjx23dS2R(`32-f_luR!J_=Z#uVXQpmnm7HYRv}+T!U2og2bft(FIr9y@f7o?D*c zjA5^pTV$_olpMOumSB&eKtpabkop3qJJO&;wR4_ecx`3?qniqbeF^PSEjkj6fV0-7 zMgZwe7-&GmX|)|Skl-wbSX83;bm8J^1S>jMq(6d0t|H~F8lF+AIpOB4*LD>243NZx z9>+Q(CCs4H{~i@p+i5Q0NZH;9ozI6GDY*DPmo8}1TXG($(q4c(y z1pF!^ULh32jUr7VKN7J-3q`tzR)S|(brJZS0yrlEo{9aG$})*pb~v<2t0ZjWj0FY5iv#7d26hXW~n0ou+7EorIsKnJJl0GgY~A3eu8&ks%< zQ1DQRJG$gMj$5yFaGFqPRNvH$Xgh?Qi4}lrc-2#~)M%e?@@?lbNYE+hb(vPB8SI!X z%CtCEzN@R6Bq+(kqn`mJc`zDtSBQSN-3??CVGCh#|e+tjl$?ssT7gQ zM=vpzC>8HAP`t1mK(M|+)g4gKpVR3W_d;UGRci=~dYw6bHLI_U*pjRM7|WpA1Q99tj~tRB9dd}4ZFCSv`yXJYLedt8N$~DZ)e`*w9+kqW+1W{dWGqwAw`e+Z zO*d(K)NswH*XQWouy6@RoUf=iiD|+<$}>3%ari(dqFP=g1QW43cYO6Ygelk42V8y!Cg^+;EkaMzQr=VCi6-{?r(tx4ris#_cW4F)W8)du}={hj;2WH_vD?0*b-oP zegevJp2+gCxHPEtCbQL9{kJ>WS7CYHJs>ZS`+!rJlK(FM7oox%~y;Toro?q z+g_{f;i<7<;oBf)fCVSSj^iqnyn0us3yP8&^3ixj`0v9>l{unmnHF@? z;1t3`(8(RY0`}byHXEV6MS_nh7(NJov#fL=EKC7qFhG!PLGz|}jMxD5?2VSo>emY0 z@-hTL`KZF{DMM|jcMYMJHWc$0%KI;BZOq?0V@3rjim+)J&6)6oZ1$@fJh3DxbMvRa1;x1xnAE&Mwt zBId0`CIqE@gzo;b7cHl0H%wbm1lT#e9lT>551a>l2Y8QF50lOJ2VB?xT_?R{Nu>j{ zATYH=m`YJu$Mpq0ba1F{87@4Bmt@nyi8Z6@R26>B|Af6OoyuHO+6&4l06jK2D@FI0 zqWCn^Wq{D+Z;%9(&0rETfN20rm&*`$~B?lirHW>w|jtKXyhX971EG26rcHghVvFC#cw zk@Y-Le?S0qlo{z(`J4gZNZiQ-aJ4_yiAGo-X7Bz%$uRM8P1%qUYgPXk0Qiwk!gxEO zM~`|PZ^3e>podcfLGxim3~*30r;r%}nc}3e(zN28ZNAb!fr;{HATyI@&9beyVb1eD z(@kDr&kO=Orer$8=2V(AJVQi0B_h^8snCpZHuTJWA7RS0xG>2i=&HC>>tB|2bP7peF;hPXO_H3rFwOJ5 zk>NQ6go8`+hh*GX9S;(*V5j$yDyApjW`r~EIpmyriU6ZG(iH4}N%d$z{Z}N>W`_WE zzA0rADapsu+V0`mcB@sl%qnk?R~N_JtBcG5d9mg+8(~wmY!c^?q<(C$D}W})2zT#h z8(wm;qyPG!b)*7iZ13@EG3xcZ{6pcW&#@-|B(DZ2G z(8frqB6&HGQ()c{()$shoycg?m@zzh;|SnUA;I~=n$mGPZ6RjNf@}CNJ(k}sGCx!I z$X1iOpQ#&`9TR{qYD%|3JnJI#KZp6x#lL@D{@zV}P_lyozR%;9bTDs6H-v;_Z49VCZ5DLmyQHC$EuR_k|c>}21$aL6vW9Tsgh|KU3^6c3JK;Oyk;Ylx7IwJ(+cwb1;~pT(VqZueB$eSoi2CS6ezxs9|_&pjyMM2 zgj&XAp#E3Ml%wux;IhoGf&A}jIT4C_nf^6WKiPTkjm(38h`1F9LtWF+ zt-OCf1MMpQe;?w@I85br^lhY$zKzvU3OvDm|Q_P-OAYW2>s8e(SITMlChq@ zuuQ%742Z+@+7}SMrs=h3B%ZF6URwdUpDE?HPmymCVWWTf8ow1^5n#ab2|; z4(~e%yzg9qHW=e&mu*nRkMAP%e|H7iVAp&};RB!NNz*~`fslXGS#V!il&meWhp|gb zJU9kz*U8`-G?s*h*bPg)u4janY1mD<>~2L7$Jam+xPJ>a*`oioNE6!qVus}bF;4%R zr0Nt6&yXK};X*svzrd1SC@$UL zqUG{)zw*AT43?oEhkM68a?dn%Nf{-Z0cdE`&2Ud+2BM!;5S`GKE{Eu6SCr^)DTq#x zs^t*=UXpNoM*kLR<2(}>gB~{)XPhTJ7Z7uBLz;-RpLvQeTVOu z6?>h3U|GM8CD)>KGXV9obYvR^97(s0!kzBC zwqv%DXcuAUj3biNeFK;qk*4bTvEUy=1PWv6!-zuuS*Lqr3FKM!k`>sjtUsNNKG+eb zE;np~co1H|EAkG+}Ashefh!4oT32R}vX z;HUqW)&XW1{0#6c%`kXL%j!e??|>?BY(@V#%d-q#Wb77ylHR{#lM^@(`tO`NehWTk z{>h4V=08pE%&~!f*Hr)Xe5uyo2q;SIEb-6@uigO=Tf=eiD3S@5_3_7nL*&rBcMql?3ZPCk}R2q>Kd7}6G>T*5M@1*^pYPn zD$KId^DirP*oel_efx=rW2AEoPr^7Yh*Mpk^c0{EI~a3o9KL>=EJ7MytC-gojxVVR zKBa&$&fd{u+hmo)as!8?C5dnM?(rgW_cSa#e6b{ccZg&aVHpU;RGthv~9nPmm5uVbLd`Z$@U~?=xvXa4v!yhsM z`Ddx9{V-lFSlY=bUj#!c+(#h{u=iq`p9(^rQ*7g89t_dx(-;?>7hHu!ftTMZ1F{Jq_3=YB+cr1?L&S{`dI_i#r z^Ce23Mr#2ahVmgyu|`E2j0i=B5Dn~dI>t)r4!2nMqO0LXD#P%6SCA?kdEwTr7-x_@ z=B|6TfdE=fh@C!k=hW=Xp~F)my%?MUA5MAEh;JOp^>m^U>_2z1ZF30$uWH-%X64k) zmVbaQ0+`UAVNLLc6y#BKLaI(6BfOk6wgBxcopiM@#hVAObopI2sxR@4>gwElxmGvG zKTW6XUp^DuLX2wDS~hQ*n-!We=6-~FUOQx;U0N`mNE~zhT{QGffD`YO&@akxMt~$~ zno1dj#dud*A9wk5v&enRxxvX!dRB9La5*hfnDa$=$q`ah^Q22cLK6ra z?k&-a<|Ws&NeyDT?q%b1Jmwj=p%UG?zY&snrsa@d%->Zm+sr@GzH-Bmc^TUg>I?hg z!L7ynC~ZaRuaDmIY&Kfn+0BDU+AFsfjbiX;wCLv4qHQh}qcY)HES4oWwVa-1WNYyh z%W}#J?{kDHF5g--SqigidHxOVi6BR}79EzsF@gC6)2!WEwD+|9G`6v5%^Mz;YHVw< zy{CHhJtP&qp;kg&Y`6AQn@bo8o3<8DgHrh!xf?CiFGJ`hHMte*aCRcWS&RObD4qUR zS&9;kjk;;?ZAA&dZUg;KA@JmmF+9!32+6II+W#;}doZ3RdIxzDR`$dulBFs14IbQ0 z{)$nu!xHa=8GoU&qD+d*D0W8)PVoeCyJc9#TLBLqdQAEb%)s!tbuzh_CWh4Y>^_+B zS_C-GMBR?`QXT^T#lI1^#sr&t7-OwpaK&Y!GQwOjBk8c;g`WNqKhH6$xFP&@$#~1! z{o=PmNWPxcy=zRG&eNweek;NS^XVM#!2K(5)2}tGnl+a=2?=O3Z5#`0^-t-JBZ}+fk%vY4=FqAI(}6i7ki+PW^MN;iO&2 zsv3XBJaR_qas^ena2AK><{*oYVC-H8Jl2RT7f>j=z-6;j0T1}@zz0j?hYj0qdd0x| zXYrvi_aR~v7VAFUMWx4OT0I9;bV&4IUe861QX+=^%`+wPnhzj_LxpuDT#kT#iGo08 d;9ri8K_ZXlkd;0AN-u-i{|{C=eSg>x0RZU55mo>I literal 0 HcmV?d00001 diff --git a/elpa/ess-20181109.703/etc/ESSR/BUILDESSR b/elpa/ess-20190121.1430/etc/ESSR/BUILDESSR similarity index 100% rename from elpa/ess-20181109.703/etc/ESSR/BUILDESSR rename to elpa/ess-20190121.1430/etc/ESSR/BUILDESSR diff --git a/elpa/ess-20181109.703/etc/ESSR/LOADREMOTE b/elpa/ess-20190121.1430/etc/ESSR/LOADREMOTE similarity index 86% rename from elpa/ess-20181109.703/etc/ESSR/LOADREMOTE rename to elpa/ess-20190121.1430/etc/ESSR/LOADREMOTE index 294d5cf0..919ec33f 100644 --- a/elpa/ess-20181109.703/etc/ESSR/LOADREMOTE +++ b/elpa/ess-20190121.1430/etc/ESSR/LOADREMOTE @@ -1,7 +1,7 @@ ## -*- mode: R -*- ## loading code which is first sent to R on remote sessions local({ - ver <- '1.3' + ver <- '%s' ## <- passed from elisp root <- '~/.config/ESSR' if(!file.exists(root)) dir.create(root, recursive = TRUE) @@ -13,6 +13,7 @@ local({ utils::download.file(url, essr_file) } ESSR <- readRDS(essr_file) + ESSR[[".ess.Rversion"]] <- ESSR[[".ess.getRversion"]]() attach(ESSR) print(TRUE) }, diff --git a/elpa/ess-20181109.703/etc/ESSR/R/.basic.R b/elpa/ess-20190121.1430/etc/ESSR/R/.basic.R similarity index 94% rename from elpa/ess-20181109.703/etc/ESSR/R/.basic.R rename to elpa/ess-20190121.1430/etc/ESSR/R/.basic.R index d24e3c3d..8ba5daf7 100644 --- a/elpa/ess-20181109.703/etc/ESSR/R/.basic.R +++ b/elpa/ess-20190121.1430/etc/ESSR/R/.basic.R @@ -4,14 +4,13 @@ ## Do not use _ in names, nor :: , nor 1L etc, as they ## cannot be parsed in old R versions +.ess.getRversion <- function() { + if(exists("getRversion", mode="function")) getRversion() + else paste(R.version$major, R.version$minor, sep=".") +} ## loading ESSR.rda might fail, so re-assign here: -.ess.Rversion <- - if( exists("getRversion", mode="function") ){ - getRversion() - } else { - paste(R.version$major, R.version$minor, sep=".") - } +.ess.Rversion <- .ess.getRversion() .ess.R.has.utils <- (.ess.Rversion >= "1.9.0") .ess.utils.name <- paste("package", @@ -133,8 +132,3 @@ if(.ess.Rversion < "1.8") unquote(substitute(expr)) } - - -## Local Variables: -## eval: (ess-set-style 'RRR t) -## End: diff --git a/elpa/ess-20181109.703/etc/ESSR/R/.load.R b/elpa/ess-20190121.1430/etc/ESSR/R/.load.R similarity index 79% rename from elpa/ess-20181109.703/etc/ESSR/R/.load.R rename to elpa/ess-20190121.1430/etc/ESSR/R/.load.R index cbbc8291..1634a0ee 100644 --- a/elpa/ess-20181109.703/etc/ESSR/R/.load.R +++ b/elpa/ess-20190121.1430/etc/ESSR/R/.load.R @@ -1,3 +1,5 @@ +## This file is sourced when R starts and `load.ESSR` is called. See +## inferior-ess-r-load-ESSR--local. ## Do not use _ in names, nor :: as they cannot be parsed in old R versions ## load .base.R and all other files into ESSR environment; then attach ESSR @@ -8,10 +10,8 @@ load.ESSR <- function(dir){ else function(..., keep.source) sys.source(...) - Rver <- - if(exists("getRversion", mode="function")) getRversion() - else paste(R.version$major, R.version$minor, sep=".") - + Rver <- if(exists("getRversion", mode="function")) getRversion() + else paste(R.version$major, R.version$minor, sep=".") oldR <- Rver <= "1.3.0" ESSR <- @@ -26,9 +26,9 @@ load.ESSR <- function(dir){ assign(".ess.Rversion", Rver, envir = ESSR) - ESSRver <- scan(paste(dirname(dir), "/VERSION", sep = ""), - what = "character", quiet = TRUE) - assign(".ess.ESSRversion", ESSRver, envir = ESSR) + ## updated by make !! + VERSION <- "1.5" + assign(".ess.ESSRversion", VERSION, envir = ESSR) ## .basic.R: @@ -51,8 +51,3 @@ load.ESSR <- function(dir){ ## BUILDESSR needs this: invisible(ESSR) } - - -## Local Variables: -## eval: (ess-set-style 'RRR t) -## End: diff --git a/elpa/ess-20181109.703/etc/ESSR/R/completion.R b/elpa/ess-20190121.1430/etc/ESSR/R/completion.R similarity index 95% rename from elpa/ess-20181109.703/etc/ESSR/R/completion.R rename to elpa/ess-20190121.1430/etc/ESSR/R/completion.R index 1bcf5221..44c60f93 100644 --- a/elpa/ess-20181109.703/etc/ESSR/R/completion.R +++ b/elpa/ess-20190121.1430/etc/ESSR/R/completion.R @@ -85,20 +85,22 @@ local({ fmls <- formals(args) fmls_names <- names(fmls) fmls <- gsub('\"', '\\\"', - gsub("\\", "\\\\", as.character(fmls),fixed = TRUE), + gsub("\\", "\\\\", as.character(fmls), fixed = TRUE), fixed=TRUE) args_alist <- sprintf("'(%s)", paste("(\"", fmls_names, "\" . \"", fmls, "\")", sep = '', collapse = ' ')) allargs <- - if(special) fmls_names + if (special) fmls_names else tryCatch(gsub('=', '', utils:::functionArgs(funname, ''), fixed = TRUE), error=function(e) NULL) allargs <- sprintf("'(\"%s\")", paste(allargs, collapse = '\" "')) - envname <- environmentName(environment(fun)) - if(envname == "R_GlobalEnv") envname <- "" + envname <- + if (is.primitive(fun)) "base" + else environmentName(environment(fun)) + if (envname == "R_GlobalEnv") envname <- "" cat(sprintf('(list \"%s\" %s %s)\n', envname, args_alist, allargs)) } @@ -159,8 +161,3 @@ local({ i <- i + 1 cat('\n\n', as.character(out), '\n') }; - - -## Local Variables: -## eval: (ess-set-style 'RRR t) -## End: diff --git a/elpa/ess-20181109.703/etc/ESSR/R/debug.R b/elpa/ess-20190121.1430/etc/ESSR/R/debug.R similarity index 99% rename from elpa/ess-20181109.703/etc/ESSR/R/debug.R rename to elpa/ess-20190121.1430/etc/ESSR/R/debug.R index 70c460a9..8154b047 100644 --- a/elpa/ess-20181109.703/etc/ESSR/R/debug.R +++ b/elpa/ess-20190121.1430/etc/ESSR/R/debug.R @@ -222,7 +222,3 @@ x } } - -## Local Variables: -## eval: (ess-set-style 'RRR t) -## End: diff --git a/elpa/ess-20181109.703/etc/ESSR/R/misc.R b/elpa/ess-20190121.1430/etc/ESSR/R/misc.R similarity index 98% rename from elpa/ess-20181109.703/etc/ESSR/R/misc.R rename to elpa/ess-20190121.1430/etc/ESSR/R/misc.R index ec96733f..c1e36183 100644 --- a/elpa/ess-20181109.703/etc/ESSR/R/misc.R +++ b/elpa/ess-20190121.1430/etc/ESSR/R/misc.R @@ -139,7 +139,3 @@ htsummary <- function(x, hlength = 4, tlength = 4, digits = 3) { } else remote paste0(home, "/doc/html/index.html") } - -## Local Variables: -## eval: (ess-set-style 'RRR t) -## End: diff --git a/elpa/ess-20181109.703/etc/ESSR/R/mpi.R b/elpa/ess-20190121.1430/etc/ESSR/R/mpi.R similarity index 100% rename from elpa/ess-20181109.703/etc/ESSR/R/mpi.R rename to elpa/ess-20190121.1430/etc/ESSR/R/mpi.R diff --git a/elpa/ess-20181109.703/etc/ESSR/R/ns-eval.R b/elpa/ess-20190121.1430/etc/ESSR/R/ns-eval.R similarity index 96% rename from elpa/ess-20181109.703/etc/ESSR/R/ns-eval.R rename to elpa/ess-20190121.1430/etc/ESSR/R/ns-eval.R index 26b0b0fa..ffdcc25d 100644 --- a/elpa/ess-20181109.703/etc/ESSR/R/ns-eval.R +++ b/elpa/ess-20190121.1430/etc/ESSR/R/ns-eval.R @@ -140,27 +140,31 @@ } ## deal with new plain objects and functions - for(this in intersect(newPkg, newNs)){ + for (this in intersect(newPkg, newNs)) { thisEnv <- get(this, envir = env, inherits = FALSE) - if(exists(this, envir = fallback_env, inherits = FALSE)){ + if (exists(this, envir = fallback_env, inherits = FALSE)){ thisGl <- get(this, envir = fallback_env) - if(.ess.differs(thisEnv, thisGl)){ - if(is.function(thisEnv)){ + if (.ess.differs(thisEnv, thisGl)) { + if (is.function(thisEnv)) { environment(thisEnv) <- envns newFunc <- c(newFunc, this) - }else{ + } else { newObjects <- c(newObjects, this) } .ess.assign(this, thisEnv, fallback_env) + if (.is.essenv(fallback_env)) + .ess.assign(this, thisEnv, .GlobalEnv) } - }else{ - if(is.function(thisEnv)){ + } else { + if (is.function(thisEnv)) { environment(thisEnv) <- envns newFunc <- c(newFunc, this) - }else{ + } else { newObjects <- c(newObjects, this) } .ess.assign(this, thisEnv, fallback_env) + if (.is.essenv(fallback_env)) + .ess.assign(this, thisEnv, .GlobalEnv) } } @@ -392,6 +396,7 @@ return(nsenv_parent) } essenv <- new.env(parent = nsenv_parent) + essenv[[".__ESSENV__."]] <- TRUE attr(essenv, "name") <- essenv_name nssym <- ".__NAMESPACE__." nssym_val <- get(nssym, envir = nsenv, inherits = FALSE) @@ -405,7 +410,6 @@ essenv } - -## Local Variables: -## eval: (ess-set-style 'RRR t) -## End: +.is.essenv <- function(env) { + exists(".__ESSENV__.", envir = env, inherits = FALSE) +} diff --git a/elpa/ess-20181109.703/etc/ESSR/R/pkg.R b/elpa/ess-20190121.1430/etc/ESSR/R/pkg.R similarity index 100% rename from elpa/ess-20181109.703/etc/ESSR/R/pkg.R rename to elpa/ess-20190121.1430/etc/ESSR/R/pkg.R diff --git a/elpa/ess-20181109.703/etc/Makefile b/elpa/ess-20190121.1430/etc/Makefile similarity index 69% rename from elpa/ess-20181109.703/etc/Makefile rename to elpa/ess-20190121.1430/etc/Makefile index e2d613ef..e2d22768 100644 --- a/elpa/ess-20181109.703/etc/Makefile +++ b/elpa/ess-20190121.1430/etc/Makefile @@ -4,9 +4,6 @@ ## Before making changes here, please take a look at Makeconf include ../Makeconf -# In ../Makefile we already construct the ESSR-VERSION file : -# ESSR_VERSION = $(shell cat ESSR-VERSION) - #ETCFILES = $(wildcard BACKBUG[S5].BAT backbug[s5] *.S sas-keys.*) #ETCFILES = ESSR.R ess-developer.R SVN-REVISION *.S sas-keys.* ess-sas-sh-command # ETCFILES_1 = *.S sas-keys.* ess-sas-sh-command *.jl @@ -21,30 +18,15 @@ endif #ICONS = $(wildcard icons/*.xpm) ICONS = icons/*.xpm -ESSR_UTIL_FILES = ESSR/LOADREMOTE ESSR/VERSION +ESSR_UTIL_FILES = ESSR/LOADREMOTE ESSR_CODE_FILES = ESSR/R/*.R ESSR/R/.*.R -# ESSR_tarball = ESSR_$(ESSR_VERSION).tar.gz -all: #ESSR-VERSION $(ESSR_tarball) library/ESSR +all: show-etc: @echo $(ETCFILES) ls -l $(ETCFILES) - -## happens "above" as it is need also in ../lisp/ : -# ESSR-VERSION: $(ESSR_FILES) -# (cd .. ; make etc/ESSR-VERSION) - -# $(ESSR_tarball): $(ESSR_FILES) -# R CMD build ESSR -# library/ESSR: $(ESSR_tarball) -# R CMD INSTALL -l library ESSR - -# rel: $(ESSR_tarball) -# [ x$$USER = xmaechler ] || (echo 'must be maechler'; exit 1 ) -# $(INSTALL) $(ESSR_tarball) $(UPLOAD_DIR)/pkgs/src/contrib - install : $(INSTALLDIR) $(ETCDIR)/icons $(INSTALLDIR) $(ETCDIR)/ESSR/R diff --git a/elpa/ess-20181109.703/etc/R-ESS-bugs.R b/elpa/ess-20190121.1430/etc/R-ESS-bugs.R similarity index 97% rename from elpa/ess-20181109.703/etc/R-ESS-bugs.R rename to elpa/ess-20190121.1430/etc/R-ESS-bugs.R index 607fc32d..c28f2f8b 100644 --- a/elpa/ess-20181109.703/etc/R-ESS-bugs.R +++ b/elpa/ess-20190121.1430/etc/R-ESS-bugs.R @@ -938,12 +938,22 @@ scored <- read.csv(scored_path, comment.char="#") ## MM: but I don't see this, so told him to upgrade ESS (he had 16.10, Windows) -## This is a problem only inside package code [ess-tracebug related] +### --- 39 --issue ..: problem *only* inside package code [ess-tracebug related] rm(old,new) old <- 10 # line 1, use ess-eval-line, i.e., C-c C-j new <- old+1 # line 2, use ess-eval-line-and-step, i.e., C-c C-n - +### --- 40 --issue ..: new in 18.10(-1) - but ok in git(2018-10-29) +Fedora.ver <- "F28"; biocLibrary <- "/usr/local.nfs/app/R/Bioconductor/library_F28" +cat(sprintf("Fedora version: %s\nBioc. library - where packages are installed now:\n %s\n", + Fedora.ver, biocLibrary)) +## After sending (C-c C-n) the first line, the `*Messages*` buffer shows +Loading line: Fedora.ver <- "F28"; biocLibrary <- "/usr/local.nfs/app/R/Bioconductor/library_F28" +Starting evaluation... +ess-send-string: Not enough arguments for format string +## and the user indeed gets the "Not enough arguments ..." +## message in the minibuffer/message area *and* the R process hangs (with a '+ ') +## expecting the continuation, but inside this buffer, further C-c C-n do nothing! ### Local Variables: diff --git a/elpa/ess-20181109.703/etc/R-ESS-bugs.el b/elpa/ess-20190121.1430/etc/R-ESS-bugs.el similarity index 100% rename from elpa/ess-20181109.703/etc/R-ESS-bugs.el rename to elpa/ess-20190121.1430/etc/R-ESS-bugs.el diff --git a/elpa/ess-20181109.703/etc/R-error-patterns.R b/elpa/ess-20190121.1430/etc/R-error-patterns.R similarity index 100% rename from elpa/ess-20181109.703/etc/R-error-patterns.R rename to elpa/ess-20190121.1430/etc/R-error-patterns.R diff --git a/elpa/ess-20181109.703/etc/completion_ideas.R b/elpa/ess-20190121.1430/etc/completion_ideas.R similarity index 100% rename from elpa/ess-20181109.703/etc/completion_ideas.R rename to elpa/ess-20190121.1430/etc/completion_ideas.R diff --git a/elpa/ess-20181109.703/etc/ess-julia.jl b/elpa/ess-20190121.1430/etc/ess-julia.jl similarity index 96% rename from elpa/ess-20181109.703/etc/ess-julia.jl rename to elpa/ess-20190121.1430/etc/ess-julia.jl index 722d252d..ed770491 100644 --- a/elpa/ess-20181109.703/etc/ess-julia.jl +++ b/elpa/ess-20190121.1430/etc/ess-julia.jl @@ -76,9 +76,9 @@ end # add Function # free Function function components(m::Module) - for v in sort(names(m)) + for v in sort(names(m, all=true, imported=true)) s = string(v) - if isdefined(m,v) + if !startswith(s, "#") && isdefined(m,v) println(rpad(s, 30), summary(Core.eval(m,v))) end end diff --git a/elpa/ess-20181109.703/etc/ess-sas-sh-command b/elpa/ess-20190121.1430/etc/ess-sas-sh-command similarity index 100% rename from elpa/ess-20181109.703/etc/ess-sas-sh-command rename to elpa/ess-20190121.1430/etc/ess-sas-sh-command diff --git a/elpa/ess-20181109.703/etc/gpl-check b/elpa/ess-20190121.1430/etc/gpl-check similarity index 100% rename from elpa/ess-20181109.703/etc/gpl-check rename to elpa/ess-20190121.1430/etc/gpl-check diff --git a/elpa/ess-20181109.703/etc/pkg-Maintainers b/elpa/ess-20190121.1430/etc/pkg-Maintainers similarity index 100% rename from elpa/ess-20181109.703/etc/pkg-Maintainers rename to elpa/ess-20190121.1430/etc/pkg-Maintainers diff --git a/elpa/ess-20181109.703/license.info b/elpa/ess-20190121.1430/license.info similarity index 100% rename from elpa/ess-20181109.703/license.info rename to elpa/ess-20190121.1430/license.info diff --git a/elpa/ess-20181109.703/mailing.info b/elpa/ess-20190121.1430/mailing.info similarity index 100% rename from elpa/ess-20181109.703/mailing.info rename to elpa/ess-20190121.1430/mailing.info diff --git a/elpa/ess-20181109.703/make-regexp.el b/elpa/ess-20190121.1430/make-regexp.el similarity index 100% rename from elpa/ess-20181109.703/make-regexp.el rename to elpa/ess-20190121.1430/make-regexp.el diff --git a/elpa/ess-20181109.703/mouseme.el b/elpa/ess-20190121.1430/mouseme.el similarity index 98% rename from elpa/ess-20181109.703/mouseme.el rename to elpa/ess-20190121.1430/mouseme.el index c9b6f6e2..be9cbf7c 100644 --- a/elpa/ess-20181109.703/mouseme.el +++ b/elpa/ess-20190121.1430/mouseme.el @@ -66,7 +66,7 @@ :group 'hypermedia) (defcustom mouse-me-get-string-function 'mouse-me-get-string - "*Function used by `mouse-me' to get string when no region selected. + "Function used by `mouse-me' to get string when no region selected. The default is `mouse-me-get-string' but this variable may commonly be made buffer local and set to something more appropriate for a specific mode (e.g., `word-at-point'). The function will be called @@ -79,7 +79,7 @@ string in the buffer." :group 'mouseme) (defcustom mouse-me-build-menu-function 'mouse-me-build-menu - "*Function used by `mouse-me' to build the popup menu. + "Function used by `mouse-me' to build the popup menu. The default is `mouse-me-build-menu' but this variable may commonly be made buffer local and set to something more appropriate for a specific mode. The function will be called with one argument, @@ -89,7 +89,7 @@ the string selected, as returned by `mouse-me-get-string-function'." :group 'mouseme) (defvar mouse-me-grep-use-extension 't - "*If non-nil `mouse-me-grep' grep's in files with current file's extension.") + "If non-nil `mouse-me-grep' grep's in files with current file's extension.") (defcustom mouse-me-menu-commands '(("Copy" . kill-new) @@ -117,7 +117,7 @@ the string selected, as returned by `mouse-me-get-string-function'." ("Command Info" . mouse-me-emacs-command-info) ("Man Page" . (if (fboundp 'woman) 'woman 'man)) ("Profile Function" . mouse-me-elp-instrument-function)) - "*Command menu used by `mouse-me-build-menu'. + "Command menu used by `mouse-me-build-menu'. A list of elements where each element is either a cons cell or a string. If a cons cell the car is a string to be displayed in the menu and the cdr is either a function to call passing a string to, or a list which evals diff --git a/elpa/ess-20181109.703/news.info b/elpa/ess-20190121.1430/news.info similarity index 76% rename from elpa/ess-20181109.703/news.info rename to elpa/ess-20190121.1430/news.info index 0043296c..d0e83caa 100644 --- a/elpa/ess-20181109.703/news.info +++ b/elpa/ess-20190121.1430/news.info @@ -1,6 +1,95 @@ This is news.info, produced by makeinfo version 6.5 from news.texi. -Bug Fixes in 18.10.2: +Changes and New Features in 19.04 (unreleased): + + * Implement a more reliable check for the process busy state. + Background actions such as completion and directory synchronization + should not block the process and should not cause printing of the + extraneous output to the interpreter. + + * Activate 'goto-address-mode' for url and emal highlighting in + inferior buffers. + + * 'smart-underscore' and 'ess-smart-S-assign-key' have been removed. + Users who liked the previous behavior (i.e. underscore inserting + "<-") should bind 'ess-insert-assign' to the underscore in their + Emacs initialization file. For example, '(define-key + ess-r-mode-map "_" #'ess-insert-assign)' and '(define-key + inferior-ess-r-mode-map "_" #'ess-insert-assign)' will activate it + in all ESS R buffers. + + * ESS major modes are now defined using 'define-derived-mode'. This + makes ESS major modes respect modern conventions such as having + -mode-hook and -mode-map. Users are encouraged + to place customizations under the appropriate mode. + + * New option ess-auto-width controls setting the width option on + window changes. Users can change it to 'frame, 'window, or an + integer. See the docstring for details. 'ess-auto-width-visible' + controls visibility. + + * ESS now respects 'display-buffer-alist'. Users can now use + 'display-buffer-alist' to manage how and where windows appear. See + *Note (ess)Controlling buffer display:: for more information and + examples. + + * 'ess-roxy-mode' can now be enabled in non-R buffers. This is + primarily intended to support roxygen documentation for cpp + buffers. Preview functionality is not supported outside R buffers. + + * ESS[R]: DESCRIPTION files now open in 'conf-colon-mode'. + + * 'ess-style' now has effects when set as a file or directory local + variable. + + * 'ess-default-style' is now obsolete, use 'ess-style' instead. + + * Options for 'ess-gen-proc-buffer-name-function' have been renamed. + ess-gen-proc-buffer-name:projectile-or-simple was renamed to + ess-gen-proc-buffer-name:project-or-simple and + ess-gen-proc-buffer-name:projectile-or-directory was renamed to + ess-gen-proc-buffer-name:project-or-directory. As the name + suggests, these now rely on project.el (included with Emacs) rather + than projectile.el, which is a third-party package. + + * ESS[R] help pages now provide links to other help topics. This is + similar with what you would see with, for example + 'options(help_type = ``html'')' but works with the plain-text + version as well. This only works with 'options(useFancyQuotes = + TRUE)' (the default). + + * 'ess-rdired' buffers now derive from tabulated-list-mode. They + should look better and be a bit faster overall. The size column + now displays object sizes in bytes. + + * ESS removed support for many unused languages. This includes old + versions of S+, ARC, OMG, VST, and XLS. + + The following have been made obsolete or removed, see their +documentation for more detail: + + * Libraries for literate data analysis are obsolete and not loaded by + default. This includes 'ess-noweb', 'ess-swv', and related + functionality like 'Rnw-mode'. Users are encouraged to switch to + one of several other packages that deal with these modes. For + example, polymode , + , or markdown-mode with edit-indirect + . + + * User options for controlling display of buffers. This includes + 'ess-show-buffer-action', 'inferior-ess-same-window', + 'inferior-ess-own-frame', and 'inferior-ess-frame-alist'. See + above about ESS respecting 'display-buffer-alist'. + + * 'inferior-ess-*-start-file' variables. All modes except Stata did + not respect customization of this variable. In order to load a + file on startup, you should put a function on + 'ess-*-post-run-hook'. + + Bug Fixes in 18.10.3: + * More 'Makefile' fixes, notably installing '*.el's. + + Bug Fixes in 18.10.2: * ESS[R] Fix namespace evaluation in non-installed packages. Evaluation is directed into GlobalEnv as originally intended. * 'Makefile' fixes, notably for 'make install' and including full diff --git a/elpa/ess-20181109.703/onews.info b/elpa/ess-20190121.1430/onews.info similarity index 100% rename from elpa/ess-20181109.703/onews.info rename to elpa/ess-20190121.1430/onews.info diff --git a/elpa/ess-20181109.703/readme.info b/elpa/ess-20190121.1430/readme.info similarity index 84% rename from elpa/ess-20181109.703/readme.info rename to elpa/ess-20190121.1430/readme.info index 43ffa7b0..ddcb57d7 100644 --- a/elpa/ess-20181109.703/readme.info +++ b/elpa/ess-20190121.1430/readme.info @@ -6,7 +6,8 @@ File: readme.info, Node: General Information 1 General Information: README ***************************** -This is the README file for the distribution of ESS version 18.10.2 +This is the README file for the distribution of ESS version +18.10.3snapshot ESS is a GNU Emacs and XEmacs mode for interactive statistical programming and data analysis. Languages supported: the S family (S, @@ -66,7 +67,7 @@ File: readme.info, Node: Installation, Next: Starting up, Prev: License, Up: 1.2 Installation ================ -ESS supports GNU Emacs versions 24.3 and newer. +ESS supports GNU Emacs versions 25.1 and newer. ESS is most likely to work with current/recent versions of the following statistical packages: R/S-PLUS, SAS, Stata, OpenBUGS and JAGS. @@ -249,7 +250,96 @@ File: readme.info, Node: New Features, Next: Reporting Bugs, Prev: Current Fe 1.9 New Features ================ -Bug Fixes in 18.10.2: +Changes and New Features in 19.04 (unreleased): + + * Implement a more reliable check for the process busy state. + Background actions such as completion and directory synchronization + should not block the process and should not cause printing of the + extraneous output to the interpreter. + + * Activate 'goto-address-mode' for url and emal highlighting in + inferior buffers. + + * 'smart-underscore' and 'ess-smart-S-assign-key' have been removed. + Users who liked the previous behavior (i.e. underscore inserting + "<-") should bind 'ess-insert-assign' to the underscore in their + Emacs initialization file. For example, '(define-key + ess-r-mode-map "_" #'ess-insert-assign)' and '(define-key + inferior-ess-r-mode-map "_" #'ess-insert-assign)' will activate it + in all ESS R buffers. + + * ESS major modes are now defined using 'define-derived-mode'. This + makes ESS major modes respect modern conventions such as having + -mode-hook and -mode-map. Users are encouraged + to place customizations under the appropriate mode. + + * New option ess-auto-width controls setting the width option on + window changes. Users can change it to 'frame, 'window, or an + integer. See the docstring for details. 'ess-auto-width-visible' + controls visibility. + + * ESS now respects 'display-buffer-alist'. Users can now use + 'display-buffer-alist' to manage how and where windows appear. See + *Note (ess)Controlling buffer display:: for more information and + examples. + + * 'ess-roxy-mode' can now be enabled in non-R buffers. This is + primarily intended to support roxygen documentation for cpp + buffers. Preview functionality is not supported outside R buffers. + + * ESS[R]: DESCRIPTION files now open in 'conf-colon-mode'. + + * 'ess-style' now has effects when set as a file or directory local + variable. + + * 'ess-default-style' is now obsolete, use 'ess-style' instead. + + * Options for 'ess-gen-proc-buffer-name-function' have been renamed. + ess-gen-proc-buffer-name:projectile-or-simple was renamed to + ess-gen-proc-buffer-name:project-or-simple and + ess-gen-proc-buffer-name:projectile-or-directory was renamed to + ess-gen-proc-buffer-name:project-or-directory. As the name + suggests, these now rely on project.el (included with Emacs) rather + than projectile.el, which is a third-party package. + + * ESS[R] help pages now provide links to other help topics. This is + similar with what you would see with, for example + 'options(help_type = ``html'')' but works with the plain-text + version as well. This only works with 'options(useFancyQuotes = + TRUE)' (the default). + + * 'ess-rdired' buffers now derive from tabulated-list-mode. They + should look better and be a bit faster overall. The size column + now displays object sizes in bytes. + + * ESS removed support for many unused languages. This includes old + versions of S+, ARC, OMG, VST, and XLS. + + The following have been made obsolete or removed, see their +documentation for more detail: + + * Libraries for literate data analysis are obsolete and not loaded by + default. This includes 'ess-noweb', 'ess-swv', and related + functionality like 'Rnw-mode'. Users are encouraged to switch to + one of several other packages that deal with these modes. For + example, polymode , + , or markdown-mode with edit-indirect + . + + * User options for controlling display of buffers. This includes + 'ess-show-buffer-action', 'inferior-ess-same-window', + 'inferior-ess-own-frame', and 'inferior-ess-frame-alist'. See + above about ESS respecting 'display-buffer-alist'. + + * 'inferior-ess-*-start-file' variables. All modes except Stata did + not respect customization of this variable. In order to load a + file on startup, you should put a function on + 'ess-*-post-run-hook'. + + Bug Fixes in 18.10.3: + * More 'Makefile' fixes, notably installing '*.el's. + + Bug Fixes in 18.10.2: * ESS[R] Fix namespace evaluation in non-installed packages. Evaluation is directed into GlobalEnv as originally intended. * 'Makefile' fixes, notably for 'make install' and including full @@ -598,17 +688,17 @@ File: readme.info, Node: Authors, Prev: Mailing Lists, Up: General Informatio  Tag Table: Node: General Information73 -Node: License1711 -Node: Installation2381 -Node: Installing from a third-party repository3298 -Node: Installing from source4248 -Node: Activating and Loading ESS5843 -Node: Check Installation6920 -Node: Starting up7143 -Node: Current Features7526 -Node: New Features9076 -Node: Reporting Bugs22834 -Node: Mailing Lists23732 -Node: Authors24468 +Node: License1719 +Node: Installation2389 +Node: Installing from a third-party repository3306 +Node: Installing from source4256 +Node: Activating and Loading ESS5851 +Node: Check Installation6928 +Node: Starting up7151 +Node: Current Features7534 +Node: New Features9084 +Node: Reporting Bugs26988 +Node: Mailing Lists27886 +Node: Authors28622  End Tag Table diff --git a/elpa/ess-20181109.703/requires.info b/elpa/ess-20190121.1430/requires.info similarity index 88% rename from elpa/ess-20181109.703/requires.info rename to elpa/ess-20190121.1430/requires.info index bb658f4b..9bc3ab78 100644 --- a/elpa/ess-20181109.703/requires.info +++ b/elpa/ess-20190121.1430/requires.info @@ -1,7 +1,7 @@ This is requires.info, produced by makeinfo version 6.5 from requires.texi. -ESS supports GNU Emacs versions 24.3 and newer. +ESS supports GNU Emacs versions 25.1 and newer. ESS is most likely to work with current/recent versions of the following statistical packages: R/S-PLUS, SAS, Stata, OpenBUGS and JAGS. -- 2.47.3