diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2015-10-12 12:02:18 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2015-10-12 12:02:18 +0200 |
commit | 48ba8943e8ad63f778cf89b6e7dc41313127fffb (patch) | |
tree | c0bc04dd5586ca90758ca7190565443d3e88d1b7 | |
parent | 697d0ac94d2d63bf755931122beafcbe1304b321 (diff) | |
download | geiser-guile-48ba8943e8ad63f778cf89b6e7dc41313127fffb.tar.gz geiser-guile-48ba8943e8ad63f778cf89b6e7dc41313127fffb.tar.bz2 |
Keeping the elisp compiler happy
Mainly by reordering definitions so that functions are not used before
defined. There are a couple of places where the compiler and I
disagree (it complains withing eval-after-load), and a valid complain
about functions defined via geiser-popup--define that should be
addressed).
-rw-r--r-- | elisp/geiser-debug.el | 3 | ||||
-rw-r--r-- | elisp/geiser-eval.el | 28 | ||||
-rw-r--r-- | elisp/geiser-racket.el | 4 | ||||
-rw-r--r-- | elisp/geiser-repl.el | 3 | ||||
-rw-r--r-- | elisp/geiser-syntax.el | 36 |
5 files changed, 38 insertions, 36 deletions
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el index a63e8eb..dbeefba 100644 --- a/elisp/geiser-debug.el +++ b/elisp/geiser-debug.el @@ -1,6 +1,6 @@ ;;; geiser-debug.el -- displaying debug information and evaluation results -;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 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 @@ -18,6 +18,7 @@ (require 'geiser-menu) (require 'geiser-popup) (require 'geiser-base) +(require 'geiser-image) ;;; Customization: diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el index 28da110..29797e6 100644 --- a/elisp/geiser-eval.el +++ b/elisp/geiser-eval.el @@ -1,6 +1,6 @@ ;;; geiser-eval.el -- sending scheme code for evaluation -;; Copyright (C) 2009, 2010, 2011, 2012, 2013 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015 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 @@ -69,16 +69,6 @@ module-exports, autodoc, callers, callees and generic-methods.") ;;; Code formatting: -(defsubst geiser-eval--eval (code) - (geiser-eval--form 'eval - (geiser-eval--module (nth 1 code)) - (geiser-eval--scheme-str (nth 0 code)))) - -(defsubst geiser-eval--comp (code) - (geiser-eval--form 'compile - (geiser-eval--module (nth 1 code)) - (geiser-eval--scheme-str (nth 0 code)))) - (defsubst geiser-eval--load-file (file) (geiser-eval--form 'load-file (geiser-eval--scheme-str file))) @@ -94,6 +84,16 @@ module-exports, autodoc, callers, callees and generic-methods.") ((or (eq code :repl) (eq code :f)) :f) (t (geiser-eval--get-module code))))) +(defsubst geiser-eval--eval (code) + (geiser-eval--form 'eval + (geiser-eval--module (nth 1 code)) + (geiser-eval--scheme-str (nth 0 code)))) + +(defsubst geiser-eval--comp (code) + (geiser-eval--form 'compile + (geiser-eval--module (nth 1 code)) + (geiser-eval--scheme-str (nth 0 code)))) + (defsubst geiser-eval--ge (proc args) (apply 'geiser-eval--form (cons proc (mapcar 'geiser-eval--scheme-str args)))) @@ -154,9 +154,6 @@ module-exports, autodoc, callers, callees and generic-methods.") buffer) geiser-eval--sync-retort) -(defsubst geiser-eval--send/result (code &optional timeout buffer) - (geiser-eval--retort-result (geiser-eval--send/wait code timeout buffer))) - ;;; Retort parsing: @@ -167,6 +164,9 @@ module-exports, autodoc, callers, callees and generic-methods.") (let ((values (cdr (assoc 'result ret)))) (car (geiser-syntax--read-from-string (car values))))) +(defsubst geiser-eval--send/result (code &optional timeout buffer) + (geiser-eval--retort-result (geiser-eval--send/wait code timeout buffer))) + (defun geiser-eval--retort-result-str (ret prefix) (let* ((prefix (or prefix "=> ")) (nlprefix (concat "\n" prefix)) diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el index 80e47b8..ccebcf8 100644 --- a/elisp/geiser-racket.el +++ b/elisp/geiser-racket.el @@ -20,6 +20,8 @@ (require 'geiser-base) (require 'geiser) +(require 'compile) + (eval-when-compile (require 'cl)) @@ -263,7 +265,7 @@ using start-geiser, a procedure in the geiser/server module." ;;; Keywords and syntax -(setq geiser-racket-font-lock-forms +(defvar geiser-racket-font-lock-forms '(("^#lang\\>" . 0) ("\\[\\(else\\)\\>" . 1) ("(\\(define/match\\)\\W+[[(]?\\(\\w+\\)+\\b" diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 2d3f26e..76991c5 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -10,7 +10,6 @@ (require 'geiser-company) -(require 'geiser-compile) (require 'geiser-doc) (require 'geiser-autodoc) (require 'geiser-edit) @@ -424,7 +423,7 @@ module command as a string") (error (insert "Unable to start REPL:\n" (error-message-string err) "\n") - (error "Couldn't start Geiser" err))) + (error "Couldn't start Geiser: %s" err))) (geiser-repl--wait-for-prompt geiser-repl-startup-time))) (defun geiser-repl--wait-for-prompt (timeout) diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el index 81ba8c6..42af4dd 100644 --- a/elisp/geiser-syntax.el +++ b/elisp/geiser-syntax.el @@ -1,6 +1,6 @@ ;;; geiser-syntax.el -- utilities for parsing scheme syntax -;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 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 @@ -289,22 +289,6 @@ implementation-specific entries for font-lock-keywords.") sep (geiser-syntax--mapconcat fun (cdr lst) sep))))) -(defun geiser-syntax--display (a) - (cond ((null a) "()") - ((eq a :t) "#t") - ((eq a :f) "#f") - ((geiser-syntax--keywordp a) (format "#%s" a)) - ((symbolp a) (format "%s" a)) - ((equal a "...") "...") - ((stringp a) (format "%S" a)) - ((and (listp a) (symbolp (car a)) - (equal (symbol-name (car a)) "quote")) - (format "'%s" (geiser-syntax--display (cadr a)))) - ((listp a) - (format "(%s)" - (geiser-syntax--mapconcat 'geiser-syntax--display a " "))) - (t (format "%s" a)))) - ;;; Code parsing: @@ -463,7 +447,23 @@ implementation-specific entries for font-lock-keywords.") '())))))))) -;;; Fontify strings as Scheme code: +;;; Display and fontify strings as Scheme code: + +(defun geiser-syntax--display (a) + (cond ((null a) "()") + ((eq a :t) "#t") + ((eq a :f) "#f") + ((geiser-syntax--keywordp a) (format "#%s" a)) + ((symbolp a) (format "%s" a)) + ((equal a "...") "...") + ((stringp a) (format "%S" a)) + ((and (listp a) (symbolp (car a)) + (equal (symbol-name (car a)) "quote")) + (format "'%s" (geiser-syntax--display (cadr a)))) + ((listp a) + (format "(%s)" + (geiser-syntax--mapconcat 'geiser-syntax--display a " "))) + (t (format "%s" a)))) (defun geiser-syntax--font-lock-buffer () (let ((name " *geiser font lock*")) |