Changed the button event handler so that it would search for a command
authorJason Wilson <edu/mit/csail/zurich/jawilson>
Mon, 9 Aug 1993 19:22:40 +0000 (19:22 +0000)
committerJason Wilson <edu/mit/csail/zurich/jawilson>
Mon, 9 Aug 1993 19:22:40 +0000 (19:22 +0000)
table in the text before calling the ordinary routine.

v7/src/edwin/edtfrm.scm

index 28c5a6bafbbffacebca74097e2f1aaec69689925..30257a78ab161e05f1f8a70fb3965c7e0a78b1e3 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: edtfrm.scm,v 1.85 1993/01/09 01:16:06 cph Exp $
+;;;    $Id: edtfrm.scm,v 1.86 1993/08/09 19:22:40 jawilson Exp $
 ;;;
 ;;;    Copyright (c) 1985, 1989-93 Massachusetts Institute of Technology
 ;;;
          ;; buffer, not in the modeline or other decoration.
          (cond ((and (< -1 relative-x (buffer-frame-x-size frame))
                      (< -1 relative-y (buffer-frame-y-size frame)))
-                (let ((command
-                       (comtab-entry (buffer-comtabs (window-buffer frame))
-                                     button)))
-                  (cond (command
-                         (with-current-button-event
-                          (make-button-event frame relative-x relative-y)
-                          (lambda () (execute-command command))))
-                        ((button/down? button)
-                         (editor-beep)))))
+                (let* ((point (window-coordinates->mark frame relative-x relative-y))
+                       (txtprp-comtab (and point
+                                           (get-property-at
+                                            'command-table
+                                            (mark-index point)
+                                            (mark-group point)))))
+                  (let ((command
+                         (or (and txtprp-comtab (comtab-entry (cadr txtprp-comtab)
+                                                              button))
+                             (comtab-entry (buffer-comtabs (window-buffer frame))
+                                           button))))
+                    (cond (command
+                           (with-current-button-event
+                               (make-button-event frame relative-x relative-y)
+                             (lambda () (execute-command command))))
+                          ((button/down? button)
+                           (editor-beep))))))
                ((button/down? button)
-                (editor-beep)))))))
\ No newline at end of file
+                (editor-beep)))))))