summaryrefslogtreecommitdiff
path: root/lisp/play/handwrite.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-02-10 11:56:00 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2011-02-10 11:56:00 -0500
commitb016851cb127f91a7ffa5d8295e5f3d4fdd3222a (patch)
treee1ccff1ff1bf49670b0cea40ebd566e1449290ee /lisp/play/handwrite.el
parent1be1d1e98e5465659b9633a3f1961e6dcc0b022a (diff)
downloademacs-b016851cb127f91a7ffa5d8295e5f3d4fdd3222a.tar.gz
Move keymap initialization into declaration.
* lisp/textmodes/enriched.el (enriched-mode-map): * lisp/textmodes/bib-mode.el (bib-mode-map): * lisp/term/lk201.el (lk201-function-map): * lisp/tar-mode.el (tar-mode-map): * lisp/replace.el (occur-mode-map): * lisp/progmodes/idlwave.el (idlwave-rinfo-mouse-map, idlwave-rinfo-map): * lisp/progmodes/idlw-help.el (idlwave-help-mode-map): * lisp/progmodes/gdb-mi.el (gdb-memory-format-menu, gdb-memory-unit-menu): * lisp/play/solitaire.el (solitaire-mode-map): * lisp/play/snake.el (snake-mode-map, snake-null-map): * lisp/play/pong.el (pong-mode-map): * lisp/play/handwrite.el (menu-bar-handwrite-map): * lisp/play/gametree.el (gametree-mode-map): * lisp/net/rcirc.el (rcirc-mode-map, rcirc-browse-url-map (rcirc-multiline-minor-mode-map, rcirc-track-minor-mode-map): * lisp/net/newst-plainview.el (newsticker-menu, newsticker-mode-map) (newsticker--url-keymap): * lisp/net/net-utils.el (nslookup-mode-map, ftp-mode-map): * lisp/menu-bar.el (menu-bar-file-menu, menu-bar-i-search-menu) (menu-bar-search-menu, menu-bar-replace-menu, menu-bar-goto-menu) (menu-bar-edit-menu, menu-bar-custom-menu) (menu-bar-showhide-fringe-ind-menu, menu-bar-showhide-fringe-menu) (menu-bar-showhide-scroll-bar-menu, menu-bar-showhide-menu) (menu-bar-line-wrapping-menu, menu-bar-options-menu) (menu-bar-games-menu, menu-bar-encryption-decryption-menu) (menu-bar-tools-menu, menu-bar-describe-menu) (menu-bar-search-documentation-menu, menu-bar-manuals-menu) (menu-bar-help-menu): * lisp/mail/rmailsum.el (rmail-summary-mode-map): * lisp/kmacro.el (kmacro-step-edit-map): * lisp/ibuffer.el (ibuffer-mode-groups-popup, ibuffer-mode-map) (ibuffer-mode-operate-map): * lisp/hi-lock.el (hi-lock-menu, hi-lock-map): * lisp/emulation/vip.el (vip-mode-map): * lisp/emacs-lisp/re-builder.el (reb-lisp-mode-map): * lisp/bookmark.el (bookmark-bmenu-mode-map): * lisp/help-mode.el (help-mode-map): * lisp/erc/erc-list.el (erc-list-menu-mode-map): * lisp/org/org-remember.el (org-remember-mode-map): * lisp/org/org-src.el (org-src-mode-map): Move initialization into declaration.
Diffstat (limited to 'lisp/play/handwrite.el')
-rw-r--r--lisp/play/handwrite.el105
1 files changed, 26 insertions, 79 deletions
diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el
index 5bab360f9ff..601232e4321 100644
--- a/lisp/play/handwrite.el
+++ b/lisp/play/handwrite.el
@@ -80,8 +80,24 @@
(defvar handwrite-psindex 0
"The index of the PostScript buffer.")
-(defvar menu-bar-handwrite-map (make-sparse-keymap "Handwrite functions."))
-(fset 'menu-bar-handwrite-map (symbol-value 'menu-bar-handwrite-map))
+(defvar menu-bar-handwrite-map
+ (let ((map (make-sparse-keymap "Handwrite functions.")))
+ (define-key map [numbering]
+ '(menu-item "Page numbering" handwrite-set-pagenumber
+ :button (:toggle . handwrite-pagenumbering)))
+ (define-key map [handwrite-separator2] '("----" . nil))
+ (define-key map [10pt] '(menu-item "10 pt" handwrite-10pt
+ :button (:radio . (eq handwrite-fontsize 10))))
+ (define-key map [11pt] '(menu-item "11 pt" handwrite-11pt
+ :button (:radio . (eq handwrite-fontsize 11))))
+ (define-key map [12pt] '(menu-item "12 pt" handwrite-12pt
+ :button (:radio . (eq handwrite-fontsize 12))))
+ (define-key map [13pt] '(menu-item "13 pt" handwrite-13pt
+ :button (:radio . (eq handwrite-fontsize 13))))
+ (define-key map [handwrite-separator1] '("----" . nil))
+ (define-key map [handwrite] '("Write by hand" . handwrite))
+ map))
+(fset 'menu-bar-handwrite-map menu-bar-handwrite-map)
;; User definable variables
@@ -135,10 +151,10 @@
The functions `handwrite-10pt', `handwrite-11pt', `handwrite-12pt'
and `handwrite-13pt' set up for various sizes of output.
-Variables: handwrite-linespace (default 12)
- handwrite-fontsize (default 11)
- handwrite-numlines (default 60)
- handwrite-pagenumbering (default nil)"
+Variables: `handwrite-linespace' (default 12)
+ `handwrite-fontsize' (default 11)
+ `handwrite-numlines' (default 60)
+ `handwrite-pagenumbering' (default nil)"
(interactive)
(let
((pmin) ; thanks, Havard
@@ -258,7 +274,8 @@ Variables: handwrite-linespace (default 12)
"Toggle the value of `handwrite-pagenumbering'."
(interactive)
(if handwrite-pagenumbering
- (handwrite-set-pagenumber-off)(handwrite-set-pagenumber-on)))
+ (handwrite-set-pagenumber-off)
+ (handwrite-set-pagenumber-on)))
(defun handwrite-10pt ()
"Specify 10-point output for `handwrite.
@@ -268,14 +285,6 @@ values for `handwrite-linespace' and `handwrite-numlines'."
(setq handwrite-fontsize 10)
(setq handwrite-linespace 11)
(setq handwrite-numlines handwrite-10pt-numlines)
- (define-key menu-bar-handwrite-map [10pt]
- '("10 pt *" . handwrite-10pt))
- (define-key menu-bar-handwrite-map [11pt]
- '("11 pt" . handwrite-11pt))
- (define-key menu-bar-handwrite-map [12pt]
- '("12 pt" . handwrite-12pt))
- (define-key menu-bar-handwrite-map [13pt]
- '("13 pt" . handwrite-13pt))
(message "Handwrite output size set to 10 points"))
@@ -287,14 +296,6 @@ values for `handwrite-linespace' and `handwrite-numlines'."
(setq handwrite-fontsize 11)
(setq handwrite-linespace 12)
(setq handwrite-numlines handwrite-11pt-numlines)
- (define-key menu-bar-handwrite-map [10pt]
- '("10 pt" . handwrite-10pt))
- (define-key menu-bar-handwrite-map [11pt]
- '("11 pt *" . handwrite-11pt))
- (define-key menu-bar-handwrite-map [12pt]
- '("12 pt" . handwrite-12pt))
- (define-key menu-bar-handwrite-map [13pt]
- '("13 pt" . handwrite-13pt))
(message "Handwrite output size set to 11 points"))
(defun handwrite-12pt ()
@@ -305,14 +306,6 @@ values for `handwrite-linespace' and `handwrite-numlines'."
(setq handwrite-fontsize 12)
(setq handwrite-linespace 13)
(setq handwrite-numlines handwrite-12pt-numlines)
- (define-key menu-bar-handwrite-map [10pt]
- '("10 pt" . handwrite-10pt))
- (define-key menu-bar-handwrite-map [11pt]
- '("11 pt" . handwrite-11pt))
- (define-key menu-bar-handwrite-map [12pt]
- '("12 pt *" . handwrite-12pt))
- (define-key menu-bar-handwrite-map [13pt]
- '("13 pt" . handwrite-13pt))
(message "Handwrite output size set to 12 points"))
(defun handwrite-13pt ()
@@ -323,14 +316,6 @@ values for `handwrite-linespace' and `handwrite-numlines'."
(setq handwrite-fontsize 13)
(setq handwrite-linespace 14)
(setq handwrite-numlines handwrite-13pt-numlines)
- (define-key menu-bar-handwrite-map [10pt]
- '("10 pt" . handwrite-10pt))
- (define-key menu-bar-handwrite-map [11pt]
- '("11 pt" . handwrite-11pt))
- (define-key menu-bar-handwrite-map [12pt]
- '("12 pt" . handwrite-12pt))
- (define-key menu-bar-handwrite-map [13pt]
- '("13 pt *" . handwrite-13pt))
(message "Handwrite output size set to 13 points"))
@@ -1263,62 +1248,24 @@ end
;;Sets page numbering off
(defun handwrite-set-pagenumber-off ()
(setq handwrite-pagenumbering nil)
- (define-key menu-bar-handwrite-map
- [numbering]
- '("Page numbering Off" . handwrite-set-pagenumber))
(message "page numbering off"))
;;Sets page numbering on
(defun handwrite-set-pagenumber-on ()
(setq handwrite-pagenumbering t)
- (define-key menu-bar-handwrite-map
- [numbering]
- '("Page numbering On" . handwrite-set-pagenumber))
(message "page numbering on" ))
;; Key bindings
-
-;;; I'd rather not fill up the menu bar menus with
-;;; lots of random miscellaneous features. -- rms.
+;; I'd rather not fill up the menu bar menus with
+;; lots of random miscellaneous features. -- rms.
;;;(define-key-after
;;; (lookup-key global-map [menu-bar edit])
;;; [handwrite]
;;; '("Write by hand" . menu-bar-handwrite-map)
;;; 'spell)
-(define-key menu-bar-handwrite-map [numbering]
- '("Page numbering Off" . handwrite-set-pagenumber))
-
-(define-key menu-bar-handwrite-map [10pt]
- '("10 pt" . handwrite-10pt))
-
-(define-key menu-bar-handwrite-map [11pt]
- '("11 pt *" . handwrite-11pt))
-
-(define-key menu-bar-handwrite-map [12pt]
- '("12 pt" . handwrite-12pt))
-
-(define-key menu-bar-handwrite-map [13pt]
- '("13 pt" . handwrite-13pt))
-
-(define-key menu-bar-handwrite-map [handwrite]
- '("Write by hand" . handwrite))
-
-(define-key-after
- (lookup-key menu-bar-handwrite-map [ ])
- [handwrite-separator1]
- '("----" . nil)
- 'handwrite)
-
-(define-key-after
- (lookup-key menu-bar-handwrite-map [ ])
- [handwrite-separator2]
- '("----" . nil)
- '10pt)
-
-
(provide 'handwrite)