changeset 98331:aa5de5d845d6

(sh-mode-map): Don't assume that skeleton is loaded.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 24 Sep 2008 22:51:09 +0000
parents 71824a19fc92
children 980421e378fa
files lisp/progmodes/sh-script.el
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/sh-script.el	Wed Sep 24 22:50:56 2008 +0000
+++ b/lisp/progmodes/sh-script.el	Wed Sep 24 22:51:09 2008 +0000
@@ -495,8 +495,13 @@
 		  :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] '("--"))