(sh-mode-map): Don't assume that skeleton is loaded.
authorChong Yidong <cyd@stupidchicken.com>
Wed, 24 Sep 2008 22:51:09 +0000 (22:51 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Wed, 24 Sep 2008 22:51:09 +0000 (22:51 +0000)
lisp/progmodes/sh-script.el

index 5d0f1cb..72533d8 100644 (file)
@@ -495,8 +495,13 @@ This is buffer-local in every such buffer.")
                  :help "Set the indentation for the current line"))
 
     (define-key menu-map [sh-pair]
-      '(menu-item "Insert braces and quotes in pairs" (lambda () (interactive) (setq skeleton-pair (not skeleton-pair)))
-                 :button (:toggle . skeleton-pair)
+      '(menu-item "Insert braces and quotes in pairs"
+                 (lambda ()
+                   (interactive)
+                   (require 'skeleton)
+                   (setq skeleton-pair (not skeleton-pair)))
+                 :button (:toggle . (and (boundp 'skeleton-pair)
+                                         skeleton-pair))
                  :help "Inserting a brace or quote automatically inserts the matching pair"))
 
     (define-key menu-map [sh-s0] '("--"))