Skip to content

Commit e2a27da

Browse files
committed
Merge branch 'master' of github.com:emacs-ess/ESS
2 parents 1088594 + feb604e commit e2a27da

15 files changed

+734
-563
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.11
1+
15.03

etc/ESSR/R/completion.R

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,46 @@
6161
c(get('token', envir=utils:::.CompletionEnv),
6262
utils:::.retrieveCompletions())
6363
}
64+
65+
.ess_arg_help <- function(arg, func){
66+
olderr <- getOption('error')
67+
options(error=NULL)
68+
on.exit(options(error=olderr))
69+
fguess <-
70+
if(is.null(func)) get('fguess', envir=utils:::.CompletionEnv)
71+
else func
72+
findArgHelp <- function(fun, arg){
73+
file <- help(fun, try.all.packages=FALSE)[[1]]
74+
hlp <- utils:::.getHelpFile(file)
75+
id <- grep('arguments', tools:::RdTags(hlp), fixed=TRUE)
76+
if(length(id)){
77+
arg_section <- hlp[[id[[1L]]]]
78+
items <- grep('item', tools:::RdTags(arg_section), fixed=TRUE)
79+
## cat('items:', items, fill=TRUE)
80+
if(length(items)){
81+
arg_section <- arg_section[items]
82+
args <- unlist(lapply(arg_section,
83+
function(el) paste(unlist(el[[1]][[1]], TRUE, FALSE), collapse='')))
84+
fits <- grep(arg, args, fixed=TRUE)
85+
## cat('args', args, 'fits', fill=TRUE)
86+
if(length(fits))
87+
paste(unlist(arg_section[[fits[1L]]][[2]], TRUE, FALSE), collapse='')
88+
}
89+
}
90+
}
91+
funcs <- c(fguess, tryCatch(methods(fguess),
92+
warning=function(w) {NULL},
93+
error=function(e) {NULL}))
94+
if(length(funcs) > 1 && length(pos <- grep('default', funcs))){
95+
funcs <- c(funcs[[pos[[1L]]]], funcs[-pos[[1L]]])
96+
}
97+
i <- 1L; found <- FALSE
98+
out <- 'No help found'
99+
while(i <= length(funcs) && is.null(out <-
100+
tryCatch(findArgHelp(funcs[[i]], arg),
101+
warning=function(w) {NULL},
102+
error=function(e) {NULL})
103+
))
104+
i <- i + 1L
105+
cat('\n\n', as.character(out), '\n')
106+
};

etc/ESSR/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.7
1+
1.1.8

etc/R-ESS-bugs.R

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -489,22 +489,37 @@ parse_roc <- function(lines, match = "^\\s*+\' ?") {
489489
{
490490
a <- ggplot(data = overtime.by.month,
491491
aes(x="", y=Percent, fill = Overtime)) +
492-
geom_bar(width = 1) +
493-
xlab('') +
494-
ylab(sub.txt) +
495-
labs(title = title.txt) +
496-
facet_wrap(~Year.Month)
492+
geom_bar(width = 1) +
493+
xlab('') +
494+
ylab(sub.txt) +
495+
labs(title = title.txt) +
496+
facet_wrap(~Year.Month)
497497
}
498498

499499
a <- ggplot(data = overtime.by.month,
500500
aes(x="", y=Percent, fill = Overtime)) +
501-
geom_bar(width = 1) +
502-
xlab('') +
503-
ylab(sub.txt) +
504-
labs(title = title.txt) +
505-
facet_wrap(~Year.Month)
506-
### ^-- face_wrap must be here
501+
geom_bar(width = 1) +
502+
xlab('') +
503+
ylab(sub.txt) +
504+
labs(title = title.txt) +
505+
facet_wrap(~Year.Month)
506+
### ^-- face_wrap must be here
507507

508+
### --- 20b ---
509+
510+
mean(rnorm(100, mean = runif(1, 1, 10)), na.rm =TRUE) +
511+
2
512+
##^--- 2 is here
513+
514+
mean(rnorm(100, mean = runif(1, 1, 10)),
515+
na.rm =TRUE) +
516+
2
517+
##^--- 2 is here
518+
519+
mean(rnorm(100,
520+
mean = runif(1, 1, 10)), na.rm=TRUE) +
521+
2
522+
##^--- 2 is here
508523

509524
### --- 21 ---
510525

@@ -659,3 +674,28 @@ x <- c(1, 3.075819, 1.515999, 2.156169, 1.480742, 1.765485, 1.460206, 1.603707,
659674
cM <- qchisq(0.95, p)
660675
function(d) as.numeric(d < cM)
661676
})
677+
678+
### --- 28 ---
679+
## Indentation of end-line comments (to column 40 = 'indent-column')
680+
## {this is part of "real" code in Rmpfr/R/hjk.R}:
681+
hjk <- function(x,n) { # <--- C-M-q "on {" -- does *no longer* indent the "# .."
682+
##-- Setting steps and stepsize -----
683+
nsteps <- floor(log2(1/tol)) # number of steps
684+
steps <- 2^c(-(0:(nsteps-1))) # decreasing step size
685+
dir <- diag(1, n, n) # orthogonal directions
686+
687+
x <- par # start point
688+
fx <- f(x) # smallest value so far
689+
fcount <- 1 # counts number of function calls
690+
691+
if (info) cat(sprintf("step nofc %-12s | %20s\n",
692+
"fmin", "xpar"))
693+
694+
##-- Start the main loop ------------
695+
ns <- 0
696+
while (ns < nsteps && fcount < maxfeval && abs(fx) < target) {
697+
ns <- ns + 1
698+
hjs <- .hjsearch(x, f, steps[ns], dir, fcount, maxfeval, target)
699+
}
700+
hjs
701+
}

