From 3d67d9292879f4c5ff50c7326091192293419630 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 31 Oct 2010 02:04:40 +0100 Subject: Fix for geiser-edit-module --- elisp/geiser-edit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el index cebcb47..e8e439c 100644 --- a/elisp/geiser-edit.el +++ b/elisp/geiser-edit.el @@ -218,7 +218,7 @@ With prefix, asks for the symbol to edit." (defun geiser-edit-module (module &optional method) "Asks for a module and opens it in a new buffer." (interactive (list (geiser-completion--read-module))) - (let ((cmd `(:eval (:ge module-location (:module ,module))))) + (let ((cmd `(:eval (:ge module-location '(:module ,module))))) (geiser-edit--try-edit module (geiser-eval--send/wait cmd) method))) -- cgit v1.2.3 From af8cd551c9ed6cac332fcb4cfa17c5143b9d48a5 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 31 Oct 2010 02:34:30 +0100 Subject: Autodoc: fix for improper macro arglists scanning --- scheme/guile/geiser/doc.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scheme/guile/geiser/doc.scm b/scheme/guile/geiser/doc.scm index 4722238..f5471b5 100644 --- a/scheme/guile/geiser/doc.scm +++ b/scheme/guile/geiser/doc.scm @@ -87,12 +87,14 @@ (else #f)))) (define (macro-args tf) + (define* (collect args #:optional (req '())) + (cond ((null? args) (arglist->args `(,(reverse req) #f #f r #f))) + ((symbol? args) (arglist->args `(,(reverse req) #f #f r ,args))) + ((and (pair? args) (symbol? (car args))) + (collect (cdr args) (cons (car args) req))) + (else #f))) (let* ((pats (procedure-property tf 'patterns)) - (args (and pats (filter identity - (map (lambda (p) - (and (every symbol? p) - (list (cons 'required p)))) - pats))))) + (args (and pats (filter-map collect pats)))) (or (and args (not (null? args)) args) default-macro-args))) (define (arity->args art) -- cgit v1.2.3 From bc8ff863ec10cb70b89b4af1983ba1fde0cd3841 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 31 Oct 2010 02:42:04 +0100 Subject: Fix for geiser-doc-module --- elisp/geiser-doc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el index 3096a3d..7d42ce5 100644 --- a/elisp/geiser-doc.el +++ b/elisp/geiser-doc.el @@ -225,7 +225,7 @@ help (e.g. browse an HTML page) implementing this method.") (defun geiser-doc--get-module-exports (module) (geiser-eval--send/result - `(:eval (:ge module-exports (:module ,module))))) + `(:eval (:ge module-exports '(:module ,module))))) (defun geiser-doc-symbol (symbol &optional module impl) (let ((module (or module (geiser-eval--get-module))) -- cgit v1.2.3 From 7dbe4a28668ebc601d1f468bd97063bd27c70083 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 31 Oct 2010 03:40:08 +0100 Subject: Documented thanks --- THANKS | 9 +++++++-- doc/Makefile.am | 1 + doc/cheat.texi | 2 +- doc/geiser.texi | 11 ++--------- doc/index.texi | 2 +- doc/web.texi | 2 ++ 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/THANKS b/THANKS index 1f3aa85..1cfd08b 100644 --- a/THANKS +++ b/THANKS @@ -2,6 +2,10 @@ Andy Wingo, Geiser's first user, has been a continuous source of encouragement and suggestions, and keeps improving Guile and heeding my feature requests. +The nice thing about collaborating with Andreas Rottmann over all +these years is that he will not only make your project better with +insightful comments and prodding: he'll send you patches galore too. + Ludovic Courtès, #geiser's citizen no. 1, joined the fun after a while, and has since then been a continuous source of encouragement, ideas and bug reports. @@ -9,7 +13,7 @@ ideas and bug reports. Eduardo Cavazos' contagious enthusiasm has helped in many ways to keep Geiser alive, and he's become its best evangelist in R6RS circles. -Eli Barzilay took the time to play with an early beta and make many +Eli Barzilay took the time to play with an early alpha and made many valuable suggestions, besides answering all my 'how do you in PLT' questions. @@ -18,4 +22,5 @@ answer my inquiries, but provided almost instant fixes to the few issues i found. Thanks also to the PLT and Guile communities, for showing me that -Geiser was not only possible, but a pleasure to hack on. +Geiser was not only possible, but a pleasure to hack on. And to the +Slime hackers, who led the way. diff --git a/doc/Makefile.am b/doc/Makefile.am index 26d2a3f..247b03d 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -21,6 +21,7 @@ geiser_TEXINFOS = \ repl.texi \ fun.texi \ cheat.texi \ + thanks.texi \ index.texi output_dir=$(top_builddir)/doc/html diff --git a/doc/cheat.texi b/doc/cheat.texi index 92e9136..6087949 100644 --- a/doc/cheat.texi +++ b/doc/cheat.texi @@ -1,4 +1,4 @@ -@node Cheat sheet, Index, Fun between the parens, Top +@node Cheat sheet, No hacker is an island, Fun between the parens, Top @chapter Cheat sheet @menu diff --git a/doc/geiser.texi b/doc/geiser.texi index d958a01..2e7ef93 100644 --- a/doc/geiser.texi +++ b/doc/geiser.texi @@ -52,20 +52,12 @@ The document was typeset with * The REPL:: * Fun between the parens:: * Cheat sheet:: +* No hacker is an island:: * Index:: @detailmenu --- The Detailed Node Listing --- -Geiser - -* Introduction:: -* Installation:: -* The REPL:: -* Fun between the parens:: -* Index:: - - Introduction * Modus operandi:: @@ -116,6 +108,7 @@ Cheat sheet @include repl.texi @include fun.texi @include cheat.texi +@include thanks.texi @include index.texi @bye diff --git a/doc/index.texi b/doc/index.texi index 68a3040..d1bf9eb 100644 --- a/doc/index.texi +++ b/doc/index.texi @@ -1,4 +1,4 @@ -@c This is part of Geiser's user manual., , Cheat sheet, Top +@c This is part of Geiser's user manual., , No hacker is an island, Top @c Copyright (C) 2010 Jose Antonio Ortega Ruiz @c See the file geiser.texi for copying conditions. diff --git a/doc/web.texi b/doc/web.texi index b921347..99f5165 100644 --- a/doc/web.texi +++ b/doc/web.texi @@ -14,6 +14,7 @@ * The REPL:: * Fun between the parens:: * Cheat sheet:: +* No hacker is an island:: * Index:: @end menu @@ -35,6 +36,7 @@ list  @include repl.texi @include fun.texi @include cheat.texi +@include thanks.texi @include index.texi @bye -- cgit v1.2.3 From 5d8a2feb0bc211945518f761c7fffcbb2dd3ff32 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 31 Oct 2010 03:48:53 +0100 Subject: Missing, if thankful, texi file --- doc/thanks.texi | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/thanks.texi diff --git a/doc/thanks.texi b/doc/thanks.texi new file mode 100644 index 0000000..e6f0203 --- /dev/null +++ b/doc/thanks.texi @@ -0,0 +1,35 @@ +@node No hacker is an island, Index, Cheat sheet, Top +@chapter No hacker is an island + +Andy Wingo, Geiser's first user, has been a continuous source of +encouragement and suggestions, and keeps improving Guile and heeding +my feature requests. + +The nice thing about collaborating with Andreas Rottmann over all +these years is that he will not only make your project better with +insightful comments and prodding: he'll send you patches galore too. + +Ludovic Courtès, #geiser's citizen no. 1, joined the fun after a +while, and has since then been a continuous source of encouragement, +ideas and bug reports. + +Eduardo Cavazos' contagious enthusiasm has helped in many ways to keep +Geiser alive, and he's become its best evangelist in R6RS circles. + +Eli Barzilay took the time to play with an early alpha and made many +valuable suggestions, besides answering all my 'how do you in PLT' +questions. + +Matthew Flatt, Robby Findler and the rest of the PLT team did not only +answer my inquiries, but provided almost instant fixes to the few +issues i found. + +Thanks also to the PLT and Guile communities, for showing me that +Geiser was not only possible, but a pleasure to hack on. And to the +Slime hackers, who led the way. + + +@c Local Variables: +@c mode: texinfo +@c TeX-master: "geiser" +@c End: -- cgit v1.2.3 From e57b89e952cd050f746033a0d40a817211fb5be1 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 31 Oct 2010 15:08:50 +0100 Subject: Simple tables (not yet used) --- elisp/geiser-table.el | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 elisp/geiser-table.el diff --git a/elisp/geiser-table.el b/elisp/geiser-table.el new file mode 100644 index 0000000..e4d4f43 --- /dev/null +++ b/elisp/geiser-table.el @@ -0,0 +1,137 @@ +;;; geiser-table.el -- table creation + +;; Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the Modified BSD License. You should +;; have received a copy of the license along with this program. If +;; not, see . + +;; Start date: Tue Jan 06, 2009 13:44 + + + +(defun geiser-table--col-widths (rows) + (let* ((col-no (length (car rows))) + (available (- (window-width) 2 (* 2 col-no))) + (widths) + (c 0)) + (while (< c col-no) + (let ((width 0) + (av-width (- available (* 5 (- col-no c))))) + (dolist (row rows) + (setq width + (min av-width + (max width (length (nth c row)))))) + (push width widths) + (setq available (- available width))) + (setq c (1+ c))) + (reverse widths))) + +(defun geiser-table--pad-str (str width) + (let ((len (length str))) + (cond ((= len width) str) + ((> len width) (concat (substring str 0 (- width 3)) "...")) + (t (concat str (make-string (- width (length str)) ?\ )))))) + +(defun geiser-table--str-lines (str width) + (if (<= (length str) width) + (list (geiser-table--pad-str str width)) + (with-temp-buffer + (let ((fill-column width)) + (insert str) + (fill-region (point-min) (point-max)) + (mapcar '(lambda (s) (geiser-table--pad-str s width)) + (split-string (buffer-string) "\n")))))) + +(defun geiser-table--pad-row (row) + (let* ((max-ln (apply 'max (mapcar 'length row))) + (result)) + (dolist (lines row) + (let ((ln (length lines))) + (if (= ln max-ln) (push lines result) + (let ((lines (reverse lines)) + (l 0) + (blank (make-string (length (car lines)) ?\ ))) + (while (< l ln) + (push blank lines) + (setq l (1+ l))) + (push (reverse lines) result))))) + (reverse result))) + +(defun geiser-table--format-rows (rows widths) + (let ((col-no (length (car rows))) + (frows)) + (dolist (row rows) + (let ((c 0) (frow)) + (while (< c col-no) + (push (geiser-table--str-lines (nth c row) (nth c widths)) frow) + (setq c (1+ c))) + (push (geiser-table--pad-row (reverse frow)) frows))) + (reverse frows))) + +(defvar geiser-table-corner-lt "┌") +(defvar geiser-table-corner-lb "└") +(defvar geiser-table-corner-rt "┐") +(defvar geiser-table-corner-rb "┘") +(defvar geiser-table-line "─") +(defvar geiser-table-tee-t "┬") +(defvar geiser-table-tee-b "┴") +(defvar geiser-table-tee-l "├") +(defvar geiser-table-tee-r "┤") +(defvar geiser-table-crux "┼") +(defvar geiser-table-sep "│") + +(defun geiser-table--insert-line (widths first last sep) + (insert first geiser-table-line) + (dolist (w widths) + (while (> w 0) + (insert geiser-table-line) + (setq w (1- w))) + (insert geiser-table-line sep geiser-table-line)) + (delete-char -2) + (insert geiser-table-line last) + (newline)) + +(defun geiser-table--insert-first-line (widths) + (geiser-table--insert-line widths + geiser-table-corner-lt + geiser-table-corner-rt + geiser-table-tee-t)) + +(defun geiser-table--insert-middle-line (widths) + (geiser-table--insert-line widths + geiser-table-tee-l + geiser-table-tee-r + geiser-table-crux)) + +(defun geiser-table--insert-last-line (widths) + (geiser-table--insert-line widths + geiser-table-corner-lb + geiser-table-corner-rb + geiser-table-tee-b)) + +(defun geiser-table--insert-row (r) + (let ((ln (length (car r))) + (l 0)) + (while (< l ln) + (insert (concat geiser-table-sep " " + (mapconcat 'identity + (mapcar `(lambda (x) (nth ,l x)) r) + (concat " " geiser-table-sep " ")) + " " geiser-table-sep "\n")) + (setq l (1+ l))))) + +(defun geiser-table--insert (rows) + (let* ((widths (geiser-table--col-widths rows)) + (rows (geiser-table--format-rows rows widths))) + (geiser-table--insert-first-line widths) + (dolist (r rows) + (geiser-table--insert-row r) + (geiser-table--insert-middle-line widths)) + (kill-line -1) + (geiser-table--insert-last-line widths))) + + +(provide 'geiser-table) +;;; geiser-table.el ends here -- cgit v1.2.3 From dff681a7e5641f350c0d18c178b7401e75b107d6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 31 Oct 2010 15:13:19 +0100 Subject: Always fallback to edit-module in M-. --- elisp/geiser-completion.el | 5 +++++ elisp/geiser-edit.el | 16 ++++++++++++++-- scheme/guile/geiser/doc.scm | 13 +++++++------ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/elisp/geiser-completion.el b/elisp/geiser-completion.el index 5c2f604..d346190 100644 --- a/elisp/geiser-completion.el +++ b/elisp/geiser-completion.el @@ -214,6 +214,11 @@ we're looking for a module name.") (defsubst geiser-completion--symbol-begin (module) (funcall geiser-completion--symbol-begin-function module)) +(defun geiser-completion--module-at-point () + (save-excursion + (goto-char (geiser-completion--symbol-begin t)) + (ignore-errors (thing-at-point 'sexp)))) + (defsubst geiser-completion--prefix (module) (buffer-substring-no-properties (geiser-completion--symbol-begin module) (point))) diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el index e8e439c..4d61edc 100644 --- a/elisp/geiser-edit.el +++ b/elisp/geiser-edit.el @@ -205,8 +205,10 @@ With prefix, asks for the symbol to edit." (geiser-completion--read-symbol "Edit symbol: "))) (cmd `(:eval (:ge symbol-location ',symbol))) (marker (point-marker))) - (geiser-edit--try-edit symbol (geiser-eval--send/wait cmd)) - (when marker (ring-insert find-tag-marker-ring marker)))) + (condition-case nil + (progn (geiser-edit--try-edit symbol (geiser-eval--send/wait cmd)) + (when marker (ring-insert find-tag-marker-ring marker))) + (error (geiser-edit-module-at-point))))) (defun geiser-pop-symbol-stack () "Pop back to where \\[geiser-edit-symbol-at-point] was last invoked." @@ -221,6 +223,16 @@ With prefix, asks for the symbol to edit." (let ((cmd `(:eval (:ge module-location '(:module ,module))))) (geiser-edit--try-edit module (geiser-eval--send/wait cmd) method))) + +(defun geiser-edit-module-at-point () + "Opens a new window visiting the module at point." + (interactive) + (let ((marker (point-marker))) + (geiser-edit-module (or (geiser-completion--module-at-point) + (geiser-completion--read-module))) + (when marker (ring-insert find-tag-marker-ring marker)))) + + (provide 'geiser-edit) ;;; geiser-edit.el ends here diff --git a/scheme/guile/geiser/doc.scm b/scheme/guile/geiser/doc.scm index f5471b5..902f2a3 100644 --- a/scheme/guile/geiser/doc.scm +++ b/scheme/guile/geiser/doc.scm @@ -66,16 +66,17 @@ (else 'variable))) (define (arguments proc) - (define (p-arguments prog) - (map (lambda (a) ((@@ (system vm program) arity->arguments-alist) prog a)) - (or (program-arities prog) '()))) + (define (p-args prog) + (let ((as (map (lambda (a) + ((@@ (system vm program) arity->arguments-alist) prog a)) + (or (program-arities prog) '())))) + (and (not (null? as)) as))) (define (clist f) (lambda (x) (let ((y (f x))) (and y (list y))))) (cond ((is-a? proc ) (generic-args proc)) + ((doc->args proc) => list) ((procedure-property proc 'arglist) => (clist arglist->args)) ((procedure-source proc) => (clist source->args)) - ((doc->args proc) => list) - ((program? proc) (let ((a (p-arguments proc))) - (and (not (null? a)) a))) + ((and (program? proc) (p-args proc))) ((procedure-property proc 'arity) => (clist arity->args)) (else #f))) -- cgit v1.2.3 From 9325189d4b3cfa2207c015b4f60cf397089edc9f Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 31 Oct 2010 15:51:57 +0100 Subject: Informational logs disabled by default Set geiser-log-verbose-p to t to enable all logs. Calling geiser-show-logs with a prefix argument will do that for you. --- elisp/geiser-log.el | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/elisp/geiser-log.el b/elisp/geiser-log.el index 150e6f3..d078b19 100644 --- a/elisp/geiser-log.el +++ b/elisp/geiser-log.el @@ -1,6 +1,6 @@ ;; geiser-log.el -- logging utilities -;; Copyright (C) 2009 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -28,11 +28,11 @@ (defvar geiser-log--max-buffer-size 32000 "Maximum size of the Geiser messages log.") -(defvar geiser-log--max-message-size 512 +(defvar geiser-log--max-message-size 2048 "Maximum size of individual Geiser log messages.") -(defvar geiser-log--verbose-p t - "Log level for Geiser messages") +(defvar geiser-log-verbose-p nil + "Log purely informational messages. Useful for debugging.") (defvar geiser-log--inhibit-p nil "Set this to t to inhibit all log messages") @@ -61,7 +61,9 @@ (defun geiser-log--msg (type &rest args) (unless geiser-log--inhibit-p (geiser-log--with-buffer - (insert (geiser--shorten-str (format "\n%s: %s\n" type (apply 'format args)) + (goto-char (point-max)) + (insert (geiser--shorten-str (format "\n%s: %s\n" type + (apply 'format args)) geiser-log--max-message-size))))) (defsubst geiser-log--warn (&rest args) @@ -71,17 +73,24 @@ (apply 'geiser-log--msg 'ERROR args)) (defsubst geiser-log--info (&rest args) - (when geiser-log--verbose-p + (when geiser-log-verbose-p (apply 'geiser-log--msg 'INFO args) "")) ;;; User commands: -(defun geiser-show-logs () - "Show Geiser log messages." - (interactive) +(defun geiser-show-logs (&optional arg) + "Show Geiser log messages. +With prefix, activates all logging levels." + (interactive "P") + (when arg (setq geiser-log-verbose-p t)) (geiser-log--pop-to-buffer)) +(defun geiser-log-clear () + "Clean all logs." + (interactive) + (geiser-log--with-buffer (delete-region (point-min) (point-max)))) + (provide 'geiser-log) ;;; geiser-log.el ends here -- cgit v1.2.3