?
Current Path : /usr/share/emacs/24.3/lisp/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : //usr/share/emacs/24.3/lisp/strokes.elc |
;ELC ;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:06:31 2024 ;;; from file /builddir/build/BUILD/emacs-24.3/lisp/strokes.el ;;; in Emacs version 24.3.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (autoload 'mail-position-on-field "sendmail") #@130 Symbol representing a stroke lift event for complex strokes. Complex strokes are those which contain two or more simple strokes. (defconst strokes-lift :strokes-lift (#$ . 597)) #@51 The header to all xpm buffers created by strokes. (defconst strokes-xpm-header "/* XPM */\nstatic char * stroke_xpm[] = {\n/* width height ncolors cpp [x_hot y_hot] */\n\"33 33 9 1 26 23\",\n/* colors */\n\" c none s none\",\n\"* c #000000 s foreground\",\n\"R c #FFFF00000000\",\n\"O c #FFFF80000000\",\n\"Y c #FFFFFFFF0000\",\n\"G c #0000FFFF0000\",\n\"B c #00000000FFFF\",\n\"P c #FFFF0000FFFF\",\n\". c #45458B8B0000\",\n/* pixels */\n" (#$ . 781)) (byte-code "\302\303\304\305\306\307\310\311&\210\312\313\314\304#\210\315\304\211\2037 @\313N\2030 \314N\2040 \316\314\313N#\210 A\211\204 *\317\313\314\320#\210\321\314\322\323\324\325\310\303&\210\321\326\327\330\324\331\310\303&\210\321\332\333\334\324\335\310\303&\210\321\336\337\340\324\335\310\303&\210\321\341\342\343\324\344\310\303&\207" [prop --dolist-tail-- custom-declare-group strokes nil "Control Emacs through mouse strokes." :link (emacs-commentary-link "strokes") :group mouse defvaralias strokes-modeline-string strokes-lighter (saved-value saved-variable-comment) put make-obsolete-variable "24.3" custom-declare-variable " Strokes" "Mode line identifier for Strokes mode." :type string strokes-character 64 "Character used when drawing strokes in the strokes buffer.\n(The default is `@', which works well.)" character strokes-minimum-match-score 1000 "Minimum score for a stroke to be considered a possible match.\nSetting this variable to 0 would require a perfectly precise match.\nThe default value is 1000, but it's mostly dependent on how precisely\nyou manage to replicate your user-defined strokes. It also depends on\nthe value of `strokes-grid-resolution', since a higher grid resolution\nwill correspond to more sample points, and thus more distance\nmeasurements. Usually, this is not a problem since you first set\n`strokes-grid-resolution' based on what your computer seems to be able\nto handle (though the defaults are usually more than sufficient), and\nthen you can set `strokes-minimum-match-score' to something that works\nfor you. The only purpose of this variable is to insure that if you\ndo a bogus stroke that really doesn't match any of the predefined\nones, then strokes should NOT pick the one that came closest." integer strokes-grid-resolution 9 "Integer defining dimensions of the stroke grid.\nThe grid is a square grid, where `strokes-grid-resolution' defaults to\n`9', making a 9x9 grid whose coordinates go from (0 . 0) on the top\nleft to ((strokes-grid-resolution - 1) . (strokes-grid-resolution - 1))\non the bottom right. The greater the resolution, the more intricate\nyour strokes can be.\nNOTE: This variable should be odd and MUST NOT be less than 3 and need\n not be greater than 33, which is the resolution of the pixmaps.\nWARNING: Changing the value of this variable will gravely affect the\n strokes you have already programmed in. You should try to\n figure out what it should be based on your needs and on how\n quick the particular platform(s) you're operating on, and\n only then start programming in your custom strokes." strokes-file (convert-standard-filename "~/.strokes") "File containing saved strokes for Strokes mode (default is ~/.strokes)." file] 9) #@56 The name of the buffer that the strokes take place in. (defvar strokes-buffer-name " *strokes*" (#$ . 4033)) #@249 If non-nil, the strokes buffer is used and strokes are displayed. If nil, strokes will be read the same, however the user will not be able to see the strokes. This be helpful for people who don't like the delay in switching to the strokes buffer. (custom-declare-variable 'strokes-use-strokes-buffer t '(#$ . 4149) :type 'boolean :group 'strokes) #@138 The special window configuration used when entering strokes. This is set properly in the function `strokes-update-window-configuration'. (defvar strokes-window-configuration nil (#$ . 4504)) #@161 Last stroke entered by the user. Its value gets set every time the function `strokes-fill-stroke' gets called, since that is the best time to set the variable. (defvar strokes-last-stroke nil (#$ . 4702)) #@288 Association list of strokes and their definitions. Each entry is (STROKE . COMMAND) where STROKE is itself a list of coordinates (X . Y) where X and Y are lists of positions on the normalized stroke grid, with the top left at (0 . 0). COMMAND is the corresponding interactive function. (defvar strokes-global-map nil (#$ . 4914)) #@48 Functions to be called when Strokes is loaded. (defvar strokes-load-hook nil (#$ . 5251)) #@36 Non-nil if STROKE is really click. (defalias 'strokes-click-p #[(stroke) "G\301W\207" [stroke 2] 2 (#$ . 5347)]) (put 'strokes-click-p 'byte-optimizer 'byte-compile-inline-expand) (defalias 'strokes-remassoc #[(key list) "\303\304 \n\"\211\203 \305\n\"\202 )\n\207" [elt key list nil assoc delete] 3]) (put 'strokes-remassoc 'byte-optimizer 'byte-compile-inline-expand) #@56 Add STROKE to STROKE-MAP alist with given command DEF. (defalias 'strokes-define-stroke '(macro . #[(stroke-map stroke def) "\303\304D\305\306 \307\211\nE\310 EEEF\207" [stroke stroke-map def if strokes-click-p (error "That's a click, not a stroke") setq cons strokes-remassoc] 10 (#$ . 5730)])) #@36 Return the square of the number X. (defalias 'strokes-square #[(x) "\211_\207" [x] 2 (#$ . 6035)]) (put 'strokes-square 'byte-optimizer 'byte-compile-inline-expand) #@104 Gets the distance (squared) between to points P1 and P2. P1 and P2 are cons cells in the form (X . Y). (defalias 'strokes-distance-squared #[(p1 p2) "@A @ A Z\211\211_)\n\fZ\211\211_)\\,\207" [p1 p2 y2 x2 y1 x1 x] 5 (#$ . 6208)]) (put 'strokes-distance-squared 'byte-optimizer 'byte-compile-inline-expand) (defalias 'strokes-mouse-event-p #[(event) ":\205* @9\205* @\301=\206* \302@\303N>\206* \304@\303N>\206* \305@\303N>\207" [event mouse-movement click event-symbol-elements down drag] 3]) (put 'strokes-mouse-event-p 'byte-optimizer 'byte-compile-inline-expand) (defalias 'strokes-button-press-event-p #[(event) ":\205 @9\205 \301@\302N>\207" [event down event-symbol-elements] 3]) (put 'strokes-button-press-event-p 'byte-optimizer 'byte-compile-inline-expand) (defalias 'strokes-button-release-event-p #[(event) ":\205 @9\205 \301@\302N>\206 \303@\302N>\207" [event click event-symbol-elements drag] 3]) (put 'strokes-button-release-event-p 'byte-optimizer 'byte-compile-inline-expand) #@110 Return position of start of line LINE in WINDOW. If LINE is nil, return the last position visible in WINDOW. (defalias 'strokes-event-closest-point-1 #[(window &optional line) "\304!\305!\203 \306\202 \307Z\n\206 \212\310!b\210\311!U\203+ \n\204+ \312u\210`+\207" [window total line distance window-height window-minibuffer-p 0 1 window-start vertical-motion -1] 3 (#$ . 7236)]) #@173 Return the nearest position to where EVENT ended its motion. This is computed for the window where EVENT's motion started, or for window START-WINDOW if that is specified. (defalias 'strokes-event-closest-point #[(event &optional start-window) "\204\f \306 !\211@)\307 !\211@)=\203\205 \307 !\310\n8\2063 \nA@:\2030 \nA@@\2023 \nA@)\311=\203C \312\313\307 !!A\"\207\307 !\310\n8\206^ \nA@:\203[ \nA@@\202^ \nA@)\314=\203h \312!\207\307 !\310\n8\206\203 \nA@:\203\200 \nA@@\202\203 \nA@)\207\307 !\211@)\315\316!A@\317!\203\243 \316!A@\202\260 \307 !\320\n8)A\321!\245\211 Y\203\275 \312!\202\300 \322!+\207" [start-window event position end-w end-w-top w-top event-start event-end 5 vertical-line strokes-event-closest-point-1 posn-col-row mode-line nil window-edges windowp 2 frame-char-height window-start] 6 (#$ . 7633)]) #@44 Return non-nil if OBJECT is a stroke-lift. (defalias 'strokes-lift-p #[(object) " =\207" [object strokes-lift] 2 (#$ . 8486)]) #@34 Undo the last stroke definition. (defalias 'strokes-unset-last-stroke #[nil "\211@A)\303\304\305\n\"!\203 A\306\307!\202 \306\310!)\207" [strokes-global-map x command y-or-n-p format "Really delete last stroke definition, defined to `%s'? " message "That stroke has been deleted" "Nothing done"] 5 (#$ . 8620) nil]) #@358 Interactively give STROKE the global binding as COMMAND. Operated just like `global-set-key', except for strokes. COMMAND is a symbol naming an interactively-callable function. STROKE is a list of sampled positions on the stroke grid as described in the documentation for the `strokes-define-stroke' function. See also `strokes-global-set-stroke-string'. (defalias 'strokes-global-set-stroke #[(stroke command) "\211G\306W)\203 \307\310!\207 B\n\311\312\f\"\211\203( \313 \"\202 )*B\211\207" [stroke command strokes-global-map list key elt 2 error "That's a click, not a stroke" nil assoc delete] 5 (#$ . 8950) (list (and (or strokes-mode (strokes-mode t)) (strokes-read-complex-stroke "Draw with mouse button 1 (or 2). End with button 3...")) (read-command "Command to map stroke to: "))]) #@336 Interactively give STROKE the global binding as STRING. Operated just like `global-set-key', except for strokes. STRING is a string to be inserted by the stroke. STROKE is a list of sampled positions on the stroke grid as described in the documentation for the `strokes-define-stroke' function. Compare `strokes-global-set-stroke'. (defalias 'strokes-global-set-stroke-string #[(stroke string) "\211G\306W)\203 \307\310!\207 B\n\311\312\f\"\211\203( \313 \"\202 )*B\211\207" [stroke string strokes-global-map list key elt 2 error "That's a click, not a stroke" nil assoc delete] 5 (#$ . 9766) (list (and (or strokes-mode (strokes-mode t)) (strokes-read-complex-stroke "Draw with mouse button 1 (or 2). End with button 3...")) (read-string "String to map stroke to: "))]) #@345 Map POSITION to a new grid position. Do so based on its STROKE-EXTENT and GRID-RESOLUTION. STROKE-EXTENT as a list ((XMIN . YMIN) (XMAX . YMAX)). If POSITION is a `strokes-lift', then it is itself returned. Optional GRID-RESOLUTION may be used in place of `strokes-grid-resolution'. The grid is a square whose dimension is [0,GRID-RESOLUTION). (defalias 'strokes-get-grid-position #[(stroke-extent position &optional grid-resolution) ":\203Y \206\n \n@A\211@@)\211@A)\211A@)@T\211A@)AT \n\f\306 \307\fZ! Z\245_!\306 \307\f\nZ! \nZ\245_!.B\207\310!\205a \207" [position grid-resolution strokes-grid-resolution stroke-extent x ymax floor float strokes-lift-p xmax ymin xmin y strokes-lift] 8 (#$ . 10563)]) #@132 From a list of absolute PIXEL-POSITIONS, return absolute spatial extent. The return value is a list ((XMIN . YMIN) (XMAX . YMAX)). (defalias 'strokes-get-stroke-extent #[(pixel-positions) "\205\264 \211@@)\211@@)\211@A)\211@A)A\n\203k \n@:\203d \n\211@@)\n\211@A)\211W\203G V\203O \fW\203Y V\203c *\nA\211\204( Z\fZ \211\n V\203\224 \f\n Z\306\245Z\n Z\306\245\\\202\252 \nZ\306\245Z \nZ\306\245\\\fB .BD\207" [pixel-positions x rest ymax ymin xmax 2 xmin y delta-y delta-x] 6 (#$ . 11307)]) #@54 Return a list with no consecutive redundant entries. (defalias 'strokes-eliminate-consecutive-redundancies #[(entries) "\304 :\203! @ \211A@)\232\204 @\nB A\211\202 \n\237*\207" [entries element #1=#:--cl-var-- x nil] 3 (#$ . 11876)]) #@264 Map POSITIONS to a new grid whose dimensions are based on GRID-RESOLUTION. POSITIONS is a list of positions and stroke-lifts. Optional GRID-RESOLUTION may be used in place of `strokes-grid-resolution'. The grid is a square whose dimension is [0,GRID-RESOLUTION). (defalias 'strokes-renormalize-to-grid #[(positions &optional grid-resolution) "\204 \304\n!\305\306\n\")\207" [grid-resolution strokes-grid-resolution positions stroke-extent strokes-get-stroke-extent mapcar #[(pos) "\303 \n#\207" [stroke-extent pos grid-resolution strokes-get-grid-position] 4]] 3 (#$ . 12128)]) #@205 Fill in missing grid locations in the list of UNFILLED-STROKE. If FORCE is non-nil, then fill the stroke even if it's `stroke-click'. NOTE: This is where the global variable `strokes-last-stroke' is set. (defalias 'strokes-fill-stroke #[(unfilled-stroke &optional force) "\211G\306W)\203 \n\204 \202k\307:\203h@\211: \211A@)\211: \2056 \205? @ \205H A\205R @\205\\ A\205h Z\205t Z\205\212 \310!?\205\212 \311!\245\204\226 C\202[\204\374 \312Y\203\317 \307W\203\310 BBT\211\202\257 \237+\202[\307V\203\365 BBS\211\202\334 \237+\202[\310!\203d\312Y\2037\307W\2030BBT\211\202\237+\202[ \307! V\203]B!B!S\211\202D!\237+\202[\313!\313!Y\203\347\312V\203\257\"\307#\"W\203\250\314Z_!\\B#B#T\211\202\204#\237+\202[$\307%$V\203\340\314Z_!\\B%B%S\211\202\274%\237+\202[\312V\203&&\307'&W\203\314Z\245!\\B'B'T\211\202\373'\237+\202[(\307)(V\203W\314Z\245!\\B)B)S\211\2023)\237+.\f\237\f\244A\211\202 \f\237*\211*\207" [unfilled-stroke stroke force grid-locs #1=#:--cl-var-- current 2 nil zerop float 0 abs round current-is-a-point-p x next next-is-a-point-p both-are-points-p x1 y1 x2 y2 delta-x delta-y slope y #2=#:--cl-var-- #3=#:--cl-var-- #4=#:--cl-var-- #5=#:--cl-var-- #6=#:--cl-var-- #7=#:--cl-var-- #8=#:--cl-var-- #9=#:--cl-var-- #10=#:--cl-var-- #11=#:--cl-var-- #12=#:--cl-var-- #13=#:--cl-var-- #14=#:--cl-var-- #15=#:--cl-var-- #16=#:--cl-var-- #17=#:--cl-var-- strokes-last-stroke] 7 (#$ . 12719)]) #@265 Rates STROKE1 with STROKE2 and return a score based on a distance metric. Note: the rating is an error rating, and therefore, a return of 0 represents a perfect match. Also note that the order of stroke arguments is order-independent for the algorithm used here. (defalias 'strokes-rate-stroke #[(stroke1 stroke2) "\205\355 \205\355A A@ @\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\f \203G\f\203G @:\203\230 \f@:\203\230 @\f@\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\\ \fA A\f\202G \306 @!\203\265 \306\f@!\203\265 A \fA\f\202= \306\f@!\203\376 @:\203= @ @\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\\ A\211 \202\277 \306 @!\203= \f@:\203= @\f@\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\\\fA\211\f\202\f\204\215 @:\203\215 @ @\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\\ A\211 \202N \204\323\f@:\203\323@\f@\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\\\fA\211\f\202\224\306 @!\204\343\306\f@!\203\352\307\211\202\354+\207" [stroke1 stroke2 p2 p1 y2 x2 strokes-lift-p nil y1 x1 x err rest2 rest1] 7 (#$ . 14472)]) #@111 Find the best matching command of STROKE in STROKE-MAP. Returns the corresponding match as (COMMAND . SCORE). (defalias 'strokes-match-stroke #[(stroke stroke-map) "\205\\ \205\\ \306 \211@@)\" \211@A) A\203T \306\211@@)\"\211\203: \203: W\204C \203M \204M \211@A)A)\202 \205[ \f B+\207" [stroke stroke-map x map command score strokes-rate-stroke newscore] 4 (#$ . 15694)]) #@71 Erase the contents of the current buffer and fill it with whitespace. (defalias 'strokes-fill-current-buffer-with-whitespace #[nil "\301 \210\302 S\211\303Y\203 \304\305\306 S\"\210\307 \210\202 )eb\207" [#1=#:--cl-var-- erase-buffer frame-height 0 insert-char 32 frame-width newline] 3 (#$ . 16105)]) (put 'strokes-fill-current-buffer-with-whitespace 'byte-optimizer 'byte-compile-inline-expand) #@354 Read a simple stroke (interactively) and return the stroke. Optional PROMPT in minibuffer displays before and during stroke reading. This function will display the stroke interactively as it is being entered in the strokes buffer if the variable `strokes-use-strokes-buffer' is non-nil. Optional EVENT is acceptable as the starting event of the stroke. (defalias 'strokes-read-stroke #[(&optional prompt event) "\212\306\211\211\203\216 \307 \310\216\311 !\210\312\313\314 \315 Z!V\204C \316 \210\317 %%S\211%\320Y\203? \321\322\323 S\"\210\324 \210\202' )eb\210&\203p \325\326&\"\210\327 \211'\211':\205h '@9\205h \330'@\331N>)\204p \332\333!\210\306\216\334\335!\210)\336 (\232\203\215 \337ed)\322$\210eb\210\340 \210*&\203\273 \325\326&\"\210\327 \211'\211':\205\263 '@9\205\263 \330'@\331N>)\204\273 \332\333!\210\334\341!\210\342\n\237!\343\344 !!,\207" [safe-to-draw-p grid-locs pix-locs strokes-use-strokes-buffer #1=#:wconfig strokes-window-configuration nil current-window-configuration ((set-window-configuration #1#)) set-window-configuration 1 abs line-end-position window-width erase-buffer frame-height 0 insert-char 32 frame-width newline message "%s" read-event down event-symbol-elements error "You must draw with the mouse" eval (track-mouse (byte-code "\204 \305 \306\211:\205% @9\205% \307@\310N>\206% \311@\310N>)?\205\204 \211:\205V @9\205V @\312=\206V \307@\310N>\206V \313@\310N>\206V \311@\310N>)\203} \314!\211\203t \203t \nb\210\315\n\211T\316$\210\202v \306\317 A\fB)\305 \211\202\n \207" [event safe-to-draw-p point strokes-character pix-locs read-event t click event-symbol-elements drag mouse-movement down strokes-event-closest-point subst-char-in-region 32 mouse-pixel-position] 6)) buffer-name subst-char-in-region bury-buffer (track-mouse (byte-code "\204 \302 \211:\205# @9\205# \303@\304N>\206# \305@\304N>)?\205e \211:\205T @9\205T @\306=\206T \303@\304N>\206T \307@\304N>\206T \305@\304N>)\203^ \310 A B\302 \211\202 \207" [event pix-locs read-event click event-symbol-elements drag mouse-movement down mouse-pixel-position] 4)) strokes-renormalize-to-grid strokes-fill-stroke strokes-eliminate-consecutive-redundancies #2=#:--cl-var-- prompt event strokes-buffer-name strokes-character] 6 (#$ . 16514)]) #@389 Read a complex stroke (interactively) and return the stroke. Optional PROMPT in minibuffer displays before and during stroke reading. Note that a complex stroke allows the user to pen-up and pen-down. This is implemented by allowing the user to paint with button 1 or button 2 and then complete the stroke with button 3. Optional EVENT is acceptable as the starting event of the stroke. (defalias 'strokes-read-complex-stroke #[(&optional prompt event) "\212\306 \307\216\310 !\210\311\211\f\2035 \211:\205% @9\205% \312 @\313N>)\2045 \314\315\f\"\210\316 \211\202 \317\216\320\321!.\207" [#1=#:wconfig strokes-window-configuration grid-locs pix-locs prompt event current-window-configuration ((set-window-configuration #1#)) set-window-configuration nil down event-symbol-elements message "%s" read-event ((byte-code "\302 \232\203 \303ed \304$\210eb\210\305 \210\302\207" [strokes-buffer-name strokes-character buffer-name subst-char-in-region 32 bury-buffer] 5)) eval (track-mouse (byte-code "\204 \306 \211:\205 @9\205 \307@\310N>)\203( @\310N@\311=\204\273 \211:\205D @9\205D \312@\310N>\206D \313@\310N>)\204\231 \211:\205t @9\205t @\314=\206t \312@\310N>\206t \307@\310N>\206t \313@\310N>)\203\222 \315!\211\203\213 b\210\316 \211T\317\n$\210\320 AB)\306 \211\202) \fB\211:\205\260 @9\205\260 \307@\310N>)\204 \306 \211\202\236 \306 \211:\205\330 @9\205\330 \312@\310N>\206\330 \313@\310N>)\203\273 A\237\321!\322\323 !!\207" [event point strokes-character pix-locs strokes-lift grid-locs read-event down event-symbol-elements mouse-3 click drag mouse-movement strokes-event-closest-point subst-char-in-region 32 mouse-pixel-position strokes-renormalize-to-grid strokes-fill-stroke strokes-eliminate-consecutive-redundancies] 6))] 4 (#$ . 18829)]) #@242 Given STROKE, execute the command which corresponds to it. The command will be executed provided one exists for that stroke, based on the variable `strokes-minimum-match-score'. If no stroke matches, nothing is done and return value is nil. (defalias 'strokes-execute-stroke #[(stroke) "\306 \"\211@\nA\n\203 \f X\203 \307\310\"\210\311!\202E \204@ \312!\203: \313\314\315\"!\205E \316 \202E \317\320!\202E \317\321!\210\322+\207" [stroke strokes-global-map match command score strokes-minimum-match-score strokes-match-stroke message "%s" command-execute file-exists-p y-or-n-p format "No strokes loaded. Load `%s'? " strokes-load-user-strokes error "No strokes defined; use `strokes-global-set-stroke'" "No stroke matches; see variable `strokes-minimum-match-score'" nil strokes-file] 5 (#$ . 20647)]) #@103 Read a simple stroke from the user and then execute its command. This must be bound to a mouse event. (defalias 'strokes-do-stroke #[(event) "\204 \300\302!\210\303\304\305 \"!\207" [strokes-mode event t strokes-execute-stroke strokes-read-stroke nil] 4 (#$ . 21472) "e"]) #@104 Read a complex stroke from the user and then execute its command. This must be bound to a mouse event. (defalias 'strokes-do-complex-stroke #[(event) "\204 \300\302!\210\303\304\305 \"!\207" [strokes-mode event t strokes-execute-stroke strokes-read-complex-stroke nil] 4 (#$ . 21754) "e"]) #@74 Displays the command which STROKE maps to, reading STROKE interactively. (defalias 'strokes-describe-stroke #[(stroke) "\306 \"\211@\nA\n\203 \f X\203 \307\310\"\210\202! \307\311!\210\312\313!+\207" [stroke strokes-global-map match command score strokes-minimum-match-score strokes-match-stroke message "That stroke maps to `%s'" "That stroke is undefined" sleep-for 1] 4 (#$ . 22052) (list (strokes-read-complex-stroke "Enter stroke to describe; end with button 3..."))]) #@47 Get instruction on using the Strokes package. (defalias 'strokes-help #[nil "r\306\307!q\210p\310 \210 \311\211\312\211\312\313 \210\314\315!\210+\211\316\317\320!!\210q\210\321 \210\322 \323!\210+\207" [default-directory #1=#:old-dir buffer-read-only buffer-file-name buffer-undo-list inhibit-modification-hooks get-buffer-create "*Help with Strokes*" kill-all-local-variables nil t erase-buffer run-hooks temp-buffer-setup-hook princ substitute-command-keys "This is help for the strokes package.\n\n------------------------------------------------------------\n\n** Strokes...\n\nThe strokes package allows you to define strokes, made with\nthe mouse or other pointer device, that Emacs can interpret as\ncorresponding to commands, and then executes the commands. It does\ncharacter recognition, so you don't have to worry about getting it\nright every time.\n\nStrokes also allows you to compose documents graphically. You can\nfully edit documents in Chinese, Japanese, etc. based on Emacs\nstrokes. Once you've done so, you can ASCII compress-and-encode them\nand then safely save them for later use, send letters to friends\n(using Emacs, of course). Strokes will later decode these documents,\nextracting the strokes for editing use once again, so the editing\ncycle can continue.\n\nTo toggle strokes-mode, invoke the command\n\n> M-x strokes-mode\n\n** Strokes for controlling the behavior of Emacs...\n\nWhen you're ready to start defining strokes, just use the command\n\n> M-x strokes-global-set-stroke\n\nYou will see a ` *strokes*' buffer which is waiting for you to enter in\nyour stroke. When you enter in the stroke, you draw with button 1 or\nbutton 2, and then end with button 3. Next, you enter in the command\nwhich will be executed when that stroke is invoked. Simple as that.\nFor now, try to define a stroke to copy a region. This is a popular\nedit command, so type\n\n> M-x strokes-global-set-stroke\n\nThen, in the ` *strokes*' buffer, draw the letter `C' (for `copy')\nand then, when it asks you to enter the command to map that to, type\n\n> copy-region-as-kill\n\nThat's about as hard as it gets.\nRemember: paint with button 1 or button 2 and then end with button 3.\n\nIf ever you want to know what a certain strokes maps to, then do\n\n> M-x strokes-describe-stroke\n\nand you can enter in any arbitrary stroke. Remember: The strokes\npackage lets you program in simple and complex (multi-lift) strokes.\nThe only difference is how you *invoke* the two. You will most likely\nuse simple strokes, as complex strokes were developed for\nChinese/Japanese/Korean. So the shifted middle mouse button (S-mouse-2) will\ninvoke the command `strokes-do-stroke'.\n\nIf ever you define a stroke which you don't like, then you can unset\nit with the command\n\n> M-x strokes-unset-last-stroke\n\nYou can always get an idea of what your current strokes look like with\nthe command\n\n> M-x strokes-list-strokes\n\nYour strokes will be displayed in alphabetical order (based on command\nnames) and the beginning of each simple stroke will be marked by a\ncolor dot. Since you may have several simple strokes in a complex\nstroke, the dot colors are arranged in the rainbow color sequence,\n`ROYGBIV'. If you want a listing of your strokes from most recent\ndown, then use a prefix argument:\n\n> C-u M-x strokes-list-strokes\n\nYour strokes are stored as you enter them. They get saved in a file\ncalled ~/.strokes, along with other strokes configuration variables.\nYou can change this location by setting the variable `strokes-file'.\nYou will be prompted to save them when you exit Emacs, or you can save\nthem with\n\n> M-x strokes-prompt-user-save-strokes\n\nYour strokes get loaded automatically when you enable `strokes-mode'.\nYou can also load in your user-defined strokes with\n\n> M-x strokes-load-user-strokes\n\n** Strokes for pictographic editing...\n\nIf you'd like to create graphical files with strokes, you'll have to\nbe running a version of Emacs with XPM support. You use the binding\nto `strokes-compose-complex-stroke' to start drawing your strokes.\nThese are just complex strokes, and thus continue drawing with mouse-1\nor mouse-2 and end with mouse-3. Then the stroke image gets inserted\ninto the buffer. You treat it somewhat like any other character,\nwhich you can copy, paste, delete, move, etc. When all is done, you\nmay want to send the file, or save it. This is done with\n\n> M-x strokes-encode-buffer\n\nLikewise, to decode the strokes from a strokes-encoded buffer you do\n\n> M-x strokes-decode-buffer\n\n** A few more important things...\n\no The command `strokes-do-complex-stroke' is invoked with M-mouse-2,\n so that you can execute complex strokes (i.e. with more than one lift)\n if preferred.\n\no Strokes are a bit computer-dependent in that they depend somewhat on\n the speed of the computer you're working on. This means that you\n may have to tweak some variables. You can read about them in the\n commentary of `strokes.el'. Better to just use \\[apropos] and read their\n docstrings. All variables/functions start with `strokes'. The one\n variable which many people wanted to see was\n `strokes-use-strokes-buffer' which allows the user to use strokes\n silently--without displaying the strokes. All variables can be set\n by customizing the group `strokes' via \\[customize-group]." help-mode help-print-return-message internal-temp-output-buffer-show inhibit-read-only #2=#:buf standard-output] 4 (#$ . 22539) nil]) (byte-code "\300\301\302\303#\210\304\301\302\305#\207" [defalias strokes-report-bug report-emacs-bug nil make-obsolete "24.1"] 4) #@148 Non-nil if the `strokes-window-configuration' frame properties changed. This is based on the last time `strokes-window-configuration' was updated. (defalias 'strokes-window-configuration-changed-p #[nil "\301\302 \"\207" [strokes-window-configuration compare-window-configurations current-window-configuration] 3 (#$ . 28224)]) #@59 Ensure that `strokes-window-configuration' is up-to-date. (defalias 'strokes-update-window-configuration #[nil "\306 \307!\204 \310!\203 \311\202\260 \312\313!\204% \314\315 !!\203% \n\204v \212\316 \317\216\320 !q\210\321 \"\210\322 \210\323 \210\324\325!\210\326\325!\210\327\325!\210\330p!\210\311\331 \210\332 S\211\325Y\203i \333\334\335 S\"\210\336 \210\202S )eb\210\316 \337 +\202\260 \340 \205\260 \212\316 \"\341\216\321 \"\210\322 \210\331 \210\332 S\211\325Y\203\246 \333\334\335 S\"\210\336 \210\202\220 )eb\210\316 \337 +)\207" [current-window strokes-buffer-name strokes-window-configuration #1=#:wconfig truncate-lines #2=#:--cl-var-- selected-window window-minibuffer-p window-dedicated-p nil called-interactively-p interactive buffer-live-p get-buffer current-window-configuration ((set-window-configuration #1#)) get-buffer-create set-window-buffer delete-other-windows fundamental-mode auto-save-mode 0 font-lock-mode abbrev-mode buffer-disable-undo erase-buffer frame-height insert-char 32 frame-width newline bury-buffer strokes-window-configuration-changed-p ((set-window-configuration #3=#:wconfig)) #3#] 3 (#$ . 28559) nil]) #@62 Load user-defined strokes from file named by `strokes-file'. (defalias 'strokes-load-user-strokes #[nil "\301!\203 \302!\203 \303!\207\304\305!\203 \306\307!\207\310\311!\207" [strokes-file file-exists-p file-readable-p load-file called-interactively-p interactive error "Trouble loading user-defined strokes; nothing done" message "No user-defined strokes, sorry"] 2 (#$ . 29732) nil]) #@60 Save user-defined strokes to file named by `strokes-file'. (defalias 'strokes-prompt-user-save-strokes #[nil "\212\303\216\304\305 \210 \232\204c \306\307!\204 \310\311!\203c \312\313!\210\314\315\n\"\210\316\317!\210\317q\210\320 \210\321 \210eb\210\322c\210\323\324\325 \326\327\304\"#c\210\314\315\n\"\210\323\330\313 !\"c\210\314\315\n\"\210\331ed\304#\210\332ed\n#\202f \314\333!+\207" [strokes-global-map current strokes-file ((byte-code "\302\303!\203\f \304\302\303!!\210\302\207" [current strokes-global-map get-buffer "*saved-strokes*" kill-buffer] 3)) nil strokes-load-user-strokes called-interactively-p interactive yes-or-no-p "Save your strokes? " require pp message "Saving strokes in %s..." get-buffer-create "*saved-strokes*" erase-buffer emacs-lisp-mode ";; -*- emacs-lisp -*-\n" format ";;; saved strokes for %s, as of %s\n\n" user-full-name format-time-string "%B %e, %Y" "(setq strokes-global-map\n'%s)" indent-region write-region "(no changes need to be saved)"] 6 (#$ . 30131) nil]) #@221 Toggle the use of the strokes buffer. In other words, toggle the variable `strokes-use-strokes-buffer'. With ARG, use strokes buffer if and only if ARG is positive or true. Returns value of `strokes-use-strokes-buffer'. (defalias 'strokes-toggle-strokes-buffer #[(&optional arg) "\203\f \302!\303V\202 ?\211\207" [arg strokes-use-strokes-buffer prefix-numeric-value 0] 2 (#$ . 31153) "P"]) #@462 Create an XPM pixmap for the given STROKE in buffer ` *strokes-xpm*'. If STROKE is not supplied, then `strokes-last-stroke' will be used. Optional BUFNAME to name something else. The pixmap will contain time information via rainbow dot colors where each individual strokes begins. Optional B/W-ONLY non-nil will create a mono pixmap, not intended for trying to figure out the order of strokes, but rather for reading the stroke as a character in some language. (defalias 'strokes-xpm-for-stroke #[(&optional stroke bufname b/w-only) "\212\306\206 \307!\310\311\312 \206 \n\313\"!!\314\315\316\317\320\321\322\257\211q\210\323 \2102c\210\32433S\2113\325Y\203J \326c\210\327\330\324\"\210\331c\210\332 \210\202. \333y\210\334\210\335c\210) 4\334\21156\33474:\2034@\2115\24265\24375:\203\361 \f\203\327 8\204\327 @\206\211 \3369\325\211:\337X\203\315 \325\211;\337X\203\303 eb\210\340\341:7#y\210\340\342;6#u\210\343\342!\2109c\210;T\211;\202\230 ):T\211:\202\217 )A\334)\202\372 eb\210\3447\\y\210\3376\\u\210\345``T\330\346$\210\202\372 \3475!\203\372 \3144A\2114\202b ,\350\351!\205\352\307!\210eb\210\353\354\355 \356\314\357\360%\361 \"-\207" [bufname stroke strokes-last-stroke rainbow-chars lift-flag buf get-buffer-create " *strokes-xpm*" strokes-eliminate-consecutive-redundancies strokes-fill-stroke strokes-renormalize-to-grid 31 t 82 79 89 71 66 80 erase-buffer 33 0 34 insert-char 32 "\"," newline -1 nil "}\n" 46 2 + 15 1 delete-char 16 subst-char-in-region 42 strokes-lift-p called-interactively-p interactive pop-to-buffer put-image create-image buffer-string xpm :ascent 100 line-end-position strokes-xpm-header #1=#:--cl-var-- #2=#:--cl-var-- point x y b/w-only char i j] 10 (#$ . 31555) nil]) #@251 Pop up a buffer containing an alphabetical listing of strokes in STROKES-MAP. With CHRONOLOGICAL prefix arg (\[universal-argument]) list strokes chronologically by command name. If STROKES-MAP is not given, `strokes-global-map' will be used instead. (defalias 'strokes-list-strokes #[(&optional chronological strokes-map) "\206\f \206\f \306 \210 \n\204 \307\310!\311\"\312 \313\314!q\210\315\316 \210\317\320\261\210\315/ :\203\214 @\211/@/A9\203I \321/A!\202N \322/A!01\3231\324\"\210\325\326!\210\327\330\331\"\210\332 \2100c\210\332 \210\331u\210\333\334r\324q\210\335 )\336\337\340\341\342\315\343\"BC%!\210* A\211\2020 m\204\226 \344`Td\"\210*\345\314\315\"\210\346\347!\210\350'!2\3512\352\353\315\354\355\356D\257#\2102)'eb)\207" [strokes-map strokes-global-map chronological config buffer-read-only #1=#:--cl-var-- strokes-load-user-strokes sort copy-sequence strokes-alphabetic-lessp current-window-configuration get-buffer-create "*Strokes List*" nil erase-buffer "Command Stroke\n" "------- ------" symbol-name prin1-to-string strokes-xpm-for-stroke " *strokes-xpm*" newline 2 insert-char 32 45 beginning-of-line insert-image create-image buffer-string xpm t :color-symbols "foreground" frame-parameter foreground-color kill-region view-buffer make-local-variable view-mode-map copy-keymap define-key "q" lambda (interactive) (View-quit) set-window-configuration def command-name stroke map] 11 (#$ . 33322) "P"]) #@79 Return t if STROKE1's command name precedes STROKE2's in lexicographic order. (defalias 'strokes-alphabetic-lessp #[(stroke1 stroke2) "\304A!\304 A!\211\n\231*\207" [stroke1 stroke2 command-name-2 command-name-1 symbol-name] 4 (#$ . 34855)]) (defvar strokes-mode-map (byte-code "\301 \302\303\304#\210\302\305\306#\210)\207" [map make-sparse-keymap define-key [(shift down-mouse-2)] strokes-do-stroke [(meta down-mouse-2)] strokes-do-complex-stroke] 4)) #@257 Non-nil if Strokes mode is enabled. See the command `strokes-mode' for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `strokes-mode'. (custom-declare-variable 'strokes-mode nil '(#$ . 35323) :set 'custom-set-minor-mode :initialize 'custom-initialize-default :group 'strokes :type 'boolean) #@707 Toggle Strokes mode, a global minor mode. With a prefix argument ARG, enable Strokes mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. \<strokes-mode-map> Strokes are pictographic mouse gestures which invoke commands. Strokes are invoked with \[strokes-do-stroke]. You can define new strokes with \[strokes-global-set-stroke]. See also \[strokes-do-complex-stroke] for `complex' strokes. To use strokes for pictographic editing, such as Chinese/Japanese, use \[strokes-compose-complex-stroke], which draws strokes and inserts them. Encode/decode your strokes with \[strokes-encode-buffer], \[strokes-decode-buffer]. \{strokes-mode-map} (defalias 'strokes-mode #[(&optional arg) "\306 \307=\203 \n?\202 \310 !\311V\312 \204 \313\314!\210\202R \n\203A \315!\2031 \f\2041 \316 \210\317\320\321\"\210\317\322\323\"\210\323 \210\202R \324 !\203M \325\324 !!\210\326\322\323\"\210\327\330\n\203\\ \331\202] \332\"\210\333\334!\203\202 \335\302!\210\306 \203u \306 \232\203\202 \336\337\n\203 \340\202\200 \341\"\210)\342 \210\n\207" [#1=#:last-message arg strokes-mode strokes-file strokes-global-map strokes-buffer-name current-message toggle prefix-numeric-value 0 display-mouse-p error "Can't use Strokes without a mouse" file-exists-p strokes-load-user-strokes add-hook kill-emacs-query-functions strokes-prompt-user-save-strokes select-frame-hook strokes-update-window-configuration get-buffer kill-buffer remove-hook run-hooks strokes-mode-hook strokes-mode-on-hook strokes-mode-off-hook called-interactively-p any customize-mark-as-set message "Strokes mode %sabled" "en" "dis" force-mode-line-update] 3 (#$ . 35742) (list (or current-prefix-arg 'toggle))]) (byte-code "\301\302\303\304\211%\210\305\306\307\310\311\312\313\314&\210\315\314\316\317#\207" [strokes-mode-map add-minor-mode strokes-mode strokes-lighter nil custom-declare-face strokes-char ((t (:background "lightgray"))) "Face for strokes characters." :version "21.1" :group strokes put char-table-extra-slots 0] 8) #@55 The table which stores values for the character keys. (defconst strokes-char-table (make-char-table 'strokes) (#$ . 37811)) (byte-code "\301\302I\210\303\304I\210\305\306I\210\307\310I\210\311\312I\210\313\314I\210\315\316I\210\317\320I\210\321\322I\210\323\324I\210\325\326I\210\327\330I\210\331\332I\210\333\334I\210\335\336I\210\337\340I\210\341\342I\210\343\344I\210\345\346I\210\347\350I\210\351\352I\210\353\354I\210\355\356I\210\357\360I\210\361\362I\210\363\364I\210\365\366I\210\367\370I\210\371\372I\210\373\374I\210\375\376I\210\377\201@ I\210\201A \201B I\210\201C \201D I\210\201E \201F I\210\201G \201H I\210\201I \201J I\210\201K \201L I\210\201M \201N I\210\201O \201P I\210\201Q \201R I\210\201S \201T I\210\201U \201V I\210\201W \201X I\210\201Y \201Z I\210\201[ \201\\ I\210\201] \201^ I\210\201_ \201` I\210\201a \301I\210\201b \303I\210\201c \305I\210\201d \307I\210\201e \311I\210\201f \313I\210\201g \315I\210\201h \317I\210\201i \321I\210\201j \323I\210\201k \201l I\210\201m \201n I\210\201o \201p I\210\201q \201r I\207" [strokes-char-table 48 0 49 1 50 2 51 3 52 4 53 5 54 6 55 7 56 8 57 9 97 10 98 11 99 12 100 13 101 14 102 15 103 16 104 17 105 18 106 19 107 20 108 21 109 22 110 23 111 24 112 25 113 26 114 27 115 28 116 29 117 30 118 31 119 32 120 33 121 34 122 35 65 36 66 37 67 38 68 39 69 40 70 41 71 42 72 43 73 44 74 45 75 46 76 47 77 78 79 80 81 82 83 84 85 86 87 58 88 59 89 60 90 61] 3) #@76 Character vector for fast lookup of base-64 encoding of numbers in [0,61]. (defconst strokes-base64-chars (byte-code "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376&>\207" [vector "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"] 63) (#$ . 39305)) #@52 Non-nil if CHAR represents an `on' bit in the XPM. (defalias 'strokes-xpm-char-on-p #[(char) "\301=\207" [char 42] 2 (#$ . 39964)]) (put 'strokes-xpm-char-on-p 'byte-optimizer 'byte-compile-inline-expand) #@61 Non-nil if CHAR represents an `on' or `off' bit in the XPM. (defalias 'strokes-xpm-char-bit-p #[(char) "\301=\206 \302=\207" [char 32 42] 2 (#$ . 40176)]) (put 'strokes-xpm-char-bit-p 'byte-optimizer 'byte-compile-inline-expand) #@63 Given some LENGTH in [0,62) do a fast lookup of its encoding. (defalias 'strokes-xpm-encode-length-as-string #[(length) " H\207" [strokes-base64-chars length] 2 (#$ . 40414)]) (put 'strokes-xpm-encode-length-as-string 'byte-optimizer 'byte-compile-inline-expand) #@78 Given a CHARACTER, do a fast lookup to find its corresponding integer value. (defalias 'strokes-xpm-decode-char #[(character) " H\207" [strokes-char-table character] 2 (#$ . 40684)]) (put 'strokes-xpm-decode-char 'byte-optimizer 'byte-compile-inline-expand) #@114 Convert XPM in XPM-BUFFER to compressed string representing the stroke. XPM-BUFFER defaults to ` *strokes-xpm*'. (defalias 'strokes-xpm-to-compressed-string #[(&optional xpm-buffer) "r\206 \306\211q\210eb\210\307\310!\210\311u\210\312\313\314\315\211f \316=\204\276 \317\f!\203H \211\320=\2068 \321=)\203B \322 \321=\322u\210\202\267 \f\323U\203p \n=\205^ \313H)\323H)Q\n\313\202\267 \211\320=\206} \321=)\203\264 \n \321==\203\222 \fT\322u\210\202\267 \n=\205\242 \313H)\fH)Q\313\n\202\267 \322u\210\315f\211\202 \f\313V\205\336 \n=\205\324 \313H)\fH)P\324Q.\207" [xpm-buffer char-at-point current-char-is-on-p last-char-was-on-p count compressed-string " *strokes-xpm*" search-forward "/* pixels */" 2 "+/" 0 t nil 125 zerop 32 42 1 61 "/" char length strokes-base64-chars] 6 (#$ . 40950)]) #@187 Decode stroke strings in BUFFER and display their corresponding glyphs. Optional BUFFER defaults to the current buffer. Optional FORCE non-nil will ignore the buffer's read-only status. (defalias 'strokes-decode-buffer #[(&optional buffer force) "r\306\206 p!\211q\210 \203! \n\204! \204! \307\310\311\"!\205u \312\313\314\"\210eb\210\315\211rq\210\316\317\315\312\315$\205I \320\321!\322\225b\210\323\324!\210\312)\203o \325 \326\"\210\327r\326q\210\330 )\331\312#\332\f\333\324\334\335\211\f\336 &\"\210\202/ *\313\337\"))\207" [buffer buffer-read-only force inhibit-read-only image string get-buffer y-or-n-p format "Buffer %s is read-only. Strokify anyway? " t message "Strokifying %s..." nil re-search-forward "\\+/\\(\\w+\\)/" match-string 1 0 replace-match " " strokes-xpm-for-compressed-string " *strokes-xpm*" create-image buffer-string xpm insert-image propertize type stroke-glyph data "Strokifying %s...done"] 10 (#$ . 41822) nil]) #@184 Convert the glyphs in BUFFER to their base-64 ASCII representations. Optional BUFFER defaults to the current buffer. Optional FORCE non-nil will ignore the buffer's read-only status. (defalias 'strokes-encode-buffer #[(&optional buffer force) "r\206 p\211q\210 \203 \n\204 \204 \306\307\310\"!\205v \311\312\"\210\313\314\211o\2035 \315`\316\"\204>