[climacs-devel] Re: Lisp Syntax suggestions

Robert Strandh strandh at labri.fr
Thu Jul 28 13:50:59 UTC 2005


Hello, 

John Q Splittist writes:
 > Robert Strandh wrote:
 > > Hello,
 > > 
 > > This patch did not work because it does not seem to be a diff with
 > > respect to what is now the latest version in CVS
 > 
 > Herewith. Like the last one, produced with cvs diff -u.

Are you sure?  See my remarks below...

 > +  (:command-table (global-climacs-table :inherit-from (global-esa-table)))
 > +  (:menu-bar nil)

OK, this one works

 > -(make-command-table 'global-climacs-table :errorp nil :inherit-from '(global-esa-table))
 > -

This one too

 > +(define-gesture-name :select-other :pointer-button-press (:left :meta) :unique nil)
 > +
 > +(define-presentation-translator lisp-string-to-string
 > +    (climacs-lisp-syntax::lisp-string string global-climacs-table
 > +                  :gesture :select-other
 > +                  :tester-definitive t
 > +                  :menu nil
 > +                  :priority 10)
 > +    (object)
 > +  object)
 > +

This bunch is already in the file except with a 10 instead of 11, so
why is this code marked with `+'?

 > +(define-named-command com-accept-lisp-string ()
 > +  (display-message (format nil "~s" (accept 'lisp-string))))

This one is already in there too, except marked with
lisp-syntax::lisp-string. 

 > +(define-presentation-type unknown-symbol () :inherit-from 'symbol
 > +                          :description "unknown symbol")
 > +
 > +(define-presentation-method presentation-typep (object (type unknown-symbol))
 > +  (or (symbolp object) (stringp object)))
 > +

Same with this.

 > -      (cond ((eql (buffer-object (buffer syntax) (start-offset parse-symbol)) #\:)
 > -            (with-drawing-options (pane :ink +dark-violet+)
 > -              (call-next-method)))
 > -           ((eql (buffer-object (buffer syntax) (start-offset parse-symbol)) #\&)
 > -            (with-drawing-options (pane :ink +dark-green+)
 > -              (call-next-method)))
 > -           (t (call-next-method)))
 > +      (let ((string (coerce (buffer-sequence (buffer syntax)
 > +                                             (start-offset parse-symbol)
 > +                                             (end-offset parse-symbol))
 > +                            'string)))
 > +        (multiple-value-bind (symbol status)
 > +            (token-to-symbol syntax parse-symbol)
 > +          (with-output-as-presentation
 > +              (pane (if status symbol string) (if status 'symbol 'unknown-symbol)
 > +               :single-box :highlighting)
 > +            (cond ((eql (buffer-object (buffer syntax) (start-offset parse-symbol)) #\:)
 > +                   (with-drawing-options (pane :ink +dark-violet+)
 > +                     (call-next-method)))
 > +                  ((eql (buffer-object (buffer syntax) (start-offset parse-symbol)) #\&)
 > +                   (with-drawing-options (pane :ink +dark-green+)
 > +                     (call-next-method)))
 > +                  (t (call-next-method)))
 > +            )))

The code in CVS looks more like the one marked with `+' than the one
marked with `-'

 > -         (multiple-value-bind (symbol status)
 > -             (token-to-symbol syntax parser-symbol)
 > -           (declare (ignore symbol))
 > -           (if (and status (typep parser-symbol 'form))
 > -               (present string 'symbol :stream pane)
 > -               (present string 'string :stream pane))))))))
 > -
 > +          (present string 'string :stream pane))))))
 > +          

This does not look familiar at all. 

 > +(define-presentation-type lisp-string () 
 > +                          :description "lisp string")
 > +

This one is already in there

 >  (defmethod display-parse-tree ((parse-symbol complete-string-form) (syntax lisp-syntax) pane)
 >    (let ((children (children parse-symbol)))
 > -    (display-parse-tree  (pop children) syntax pane)
 > -    (with-text-face (pane :italic)
 > -      (loop until (null (cdr children))
 > -           do (display-parse-tree (pop children) syntax pane)))
 > -    (display-parse-tree (pop children) syntax pane)))
 > +    (if (third children)
 > +        (let ((string (coerce (buffer-sequence (buffer syntax)
 > +                                               (start-offset (second children))
 > +                                               (end-offset (car (last children 2))))
 > +                              'string)))
 > +          (with-output-as-presentation (pane string 'lisp-string
 > +                                             :single-box :highlighting)
 > +            (display-parse-tree  (pop children) syntax pane)
 > +            (with-text-face (pane :italic)
 > +              (loop until (null (cdr children))
 > +                 do (display-parse-tree (pop children) syntax pane)))
 > +            (display-parse-tree (pop children) syntax pane)))
 > +        (progn (display-parse-tree (pop children) syntax pane)
 > +               (display-parse-tree (pop children) syntax pane)))))

The code in CVS looks more like the one marked with `+' than the one
marked with `-'.

 > -    (display-parse-tree  (pop children) syntax pane)
 > -    (with-text-face (pane :italic)
 > -      (loop until (null children)
 > -           do (display-parse-tree (pop children) syntax pane)))))
 > +    (if (second children)
 > +        (let ((string (coerce (buffer-sequence (buffer syntax)
 > +                                               (start-offset (second children))
 > +                                               (end-offset (car (last children))))
 > +                              'string)))
 > +          (with-output-as-presentation (pane string 'lisp-string
 > +                                             :single-box :highlighting)
 > +            (display-parse-tree  (pop children) syntax pane)
 > +            (with-text-face (pane :italic)
 > +              (loop until (null children)
 > +                 do (display-parse-tree (pop children) syntax pane)))))
 > +        (display-parse-tree  (pop children) syntax pane))))

same here. 

 > -  (:export))
 > +  (:export :lisp-string))

This one might work.

 > -       :climacs-kill-ring :climacs-pane :clim-extensions :undo :esa))
 > +       :climacs-kill-ring :climacs-pane :clim-extensions :undo :esa)
 > +  (:import-from :climacs-lisp-syntax :lisp-string))

This one too. 

-- 
Robert Strandh

---------------------------------------------------------------------
Greenspun's Tenth Rule of Programming: any sufficiently complicated C
or Fortran program contains an ad hoc informally-specified bug-ridden
slow implementation of half of Common Lisp.
---------------------------------------------------------------------



More information about the climacs-devel mailing list