1 new commit in edit-utils:
https://bitbucket.org/xemacs/edit-utils/changeset/b1f2bf6133c5/
changeset: b1f2bf6133c5
user: skm
date: 2012-11-19 06:51:50
summary: fixed autoloads in buffer-colors.el
affected #: 2 files
diff -r ca2abadaf7dba3d3a5c7849fe85b5cc041bccfb1 -r
b1f2bf6133c5f2607058e88d1f9e385ce87e8415 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-11-19 Steve Mitchell <smitchel(a)bnin.net>
+ Byrel Mitchell <byrel.mitchell(a)gmail.com>
+
+ * buffer-colors.el : re-added autoloads with
+ checks for behavior support.
+ uses variables if behavior
+ support not available.
+
2012-01-13 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 2.46 released.
diff -r ca2abadaf7dba3d3a5c7849fe85b5cc041bccfb1 -r
b1f2bf6133c5f2607058e88d1f9e385ce87e8415 buffer-colors.el
--- a/buffer-colors.el
+++ b/buffer-colors.el
@@ -81,18 +81,21 @@
(define-specifier-tag 'bc-read-only)
(defvar bc-fgbg-menu nil "Menu for Buffer Colors")
-
+(defvar bc-buffer-colors-enabled-p nil
+ "Is buffer-colors currently loaded.
+This variable is used on systems without behavior functionality to keep track of whether
buffer-colors is currently loaded.")
;; the behaviour lets us
;; disable Buffer Colors,
;; remove the Buffer Colors menu item,
;; and delete all previously set buffer colors,
;; restoring them to the colors in the default face.
-(define-behavior 'buffer-colors
- "A system for quickly changing the fg and bg colors of buffers.
+(when (functionp 'define-behavior)
+ (define-behavior 'buffer-colors
+ "A system for quickly changing the fg and bg colors of buffers.
It includes a rule-based system for coloring new buffers."
-:enable 'bc-enable-behavior
-:disable 'bc-disable-behavior)
+:enable 'bc-enable-behavior
+:disable 'bc-disable-behavior))
;;---- functions for rules ----------------------------------------
(defun bc-read-only-p ()
@@ -236,6 +239,15 @@
(disable-behavior 'buffer-colors)
(enable-behavior 'buffer-colors)))
+;;;###autoload
+(defun bc-toggle-no-behavior ()
+ (interactive)
+ (if bc-buffer-colors-enabled-p
+ (bc-disable-behavior)
+ (bc-enable-behavior))
+ (setq bc-buffer-colors-enabled-p (not bc-buffer-colors-enabled-p)))
+
+
(defun bc-write-current-fgbg ()
"Writes buffer colors menu to file"
(custom-save-all))
@@ -406,15 +418,24 @@
:value bc-read-only))))))
;;;;--- start up code ----------------------------------------------
+;;;###autoload
+(unless (featurep 'buffer-colors)
+ (when (boundp 'current-menubar)
+ (add-menu-button '("Options" "Display")
+ "---"))) ;add a separator only first time loaded
-(unless (featurep 'buffer-colors)
- (add-menu-button '("Options" "Display")
- "---")) ;add a separator only first time loaded
+;;;###autoload
+(when (boundp 'current-menubar)
+ (if (functionp 'define-behavior)
+ (add-menu-button '("Options" "Display")
+ [ "Buffer Colors" bc-toggle-behavior
+ :style toggle
+ :selected (behavior-enabled-p 'buffer-colors)])
+ (add-menu-button '("Options" "Display")
+ [ "Buffer Colors" bc-toggle-no-behavior
+ :style toggle
+ :selected bc-buffer-colors-enabled-p])))
-(add-menu-button '("Options" "Display")
- [ "Buffer Colors" bc-toggle-behavior
- :style toggle
- :selected (behavior-enabled-p 'buffer-colors)])
(provide 'buffer-colors)
Repository URL:
https://bitbucket.org/xemacs/edit-utils/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches