From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs Subject: info-lookup-symbol index case sensitivity Date: Wed, 04 Dec 2002 10:19:19 +1000 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <87bs42ab5k.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1038961077 30922 80.91.224.249 (4 Dec 2002 00:17:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 4 Dec 2002 00:17:57 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18JNEh-00082H-00 for ; Wed, 04 Dec 2002 01:17:55 +0100 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 18JNGq-0004EQ-00; Tue, 03 Dec 2002 19:20:08 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18JNGZ-000406-00 for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2002 19:19:51 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18JNGX-0003zg-00 for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2002 19:19:50 -0500 Original-Received: from sunny.pacific.net.au ([203.25.148.40]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18JNGW-0003y6-00 for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2002 19:19:48 -0500 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id gB40Jjp4024412 for ; Wed, 4 Dec 2002 11:19:45 +1100 (EST) Original-Received: from localhost (ppp28.dyn228.pacific.net.au [203.143.228.28]) by wisma.pacific.net.au with ESMTP id LAA16783 for ; Wed, 4 Dec 2002 11:19:43 +1100 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 18JNG5-0005fA-00; Wed, 04 Dec 2002 10:19:21 +1000 Original-To: bug-gnu-emacs@gnu.org User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.1 (i386-debian-linux-gnu) Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:3999 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:3999 --=-=-= In GNU Emacs 21.1.1 (i386-debian-linux-gnu, X toolkit, Xaw3d scroll bars) of 2001-12-07 on raven, modified by Debian configured using `configure i386-debian-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --with-x=yes --with-x-toolkit=athena --without-gif' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil locale-coding-system: nil default-enable-multibyte-characters: t When the help-data in info-lookup-alist specifies that symbols are case-sensitive, the index search performed by info-lookup-symbol (C-h C-i) is instead case-insensitive when searching through index entries. I'm not aware of any of the manuals in the supplied info-look.el which have two index entries differing only in case. But I encountered the problem while setting up some sh-mode data. bash.info has a variable "GROUPS", and sh-utils.info has the program "groups". The problem can be illustrated with a contrived foo.info below, having index entries "foo" and "FOO". Put it and the foo.el below in an otherwise empty directory and run emacs -q -no-site-file -l foo.el foo.el sets up foo.info as case-sensitive help for fundamental-mode, and leaves such a buffer with "FOO" and "foo" ready to be looked up with C-h C-i. Press C-h C-i on either "FOO" or "foo" and notice that both bring up the node for lower case "foo", whereas I believe for "FOO" it ought to bring up the upper case FOO node. I think this is just a problem with the searching in info-lookup, since info-lookup-cache records the available index entries in their correct case. In fact I believe the use of Info-menu in info-lookup might be the problem, since it forcibly binds case-fold-search to t. No doubt that's good for interactive use, but it's not what info-lookup wants. I get some joy from the info-lookup.el.diff below, doing a case-sensitive search in the index node to get to the right spot. * info-look.el (info-lookup): Replace Info-menu call with a case sensitive search of the index, to preserve sensitivity requested by the help data. I believe this is correct for case-insensitive help modes too, since the index entries in info-lookup-cache are recorded with their case unchanged, only the symbols to which they refer are downcased. --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=foo.info This is foo.info, produced by makeinfo version 4.2 from /home/gg/bug/info-look-case/foo.texi. INFO-DIR-SECTION Programs  File: foo.info, Node: Top, Next: Upper, Prev: (dir), Up: (dir) FOO *** * Menu: * Upper:: * Lower:: * Index::  File: foo.info, Node: Upper, Next: Lower, Prev: Top, Up: Top Upper ***** This is upper case FOO.  File: foo.info, Node: Lower, Next: Index, Prev: Upper, Up: Top Lower ***** This is lower case foo.  File: foo.info, Node: Index, Prev: Lower, Up: Top Index ***** * Menu: * foo: Lower. * FOO: Upper.  Tag Table: Node: Top95 Node: Upper240 Node: Lower349 Node: Index460  End Tag Table --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=foo.el (require 'info) (add-to-list 'Info-additional-directory-list default-directory) (require 'info-look) (info-lookup-add-help :mode 'fundamental-mode :regexp "[a-zA-Z]+" :doc-spec '(("(foo)Index" nil))) (switch-to-buffer "bar") (fundamental-mode) (insert "FOO\nfoo\n") (beginning-of-buffer) --=-=-= Content-Disposition: attachment; filename=info-look.el.diff *** info-look.el.~1.27.~ Sat Jul 27 08:07:16 2002 --- info-look.el Tue Dec 3 19:41:37 2002 *************** (defun info-lookup (topic item mode) *** 356,362 **** nil)) (condition-case nil (progn ! (Info-menu (or (cdr entry) item)) (setq found t) (if (or prefix suffix) (let ((case-fold-search --- 356,366 ---- nil)) (condition-case nil (progn ! ;; Don't use Info-menu, it forces case-fold-search to nil ! (let ((case-fold-search nil)) ! (re-search-forward ! (concat "^\\* " (regexp-quote (or (cdr entry) item)) ":"))) ! (Info-follow-nearest-node) (setq found t) (if (or prefix suffix) (let ((case-fold-search --=-=-=--