4 ;;; $Id: notes-variables.el,v 1.30 2007/11/06 02:45:55 johnh Exp $
6 ;;; Copyright (C) 1994-2000 by John Heidemann
7 ;;; Comments to <johnh@isi.edu>.
9 ;;; This file is under the Gnu Public License, version 2.
13 ;; This file lists all parameters you might wish to change in
14 ;; notes{-index,}-mode. The best way to handle this in your
15 ;; .emacs file is to do
16 ;; (require 'notes-variables)
17 ;; (setq your-variable-to-change 'your-new value)
20 ;; xxx: if part of emacs, this should be probably be set to exec-directory (?)
21 (defvar notes-utility-dir "/home/johnh/NOTES/BIN"
22 "Location of notes utility programs")
25 ;; Notice: several notes parameters are defined in your
26 ;; ~/.notesrc file. These are not specified here.
27 ;; See mkconfig for details.
28 ;; We fetch them here.
30 ;; To make this fast, we cache the configuration in a .notesrc.el
31 ;; file. We only have to invoke mkconfig when that file is out-of-date.
32 ;; This optimization is very important because notes-variables is
33 ;; required every time emacs is started.
36 (if (null (file-exists-p (concat notes-utility-dir "/mkconfig")))
39 ;; A common user error is that people don't
40 ;; follow the installation instructions.
41 ;; Part of installation is chaning my local paths (with
42 ;; johnh in them) to whatever you use on your system.
43 ;; If the following error is triggered, it's probably
44 ;; because the user didn't RTFM (or even TF README)
45 ;; and just tried to run notes-mode in place.
46 ;; DON'T DO THAT! Follow the installation instructions.
48 (error "notes-mode is incorrectly installed. Consult the INSTALL section of README.")))
50 ((source-file (expand-file-name "~/.notesrc"))
51 (cache-file (expand-file-name "~/.notesrc.el"))
52 (cache-buf (set-buffer (find-file-noselect cache-file))))
54 (not (file-exists-p source-file))
57 (require 'notes-first)
58 (notes-first-use-init)))
59 (if (and ; requirements for a valid cache-file
60 (file-exists-p cache-file)
61 (if (file-exists-p source-file)
62 (file-newer-than-file-p cache-file source-file)
64 (file-newer-than-file-p cache-file (concat notes-utility-dir "/mkconfig")))
65 t ; cache is up-to-date
66 ;; otherwise, refresh the cache
68 (call-process (concat notes-utility-dir "/mkconfig") nil t nil "elisp")
69 (save-buffer cache-buf)
70 (set-file-modes cache-file 420)) ; protect it => mode 0644
72 (kill-buffer cache-buf)))
77 (concat notes-int-glob "/" notes-file-glob ".?$")
81 ;;; xxx: most of these should use defcustom or something similar, I presume.
82 (defvar notes-w3-alternate-url 'browse-url
83 "* A function to call when notes-w3-url cannot handle a complex URL.
84 It now goes through the emacs browse-url package,
85 but you could also set it manually (say, to w3-fetch).")
87 (defvar notes-use-font-lock t
88 "* Enable notes fontification.")
90 (defvar notes-use-outline-mode t
91 "* Enable outline-minor-mode in all notes buffers?")
93 (defvar notes-index-fontify-dates nil
94 "* Fontify dates in notes-index-mode.
95 Turning this off for large notes-index's can improve performance.")
97 (defvar notes-bold-face 'notes-bold-face
98 "* Face to use for notes-index-mode and notes-mode subjects.
99 The default face is copied from 'bold.")
101 (defvar notes-font-lock-keywords
102 '(("^\\* .*$" . notes-bold-face)
103 ("^\\-+$" . notes-bold-face)
104 ;; ("^[0-9]+\\-[A-Za-z]+\\-[0-9]+ [A-Za-z]+$" . font-lock-bold-face)
105 ;; NEEDSWORK: should also highlight URLs, maybe?
107 "* Font-lock keywords for notes mode.")
109 (defvar notes-index-font-lock-keywords
110 '(("^[^:]*:" . notes-bold-face)
111 ("\\<[0-9]*\\>" . mouse-face)
113 "* Font-lock keywords for notes-index mode.")
115 (defvar notes-mode-complete-subjects t
116 "* Enable subject completion in notes mode?")
118 (defvar notes-w3-follow-link-mouse-other-window t
119 "* Should notes-w3-follow-link-mouse open another window?")
121 (defvar notes-subject-table nil
122 "List of notes-subjects needed for subject completion.
123 Reloaded by loading the notes-index file.")
125 (defvar notes-mode-initialization-program "mknew"
126 "Program to run to initialize a new notes file. Must be in notes-bin-dir.
127 If nil, no initialization is done.")
129 (defvar notes-encryption-key-id nil
130 "Keyid of PGP key for the current user.
131 Useful if your \\[user-full-name] doesn't match a unique key.
132 Should have a leading 0x.")
134 (defvar notes-electric-prevnext 2
135 "Amount of electricity in prevnext for notes-mode.
136 nil: don't auto-update anything.
137 1: update prevnext, but don't autosave the old buffer
138 2: update prevnext and autosave the old buffer.")
140 (defvar notes-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)
141 "*In XEmacs or Lucid Emacs?.")
144 ;;; prep the load path using the notes-lisp-dir
145 ;;; code stolen from the auctex styles files (specifically tex-site.el)
147 ;;; Wed Apr 7 09:40:27 EDT 1999
149 (if (boundp 'notes-lisp-dir)
150 (or (assoc notes-lisp-dir (mapcar 'list load-path)) ;No `member' yet.
151 (assoc (substring notes-lisp-dir 0 -1) ;Without trailing slash.
152 (mapcar 'list load-path))
153 (setq load-path (cons notes-lisp-dir load-path))))
155 (if notes-running-xemacs
156 (require 'notes-xemacs)
157 (require 'notes-emacs))
159 (defvar notes-platform-inited nil
160 "Have we inited our platform (xemacs/emacs)?")
167 ;;;### (autoloads (notes-index-mode) "notes-index-mode" "notes-index-mode.el" (12248 45843))
168 ;;; Generated autoloads from notes-index-mode.el
170 (autoload (quote notes-index-mode) "notes-index-mode" "\
171 Notes-index-mode with mouse support.
173 You may wish to change notes-bold-face and notes-use-font-lock.
176 \\{notes-index-mode-map}" t nil)
179 (autoload (quote notes-index-todays-link) "notes-index-mode" "\
180 * Open the notes file for today." t nil)
184 ;;;### (autoloads (notes-w3-follow-link-mouse notes-w3-follow-link notes-w3-file) "notes-url" "notes-url.el" (12248 46828))
185 ;;; Generated autoloads from notes-url.el
187 (autoload (quote notes-w3-url) "notes-url" "\
188 Find a link to an ftp site - simple transformation to ange-ftp format.
189 Takes the URL as an argument. Optionally you specify
190 WHERE the information should appear (either 'otherwindow or not)." nil nil)
192 (autoload (quote notes-w3-follow-link) "notes-url" "\
193 * Follow the URL at the point.
194 NEEDSWORK: should handle (by ignoring) an optional \"URL:\" tag." t nil)
196 (autoload (quote notes-w3-follow-link-mouse) "notes-url" "\
197 * Follow the URL where the mouse is." t nil)
202 ;;;### (autoloads (notes-underline-line notes-end-of-defun notes-beginning-of-defun) "notes-mode" "notes-mode.el" (12250 9363))
203 ;;; Generated autoloads from notes-mode.el
205 (autoload (quote notes-underline-line) "notes-mode" "\
206 *Create a row of dashes as long as this line, or adjust the current underline." t nil)
210 (autoload 'notes-mode "notes-mode" "autoloaded notes-mode" t nil)
212 (run-hooks 'notes-variables-load-hooks)
213 (provide 'notes-variables)