/[slime]/slime/swank-backend.lisp
ViewVC logotype

Diff of /slime/swank-backend.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.109 by heller, Sun Nov 19 21:33:03 2006 UTC revision 1.110 by heller, Tue Dec 5 12:57:57 2006 UTC
# Line 421  Return nil if the file contains no speci Line 421  Return nil if the file contains no speci
421    (with-open-file (s filename :if-does-not-exist nil    (with-open-file (s filename :if-does-not-exist nil
422                       :external-format (or (find-external-format "latin-1-unix")                       :external-format (or (find-external-format "latin-1-unix")
423                                            :default))                                            :default))
424      (or (let* ((line (read-line s nil))      (if s
425                 (p (search "-*-" line)))          (or (let* ((line (read-line s nil))
426            (when p                     (p (search "-*-" line)))
427              (let* ((start (+ p (length "-*-")))                (when p
428                     (end (search "-*-" line :start2 start)))                  (let* ((start (+ p (length "-*-")))
429                (when end                         (end (search "-*-" line :start2 start)))
430                  (%search-coding line start end)))))                    (when end
431          (let* ((len (file-length s))                      (%search-coding line start end)))))
432                 (buf (make-string (min len 3000))))              (let* ((len (file-length s))
433            (file-position s (- len (length buf)))                     (buf (make-string (min len 3000))))
434            (read-sequence buf s)                (file-position s (- len (length buf)))
435            (let ((start (search "Local Variables:" buf :from-end t))                (read-sequence buf s)
436                  (end (search "End:" buf :from-end t)))                (let ((start (search "Local Variables:" buf :from-end t))
437              (and start end (< start end)                      (end (search "End:" buf :from-end t)))
438                   (%search-coding buf start end)))))))                  (and start end (< start end)
439                         (%search-coding buf start end))))))))
440    
441  (defun %search-coding (str start end)  (defun %search-coding (str start end)
442    (let ((p (search "coding:" str :start2 start :end2 end)))    (let ((p (search "coding:" str :start2 start :end2 end)))

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.110

  ViewVC Help
Powered by ViewVC 1.1.5