-;;;_ > allout-init (&optional mode)
-(defun allout-init (&optional mode)
- "Prime `allout-mode' to enable/disable auto-activation, wrt `allout-layout'.
-
-MODE is one of the following symbols:
-
- - nil (or no argument) deactivate auto-activation/layout;
- - `activate', enable auto-activation only;
- - `ask', enable auto-activation, and enable auto-layout but with
- confirmation for layout operation solicited from user each time;
- - `report', just report and return the current auto-activation state;
- - anything else (eg, t) for auto-activation and auto-layout, without
- any confirmation check.
-
-Use this function to setup your Emacs session for automatic activation
-of allout outline mode, contingent to the buffer-specific setting of
-the `allout-layout' variable. (See `allout-layout' and
-`allout-expose-topic' docstrings for more details on auto layout).
-
-`allout-init' works by setting up (or removing) the `allout-mode'
-find-file-hook, and giving `allout-auto-activation' a suitable
-setting.
-
-To prime your Emacs session for full auto-outline operation, include
-the following two lines in your Emacs init file:
-
-\(require 'allout)
-\(allout-init t)"
-
- (interactive)
- (if (allout-called-interactively-p)
- (progn
- (setq mode
- (completing-read
- (concat "Select outline auto setup mode "
- "(empty for report, ? for options) ")
- '(("nil")("full")("activate")("deactivate")
- ("ask") ("report") (""))
- nil
- t))
- (if (string= mode "")
- (setq mode 'report)
- (setq mode (intern-soft mode)))))
- (let
- ;; convenience aliases, for consistent ref to respective vars:
- ((hook 'allout-find-file-hook)
- (find-file-hook-var-name (if (boundp 'find-file-hook)
- 'find-file-hook
- 'find-file-hooks))
- (curr-mode 'allout-auto-activation))
-
- (cond ((not mode)
- (set find-file-hook-var-name
- (delq hook (symbol-value find-file-hook-var-name)))
- (if (allout-called-interactively-p)
- (message "Allout outline mode auto-activation inhibited.")))
- ((eq mode 'report)
- (if (not (memq hook (symbol-value find-file-hook-var-name)))
- (allout-init nil)
- ;; Just punt and use the reports from each of the modes:
- (allout-init (symbol-value curr-mode))))
- (t (add-hook find-file-hook-var-name hook)
- (set curr-mode ; `set', not `setq'!
- (cond ((eq mode 'activate)
- (message
- "Outline mode auto-activation enabled.")
- 'activate)
- ((eq mode 'report)
- ;; Return the current mode setting:
- (allout-init mode))
- ((eq mode 'ask)
- (message
- (concat "Outline mode auto-activation and "
- "-layout (upon confirmation) enabled."))
- 'ask)
- ((message
- "Outline mode auto-activation and -layout enabled.")
- 'full)))))))
+;;;_ > allout-init (mode)
+(defun allout-init (mode)
+ "DEPRECATED - configure allout activation by customizing
+`allout-auto-activation'. This function remains around, limited
+from what it did before, for backwards compatibility.
+
+MODE is the activation mode - see `allout-auto-activation' for
+valid values."
+
+ (custom-set-variables (list 'allout-auto-activation (format "%s" mode)))
+ (format "%s" mode))
+(make-obsolete 'allout-init
+ "customize 'allout-auto-activation' instead." "23.3")