stephent  committed 037900f

Fix bogus console messages at XEmacs startup. <>

  • Participants
  • Parent commits 242c1b3

Comments (0)

Files changed (2)

+2008-03-20  Stephen J. Turnbull  <>
+	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.
 2007-05-07  Norbert Koch  <>
 	* Makefile (VERSION): XEmacs package 0.51 released.

File guided-tour.el

 ;;; 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 <>
 ;; 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'
     ["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
 (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)
 ;; Is this OK?  Don't see how it really hurts.
+(add-one-shot-hook 'after-init-hook #'guided-tour-insinuate-menubar)
 ;; The Guided Tour
 (defun guided-tour (type part)
   "Start the Guided Tour with TYPE viewer, in Part PART."
   (interactive "sWhich format? \nnWhich part? ")
 (defun guided-tour-about ()
   "Document the Guided Tour."
-  (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
 to Steve via the XEmacs Developers mailing list <>.
 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;
 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 <>.
+				 "*About the Guided Tour of Emacs*")))
+(provide 'guided-tour)
 ;;; guided-tour.el ends here