/[climacs]/climacs/gui.lisp
ViewVC logotype

Diff of /climacs/gui.lisp

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

revision 1.139 by crhodes, Thu May 19 09:04:26 2005 UTC revision 1.140 by crhodes, Thu May 26 08:31:53 2005 UTC
# Line 699  Line 699 
699        (concatenate 'string (pathname-name pathname)        (concatenate 'string (pathname-name pathname)
700                     "." (pathname-type pathname))))                     "." (pathname-type pathname))))
701    
702    (defun syntax-class-name-for-filepath (filepath)
703      (or (climacs-syntax::syntax-description-class-name
704           (find (or (pathname-type filepath)
705                     (pathname-name filepath))
706                 climacs-syntax::*syntaxes*
707                 :test (lambda (x y)
708                         (member x y :test #'string=))
709                 :key #'climacs-syntax::syntax-description-pathname-types))
710          'basic-syntax))
711    
712  (define-named-command com-find-file ()  (define-named-command com-find-file ()
713    (let ((filepath (accept 'completable-pathname    (let ((filepath (accept 'completable-pathname
714                            :prompt "Find File"))                            :prompt "Find File"))
# Line 707  Line 717 
717      (setf (point (buffer pane)) (clone-mark (point pane)))      (setf (point (buffer pane)) (clone-mark (point pane)))
718      (push buffer (buffers *application-frame*))      (push buffer (buffers *application-frame*))
719      (setf (buffer (current-window)) buffer)      (setf (buffer (current-window)) buffer)
720      (setf (syntax buffer) (make-instance      (setf (syntax buffer)
721                             'basic-syntax :buffer (buffer (point pane))))            (make-instance
722               (syntax-class-name-for-filepath filepath)
723               :buffer (buffer (point pane))))
724      ;; Don't want to create the file if it doesn't exist.      ;; Don't want to create the file if it doesn't exist.
725      (when (probe-file filepath)      (when (probe-file filepath)
726        (with-open-file (stream filepath :direction :input)        (with-open-file (stream filepath :direction :input)

Legend:
Removed from v.1.139  
changed lines
  Added in v.1.140

  ViewVC Help
Powered by ViewVC 1.1.5