summaryrefslogtreecommitdiff
path: root/lisp/woman.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2007-09-10 03:22:12 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2007-09-10 03:22:12 +0000
commitf9ed1fd5f3eb11b8890772ec0cd8630c83818237 (patch)
tree8e2229f2b88ab5087902496cd2b6cbd9643ddebc /lisp/woman.el
parentfb2831535bbf0d356f8c3a573f3b1d3ad1f986e6 (diff)
downloademacs-f9ed1fd5f3eb11b8890772ec0cd8630c83818237.tar.gz
(woman-mode-map, woman-syntax-table): Initialize in the declaration.
Diffstat (limited to 'lisp/woman.el')
-rw-r--r--lisp/woman.el45
1 files changed, 21 insertions, 24 deletions
diff --git a/lisp/woman.el b/lisp/woman.el
index b5fd22f5913..10cf609b174 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1761,21 +1761,21 @@ Leave point at end of new text. Return length of inserted text."
;;; Major mode (Man) interface:
-(defvar woman-mode-map nil "Keymap for woman mode.")
-
-(unless woman-mode-map
- (setq woman-mode-map (make-sparse-keymap))
- (set-keymap-parent woman-mode-map Man-mode-map)
-
- (define-key woman-mode-map "R" 'woman-reformat-last-file)
- (define-key woman-mode-map "w" 'woman)
- (define-key woman-mode-map "\en" 'WoMan-next-manpage)
- (define-key woman-mode-map "\ep" 'WoMan-previous-manpage)
- (define-key woman-mode-map [M-mouse-2] 'woman-follow-word)
-
- ;; We don't need to call `man' when we are in `woman-mode'.
- (define-key woman-mode-map [remap man] 'woman)
- (define-key woman-mode-map [remap man-follow] 'woman-follow))
+(defvar woman-mode-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map Man-mode-map)
+
+ (define-key map "R" 'woman-reformat-last-file)
+ (define-key map "w" 'woman)
+ (define-key map "\en" 'WoMan-next-manpage)
+ (define-key map "\ep" 'WoMan-previous-manpage)
+ (define-key map [M-mouse-2] 'woman-follow-word)
+
+ ;; We don't need to call `man' when we are in `woman-mode'.
+ (define-key map [remap man] 'woman)
+ (define-key map [remap man-follow] 'woman-follow)
+ map)
+ "Keymap for woman mode.")
(defun woman-follow (topic)
"Get a Un*x manual page of the item under point and put it in a buffer."
@@ -2083,17 +2083,14 @@ alist in `woman-buffer-alist' and return nil."
(char-to-string woman-unpadded-space-char)
"Internal string representation of unpadded space characters.")
-(defvar woman-syntax-table nil
+(defvar woman-syntax-table
+ (let ((st (make-syntax-table)))
+ ;; The following internal chars must NOT have whitespace syntax:
+ (modify-syntax-entry woman-unpadded-space-char "." st)
+ (modify-syntax-entry woman-escaped-escape-char "." st)
+ st)
"Syntax table to support special characters used internally by WoMan.")
-(if woman-syntax-table
- ()
- (setq woman-syntax-table (make-syntax-table))
- ;; The following internal chars must NOT have whitespace syntax:
- (modify-syntax-entry woman-unpadded-space-char "." woman-syntax-table)
- (modify-syntax-entry woman-escaped-escape-char "." woman-syntax-table)
- )
-
(defun woman-set-buffer-display-table ()
"Set up a display table for a WoMan buffer.
This display table is used for displaying internal special characters, but