From xemacs-m  Mon Jul 14 17:03:39 1997
Received: from netscape.com (h-205-217-237-47.netscape.com [205.217.237.47])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id RAA08215
	for <xemacs-beta@xemacs.org>; Mon, 14 Jul 1997 17:03:38 -0500 (CDT)
Received: from oink.mcom.com (oink.mcom.com [205.217.246.113])
	by netscape.com (8.8.5/8.8.5) with ESMTP id PAA13009;
	Mon, 14 Jul 1997 15:03:08 -0700 (PDT)
Received: (from friedman@localhost)
	by oink.mcom.com (8.8.5/8.8.5) id PAA04854;
	Mon, 14 Jul 1997 15:03:07 -0700 (PDT)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Noah Friedman <friedman@splode.com>
To: bwarsaw@python.org
Cc: xemacs-beta@xemacs.org
Subject: Re: pending-delete customization [PATCH]
Reply-To: friedman@splode.com
In-Reply-To: <bwarsaw@CNRI.Reston.Va.US> Mon, 14 Jul 1997 17:05:25 -0400
References: <bci67ud5tse.fsf@corp.Sun.COM>
	<kig4t9xctxy.fsf@jagor.srce.hr>
	<199707142105.RAA06485@anthem.CNRI.Reston.Va.US>
Date: Mon, 14 Jul 1997 15:03:06 -0700 (PDT)
Message-Id: <19970714150306.943951.FMU8095@oink.mcom.com>

>I really wish that all minor modes would use a variable for their
>modeline string.  I don't care what you come up with for the default
>for pending-del; it doesn't matter.  I want to be able to easily
>change it.  This leads me to want to custom-ize it too, but that's up
>to you.
>
>E.g. filladapt does it Right:
>
>(or (assq 'filladapt-mode minor-mode-alist)
>    (setq minor-mode-alist (cons (list 'filladapt-mode
>				       'filladapt-mode-line-string)
>				 minor-mode-alist)))
>
>And I:
>
>(setq filladapt-mode-line-string " FA")

Or alternatively:
  
   (set-minor-mode-string 'filladapt-mode " FA")


(defun set-minor-mode-string (minor-mode string &optional globalp)
  "Set MINOR-MODE display string according to STRING.
STRING need not actually be a string; see `mode-line-format'.
If optional arg GLOBALP is non-nil, then always set the global value of
`minor-mode-alist'.  Otherwise, set the buffer-local value if there is one."
  (let* ((alist (if globalp 
                    (default-value 'minor-mode-alist)
                  minor-mode-alist))
         (cell (assq minor-mode alist)))
    (cond (cell
           (setcar (cdr cell) string))
          (t
           (setq alist (cons (list minor-mode string) alist))
           (if globalp
               (setq-default minor-mode-alist alist)
             (setq minor-mode-alist alist))))))

