;;; -*- Mode:Common-Lisp; Package:GLOSS; Fonts:(COURIER HL12B HL12BI); Base:10 -*-


;;;                           RESTRICTED RIGHTS LEGEND

;;;Use, duplication, or disclosure by the Government is subject to
;;;restrictions as set forth in subdivision (b)(3)(ii) of the Rights in
;;;Technical Data and Computer Software clause at 52.227-7013.
;;;
;;;                     TEXAS INSTRUMENTS INCORPORATED.
;;;                              P.O. BOX 2909
;;;                           AUSTIN, TEXAS 78769
;;;                                 MS 2151
;;;
;;; Copyright (C) 1985, Texas Instruments Incorporated. All rights reserved.
;;; Copyright (c) 1984, Texas Instruments Incorporated.  All Rights Reserved.
;;; Copyright (C) 1986, Texas Instruments Incorporated. All rights reserved.

;1;; This file contains basic definitions for the glossary system (mostly variable declarations)*


(DEFUN g-string-lessp (x y)
  "2Special string comparison that ignores package names.*"
  (STRING-LESSP x y))

;1;;This isn't used because of the efficiency costs*
;(DEFUN string-to-compare (string)
;  "2Returns a copy of STRING that can be compared using G-STRING-LESSP.*"
;  (SETQ string (STRING string))
;  ;1;First, remove package prefixes*
;  (LET ((position (STRING-SEARCH-CHAR #/: string)))
;    (WHEN (NOT (NULL position))
;      (SETQ string (SUBSTRING string (1+ position))))
;    ;1;Change Numbers to be greater than any letters*
;    (LOOP for number-pos = (STRING-SEARCH-SET "0123456789" string)
;	  until (NULL number-pos)
;	  do
;	  (SETQ string (STRING-APPEND
;			 (SUBSTRING string 0 number-pos)
;			 (+ (AREF string number-pos) (- #/{ #/0))
;			 (SUBSTRING string (1+ number-pos))))))
;  (WHEN (STRING-SEARCH "-" string)
;    (SETQ string (STRING-APPEND
;		   (STRING-STRIP-CHARS "-" string)
;		   0)))			   ;1;This character is appended to ensure that Alist comes before A-list*
;  string)



;1; The type of the glossary data files ("compiled versions")*
(fs:define-canonical-type :cgloss "CGLOSS"
  (:unix "CGloss")
  (:vms "CGl"))

;;*Glossary-area* removed for 4.0... consing area is now SI:WORKING-STORAGE-AREA
;;slm 1/7/88
(DEFPARAMETER *glossary-area* si:working-storage-area)
;(DEFPARAMETER *glossary-area*
;	      ;1;Check if the area already exists to prevent errors*
;   (loop for area-number from 0 below system:size-of-area-arrays
;	 when (eq (area-name area-number) 'glossary-area)
;	 return area-number
;	 finally (return (make-area :name 'glossary-area :region-size 32768)))
;   "2The memory area used by the glossary.*") 

(DEFPARAMETER *default-pathname* (fs:parse-pathname "sys: GLOSSARY; MAIN-GLOSS")
   "2The default filename to be loaded in glossary*") 

(DEFVAR *glossary-hacker-p* nil
  "2When T, the glossary manipulation tools are enabled.
The only facility this offers to the user is the ability to delete
cross-references within the text of a glossary entry.*")

(DEFVAR *glossary-tools-on* nil
  "2When T, the glossary manipulation tools should be displayed.*")

(DEFPARAMETER *entry-text-left-margin* 16
   "2The left margin that the text of new glossary entries will use.in files.*")

(DEFPARAMETER *entry-name-left-margin* 12
   "2The left margin that the names of glossary entries will use in files.*") 

(DEFPARAMETER *xref-generation-notification* 200
   "2If a glossary has more entries than this and a user attempts to generate all
cross-references, the user will be asked for confirmation.
If the value is not an integer:
:prevent-xref - Prevents the user from generating xrefs.
:allow-xref   - Allows the user to generate xrefs of any size glossary wo confirmation.*") 

;1;; Font Information*

;(WHEN (NOT (BOUNDP 'fonts:tr18))     ;1This should be done in the FONTS system (SYS:SYS;SYSDCL)*
;  (LOAD "sys:fonts;tr18"))


;1;;All Entry names are in the same font. (tr12bi)*
(DEFCONSTANT %entry-name-font 'fonts:tr12bi "2This font is used for all entry names.*")

(DEFPARAMETER *entry-name-font* %entry-name-font
   "2Used for printing the entry name in the entry text display.*") 

1;;These fonts are now stored in *alph-font-list**
(DEFPARAMETER *entry-text-font* 'FONTS:TR12
   "2Used for printing the entry text in the entry text display.*") 
(DEFPARAMETER *entry-xref-font* %entry-name-font
   "2Used for printing the xref entry names in the entry text display.*") 

;(DEFCONST *alph-font*         'fonts:tr18 "2Used for displaying the alphabet in the Thumb Index*")

;(DEFCONST *alph-small-font*   'fonts:tr12b
;  "2Alternative font used for the Thumb Index when the menu needs to be smaller.*")

(DEFPARAMETER *entry-menu-font* %entry-name-font
   "2Used for displaying the entry names in the entry menu.*") 

(DEFPARAMETER *label-font* 'FONTS:TR12I "2Used for labels for all of the panes.*") 

(DEFPARAMETER *kbd-font* 'FONTS:HL12B "2Used for keyboard typein - typeout.*") 

(DEFPARAMETER *title-font* 'FONTS:METSI "2Title of the entire frame.*") 

(DEFPARAMETER *pop-up-menu-title-font* 'FONTS:TR18 "2Title of the title for pop up menus.*") 

(DEFPARAMETER *command-menu-font* 'FONTS:HL12BI
   "2Used for the standard entries in the command menu.*") 

(DEFPARAMETER *command-menu-alt-font* 'FONTS:HL12B
   "2Used for extended commands in the command menu.*") 

(DEFPARAMETER *alph-font-list* (LIST FONTS:TR18 FONTS:TR12B FONTS:TR10B FONTS:TR8B FONTS:|5X5|)
   "2The list of the fonts that can be used for the thumb index.
This list should be arranged in order of decending character font height.
The largest font in this list that fits is chosen to be the font in the alph menu.*") 


(DEFPARAMETER *deleted-glossary-entries* ()
   "2The list of glossary entries that have been deleted.  Elements are glossary entry objects.*") 

(DEFPARAMETER *auto-generate-x-references-p* T
   "2Whether cross references are automatically generated for glossary entries that
are created or modified.*") 
