all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Subject: info-lookup-symbol index case sensitivity
Date: Wed, 04 Dec 2002 10:19:19 +1000	[thread overview]
Message-ID: <87bs42ab5k.fsf@zip.com.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 2520 bytes --]

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.



[-- Attachment #2: foo.info --]
[-- Type: application/octet-stream, Size: 726 bytes --]

[-- Attachment #3: foo.el --]
[-- Type: application/emacs-lisp, Size: 293 bytes --]

[-- Attachment #4: info-look.el.diff --]
[-- Type: text/plain, Size: 766 bytes --]

*** 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

             reply	other threads:[~2002-12-04  0:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-04  0:19 Kevin Ryde [this message]
2002-12-05 15:09 ` info-lookup-symbol index case sensitivity Richard Stallman
2002-12-07  0:36   ` Kevin Ryde
2002-12-07  1:13     ` Miles Bader
     [not found]     ` <E18LCzP-0004Kq-00@fencepost.gnu.org>
2002-12-10 23:19       ` Kevin Ryde
2002-12-21 22:18         ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bs42ab5k.fsf@zip.com.au \
    --to=user42@zip.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.