From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.devel Subject: Re: info-lookup-symbol index case sensitivity Date: Sun, 22 Dec 2002 08:18:44 +1000 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87r8cbaud7.fsf@zip.com.au> References: <87bs42ab5k.fsf@zip.com.au> <877kemsm0o.fsf@zip.com.au> <87adjdfonf.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1040509294 10571 80.91.224.249 (21 Dec 2002 22:21:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 21 Dec 2002 22:21:34 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Prz3-0002hc-00 for ; Sat, 21 Dec 2002 23:20:37 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18Ps1K-0002Ka-00 for ; Sat, 21 Dec 2002 23:22:58 +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 18PryB-0005xY-00 for emacs-devel@quimby.gnus.org; Sat, 21 Dec 2002 17:19:43 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18Prxp-0005wA-00 for emacs-devel@gnu.org; Sat, 21 Dec 2002 17:19:21 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18Prxl-0005vw-00 for emacs-devel@gnu.org; Sat, 21 Dec 2002 17:19:21 -0500 Original-Received: from sunny.pacific.net.au ([203.25.148.40]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Prxj-0005iN-00 for emacs-devel@gnu.org; Sat, 21 Dec 2002 17:19:16 -0500 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id gBLMJ3KR015962 for ; Sun, 22 Dec 2002 09:19:03 +1100 (EST) Original-Received: from localhost (ppp20.dyn228.pacific.net.au [203.143.228.20]) by wisma.pacific.net.au with ESMTP id JAA03526 for ; Sun, 22 Dec 2002 09:19:01 +1100 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 18PrxG-00049L-00; Sun, 22 Dec 2002 08:18:46 +1000 Original-To: emacs-devel@gnu.org In-Reply-To: <87adjdfonf.fsf@zip.com.au> (Kevin Ryde's message of "Wed, 11 Dec 2002 09:19:16 +1000") User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.1 (i386-debian-linux-gnu) 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:10315 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10315 --=-=-= My effort at this, incorporating an amended fix for the bug that started this. * info-look.el (info-lookup): For ease of use try item case-insensitive if not found case-sensitive. Do case sensitive search in index nodes, so items differing only in case go correctly to their respective nodes. --=-=-= Content-Disposition: attachment; filename=info-look.el.lazy-case.diff *** info-look.el.~1.27.~ Sat Jul 27 08:07:16 2002 --- info-look.el Mon Dec 16 16:33:16 2002 *************** (defun info-lookup (topic item mode) *** 318,330 **** (or mode (setq mode (info-lookup-select-mode))) (or (info-lookup->mode-value topic mode) (error "No %s help available for `%s'" topic mode)) ! (let ((entry (or (assoc (if (info-lookup->ignore-case topic mode) ! (downcase item) item) ! (info-lookup->completions topic mode)) ! (error "Not documented as a %s: %s" topic (or item "")))) ! (modes (info-lookup->all-modes topic mode)) ! (window (selected-window)) ! found doc-spec node prefix suffix doc-found) (if (or (not info-lookup-other-window-flag) (eq (current-buffer) (get-buffer "*info*"))) (info) --- 318,331 ---- (or mode (setq mode (info-lookup-select-mode))) (or (info-lookup->mode-value topic mode) (error "No %s help available for `%s'" topic mode)) ! (let* ((completions (info-lookup->completions topic mode)) ! (ignore-case (info-lookup->ignore-case topic mode)) ! (entry (or (assoc (if ignore-case (downcase item) item) completions) ! (assoc-ignore-case item completions) ! (error "Not documented as a %s: %s" topic (or item "")))) ! (modes (info-lookup->all-modes topic mode)) ! (window (selected-window)) ! found doc-spec node prefix suffix doc-found) (if (or (not info-lookup-other-window-flag) (eq (current-buffer) (get-buffer "*info*"))) (info) *************** (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 --- 357,368 ---- nil)) (condition-case nil (progn ! ;; Don't use Info-menu, it forces case-fold-search to t ! (let ((case-fold-search nil)) ! (re-search-forward ! (concat "^\\* " (regexp-quote (or (cdr entry) (car entry))) ! ":"))) ! (Info-follow-nearest-node) (setq found t) (if (or prefix suffix) (let ((case-fold-search *************** (defun info-lookup (topic item mode) *** 364,375 **** (buffer-read-only nil)) (goto-char (point-min)) (re-search-forward ! (concat prefix (regexp-quote item) suffix)) (goto-char (match-beginning 0)) (and (display-color-p) info-lookup-highlight-face ;; Search again for ITEM so that the first ;; occurrence of ITEM will be highlighted. ! (re-search-forward (regexp-quote item)) (let ((start (match-beginning 0)) (end (match-end 0))) (if (overlayp info-lookup-highlight-overlay) --- 370,381 ---- (buffer-read-only nil)) (goto-char (point-min)) (re-search-forward ! (concat prefix (regexp-quote (car entry)) suffix)) (goto-char (match-beginning 0)) (and (display-color-p) info-lookup-highlight-face ;; Search again for ITEM so that the first ;; occurrence of ITEM will be highlighted. ! (re-search-forward (regexp-quote (car entry))) (let ((start (match-beginning 0)) (end (match-end 0))) (if (overlayp info-lookup-highlight-overlay) *************** (defun info-lookup (topic item mode) *** 382,387 **** --- 388,398 ---- (error nil))) (setq doc-spec (cdr doc-spec))) (setq modes (cdr modes))) + ;; Alert the user if case was munged, and do this after bringing up the + ;; info buffer since that can print messages + (unless (or ignore-case + (string-equal item (car entry))) + (message "Found in differnt case: %s" (car entry))) (or doc-found (error "Info documentation for lookup was not found")) ;; Don't leave the Info buffer if the help item couldn't be looked up. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel --=-=-=--