Source

hyperbole / hmous-info.el

Diff from to

File hmous-info.el

-;;!emacs
-;;
-;; FILE:         hmous-info.el
-;; SUMMARY:      Walks through Info networks using one key.
-;; USAGE:        GNU Emacs Lisp Library
-;; KEYWORDS:     docs, help, hypermedia, mouse
-;;
-;; AUTHOR:       Bob Weiner
-;; ORG:          BeOpen.com
-;;
-;; ORIG-DATE:    04-Apr-89
-;; LAST-MOD:     13-Jun-99 at 01:16:10 by Bob Weiner
-;;
-;; Copyright (C) 1989, 1990, 1991, 1998  BeOpen.com
-;; See the HY-COPY (Hyperbole) or BR-COPY (OO-Browser) file for license
-;; information.
-;;
-;; This file is part of Hyperbole and the OO-Browser.
-;;
-;; DESCRIPTION:  
+;;; hmous-info.el --- Walks through Info networks using one key.
+
+;; Copyright (C) 1989, 1990, 1991, 2006 Free Software Foundation, Inc.
+;; Developed with support from Motorola Inc.
+
+;; Author: Bob Weiner, Brown U.
+;; Maintainer: Mats Lidell <matsl@contactor.se>
+;; Keywords: docs, help, hypermedia, mouse
+
+;; This file is part of GNU Hyperbole.
+
+;; GNU Hyperbole is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; GNU Hyperbole is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
 ;;
 ;;  This code is machine independent.
 ;;
-;;  To install see "hui-mouse.el".
+;;  To install:  See hui-mouse.el
 ;;
-;; DESCRIP-END.
+
+;;; Code:
 
 ;;;###autoload
 (defun smart-info ()
  (2) the Up, Next, or Previous entries of a Node Header (first line),
        the desired node is found;
  (3) the File entry of a Node Header (first line),       
-       the `Top' node within that file is found;
+       the 'Top' node within that file is found;
  (4) at the end of the current node, the Next node is found (this will
-       descend subtrees if the function `Info-global-next' is bound);
+       descend subtrees if the function 'Info-global-next' is bound);
  (5) anywhere else (e.g. at the end of a line), the current node entry is
        scrolled up one windowful.
 
  (2) the Up, Next, or Previous entries of a Node Header (first line),
        the last node in the history list is found;
  (3) the File entry of a Node Header (first line),       
-       the `DIR' root-level node is found;
+       the 'DIR' root-level node is found;
  (4) at the end of the current node, the Previous node is found (this will
        return from subtrees if the function 'Info-global-prev is bound);
  (5) anywhere else (e.g. at the end of a line), the current node entry is
     (let ((nodename "Top") (filep nil))
       (save-excursion
 	(if (and
-	      (re-search-forward "[:, \t\n\r]" nil t)
+	      (re-search-forward "[:, \t\n]" nil t)
 	      (re-search-backward
 		"\\(File\\|Node\\|Up\\|Prev\\|Previous\\|Next\\):[ \t]" nil t))
 	    (progn (setq filep (string-equal
 				 (downcase (buffer-substring
 					     (match-beginning 1)
 					     (match-end 1)))))
-		   (if (re-search-forward (concat ":[ \n\r]\\([^,\t\n\r"
+		   (if (re-search-forward (concat ":[ \n]\\([^,\t\n"
 						  (if filep " ")
 						  "]*\\)") nil t)
 		       (setq nodename (buffer-substring
 					(match-end 1)))))
 	  (error "Node header not found.")))
       (setq nodename
-	    (cond ((eq (aref nodename 0) ?\() nodename)
+	    (cond ((= (aref nodename 0) ?\() nodename)
 		  (filep (concat "(" nodename ")" "Top"))
 		  (buffer-file-name (concat "(" buffer-file-name ")" nodename))
 		  (t nodename)))
       t)))
 
 (defun Info-handle-in-node-hdr-assist ()
-  "If within an Info node header when the `smart-info-assist' command is
+  "If within an Info node header when the 'smart-info-assist' command is
 executed, when within the <FILE> header go to the DIR top-level node.  When
 within any other header (<Up>, <Previous>, or <Next>) go to last node from
 history list.  Return t if in Info node header.  Otherwise return nil."
       nil
     (save-excursion
       (if (and 
-	    (re-search-forward "[:, \t\n\r]" nil t)
+	    (re-search-forward "[:, \t\n]" nil t)
 	    (re-search-backward
 	      "\\(File\\|Node\\|Up\\|Prev\\|Previous\\|Next\\):[ \t]" nil t) )
 	  ;; If in <FILE> hdr
     (save-excursion
       (skip-chars-forward "^:")
       (if (and (re-search-backward
-		"\*\\(Ref\\|Note\\|See\\)\\([ \t\n\r]+\\|$\\)" nil t)
-	       (looking-at "\*\\(Ref\\|Note\\|See\\)[ \t\n\r]+\\([^:]*\\):")
+		"\*\\(Ref\\|Note\\|See\\)\\([ \t\n]+\\|$\\)" nil t)
+	       (looking-at "\*\\(Ref\\|Note\\|See\\)[ \t\n]+\\([^:]*\\):")
 	       (<= (match-beginning 0) opoint)
 	       (> (match-end 0) opoint))
-	  ;; Remove newline and extra spaces from `note-name'
+	  ;; Remove newline and extra spaces from 'note-name'
 	  (setq note-name (hypb:replace-match-string
-			   "[ \t\n\r]+"
+			   "[ \n\t]+"
 			   (buffer-substring
 			    (match-beginning 2) (match-end 2))
 			   " " t))))
 	nil
       (let ((node))
 	(save-excursion
-	  (forward-char) ; Pass `*' char if point is in front of
+	  (forward-char) ; Pass '*' char if point is in front of
 	  (if (search-backward "\n*" nil t)
 	      (progn (forward-char 2)
 		     (setq node (Info-extract-menu-node-name)))))
 	  t)))))
 
 (provide 'hmous-info)
+
+;;; hmous-info.el ends here