From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: |PATCH| describe-minor-mode and describe-minor-mode-from-indicator Date: Tue, 01 Apr 2003 01:35:09 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20030401.013509.115912667.jet@gyve.org> References: <20030330.165124.126582929.jet@gyve.org> <200303311551.h2VFp1xQ016968@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1049131078 22947 80.91.224.249 (31 Mar 2003 17:17:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 31 Mar 2003 17:17:58 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Mar 31 19:17:57 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1902uz-0005xw-00 for ; Mon, 31 Mar 2003 19:17:57 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 1902vB-0006md-00 for ; Mon, 31 Mar 2003 19:18:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 1902rZ-0001pr-01 for emacs-devel@quimby.gnus.org; Mon, 31 Mar 2003 12:14:25 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 1902rC-0001nv-00 for emacs-devel@gnu.org; Mon, 31 Mar 2003 12:14:02 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 1902r7-0001eK-00 for emacs-devel@gnu.org; Mon, 31 Mar 2003 12:13:58 -0500 Original-Received: from r-maa.spacetown.ne.jp ([210.130.136.40]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 1902kX-0005rp-00; Mon, 31 Mar 2003 12:07:09 -0500 Original-Received: from localhost (h219-110-074-192.catv01.itscom.jp [219.110.74.192]) by r-maa.spacetown.ne.jp (8.11.6) with ESMTP id h2VH74Q09934; Tue, 1 Apr 2003 02:07:04 +0900 (JST) Original-To: monnier+gnu/emacs@rum.cs.yale.edu In-Reply-To: <200303311551.h2VFp1xQ016968@rum.cs.yale.edu> X-Mailer: Mew version 3.1.52 on Emacs 21.3 / Mule 5.0 (SAKAKI) Original-cc: rms@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:12767 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12767 Thank you for reviewing my patch. I agree with the almost all of your suggestions. I'll reflect suggestions to my patch. > > +(defun lookup-minor-mode-from-indicator (indicator) > > + "Return a minor mode symbol from its indicator on the modeline." > > + (if (and (< 0 (length indicator)) > > + (not (string= " " (substring indicator 0 1)))) > > + (setq indicator (concat " " indicator))) > > I'd rather not assume that indicators start with a space. What can I do? (defun lookup-minor-mode-from-indicator (indicator) "Return a minor mode symbol from its indicator on the modeline." (if (and (< 0 (length indicator)) (not (eq (aref indicator 0) ?\ ))) (setq indicator (concat " " indicator))) (let ((minor-modes minor-mode-alist) result) (while minor-modes (let* ((minor-mode (car (car minor-modes))) (anindicator (car (cdr (car minor-modes))))) (setq anindicator (format-mode-line anindicator)) (if (and (stringp anindicator) (string= anindicator indicator)) Should I use string-match instead of string= to compare indicator and anindicator? (concat " " indicator) is wrong idea? Masatake YAMATO