APPROVE COMMIT guided-tour
This patch fixes the "Loading guided-tour ..." messages to console at
startup, and allows user to suppress loading of guided-tour at
startup.
Also some (very) minor touchups.
Should be ready to go, Norbert.
Index: xemacs-packages/guided-tour/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/guided-tour/ChangeLog,v
retrieving revision 1.3
diff -u -r1.3 ChangeLog
--- xemacs-packages/guided-tour/ChangeLog 7 May 2007 07:01:26 -0000 1.3
+++ xemacs-packages/guided-tour/ChangeLog 19 Mar 2008 22:50:16 -0000
@@ -0,0 +1,14 @@
+2008-03-20 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ Suppress messages to stderr at XEmacs startup.
+ Allow user to suppress menu insinuation and guided tour load.
+
+ * guided-tour.el: Update copyright notice.
+ (guided-tour-insinuate-menubar): Change sense of
+ boolean, improve default, and fixup documentation.
+ (guided-tour-insinuate-menubar): Make function unconditional if
+ interactive. Fixup for change in control variable. Add to
+ `after-init-hook' instead of calling from auto-autoloads.el.
+ (guided-tour): Mark with autoload cookie.
+ (guided-tour-about): Fix typo, update copyright.
+
Index: xemacs-packages/guided-tour/guided-tour.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/guided-tour/guided-tour.el,v
retrieving revision 1.2
diff -u -r1.2 guided-tour.el
--- xemacs-packages/guided-tour/guided-tour.el 5 May 2007 15:42:36 -0000 1.2
+++ xemacs-packages/guided-tour/guided-tour.el 19 Mar 2008 22:50:16 -0000
@@ -1,10 +1,11 @@
;;; guided-tour.el --- functions for viewing Phil Sung's Emacs Guided Tour
-;; Copyright 2007 Free Software Foundation, Inc.
+;; Copyright 2007, 2008 Free Software Foundation, Inc.
;; Author: Stephen J. Turnbull <stephen(a)xemacs.org>
;; Maintainer: XEmacs Development Team
;; Created: 2007-05-02
+;; Last-Modified: 2008-03-19
;; Keywords: doc
;; The permissions notice is contained in the function `guided-tour-about'
@@ -66,9 +67,10 @@
["About COPYING the Tour" guided-tour-about])
"The submenu for the \"Guided Tour of Emacs\".")
-(defvar guided-tour-insinuate-menubar nil
- "If non-nil, inhibits insinuation of the menubar.
-Note that if you make this nil and reinsinuate, you are responsible for
+(defvar guided-tour-insinuate-menubar load-user-init-file-p
+ "If nil, the function `guided-tour-insinuate-menubar' exits immediately.
+Guards against multiple insinuations of the menu into the menubar.
+Note that if you make this t and reinsinuate, you are responsible for
removing any existing instances of the submenu.")
;; Functions
@@ -94,9 +96,14 @@
;;;###autoload
(defun guided-tour-insinuate-menubar ()
- "Add the Guided Tour of Emacs to the default menubar."
- (unless guided-tour-insinuate-menubar
- (setq guided-tour-insinuate-menubar t)
+ "Add the Guided Tour of Emacs to the default menubar.
+This is normally done at startup if the user's init file was loaded.
+To inhibit, set `guided-tour-insinuate-menubar' to nil in your init file.
+If called interactively, insinuates menubar unconditionally \(warning:
+that means even if the Guided Tour item is already present)."
+ (interactive)
+ (when (or guided-tour-insinuate-menubar (interactive-p))
+ (setq guided-tour-insinuate-menubar nil)
(let* ((help (guided-tour-find-menubar-help-menu)))
(setcdr help (nconc (if (eq 0 (guided-tour-about-xemacs-index help))
(list (cadr help) guided-tour-submenu)
@@ -105,10 +112,11 @@
;; Is this OK? Don't see how it really hurts.
;;;###autoload
-(guided-tour-insinuate-menubar)
+(add-one-shot-hook 'after-init-hook #'guided-tour-insinuate-menubar)
;; The Guided Tour
+;;;###autoload
(defun guided-tour (type part)
"Start the Guided Tour with TYPE viewer, in Part PART."
(interactive "sWhich format? \nnWhich part? ")
@@ -151,8 +159,8 @@
(defun guided-tour-about ()
"Document the Guided Tour."
(interactive)
- (with-displaying-temp-buffer "*About the Guided Tour of Emacs*"
- (princ "\
+ ;; for 21.4 compatibility
+ (with-displaying-help-buffer (lambda () (princ "\
A Guided Tour of Emacs
Phil Sung
@@ -163,9 +171,9 @@
to Steve via the XEmacs Developers mailing list <xemacs-beta(a)xemacs.org>.
The FAQ follows the permissions notice.
-Copyright 2007 The Free Software Foundation Inc.
+Copyright 2007, 2008 The Free Software Foundation Inc.
-The Guided Tour, is both free software and free content.
+The Guided Tour is both free software and free content.
You can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation;
@@ -213,7 +221,9 @@
Q2.4 Will an HTML version be included in the future?
A2.4 Patches welcome! Ask about how to contribute to the XEmacs package, or
lobby for inclusion of new/updated content at <xemacs-beta(a)xemacs.org>.
-"
-)))
+")
+ "*About the Guided Tour of Emacs*")))
+
+(provide 'guided-tour)
;;; guided-tour.el ends here
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches