]> code.delx.au - gnu-emacs-elpa/blob - packages/notes-mode/notes-variables.el
0f83ac2156ea432905831a4af52804f21ee7da13
[gnu-emacs-elpa] / packages / notes-mode / notes-variables.el
1
2 ;;;
3 ;;; notes-variables.el
4 ;;; $Id: notes-variables.el,v 1.30 2007/11/06 02:45:55 johnh Exp $
5 ;;;
6 ;;; Copyright (C) 1994-2000 by John Heidemann
7 ;;; Comments to <johnh@isi.edu>.
8 ;;;
9 ;;; This file is under the Gnu Public License, version 2.
10 ;;;
11
12 ;;
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)
18 ;;
19
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")
23
24 ;;
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.
29 ;;
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.
34 ;;
35 (save-excursion
36 (if (null (file-exists-p (concat notes-utility-dir "/mkconfig")))
37 (progn
38 ;;
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.
47 ;;
48 (error "notes-mode is incorrectly installed. Consult the INSTALL section of README.")))
49 (let*
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))))
53 (if (and
54 (not (file-exists-p source-file))
55 (not noninteractive))
56 (progn
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)
63 t)
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
67 (erase-buffer)
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
71 (eval-current-buffer)
72 (kill-buffer cache-buf)))
73
74
75 (setq auto-mode-alist
76 (cons (cons
77 (concat notes-int-glob "/" notes-file-glob ".?$")
78 'notes-mode)
79 auto-mode-alist))
80
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).")
86
87 (defvar notes-use-font-lock t
88 "* Enable notes fontification.")
89
90 (defvar notes-use-outline-mode t
91 "* Enable outline-minor-mode in all notes buffers?")
92
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.")
96
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.")
100
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?
106 )
107 "* Font-lock keywords for notes mode.")
108
109 (defvar notes-index-font-lock-keywords
110 '(("^[^:]*:" . notes-bold-face)
111 ("\\<[0-9]*\\>" . mouse-face)
112 )
113 "* Font-lock keywords for notes-index mode.")
114
115 (defvar notes-mode-complete-subjects t
116 "* Enable subject completion in notes mode?")
117
118 (defvar notes-w3-follow-link-mouse-other-window t
119 "* Should notes-w3-follow-link-mouse open another window?")
120
121 (defvar notes-subject-table nil
122 "List of notes-subjects needed for subject completion.
123 Reloaded by loading the notes-index file.")
124
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.")
128
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.")
133
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.")
139
140 (defvar notes-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)
141 "*In XEmacs or Lucid Emacs?.")
142
143 ;;;
144 ;;; prep the load path using the notes-lisp-dir
145 ;;; code stolen from the auctex styles files (specifically tex-site.el)
146 ;;; -- Kannan
147 ;;; Wed Apr 7 09:40:27 EDT 1999
148 ;;;
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))))
154
155 (if notes-running-xemacs
156 (require 'notes-xemacs)
157 (require 'notes-emacs))
158
159 (defvar notes-platform-inited nil
160 "Have we inited our platform (xemacs/emacs)?")
161
162 ;;;
163 ;;; autoloads
164 ;;;
165
166 \f
167 ;;;### (autoloads (notes-index-mode) "notes-index-mode" "notes-index-mode.el" (12248 45843))
168 ;;; Generated autoloads from notes-index-mode.el
169
170 (autoload (quote notes-index-mode) "notes-index-mode" "\
171 Notes-index-mode with mouse support.
172
173 You may wish to change notes-bold-face and notes-use-font-lock.
174
175 Key bindings are:
176 \\{notes-index-mode-map}" t nil)
177
178 ;;;###autoload
179 (autoload (quote notes-index-todays-link) "notes-index-mode" "\
180 * Open the notes file for today." t nil)
181
182 ;;;***
183 \f
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
186
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)
191
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)
195
196 (autoload (quote notes-w3-follow-link-mouse) "notes-url" "\
197 * Follow the URL where the mouse is." t nil)
198
199 ;;;***
200
201 \f
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
204
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)
207
208 ;;;***
209
210 (autoload 'notes-mode "notes-mode" "autoloaded notes-mode" t nil)
211
212 (run-hooks 'notes-variables-load-hooks)
213 (provide 'notes-variables)