lisp/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ ELC = $(CORE) ess-comp.elc ess-custom.elc \
4848
ess-omg-l.elc ess-omg-d.elc \
4949
ess-bugs-l.elc ess-bugs-d.elc ess-jags-d.elc \
5050
ess-noweb.elc ess-noweb-mode.elc ess-noweb-font-lock-mode.elc \
51-
ess-eldoc.elc ess-roxy.elc ess-rutils.elc \
51+
ess-eldoc.elc ess-roxy.elc ess-rutils.elc ess-r-completion.elc \
5252
ess-s-l.elc ess-s3-d.elc ess-s4-d.elc \
5353
ess-sp3-d.elc ess-sp4-d.elc ess-sp5-d.elc ess-sp6-d.elc \
5454
ess-rdired.elc ess-r-args.elc ess-r-d.elc ess-rd.elc \
5555
ess-developer.elc ess-tracebug.elc ess-julia.elc\
56-
ess-sp6w-d.elc msdos.elc
56+
ess-sp6w-d.elc msdos.elc
5757
## ^^^^^^^^^^^^^^^^^^^^^^^ Windows only (but be platform-oblivious)
5858

5959
ESSR_VER =`cat ../etc/ESSR-VERSION`
@@ -85,7 +85,7 @@ uninstall:
8585
cd $(SITELISP) && $(UNINSTALL) ess-site.el ; \
8686
fi;
8787
clean:
88-
rm -f $(ELC)
88+
rm -f $(ELC)
8989

9090
distclean: clean
9191
# and potentially more
@@ -96,7 +96,7 @@ distclean: clean
9696
### Replace Version numbers (as in ../doc/Makefile !):
9797
## "../VERSION" if that changes, *definitely* need to update ess-custom.el
9898
ess-custom.el: ../VERSION
99-
perl -pi -e 's/".*"/"$(ESSVERSION)"/ if /ess-version/' $@
99+
EV=$(ESSVERSION); perl -pi -e "s/\".*\"/\"$$EV\"/ if /ess-version/" $@
100100

101101
# ess-r-d.el: ../etc/ESSR-VERSION
102102
# sed -i -e '/let.*ESSR-version/s/"[-.0-9]*"/"$(ESSR_VER)"/' $@

lisp/ess-custom.el

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
;;; ess-custom.el --- Customize variables for ESS
22

3-
;; Copyright (C) 1997--2010, 2014 A.J. Rossini, Richard M. Heiberger, Martin
3+
;; Copyright (C) 1997--2010 A.J. Rossini, Richard M. Heiberger, Martin
44
;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.
5-
;; Copyright (C) 2011--2012 A.J. Rossini, Richard M. Heiberger, Martin Maechler,
5+
;; Copyright (C) 2011--2015 A.J. Rossini, Richard M. Heiberger, Martin Maechler,
66
;; Kurt Hornik, Rodney Sparapani, Stephen Eglen and Vitalie Spinu.
77

