bongo-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bongo-patches] Add Emacs 21 compatibility wrapper `bongo-custom-set-min


From: Daniel Brockman
Subject: [bongo-patches] Add Emacs 21 compatibility wrapper `bongo-custom-set-minor-mode'
Date: Fri, 29 Dec 2006 11:18:27 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Wed Dec 27 12:23:23 CET 2006  Daniel Brockman <address@hidden>

 * Add Emacs 21 compatibility wrapper
   `bongo-custom-set-minor-mode'.

diff -rN -u old-bongo/bongo.el new-bongo/bongo.el
--- old-bongo/bongo.el  2006-12-29 11:18:17.000000000 +0100
+++ new-bongo/bongo.el  2006-12-29 11:18:17.000000000 +0100
@@ -96,6 +96,8 @@
          'lisp-indent-function 'defun)
     (put 'bongo-define-obsolete-variable-alias
          'lisp-indent-function 'defun))
+  (defalias 'bongo-custom-set-minor-mode
+    'custom-set-minor-mode)
   (defalias 'bongo-customize-mark-as-set
     'customize-mark-as-set)
   (defalias 'bongo-custom-reevaluate-setting
@@ -629,7 +631,7 @@
   "Display header lines in Bongo playlist buffers."
   :type 'boolean
   :initialize 'custom-initialize-default
-  :set 'custom-set-minor-mode
+  :set 'bongo-custom-set-minor-mode
   :group 'bongo-header-line)
 
 (defcustom bongo-header-line-playing-string "Playing:"
@@ -753,7 +755,7 @@
 See `bongo-mode-line-indicator-format'."
   :type 'boolean
   :initialize 'custom-initialize-default
-  :set 'custom-set-minor-mode
+  :set 'bongo-custom-set-minor-mode
   :group 'bongo-mode-line)
 
 (defun bongo-hyphen-padded-mode-line-p ()
diff -rN -u old-bongo/bongo-emacs21.el new-bongo/bongo-emacs21.el
--- old-bongo/bongo-emacs21.el  2006-12-29 11:18:17.000000000 +0100
+++ new-bongo/bongo-emacs21.el  2006-12-29 11:18:17.000000000 +0100
@@ -75,6 +75,16 @@
 ;;; The following functions were copied from `custom.el'
 ;;; and modified to work with Emacs 21.
 
+(defun bongo-custom-set-minor-mode (variable value)
+  ":set function for minor mode variables.
+Normally, this sets the default value of VARIABLE to nil if VALUE
+is nil and to t otherwise, but if `custom-local-buffer' is non-nil,
+this sets the local binding in that buffer instead."
+  (if custom-local-buffer
+      (with-current-buffer custom-local-buffer
+       (funcall variable (if value 1 0)))
+    (funcall variable (if value 1 0))))
+
 (defun bongo-customize-mark-as-set (symbol)
   "Mark current value of SYMBOL as being set from customize.
 
-- 
Daniel Brockman <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]