summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-28 04:35:45 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-28 04:35:45 +0100
commit9186ce41aabe30f6242fcfc32d80c21e4f63d4d5 (patch)
treee0471ca78c5f4a6d9287b7553f0730ffc86f4c3a
parent5e55181bae7bc30a428854f2bde5cd03c9ff6717 (diff)
downloadgeiser-9186ce41aabe30f6242fcfc32d80c21e4f63d4d5.tar.gz
geiser-9186ce41aabe30f6242fcfc32d80c21e4f63d4d5.tar.bz2
Simpler handling of rest args in Emacs' side.
-rw-r--r--elisp/geiser-autodoc.el33
-rw-r--r--elisp/geiser-doc.el11
-rw-r--r--elisp/geiser-repl.el4
3 files changed, 21 insertions, 27 deletions
diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el
index 3577193..5d5befa 100644
--- a/elisp/geiser-autodoc.el
+++ b/elisp/geiser-autodoc.el
@@ -85,23 +85,13 @@ when `geiser-autodoc-display-module-p' is on."
(cdr geiser-autodoc--last))))))
(defun geiser-autodoc--insert-arg (arg current pos)
- (let ((str (format "%s" arg)))
+ (let ((str (format "%s" (if (eq arg '\#:rest) "." arg))))
(when (= current pos)
(put-text-property 0 (length str)
'face 'geiser-font-lock-autodoc-current-arg
str))
(insert str)))
-(defun geiser-autodoc--insert-args (arg args current pos)
- (when arg
- (geiser-autodoc--insert-arg arg current pos)
- (cond ((null args) (insert ")"))
- ((listp args)
- (insert " ")
- (geiser-autodoc--insert-args (car args) (cdr args) (1+ current) pos))
- (t (insert " . ")
- (geiser-autodoc--insert-args args nil (1+ current) pos)))))
-
(defsubst geiser-autodoc--proc-name (proc module)
(let ((str (if module
(format geiser-autodoc-procedure-name-format module proc)
@@ -116,17 +106,16 @@ when `geiser-autodoc-display-module-p' is on."
(save-current-buffer
(set-buffer (geiser-syntax--font-lock-buffer))
(erase-buffer)
- (let ((proc (car signature))
- (args (cdr signature)))
- (insert (format "(%s " (geiser-autodoc--proc-name proc module)))
- (if args
- (if (listp args)
- (geiser-autodoc--insert-args (car args) (cdr args) 1 pos)
- (insert ". ")
- (geiser-autodoc--insert-arg args 1 1)
- (insert ")"))
- (delete-char -1)
- (insert ")"))
+ (let* ((proc (car signature))
+ (args (cdr signature))
+ (current 1)
+ (pos (if (> pos (length args)) (length args) pos)))
+ (insert (format "(%s" (geiser-autodoc--proc-name proc module)))
+ (dolist (a args)
+ (insert " ")
+ (geiser-autodoc--insert-arg a current pos)
+ (setq current (1+ current)))
+ (insert ")")
(buffer-string)))))
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el
index 4e65b67..6d2eb40 100644
--- a/elisp/geiser-doc.el
+++ b/elisp/geiser-doc.el
@@ -125,9 +125,14 @@
(defun geiser-doc--insert-title (title)
(let ((p (point)))
- (insert (format "%s" title))
- (put-text-property p (point) 'face 'geiser-font-lock-doc-title))
- (newline))
+ (if (not (listp title))
+ (insert (format "%s" title))
+ (insert "(" (format "%s" (car title)))
+ (dolist (a (cdr title))
+ (insert " " (if (eq a '\#:rest) "." (format "%s" a))))
+ (insert ")"))
+ (put-text-property p (point) 'face 'geiser-font-lock-doc-title)
+ (newline)))
(defun geiser-doc--insert-list (title lst module)
(when lst
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index e4617e1..430dc44 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -83,7 +83,7 @@ REPL buffer."
:group 'geiser-repl)
-;;; REPL History:
+;;; REPL history:
(defun geiser-repl--sentinel (proc event)
(when (string= event "finished\n")
@@ -91,7 +91,7 @@ REPL buffer."
(let ((comint-input-ring-file-name geiser-repl-history-filename))
(comint-write-input-ring)
(when (buffer-name (current-buffer))
- (insert "\nIt's been nice to interact with you!\n")
+ (insert "\nIt's been nice interacting with you!\n")
(insert "Press C-cz to bring me back.\n" ))))))
(defun geiser-repl--input-filter (str)