88
;; Author: A.J. Rossini <[email protected]>
@@ -132,7 +132,7 @@
132132
:prefix "ess-")
133133
;; Variables (not user-changeable)
134134

135-
(defvar ess-version "14.11" ;; updated by 'make'
135+
(defvar ess-version "15.03" ;; updated by 'make'
136136
"Version of ESS currently loaded.")
137137

138138
(defvar ess-revision nil ;; set
@@ -451,8 +451,7 @@ default), doc strings are truncated to fit into minibufer. This
451451
allows the use of different abbreviation styles with the
452452
truncation."
453453
:group 'ess
454-
:type '(choice (const nil) (const mild) (const normal) (const strong) (const aggressive) (const t))
455-
)
454+
:type '(choice (const nil) (const mild) (const normal) (const strong) (const aggressive) (const t)))
456455

457456

458457
(defcustom ess-use-auto-complete t
@@ -465,15 +464,22 @@ If non-nil add `ac-source-R' and `ac-source-filename' to the
465464
ESS defines three AC sources `ac-source-R',`ac-source-R-objects'
466465
and `ac-source-R-args'. See auto-complete package
467466
documentation (http://cx4a.org/software/auto-complete/) for how
468-
to install your custom sources.
469-
"
467+
to install your custom sources."
470468
:group 'ess-extras
471469
:type '(choice (const t) (const script-only) (const nil)))
472470

473-
(defcustom ess-ac-R-argument-suffix " = "
474-
"Suffix appended by `ac-source-R' and `ac-source-R-args' to candidates."
475-
:group 'R
476-
:type 'string)
471+
(defcustom ess-use-company t
472+
"If t, activate company support in ess-mode and inferior-ess-mode buffers.
473+
If non-nil add `company-R-args' and `company-R-objects' to the
474+
`company-backends'. If 'script-only activate in ess-mode buffers
475+
only."
476+
:group 'ess-extras
477+
:type '(choice (const t) (const script-only) (const nil)))
478+
479+
(defcustom ess-company-arg-prefix-length t
480+
"Minimum prefix for ess company function argument completion."
481+
:group 'ess-extras
482+
:type 'number)
477483

478484
(defcustom ess-use-tracebug t
479485
"If t, load ess-tracebug when R process starts."
@@ -493,15 +499,17 @@ might want to set this to nil.
493499
(defvar ess-ac-sources nil
494500
"Dialect specific, ESS specific list of ac-sources")
495501

502+
(defvar ess-company-backends nil
503+
"Dialect specific, ESS specific list of `company-backends'")
504+
496505
(defvar ess--completing-hist nil
497506
"Variable to store completion history.
498507
Used by `ess-completion-read' command.")
499508

500509
(defvar ess-smart-operators ()
501510
"List of smart operators to be used in ESS and IESS modes.
502511
Not to be set by users. It is redefined by mode specific
503-
settings, such as `ess-R-smart-operators'.
504-
")
512+
settings, such as `ess-R-smart-operators'.")
505513
(make-variable-buffer-local 'ess-smart-operators)
506514

507515
(defvar ess-R-smart-operators nil
@@ -510,15 +518,13 @@ If t, use all. If an axplicit list of operators, use only those
510518
operators.
511519
512520
In current verion of ESS, it controls the behavior of
513-
ess-smart-comma only, but will be enriched in the near future.
514-
")
521+
ess-smart-comma only, but will be enriched in the near future.")
515522

516523
(defvar ess-no-skip-regexp "[ \t\n]*\\'"
517524
"If `ess-next-code-line' sees this line, it doesn't jump over.
518525
519526
Used to avoid annoying jumping by ess-eval.*-and-step to end of
520-
buffer or end chunks etc.
521-
")
527+
buffer or end chunks etc.")
522528

523529
(defcustom ess-S-assign " <- "
524530
"String used for left assignment in all S dialects.
@@ -2032,9 +2038,7 @@ from `inferior-ess-primary-prompt' and `inferior-ess-secondary-prompt'.")
20322038
(make-obsolete-variable 'ess-search-list nil "ESS[12.09]")
20332039

20342040
(defvar ess-sl-modtime-alist nil
2035-
"Alist of modification times for all ess directories accessed this
2036-
session.")
2037-
2041+
"Alist of modification times for all ess directories accessed this session.")
20382042
(make-variable-buffer-local 'ess-sl-modtime-alist)
20392043

20402044
(defvar ess-sp-change nil
@@ -2223,12 +2227,10 @@ system described in `ess-font-lock-keywords'.")
22232227
(cons "=" 'font-lock-constant-face)
22242228
"=")
22252229

2226-
22272230
(defvar ess-fl-keyword:operators
22282231
(cons "[-=+></%]+" 'font-lock-constant-face)
22292232
"Operators.")
22302233

2231-
22322234
;;; fl-keywords S
22332235
(defvar ess-S-fl-keyword:modifiers
22342236
(cons (concat "\\<" (regexp-opt ess-S-modifyiers 'enc-paren) "\\>")
@@ -2275,7 +2277,6 @@ default or not."
22752277
:type 'alist)
22762278

22772279

2278-
22792280
;;; fl-keywords R
22802281
(defvar ess-R-fl-keyword:modifiers
22812282
(cons (concat "\\<" (regexp-opt ess-R-modifyiers 'enc-paren) "\\>")
@@ -2307,8 +2308,11 @@ default or not."
23072308

23082309
(defvar ess-R-fl-keyword:F&T
23092310
(cons "\\b[FT]\\b" 'font-lock-type-face)
2310-
"Highlith T and F in addition to TRUE and FALSE in R.")
2311+
"Highlight T and F in addition to TRUE and FALSE in R.")
23112312

2313+
(defvar ess-R-fl-keyword:%op%
2314+
(cons "%[^ \t]*%" 'ess-%op%-face)
2315+
"Highlight %op% operators.")
23122316

23132317
(defcustom ess-R-font-lock-keywords
23142318
'((ess-R-fl-keyword:modifiers . t)
@@ -2321,7 +2325,8 @@ default or not."
23212325
(ess-fl-keyword:operators)
23222326
(ess-fl-keyword:delimiters)
23232327
(ess-fl-keyword:=)
2324-
(ess-R-fl-keyword:F&T))
2328+
(ess-R-fl-keyword:F&T)
2329+
(ess-R-fl-keyword:%op%))
23252330
"An alist of available font-lock keywords for the R mode.
23262331
The key of each cons cell is a name of the keyword. The value
23272332
should be t or nil to indicate if the keyword is active or not."
@@ -2481,21 +2486,23 @@ the variable `ess-help-own-frame' is non-nil."
24812486
(defvar ess-numbers-face 'ess-numbers-face
24822487
"Face name to use for highlighting numbers.")
24832488

2484-
(if (featurep 'xemacs)
2485-
;; just to make xemacs not to choke on ESS
2486-
(setq ess-function-call-face font-lock-builtin-face
2487-
ess-numbers-face font-lock-type-face)
2489+
(defvar ess-%op%-face 'ess-%op%-face
2490+
"Face name to use for highlighting %op% operators.")
24882491

2489-
(defface ess-function-call-face
2490-
'((default (:slant normal :inherit font-lock-function-name-face)))
2491-
"Font Lock face used to highlight function calls in ess buffers."
2492-
:group 'ess)
2492+
(defface ess-function-call-face
2493+
'((default (:slant normal :inherit font-lock-function-name-face)))
2494+
"Font Lock face used to highlight function calls in ess buffers."
2495+
:group 'ess)
24932496

2494-
(defface ess-numbers-face
2495-
'((default (:slant normal :inherit font-lock-type-face)))
2496-
"Font Lock face used to highlight numbers in ess-mode buffers."
2497-
:group 'ess)
2498-
)
2497+
(defface ess-numbers-face
2498+
'((default (:slant normal :inherit font-lock-type-face)))
2499+
"Font Lock face used to highlight numbers in ess-mode buffers."
2500+
:group 'ess)
2501+
2502+
(defface ess-%op%-face
2503+
'((default (:slant normal :inherit font-lock-keyword-face)))
2504+
"Font Lock face used to highlight %op% operators in ess-mode buffers."
2505+
:group 'ess)
24992506

25002507

25012508
(defcustom ess-help-kill-bogus-buffers t

0 commit comments

Comments
 (0)