summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-vars.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-06-01 11:06:56 -0700
committerGlenn Morris <rgm@gnu.org>2013-06-01 11:06:56 -0700
commit31e7b090350955c8fc91e32ffb2bfaeaf30f87ce (patch)
tree6234c7ec992012c4dc2929baa4d92f9534b85a71 /lisp/progmodes/cc-vars.el
parent7225c83207c8f28eeb919c39337e1e44582dff2c (diff)
downloademacs-31e7b090350955c8fc91e32ffb2bfaeaf30f87ce.tar.gz
Don't (re)define a basic custom widget in cc-vars
* lisp/progmodes/cc-vars.el (other): Emacs has this widget since at least 21.1, so don't (re)define it.
Diffstat (limited to 'lisp/progmodes/cc-vars.el')
-rw-r--r--lisp/progmodes/cc-vars.el19
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index f97e8d1483b..7a9181db716 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -51,14 +51,19 @@
;;; Helpers
-;; This widget exists in newer versions of the Custom library
-(or (get 'other 'widget-type)
- (define-widget 'other 'sexp
- "Matches everything, but doesn't let the user edit the value.
+
+;; Emacs has 'other since at least version 21.1.
+;; FIXME this is probably broken, since the widget is defined
+;; in wid-edit, which this file does not load. So we will always
+;; define the widget, even when we don't need to.
+(when (featurep 'xemacs)
+ (or (get 'other 'widget-type)
+ (define-widget 'other 'sexp
+ "Matches everything, but doesn't let the user edit the value.
Useful as last item in a `choice' widget."
- :tag "Other"
- :format "%t%n"
- :value 'other))
+ :tag "Other"
+ :format "%t%n"
+ :value 'other)))
;; The next defun will supersede c-const-symbol.
(eval-and-compile