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

Diff of /slime/swank-allegro.lisp

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

revision 1.133 by heller, Sun Mar 7 16:22:10 2010 UTC revision 1.134 by heller, Sun Mar 7 16:22:17 2010 UTC
# Line 394  Line 394 
394    (etypecase fspec    (etypecase fspec
395      (symbol fspec)      (symbol fspec)
396      (list (fspec-primary-name (second fspec)))))      (list (fspec-primary-name (second fspec)))))
   
 ;; If Emacs uses DOS-style eol conventions, \n\r are considered as a  
 ;; single character, but file-position counts them as two.  Here we do  
 ;; our own conversion.  
 (defun count-cr (file pos)  
   (let* ((bufsize 256)  
          (type '(unsigned-byte 8))  
          (buf (make-array bufsize :element-type type))  
          (cr-count 0))  
   (with-open-file (stream file :direction :input :element-type type)  
     (loop for bytes-read = (read-sequence buf stream) do  
           (incf cr-count (count (char-code #\return) buf  
                                 :end (min pos bytes-read)))  
           (decf pos bytes-read)  
           (when (<= pos 0)  
             (return cr-count))))))  
397    
398  (defun find-definition-in-file (fspec type file top-level)  (defun find-definition-in-file (fspec type file top-level)
399    (let* ((part    (let* ((part

Legend:
Removed from v.1.133  
changed lines
  Added in v.1.134

  ViewVC Help
Powered by ViewVC 1.1.5