/[emacs]/emacs/lisp/strokes.el
ViewVC logotype

Diff of /emacs/lisp/strokes.el

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

revision 1.20 by miles, Fri Jun 10 10:43:03 2005 UTC revision 1.21 by lektu, Mon Jul 4 02:33:29 2005 UTC
# Line 208  static char * stroke_xpm[] = { Line 208  static char * stroke_xpm[] = {
208  ;;; user variables...  ;;; user variables...
209    
210  (defgroup strokes nil  (defgroup strokes nil
211    "Control Emacs through mouse strokes"    "Control Emacs through mouse strokes."
212    :link '(emacs-commentary-link "strokes")    :link '(emacs-commentary-link "strokes")
213    :link '(url-link "http://www.mit.edu/people/cadet/strokes-help.html")    :link '(url-link "http://www.mit.edu/people/cadet/strokes-help.html")
214    :group 'mouse)    :group 'mouse)
# Line 753  Optional EVENT is acceptable as the star Line 753  Optional EVENT is acceptable as the star
753                                (progn                                (progn
754                                  (goto-char point)                                  (goto-char point)
755                                  (subst-char-in-region point (1+ point)                                  (subst-char-in-region point (1+ point)
756                                                        ?\  strokes-character))                                                        ?\s strokes-character))
757                              ;; otherwise, we can start drawing the next time...                              ;; otherwise, we can start drawing the next time...
758                              (setq safe-to-draw-p t))                              (setq safe-to-draw-p t))
759                            (push (cdr (mouse-pixel-position))                            (push (cdr (mouse-pixel-position))
# Line 763  Optional EVENT is acceptable as the star Line 763  Optional EVENT is acceptable as the star
763              ;; clean up strokes buffer and then bury it.              ;; clean up strokes buffer and then bury it.
764              (when (equal (buffer-name) strokes-buffer-name)              (when (equal (buffer-name) strokes-buffer-name)
765                (subst-char-in-region (point-min) (point-max)                (subst-char-in-region (point-min) (point-max)
766                                      strokes-character ?\ )                                      strokes-character ?\s)
767                (goto-char (point-min))                (goto-char (point-min))
768                (bury-buffer))))                (bury-buffer))))
769        ;; Otherwise, don't use strokes buffer and read stroke silently        ;; Otherwise, don't use strokes buffer and read stroke silently
# Line 813  Optional EVENT is acceptable as the star Line 813  Optional EVENT is acceptable as the star
813                          (when point                          (when point
814                            (goto-char point)                            (goto-char point)
815                            (subst-char-in-region point (1+ point)                            (subst-char-in-region point (1+ point)
816                                                  ?\  strokes-character))                                                  ?\s strokes-character))
817                          (push (cdr (mouse-pixel-position))                          (push (cdr (mouse-pixel-position))
818                                pix-locs)))                                pix-locs)))
819                    (setq event (read-event)))                    (setq event (read-event)))
# Line 831  Optional EVENT is acceptable as the star Line 831  Optional EVENT is acceptable as the star
831            ;; protected            ;; protected
832            (when (equal (buffer-name) strokes-buffer-name)            (when (equal (buffer-name) strokes-buffer-name)
833              (subst-char-in-region (point-min) (point-max)              (subst-char-in-region (point-min) (point-max)
834                                    strokes-character ?\ )                                    strokes-character ?\s)
835              (goto-char (point-min))              (goto-char (point-min))
836              (bury-buffer)))))))              (bury-buffer)))))))
837    
# Line 1035  o Strokes are a bit computer-dependent i Line 1035  o Strokes are a bit computer-dependent i
1035    "Erase the contents of the current buffer and fill it with whitespace."    "Erase the contents of the current buffer and fill it with whitespace."
1036    (erase-buffer)    (erase-buffer)
1037    (loop repeat (frame-height) do    (loop repeat (frame-height) do
1038          (insert-char ?\  (1- (frame-width)))          (insert-char ?\s (1- (frame-width)))
1039          (newline))          (newline))
1040    (goto-char (point-min)))    (goto-char (point-min)))
1041    
# Line 1169  the stroke as a character in some langua Line 1169  the stroke as a character in some langua
1169        (insert strokes-xpm-header)        (insert strokes-xpm-header)
1170        (loop repeat 33 do        (loop repeat 33 do
1171              (insert ?\")              (insert ?\")
1172              (insert-char ?\  33)              (insert-char ?\s 33)
1173              (insert "\",")              (insert "\",")
1174              (newline)              (newline)
1175              finally              finally
# Line 1195  the stroke as a character in some langua Line 1195  the stroke as a character in some langua
1195                       ;; Otherwise, just plot the point...                       ;; Otherwise, just plot the point...
1196                       (goto-line (+ 17 y))                       (goto-line (+ 17 y))
1197                       (forward-char (+ 2 x))                       (forward-char (+ 2 x))
1198                       (subst-char-in-region (point) (1+ (point)) ?\  ?\*)))                       (subst-char-in-region (point) (1+ (point)) ?\s ?\*)))
1199                    ((strokes-lift-p point)                    ((strokes-lift-p point)
1200                     ;; a lift--tell the loop to X out the next point...                     ;; a lift--tell the loop to X out the next point...
1201                     (setq lift-flag t))))                     (setq lift-flag t))))
# Line 1286  the stroke as a character in some langua Line 1286  the stroke as a character in some langua
1286  ;;            (command-name (symbol-name (cdr def))))  ;;            (command-name (symbol-name (cdr def))))
1287  ;;        (strokes-xpm-for-stroke stroke " *strokes-xpm*")  ;;        (strokes-xpm-for-stroke stroke " *strokes-xpm*")
1288  ;;        (newline 2)  ;;        (newline 2)
1289  ;;        (insert-char ?\  45)  ;;        (insert-char ?\s 45)
1290  ;;        (beginning-of-line)  ;;        (beginning-of-line)
1291  ;;        (insert command-name)  ;;        (insert command-name)
1292  ;;        (beginning-of-line)  ;;        (beginning-of-line)
# Line 1342  If STROKES-MAP is not given, `strokes-gl Line 1342  If STROKES-MAP is not given, `strokes-gl
1342                                  (prin1-to-string (cdr def)))))                                  (prin1-to-string (cdr def)))))
1343              (strokes-xpm-for-stroke stroke " *strokes-xpm*")              (strokes-xpm-for-stroke stroke " *strokes-xpm*")
1344              (newline 2)              (newline 2)
1345              (insert-char ?\  45)              (insert-char ?\s 45)
1346              (beginning-of-line)              (beginning-of-line)
1347              (insert command-name)              (insert command-name)
1348              (beginning-of-line)              (beginning-of-line)
# Line 1515  Encode/decode your strokes with \\[strok Line 1515  Encode/decode your strokes with \\[strok
1515    
1516  (defsubst strokes-xpm-char-bit-p (char)  (defsubst strokes-xpm-char-bit-p (char)
1517    "Non-nil if CHAR represents an `on' or `off' bit in the XPM."    "Non-nil if CHAR represents an `on' or `off' bit in the XPM."
1518    (or (eq char ?\ )    (or (eq char ?\s)
1519        (eq char ?*)))        (eq char ?*)))
1520    
1521  ;;(defsubst strokes-xor (a b)  ### Should I make this an inline function? ###  ;;(defsubst strokes-xor (a b)  ### Should I make this an inline function? ###
# Line 1716  Store XPM in buffer BUFNAME if supplied Line 1716  Store XPM in buffer BUFNAME if supplied
1716          (insert-char          (insert-char
1717           (if current-char-is-on-p           (if current-char-is-on-p
1718               ?*               ?*
1719             ?\ )             ?\s)
1720           (strokes-xpm-decode-char (char-after)))           (strokes-xpm-decode-char (char-after)))
1721          (delete-char 1)          (delete-char 1)
1722          (setq current-char-is-on-p (not current-char-is-on-p)))          (setq current-char-is-on-p (not current-char-is-on-p)))

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26