diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2015-01-19 02:46:00 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2015-01-19 02:46:00 +0100 |
commit | 7b9383db986ee9ed9ab5287af64440ae1f94dfd7 (patch) | |
tree | c3604329d6482a30d013d77503f3df452732ee18 /elisp/geiser-racket.el | |
parent | 27b7eacc9c062328d189337e02c2229b4be3e3c7 (diff) | |
download | geiser-guile-7b9383db986ee9ed9ab5287af64440ae1f94dfd7.tar.gz geiser-guile-7b9383db986ee9ed9ab5287af64440ae1f94dfd7.tar.bz2 |
Not cleaning the image cache before displaying images
Image cache cleaning was being performed during comint output filtering
and, since that can happen in batches, if the total output had more
images than the maximum cache size, some of them would be gone (in fact
it was even worse: we were cleaning the cache after each image display).
Now we just perform cache maintenance before sending the input, and
avoid paying a price for non-rackets by making the cache dir setting
implementation-specific.
Diffstat (limited to 'elisp/geiser-racket.el')
-rw-r--r-- | elisp/geiser-racket.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el index 8a0d46d..6a849e3 100644 --- a/elisp/geiser-racket.el +++ b/elisp/geiser-racket.el @@ -1,6 +1,6 @@ ;; geiser-racket.el -- geiser support for Racket scheme -;; 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 @@ -366,6 +366,8 @@ using start-geiser, a procedure in the geiser/server module." (defun geiser-racket--version (binary) (shell-command-to-string (format "%s -e '(display (version))'" binary))) +(defvar geiser-racket--image-cache-dir nil) + (defun geiser-racket--startup (remote) (set (make-local-variable 'compilation-error-regexp-alist) `(("^ *\\([^:(\t\n]+\\):\\([0-9]+\\):\\([0-9]+\\):" 1 2 3))) @@ -373,9 +375,12 @@ using start-geiser, a procedure in the geiser/server module." (if geiser-image-cache-dir (geiser-eval--send/wait `(:eval (image-cache ,geiser-image-cache-dir) geiser/user)) - (setq geiser-image-cache-dir + (setq geiser-racket--image-cache-dir (geiser-eval--send/result '(:eval (image-cache) geiser/user))))) +(defun geiser-racket--image-cache-dir () + (or geiser-image-cache-dir geiser-racket--image-cache-dir)) + ;;; Additional commands @@ -434,6 +439,7 @@ Use a prefix to be asked for a submodule name." (external-help geiser-racket--external-help) (check-buffer geiser-racket--guess) (keywords geiser-racket--keywords) + (image-cache-dir geiser-racket--image-cache-dir) (case-sensitive geiser-racket-case-sensitive-p) (binding-forms geiser-racket--binding-forms) (binding-forms* geiser-racket--binding-forms*)) |