aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2014-03-04 14:01:48 +0100
committerJuanma Barranquero2014-03-04 14:01:48 +0100
commit4242d21d559884e08e5b1bf13fbf8749de9b62d9 (patch)
tree27191deb04a18a7ba978d1e9d068ffb3fe6fc2a9
parenta55130ca1052ba7ddcd9ef22db986cef053f4e00 (diff)
downloademacs-4242d21d559884e08e5b1bf13fbf8749de9b62d9.tar.gz
emacs-4242d21d559884e08e5b1bf13fbf8749de9b62d9.zip
lisp/strokes.el: Fix typos.
(strokes-xpm-header, strokes-rate-stroke): Fix typos. (strokes-character, strokes-get-grid-position, strokes-list-strokes): Remove superfluous backslashes. (strokes-last-stroke, strokes-global-map, strokes-mode): Reflow docstrings. (strokes-xpm-for-stroke, strokes-xpm-to-compressed-string) (strokes-xpm-for-compressed-string): Use quotes with buffer name. (strokes-distance-squared, strokes-global-set-stroke) (strokes-global-set-stroke-string): Doc fixes. (strokes-help): Fix typos; reflow docstring.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/strokes.el54
2 files changed, 41 insertions, 26 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5cc5291adc8..4b4b85b4a47 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12014-03-04 Juanma Barranquero <lekktu@gmail.com>
2
3 * strokes.el (strokes-xpm-header, strokes-rate-stroke): Fix typos.
4 (strokes-character, strokes-get-grid-position, strokes-list-strokes):
5 Remove superfluous backslashes.
6 (strokes-last-stroke, strokes-global-map, strokes-mode):
7 Reflow docstrings.
8 (strokes-xpm-for-stroke, strokes-xpm-to-compressed-string)
9 (strokes-xpm-for-compressed-string): Use quotes with buffer name.
10 (strokes-distance-squared, strokes-global-set-stroke)
11 (strokes-global-set-stroke-string): Doc fixes.
12 (strokes-help): Fix typos; reflow docstring.
13
12014-03-04 Martin Rudalics <rudalics@gmx.at> 142014-03-04 Martin Rudalics <rudalics@gmx.at>
2 15
3 * window.el (window-in-direction): Fix doc-string. 16 * window.el (window-in-direction): Fix doc-string.
diff --git a/lisp/strokes.el b/lisp/strokes.el
index fdaf31a9312..040b4e7135a 100644
--- a/lisp/strokes.el
+++ b/lisp/strokes.el
@@ -202,7 +202,7 @@ static char * stroke_xpm[] = {
202\"P c #FFFF0000FFFF\", 202\"P c #FFFF0000FFFF\",
203\". c #45458B8B0000\", 203\". c #45458B8B0000\",
204/* pixels */\n" 204/* pixels */\n"
205 "The header to all xpm buffers created by strokes.") 205 "The header to all XPM buffers created by strokes.")
206 206
207;;; user variables... 207;;; user variables...
208 208
@@ -221,7 +221,7 @@ static char * stroke_xpm[] = {
221 221
222(defcustom strokes-character ?@ 222(defcustom strokes-character ?@
223 "Character used when drawing strokes in the strokes buffer. 223 "Character used when drawing strokes in the strokes buffer.
224\(The default is `@', which works well.\)" 224\(The default is `@', which works well.)"
225 :type 'character 225 :type 'character
226 :group 'strokes) 226 :group 'strokes)
227 227
@@ -284,16 +284,15 @@ This is set properly in the function `strokes-update-window-configuration'.")
284 284
285(defvar strokes-last-stroke nil 285(defvar strokes-last-stroke nil
286 "Last stroke entered by the user. 286 "Last stroke entered by the user.
287Its value gets set every time the function 287Its value gets set every time the function `strokes-fill-stroke'
288`strokes-fill-stroke' gets called, 288gets called, since that is the best time to set the variable.")
289since that is the best time to set the variable.")
290 289
291(defvar strokes-global-map '() 290(defvar strokes-global-map '()
292 "Association list of strokes and their definitions. 291 "Association list of strokes and their definitions.
293Each entry is (STROKE . COMMAND) where STROKE is itself a list of 292Each entry is (STROKE . COMMAND) where STROKE is itself a list of
294coordinates (X . Y) where X and Y are lists of positions on the 293coordinates (X . Y) where X and Y are lists of positions on the
295normalized stroke grid, with the top left at (0 . 0). COMMAND is the 294normalized stroke grid, with the top left at (0 . 0). COMMAND is
296corresponding interactive function.") 295the corresponding interactive function.")
297 296
298(defvar strokes-load-hook nil 297(defvar strokes-load-hook nil
299 "Functions to be called when Strokes is loaded.") 298 "Functions to be called when Strokes is loaded.")
@@ -349,7 +348,7 @@ corresponding interactive function.")
349 (* x x)) 348 (* x x))
350 349
351(defsubst strokes-distance-squared (p1 p2) 350(defsubst strokes-distance-squared (p1 p2)
352 "Gets the distance (squared) between to points P1 and P2. 351 "Compute the distance (squared) between to points P1 and P2.
353P1 and P2 are cons cells in the form (X . Y)." 352P1 and P2 are cons cells in the form (X . Y)."
354 (let ((x1 (car p1)) 353 (let ((x1 (car p1))
355 (y1 (cdr p1)) 354 (y1 (cdr p1))
@@ -434,9 +433,9 @@ or for window START-WINDOW if that is specified."
434;;;###autoload 433;;;###autoload
435(defun strokes-global-set-stroke (stroke command) 434(defun strokes-global-set-stroke (stroke command)
436 "Interactively give STROKE the global binding as COMMAND. 435 "Interactively give STROKE the global binding as COMMAND.
437Operated just like `global-set-key', except for strokes. 436Works just like `global-set-key', except for strokes. COMMAND is
438COMMAND is a symbol naming an interactively-callable function. STROKE 437a symbol naming an interactively-callable function. STROKE is a
439is a list of sampled positions on the stroke grid as described in the 438list of sampled positions on the stroke grid as described in the
440documentation for the `strokes-define-stroke' function. 439documentation for the `strokes-define-stroke' function.
441 440
442See also `strokes-global-set-stroke-string'." 441See also `strokes-global-set-stroke-string'."
@@ -450,7 +449,7 @@ See also `strokes-global-set-stroke-string'."
450 449
451(defun strokes-global-set-stroke-string (stroke string) 450(defun strokes-global-set-stroke-string (stroke string)
452 "Interactively give STROKE the global binding as STRING. 451 "Interactively give STROKE the global binding as STRING.
453Operated just like `global-set-key', except for strokes. STRING 452Works just like `global-set-key', except for strokes. STRING
454is a string to be inserted by the stroke. STROKE is a list of 453is a string to be inserted by the stroke. STROKE is a list of
455sampled positions on the stroke grid as described in the 454sampled positions on the stroke grid as described in the
456documentation for the `strokes-define-stroke' function. 455documentation for the `strokes-define-stroke' function.
@@ -476,7 +475,7 @@ Compare `strokes-global-set-stroke'."
476(defun strokes-get-grid-position (stroke-extent position &optional grid-resolution) 475(defun strokes-get-grid-position (stroke-extent position &optional grid-resolution)
477 "Map POSITION to a new grid position. 476 "Map POSITION to a new grid position.
478Do so based on its STROKE-EXTENT and GRID-RESOLUTION. 477Do so based on its STROKE-EXTENT and GRID-RESOLUTION.
479STROKE-EXTENT as a list \(\(XMIN . YMIN\) \(XMAX . YMAX\)\). 478STROKE-EXTENT is a list ((XMIN . YMIN) (XMAX . YMAX)).
480If POSITION is a `strokes-lift', then it is itself returned. 479If POSITION is a `strokes-lift', then it is itself returned.
481Optional GRID-RESOLUTION may be used in place of `strokes-grid-resolution'. 480Optional GRID-RESOLUTION may be used in place of `strokes-grid-resolution'.
482The grid is a square whose dimension is [0,GRID-RESOLUTION)." 481The grid is a square whose dimension is [0,GRID-RESOLUTION)."
@@ -651,7 +650,7 @@ NOTE: This is where the global variable `strokes-last-stroke' is set."
651 y)))))))))) 650 y))))))))))
652 651
653(defun strokes-rate-stroke (stroke1 stroke2) 652(defun strokes-rate-stroke (stroke1 stroke2)
654 "Rates STROKE1 with STROKE2 and return a score based on a distance metric. 653 "Rate STROKE1 with STROKE2 and return a score based on a distance metric.
655Note: the rating is an error rating, and therefore, a return of 0 654Note: the rating is an error rating, and therefore, a return of 0
656represents a perfect match. Also note that the order of stroke 655represents a perfect match. Also note that the order of stroke
657arguments is order-independent for the algorithm used here." 656arguments is order-independent for the algorithm used here."
@@ -857,6 +856,9 @@ Optional EVENT is acceptable as the starting event of the stroke."
857The command will be executed provided one exists for that stroke, 856The command will be executed provided one exists for that stroke,
858based on the variable `strokes-minimum-match-score'. 857based on the variable `strokes-minimum-match-score'.
859If no stroke matches, nothing is done and return value is nil." 858If no stroke matches, nothing is done and return value is nil."
859 ;; FIXME: Undocument return value. It is not documented for all cases,
860 ;; and doesn't allow to difference between no stroke matches and
861 ;; command-execute returning nil, anyway.
860 (let* ((match (strokes-match-stroke stroke strokes-global-map)) 862 (let* ((match (strokes-match-stroke stroke strokes-global-map))
861 (command (car match)) 863 (command (car match))
862 (score (cdr match))) 864 (score (cdr match)))
@@ -969,8 +971,8 @@ and you can enter in any arbitrary stroke. Remember: The strokes
969package lets you program in simple and complex (multi-lift) strokes. 971package lets you program in simple and complex (multi-lift) strokes.
970The only difference is how you *invoke* the two. You will most likely 972The only difference is how you *invoke* the two. You will most likely
971use simple strokes, as complex strokes were developed for 973use simple strokes, as complex strokes were developed for
972Chinese/Japanese/Korean. So the shifted middle mouse button (S-mouse-2) will 974Chinese/Japanese/Korean. So the shifted middle mouse button (S-mouse-2)
973invoke the command `strokes-do-stroke'. 975will invoke the command `strokes-do-stroke'.
974 976
975If ever you define a stroke which you don't like, then you can unset 977If ever you define a stroke which you don't like, then you can unset
976it with the command 978it with the command
@@ -993,8 +995,8 @@ down, then use a prefix argument:
993 995
994Your strokes are stored as you enter them. They get saved into the 996Your strokes are stored as you enter them. They get saved into the
995file specified by the `strokes-file' variable, along with other strokes 997file specified by the `strokes-file' variable, along with other strokes
996configuration variables. You will be prompted to save them when 998configuration variables. You will be prompted to save them when you
997you exit Emacs, or you can save them with 999exit Emacs, or you can save them with
998 1000
999> M-x strokes-prompt-user-save-strokes 1001> M-x strokes-prompt-user-save-strokes
1000 1002
@@ -1009,7 +1011,7 @@ If you'd like to create graphical files with strokes, you'll have to
1009be running a version of Emacs with XPM support. You use the binding 1011be running a version of Emacs with XPM support. You use the binding
1010to `strokes-compose-complex-stroke' to start drawing your strokes. 1012to `strokes-compose-complex-stroke' to start drawing your strokes.
1011These are just complex strokes, and thus continue drawing with mouse-1 1013These are just complex strokes, and thus continue drawing with mouse-1
1012or mouse-2 and end with mouse-3. Then the stroke image gets inserted 1014or mouse-2 and end with mouse-3. Then the stroke image gets inserted
1013into the buffer. You treat it somewhat like any other character, 1015into the buffer. You treat it somewhat like any other character,
1014which you can copy, paste, delete, move, etc. When all is done, you 1016which you can copy, paste, delete, move, etc. When all is done, you
1015may want to send the file, or save it. This is done with 1017may want to send the file, or save it. This is done with
@@ -1147,7 +1149,7 @@ Returns value of `strokes-use-strokes-buffer'."
1147 (not strokes-use-strokes-buffer)))) 1149 (not strokes-use-strokes-buffer))))
1148 1150
1149(defun strokes-xpm-for-stroke (&optional stroke bufname b/w-only) 1151(defun strokes-xpm-for-stroke (&optional stroke bufname b/w-only)
1150 "Create an XPM pixmap for the given STROKE in buffer ` *strokes-xpm*'. 1152 "Create an XPM pixmap for the given STROKE in buffer \" *strokes-xpm*\".
1151If STROKE is not supplied, then `strokes-last-stroke' will be used. 1153If STROKE is not supplied, then `strokes-last-stroke' will be used.
1152Optional BUFNAME to name something else. 1154Optional BUFNAME to name something else.
1153The pixmap will contain time information via rainbow dot colors 1155The pixmap will contain time information via rainbow dot colors
@@ -1318,8 +1320,8 @@ the stroke as a character in some language."
1318;;;###autoload 1320;;;###autoload
1319(defun strokes-list-strokes (&optional chronological strokes-map) 1321(defun strokes-list-strokes (&optional chronological strokes-map)
1320 "Pop up a buffer containing an alphabetical listing of strokes in STROKES-MAP. 1322 "Pop up a buffer containing an alphabetical listing of strokes in STROKES-MAP.
1321With CHRONOLOGICAL prefix arg \(\\[universal-argument]\) list strokes 1323With CHRONOLOGICAL prefix arg (\\[universal-argument]) list strokes chronologically
1322chronologically by command name. 1324by command name.
1323If STROKES-MAP is not given, `strokes-global-map' will be used instead." 1325If STROKES-MAP is not given, `strokes-global-map' will be used instead."
1324 (interactive "P") 1326 (interactive "P")
1325 (setq strokes-map (or strokes-map 1327 (setq strokes-map (or strokes-map
@@ -1386,8 +1388,8 @@ If STROKES-MAP is not given, `strokes-global-map' will be used instead."
1386(define-minor-mode strokes-mode 1388(define-minor-mode strokes-mode
1387 "Toggle Strokes mode, a global minor mode. 1389 "Toggle Strokes mode, a global minor mode.
1388With a prefix argument ARG, enable Strokes mode if ARG is 1390With a prefix argument ARG, enable Strokes mode if ARG is
1389positive, and disable it otherwise. If called from Lisp, enable 1391positive, and disable it otherwise. If called from Lisp,
1390the mode if ARG is omitted or nil. 1392enable the mode if ARG is omitted or nil.
1391 1393
1392\\<strokes-mode-map> 1394\\<strokes-mode-map>
1393Strokes are pictographic mouse gestures which invoke commands. 1395Strokes are pictographic mouse gestures which invoke commands.
@@ -1540,7 +1542,7 @@ Encode/decode your strokes with \\[strokes-encode-buffer],
1540 1542
1541(defun strokes-xpm-to-compressed-string (&optional xpm-buffer) 1543(defun strokes-xpm-to-compressed-string (&optional xpm-buffer)
1542 "Convert XPM in XPM-BUFFER to compressed string representing the stroke. 1544 "Convert XPM in XPM-BUFFER to compressed string representing the stroke.
1543XPM-BUFFER defaults to ` *strokes-xpm*'." 1545XPM-BUFFER defaults to \" *strokes-xpm*\"."
1544 (with-current-buffer (setq xpm-buffer (or xpm-buffer " *strokes-xpm*")) 1546 (with-current-buffer (setq xpm-buffer (or xpm-buffer " *strokes-xpm*"))
1545 (goto-char (point-min)) 1547 (goto-char (point-min))
1546 (search-forward "/* pixels */") ; skip past header junk 1548 (search-forward "/* pixels */") ; skip past header junk
@@ -1707,7 +1709,7 @@ Optional FORCE non-nil will ignore the buffer's read-only status."
1707 1709
1708(defun strokes-xpm-for-compressed-string (compressed-string &optional bufname) 1710(defun strokes-xpm-for-compressed-string (compressed-string &optional bufname)
1709 "Convert the stroke represented by COMPRESSED-STRING into an XPM. 1711 "Convert the stroke represented by COMPRESSED-STRING into an XPM.
1710Store XPM in buffer BUFNAME if supplied \(default is ` *strokes-xpm*'\)" 1712Store XPM in buffer BUFNAME if supplied (default is \" *strokes-xpm*\")"
1711 (or bufname (setq bufname " *strokes-xpm*")) 1713 (or bufname (setq bufname " *strokes-xpm*"))
1712 (with-current-buffer (get-buffer-create bufname) 1714 (with-current-buffer (get-buffer-create bufname)
1713 (erase-buffer) 1715 (erase-buffer)