1 |
;;; strokes.el --- control Emacs through mouse strokes |
;;; strokes.el --- control Emacs through mouse strokes |
2 |
|
|
3 |
;; Copyright (C) 1997, 2000 Free Software Foundation, Inc. |
;; Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: David Bakhash <cadet@alum.mit.edu> |
;; Author: David Bakhash <cadet@alum.mit.edu> |
6 |
;; Maintainer: David Bakhash <cadet@alum.mit.edu> |
;; Maintainer: David Bakhash <cadet@alum.mit.edu> |
99 |
;; `strokes-grid-resolution' (determines the grid dimensions that you use |
;; `strokes-grid-resolution' (determines the grid dimensions that you use |
100 |
;; when defining/reading strokes. The finer the grid your computer can |
;; when defining/reading strokes. The finer the grid your computer can |
101 |
;; handle, the more you can do, but even a 3x3 grid is pretty cool.) |
;; handle, the more you can do, but even a 3x3 grid is pretty cool.) |
102 |
;; The default value (7) should be fine for most decent computers. |
;; The default value (9) should be fine for most decent computers. |
103 |
;; NOTE: This variable should not be set to a number less than 3. |
;; NOTE: This variable should not be set to a number less than 3. |
104 |
|
|
105 |
;; `strokes-display-strokes-buffer' will allow you to hide the strokes |
;; `strokes-display-strokes-buffer' will allow you to hide the strokes |
986 |
|
|
987 |
;;;###autoload |
;;;###autoload |
988 |
(defun strokes-do-stroke (event) |
(defun strokes-do-stroke (event) |
989 |
"Read a simple stroke from the user and then exectute its command. |
"Read a simple stroke from the user and then execute its command. |
990 |
This must be bound to a mouse event." |
This must be bound to a mouse event." |
991 |
(interactive "e") |
(interactive "e") |
992 |
(or strokes-mode (strokes-mode t)) |
(or strokes-mode (strokes-mode t)) |
994 |
|
|
995 |
;;;###autoload |
;;;###autoload |
996 |
(defun strokes-do-complex-stroke (event) |
(defun strokes-do-complex-stroke (event) |
997 |
"Read a complex stroke from the user and then exectute its command. |
"Read a complex stroke from the user and then execute its command. |
998 |
This must be bound to a mouse event." |
This must be bound to a mouse event." |
999 |
(interactive "e") |
(interactive "e") |
1000 |
(or strokes-mode (strokes-mode t)) |
(or strokes-mode (strokes-mode t)) |
1027 |
(defun strokes-help () |
(defun strokes-help () |
1028 |
"Get instructional help on using the `strokes' package." |
"Get instructional help on using the `strokes' package." |
1029 |
(interactive) |
(interactive) |
1030 |
(with-output-to-temp-buffer "*Help with Strokes*" |
(let ((helpdoc |
1031 |
(let ((helpdoc |
"This is help for the strokes package. |
|
"This is help for the strokes package. |
|
1032 |
|
|
1033 |
If you find something wrong with strokes, or feel that it can be |
If you find something wrong with strokes, or feel that it can be |
1034 |
improved in some way, then please feel free to email me: |
improved in some way, then please feel free to email me: |
1050 |
right every time. |
right every time. |
1051 |
|
|
1052 |
Strokes also allows you to compose documents graphically. You can |
Strokes also allows you to compose documents graphically. You can |
1053 |
fully edit documents in Chinese, Japanese, etc. based on XEmacs |
fully edit documents in Chinese, Japanese, etc. based on Emacs |
1054 |
strokes. Once you've done so, you can ascii compress-and-encode them |
strokes. Once you've done so, you can ascii compress-and-encode them |
1055 |
and then safely save them for later use, send letters to friends |
and then safely save them for later use, send letters to friends |
1056 |
\(using Emacs, of course). Strokes will later decode these documents, |
\(using Emacs, of course). Strokes will later decode these documents, |
1172 |
by customizing the group named `strokes' via the customization package: |
by customizing the group named `strokes' via the customization package: |
1173 |
|
|
1174 |
> M-x customize")) |
> M-x customize")) |
1175 |
(with-output-to-temp-buffer "*Help" |
(with-output-to-temp-buffer "*Help with Strokes*" |
1176 |
(princ helpdoc) |
(princ helpdoc) |
1177 |
(set-buffer standard-output) |
(set-buffer standard-output) |
1178 |
(help-mode)) |
(help-mode) |
1179 |
(print-help-return-message)))) |
(print-help-return-message)))) |
1180 |
|
|
1181 |
(defun strokes-report-bug () |
(defun strokes-report-bug () |
1285 |
(strokes-load-user-strokes) |
(strokes-load-user-strokes) |
1286 |
(if (and (not (equal current strokes-global-map)) |
(if (and (not (equal current strokes-global-map)) |
1287 |
(or (interactive-p) |
(or (interactive-p) |
1288 |
(yes-or-no-p "save your strokes? "))) |
(yes-or-no-p "Save your strokes? "))) |
1289 |
(progn |
(progn |
1290 |
(require 'pp) ; pretty-print variables |
(require 'pp) ; pretty-print variables |
1291 |
(message "Saving strokes in %s..." strokes-file) |
(message "Saving strokes in %s..." strokes-file) |
1529 |
(buffer-string)) |
(buffer-string)) |
1530 |
'xpm t))) |
'xpm t))) |
1531 |
finally do (kill-region (1+ (point)) (point-max))) |
finally do (kill-region (1+ (point)) (point-max))) |
1532 |
(view-buffer "*Strokes List*" t) |
(view-buffer "*Strokes List*" nil) |
1533 |
(set (make-local-variable 'view-mode-map) |
(set (make-local-variable 'view-mode-map) |
1534 |
(let ((map (copy-keymap view-mode-map))) |
(let ((map (copy-keymap view-mode-map))) |
1535 |
(define-key map "q" `(lambda () |
(define-key map "q" `(lambda () |