comparison lisp/strokes.el @ 85835:f3bfe76fe370

(strokes-alphabetic-lessp): Simplify. Doc fix. (strokes-unload-hook): Remove function and variable. (strokes-unload-function): New-style unload function, adapted from `strokes-unload-hook'.
author Juanma Barranquero <lekktu@gmail.com>
date Wed, 31 Oct 2007 12:49:11 +0000
parents 7c8949dbfa0d
children d3e87ee5aa0e
comparison
equal deleted inserted replaced
85834:7400d979a9d9 85835:f3bfe76fe370
1368 (set-window-configuration ,config))) 1368 (set-window-configuration ,config)))
1369 map)) 1369 map))
1370 (goto-char (point-min)))) 1370 (goto-char (point-min))))
1371 1371
1372 (defun strokes-alphabetic-lessp (stroke1 stroke2) 1372 (defun strokes-alphabetic-lessp (stroke1 stroke2)
1373 "T if command name for STROKE1 is less than STROKE2's in lexicographic order." 1373 "Return t if STROKE1's command name precedes STROKE2's in lexicographic order."
1374 (let ((command-name-1 (symbol-name (cdr stroke1))) 1374 (string-lessp (cdr stroke1) (cdr stroke2)))
1375 (command-name-2 (symbol-name (cdr stroke2))))
1376 (string-lessp command-name-1 command-name-2)))
1377 1375
1378 (defvar strokes-mode-map 1376 (defvar strokes-mode-map
1379 (let ((map (make-sparse-keymap))) 1377 (let ((map (make-sparse-keymap)))
1380 (define-key map [(shift down-mouse-2)] 'strokes-do-stroke) 1378 (define-key map [(shift down-mouse-2)] 'strokes-do-stroke)
1381 (define-key map [(meta down-mouse-2)] 'strokes-do-complex-stroke) 1379 (define-key map [(meta down-mouse-2)] 'strokes-do-complex-stroke)
1743 (insert (strokes-xpm-to-compressed-string " *strokes-xpm*")) 1741 (insert (strokes-xpm-to-compressed-string " *strokes-xpm*"))
1744 (strokes-decode-buffer) 1742 (strokes-decode-buffer)
1745 ;; strokes-decode-buffer does a save-excursion. 1743 ;; strokes-decode-buffer does a save-excursion.
1746 (forward-char))) 1744 (forward-char)))
1747 1745
1748 (defun strokes-unload-hook () 1746 (defun strokes-unload-function ()
1747 "Unload the Strokes library."
1749 (strokes-mode -1) 1748 (strokes-mode -1)
1750 (remove-hook 'kill-emacs-query-functions 'strokes-prompt-user-save-strokes)) 1749 ;; continue standard unloading
1751 1750 nil)
1752 (add-hook 'strokes-unload-hook 'strokes-unload-hook)
1753 1751
1754 (run-hooks 'strokes-load-hook) 1752 (run-hooks 'strokes-load-hook)
1755 (provide 'strokes) 1753 (provide 'strokes)
1756 1754
1757 ;;; arch-tag: 8377f60e-43fb-467a-bbcd-2774f91f833e 1755 ;;; arch-tag: 8377f60e-43fb-467a-bbcd-2774f91f833e