~ubuntu-branches/ubuntu/intrepid/slime/intrepid

« back to all changes in this revision

Viewing changes to swank-source-file-cache.lisp

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2006-12-05 10:35:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20061205103550-qh2ij11czkh5x7ns
Tags: 1:20061201-2
Fix stupid merge error that I missed. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
(defimplementation buffer-first-change (filename)
42
42
  "Load a file into the cache when the user modifies its buffer.
43
43
This is a win if the user then saves the file and tries to M-. into it."
44
 
  (unless (source-cached-p filename)
45
 
    (ignore-errors (source-cache-get filename (file-write-date filename)))))
 
44
  (unless (or (source-cached-p filename)
 
45
              (not (ignore-errors (probe-file filename))))
 
46
    (ignore-errors
 
47
      (source-cache-get filename (file-write-date filename)))))
46
48
 
47
49
(defun get-source-code (filename code-date)
48
50
  "Return the source code for FILENAME as written on DATE in a string.
75
77
 
76
78
(defun read-file (filename)
77
79
  "Return the entire contents of FILENAME as a string."
78
 
  (with-open-file (s filename :direction :input)
 
80
  (with-open-file (s filename :direction :input
 
81
                     :external-format (or (guess-external-format filename)
 
82
                                          (find-external-format "latin-1")
 
83
                                          :default))
79
84
    (let ((string (make-string (file-length s))))
80
85
      (read-sequence string s)
81
86
      string)))