Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2477 line
88 KiB

4 年之前
  1. ;;; ess-custom.el --- Customize variables for ESS -*- lexical-binding: t; -*-
  2. ;; Copyright (C) 1997--2010 A.J. Rossini, Richard M. Heiberger, Martin
  3. ;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.
  4. ;; Copyright (C) 2011--2015 A.J. Rossini, Richard M. Heiberger, Martin Maechler,
  5. ;; Kurt Hornik, Rodney Sparapani, Stephen Eglen and Vitalie Spinu.
  6. ;; Author: A.J. Rossini <blindglobe@gmail.com>
  7. ;; Created: 05 June 2000
  8. ;; Maintainer: ESS-core <ESS-core@r-project.org>
  9. ;; Keywords: languages
  10. ;; This file is part of ESS
  11. ;; This file is free software; you can redistribute it and/or modify
  12. ;; it under the terms of the GNU General Public License as published by
  13. ;; the Free Software Foundation; either version 2, or (at your option)
  14. ;; any later version.
  15. ;;
  16. ;; This file is distributed in the hope that it will be useful,
  17. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;; GNU General Public License for more details.
  20. ;;
  21. ;; A copy of the GNU General Public License is available at
  22. ;; https://www.r-project.org/Licenses/
  23. ;;; Commentary:
  24. ;; This file holds defcustoms for ESS. It is required by ess-utils.el,
  25. ;; which in turn is required by almost every other ESS file.
  26. ;;; Code:
  27. (require 'comint)
  28. ;; FIXME: When Emacs is started from Cygwin shell in Windows,
  29. ;; we have (equal window-system 'x) -and should use "--ess" in *d-r.el
  30. (defvar ess-microsoft-p (memq system-type '(ms-dos windows-nt))
  31. "Value is t if the OS is one of Microsoft's, nil otherwise.")
  32. ;; Customization Groups
  33. (defgroup ess nil
  34. "ESS: Emacs Speaks Statistics."
  35. :group 'languages
  36. :link '(info-link "(ESS)")
  37. :link '(url-link "https://ess.r-project.org/"))
  38. (defgroup ess-edit nil
  39. "ESS: editing behavior, including comments/indentation."
  40. :group 'ess
  41. :prefix "ess-")
  42. (defgroup ess-proc nil
  43. "ESS: process control."
  44. :group 'ess
  45. :prefix "ess-")
  46. (defgroup ess-command nil
  47. "ESS: Commands for various things."
  48. :group 'ess
  49. :prefix "ess-")
  50. (defgroup ess-help nil
  51. "ESS: help functions."
  52. :group 'ess
  53. :prefix "ess-")
  54. (defgroup ess-hooks nil
  55. "ESS: hooks for customization."
  56. :group 'ess
  57. :prefix "ess-")
  58. (defgroup ess-S nil
  59. "ESS: S Languages."
  60. :group 'ess
  61. :prefix "ess-")
  62. (defgroup ess-SPLUS nil
  63. "ESS: S-PLUS Dialect of S."
  64. :group 'ess-S
  65. :prefix "ess-")
  66. (defgroup ess-R nil
  67. "ESS: R Dialect of S."
  68. :group 'ess-S
  69. :prefix "ess-")
  70. (defgroup ess-Julia nil
  71. "ESS: Julia."
  72. :group 'ess
  73. :prefix "julia-")
  74. (defgroup ess-sas nil
  75. "ESS: SAS."
  76. :group 'ess
  77. :prefix "ess-")
  78. (defgroup ess-Stata nil
  79. "ESS: Stata."
  80. :group 'ess
  81. :prefix "ess-")
  82. (defgroup ess-roxy nil
  83. "Mode for editing in-code Roxygen documentation."
  84. :group 'ess
  85. :group 'convenience
  86. :group 'ess-extras
  87. :prefix "ess-"
  88. :group 'tools)
  89. (defgroup ess-extras nil
  90. "Extra utilities for ESS"
  91. :group 'ess
  92. :prefix "ess-")
  93. (defgroup ess-faces nil
  94. "Faces and face options for ESS modes."
  95. :group 'ess
  96. :group 'faces
  97. :prefix "ess-")
  98. ; User changeable variables
  99. ;;*;; Options and Initialization
  100. ;;;###autoload
  101. (defcustom ess-lisp-directory
  102. (file-name-directory
  103. (or load-file-name
  104. buffer-file-name))
  105. "Directory containing ess-site.el(c) and other ESS Lisp files."
  106. :group 'ess
  107. :type 'directory
  108. :package-version '(ess . "19.04"))
  109. (defcustom ess-etc-directory
  110. ;; Try to detect the `etc' folder only if not already set up by distribution
  111. (let (dir)
  112. (dolist (d '("./etc/" "../../etc/ess/" "../etc/" "../etc/ess/"))
  113. (setq d (expand-file-name d ess-lisp-directory))
  114. (when (file-directory-p d)
  115. (setq dir d)))
  116. dir)
  117. "Location of the ESS etc/ directory.
  118. The ESS etc directory stores various auxiliary files that are useful
  119. for ESS, such as icons."
  120. :group 'ess
  121. :type 'directory
  122. :package-version '(ess . "19.04"))
  123. ;; Depending on how ESS is loaded the `load-path' might not contain
  124. ;; the `lisp' directory. For this reason we need to add it before we
  125. ;; start requiring ESS files
  126. ;;;###autoload
  127. (add-to-list 'load-path ess-lisp-directory)
  128. ;; Add ess-lisp-directory/obsolete to load-path; files here will
  129. ;; automatically warn that they are obsolete when loaded.
  130. ;;;###autoload
  131. (add-to-list 'load-path (file-name-as-directory (expand-file-name "obsolete" ess-lisp-directory)))
  132. (unless (file-directory-p ess-etc-directory)
  133. (display-warning 'ess (format "Could not find directory `ess-etc-directory': %s"
  134. ess-etc-directory) :error))
  135. ;; Menus and pulldowns.
  136. (defcustom ess-imenu-use-p (fboundp 'imenu)
  137. "Non-nil means use imenu facility.
  138. This value can be overridden by mode-specific variables, such
  139. as `ess-imenu-use-S'."
  140. :group 'ess
  141. :type 'boolean)
  142. (defcustom ess-imenu-use-S ess-imenu-use-p
  143. "Non-nil means include an Imenu menu item in S buffers."
  144. :group 'ess
  145. :type 'boolean)
  146. (defcustom ess-auto-width-visible nil
  147. "When non-nil, echo width setting in the inferior buffer.
  148. See `ess-auto-width'. Be warned that ESS can set the width a
  149. lot."
  150. :group 'ess
  151. :type 'boolean
  152. :package-version '(ess . "19.04"))
  153. (defcustom ess-auto-width nil
  154. "When non-nil, set the width option when the window configuration changes.
  155. When 'frame, set the width to the frame width. When 'window, set
  156. the width to the window width. If an integer, set the width to
  157. that integer. Anything else is treated as 'window."
  158. :group 'ess
  159. :type '(choice (const :tag "Do nothing" :value nil)
  160. (const :tag "Frame width" :value frame)
  161. (const :tag "Window width" :value window)
  162. (integer :tag "Integer value"))
  163. :package-version '(ess . "19.04"))
  164. (defcustom ess-handy-commands '(("change-directory" . ess-change-directory)
  165. ("install.packages" . ess-install-library)
  166. ("library" . ess-library)
  167. ("objects[ls]" . ess-execute-objects)
  168. ("help-apropos" . ess-display-help-apropos)
  169. ("help-index" . ess-display-package-index)
  170. ("help-object" . ess-display-help-on-object)
  171. ("search" . ess-execute-search)
  172. ("set-width" . ess-execute-screen-options)
  173. ("setRepos" . ess-setRepositories)
  174. ("sos" . ess-sos)
  175. ("vignettes" . ess-display-vignettes)
  176. )
  177. "An alist of custom ESS commands.
  178. These are available for call by function `ess-handy-commands' and
  179. `ess-smart-comma' function."
  180. :group 'ess
  181. :type 'alist)
  182. (defvar-local ess--local-handy-commands nil
  183. "Store handy commands locally.")
  184. (defcustom ess-describe-at-point-method nil
  185. "Whether `ess-describe-object-at-point' should use a tooltip.
  186. If nil display in an electric buffer. If 'tooltip display in
  187. a tooltip.
  188. See also `tooltip-hide-delay' and variable `tooltip-delay'."
  189. :group 'ess-utils
  190. :type '(choice (const :tag "buffer" :value nil ) (const tooltip)))
  191. (defvaralias
  192. 'ess-R-describe-object-at-point-commands
  193. 'ess-r-describe-object-at-point-commands)
  194. (defcustom ess-r-describe-object-at-point-commands
  195. '(("str(%s)")
  196. (".ess_htsummary(%s, hlength = 20, tlength = 20)")
  197. ("summary(%s, maxsum = 20)"))
  198. "A list of commands cycled by `ess-describe-object-at-point'.
  199. %s is substituted with the name at point.
  200. The value of each element is nil and is not used in current
  201. implementation."
  202. :group 'ess-R
  203. :type 'alist)
  204. (defcustom ess-S-describe-object-at-point-commands
  205. ess-R-describe-object-at-point-commands
  206. "An alist of commands cycled by `ess-describe-object-at-point'.
  207. %s is substitute with the name at point. The value is not used as
  208. yet."
  209. :group 'S+
  210. :type 'alist)
  211. (defcustom ess-can-eval-in-background t
  212. "If non-nil ESS can perform caching and other background activities.
  213. This allows ESS to call the subprocess on idle time."
  214. :group 'ess
  215. :type 'boolean)
  216. (defcustom ess-user-full-name (user-full-name)
  217. "The full name of the user."
  218. :group 'ess
  219. :type 'string)
  220. (defcustom ess-blink-region t
  221. "If t evaluated region is highlighted for a shortwhile.
  222. See also `ess-blink-delay'"
  223. :group 'ess
  224. :type 'boolean)
  225. (defcustom ess-blink-delay .3
  226. "Number of seconds to highlight the evaluated region."
  227. :group 'ess
  228. :type 'number)
  229. (defcustom ess-ask-for-ess-directory t
  230. "Non-nil means request the process directory each time S is run."
  231. :group 'ess
  232. :type 'boolean)
  233. (defcustom ess-ask-about-transfile nil
  234. "Non-nil means ask about a transcript file before running ESS."
  235. :group 'ess
  236. :type 'boolean)
  237. (defcustom ess-display-buffer-reuse-frames t
  238. "Non-nil means \\[display-buffer] reuses existing frames.
  239. See `display-buffer-reuse-frames'."
  240. :group 'ess
  241. :type 'boolean)
  242. (defvar-local ess-language nil
  243. "Determines the language to use for the current buffer.
  244. See also `ess-dialect'.")
  245. (defvar-local ess-dialect nil
  246. "String version of the dialect being run for the inferior process.
  247. This, plus `ess-language', should be able to determine the exact
  248. version of the statistical package being executed in the particular
  249. buffer.")
  250. (defcustom ess-directory-function nil
  251. "Function to return the directory that ESS is run from.
  252. If nil or if the function returns nil then you get `ess-startup-directory'."
  253. :group 'ess
  254. :type '(choice (const nil) function))
  255. (defcustom ess-setup-directory-function nil
  256. "Function to setup the directory that ESS is run from.
  257. This function can be called to set environment variables or to create
  258. a workspace."
  259. :group 'ess
  260. :type '(choice (const nil) function))
  261. (defvaralias 'ess-directory 'ess-startup-directory)
  262. (defcustom ess-startup-directory nil
  263. "The directory ESS is run from. It must end in a slash.
  264. Provided as a default if `ess-ask-for-ess-directory' is non-nil.
  265. A nil value means use the current buffer's default directory."
  266. :group 'ess
  267. :type '(choice (const nil) directory))
  268. (defcustom ess-history-directory nil
  269. "Directory to pick up `ess-history-file' from.
  270. If this is nil, the history file is relative to the startup
  271. directory of the inferior process (see `ess-startup-directory')."
  272. :group 'ess
  273. :type '(choice (const nil) directory))
  274. (defcustom ess-history-file t
  275. "File to pick up history from. nil means *no* history is read or written.
  276. t means something like \".Rhistory\".
  277. If this is a relative file name, it is relative to `ess-history-directory'.
  278. Consequently, if that is set explicitly, you will have one history file
  279. for all projects."
  280. :group 'ess
  281. :type '(choice (const :tag "Off" nil)
  282. (const :tag "On" t)
  283. file))
  284. (defcustom ess-plain-first-buffername t
  285. "When non-nil, the first process buffer created does not have a number.
  286. In other words, it is R:foo rather than R:1:foo. Subsequent
  287. processes buffers are always numbered (e.g. R:2:foo."
  288. :group 'ess
  289. :type 'boolean)
  290. (define-obsolete-variable-alias
  291. 'ess-use-inferior-program-name-in-buffer-name
  292. 'ess-use-inferior-program-in-buffer-name "ESS 18.10")
  293. (defcustom ess-use-inferior-program-in-buffer-name nil
  294. "For R, use e.g., 'R-2.1.0' or 'R-devel' (the program name) for buffer name.
  295. Avoids the plain dialect name."
  296. :group 'ess
  297. :type 'boolean)
  298. (defcustom ess-use-ido t
  299. "If t ess will try to use ido completion whenever possible.
  300. By default ESS uses enables IDO flex matching. See
  301. `ido-enable-flex-matching' for details on flex matching and
  302. `ess-ido-flex-matching' on how to disable it for ESS, if you
  303. don't want it.
  304. See info node `(ido) Top' for more information about how ido
  305. works."
  306. :group 'ess
  307. :require 'ido
  308. :type 'boolean)
  309. (defcustom ess-tab-complete-in-script nil
  310. "If non-nil, TAB tries to complete if it does not indent in script buffers.
  311. See also `ess-first-tab-never-complete'."
  312. :group 'ess
  313. :type 'boolean)
  314. (make-obsolete-variable 'ess-tab-complete-in-script 'tab-always-indent "ESS 19.04" 'set)
  315. (define-obsolete-variable-alias 'ess-first-tab-never-completes-p
  316. 'ess-first-tab-never-complete "ESS 19.04")
  317. (defcustom ess-first-tab-never-complete 'symbol
  318. "If t, first TAB never tries to complete in `ess-mode'.
  319. If 'symbol first TAB doesn't try to complete if next char is a
  320. valid symbol constituent.
  321. If 'symbol-or-paren don't complete if next char is closed paren
  322. )}] or symbol character.
  323. If 'symbol-or-paren-or-punct don't complete if next char is
  324. punctuation +-=% etc, or closed paren or symbol.
  325. If 'unless-eol - first TAB completes only at end of line.
  326. If nil first TAB always tries to complete (this might be too
  327. aggressive and dangerous)."
  328. :group 'ess
  329. :type '(choice (const nil)
  330. (const symbol)
  331. (const symbol-or-paren)
  332. (const symbol-or-paren-or-punct)
  333. (const unless-eol)
  334. (const t)))
  335. (defcustom ess-use-eldoc t
  336. "If t, activate eldoc in `ess-mode' and `inferior-ess-mode' buffers.
  337. If 'script-only activate in `ess-mode' buffers only.
  338. See also `ess-eldoc-show-on-symbol'."
  339. :group 'ess-extras
  340. :type '(choice (const t) (const script-only) (const nil)))
  341. (defcustom ess-eldoc-show-on-symbol nil
  342. "If non-nil, show help string whenever the point is on a symbol.
  343. If nil show only when the point is in a function call, i.e. after (."
  344. :group 'ess-extras
  345. :type 'boolean)
  346. (defcustom ess-eldoc-abbreviation-style 'normal
  347. "Controls how `eldoc' displays information that does not fit on a line.
  348. A symbol which can be
  349. - nil: do nothing
  350. - mild: Replace TRUE, FALSE with T,F
  351. - normal: Try mild + shorten the default values longer than 10
  352. characters.
  353. - strong: Try normal + completely remove default values except
  354. =F,=T,=d where d is a digit.
  355. - aggressive (or t): Try strong + truncate the doc string to fit
  356. into minibuffer.
  357. The default style is 'normal.
  358. Ess-eldoc also honors the value of
  359. `eldoc-echo-area-use-multiline-p'. If this variable is not t (the
  360. default), doc strings are truncated to fit into minibufer. This
  361. allows the use of different abbreviation styles with the
  362. truncation."
  363. :group 'ess
  364. :type '(choice (const nil) (const mild) (const normal) (const strong) (const aggressive) (const t)))
  365. (defcustom ess-use-flymake t
  366. "If non-nil activate flymake in `ess-mode' buffers.
  367. If 'process, only check if the buffer has an inferior process."
  368. :group 'ess
  369. :type '(choice (const :tag "Always" t)
  370. (const :tag "With running inferior process" process)
  371. (const :tag "Never" nil))
  372. :package-version '(ess . "18.10"))
  373. (defcustom ess-use-auto-complete t
  374. "If non-nil, activate auto-complete support.
  375. If t, activate auto-complete support in `ess-mode' and
  376. `inferior-ess-mode' buffers. If 'script-only activate in `ess-mode'
  377. buffers only.
  378. If non-nil add `ac-source-R' and `ac-source-filename' to the
  379. `ac-sources' buffer local variable.
  380. ESS defines three AC sources `ac-source-R',`ac-source-R-objects'
  381. and `ac-source-R-args'. See auto-complete package
  382. documentation (http://cx4a.org/software/auto-complete/) for how
  383. to install your custom sources."
  384. :group 'ess-extras
  385. :type '(choice (const t) (const script-only) (const nil)))
  386. (make-obsolete-variable 'ess-use-auto-complete "Auto-complete is unmaintained; use company-mode instead"
  387. "ESS 19.04" 'set)
  388. (defcustom ess-use-company t
  389. "If t, activate company support in `ess-mode' and `inferior-ess-mode' buffers.
  390. If non-nil add `company-R-args' and `company-R-objects' to the
  391. `company-backends'. If 'script-only activate in `ess-mode' buffers
  392. only."
  393. :group 'ess-extras
  394. :type '(choice (const t) (const script-only) (const nil)))
  395. (defcustom ess-company-arg-prefix-length nil
  396. "Minimum prefix for ess company function argument completion."
  397. :group 'ess-extras
  398. :type '(choice (const :tag "Default" nil)
  399. integer))
  400. (defcustom ess-use-tracebug t
  401. "If t, load `ess-tracebug' when R process starts."
  402. :group 'ess-extras
  403. :type 'boolean)
  404. (defcustom ess-ido-flex-matching t
  405. "If t, ido for ESS completion uses flex matching.
  406. See `ido-enable-flex-matching' for details.
  407. If you have an old computer, or you load lot of packages, you
  408. might want to set this to nil."
  409. :group 'ess
  410. :type 'boolean)
  411. (defvar ess--completing-hist nil
  412. "Variable to store completion history.
  413. Used by `ess-completion-read' command.")
  414. (defvar-local ess-smart-operators ()
  415. "List of smart operators to be used in ESS and IESS modes.
  416. Not to be set by users. It is redefined by mode specific
  417. settings, such as `ess-r-smart-operators'.")
  418. (defvaralias 'ess-R-smart-operators 'ess-r-smart-operators)
  419. (defvar ess-r-smart-operators nil
  420. "If nil, don't use any of smart operators.
  421. If t, use all. If an explicit list of operators, use only those
  422. operators.
  423. In current version of ESS, it controls the behavior of
  424. `ess-smart-comma' only, but will be enriched in the near future.")
  425. (defvar ess-no-skip-regexp "[ \t\n]*\\'"
  426. "If `ess-next-code-line' sees this line, it doesn't jump over.
  427. Used to avoid annoying jumping by ess-eval.*-and-step to end of
  428. buffer or end chunks etc.")
  429. (make-obsolete-variable 'ess-smart-S-assign-key nil "ESS 18.10")
  430. (defcustom ess-assign-list (cons (or (bound-and-true-p ess-S-assign) " <- ")
  431. '(" <<- " " = " " -> " " ->> "))
  432. "List of assignment operators.
  433. `ess-cycle-assign' uses this list. These strings must
  434. contain spaces on either side."
  435. ;; Note that spaces on either side is not strictly true (as in the
  436. ;; function won't error), but matching <-/<<- is broken without
  437. ;; them.
  438. :type '(repeat string)
  439. :group 'ess
  440. :package-version '(ess "18.10"))
  441. (defvar ess-S-assign)
  442. (make-obsolete-variable 'ess-S-assign 'ess-assign-list "ESS 18.10")
  443. (defcustom ess-r-prettify-symbols
  444. '(("<-" . (?\s (Br . Bl) ?\s (Bc . Bc) ?←))
  445. ("->" . (?\s (Br . Bl) ?\s (Bc . Bc) ?→))
  446. ("->>" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s
  447. (Bl . Bl) ?- (Bc . Br) ?- (Bc . Bc) ?>
  448. (Bc . Bl) ?- (Br . Br) ?>))
  449. ("<<-" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s
  450. (Bl . Bl) ?< (Bc . Br) ?- (Bc . Bc) ?-
  451. (Bc . Bl) ?< (Br . Br) ?-)))
  452. ;; Setup prettify-symbols-alist to show "pretty" arrows, but make
  453. ;; sure that they arrows use the same amount of spacing as <- and
  454. ;; <<- to ensure indentation does not change when
  455. ;; prettify-symbols-mode is turned on/off.
  456. "Alist of symbols prettifications, see `prettify-symbols-alist'.
  457. This gets appended to `prettify-symbols-alist', so set it to nil
  458. if you want to disable R specific prettification."
  459. :group 'ess-R
  460. :type '(alist :key-type string :value-type symbol)
  461. :package-version '(ess . "18.10"))
  462. ;;*;; Variables concerning editing behavior
  463. (defcustom ess-filenames-map t
  464. "If non-nil, filenames and objects are the same in an attached directory.
  465. This is not true for DOS and other OS's with limited filename
  466. lengths. Even if this is set incorrectly, the right things will
  467. probably still happen, however."
  468. :group 'ess-edit
  469. :type 'boolean)
  470. (defcustom ess-keep-dump-files t
  471. "Variable controlling whether to delete dump files after a successful load.
  472. If nil: always delete. If `ask', confirm to delete. If `check', confirm
  473. to delete, except for files created with `ess-dump-object-into-edit-buffer'.
  474. Anything else, never delete. This variable only affects the behavior
  475. of `ess-load-file'. Dump files are never deleted if an error occurs
  476. during the load."
  477. :group 'ess-edit
  478. :type '(choice (const :tag "Check" :value 'check)
  479. (const :tag "Ask" :value 'ask)
  480. (const :tag "Always keep" :value t)
  481. (const :tag "Always delete" :value nil)))
  482. (defcustom ess-delete-dump-files nil
  483. "Non-nil means delete dump files after they are created.
  484. This applies to dump files created with
  485. `ess-dump-object-into-edit-buffer', only.
  486. Boolean flag which determines what to do with the dump files
  487. generated by \\[ess-dump-object-into-edit-buffer], as follows:
  488. If non-nil: dump files are deleted after each use, and so appear
  489. only transiently. The one exception to this is when a loading error
  490. occurs, in which case the file is retained until the error is
  491. corrected and the file re-loaded.
  492. If nil: dump files are not deleted, and backups are kept
  493. as usual. This provides a simple method for keeping an archive of S
  494. functions in text-file form.
  495. Auto-save is always enabled in dump-file buffers to enable recovery
  496. from crashes.
  497. This is useful to prevent source files being created for objects
  498. you don't actually modify. Once the buffer is modified and saved
  499. however, the file is not subsequently deleted unless
  500. `ess-keep-dump-files' is nil, and the file is successfully loaded
  501. back into S."
  502. :group 'ess-edit
  503. :type 'boolean)
  504. (defcustom ess-fill-calls t
  505. "If non-nil, refilling inside a call arranges arguments.
  506. In other words, refilling a paragraph inside a function or
  507. indexing call will arrange the arguments according to
  508. `fill-column' as in:
  509. fun_call(argument1, argument2,
  510. argument3, argument4)
  511. Refilling repeatedly cycles through different styles and
  512. eventually to the original formatting.
  513. The second style formats according to one argument per line:
  514. fun_call(argument1,
  515. argument2,
  516. argument3,
  517. argument4)
  518. When `ess-fill-calls-newlines' is t, the second style becomes:
  519. fun_call(
  520. argument1,
  521. argument2,
  522. argument3,
  523. argument4
  524. )
  525. Setting `ess-offset-arguments' to `prev-line' or `prev-call'
  526. activates a third style. It keeps one argument per line except
  527. for the first N arguments. N is controlled with a prefix. For
  528. example, calling \\[fill-paragraph] three times sets N to 1 while
  529. calling \\[fill-paragraph] twice then \\[universal-argument] 2
  530. \\[fill-paragraph] sets N to 2. Here what the default produces:
  531. fun_call(argument1,
  532. argument2,
  533. argument3,
  534. argument4,
  535. argument5
  536. )
  537. This style is useful for refilling R6 or ggproto class
  538. definitions.
  539. The blinking of the refilled region can be disabled with
  540. `ess-blink-refilling'."
  541. :group 'ess-edit
  542. :type 'boolean)
  543. (defcustom ess-fill-continuations t
  544. "Controls filling of continuations.
  545. If non-nil, refilling a paragraph inside a continuation of
  546. statements (expressions separated by operators) will arrange all
  547. its elements, never going past `fill-column'.
  548. lm(outcome ~ pred1 + pred2 +
  549. pred3 + pred4, data)
  550. Refilling repeatedly cycles through different styles and
  551. eventually to the original formatting.
  552. The second style lay out the statements according to one
  553. expression per line:
  554. lm(outcome ~
  555. pred1 +
  556. pred2 +
  557. pred3 +
  558. pred4, data)
  559. The blinking of the refilled region can be disabled with
  560. `ess-blink-refilling'."
  561. :group 'ess-edit
  562. :type 'boolean)
  563. (defcustom ess-fill-calls-newlines nil
  564. "When non-nil, refilling may place newlines before and after delimiters.
  565. When non-nil, the second refilling style produces newlines
  566. after and before the opening and closing delimiters. This is
  567. intended for example for dplyr-style code:
  568. fun_call(
  569. argument1,
  570. argument2,
  571. argument3,
  572. argument4
  573. )
  574. Note that this setting is temporary and likely to be replaced in
  575. a future ESS version by a more comprehensive and flexible way to
  576. set refill styles."
  577. :group 'ess-edit
  578. :type 'boolean)
  579. (defcustom ess-blink-refilling t
  580. "When non-nil, refilling blinks the filling region."
  581. :group 'ess-edit
  582. :type 'boolean)
  583. (define-obsolete-variable-alias 'ess-mode-silently-save 'ess-save-silently "ESS 19.04")
  584. (defcustom ess-save-silently 'auto
  585. "If non-nil, possibly save buffers without asking.
  586. If t, save without asking. If 'auto, save without asking if
  587. either `compilation-ask-about-save' or variable `auto-save-visited-mode'
  588. is non-nil. Affects `ess-save-file'."
  589. :group 'ess-edit
  590. :type '(choice (const :tag "Do not save without asking." :value nil)
  591. (const :tag "Use compilation-ask-about-save and auto-save-visited-mode."
  592. :value auto)
  593. (const :tag "Save without asking." :value t))
  594. :package-version '(ess . "19.04"))
  595. ;;*;; Variables controlling editing
  596. ;;;*;;; Edit buffer processing
  597. (defcustom ess-function-template " <- function( )\n{\n\n}\n"
  598. "If non-nil, function template used when editing nonexistent objects.
  599. The edit buffer will contain the object name in quotes, followed by
  600. this string. Point will be placed after the first parenthesis or
  601. bracket."
  602. :group 'ess-edit
  603. :type 'string)
  604. ;;;*;;; Indentation parameters
  605. (define-obsolete-variable-alias 'ess-tab-always-indent 'tab-always-indent "ESS 19.04")
  606. (define-obsolete-variable-alias 'ess-indent-level 'ess-indent-offset "15.09")
  607. (defvar ess-indent-offset 2
  608. "Main indentation offset that is commonly inherited by other offsets.
  609. See `ess-style-alist' for all available offsets.")
  610. ;;;###autoload
  611. (put 'ess-indent-offset 'safe-local-variable #'numberp)
  612. (defvar ess-offset-arguments 'open-delim
  613. "Indent for arguments of function calls or indexing brackets.
  614. This variables has an effect only when the ( or [ are not
  615. directly followed by a new line. See
  616. `ess-offset-arguments-newline' for indentation after closing
  617. newline.
  618. When set to `open-delim', arguments are indented relative to the
  619. opening parenthesis of the closest function call:
  620. object <- call(argument, other_call(argument,
  621. other_argument))
  622. When set to `prev-call', arguments are indented relative to the
  623. closest function call:
  624. object <- call(argument, other_call(argument,
  625. other_argument))
  626. When set to `prev-line', arguments are indented relative to the
  627. preceding line:
  628. object <- call(argument, other_call(argument,
  629. other_argument))
  630. This setting can also be set to a list containing the the offset
  631. type and the offset size, such as `'(prev-call 2)'. Otherwise,
  632. `ess-indent-offset' is used as a default. See `ess-style-alist'
  633. for other offsets controlling indentation.")
  634. (define-obsolete-variable-alias 'ess-arg-function-offset-new-line 'ess-offset-arguments-newline "15.09")
  635. (defvar ess-offset-arguments-newline 'prev-call
  636. "Indent of arguments when ( or [ is followed by a new line.
  637. When set to `open-delim', arguments on a new line are indented
  638. relative to the opening parenthesis of the closest function call:
  639. object <- call(argument, other_call(
  640. argument,
  641. other_argument
  642. ))
  643. When set to `prev-call', arguments on a new line are indented relative to
  644. the closest function call:
  645. object <- call(argument, other_call(
  646. argument,
  647. other_argument
  648. ))
  649. You can control the details of indentation at `prev-call' with
  650. `ess-indent-from-lhs' and `ess-indent-from-chain-start'.
  651. When set to `prev-line', arguments on a new line are indented
  652. relative to the preceding line:
  653. object <- call(argument, other_call(
  654. argument,
  655. other_argument
  656. ))
  657. This setting can also be set to a list containing the the offset
  658. type and the offset size, such as `'(prev-call 2)'. Otherwise,
  659. `ess-indent-offset' is used as a default. See `ess-style-alist'
  660. for other offsets controlling indentation.")
  661. (defvar ess-offset-block 'prev-line
  662. "Controls indentation for blocks.
  663. A block is usually declared with braces but a statement wrapped
  664. in anonymous parentheses is also considered a block. This offset
  665. can be either `prev-call', `prev-line' or `open-delim'.
  666. When set to `open-delim', blocks are indented relative to the
  667. opening parenthesis of the closest function call:
  668. call(argument, other_call(parameter = {
  669. stuff
  670. }, {
  671. stuff
  672. }))
  673. call(argument, lapply(data, function(x) {
  674. body
  675. }))
  676. When set to `prev-call', blocks are indented relative to the
  677. closest function call:
  678. call(argument, other_call(parameter = {
  679. stuff
  680. }, {
  681. stuff
  682. }))
  683. call(argument, lapply(data, function(x) {
  684. body
  685. }))
  686. You can control the details of indentation at `prev-call' with
  687. `ess-indent-from-lhs' and `ess-indent-from-chain-start'.
  688. When set to `prev-line', blocks are indented relative to the
  689. preceding line:
  690. call(argument, other_call(parameter = {
  691. stuff
  692. }, {
  693. stuff
  694. }))
  695. call(argument, lapply(data, function(x) {
  696. body
  697. }))
  698. This setting can also be set to a list containing the the offset
  699. type and the offset size, such as `'(prev-call 2)'. Otherwise,
  700. `ess-indent-offset' is used as a default. See `ess-style-alist'
  701. for other offsets controlling indentation.")
  702. (define-obsolete-variable-alias 'ess-first-continued-statement-offset 'ess-offset-continued "15.09")
  703. (define-obsolete-variable-alias 'ess-continued-statement-offset 'ess-offset-continued "15.09")
  704. (defvar ess-offset-continued 'straight
  705. "This setting controls indentation of continued statements.
  706. That is, consecutive statements separated by operators.
  707. When set to 'straight, continued statements are indented as follows:
  708. object %>%
  709. some_function() %>%
  710. other_function()
  711. When set to 'cascade:
  712. object %>%
  713. some_function() %>%
  714. other_function()
  715. The 'straight and 'cascade settings are actually equivalent to
  716. '(straight . t) and '(cascade . t), where t represents the
  717. base indent size. More generally, you can supply '(straight . N)
  718. to control the size of indentation.
  719. See `ess-style-alist' for for an overview of ESS indentation.")
  720. (defvar ess-align-nested-calls '("ifelse")
  721. "List of strings for which `ess-offset-arguments-newline' is ignored.
  722. These calls will be vertically aligned instead. For example, if
  723. `ifelse' is a member of the list, nested ifelse calls are
  724. indented like this:
  725. object <- ifelse(condition1, out1,
  726. ifelse(condition2, out2, out3))
  727. See `ess-style-alist' for for an overview of ESS indentation.")
  728. (defvar ess-align-arguments-in-calls '("function[ \t]*(")
  729. "A list of refexes where `ess-offset-arguments' is ignored.
  730. List of regexes specifying the calls where `ess-offset-arguments'
  731. should have no effect on function declarations. The arguments of
  732. those calls will be aligned from the opening parenthesis.
  733. By default, function declarations are overridden. If for example
  734. `ess-offset-arguments' is set to `prev-line', then function calls
  735. are normally indented as in:
  736. some_function(argument1,
  737. argument2, argument3
  738. )
  739. However, the parameters of function declarations will be
  740. vertically aligned:
  741. fun <- function(argument1,
  742. argument2
  743. argument3) {
  744. body
  745. }
  746. See `ess-style-alist' for further details.")
  747. (defvar ess-align-continuations-in-calls t
  748. "Whether continuations inside calls are indented from the opening delimiter.
  749. This produces the following indentation:
  750. 10 + (1 + 2 +
  751. 3 + 4)
  752. object[variable1 +
  753. variable2]
  754. if (test1 || test2 ||
  755. test3 || test4) {
  756. any(test5 &
  757. test6)
  758. }
  759. instead of
  760. 10 + (1 + 2 +
  761. 3 + 4)
  762. object[variable1 +
  763. variable2]
  764. if (test1 || test2 ||
  765. test3 || test4) {
  766. any(test5 &
  767. test6)
  768. }
  769. Definition operators (`<-', `=', `:=' and `~') still trigger an
  770. indentation in all cases. Also, operators at top level and in
  771. curly brackets are not affected by this setting and always induce
  772. an offset:
  773. {
  774. var1 +
  775. var2
  776. }
  777. See `ess-style-alist' for for an overview of ESS indentation.")
  778. (defvar ess-align-blocks '(control-flow)
  779. "List of block types for which `ess-offset-blocks' is ignored.
  780. The overridden blocks are vertically aligned. The list can
  781. contain either or both of the symbols `control-flow' and
  782. `fun-decl'.
  783. With `control-flow', if, else for and while blocks will always be
  784. aligned vertically. With `fun-decl', the body of a function
  785. declaration will always be aligned with the call to
  786. `function'.")
  787. (define-obsolete-variable-alias 'ess-arg-function-offset 'ess-indent-from-lhs "15.09")
  788. (defvar ess-indent-from-lhs '(arguments fun-decl-opening)
  789. "List of elements that are indented from the left side of an assignment.
  790. The list accepts the symbol `arguments' and `fun-decl-opening'.
  791. For arguments, this setting only has an effect for offsets set to
  792. `prev-call'. When set, this indentation is produced:
  793. some_function(parameter = other_function(
  794. argument
  795. ))
  796. object <- some_function(
  797. argument1,
  798. argument2
  799. )
  800. instead of:
  801. some_function(parameter = other_function(
  802. argument
  803. ))
  804. object <- some_function(
  805. argument1,
  806. argument2
  807. )
  808. `fun-decl-opening' refers to the opening curly following a function
  809. declaration. Setting it produces:
  810. object <-
  811. function(argument)
  812. {
  813. body
  814. }
  815. instead of:
  816. object <-
  817. function(argument)
  818. {
  819. body
  820. }
  821. This is useful when (a) you have a long function name and want to
  822. break a line after `<-' so that you have room to lay out the
  823. arguments within `fill-column' characters; (b) you still want to
  824. align the function body from the LHS to save horizontal space.
  825. See `ess-style-alist' for for an overview of ESS indentation.")
  826. (defvar ess-indent-from-chain-start t
  827. "When non-nil, chained calls are treated as if they were one call.
  828. Indentation will start from the first one. This setting only has
  829. an effect for offsets set to `prev-call' or block offsets set to
  830. `opening-delim'.
  831. If nil:
  832. some_function(other_function(
  833. argument
  834. ))
  835. If t:
  836. some_function(other_function(
  837. argument
  838. ))
  839. See `ess-style-alist' for for an overview of ESS indentation.")
  840. ;;added rmh 2Nov97 at request of Terry Therneau
  841. (define-obsolete-variable-alias 'ess-fancy-comments 'ess-indent-with-fancy-comments "15.09")
  842. (defcustom ess-indent-with-fancy-comments t
  843. "Non-nil means distinguish between #, ##, and ### for indentation.
  844. See `ess-style-alist' for for an overview of ESS indentation."
  845. :type 'boolean
  846. :group 'ess-edit)
  847. ;;;*;;; Editing styles
  848. (defvar ess-style-alist
  849. `((BSD
  850. (ess-indent-offset . 8)
  851. (ess-offset-arguments . ,(default-value 'ess-offset-arguments))
  852. (ess-offset-arguments-newline . ,(default-value 'ess-offset-arguments-newline))
  853. (ess-offset-block . prev-call)
  854. (ess-offset-continued . ,(default-value 'ess-offset-continued))
  855. (ess-align-nested-calls . ,(default-value 'ess-align-nested-calls))
  856. (ess-align-arguments-in-calls . ,(default-value 'ess-align-arguments-in-calls))
  857. (ess-align-continuations-in-calls . ,(default-value 'ess-align-continuations-in-calls))
  858. (ess-align-blocks . ,(default-value 'ess-align-blocks))
  859. (ess-indent-from-lhs . ,(default-value 'ess-indent-from-lhs))
  860. (ess-indent-from-chain-start . ,(default-value 'ess-indent-from-chain-start))
  861. (ess-indent-with-fancy-comments . ,(default-value 'ess-indent-with-fancy-comments)))
  862. (C++
  863. (ess-indent-offset . 4)
  864. (ess-offset-arguments . ,(default-value 'ess-offset-arguments))
  865. (ess-offset-arguments-newline . ,(default-value 'ess-offset-arguments-newline))
  866. (ess-offset-block . prev-call)
  867. (ess-offset-continued . ,(default-value 'ess-offset-continued))
  868. (ess-align-nested-calls . ,(default-value 'ess-align-nested-calls))
  869. (ess-align-arguments-in-calls . ,(default-value 'ess-align-arguments-in-calls))
  870. (ess-align-continuations-in-calls . ,(default-value 'ess-align-continuations-in-calls))
  871. (ess-align-blocks . ,(default-value 'ess-align-blocks))
  872. (ess-indent-from-lhs . (arguments))
  873. (ess-indent-from-chain-start . ,(default-value 'ess-indent-from-chain-start))
  874. (ess-indent-with-fancy-comments . ,(default-value 'ess-indent-with-fancy-comments)))
  875. ;; CLB added rmh 2Nov97 at request of Terry Therneau
  876. (CLB
  877. (ess-indent-offset . ,(default-value 'ess-indent-offset))
  878. (ess-offset-arguments . ,(default-value 'ess-offset-arguments))
  879. (ess-offset-arguments-newline . ,(default-value 'ess-offset-arguments-newline))
  880. (ess-offset-block . ,(default-value 'ess-offset-block))
  881. (ess-offset-continued . (straight 4))
  882. (ess-align-nested-calls . ,(default-value 'ess-align-nested-calls))
  883. (ess-align-arguments-in-calls . ,(default-value 'ess-align-arguments-in-calls))
  884. (ess-align-continuations-in-calls . ,(default-value 'ess-align-continuations-in-calls))
  885. (ess-align-blocks . ,(default-value 'ess-align-blocks))
  886. (ess-indent-from-lhs . ,(default-value 'ess-indent-from-lhs))
  887. (ess-indent-from-chain-start . ,(default-value 'ess-indent-from-chain-start))
  888. (ess-indent-with-fancy-comments . ,(default-value 'ess-indent-with-fancy-comments)))
  889. (GNU
  890. (ess-indent-offset . ,(default-value 'ess-indent-offset))
  891. (ess-offset-arguments . ,(default-value 'ess-offset-arguments))
  892. (ess-offset-arguments-newline . (prev-call 4))
  893. (ess-offset-block . ,(default-value 'ess-offset-block))
  894. (ess-offset-continued . ,(default-value 'ess-offset-continued))
  895. (ess-align-nested-calls . ,(default-value 'ess-align-nested-calls))
  896. (ess-align-arguments-in-calls . ,(default-value 'ess-align-arguments-in-calls))
  897. (ess-align-continuations-in-calls . ,(default-value 'ess-align-continuations-in-calls))
  898. (ess-align-blocks . ,(default-value 'ess-align-blocks))
  899. (ess-indent-from-lhs . ,(default-value 'ess-indent-from-lhs))
  900. (ess-indent-from-chain-start . ,(default-value 'ess-indent-from-chain-start))
  901. (ess-indent-with-fancy-comments . ,(default-value 'ess-indent-with-fancy-comments)))
  902. (K&R
  903. (ess-indent-offset . 5)
  904. (ess-offset-arguments . ,(default-value 'ess-offset-arguments))
  905. (ess-offset-arguments-newline . ,(default-value 'ess-offset-arguments-newline))
  906. (ess-offset-block . prev-call)
  907. (ess-offset-continued . ,(default-value 'ess-offset-continued))
  908. (ess-align-nested-calls . ,(default-value 'ess-align-nested-calls))
  909. (ess-align-arguments-in-calls . ,(default-value 'ess-align-arguments-in-calls))
  910. (ess-align-continuations-in-calls . ,(default-value 'ess-align-continuations-in-calls))
  911. (ess-align-blocks . ,(default-value 'ess-align-blocks))
  912. (ess-indent-from-lhs . ,(default-value 'ess-indent-from-lhs))
  913. (ess-indent-from-chain-start . ,(default-value 'ess-indent-from-chain-start))
  914. (ess-indent-with-fancy-comments . ,(default-value 'ess-indent-with-fancy-comments)))
  915. ;; added ajr 17.Feb'04 to match "common R" use (== DEFAULT apart from offset = 4)
  916. (RRR
  917. (ess-indent-offset . 4)
  918. (ess-offset-arguments . ,(default-value 'ess-offset-arguments))
  919. (ess-offset-arguments-newline . ,(default-value 'ess-offset-arguments-newline))
  920. (ess-offset-block . ,(default-value 'ess-offset-block))
  921. (ess-offset-continued . ,(default-value 'ess-offset-continued))
  922. (ess-align-nested-calls . ,(default-value 'ess-align-nested-calls))
  923. (ess-align-arguments-in-calls . ,(default-value 'ess-align-arguments-in-calls))
  924. (ess-align-continuations-in-calls . ,(default-value 'ess-align-continuations-in-calls))
  925. (ess-align-blocks . ,(default-value 'ess-align-blocks))
  926. (ess-indent-from-lhs . ,(default-value 'ess-indent-from-lhs))
  927. (ess-indent-from-chain-start . ,(default-value 'ess-indent-from-chain-start))
  928. (ess-indent-with-fancy-comments . ,(default-value 'ess-indent-with-fancy-comments)))
  929. (RRR+
  930. (ess-indent-offset . 4)
  931. (ess-offset-arguments . ,(default-value 'ess-offset-arguments))
  932. (ess-offset-arguments-newline . ,(default-value 'ess-offset-arguments-newline))
  933. (ess-offset-block . open-delim)
  934. (ess-offset-continued . ,(default-value 'ess-offset-continued))
  935. (ess-align-nested-calls . ,(default-value 'ess-align-nested-calls))
  936. (ess-align-arguments-in-calls . ,(default-value 'ess-align-arguments-in-calls))
  937. (ess-align-continuations-in-calls . ,(default-value 'ess-align-continuations-in-calls))
  938. (ess-align-blocks . ,(default-value 'ess-align-blocks))
  939. (ess-indent-from-lhs . (arguments))
  940. (ess-indent-from-chain-start . nil)
  941. (ess-indent-with-fancy-comments . ,(default-value 'ess-indent-with-fancy-comments)))
  942. (RStudio
  943. (ess-indent-offset . ,(default-value 'ess-indent-offset))
  944. (ess-offset-arguments . ,(default-value 'ess-offset-arguments))
  945. (ess-offset-arguments-newline . prev-line)
  946. (ess-offset-block . ,(default-value 'ess-offset-block))
  947. (ess-offset-continued . ,(default-value 'ess-offset-continued))
  948. (ess-align-nested-calls . nil)
  949. (ess-align-arguments-in-calls . ,(default-value 'ess-align-arguments-in-calls))
  950. (ess-align-continuations-in-calls . nil)
  951. (ess-align-blocks . nil)
  952. (ess-indent-from-lhs . (arguments))
  953. (ess-indent-from-chain-start . ,(default-value 'ess-indent-from-chain-start))
  954. (ess-indent-with-fancy-comments . nil))
  955. (RStudio-
  956. (ess-indent-offset . ,(default-value 'ess-indent-offset))
  957. (ess-offset-arguments . prev-line)
  958. (ess-offset-arguments-newline . prev-line)
  959. (ess-offset-block . ,(default-value 'ess-offset-block))
  960. (ess-offset-continued . ,(default-value 'ess-offset-continued))
  961. (ess-align-nested-calls . nil)
  962. (ess-align-arguments-in-calls . ,(default-value 'ess-align-arguments-in-calls))
  963. (ess-align-continuations-in-calls . nil)
  964. (ess-align-blocks . nil)
  965. (ess-indent-from-lhs . (arguments))
  966. (ess-indent-from-chain-start . ,(default-value 'ess-indent-from-chain-start))
  967. (ess-indent-with-fancy-comments . nil))
  968. (DEFAULT
  969. (ess-indent-offset . ,(default-value 'ess-indent-offset))
  970. (ess-offset-arguments . ,(default-value 'ess-offset-arguments))
  971. (ess-offset-arguments-newline . ,(default-value 'ess-offset-arguments-newline))
  972. (ess-offset-block . ,(default-value 'ess-offset-block))
  973. (ess-offset-continued . ,(default-value 'ess-offset-continued))
  974. (ess-align-nested-calls . ,(default-value 'ess-align-nested-calls))
  975. (ess-align-arguments-in-calls . ,(default-value 'ess-align-arguments-in-calls))
  976. (ess-align-continuations-in-calls . ,(default-value 'ess-align-continuations-in-calls))
  977. (ess-align-blocks . ,(default-value 'ess-align-blocks))
  978. (ess-indent-from-lhs . ,(default-value 'ess-indent-from-lhs))
  979. (ess-indent-from-chain-start . ,(default-value 'ess-indent-from-chain-start))
  980. (ess-indent-with-fancy-comments . ,(default-value 'ess-indent-with-fancy-comments))))
  981. "Predefined formatting styles for ESS code.
  982. Use `ess-set-style' to apply a style in all R buffers. The values of
  983. all styles except OWN are fixed. To change the value of variables
  984. in the OWN group, customize the variable `ess-own-style-list'.
  985. DEFAULT style picks default (aka global) values from ESS
  986. indentation variables. In addition, ESS provides many indentation
  987. styles, the most important being the RRR and the RStudio
  988. variants.
  989. RRR is the common R style that adheres closely to R internal
  990. standards. RRR+ is the same except it also aligns blocks in
  991. function calls with the opening delimiter, producing more
  992. indentation. The C++ style (named like this for historical
  993. reasons rather than any resemblance to existing C++ indentation
  994. schemes) is halfway between these two styles and indent block
  995. arguments from the start of the surrounding function's name.
  996. The RStudio style closely mimics the indentation of the RStudio
  997. editor. RStudio- is the same except it does not align arguments
  998. in function calls, which corresponds to the settings of some
  999. RStudio users.
  1000. ESS indentation is fully specified by the following offsets and
  1001. variables. See the documentation of these variables for examples.
  1002. Offsets:
  1003. - `ess-indent-offset': main offset inherited by other settings
  1004. - `ess-offset-arguments': offset type for function and bracket
  1005. arguments
  1006. - `ess-offset-arguments-newline': offset type of arguments
  1007. when ( or [ is followed by a new line.
  1008. - `ess-offset-block': offset type for brace and anonymous
  1009. parenthesis blocks
  1010. - `ess-offset-continued': offset type for continuation lines in
  1011. multiline statements
  1012. Overrides (implies vertical alignment):
  1013. - `ess-align-nested-calls': functions whose nested calls
  1014. should be aligned.
  1015. - `ess-align-arguments-in-calls': calls where
  1016. `ess-offset-arguments' should be ignored
  1017. - `ess-align-continuations-in-calls': whether to ignore
  1018. `ess-offset-continued' in calls.
  1019. - `ess-align-blocks': whether to ignore `ess-offset-blocks' for
  1020. function declarations or control flow statements.
  1021. Control variables:
  1022. - `ess-indent-from-lhs': whether to indent arguments from
  1023. left-hand side of an assignment or parameter declaration.
  1024. - `ess-indent-from-chain-start': whether to indent arguments from
  1025. the first of several consecutive calls.
  1026. - `ess-indent-with-fancy-comments': whether to indent #, ## and
  1027. ### comments distinctly.")
  1028. (defun ess-add-style (key entries)
  1029. "Add a new style to `ess-style-list'.
  1030. The new style has KEY and ENTRIES. Remove any existing entry with
  1031. the same KEY before adding the new one."
  1032. (setq ess-style-alist (assq-delete-all key ess-style-alist))
  1033. (add-to-list 'ess-style-alist (cons key entries)))
  1034. (defcustom ess-own-style-list (cdr (assoc 'RRR ess-style-alist))
  1035. "Indentation variables for your own style.
  1036. Set `ess-style' to 'OWN to use these values. To change
  1037. these values, use the customize interface. See the documentation
  1038. of each variable for its meaning."
  1039. :group 'ess-edit
  1040. :type 'alist
  1041. :initialize 'custom-initialize-set
  1042. :set (lambda (symbol value)
  1043. (set symbol value)
  1044. (ess-add-style 'OWN value)))
  1045. ;;;###autoload
  1046. (put 'ess-style 'safe-local-variable #'symbolp)
  1047. (define-obsolete-variable-alias 'ess-default-style 'ess-style "ESS 19.04")
  1048. (defcustom ess-style 'RRR
  1049. "Current ESS indentation style, see `ess-style-alist' for more.
  1050. See the variable `ess-style-alist' for how these groups (RRR,
  1051. DEFAULT, GNU, BSD, ...) map onto different settings for
  1052. variables. OWN style is defined in `ess-own-style-list' and you
  1053. can customize it to your needs. DEFAULT style picks default (aka
  1054. global) values from ESS indentation variables.
  1055. Prefer `ess-set-style' to set the current style. This variable
  1056. has an effect if set before a buffer is visited (e.g. in your
  1057. Emacs initialization file) or as a file or directory local
  1058. variable (see Info node `(Emacs) File Variables'."
  1059. :type '(choice (const OWN)
  1060. (const GNU)
  1061. (const BSD)
  1062. (const C++)
  1063. (const CLB)
  1064. (const K&R)
  1065. (const RRR)
  1066. (const RRR+)
  1067. (const RStudio)
  1068. (const RStudio-)
  1069. (const DEFAULT))
  1070. :group 'ess-edit
  1071. :safe #'symbolp)
  1072. ;;*;; Variables controlling behavior of dump files
  1073. (defcustom ess-source-directory
  1074. (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") temporary-file-directory)
  1075. "Directory in which to place dump files.
  1076. This can be a string (an absolute directory name ending in a slash) or
  1077. a lambda expression of no arguments which will return a suitable string
  1078. value. The lambda expression is evaluated with the process buffer as the
  1079. current buffer.
  1080. This always dumps to a sub-directory (\".Src\") of the current ess
  1081. working directory (i.e. first elt of search list)."
  1082. :group 'ess-edit
  1083. :type 'directory
  1084. :package-version '(ess . "18.10"))
  1085. (defvar ess-dump-filename-template nil
  1086. "Internal. Initialized by dialects.")
  1087. (defcustom ess-dump-filename-template-proto (concat (user-login-name) ".%s.S")
  1088. "Prototype template for filenames of dumped objects.
  1089. The ending `S' is replaced by the current \\[ess-suffix], to give
  1090. `ess-dump-filename-template' when an inferior ESS process starts.
  1091. By default, gives filenames like `user.foofun.S', so as not to clash with
  1092. other users if you are using a shared directory. Other alternatives:
  1093. \"%s.S\" ; Don't bother uniquifying if using your own directory(ies)
  1094. \"dumpdir\"; Always dump to a specific filename. This makes it impossible
  1095. to edit more than one object at a time, though.
  1096. (make-temp-name \"scr.\") ; Another way to uniquify"
  1097. ;; MM: The last 3-4 lines above suck (I don't understand them) -- FIXME --
  1098. :group 'ess-edit
  1099. :type 'string)
  1100. (defcustom ess-pre-run-hook nil
  1101. "Hook to call before starting up ESS.
  1102. Good for setting up your directory."
  1103. :group 'ess-hooks
  1104. :type 'hook)
  1105. (defcustom ess-post-run-hook nil
  1106. "Hook to call just after the ESS process starts up.
  1107. Good for evaluating ESS code."
  1108. :group 'ess-hooks
  1109. :type 'hook)
  1110. (defcustom ess-send-input-hook nil
  1111. "Hook called just before line input is sent to the process."
  1112. :group 'ess-hooks
  1113. :type 'hook)
  1114. ;; ---- ./ess-roxy.el : ------------
  1115. (defcustom ess-roxy-package "roxygen2"
  1116. "The name of the R package to use for Roxygen."
  1117. :group 'ess-roxy
  1118. :type 'string)
  1119. (defcustom ess-roxy-tags-noparam '("export" "noRd")
  1120. "The tags used in roxygen fields that can be used alone.
  1121. Used to decide highlighting and tag completion."
  1122. :group 'ess-roxy
  1123. :type '(repeat string))
  1124. (defcustom ess-roxy-tags-param '("author" "aliases" "concept" "details"
  1125. "examples" "format" "keywords"
  1126. "method" "exportMethod"
  1127. "name" "note" "param"
  1128. "include" "references" "return"
  1129. "seealso" "source" "docType"
  1130. "title" "TODO" "usage" "import"
  1131. "exportClass" "exportPattern" "S3method"
  1132. "inheritParams"
  1133. "importFrom" "importClassesFrom"
  1134. "importMethodsFrom" "useDynLib"
  1135. "rdname" "section" "slot" "description"
  1136. "md" "eval")
  1137. "The tags used in roxygen fields that require a parameter.
  1138. Used to decide highlighting and tag completion."
  1139. :group 'ess-roxy
  1140. :type '(repeat string))
  1141. (defcustom ess-roxy-template-alist
  1142. (list (cons "description" ".. content for \\description{} (no empty lines) ..")
  1143. (cons "details" ".. content for \\details{} ..")
  1144. (cons "title" "")
  1145. (cons "param" "")
  1146. (cons "return" "")
  1147. (cons "author" ess-user-full-name))
  1148. "The tags and defaults to insert when creating empty templates.
  1149. Param is a place holder for where to enter
  1150. parameters. Description and details do not use @ tags, but are
  1151. instead placed at the beginning of the entry (and should
  1152. therefore also be at the beginning of this template to give
  1153. syntactically correct roxygen entries)"
  1154. :group 'ess-roxy
  1155. :type '(alist :key-type string :value-type string))
  1156. (defcustom ess-roxy-fill-param-p nil
  1157. "Non-nil causes parameter descriptions to be filled (word-wrapped) upon `ess-roxy-update-entry'."
  1158. :group 'ess-roxy
  1159. :type '(choice (const :tag "Off" nil)
  1160. (const :tag "On" t)))
  1161. (defcustom ess-roxy-hide-show-p nil
  1162. "Non-nil means ess-roxy uses function `hs-minor-mode' for block hiding with TAB."
  1163. :group 'ess-roxy
  1164. :type '(choice (const :tag "Off" nil)
  1165. (const :tag "On" t)))
  1166. (defcustom ess-roxy-start-hidden-p nil
  1167. "Non-nil means all blocks should be hidden from start."
  1168. :group 'ess-roxy
  1169. :type '(choice (const :tag "Off" nil)
  1170. (const :tag "On" t)))
  1171. (defcustom ess-roxy-str "##'"
  1172. "Prefix string to insert before each line in new roxygen blocks.
  1173. In existing roxygen blocks, the prefix is taken from the line at
  1174. point"
  1175. :group 'ess-roxy
  1176. :type 'string)
  1177. (defvar ess-roxy-insert-prefix-on-newline t
  1178. "When non-nil, `ess-roxy-newline-and-indent' makes newlines start with the roxy prefix.")
  1179. ; System variables
  1180. ;; SJE -- this should not be defcustom - user does not set it.
  1181. (defvaralias 'ess-current-process-name 'ess-local-process-name)
  1182. (defvar-local ess-local-process-name nil
  1183. "The name of the ESS process associated with the current buffer.")
  1184. (put 'ess-local-process-name 'risky-local-variable t)
  1185. (put 'ess-local-process-name 'permanent-local t)
  1186. (defcustom ess-switch-to-end-of-proc-buffer t
  1187. "If non-nil, `ess-switch-to-inferior-or-script-buffer' goes to the end of the process buffer."
  1188. :group 'ess
  1189. :type 'boolean)
  1190. (defcustom ess-gen-proc-buffer-name-function 'ess-gen-proc-buffer-name:project-or-simple
  1191. "Function used for generation of the buffer name of the new ESS processes.
  1192. It should accept one argument PROC-NAME, a string specifying
  1193. internal process name (R, R:2, etc).
  1194. Provided default options are:
  1195. `ess-gen-proc-buffer-name:simple'
  1196. *proc*
  1197. `ess-gen-proc-buffer-name:directory'
  1198. *proc:dir*
  1199. `ess-gen-proc-buffer-name:abbr-long-directory'
  1200. *proc:abbr-long-dir*
  1201. `ess-gen-proc-buffer-name:project-or-simple'
  1202. *proc:project-root* or *proc*
  1203. `ess-gen-proc-buffer-name:project-or-directory'
  1204. *proc:project-root* or *proc:dir*
  1205. Strategies based on projects default to built-in strategies if
  1206. there is no project root in the current directory."
  1207. :group 'ess
  1208. :type '(choice (const :tag "*proc*" ess-gen-proc-buffer-name:simple)
  1209. (const :tag "*proc:dir*" ess-gen-proc-buffer-name:directory)
  1210. (const :tag "*proc:abbr-long-dir*" ess-gen-proc-buffer-name:abbr-long-directory)
  1211. (const :tag "*proc:project-root* or *proc*" ess-gen-proc-buffer-name:project-or-simple)
  1212. (const :tag "*proc:project-root* or *proc:dir*" ess-gen-proc-buffer-name:project-or-directory)
  1213. function)
  1214. :package-version '(ess . "19.04"))
  1215. (defcustom ess-kermit-command "gkermit -T"
  1216. "Kermit command invoked by `ess-kermit-get' and `ess-kermit-send'."
  1217. :group 'ess
  1218. :type 'string)
  1219. (defcustom ess-kermit-prefix "#"
  1220. "String files must begin with to use kermit file transfer."
  1221. :group 'ess
  1222. :type 'string)
  1223. (defcustom ess-kermit-remote-directory "."
  1224. "Buffer local variable that designates remote directory of file."
  1225. :group 'ess
  1226. :type 'string)
  1227. (make-variable-buffer-local 'ess-kermit-remote-directory)
  1228. ;;*;; Regular expressions
  1229. ;; -- Note: Some variables not-to-customize moved to ./ess-mode.el :
  1230. ;; ess-r-set-function-start
  1231. ;; Fixme: the following is just for S dialects :
  1232. (defcustom ess-dumped-missing-re
  1233. "\\(<-\nDumped\n\\'\\)\\|\\(<-\\(\\s \\|\n\\)*\\'\\)"
  1234. "If a dumped object's buffer matches this re, then it is replaced by `ess-function-template'."
  1235. :group 'ess
  1236. :type 'regexp)
  1237. (defcustom ess-dump-error-re
  1238. (if (string= ess-language "S") "\nDumped\n\\'"
  1239. "[Ee]rror")
  1240. "Regexp used to detect an error when loading a file."
  1241. :group 'ess
  1242. :type 'regexp)
  1243. ; ess-inf: variables for inferior-ess.
  1244. (defvar inferior-ess-own-frame nil
  1245. "Non-nil means that inferior ESS buffers should start in their own frame.
  1246. This variable is deprecated.
  1247. please add an entry to `display-buffer-alist' instead. See Info
  1248. node `(ess)Customizing startup'. For example:
  1249. \(add-to-list 'display-buffer-alist
  1250. '(\"*R\"
  1251. (display-buffer-reuse-window display-buffer-pop-up-frame)))")
  1252. (make-obsolete-variable 'inferior-ess-own-frame 'display-buffer-alist "ESS 19.04")
  1253. (make-obsolete-variable 'inferior-ess-frame-alist "It is ignored. Use `display-buffer-alist' and `pop-up-frame-alist' instead." "ESS 19.04")
  1254. (make-obsolete-variable 'inferior-ess-same-window 'display-buffer-alist "ESS 19.04")
  1255. (defcustom inferior-ess-jit-lock-chunk-size 10000
  1256. "Default for (buffer local) `jit-lock-chunk-size' in inferior ESS buffers."
  1257. :group 'ess-proc
  1258. :type 'integer)
  1259. (defvaralias 'inferior-R-program 'inferior-ess-r-program)
  1260. (define-obsolete-variable-alias 'inferior-R-program-name
  1261. 'inferior-ess-r-program "ESS 18.10")
  1262. (define-obsolete-variable-alias 'inferior-ess-r-program-name
  1263. 'inferior-ess-r-program "ESS 18.10")
  1264. (defcustom inferior-ess-r-program (if ess-microsoft-p
  1265. "Rterm"
  1266. "R")
  1267. "Program name for invoking an inferior ESS with \\[R]."
  1268. :group 'ess-R
  1269. :type '(choice (string) file))
  1270. (defcustom inferior-R-args ""
  1271. "String of arguments used when starting R.
  1272. See also `ess-R-readline'."
  1273. :group 'ess-R
  1274. :type 'string)
  1275. (defcustom ess-R-readline nil
  1276. "When non-nil, use readline in R.
  1277. nil indicates that \"--no-readline \" should be used as argument
  1278. when starting R. This may very slightly speedup interaction. On
  1279. the other hand, readline is necessary for expansion of
  1280. \"~username/\" in paths. Note that readline interprets
  1281. tabs (tabular characters) in R source files as asking for file
  1282. name completion. This can mess up evaluation completely."
  1283. :group 'ess-R
  1284. :type 'boolean)
  1285. (defcustom inferior-STA-start-args ""
  1286. "String of switches used when starting Stata.
  1287. Also see `inferior-STA-program'."
  1288. :group 'ess-Stata
  1289. :type 'string)
  1290. (defvaralias 'inferior-R-objects-command 'inferior-ess-r-objects-command)
  1291. (defcustom inferior-ess-r-objects-command "print(objects(pos=%d, all.names=TRUE), max=1e6)\n"
  1292. "Format string for R command to get a list of objects at position %d.
  1293. Used in e.g., \\[ess-execute-objects] or \\[ess-display-help-on-object]."
  1294. :group 'ess-command
  1295. :type 'string)
  1296. (defvar ess-getwd-command nil
  1297. "Command string retrieving the working directory from the process.")
  1298. (defvar ess-setwd-command nil
  1299. "Command string to set working directory.
  1300. Should contain a formatting %s to be replaced by a
  1301. path (as in 'setwd(%s)\\n'.")
  1302. (defcustom ess-program-files ;; 32 bit version
  1303. (if (and ess-microsoft-p
  1304. (fboundp 'w32-short-file-name))
  1305. (if (getenv "ProgramW6432")
  1306. (w32-short-file-name (getenv "ProgramFiles(x86)"));; always 32 on 64 bit OS
  1307. (w32-short-file-name (getenv "ProgramFiles"))) ;; always 32 on 32 bit OS
  1308. nil)
  1309. "Safe (no embedded blanks) 8.3 name for 32-bit programs that works across internationalization."
  1310. :group 'ess
  1311. :type '(choice (string) (const nil)))
  1312. (defcustom ess-program-files-64 ;; 64 bit version
  1313. (when (and ess-microsoft-p (fboundp 'w32-short-file-name) (getenv "ProgramW6432"))
  1314. (w32-short-file-name (getenv "ProgramW6432")))
  1315. "Safe (no embedded blanks) 8.3 name for 64-bit programs that works across internationalization."
  1316. :group 'ess
  1317. :type '(choice (string) (const nil)))
  1318. (defcustom ess-directory-containing-R nil
  1319. "When non-nil, a directory containing R.
  1320. nil means the search for all occurrences of R on the machine will
  1321. use the default location of the R directory
  1322. (inside \"c:/Program Files\" in English locale Windows systems).
  1323. Non-nil values mean use the specified location as the
  1324. directory in which \"R/\" is located. For example, setting
  1325. `ess-directory-containing-R' to \"c:\" will tell ESS to search
  1326. for R versions with path names of the form \"c:/R/R-x.y.z\".
  1327. Currently only used when `ess-microsoft-p'. If you change the
  1328. value of this variable, you need to restart Emacs for it to take
  1329. effect. It also needs to be set before you load ess-site as its
  1330. value is used once only when ESS is loaded."
  1331. :group 'ess
  1332. :type '(choice (directory) (const nil)))
  1333. (defcustom ess-rterm-version-paths nil
  1334. "Stores the full path file names of Rterm versions computed via \\[ess-find-rterm].
  1335. If you have versions of R in locations other than in
  1336. ../../R-*/bin/Rterm.exe or ../../rw*/bin/Rterm.exe, relative to
  1337. the directory in the variable `exec-path' containing your default
  1338. location of Rterm, you will need to redefine this variable with a
  1339. `custom-set-variables' statement in your site-start.el or .emacs
  1340. file."
  1341. :group 'ess-R
  1342. :type '(repeat string))
  1343. (define-obsolete-variable-alias 'inferior-S3-program-name
  1344. 'inferior-S3-program "ESS 18.10")
  1345. (defcustom inferior-S3-program "/disk05/s/S"
  1346. "Program name for invoking an inferior ESS with S3()."
  1347. :group 'ess-S
  1348. :type 'string)
  1349. (define-obsolete-variable-alias
  1350. 'inferior-S-elsewhere-program-name
  1351. 'inferior-S-elsewhere-program "ESS 18.10")
  1352. (defcustom inferior-S-elsewhere-program "sh"
  1353. "Program name to invoke an inferior ESS with S on a different computer."
  1354. :group 'ess-proc
  1355. :type 'string)
  1356. (defvaralias 'S+6-dialect-name 'S+-dialect-name)
  1357. (defcustom S+-dialect-name "S+"
  1358. "Name of 'dialect' for S-PLUS 6.x and later.
  1359. Easily changeable in a user's `.emacs'."
  1360. :group 'ess-SPLUS
  1361. :type 'string)
  1362. (define-obsolete-variable-alias 'inferior-S+-program-name
  1363. 'inferior-S+-program "ESS 18.10")
  1364. (defcustom inferior-S+-program
  1365. (if ess-microsoft-p
  1366. (concat ess-program-files "/TIBCO/splus82/cmd/Splus.exe")
  1367. "Splus")
  1368. "Program name to invoke S+.
  1369. On Unix/Linux, use the Splus executable. On Windows, the default
  1370. value is correct for a default installation of S-Plus 8.1 and
  1371. with bash as the shell. For any other version or location,
  1372. change this value in ess-site.el or site-start.el. Use the 8.3
  1373. version of the path name. Use double backslashes if you use the
  1374. msdos shell."
  1375. :group 'ess-SPLUS
  1376. :type '(choice (string) (file)))
  1377. (defvaralias 'inferior-S+6-start-args 'inferior-S+-start-args)
  1378. (defvaralias 'inferior-Splus-args 'inferior-S+-start-args)
  1379. (defcustom inferior-S+-start-args ""
  1380. "String of arguments used when starting S.
  1381. These arguments are currently passed only to S+6 and higher."
  1382. :group 'ess-SPLUS
  1383. :type 'string)
  1384. (defcustom inferior-Splus-objects-command "objects(where=%d)\n"
  1385. "Format string for R command to get a list of objects at position %d.
  1386. Used in e.g., \\[ess-execute-objects] or \\[ess-display-help-on-object]."
  1387. :group 'ess-command
  1388. :type 'string)
  1389. (defcustom ess-S-quit-kill-buffers-p nil
  1390. "Controls whether S buffers should also be killed once a process is killed.
  1391. This is used only when an iESS process is killed using \\[ess-quit].
  1392. Possible values:
  1393. nil - do not kill any S buffers associated with the process.
  1394. t - kill S buffers associated with the process.
  1395. ask - ask the user whether the S buffers should be killed."
  1396. :group 'ess-S
  1397. :type '(choice (const nil) (const t) (const ask)))
  1398. (define-obsolete-variable-alias 'inferior-SAS-program-name
  1399. 'inferior-SAS-program "ESS 18.10")
  1400. (defcustom inferior-SAS-program "sas"
  1401. "Program name for invoking an inferior ESS with SAS()."
  1402. :group 'ess-sas
  1403. :type '(choice (string) (file)))
  1404. (define-obsolete-variable-alias 'inferior-STA-program-name
  1405. 'inferior-STA-program "ESS 18.10")
  1406. (defcustom inferior-STA-program "stata"
  1407. "Program name for invoking an inferior ESS with stata().
  1408. This is NOT Stata, because we need to call Stata with TERM=emacs in
  1409. order for it to work right. And Emacs is too smart for it."
  1410. :group 'ess-Stata
  1411. :type '(choice (string) (file)))
  1412. (defvaralias 'R-editor 'ess-r-editor)
  1413. (defcustom ess-r-editor "emacsclient"
  1414. "Editor called by R process with 'edit()' command."
  1415. :group 'ess
  1416. :type 'string)
  1417. (defvaralias 'R-pager 'ess-r-pager)
  1418. (defcustom ess-r-pager 'nil ; Usually nil is correct as ESS and page() cooperate.
  1419. "Pager called by R process with 'page()' command."
  1420. :group 'ess
  1421. :type '(choice (const nil) string))
  1422. (defcustom S-editor "emacsclient"
  1423. "Editor called by S process with 'edit()' command."
  1424. :group 'ess
  1425. :type 'string)
  1426. (defcustom S-pager
  1427. (if ess-microsoft-p "emacsclientw.exe" "emacsclient")
  1428. "Pager called by S process with 'page()' command."
  1429. :group 'ess
  1430. :type 'string)
  1431. (defvar-local ess-editor nil
  1432. "Editor by which the process sends information to an Emacs buffer
  1433. for editing and then to be returned to the process.")
  1434. (defvar-local ess-pager nil
  1435. "Pager by which the process sends information to an Emacs buffer.")
  1436. (defvar-local inferior-ess-language-start nil
  1437. "Initialization commands sent to the ESS process.")
  1438. (define-obsolete-variable-alias 'inferior-ess-program-name
  1439. 'inferior-ess-program "ESS 18.10")
  1440. (defvar-local inferior-ess-program nil
  1441. "Default program name for invoking `inferior-ess'.
  1442. The other variables ...-program should be changed, for the
  1443. corresponding program.")
  1444. (make-obsolete-variable 'inferior-ess-start-args
  1445. "Use the language specific variables like `inferior-R-args'"
  1446. "ESS 19.04")
  1447. (defvar inferior-ess-start-args ""
  1448. "String of arguments passed to the ESS process.
  1449. If you wish to pass arguments to a process, see e.g. `inferior-R-args'.")
  1450. (defcustom inferior-ess-pager (if ess-microsoft-p "console" "cat")
  1451. "Pager to use for reporting help files and similar things."
  1452. :group 'ess-proc
  1453. :type 'string)
  1454. (defvar-local inferior-ess-primary-prompt "> "
  1455. "Regular expression used by `ess-mode' to detect the primary prompt.")
  1456. (defvar-local inferior-ess-secondary-prompt nil
  1457. "Regular expression used by ess-mode to detect the secondary prompt.
  1458. This is issued by S to continue an incomplete expression.
  1459. Set to nil if language doesn't support secondary prompt.")
  1460. (defvar ess-traceback-command nil
  1461. "Command to generate error traceback.")
  1462. ;; Need this to recognize prompts of the form + + + > > >
  1463. ;; and "+ . + ", but not "Abcd. "
  1464. (defvar inferior-S-prompt "[]a-zA-Z0-9.[]*[>+] \\(?:[>+.] \\)*"
  1465. "Regexp used in S and R inferior and transcript buffers for prompt navigation.
  1466. Must not be anchored to BOL.")
  1467. ;;*;; Variables controlling interaction with the ESS process
  1468. (defcustom ess-execute-in-process-buffer nil
  1469. "Non-nil means the ess-execute- commands output to the process buffer.
  1470. Otherwise, they get their own temporary buffer."
  1471. :group 'ess-proc
  1472. :type 'boolean)
  1473. (defcustom ess-eval-empty nil
  1474. "Non-nil means `ess-eval-line*' will send empty lines to the ESS process."
  1475. :group 'ess-proc
  1476. :type 'boolean)
  1477. (defvaralias 'ess-eval-visibly-p 'ess-eval-visibly)
  1478. (defcustom ess-eval-visibly t
  1479. "Non-nil means ess-eval- commands display commands in the process buffer.
  1480. If t, ESS waits after each line of the command for the process
  1481. output. This results in a nice sequence of input and output but
  1482. stalls Emacs on long output (like Sys.sleep(5) in R).
  1483. If 'nowait, ESS still shows the input commands, but don't wait
  1484. for the process. Thus all the output is printed after the input
  1485. lines.
  1486. If nil, ESS doesn't print input commands and doesn't wait for the process.
  1487. This variable also affect the evaluation of input code in
  1488. iESS. The effect is similar to the above. If t then ess waits for
  1489. the process output, otherwise not."
  1490. :group 'ess-proc
  1491. :type '(choice (const t) (const nowait) (const nil)))
  1492. (defcustom ess-eval-deactivate-mark (fboundp 'deactivate-mark); was nil till 2010-03-22
  1493. "Non-nil means that after ess-eval- commands the mark is deactivated."
  1494. :group 'ess-proc
  1495. :type 'boolean)
  1496. (defcustom ess-use-R-completion t
  1497. "Non-nil means use R-builtin completion mechanism when available."
  1498. :group 'ess-proc
  1499. :type 'boolean)
  1500. (defcustom ess-sleep-for-shell (if ess-microsoft-p 5 1)
  1501. "Pause before sending output to the shell."
  1502. :group 'ess-proc
  1503. :type 'number)
  1504. ; System variables
  1505. ;; VS[06-04-2016]: fixme: move all inf vars into ess-inf.el.
  1506. ;;*;; Variables relating to multiple processes
  1507. (defvar-local ess--mode-line-process-indicator '("" ess-local-process-name)
  1508. "List of ESS mode-line indicators.
  1509. Local in process buffers and must start with a string. Changes of
  1510. this variable are automatically reflected in mode-lines of the
  1511. process and all associated with it buffers.
  1512. Each symbol must evaluate to one of the standard mode line
  1513. objects. See info node `(elisp)Mode Line Data'). Add a symbol
  1514. with `add-to-list' and remove with `delq'. Note that the symbols
  1515. which are part of this list should better have
  1516. 'risky-local-variable property set to t, otherwise the text
  1517. properties are not displayed.
  1518. External utilities such as `ess-tracebug' and `ess-developer'
  1519. customize this variable to indicate changes in the process
  1520. status.
  1521. ")
  1522. (put 'ess--mode-line-process-indicator 'risky-local-variable t)
  1523. (defvar-local ess--local-mode-line-process-indicator '("")
  1524. "List of local process indicators.
  1525. See `ess--mode-line-process-indicator' for how to set it.
  1526. This is an internal variable used by tools like `ess-developer'
  1527. and `ess-tracebug'.")
  1528. (put 'ess--local-mode-line-process-indicator 'risky-local-variable t)
  1529. ;;*;; Inferior ESS commands
  1530. (defvar-local ess-load-command "source('%s')\n"
  1531. "Dialect specific format-string for building the ess command to load a file.
  1532. This format string should use %s to substitute a file name and should
  1533. result in an ESS expression that will command the inferior ESS to load
  1534. that file.")
  1535. (defvar-local ess-eval-command nil
  1536. "Dialect specific format-string for building the command to evaluate a string.
  1537. It is usually faster to send a string to remote processes than a
  1538. file. The latter involves Tramp and can be quite slow. When
  1539. possible, a dialect should implement that command and use it
  1540. preferentially.
  1541. This format string should use %s as a placeholder for the string
  1542. to be evaluated and, optionally, %f for the file name to be
  1543. reported in the error references.
  1544. The resulting command should not echo code or print any
  1545. transitory output. See also `ess-eval-visibly-command' and
  1546. `ess-eval-visibly-noecho-command'.")
  1547. (defvar-local ess-build-eval-message-function nil
  1548. "Dialect-specific function for formatting an evaluation message.")
  1549. (defcustom inferior-ess-dump-command "dump(\"%s\",file=\"%s\")\n"
  1550. "Format-string for building the ess command to dump an object into a file.
  1551. Use first %s to substitute an object name.
  1552. Use second %s to substitute the dump file name."
  1553. :group 'ess-command
  1554. :type 'string)
  1555. (defvar-local inferior-ess-help-command "help(\"%s\")\n"
  1556. "Format-string for building the ESS command to ask for help on an object.
  1557. This format string should use %s to substitute an object name.")
  1558. (defcustom inferior-ess-r-help-command ".ess.help('%s')\n"
  1559. "Format-string for building the R command to ask for help on an object.
  1560. This format string should use %s to substitute an object name.
  1561. If set, changes will take effect when next R session is started."
  1562. :group 'ess-command
  1563. :type 'string)
  1564. (defvar-local inferior-ess-exit-command "q()\n"
  1565. "Format-string for building the ess command to exit.
  1566. This format string should use %s to substitute an object name.")
  1567. (defvar-local inferior-ess-search-list-command nil
  1568. "`ess-language' command that prints out the search list;
  1569. i.e. the list of directories and (recursive) objects that `ess-language' uses
  1570. when it searches for objects.
  1571. Really set in <ess-lang>-customize-alist in ess[dl]-*.el")
  1572. (defcustom inferior-ess-safe-names-command
  1573. "tryCatch(base::print(base::names(%s), max=1e6), error=function(e){})\n"
  1574. "Format string for ESS command to extract names from an object *safely*.
  1575. %s is replaced by an \"object name\" -- usually a list or data
  1576. frame, but in R also e.g., 'package:stats'."
  1577. :group 'ess-command
  1578. :type 'string)
  1579. ;;*;; Regular expressions
  1580. (defvar-local inferior-ess-prompt nil
  1581. "The regular expression used for recognizing prompts.
  1582. It is always used in transcript mode. In inferior ess mode it is
  1583. used only if `comint-use-prompt-regexp' is t.
  1584. If not set in language's customize-alist it is constructed at run time
  1585. from `inferior-ess-primary-prompt' and `inferior-ess-secondary-prompt'.")
  1586. (defvar-local ess-change-sp-regexp ""
  1587. "The regexp for matching the S/R/.. commands that change the search path.")
  1588. (defvar ess-S+-change-sp-regexp
  1589. "\\(attach(\\([^)]\\|$\\)\\|detach(\\|collection(\\|library(\\|module(\\|source(\\)"
  1590. "The regexp for matching the S-plus commands that change the search path.")
  1591. (defvaralias 'ess-R-change-sp-regexp 'ess-r-change-sp-regexp)
  1592. (defvar ess-r-change-sp-regexp
  1593. "\\(attach(\\([^)]\\|$\\)\\|detach(\\|library(\\|require(\\|source(\\)"
  1594. "The regexp for matching the R commands that change the search path.")
  1595. ;;*;; Process-dependent variables
  1596. (defvar-local ess-sl-modtime-alist nil
  1597. "Alist of modification times for all ess directories accessed this session.")
  1598. (defvar-local ess-prev-load-dir/file nil
  1599. "This symbol saves the (directory . file) pair used in the last
  1600. `ess-load-file' command. Used for determining the default in the next one.")
  1601. (defvar-local ess-object-list nil
  1602. ;; This is a list of the currently known object names. It is
  1603. ;; current only for one command entry; it exists under the
  1604. ;; assumption that the list of objects doesn't change while entering
  1605. ;; a command.
  1606. "Cache of object names.")
  1607. (defvar-local ess-help-topics-list nil
  1608. ;; List of currently known help topics.
  1609. "Cache of help topics.")
  1610. ;;*;; Miscellaneous system variables
  1611. ;; SJE: Wed 29 Dec 2004 - following 3 ess-object* variables can be removed
  1612. ;; soon if no-one needs the completion code.
  1613. (defvar ess-object-name-db-file "ess-namedb"
  1614. "File containing definitions for `ess-object-name-db'.")
  1615. (defvar ess-object-name-db-file-loaded '()
  1616. "List of programs whose name-db file has been loaded.")
  1617. (defvar-local ess-object-name-db nil
  1618. "Alist of lists of object names, with directory names as keys.
  1619. The file ess-namedb.el is loaded (if it exists) to define this variable.
  1620. See also function `ess-create-object-name-db'.")
  1621. ;;;*;;; Font-lock support
  1622. ;; "Reserved Words" -- part 1 --
  1623. (defvar ess-RS-constants
  1624. '("TRUE" "FALSE" "NA" "NULL" "Inf" "NaN"))
  1625. (defvar ess-R-constants
  1626. (append ess-RS-constants
  1627. '("NA_integer_" "NA_real_" "NA_complex_" "NA_character_")))
  1628. (defvar ess-S-constants
  1629. (append ess-RS-constants
  1630. '("T" "F")))
  1631. (defvar ess-R-keywords
  1632. '("if" "else" "repeat" "while" "function" "for" "in" "next" "break"
  1633. "switch" "function" "return" "on.exit" "stop" ".Defunct" "tryCatch"
  1634. "withRestarts" "invokeRestart"
  1635. "recover" "browser")
  1636. "Reserved words or special functions in the R language.")
  1637. (defvar ess-S-keywords
  1638. (append ess-R-keywords '("terminate")))
  1639. ;; only some of these keywords "look like functions but are not":
  1640. (defvar ess-S-non-functions
  1641. '("if" "for" "function" "while"))
  1642. ;; first the common ones
  1643. (define-obsolete-variable-alias 'ess-S-modifyiers 'ess-S-modifiers "18.10")
  1644. (defvar ess-S-modifiers
  1645. '("library" "attach" "detach" "source" "module"
  1646. "message" "warning"))
  1647. (define-obsolete-variable-alias 'ess-R-modifyiers 'ess-R-modifiers "18.10")
  1648. (defvar ess-R-modifiers
  1649. '("library" "attach" "detach" "source" "require"
  1650. "setwd" "options" "par" "load" "rm"
  1651. "message" "warning" ".Deprecated"
  1652. "signalCondition" "withCallingHandlers"))
  1653. (defvar ess-R-message-prefixes
  1654. '("Error:" "Error in"
  1655. "Warning:" "Warning in"
  1656. "Warning messages"))
  1657. (defvar ess-S-message-prefixes
  1658. (append ess-R-message-prefixes
  1659. '("Syntax error:" "Dumped")))
  1660. (defvar ess-R-assign-ops
  1661. ;; don't want "=" here which is not only for assign
  1662. '("<<-" "<-" "->" "->>"))
  1663. (defvar ess-S-assign-ops ess-R-assign-ops)
  1664. (defvar ess-R-function-name-regexp
  1665. (concat "\\(" "\\sw+" "\\)"
  1666. "[ \t]*" "\\(<-\\)"
  1667. "[ \t\n]*" "function\\b"))
  1668. (defvar ess-S-function-name-regexp
  1669. ess-R-function-name-regexp)
  1670. (defvar ess-font-lock-keywords nil
  1671. "A name of the dialect specific font-lock keywords in the current buffer.
  1672. See `ess-R-font-lock-keywords' for an example. This is an
  1673. internal variable.")
  1674. (defvar ess-fl-keyword:fun-calls
  1675. (cons "\\(\\sw+\\)[\t ]*(" '(1 ess-function-call-face keep))
  1676. "Font lock for function calls.")
  1677. (defvar ess-fl-keyword:numbers
  1678. (cons "\\b\\.?[0-9]+[.eEL]?[0-9]*\\b" 'ess-numbers-face)
  1679. "Font lock for numbers.")
  1680. (defvar ess-fl-keyword:delimiters
  1681. (cons "\\s(\\|\\s)" 'ess-paren-face)
  1682. "Font lock for parenthesis.")
  1683. (defvar ess-fl-keyword:=
  1684. (cons "=" 'ess-paren-face)
  1685. "Font lock for equal sign (=).")
  1686. (defvar ess-fl-keyword:operators
  1687. (cons "[-=+></]+" 'ess-operator-face)
  1688. "Operators.")
  1689. (defvar ess-S-fl-keyword:modifiers
  1690. (cons (regexp-opt ess-S-modifiers 'words)
  1691. 'ess-modifiers-face) ; modify search list or source (i.e. directives)
  1692. "Font lock keyword R modifiers.")
  1693. (defvar ess-S-fl-keyword:fun-defs
  1694. (cons ess-S-function-name-regexp
  1695. '(1 font-lock-function-name-face t))
  1696. "Font-lock function definitions keyword.")
  1697. (defvar ess-S-fl-keyword:keywords
  1698. (cons (regexp-opt ess-S-keywords 'words) 'ess-keyword-face))
  1699. (defvar ess-S-fl-keyword:assign-ops
  1700. (cons (regexp-opt ess-S-assign-ops) 'ess-assignment-face)
  1701. "Font-lock assign operators.")
  1702. (defvar ess-S-fl-keyword:constants
  1703. (cons (regexp-opt ess-S-constants 'words) 'ess-constant-face)
  1704. "Font-lock constants keyword.")
  1705. (defcustom ess-S-font-lock-keywords
  1706. '((ess-S-fl-keyword:modifiers . t)
  1707. (ess-S-fl-keyword:fun-defs . t)
  1708. (ess-S-fl-keyword:keywords . t)
  1709. (ess-S-fl-keyword:assign-ops . t)
  1710. (ess-S-fl-keyword:constants . t)
  1711. (ess-fl-keyword:fun-calls)
  1712. (ess-fl-keyword:numbers)
  1713. (ess-fl-keyword:operators)
  1714. (ess-fl-keyword:delimiters)
  1715. (ess-fl-keyword:=))
  1716. "An alist of available font-lock keywords for the S mode.
  1717. The key of each cons cell is a name of the keyword. The value
  1718. should be t or nil to indicate if the keyword is activated by
  1719. default or not."
  1720. :group 'ess-S
  1721. :group 'ess-faces
  1722. :type '(repeat (cons symbol boolean)))
  1723. (defvar ess-R-fl-keyword:modifiers
  1724. '(eval . (cons (concat "\\(" (regexp-opt ess-R-modifiers 'words) "\\)\\s-*(")
  1725. '(1 ess-modifiers-face)))
  1726. "Font-lock keyword R modifiers.
  1727. See `ess-R-modifiers' for the list of modifiers.")
  1728. (defvar ess-R-fl-keyword:fun-defs
  1729. '(eval . (cons ess-R-function-name-regexp
  1730. '(1 font-lock-function-name-face nil)))
  1731. "Font-lock keyword for function names in function definitions.
  1732. When this keyword is on, function names on the left hand side of
  1733. <- are highlighted with `font-lock-function-name-face'.")
  1734. (defvar ess-R-fl-keyword:keywords
  1735. '(ess-r--find-fl-keyword . ess-keyword-face)
  1736. "Font lock keyword for `ess-R-keywords'.")
  1737. (defvar ess-R-fl-keyword:assign-ops
  1738. '(eval . (cons (regexp-opt ess-R-assign-ops) 'ess-assignment-face))
  1739. "Font-lock assign operators.
  1740. See `ess-R-assign-ops' for the ops.")
  1741. (defvar ess-R-fl-keyword:constants
  1742. '(eval . (cons (regexp-opt ess-R-constants 'words) 'ess-constant-face))
  1743. "Font-lock constants keyword.
  1744. See `ess-R-constants' for the list of constants.")
  1745. (defvar ess-R-fl-keyword:F&T
  1746. '("\\b[FT]\\b" . ess-constant-face)
  1747. "Highlight T and F in addition to TRUE and FALSE in R.")
  1748. (defvar ess-R-fl-keyword:%op% nil
  1749. "Highlight %op% operators.")
  1750. (defcustom ess-R-font-lock-keywords
  1751. '((ess-R-fl-keyword:keywords . t)
  1752. (ess-R-fl-keyword:constants . t)
  1753. (ess-R-fl-keyword:modifiers . t)
  1754. (ess-R-fl-keyword:fun-defs . t)
  1755. (ess-R-fl-keyword:assign-ops . t)
  1756. (ess-R-fl-keyword:%op% . t)
  1757. (ess-fl-keyword:fun-calls)
  1758. (ess-fl-keyword:numbers)
  1759. (ess-fl-keyword:operators)
  1760. (ess-fl-keyword:delimiters)
  1761. (ess-fl-keyword:=)
  1762. (ess-R-fl-keyword:F&T))
  1763. "An alist of available font-lock keywords for the R mode.
  1764. The key of each cons cell is a name of the keyword. The value
  1765. should be t or nil to indicate if the keyword is active or not."
  1766. :group 'ess-R
  1767. :group 'ess-faces
  1768. :type '(repeat (cons symbol boolean)))
  1769. (defvar ess-S-fl-keyword:prompt
  1770. (cons (concat "^" inferior-S-prompt) 'comint-highlight-prompt)
  1771. "Highlight prompts missed by comint.")
  1772. (defvar ess-fl-keyword:matrix-labels
  1773. ;; also matches subsetting
  1774. (cons "\\[,?[1-9][0-9]*,?\\]" 'ess-matrix-face)
  1775. "Matrix and vector numeric labels.")
  1776. (defvar ess-R-fl-keyword:messages
  1777. (cons (regexp-opt ess-R-message-prefixes 'enc-paren)
  1778. 'font-lock-warning-face)
  1779. "Inferior-ess problems or errors.")
  1780. (defvaralias 'inferior-R-font-lock-keywords 'inferior-ess-r-font-lock-keywords)
  1781. (defcustom inferior-ess-r-font-lock-keywords
  1782. '((ess-S-fl-keyword:prompt . t)
  1783. (ess-R-fl-keyword:keywords . t)
  1784. (ess-R-fl-keyword:constants . t)
  1785. (ess-R-fl-keyword:modifiers . t)
  1786. (ess-R-fl-keyword:messages . t)
  1787. (ess-R-fl-keyword:fun-defs . t)
  1788. (ess-R-fl-keyword:assign-ops . t)
  1789. (ess-fl-keyword:matrix-labels . t)
  1790. (ess-fl-keyword:fun-calls)
  1791. (ess-fl-keyword:numbers)
  1792. (ess-fl-keyword:operators)
  1793. (ess-fl-keyword:delimiters)
  1794. (ess-fl-keyword:=)
  1795. (ess-R-fl-keyword:F&T))
  1796. "Font-lock patterns used in `inferior-ess-r-mode' buffers.
  1797. The key of each cons cell is a name of the keyword. The value
  1798. should be t or nil to indicate if the keyword is active or not."
  1799. :group 'ess-R
  1800. :group 'ess-faces
  1801. :type '(repeat (cons symbol boolean)))
  1802. (defvar ess-S-fl-keyword:messages
  1803. (cons (regexp-opt ess-S-message-prefixes 'enc-paren)
  1804. 'font-lock-warning-face)
  1805. "Inferior-ess problems or errors.")
  1806. (defcustom inferior-S-font-lock-keywords
  1807. '((ess-S-fl-keyword:prompt . t)
  1808. (ess-S-fl-keyword:messages . t)
  1809. (ess-S-fl-keyword:modifiers . t)
  1810. (ess-S-fl-keyword:fun-defs . t)
  1811. (ess-S-fl-keyword:keywords . t)
  1812. (ess-S-fl-keyword:assign-ops . t)
  1813. (ess-S-fl-keyword:constants . t)
  1814. (ess-fl-keyword:fun-calls)
  1815. (ess-fl-keyword:numbers)
  1816. (ess-fl-keyword:operators)
  1817. (ess-fl-keyword:delimiters)
  1818. (ess-fl-keyword:=))
  1819. "Font-lock patterns used in inferior-S-mode buffers.
  1820. The key of each cons cell is a name of the keyword. The value
  1821. should be t or nil to indicate if the keyword is active by
  1822. default."
  1823. :group 'ess-S
  1824. :group 'ess-faces
  1825. :type '(repeat (cons symbol boolean)))
  1826. ;;;*;;; ess-help variables
  1827. ;; This will never need to be loaded independently of any of the other modules,
  1828. ;; but they can all call it so we may as well put it here.
  1829. (defcustom ess-help-pop-to-buffer t
  1830. "If non-nil ess-help buffers are given focus during the display.
  1831. If non-nil, `ess-display-help' uses `pop-to-buffer' to display
  1832. help, otherwise it uses `display-buffer', which does not select
  1833. the help window."
  1834. :group 'ess-help
  1835. :type 'boolean)
  1836. (defcustom ess-help-own-frame nil
  1837. "Controls whether ESS help buffers should start in a different frame.
  1838. Possible values are:
  1839. nil: Display help in current frame.
  1840. 'one: All help buffers are shown in one dedicated frame.
  1841. t: Each help buffer gets its own frame.
  1842. If this is non-nil,`ess-help-reuse-window' is ignored. The
  1843. parameters of the own frame are stored in
  1844. `ess-help-frame-alist'."
  1845. :group 'ess-help
  1846. :type '(choice (const :tag "Display in current frame" nil)
  1847. (const :tag "Display in one frame" one)
  1848. (const :tag "Always display in a new frame" t)))
  1849. (defcustom ess-help-reuse-window t
  1850. "If t, ESS tries to display new help buffers in the existing help window.
  1851. This variable is ignored if `ess-help-own-frame' is non-nil."
  1852. :type 'boolean
  1853. :group 'ess-help)
  1854. (defcustom ess-help-frame-alist default-frame-alist
  1855. "Alist of frame parameters used to create help frames.
  1856. This defaults to `default-frame-alist' and is used only when
  1857. the variable `ess-help-own-frame' is non-nil."
  1858. :group 'ess-help
  1859. :type 'alist
  1860. :package-version '(ess . "18.10"))
  1861. ; Faces
  1862. ;;;=====================================================
  1863. (defconst comint-highlight-prompt 'comint-highlight-prompt)
  1864. (defconst ess-function-call-face 'ess-function-call-face)
  1865. (defface ess-function-call-face
  1866. '((default (:slant normal :inherit font-lock-function-name-face)))
  1867. "Font Lock face used to highlight function calls in ess buffers."
  1868. :group 'ess-faces)
  1869. (defconst ess-numbers-face 'ess-numbers-face)
  1870. (defface ess-numbers-face
  1871. '((default (:slant normal :inherit font-lock-type-face)))
  1872. "Font Lock face used to highlight numbers in ess-mode buffers."
  1873. :group 'ess-faces)
  1874. (defconst ess-operator-face 'ess-operator-face)
  1875. (defface ess-operator-face
  1876. '((default (:inherit font-lock-constant-face)))
  1877. "Font Lock face for operators."
  1878. :group 'ess-faces)
  1879. (defconst ess-%op%-face 'ess-%op%-face)
  1880. (defface ess-%op%-face
  1881. '((default (:inherit ess-operator-face)))
  1882. "Font Lock face used to highlight %op% operators in ess-mode buffers."
  1883. :group 'ess-faces)
  1884. (defconst ess-assignment-face 'ess-assignment-face)
  1885. (defface ess-assignment-face
  1886. '((default (:inherit font-lock-constant-face)))
  1887. "Font lock face used to highlight assignment operators."
  1888. :group 'ess-faces)
  1889. (defconst ess-paren-face 'ess-paren-face)
  1890. (defface ess-paren-face
  1891. '((default (:inherit font-lock-constant-face)))
  1892. "Font lock face used to highlight parentheses."
  1893. :group 'ess-faces)
  1894. (defconst ess-operator-face 'ess-operator-face)
  1895. (defface ess-operator-face
  1896. '((default (:inherit font-lock-constant-face)))
  1897. "Font lock face used to highlight operators."
  1898. :group 'ess-faces)
  1899. (defconst ess-modifiers-face 'ess-modifiers-face)
  1900. (defface ess-modifiers-face
  1901. '((default (:inherit font-lock-constant-face)))
  1902. "Font lock face used to highlight modifiers.
  1903. In `R-mode', for example, this includes \"library,\" \"attach,\"
  1904. and others. See `ess-R-modifiers'."
  1905. :group 'ess-faces)
  1906. (defconst ess-constant-face 'ess-constant-face)
  1907. (defface ess-constant-face
  1908. '((default (:inherit font-lock-type-face)))
  1909. "Font lock face used to highlight constants.
  1910. In `ess-r-mode', for example, this includes TRUE, FALSE, Inf and
  1911. others. See `ess-R-constants'."
  1912. :group 'ess-faces)
  1913. (defconst ess-matrix-face 'ess-matrix-face)
  1914. (defface ess-matrix-face
  1915. '((default (:inherit font-lock-constant-face)))
  1916. "Font lock face used to highlight row/column labels in matrices."
  1917. :group 'ess-faces)
  1918. (defconst ess-keyword-face 'ess-keyword-face)
  1919. (defface ess-keyword-face
  1920. '((default (:inherit font-lock-keyword-face)))
  1921. "Font lock face used to highlight reserved keywords.
  1922. In `ess-r-mode', for example, this includes \"while,\" \"if/else\",
  1923. \"function,\" and others. See `ess-R-keywords'."
  1924. :group 'ess-faces)
  1925. (defconst ess-r-control-flow-keyword-face 'ess-r-control-flow-keyword-face)
  1926. (defface ess-r-control-flow-keyword-face
  1927. '((default (:inherit ess-keyword-face)))
  1928. "Font lock face used to highlight control flow keywords.
  1929. In `R-mode', for example, this includes \"switch(),\"
  1930. \"tryCatch()\", and \"stop(),\". See
  1931. `ess-R-control-flow-keywords'. By default, these keywords are
  1932. highlighted with the same face as `ess-R-keywords'"
  1933. :group 'ess-faces)
  1934. (defcustom ess-help-kill-bogus-buffers t
  1935. "Non-nil means kill ESS help buffers immediately if they are \"bogus\"."
  1936. :group 'ess-help
  1937. :type 'boolean)
  1938. (defvar ess-execute-screen-options-command nil
  1939. "Dialect specific command run by `ess-execute-screen-options'.")
  1940. (defvar-local ess-funargs-command nil
  1941. "Dialect specific command to return a list of function arguments.
  1942. See `ess-function-arguments' and .ess_funargs command in R and
  1943. S+ for details of the format that should be returned.")
  1944. ; System variables
  1945. ;;;=====================================================
  1946. ;;; Users note: You will rarely have to change these
  1947. ;;; variables.
  1948. ;;*;; Variables relating to ess-help-mode
  1949. ;;-- ess-help-S-.. and ess-help-R-.. : in ess-s-lang.el (are used in ess-inf).
  1950. (defvar-local ess-help-sec-keys-alist nil
  1951. "Alist of (key . string) pairs for use in section searching.")
  1952. (defvar-local ess-help-sec-regex nil
  1953. "Reg(ular) Ex(pression) of section headers in help file.")
  1954. ; julia-mode
  1955. (define-obsolete-variable-alias 'inferior-julia-program-name
  1956. 'inferior-julia-program "ESS 18.10")
  1957. (defcustom inferior-julia-program (or (executable-find "julia-basic")
  1958. "julia")
  1959. "Executable for Julia.
  1960. Should be an absolute path to the julia executable."
  1961. :group 'ess-Julia
  1962. :type '(choice (string) (file)))
  1963. ;; FIXME
  1964. (defvar-local ess-mode-completion-syntax-table nil "Completion and help syntax table for `ess-mode'.")
  1965. ; Buffer local customization stuff
  1966. (defcustom ess-error-buffer-name "*ESS-errors*"
  1967. "Name of buffer to keep process error messages in.
  1968. Created for each process."
  1969. :group 'ess-proc
  1970. :type 'string)
  1971. (defvar ess-error-regexp-alist nil
  1972. "List of symbols which are looked up in `compilation-error-regexp-alist-alist'.")
  1973. (defcustom ess-write-to-dribble t
  1974. "Non-nil means write to `ess-dribble-buffer'.
  1975. See also `ess-verbose'."
  1976. :group 'ess-proc
  1977. :type 'boolean
  1978. :package-version '(ess . "18.10"))
  1979. (defcustom ess-verbose nil
  1980. "Non-nil means write more information to `ess-dribble-buffer' than usual."
  1981. :group 'ess-proc
  1982. :type 'boolean)
  1983. (defvar ess-dribble-buffer "*ESS*"
  1984. "Buffer or name of buffer for printing debugging information.")
  1985. (defvar-local ess-local-customize-alist nil
  1986. "Buffer local settings for proper behavior.
  1987. Used to store the values for passing on to newly created buffers.")
  1988. (defvar ess-mode-editing-alist nil
  1989. "Variable settings for `ess-mode'.")
  1990. (defvar-local ess-transcript-minor-mode nil
  1991. "Non-nil if using `ess-transcript-mode' as a minor mode of some other mode.")
  1992. (defvar-local ess-listing-minor-mode nil
  1993. "Non-nil if using `ess-listing-minor-mode'.")
  1994. (defvar ess--enable-experimental-projects nil
  1995. "Enable experimental project support in ESS.")
  1996. (defvar ess-STERM nil
  1997. "Placeholder for dialect-specific STERM.")
  1998. (make-obsolete-variable 'ess-S-loop-timeout "It is ignored." "ESS 18.10")
  1999. (make-obsolete-variable 'ess-mode-load-hook "It is ignored." "ESS 18.10")
  2000. (make-obsolete-variable 'ess-speedbar-use-p "It is ignored." "ESS 18.10")
  2001. (make-obsolete-variable 'ess-synchronize-evals "It is ignored." "ESS 18.10")
  2002. (make-obsolete-variable 'ess-eval-visibly-at-end "It is ignored." "ESS 18.10")
  2003. (make-obsolete-variable 'ess-font-lock-mode 'global-font-lock-mode "ESS 18.10")
  2004. (provide 'ess-custom)
  2005. ;;; ess-custom.el ends here