Subject: Re: bug#1621: Please move cperl micro-docs to top of the cperl-mode.el file

From: "era eriksson" <[email-masked]>
Date: Fri, 20 Feb 2009 20:39:37 +0200

How about a slight refactoring to make it more obvious where to look for
the startup information?

Please find attached a proposed patch.  This is just a quick proof of
concept; perhaps there is more startup-related information which could
be moved to the new variable.

(Cc:ing Ilya as I don't know whether he subscribes to this bug report.)

/* era */

-- 
If this were a real .signature, it would suck less.  Well, maybe not.

--- emacs-snapshot-20090207/lisp/progmodes/cperl-mode.el~	2009-02-20 09:44:54.000000000 +0200
+++ emacs-snapshot-20090207/lisp/progmodes/cperl-mode.el	2009-02-20 09:43:09.000000000 +0200
@@ -28,6 +28,9 @@
 
 ;;; Commentary:
 
+;; To use this mode instead of perl-mode for Perl files, see the
+;; documentation for the variable `cperl-setup'
+
 ;; You can either fine-tune the bells and whistles of this mode or
 ;; bulk enable them by putting
 
@@ -37,8 +40,8 @@
 ;; correct to make whistles enabled by default.)
 
 ;; DO NOT FORGET to read micro-docs (available from `Perl' menu)   <<<<<<
-;; or as help on variables `cperl-tips', `cperl-problems',         <<<<<<
-;; `cperl-praise', `cperl-speed'.				   <<<<<<
+;; or as help on variables `cperl-setup', `cperl-tips',		   <<<<<<
+;; `cperl-problems',`cperl-praise', `cperl-speed'.		   <<<<<<
 
 ;; The mode information (on C-h m) provides some customization help.
 ;; If you use font-lock feature of this mode, it is advisable to use
@@ -700,6 +703,12 @@
 
 ;;; Short extra-docs.
 
+(defvar cperl-setup 'please-ignore-this-line
+  "If your Emacs does not default to `cperl-mode' on Perl files, and you
+want it to: put the following into your .emacs file:
+
+  (defalias 'perl-mode 'cperl-mode)"
+
 (defvar cperl-tips 'please-ignore-this-line
   "Get maybe newer version of this package from
   http://ilyaz.org/software/emacs
@@ -721,11 +730,6 @@
 Note that to enable Compile choices in the menu you need to install
 mode-compile.el.
 
-If your Emacs does not default to `cperl-mode' on Perl files, and you
-want it to: put the following into your .emacs file:
-
-  (defalias 'perl-mode 'cperl-mode)
-
 Get perl5-info from
   $CPAN/doc/manual/info/perl5-old/perl5-info.tar.gz
 Also, one can generate a newer documentation running `pod2texi' converter
@@ -1369,6 +1373,7 @@
 	  ["Memorize Current" (cperl-set-style "Current") t]
 	  ["Memorized" (cperl-set-style-back) cperl-old-style])
 	 ("Micro-docs"
+	  ["Setup" (describe-variable 'cperl-setup) t]
 	  ["Tips" (describe-variable 'cperl-tips) t]
 	  ["Problems" (describe-variable 'cperl-problems) t]
 	  ["Speed" (describe-variable 'cperl-speed) t]
@@ -1688,7 +1693,7 @@
 with no args.
 
 DO NOT FORGET to read micro-docs (available from `Perl' menu)
-or as help on variables `cperl-tips', `cperl-problems',
+or as help on variables `cperl-setup', `cperl-tips', `cperl-problems',
 `cperl-praise', `cperl-speed'."
   (interactive)
   (kill-all-local-variables)