From c927fdf124e41458c7ac9e4b429d1d5771b67f2c Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 28 Oct 2012 10:00:55 +0000 Subject: [PATCH 01/22] solve demo mouse-2 problem git-svn-id: https://svn.r-project.org/ESS/trunk@5273 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-help.el | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/lisp/ess-help.el b/lisp/ess-help.el index 4e73fa028..7b6114e8a 100644 --- a/lisp/ess-help.el +++ b/lisp/ess-help.el @@ -246,16 +246,12 @@ If COMMAND is suplied, it is used instead of `inferior-ess-help-command'. (browse-url (funcall fun-get-file-path ess-help-object)))))) ))) -(defun ess--action-help-on-object (&optional pos) +(defun ess--action-help-on-object (&optional button) "Provide help on object at the beginning of line. It's intended to be used in R-index help pages. Load the package if necessary. It is bound to RET and C-m in R-index pages." (interactive) - (let* ((link-beg (previous-single-property-change pos 'button - nil (point-at-bol))) - (link-end (next-single-property-change pos 'button - nil (point-at-eol))) - (string (buffer-substring link-beg link-end)) + (let* ((string (button-label button)) (command (when (equal ess-dialect "R") (cond ((string-match"::" string) @@ -406,21 +402,18 @@ if necessary. It is bound to RET and C-m in R-index pages." 'demos #'ess--action-demo))) -(defun ess--action-demo (&optional pos) +(defun ess--action-demo (&optional button) "Provide help on object at the beginning of line. It's intended to be used in R-index help pages. Load the package if necessary. It is bound to RET and C-m in R-index pages." (interactive) - (let* ((link-beg (previous-single-property-change pos 'button - nil (point-at-bol))) - (link-end (next-single-property-change pos 'button - nil (point-at-eol))) - (string (buffer-substring link-beg link-end)) - (command (cond ((equal ess-dialect "R") - (format "demo('%s')\n" string)) - (t (error "Not implemented for dialect %s" ess-dialect)) - ))) - (ess-eval-linewise command))) + (let* ((string (button-label button)) + (command + (cond ((equal ess-dialect "R") + (format "demo('%s')\n" string)) + (t (error "Not implemented for dialect %s" ess-dialect))))) + (ess-eval-linewise command) + (ess-switch-to-end-of-ESS))) (defun ess-display-vignettes () "Display vignettes if available for the current dialect." From 61b42091efe0257d99bd8e6fa92360e0c58901c5 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 28 Oct 2012 10:19:53 +0000 Subject: [PATCH 02/22] move describe-object-at-point functionality into ess-help and remap it on C-e in doc-map git-svn-id: https://svn.r-project.org/ESS/trunk@5274 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-help.el | 59 +++++++++++++++++++++++++++++++++++++++++++++++ lisp/ess-mode.el | 1 - lisp/ess-utils.el | 50 --------------------------------------- 3 files changed, 59 insertions(+), 51 deletions(-) diff --git a/lisp/ess-help.el b/lisp/ess-help.el index 7b6114e8a..3127ca2ee 100644 --- a/lisp/ess-help.el +++ b/lisp/ess-help.el @@ -585,6 +585,8 @@ For internal use. Used in `ess-display-help-on-object', (defvar ess-doc-map (let (ess-doc-map) (define-prefix-command 'ess-doc-map) + (define-key ess-doc-map "\C-e" 'ess-describe-object-at-point) + (define-key ess-doc-map "e" 'ess-describe-object-at-point) (define-key ess-doc-map "\C-d" 'ess-display-help-on-object) (define-key ess-doc-map "d" 'ess-display-help-on-object) (define-key ess-doc-map "\C-i" 'ess-display-package-index) @@ -593,6 +595,7 @@ For internal use. Used in `ess-display-help-on-object', (define-key ess-doc-map "a" 'ess-display-help-apropos) (define-key ess-doc-map "\C-v" 'ess-display-vignettes) (define-key ess-doc-map "v" 'ess-display-vignettes) + (define-key ess-doc-map "\C-o" 'ess-display-demos) (define-key ess-doc-map "o" 'ess-display-demos) ess-doc-map ) @@ -918,6 +921,61 @@ return it. Otherwise, return `ess-help-topics-list'." ;;(other-window 1) (Info-goto-node (concat "(ess)" node))) + + ;; describe object at point + +(defvar ess-describe-object-at-point-commands nil + "Commands cycled by `ess-describe-object-at-point'. Dialect +specific.") +(make-variable-buffer-local 'ess-describe-at-point-commands) + +(defvar ess--descr-o-a-p-commands nil) + +(defun ess-describe-object-at-point () + "Get info for object at point, and display it in an electric buffer or tooltip. + +Customize `ess-describe-at-point-method' if you wan to display +the description in a tooltip. + +See also `ess-R-describe-object-at-point-commands' (and similar +option for other dialects). +" + (interactive) + (if (not ess-describe-object-at-point-commands) + (message "Not implemented for dialect %s" ess-dialect) + (ess-force-buffer-current) + (let ((map (make-sparse-keymap)) + (objname (symbol-at-point)) + bs ess--descr-o-a-p-commands) + (unless objname (error "No object at point ")) + (define-key map (vector last-command-event) 'ess--describe-object-at-point) + ;; todo: put digits into the map + (let ((buf (ess--execute-singlekey-command map nil objname))) + (when (bufferp buf) + (kill-buffer buf))) ;; bury does not work here :( (emacs bug?) + ))) + +(defun ess--describe-object-at-point (ev objname) + (setq ess--descr-o-a-p-commands (or ess--descr-o-a-p-commands + ess-describe-object-at-point-commands)) + (let* ((com (format (car (pop ess--descr-o-a-p-commands)) objname)) + (buf (get-buffer-create "*ess-describe*")) + pos) + (ess-command (concat com "\n") buf) + (with-current-buffer buf + (goto-char (point-min)) + (insert (propertize (format "%s:\n\n" com) 'face 'font-lock-string-face)) + (forward-line -1) + (setq pos (point)) + (setq buffer-read-only t)) + (if (eq ess-describe-at-point-method 'tooltip) + (ess-tooltip-show-at-point + (with-current-buffer buf (buffer-string)) 0 30) + (display-buffer buf) + (set-window-point (get-buffer-window buf) pos) ;; don't move the visible point + buf))) + + ; Bug Reporting (defun ess-submit-bug-report () @@ -959,6 +1017,7 @@ return it. Otherwise, return `ess-help-topics-list'." )))) + ;;; Provide (provide 'ess-help) diff --git a/lisp/ess-mode.el b/lisp/ess-mode.el index 95cb28b5d..7759e7a22 100644 --- a/lisp/ess-mode.el +++ b/lisp/ess-mode.el @@ -193,7 +193,6 @@ (let (ess-extra-map) (define-prefix-command 'ess-extra-map) (define-key ess-extra-map "\C-d" 'ess-dump-object-into-edit-buffer) - (define-key ess-extra-map "\C-e" 'ess-describe-object-at-point) (define-key ess-extra-map "\C-t" 'ess-build-tags-for-directory) ;; (define-key map "C-t" ess-extra-map) diff --git a/lisp/ess-utils.el b/lisp/ess-utils.el index 515fa297a..d447c8123 100644 --- a/lisp/ess-utils.el +++ b/lisp/ess-utils.el @@ -917,56 +917,6 @@ and y-offsets for the toolbar from point." -(defvar ess-describe-object-at-point-commands nil - "Commands cycled by `ess-describe-object-at-point'. Dialect -specific.") -(make-variable-buffer-local 'ess-describe-at-point-commands) - -(defvar ess--descr-o-a-p-commands nil) - -(defun ess-describe-object-at-point () - "Get info for object at point, and display it in an electric buffer or tooltip. - -Customize `ess-describe-at-point-method' if you wan to display -the description in a tooltip. - -See also `ess-R-describe-object-at-point-commands' (and similar -option for other dialects). -" - (interactive) - (if (not ess-describe-object-at-point-commands) - (message "Not implemented for dialect %s" ess-dialect) - (ess-force-buffer-current) - (let ((map (make-sparse-keymap)) - (objname (symbol-at-point)) - bs ess--descr-o-a-p-commands) - (unless objname (error "No object at point ")) - (define-key map (vector last-command-event) 'ess--describe-object-at-point) - ;; todo: put digits into the map - (let ((buf (ess--execute-singlekey-command map nil objname))) - (when (bufferp buf) - (kill-buffer buf))) ;; bury does not work here :( (emacs bug?) - ))) - -(defun ess--describe-object-at-point (ev objname) - (setq ess--descr-o-a-p-commands (or ess--descr-o-a-p-commands - ess-describe-object-at-point-commands)) - (let* ((com (format (car (pop ess--descr-o-a-p-commands)) objname)) - (buf (get-buffer-create "*ess-describe*")) - pos) - (ess-command (concat com "\n") buf) - (with-current-buffer buf - (goto-char (point-min)) - (insert (propertize (format "%s:\n\n" com) 'face 'font-lock-string-face)) - (forward-line -1) - (setq pos (point)) - (setq buffer-read-only t)) - (if (eq ess-describe-at-point-method 'tooltip) - (ess-tooltip-show-at-point - (with-current-buffer buf (buffer-string)) 0 30) - (display-buffer buf) - (set-window-point (get-buffer-window buf) pos) ;; don't move the visible point - buf))) (defvar ess-build-tags-command nil From f2a448b651e2912bf1a29da90575226040c6840c Mon Sep 17 00:00:00 2001 From: Martin Maechler Date: Sun, 28 Oct 2012 18:48:43 +0000 Subject: [PATCH 03/22] "deprecate" ess-noweb-mode-version git-svn-id: https://svn.r-project.org/ESS/trunk@5275 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-noweb-mode.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lisp/ess-noweb-mode.el b/lisp/ess-noweb-mode.el index 536540972..cb96b3009 100644 --- a/lisp/ess-noweb-mode.el +++ b/lisp/ess-noweb-mode.el @@ -96,11 +96,11 @@ ;;; Variables -(defconst ess-noweb-mode-RCS-Id - "Imported to ESS Subversion repository and RCS ids not maintained.") +;; (defconst ess-noweb-mode-RCS-Id +;; "Imported to ESS Subversion repository and RCS ids not maintained.") -(defconst ess-noweb-mode-RCS-Name - " ") +;; (defconst ess-noweb-mode-RCS-Name +;; " ") (defvar ess-noweb-mode-prefix "\M-n" "*Prefix key to use for noweb mode commands. @@ -261,7 +261,7 @@ replaced by sequences of '*'.") (define-key map "q" 'ess-noweb-fill-chunk) (define-key map "i" 'ess-noweb-new-chunk) (define-key map "o" 'ess-noweb-occur) - (define-key map "v" 'ess-noweb-mode-version) + ;;(define-key map "v" 'ess-noweb-mode-version) (define-key map "h" 'ess-noweb-describe-mode) ;; do *NOT* override C-h (give all keybindings startings with M-n! map) @@ -329,7 +329,8 @@ replaced by sequences of '*'.") ["Chunk occurrences" ess-noweb-occur t]) "--" ["Help" ess-noweb-describe-mode t] - ["Version" ess-noweb-mode-version t])) + ;;["Version" ess-noweb-mode-version t] + )) ;; Add ess-noweb-mode to the list of minor modes (if (not (assq 'ess-noweb-mode minor-mode-alist)) @@ -413,7 +414,6 @@ Misc: \\[ess-noweb-occur] \t\tfind all occurrences of the current chunk \\[ess-noweb-update-chunk-vector] \tupdate the markers for chunks \\[ess-noweb-describe-mode] \tdescribe ess-noweb-mode -\\[ess-noweb-mode-version] \t\tshow ess-noweb-mode's version in the minibuffer " (interactive "P") ;; This bit is tricky: copied almost verbatim from bib-cite-mode.el ;; It seems to ensure that the variable ess-noweb-mode is made @@ -1381,8 +1381,7 @@ The only sensible way to do this is to add a mode line to the chunk" (defun ess-noweb-mode-version () "Echo the RCS identification of noweb mode." (interactive) - (message "Thorsten's ess-noweb-mode (PRERELEASE). RCS: %s" - ess-noweb-mode-RCS-Id)) + (message "Thorsten's ess-noweb-mode, now part of ESS version %s" ess-version)) (defun ess-noweb-describe-mode () "Describe noweb mode." From fdc9eabe3af194802dab91df825f281a3d4e3836 Mon Sep 17 00:00:00 2001 From: Martin Maechler Date: Wed, 31 Oct 2012 09:45:11 +0000 Subject: [PATCH 04/22] minimal example showing the "assign key no longer works" problem git-svn-id: https://svn.r-project.org/ESS/trunk@5276 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- etc/in-string-bug-ex.Rnw | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 etc/in-string-bug-ex.Rnw diff --git a/etc/in-string-bug-ex.Rnw b/etc/in-string-bug-ex.Rnw new file mode 100644 index 000000000..c1605ec3c --- /dev/null +++ b/etc/in-string-bug-ex.Rnw @@ -0,0 +1,25 @@ +% From: Richard Morrisroe +% To: +% Subject: Re: [ESS] noweb file and assignment key +% Date: Tue, 30 Oct 2012 20:57:32 +0000 + +\documentclass{article} + +\begin{document} + +<>= +i.can.haz.assginment <- TRUE +@ + +Now, we will introduce an extraneous apostrophe, for no reason ' + +<>= +a_2 #ess-smart-underscore-no-longer-works +@ + +' +<>= +nowitdoes <- cat("Note the apostrophe above which closes the earlier one\n") +@ + +\end{document} From 3ce48622fc4ab7ba4aeed8ac1f233d1de54e1a83 Mon Sep 17 00:00:00 2001 From: Martin Maechler Date: Wed, 31 Oct 2012 11:27:38 +0000 Subject: [PATCH 05/22] fix (ess-smart-underscore) inside Rnw --- based on suggestion by Chuck Berry git-svn-id: https://svn.r-project.org/ESS/trunk@5277 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-s-l.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ess-s-l.el b/lisp/ess-s-l.el index 8914b8f3c..d81c09bb9 100644 --- a/lisp/ess-s-l.el +++ b/lisp/ess-s-l.el @@ -687,7 +687,10 @@ an underscore is always inserted. " (ignore-errors (when (and (eq major-mode 'inferior-ess-mode) (> (point) (process-mark (get-buffer-process (current-buffer))))) - (narrow-to-region (process-mark (get-ess-process)) (point-max)))) + (narrow-to-region (process-mark (get-ess-process)) (point-max))) + (and ess-noweb-mode + (ess-noweb-in-code-chunk) + (ess-noweb-narrow-to-chunk))) (if (or (ess-inside-string-or-comment-p (point)) (not (equal ess-language "S"))) From c1af73ab931a356a195b014ab0188cddd9b2e2ea Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Wed, 31 Oct 2012 13:42:10 +0000 Subject: [PATCH 06/22] fix "wrong number of arguments" issue with C-c C-z git-svn-id: https://svn.r-project.org/ESS/trunk@5278 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-inf.el | 2 +- lisp/ess-utils.el | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el index bad1d322b..e46237d66 100644 --- a/lisp/ess-inf.el +++ b/lisp/ess-inf.el @@ -844,7 +844,7 @@ with C-c C-z C-z C-z ... (interactive "P") (let ((map (make-sparse-keymap))) (define-key map (vector last-command-event) - (lambda (eob) (interactive) + (lambda (ev eob) (interactive) (if (not (eq major-mode 'inferior-ess-mode)) (ess-switch-to-ESS eob) (let ((dialect ess-dialect) diff --git a/lisp/ess-utils.el b/lisp/ess-utils.el index d447c8123..0c8750f09 100644 --- a/lisp/ess-utils.el +++ b/lisp/ess-utils.el @@ -831,9 +831,9 @@ requre the prefix command for subsequent invocation. If WAIT is t, wait for next input and ignore the keystroke which triggered the command. -Each command in map should accept one argument, the most recent -event (as read by `read-event'). ARGS are the supplementary -arguments passed to commands in MAP. +Each command in map should accept one at least one argument, the +most recent event (as read by `read-event'). ARGS are the +supplementary arguments passed to the commands. " `(let* ((ev last-command-event) From e7fadea618d70001f6fe7a26f97e7424a734e490 Mon Sep 17 00:00:00 2001 From: Martin Maechler Date: Thu, 1 Nov 2012 17:07:02 +0000 Subject: [PATCH 07/22] a /inst/CITATION file should also be in R mode git-svn-id: https://svn.r-project.org/ESS/trunk@5279 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-site.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/ess-site.el b/lisp/ess-site.el index 3744dc559..718fa32ae 100644 --- a/lisp/ess-site.el +++ b/lisp/ess-site.el @@ -247,6 +247,7 @@ between .s or .S files and assembly mode. ("\\.[sS]nw\\'" . Snw-mode); currently identical to Rnw-mode ("\\.[rR]profile\\'" . R-mode) ("NAMESPACE\\'" . R-mode) + ("CITATION\\'" . R-mode) ("\\.omg\\'" . omegahat-mode) ("\\.hat\\'" . omegahat-mode) ;; Duncan's pref'd... ("\\.lsp\\'" . XLS-mode) From 26cafca251b993987460f6f76f450e3c4ebe735c Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Fri, 2 Nov 2012 23:43:21 +0000 Subject: [PATCH 08/22] solve ?for problem git-svn-id: https://svn.r-project.org/ESS/trunk@5280 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-help.el | 2 +- lisp/ess-inf.el | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/ess-help.el b/lisp/ess-help.el index 3127ca2ee..41ac19c9a 100644 --- a/lisp/ess-help.el +++ b/lisp/ess-help.el @@ -323,7 +323,7 @@ if necessary. It is bound to RET and C-m in R-index pages." (defun ess--display-indexed-help-page (command item-regexp title help-type &optional action help-echo reg-start help-object) "Internal function to display help pages with linked actions - ;; COMMAND which produces the help page + ;; COMMAND to produce the indexed help page ;; ITEM-REGEXP -- first subexpression is highlighted ;; TITLE of the help page ;; HELP-TYPE to be stored in `ess-help-type' local variable diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el index e46237d66..41a8479bd 100644 --- a/lisp/ess-inf.el +++ b/lisp/ess-inf.el @@ -2220,7 +2220,7 @@ to continue it." (defconst inferior-R--input-help (format "^ *help *(%s)" ess-help-arg-regexp)) ;; (defconst inferior-R-2-input-help (format "^ *\\? *%s" ess-help-arg-regexp)) (defconst inferior-R--input-?-help-regexp - "^ *\\(\\(?:[a-zA-Z ]*\\)\\?\\{1,2\\}.+\\)") ; "\\?\\{1,2\\}\\) *['\"]?\\([^,=)'\"]*\\)['\"]?") ;;catch ?? + "^ *\\(?:\\(?1:[a-zA-Z ]*\\?\\{1,2\\}\\)\\(?2:.+\\)\\)") ; "\\?\\{1,2\\}\\) *['\"]?\\([^,=)'\"]*\\)['\"]?") ;;catch ?? (defconst inferior-R--page-regexp (format "^ *page *(%s)" ess-help-arg-regexp)) (defun inferior-R-input-sender (proc string) @@ -2228,7 +2228,7 @@ to continue it." (let ((help-match (and (string-match inferior-R--input-help string) (match-string 2 string))) (help-?-match (and (string-match inferior-R--input-?-help-regexp string) - (match-string 0 string))) + (format "%s'%s'" (match-string 1 string) (match-string 2 string)))) (page-match (and (string-match inferior-R--page-regexp string) (match-string 2 string)))) (cond (help-match @@ -2240,10 +2240,10 @@ to continue it." (format "*ess-apropos[%s](%s)*" ess-current-process-name (match-string 1 help-?-match)) 'appropos) - (ess--display-indexed-help-page (concat help-?-match "\n") nil - (format "*ess-help[%s](%s)*" - ess-current-process-name help-?-match) - 'help)) + (ess--display-indexed-help-page (concat help-?-match "\n") nil + (format "*ess-help[%s](%s)*" + ess-current-process-name help-?-match) + 'help)) (process-send-string proc "\n")) (page-match From bdeefd7cbd787019dca0c210d558680142173bfb Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Fri, 2 Nov 2012 23:43:24 +0000 Subject: [PATCH 09/22] make ess-describe-object-at-point work again git-svn-id: https://svn.r-project.org/ESS/trunk@5281 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-help.el | 4 ++-- lisp/ess-utils.el | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ess-help.el b/lisp/ess-help.el index 41ac19c9a..3a7990283 100644 --- a/lisp/ess-help.el +++ b/lisp/ess-help.el @@ -957,7 +957,7 @@ option for other dialects). (defun ess--describe-object-at-point (ev objname) (setq ess--descr-o-a-p-commands (or ess--descr-o-a-p-commands - ess-describe-object-at-point-commands)) + (symbol-value ess-describe-object-at-point-commands))) (let* ((com (format (car (pop ess--descr-o-a-p-commands)) objname)) (buf (get-buffer-create "*ess-describe*")) pos) @@ -972,7 +972,7 @@ option for other dialects). (ess-tooltip-show-at-point (with-current-buffer buf (buffer-string)) 0 30) (display-buffer buf) - (set-window-point (get-buffer-window buf) pos) ;; don't move the visible point + (set-window-point (get-buffer-window buf) pos) ;; don't move window point buf))) diff --git a/lisp/ess-utils.el b/lisp/ess-utils.el index 0c8750f09..da601e019 100644 --- a/lisp/ess-utils.el +++ b/lisp/ess-utils.el @@ -840,7 +840,7 @@ supplementary arguments passed to the commands. (command (lookup-key ,map (vector ev))) out) (unless ,wait - (funcall command ev ,@args)) + (setq out (funcall command ev ,@args))) (while (setq command (lookup-key ,map (vector (setq ev (read-event))))) From 4a10b378ccf11c6e28d5f1c5385627e9a43bac0f Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Fri, 2 Nov 2012 23:43:26 +0000 Subject: [PATCH 10/22] add ess-load-library and ess-install-library to ess-extra-map git-svn-id: https://svn.r-project.org/ESS/trunk@5282 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-mode.el | 4 ++++ lisp/ess-r-d.el | 51 +++++++++++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/lisp/ess-mode.el b/lisp/ess-mode.el index 7759e7a22..462ed81ac 100644 --- a/lisp/ess-mode.el +++ b/lisp/ess-mode.el @@ -194,6 +194,10 @@ (define-prefix-command 'ess-extra-map) (define-key ess-extra-map "\C-d" 'ess-dump-object-into-edit-buffer) (define-key ess-extra-map "\C-t" 'ess-build-tags-for-directory) + (define-key ess-extra-map "\C-l" 'ess-load-library) + (define-key ess-extra-map "l" 'ess-load-library) + (define-key ess-extra-map "\C-i" 'ess-install-library) + (define-key ess-extra-map "i" 'ess-install-library) ;; (define-key map "C-t" ess-extra-map) "ESS extra map" diff --git a/lisp/ess-r-d.el b/lisp/ess-r-d.el index 5513a87c0..6fcb5b8a2 100644 --- a/lisp/ess-r-d.el +++ b/lisp/ess-r-d.el @@ -1287,28 +1287,38 @@ Completion is available for supplying options." "Cache var to store package names. Used by `ess-install.packages'.") -(defun ess-install.packages (&optional update) + + +(defun ess-R-install.packages (&optional update) "Prompt and install R package. With argument, update cached packages list." (interactive "P") + (when (equal "@CRAN@" (car (ess-get-words-from-vector "getOption('repos')[['CRAN']]\n"))) + (ess-setCRANMiror) + (ess-wait-for-process (get-process ess-current-process-name)) + (setq update t)) + (when (or update + (not ess--packages-cache)) + (message "Fetching R packages ... ") + (setq ess--packages-cache + (ess-get-words-from-vector "print(rownames(available.packages()), max=1e6)\n"))) + (let ((ess-eval-visibly-p t) + pack) + (setq pack (ess-completing-read "Package to install" ess--packages-cache)) + (process-send-string (get-process ess-current-process-name) + (format "install.packages('%s')\n" pack)) + (display-buffer (buffer-name (process-buffer (get-process ess-current-process-name)))) + )) + +(define-obsolete-function-alias 'ess-install.packages 'ess-R-install.packages "ESS[12.09-1]") + +(defun ess-install-library () + "Install library/package for current dialect. +Currently works only for R." + (interactive) (if (not (string-match "^R" ess-dialect)) (message "Sorry, not available for %s" ess-dialect) - (when (equal "@CRAN@" (car (ess-get-words-from-vector "getOption('repos')[['CRAN']]\n"))) - (ess-setCRANMiror) - (ess-wait-for-process (get-process ess-current-process-name)) - (setq update t)) - (when (or update - (not ess--packages-cache)) - (message "Fetching R packages ... ") - (setq ess--packages-cache - (ess-get-words-from-vector "print(rownames(available.packages()), max=1e6)\n"))) - (let ((ess-eval-visibly-p t) - pack) - (setq pack (ess-completing-read "Package to install" ess--packages-cache)) - (process-send-string (get-process ess-current-process-name) - (format "install.packages('%s')\n" pack)) - (display-buffer (buffer-name (process-buffer (get-process ess-current-process-name)))) - ))) - + (ess-R-install.packages))) + (defun ess-setRepositories () "Call setRepositories()" @@ -1347,8 +1357,8 @@ Completion is available for supplying options." (ess-eval-linewise (format "findFn(\"%s\", maxPages=10)" cmd)) ) -(defun ess-library () - "Prompt and install R package. With argument, update cached packages list." +(defun ess-load-library () + "Prompt and load ess-dialect library/package." (interactive) (if (not (string-match "^R" ess-dialect)) (message "Sorry, not available for %s" ess-dialect) @@ -1361,6 +1371,7 @@ Completion is available for supplying options." (display-buffer (buffer-name (process-buffer (get-process ess-current-process-name)))) ))) +(define-obsolete-function-alias 'ess-library 'ess-load-library "ESS[12.09-1]") ; provides From 6986b65629424a2c8a199e6dafdad08af89a1b58 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Fri, 2 Nov 2012 23:43:29 +0000 Subject: [PATCH 11/22] add stub for ess--execute-dialect-specific comand git-svn-id: https://svn.r-project.org/ESS/trunk@5283 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-utils.el | 13 +++++++++++++ lisp/ess.el | 1 + 2 files changed, 14 insertions(+) diff --git a/lisp/ess-utils.el b/lisp/ess-utils.el index da601e019..65a79b71d 100644 --- a/lisp/ess-utils.el +++ b/lisp/ess-utils.el @@ -848,6 +848,19 @@ supplementary arguments passed to the commands. (push ev unread-command-events) out)) +(defmacro ess--execute-dialect-specific (command &optional args) + "Execute dialect specific command. + +-- If command is not defined issue warning 'Not availabe for dialect X' +-- if a function, execute it with ARGS +-- If a string strarting with 'http' or 'www' browse with `browse-url', + otherwise execute the command in inferior process. + +When command is a string ARGS are substituted as in (format +command ,@args). +" + (error "not implemente yet") + ) diff --git a/lisp/ess.el b/lisp/ess.el index 94dbd6630..2d49330a1 100644 --- a/lisp/ess.el +++ b/lisp/ess.el @@ -441,6 +441,7 @@ Used in noweb modes.") (defun ess-setq-vars-local (alist &optional buf) "Set language variables from ALIST, in buffer BUF, if desired." (if buf (set-buffer buf)) + ;; (setq alist (reverse alist)) ;; It should really be in reverse order; (mapc (lambda (pair) (make-local-variable (car pair)) (set (car pair) (eval (cdr pair))) From 4f7f3714aeb7353dbb180398bc829f233d224bba Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sat, 3 Nov 2012 00:31:14 +0000 Subject: [PATCH 12/22] further tweaks of process auto-start (not clear why it switches to the proc buffer) git-svn-id: https://svn.r-project.org/ESS/trunk@5284 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-inf.el | 70 ++++++++++++++++++++++++------------------------- lisp/ess-r-d.el | 6 ++++- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el index 41a8479bd..f90341172 100644 --- a/lisp/ess-inf.el +++ b/lisp/ess-inf.el @@ -679,31 +679,30 @@ LANGUAGE (and DIALECT)." (unless dialect (error "The value of `dialect' is nil")) - - (let ((cur-buf (current-buffer)) - (dsymb (intern dialect))) - - (ess-write-to-dribble-buffer - (format " ..start-process-specific: lang:dialect= %s:%s, current-buf=%s\n" - language dialect cur-buf)) - (cond ((string= dialect "R") (R)) - ((string= language "S") ;VS[03-09-2012]: cannot start s+? - (message "ESS process not running, trying to start R, since language = 'S") - (R)) - ((string= dialect "Stata") (stata)) - ;;general case - ((fboundp dsymb) - (funcall dsymb)) - (t ;; else: ess-language is not S - - ;; Typically triggered from - ;; ess-force-buffer-current("Process to load into: ") - ;; \--> ess-request-a-process("Process to load into: " no-switch) - (error "No ESS processes running; not yet implemented to start (%s,%s)" - language dialect))) - ;; fixme: save excursion is not working here !!! bad bad bad !! - (pop-to-buffer cur-buf) - )) + + (save-current-buffer + (let ((dsymb (intern dialect))) + (ess-write-to-dribble-buffer + (format " ..start-process-specific: lang:dialect= %s:%s, current-buf=%s\n" + language dialect (current-buffer))) + (cond ((string= dialect "R") (R)) + ((string= language "S") ;VS[03-09-2012]: cannot start s+? + (message "ESS process not running, trying to start R, since language = 'S") + (R)) + ((string= dialect "Stata") (stata)) + ;;general case + ((fboundp dsymb) + (funcall dsymb)) + (t ;; else: ess-language is not S + + ;; Typically triggered from + ;; ess-force-buffer-current("Process to load into: ") + ;; \--> ess-request-a-process("Process to load into: " no-switch) + (error "No ESS processes running; not yet implemented to start (%s,%s)" + language dialect))) + ;; fixme: save excursion is not working here !!! bad bad bad !! + ;; (pop-to-buffer cur-buf) + ))) (defun ess-request-a-process (message &optional noswitch ask-if-1) "Ask for a process, and make it the current ESS process. @@ -721,6 +720,7 @@ Returns the name of the selected process." (error "Local value of `ess-dialect' is nil")) (let ((num-processes (length ess-process-name-list)) + (inferior-ess-same-window nil) ;; this should produce the inferior process in other window (auto-started?)) (if (or (= 0 num-processes) (and (= 1 num-processes) @@ -763,9 +763,8 @@ Returns the name of the selected process." (setq proc (caar ess-process-name-list))) ;; (with-current-buffer (process-buffer (get-process proc)) ;; (ess-make-buffer-current)) - (if noswitch - nil - (ess-show-buffer (buffer-name (process-buffer (get-process proc))) t)) + (unless noswitch + (ess-pop-to-buffer (buffer-name (process-buffer (get-process proc))) t)) proc))) @@ -789,14 +788,13 @@ there is only one process running." (if (and ess-local-process-name (not force) no-autostart) (error "Process %s has died" ess-local-process-name) ;; ess-local-process-name is nil -- which process to attach to - (save-excursion - (let ((proc (ess-request-a-process prompt 'no-switch ask-if-1)) - temp-ess-help-filetype dialect) - (with-current-buffer (process-buffer (get-process proc)) - (setq temp-ess-help-filetype inferior-ess-help-filetype)) - (setq ess-local-process-name proc) - (setq inferior-ess-help-filetype temp-ess-help-filetype) - )))))) + (let ((proc (ess-request-a-process prompt 'no-switch ask-if-1)) + temp-ess-help-filetype dialect) + (with-current-buffer (process-buffer (get-process proc)) + (setq temp-ess-help-filetype inferior-ess-help-filetype)) + (setq ess-local-process-name proc) + (setq inferior-ess-help-filetype temp-ess-help-filetype) + ))))) (defun ess-switch-process () "Force a switch to a new underlying process." diff --git a/lisp/ess-r-d.el b/lisp/ess-r-d.el index 6fcb5b8a2..e9da39c1e 100644 --- a/lisp/ess-r-d.el +++ b/lisp/ess-r-d.el @@ -117,9 +117,12 @@ ;; :enable ess-local-process-name ["Active?" ess-toggle-tracebug :style toggle - :selected (and ess-local-process-name (ess-process-get 'tracebug))] + :selected (and ess-local-process-name + (get-process ess-local-process-name) + (ess-process-get 'tracebug))] ["Show traceback" ess-show-R-traceback ess-local-process-name] ["Watch" ess-watch (and ess-local-process-name + (get-process ess-local-process-name) (ess-process-get 'tracebug))] ["Error action cycle" ess-dbg-toggle-error-action (and ess-local-process-name (ess-process-get 'tracebug))] @@ -145,6 +148,7 @@ ["Active?" ess-toggle-developer :style toggle :selected (and ess-local-process-name + (get-process ess-local-process-name) (ess-process-get 'developer))] ["Add package" ess-developer-add-package t] ["Remove package" ess-developer-remove-package t] From b29ea8f934f7c08a512c73f14e914bca7229b3c1 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sat, 3 Nov 2012 11:13:49 +0000 Subject: [PATCH 13/22] fix popping to inferior buffer on autostart git-svn-id: https://svn.r-project.org/ESS/trunk@5285 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-inf.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el index f90341172..dc96c8841 100644 --- a/lisp/ess-inf.el +++ b/lisp/ess-inf.el @@ -700,8 +700,7 @@ LANGUAGE (and DIALECT)." ;; \--> ess-request-a-process("Process to load into: " no-switch) (error "No ESS processes running; not yet implemented to start (%s,%s)" language dialect))) - ;; fixme: save excursion is not working here !!! bad bad bad !! - ;; (pop-to-buffer cur-buf) + ;; save excursion is not working here !!! bad bad bad !! ))) (defun ess-request-a-process (message &optional noswitch ask-if-1) @@ -763,7 +762,8 @@ Returns the name of the selected process." (setq proc (caar ess-process-name-list))) ;; (with-current-buffer (process-buffer (get-process proc)) ;; (ess-make-buffer-current)) - (unless noswitch + (if noswitch + (pop-to-buffer (current-buffer)) ;; VS: this is weired, but is necessary (ess-pop-to-buffer (buffer-name (process-buffer (get-process proc))) t)) proc))) From 441fa092b5673925a51121348b5698ff9b6a835a Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sat, 3 Nov 2012 11:29:30 +0000 Subject: [PATCH 14/22] solve "'" problem for argument and eldoc completion in Rnw buffer git-svn-id: https://svn.r-project.org/ESS/trunk@5286 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-r-d.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ess-r-d.el b/lisp/ess-r-d.el index e9da39c1e..79e4300c2 100644 --- a/lisp/ess-r-d.el +++ b/lisp/ess-r-d.el @@ -927,8 +927,12 @@ later." (save-restriction (let* ((proc (get-buffer-process (current-buffer))) (mark (and proc (process-mark proc)))) - (if (and mark (>= (point) mark)) + + (if (and mark (>= (point) mark)) (narrow-to-region mark (point))) + + (and ess-noweb-mode + (ess-noweb-narrow-to-chunk)) (when (not (ess-inside-string-p)) (setq ess--funname.start From 4b6e305ee8d719cde58c8a837c6f3f8ad1d6b0f2 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 4 Nov 2012 23:32:38 +0000 Subject: [PATCH 15/22] add a versatile wrapper ess-execute-dialect-specific git-svn-id: https://svn.r-project.org/ESS/trunk@5287 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-utils.el | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/lisp/ess-utils.el b/lisp/ess-utils.el index 65a79b71d..db1c46d04 100644 --- a/lisp/ess-utils.el +++ b/lisp/ess-utils.el @@ -848,7 +848,7 @@ supplementary arguments passed to the commands. (push ev unread-command-events) out)) -(defmacro ess--execute-dialect-specific (command &optional args) +(defmacro ess-execute-dialect-specific (command &optional prompt &rest args) "Execute dialect specific command. -- If command is not defined issue warning 'Not availabe for dialect X' @@ -856,10 +856,38 @@ supplementary arguments passed to the commands. -- If a string strarting with 'http' or 'www' browse with `browse-url', otherwise execute the command in inferior process. -When command is a string ARGS are substituted as in (format -command ,@args). +When command is a string ARGS are substituted by (format ,command ,@args). + +When PROMPT is non-nil ask the user for a string value and +prepend the response to ARGS. + +If prompt is a string just pass it to `read-string'. If a list, pass it +to `ess-completing-read'. " - (error "not implemente yet") + `(if (null ,command) + (message "Sorry, not implemented for dialect %s" ess-dialect) + (let* ((com (if (symbolp ,command) + (symbol-value ,command) + ,command)) + (prompt ',prompt) + (resp (and prompt + (if (stringp prompt) + (read-string prompt) + (apply 'ess-completing-read prompt)))) + (args (append (list resp) ',args))) + (cond ((functionp com) + (apply com args)) + ((and (stringp com) + (string-match "^\\(http\\|www\\)" com)) + (setq com (apply 'format com args)) + (browse-url com)) + ((stringp com) + (unless (string-match "\n$" com) + (setq com (concat com "\n"))) + (setq com (apply 'format com args)) + (ess-eval-linewise com)) + (t + (error "arcument COMMAND must be either a function or a string"))))) ) From 522e4923719b86d082bea1164b531b9630a30335 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 4 Nov 2012 23:32:41 +0000 Subject: [PATCH 16/22] clarified the documentation of ess-library git-svn-id: https://svn.r-project.org/ESS/trunk@5288 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-r-d.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ess-r-d.el b/lisp/ess-r-d.el index 79e4300c2..dcde72632 100644 --- a/lisp/ess-r-d.el +++ b/lisp/ess-r-d.el @@ -1365,8 +1365,16 @@ Currently works only for R." (ess-eval-linewise (format "findFn(\"%s\", maxPages=10)" cmd)) ) + + (defun ess-load-library () - "Prompt and load ess-dialect library/package." + "Prompt and load dialect specific library/package/module. + +Note that add-on code in R are called 'packages' and the name of +this function has nothing to do with R package mechanism, but it +rather serves a generic, dialect independent purpose. It is also +similar to `load-library' emacs function. +" (interactive) (if (not (string-match "^R" ess-dialect)) (message "Sorry, not available for %s" ess-dialect) From 46ddb0b016fe9ea5e7eee56d9aa362211c5219f0 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 4 Nov 2012 23:32:43 +0000 Subject: [PATCH 17/22] Rename ess-sos into ess-R-sos and implement a generic web help search mechanism (C-c C-d w). git-svn-id: https://svn.r-project.org/ESS/trunk@5289 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-help.el | 18 ++++++------------ lisp/ess-r-d.el | 4 +++- lisp/ess-utils.el | 4 ++-- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/lisp/ess-help.el b/lisp/ess-help.el index 3a7990283..5d7109782 100644 --- a/lisp/ess-help.el +++ b/lisp/ess-help.el @@ -560,18 +560,10 @@ For internal use. Used in `ess-display-help-on-object', -;;; THIS WORKS! -;;(require 'w3) - ;(defun ess-display-w3-help-on-object-other-window (object) - ; "Display R-documentation for OBJECT using W3" - ; (interactive "s Help on :") - ; (let* ((ess-help-url (concat ess-help-w3-url-prefix - ; ess-help-w3-url-funs - ; object - ; ".html"))) -;;(w3-fetch-other-window ess-help-url) - ; )) - +(defun ess-help-web-search () + "Search the web for documentation" + (interactive) + (ess-execute-dialect-specific ess-help-web-search-command "Search for: ")) ;;*;; Major mode definition @@ -597,6 +589,8 @@ For internal use. Used in `ess-display-help-on-object', (define-key ess-doc-map "v" 'ess-display-vignettes) (define-key ess-doc-map "\C-o" 'ess-display-demos) (define-key ess-doc-map "o" 'ess-display-demos) + (define-key ess-doc-map "\C-w" 'ess-help-web-search) + (define-key ess-doc-map "w" 'ess-help-web-search) ess-doc-map ) "ESS documentaion map.") diff --git a/lisp/ess-r-d.el b/lisp/ess-r-d.el index dcde72632..3cacede28 100644 --- a/lisp/ess-r-d.el +++ b/lisp/ess-r-d.el @@ -187,6 +187,7 @@ (ess-dump-filename-template . (ess-replace-regexp-in-string "S$" ess-suffix ; in the one from custom: ess-dump-filename-template-proto)) + (ess-help-web-search-command . 'ess-R-sos) (ess-mode-syntax-table . R-syntax-table) (ess-mode-editing-alist . R-editing-alist) (ess-change-sp-regexp . ess-R-change-sp-regexp) @@ -1352,7 +1353,7 @@ Currently works only for R." (message "New CHRAN mirror: %s" (car (ess-get-words-from-vector "getOption('repos')[['CRAN']]\n"))) ))) -(defun ess-sos (cmd) +(defun ess-R-sos (cmd) "Interface to findFn in the library sos." ;(interactive (list (read-from-minibuffer "Web search for:" nil nil t nil (current-word)))) (interactive "sfindFn: ") @@ -1365,6 +1366,7 @@ Currently works only for R." (ess-eval-linewise (format "findFn(\"%s\", maxPages=10)" cmd)) ) +(define-obsolete-function-alias 'ess-sos 'ess-R-sos "ESS[12.09-1]") (defun ess-load-library () diff --git a/lisp/ess-utils.el b/lisp/ess-utils.el index db1c46d04..88885f69e 100644 --- a/lisp/ess-utils.el +++ b/lisp/ess-utils.el @@ -867,7 +867,7 @@ to `ess-completing-read'. `(if (null ,command) (message "Sorry, not implemented for dialect %s" ess-dialect) (let* ((com (if (symbolp ,command) - (symbol-value ,command) + (symbol-function ,command) ,command)) (prompt ',prompt) (resp (and prompt @@ -887,7 +887,7 @@ to `ess-completing-read'. (setq com (apply 'format com args)) (ess-eval-linewise com)) (t - (error "arcument COMMAND must be either a function or a string"))))) + (error "Argument COMMAND must be either a function or a string"))))) ) From 4a1ea8a7e70d7657f10210b1dba0ad57a072862f Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 4 Nov 2012 23:32:46 +0000 Subject: [PATCH 18/22] move all ess-help-search regexp in one place git-svn-id: https://svn.r-project.org/ESS/trunk@5290 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-custom.el | 14 ++++---------- lisp/ess-inf.el | 2 ++ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lisp/ess-custom.el b/lisp/ess-custom.el index 273d286f9..d3717f164 100644 --- a/lisp/ess-custom.el +++ b/lisp/ess-custom.el @@ -1062,9 +1062,6 @@ by `ess-function-template'." :group 'ess :type 'regexp) -;;;; This is tested for S dialects (actually only for R) -- be careful with it! -(defvar ess-help-arg-regexp "\\(['\"]?\\)\\([^,=)'\"]*\\)\\1" - "Reg(ular) Ex(pression) of help(.) arguments. MUST: 2nd \\(.\\) = arg.") ; ess-inf: variables for inferior-ess. @@ -2338,13 +2335,10 @@ the variable `ess-help-own-frame' is non-nil." Choices are `separate-buffer', `s-process', `www'. The latter uses `browse-url' to find the location.") -;; WWW Help NOT included yet. Be patient. -(defvar ess-help-w3-url-prefix "http://pyrite.cfas.washington.edu/ESS/R/" - "*Head URL for finding function help.") - -(defvar ess-help-w3-url-funs "funs/" - "Place to find functions.") - +(defvar ess-help-web-search-command nil + "Dialect specific command web help search. +Passed to `ess-execute-dialect-specific' which see. ") +(make-variable-buffer-local 'ess-help-web-search-command) (defcustom ess-r-args-noargsmsg "No args found." "Message returned if \\[ess-r-args-get] cannot find a list of arguments." diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el index dc96c8841..aacb07030 100644 --- a/lisp/ess-inf.el +++ b/lisp/ess-inf.el @@ -2215,6 +2215,8 @@ to continue it." (process-send-string proc (concat string "\n")))) +(defvar ess-help-arg-regexp "\\(['\"]?\\)\\([^,=)'\"]*\\)\\1" + "Reg(ular) Ex(pression) of help(.) arguments. MUST: 2nd \\(.\\) = arg.") (defconst inferior-R--input-help (format "^ *help *(%s)" ess-help-arg-regexp)) ;; (defconst inferior-R-2-input-help (format "^ *\\? *%s" ess-help-arg-regexp)) (defconst inferior-R--input-?-help-regexp From 4c93a4a59b02e7fcf72c471e032545ba6df5930f Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 4 Nov 2012 23:32:49 +0000 Subject: [PATCH 19/22] define ess-help-web-search-command for julia and stata git-svn-id: https://svn.r-project.org/ESS/trunk@5291 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-julia.el | 1 + lisp/ess-sta-d.el | 1 + 2 files changed, 2 insertions(+) diff --git a/lisp/ess-julia.el b/lisp/ess-julia.el index f5f19211a..3b1223f87 100644 --- a/lisp/ess-julia.el +++ b/lisp/ess-julia.el @@ -333,6 +333,7 @@ (inferior-ess-program . inferior-julia-program-name) (inferior-ess-font-lock-defaults . julia-font-lock-defaults) (ess-get-help-topics-function . 'julia-get-help-topics) + (ess-help-web-search-command . "http://docs.julialang.org/en/latest/search/?q=%s") (inferior-ess-load-command . "load(\"%s\")\n") (ess-dump-error-re . "in \\w* at \\(.*\\):[0-9]+") (ess-error-regexp . "\\(^\\s-*at\\s-*\\(?3:.*\\):\\(?2:[0-9]+\\)\\)") diff --git a/lisp/ess-sta-d.el b/lisp/ess-sta-d.el index bcb079f17..277114387 100644 --- a/lisp/ess-sta-d.el +++ b/lisp/ess-sta-d.el @@ -53,6 +53,7 @@ (ess-help-sec-keys-alist . ess-help-STA-sec-keys-alist) (ess-loop-timeout . 500000 ) (ess-object-name-db-file . "ess-sta-namedb.el" ) + (ess-help-web-search-command . "http://www.stata.com/search/?q=%s&restrict=&btnG=Search&client=stata&num=&output=xml_no_dtd&site=stata&ie=&oe=UTF-8&sort=&proxystylesheet=stata") (inferior-ess-font-lock-defaults . ess-STA-mode-font-lock-defaults) (inferior-ess-program . inferior-STA-program-name) (inferior-ess-objects-command . "describe\n") From edf83e512fcca553cdad255b3ef4de2acf8426c4 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 4 Nov 2012 23:32:51 +0000 Subject: [PATCH 20/22] don't forget to require 'browse-url git-svn-id: https://svn.r-project.org/ESS/trunk@5292 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-utils.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/ess-utils.el b/lisp/ess-utils.el index 88885f69e..2f04770e4 100644 --- a/lisp/ess-utils.el +++ b/lisp/ess-utils.el @@ -880,6 +880,7 @@ to `ess-completing-read'. ((and (stringp com) (string-match "^\\(http\\|www\\)" com)) (setq com (apply 'format com args)) + (require 'browse-url) (browse-url com)) ((stringp com) (unless (string-match "\n$" com) From e66af63a71bb712daafd021b3dc9ca85a29e2e77 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 4 Nov 2012 23:32:54 +0000 Subject: [PATCH 21/22] cosmetics git-svn-id: https://svn.r-project.org/ESS/trunk@5293 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- lisp/ess-custom.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/ess-custom.el b/lisp/ess-custom.el index d3717f164..6187bab73 100644 --- a/lisp/ess-custom.el +++ b/lisp/ess-custom.el @@ -209,14 +209,14 @@ as `ess-imenu-use-S'." (defcustom ess-describe-at-point-method nil - "Whehter `ess-describe-object-at-point' should use tooltip or -not. If nil display in an electric buffer. If 'tooltip display in -an tooltip. + "Whehter `ess-describe-object-at-point' should use a tooltip. +If nil display in an electric buffer. If 'tooltip display in +a tooltip. See also `tooltip-hide-delay' and `tooltip-delay'. " :group 'ess-utils - :type '(choice (const nil) (const tooltip)) + :type '(choice (const :tag "buffer" :value nil ) (const tooltip)) ) (defcustom ess-R-describe-object-at-point-commands From 74d1fc14932c49a4cb168bd459e57fe886ebc4c0 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 4 Nov 2012 23:32:56 +0000 Subject: [PATCH 22/22] started documenting my changes git-svn-id: https://svn.r-project.org/ESS/trunk@5294 0bbaf3bd-34e0-0310-bf65-c717079852d4 --- doc/newfeat.texi | 71 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 9 deletions(-) diff --git a/doc/newfeat.texi b/doc/newfeat.texi index 6d1aee661..af1122f34 100644 --- a/doc/newfeat.texi +++ b/doc/newfeat.texi @@ -1,24 +1,77 @@ @itemize @w{} -Bug Fixes/Changes/New Features in 12.09-1: +Changes/New Features in 12.09-1: +@itemize @bullet +@item @ESS{} @emph{Breaking Changes}: Key changes. + +@itemize @minus +@item New keymaps: +@code{ess-doc-map} bound to @kbd{C-c C-d}; @code{ess-extra-map} bound +to @kbd{C-c C-e}; @code{ess-dump-object-into-edit-buffer} was moved on +@kbd{C-c C-e C-d}. +@item roxygen map was moved on @kbd{C-c C-o} and +@kbd{ess-roxy-update-entry} now resides on @kbd{C-c C-o C-o}. +@item handy commands moved to @kbd{C-c C-a}. +@item @code{ess-dev-map} (including @code{ess-tracebug} and @code{ess-developer}) +moved on @kbd{C-c C-t}. +@end itemize +@item @ESS{[R]} new command @code{ess-describe-object-at-point} +bound to @kbd{C-c C-d C-e} (repeat @kbd{C-e} or @kbd{e} to cycle). It +was inspired by Erik Iverson's @code{ess-R-object-tooltip} which was +floating around for long time. Customize +@code{ess-describe-at-point-method} to use tooltip instead of an +electric buffer. +@item @ESS{}: new command @code{ess-build-tags-for-directory} +bound to @kbd{C-c C-e C-t} for building dialect specific tag +tables. After building tags you can use @kbd{M-.} to navigate to +function and objects definitions. By default @kbd{C-c C-e C-t} builds +tags based on imenu regular expressions and also include other common +languages @code{.c, .o, .cpp} etc. But it relies on external @code{find} +and @code{etags} commands. If @code{ess-build-tags-command} is defined +(default for R), the inferior process is asked to build the tags. See +@code{ess-build-tags-for-directory} for more details. +@item @ESS{[R]}: new evaluation patter @code{nowait}. +In addition to old @code{nil} and @code{t} values, +@code{ess-eval-visibly} accepts @code{nowait} for a visible evaluation +but with now express waiting for the process. See +@code{ess-eval-visibly} for details on evaluation patterns. +@item @iESS{} process buffer now pops up on errors +@item @ESS{}: @code{ess-switch-process} offers @code{*new*} alternative +to start a new process instead of switching to one of the currently +running processes. +@item @ESS{[R]} ess-roxy: new variable @code{ess-roxy-re} for fontification +of cases where the number of leading @kbd{#} differs from +@code{ess-roxy-str}. +@item @ESS{[R]} Eldoc was considerably enhanced. +It now find even hidden default S3 methods and displays other methods' +arguments. +@item @ESS{[Rnw]} Add knitr support. +Customize @code{ess-swv-processor} for the default processor. +@item @ESS{[Rnw]} more thorough renaming of remaining +@code{noweb-*} to @code{ess-noweb-*}. +@item @ESS{[Rnw]} new commands @code{ess-eval-chunk-and-step} and @code{ess-eval-chunk} +bound to @kbd{M-n C-c} and @kbd{M-n C-M-x} to mirror standard ess +commands in C-c map. +@item @ESS{[R]} Auto-completion integration: new variable +@code{ess-ac-R-argument-suffix} to customize the insertion of trailing +"=". Defaults to `` = ``. +@end itemize + +Bug Fixes in 12.09-1: @itemize @bullet @item @iESS{[R]} and @iESS{(Sqpe) [S]} on Windows: The @code{options("editor")} is now initialized to @code{emacsclient} instead of the previous @code{gnuclient}. The user may need to add the line @code{(server-start)} to the emacs initialization file. @code{emacsclient} has been included with emacs since GNU Emacs 22.1. -@item @ESS{[Rnw]} fixed ``connection to R'' bug (in 12.09 only). +@item @ESS{[Rnw]} Fixed ``connection to R'' bug (in 12.09 only). @item @ESS{[Rnw]} New @code{ess-eval-chunk-and-step} function functions. @item @ESS{[Rnw]} Explicit @code{ess-swv-stangle} and @code{ess-swv-sweave} functions. -@item @ESS{[Rnw]} ess-noweb: more thorough renaming of remaining -@code{noweb-*} to @code{ess-noweb-*}. - -@item @ESS{[R]} ess-roxy: new variable @code{ess-roxy-re} for fontification -of cases where the number of leading @kbd{#} differs from @code{ess-roxy-str}. -@item @ESS{[R]} @file{eldoc} rewritten. - +@item @ESS{[R]} is more careful with the @code{R} code injection. +It now happens only once at the start of the session. +@item @ESS{[R]}: Fixed auto-scrolling the comint buffer on evaluation. @end itemize Changes/New Features in 12.09: