Skip to content

Instantly share code, notes, and snippets.

@abicky
Created April 15, 2012 10:05
Show Gist options
  • Save abicky/2391663 to your computer and use it in GitHub Desktop.
Save abicky/2391663 to your computer and use it in GitHub Desktop.
patch for ess-r-d.el (ESS 12.0.4)
--- ess-r-d.el.orig 2012-04-06 08:02:29.000000000 +0900
+++ ess-r-d.el 2012-04-14 22:20:21.000000000 +0900
@@ -511,10 +511,15 @@
(when (and ess-current-process-name
(get-process ess-current-process-name)
(not (ess-process-get 'busy)))
- (let* ((funname (or (and ess-eldoc-show-on-symbol ;; aggressive completion
- (ess-get-object-at-point))
- (car (ess--funname.start))))
- (doc (cadr (ess-function-arguments funname))))
+ (let* ((funname (car (ess--funname.start)))
+ (obj (and ess-eldoc-show-on-symbol ;; aggressive completion
+ (ess-get-object-at-point)))
+ (doc))
+ (if obj
+ (setq doc (cadr (ess-function-arguments obj))))
+ (if doc
+ (setq funname obj)
+ (setq doc (cadr (ess-function-arguments funname))))
;; (comint-preinput-scroll-to-bottom)
(when doc
(ess-eldoc-docstring-format funname doc))
@@ -658,17 +663,20 @@
(defun ess-get-object-at-point ()
"A very permissive version of symbol-at-point.
Suitable for R object's names."
- (let ((delim "[-+ ,\"\t\n\\*/()%{}]"))
+ (let ((delim "[-+ ,\"\t\n\\*/()%{}!]"))
(unless (and (looking-back delim)
(looking-at delim))
(save-excursion
- (let ((beg (re-search-backward delim nil t)))
+ (let ((beg (re-search-backward delim nil t))
+ (end)
+ (funname))
(setq beg (or (and beg (goto-char (1+ beg)))
(goto-char (point-min))))
- (unless (re-search-forward delim nil t)
- (goto-char (point-max)))
- (buffer-substring-no-properties beg (1- (point))))
- ))))
+ (setq end (or (and (re-search-forward delim nil t) (1- (point)))
+ (point-max)))
+ (setq funname (buffer-substring-no-properties beg end))
+ (and (and (not (string-match delim funname)) (not (string= "" funname)))
+ funname))))))
(defvar ess--funname.start nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment