1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
|
<!doctype HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>Older changes in Lightning Completion/Ultra-TeX</title>
<link REV="made" HREF="mailto:palmieri@member.ams.org">
</head>
<body>
<h2>Older changes in Lightning Completion/Ultra-TeX</h2>
<h4>Changes made 28 April 1998:</h4>
<strong>ultex.el:</strong> <p>
Bug fix in <code>ultex-make-ref-from-label</code>.
<h4>Changes made 17 April 1998:</h4>
<strong>ultex.el:</strong> <p>
Bug fix.
<h4>Changes made 7 April 1998:</h4>
<strong>ultex.el:</strong> <p>
Fixed a bug in <code>ultex-grab-bibs</code>, and reorganized some
stuff.
<p>
<h4>Changes made 27 March 1998:</h4>
<strong>ultex.el:</strong> <p>
There are about a dozen changes. From the user's point of view, the
most important ones are: <code>ultex-grab-defs</code> now works
recursively on all input and include files.
<code>ultex-grab-commands</code> now recognizes
<samp>\DeclareMathSymbol</samp>. And hitting <kbd>TAB</kbd> (which runs
<code>ultex-tab-resume</code>) now works better at resuming
completion.
<p>
As far as the recursive command-grabbing goes, if you have an
<samp>\input{bozo}</samp> command and you don't want the file
<samp>bozo</samp> to be scanned by Ultra-TeX, put a space or <kbd>TAB</kbd>
at the beginning of the line (before the <samp>\input</samp>
command).
<p>
<h4>Changes made 23 March 1998:</h4>
<strong>ultex.el:</strong> <p>
Fixed bug in <code>ultex-grab-commands</code>,
<code>ultex-grab-labels</code>. <p>
<h4>Changes made 22 September 1997:</h4>
<strong>ultex-setup.el:</strong> <p>
Made the font-lock stuff work with GNU Emacs 20.1 (at least on my
machine). Some day soon I may rewrite ultex-setup.el (etc.) so that
you can use the custom package to customize everything. <p>
<h4>Changes made 1 August 1997:</h4>
<strong>ultex.el:</strong> <p>
Fixed a little bug in <code>ultex-grab-bibs</code>. This only affects
things when this function is called in a buffer which is not
associated to any file. (That's why I said "little bug.") <p>
<hr>
<h4>Changes made between 1 March 1997 and 31 July 1997:</h4>
I've reorganized the distribution: now there is a main directory
called <code>ultratex-0.3</code> (0.3 is the version number); it has
subdirectories <code>lisp</code>, <code>texi</code>, and
<code>user</code>, which contain, respectively, the main lisp code,
the documentation (in texinfo format), and sample user customization
files. Changing to the main directory and typing
<code>make all</code> will byte-compile the lisp files and format the
documentation into both info files and dvi files. <p>
<strong>aucify.el:</strong> <p>
In response to changes in a recent version of AUC-TeX, I introduced a
new variable, <code>ultex-ignore-auctex-tex.el</code>. If this is
non-nil (the default), then the AUC-TeX file <code>tex.el</code> will
not be loaded when requested by other files (such as
<code>tex-buf.el</code>). If the only part of AUC-TeX that you use is
the part that comes with Ultra-TeX (i.e., just the file
<code>tex-buf.el</code>), then this change won't affect you. If you
use more features of AUC-TeX than that, you should set this variable
to be nil (although this may break some things in
<code>aucify.el</code>). If I get a chance (or if Mark Hovey does),
then we may clean this up a bit. <p>
<strong>light.el:</strong> <p>
Fixed a few bugs. <p>
<strong>ultex.el:</strong> <p>
Fixed a few bugs. Also, in <code>ultex</code>, added recognition for
<samp>providecommand</samp>. <code>ultra-tex-mode</code> no longer
runs <code>text-mode-hook</code> when it starts, because it shouldn't.
It still runs <code>tex-mode-hook</code>, and of course
<code>ultra-tex-mode-hook</code>. Furthermore, if you are typing on a
line which has been commented out and you use a math-mode specific
command (like a Greek key), ultra-tex won't beep at you. Similarly,
if you use a math-mode specific command in the argument to
\newcommand (etc.), it won't beep at you.
<p>
<strong>Other:</strong> <p>
In response to unpopular demand (i.e., nobody has mentioned it, but I
thought it was a good idea), I've started to include the files
<code>tex-buf.el</code> and <code>font-latex.el</code> with the
distribution. This way, users don't have to go around getting various
things by ftp, and they get versions of these files that have been (at
least cursorily) tested with Ultra-TeX. <p>
<hr>
<h4>Changes made between 15 February 1997 and 28 February 1997:</h4>
<strong>light.el:</strong> <p>
I incorporated the stuff in the file <code>bufcomp.el</code> into
<code>light.el</code>, and removed <code>bufcomp.el</code> from the
package. <p>
Things regarding the <samp>*Completions*</samp> buffer were fixed up a
bit, so that they seem to work with XEmacs. I also fixed one or two
bugs. <p>
<strong>ultex18.el:</strong> <p>
This is a new file. Various changes in <code>ultex.el</code> make it
incompatible with GNU Emacs 18, so <code>ultex18.el</code> patches the
problems. If you use GNU Emacs 18, just make sure that both
<code>ultex.el</code> and <code>ultex18.el</code> are in your
load-path; <code>ultex-setup.el</code> will figure out which version
of Emacs you are using, and load the appropriate thing. (GNU Emacs 18
requires both of these files, by the way.)
<strong>ultex.el:</strong> <p>
The Greek keymap stuff was rewritten a bit. This shouldn't have too
much of an impact on anyone, I hope. <p>
There is a new variable, <code>ultex-dont-use-completion</code>. If
for some odd reason, you want to use Ultra-TeX mode, but you don't
want to use lightning completion, then set this variable to
<samp>t</samp>--i.e., put a line like this in your <code>.emacs</code>
(or <code>.ultex</code>) file:
<pre>
(setq ultex-dont-use-completion t)
</pre>
Then you never enter lightning completion mode; instead, the
<kbd>TAB</kbd> key tries to complete on TeX commands, using a new
function, <code>ultex-try-to-complete</code>. I don't know how well
this works yet, so let me know if you find problems. <p>
I've introduced three new variables, <code>ultex-match-braces</code>,
<code>ultex-match-brackets</code>, and
<code>ultex-match-parens</code>. The default values are t, nil, and
nil, respectively. If <code>ultex-match-braces</code> is non-nil,
then hitting <kbd>{</kbd> inserts <samp>{}</samp> into the buffer (and
similarly for the other two variables). So the default behavior of
ultra-tex regarding insertion of braces, brackets, and parentheses
hasn't changed, but it's easier to modify that behavior. <p>
<hr>
<h4>Changes made between 17 January 1997 and 14 February 1997:</h4>
<strong>light.el:</strong> <p>
Just a few bug fixes and things like that. <p>
<strong>ultex.el:</strong> <p>
There is a new variable, <code>ultex-rescan-after-new-label</code>.
If this is non-nil, then every time you enter a new \label, Emacs
rescans your file for labels. This way, if you change a label, Emacs
won't complete on the old one. <p>
There is a new function, <code>ultex-dont-use-completion</code>. If
for some odd reason, you want to use Ultra-TeX mode, but you don't
want to use lightning completion, then add this function to your
<code>ultra-tex-mode-hook</code>--i.e., put a line like this in your
<code>.emacs</code> (or <code>.ultex</code>) file:
<pre>
(add-hook 'ultra-tex-mode-hook 'ultex-dont-use-completion)
</pre>
Then you never enter lightning completion mode; instead, the
<kbd>TAB</kbd> key tries to complete on TeX commands. I don't know
how well this works yet, so let me know if you find problems. <p>
<hr>
<h4>Changes made between 10 December 1996 and 16 January 1997:</h4>
<strong>ultex.el:</strong> <p>
I have enhanced the behavior of the dollar sign. For quite a while
now, if you had <samp>$$</samp> with the cursor between the dollar
signs, then hitting <kbd>$</kbd> would produce <samp>$$\n\n$$</samp>,
and so on. This now works even if the math environment is not empty,
so that if you have <samp>$x=y$</samp> with the point somewhere
between the dollar signs, hitting <kbd>$</kbd> produces
<pre>
$$
x=y
$$
</pre>
with the cursor placed appropriately. In addition, if you have
<samp>$x=y</samp> and Emacs can't find the closing <samp>$</samp>,
then hitting <kbd>$</kbd> puts a <samp>$</samp> at the point.
Similarly, if you have <samp>\begin{equation}</samp> and Emacs can't
find the closing <samp>\end{equation}</samp>, it inserts that string
wherever you hit <kbd>$</kbd>. These changes are quite recent, and I
expect there to be a few bugs. Let me know if you find any.
<p>
I have also changed the default value of
<code>ultex-dollar-array</code>. The entries are now:
<pre>
Starting delimiter Ending delimiter
$ $
\[ \]
\begin{equation}\label{} \end{equation}
\begin{equation*} \end{equation*}
\begin{align}\label{} \end{align}
\begin{align*} \end{align*}
\begin{gather}\label{} \end{gather}
\begin{gather*} \end{gather*}
\begin{multline}\label{} \end{multline}
\begin{multline*} \end{multline*}
</pre>
Note: there is (and has been for some time) a variable
<code>ultex-dollar-back</code>. It determines the entry number, in
this list, to start with after you have cycled through one time. The
entries are numbered starting with 0, and this variable is set, by
default, to 1. So if you have <samp>\begin{multline*}
... \end{multline*}</samp>, hitting <kbd>$</kbd> changes this to
<samp>\[ ... \]</samp>. Hence if you put
<pre>
(setq ultex-dollar-back 0)
</pre>
in your <code>ultra-tex-mode-hook</code>, then hitting <kbd>$</kbd>
would instead have produced <samp>$ ... $</samp>. <p>
I changed <code>ultex-math-mode</code>, the function that tries to
determine if the cursor is in a math environment or not. Now: it no
longer beeps when you are entering arguments to <samp>\newcommand</samp>
and <samp>\renewcommand</samp>, and it no longer treats the string
<samp>\\[</samp> as the start of a math environment, which it used to
because it would only look at the substring <samp>\[</samp>. <p>
There were some problems with comments and indentation and things; I
think I have fixed them. (But in so doing, I have probably introduced
some new problems. Oh well.) Along the way, I corrected an
oversight, pointed out by Tom Roby: now \% is no longer treated as the
start of a comment. <p>
<strong>light.el:</strong> <p>
There are now functions <code>lc-make-command-dark</code> and
<code>lc-make-command-light</code> for disabling and then re-enabling
lightning completion on commands. For example, I use
<pre>
(lc-make-command-dark 'dired-create-directory)
</pre>
to disable lightning completion when using the function
<code>dired-create-directory</code>. I can re-enable lightning
completion for this command via
<pre>
(lc-make-command-light 'dired-create-directory)
</pre>
(Note: <code>lc-make-command-light</code> does not, all by itself,
turn on lightning completion; it only turns it back on if you have
temporarily turned it off for a particular command.) <p>
I changed some things around so that file-name completion is a bit
faster when looking at big directories, and you don't get that long
pause anymore if the minibuffer says "/home/palmieri/" and you hit
"/". <p>
<hr>
<h4>Changes made on 10 December 1996:</h4>
<strong>sample.emacs</strong> <p>
New file: this is a sample <code>.emacs</code> file for use with
<code>light.el</code>. <p>
<strong>sample.ultex</strong> <p>
New file: this is a sample <code>.ultex</code> file for use with
<code>ultex.el</code>. <p>
<hr>
<h4>Changes made on 03 December 1996:</h4>
<strong>ultex.el:</strong> <p>
I removed the key binding on <kbd>C-c C-g</kbd>. This used to be
bound to <code>ultex-redefine-greek-key</code>, but I don't think one
should use that very much. And if I hit <kbd>C-c</kbd> accidentally,
I want to be able to cancel it by hitting <kbd>C-g</kbd>. <p>
Due to changes in lightnification, <code>ultex-delete-csname</code>
(bound to <kbd>C-c C-d</kbd>) no longer completes on TeX commands.
This will be fixed eventually. <p>
There are several changes to <code>ultex-grab-defs</code>, the
function that Ultra-TeX uses to find TeX commands. First, it now will
search the buffer no farther than the first occurrence of
"\end{document}" (if it can find that string), so if you put
"\newcommand"s (or whatever) after that, they will be ignored by
Emacs, just as they are ignored by LaTeX. Second, it ignores lines
that are commented out. <p>
<hr>
<h4>Changes made on 02 December 1996:</h4>
<strong>light.el:</strong> <p>
Added a few things to lightnification. There is a new variable,
<code>lc-dark-recursive-minibufs</code>. If this is a number
<var>N</var>, then lightning completion will be disabled if the
recursion depth is bigger than <var>N</var>; if this is non-nil but
not a number, it's as if the value were 1. If it is nil, then
lightning completion goes ahead normally. <p>
Another new variable: <code>lc-dark-commands</code>. This is a list
of commands for which lightning completion is disabled. For example,
if you want one version of <code>find-file</code> which uses lightning
completion and another that doesn't, give the following commands:
<pre>
(lightnify 'files) ;; enables lightning completion on file names
(defalias 'find-file-dark 'find-file) ;; defines new command,
;; find-file-dark, which acts like find-file
(setq lc-dark-commands (cons 'find-file-dark lc-dark-commands))
;; adds find-file-dark to lc-dark-commands
</pre>
This way, <code>find-file-dark</code> will not use lightning
completion. <p>
<hr>
<h4>Changes made on 27 November 1996:</h4>
<strong>light.el:</strong> <p>
Totally rewrote the <code>lightnify</code> function, at Richard
Stallman's suggestion. Now, rather than using lightnify on particular
functions, you use it on situations. For example, calling
<pre>
(lightnify 'files)
</pre>
turns on lightning completion whenever you enter a file name in the
minibuffer. Calling <code>(lightnify 'files)</code> again turns
this lightning completion off. <strong>Important:</strong> Before any
of this will take effect, you have to give the command
<pre>
(add-hook 'minibuffer-setup-hook 'lightning-completion)
</pre>
Here are the arguments you can give to <code>lightnify</code>, and
their effects:
<pre>
ARGUMENT EFFECT: toggle lightning completion on
'files file names (e.g., for <kbd>C-x C-f</kbd>)
'commands commands (e.g., for <kbd>M-x</kbd>)
'functions lisp functions (e.g., for <kbd>C-h f</kbd>)
'variables lisp variables (e.g., for <kbd>C-h v</kbd>)
'lisp-objects lisp objects
'user-variables user variables
'buffers buffer names (e.g., for <kbd>C-x b</kbd>)
'info-menu-items menu items in info (e.g., when
you hit <kbd>m</kbd> in Info-mode)
'query buffer contents when using <code>query-replace</code>
'misc everything else
</pre>
There are two other possible arguments:
<pre>
'all turn on lightning completion everywhere imaginable.
'none turn off lightning completion everywhere.
</pre>
Note that <code>(lightnify 'query)</code> requires the use of the
<code>bufcomp.el</code> package, so if you use this, make sure
<code>bufcomp.el</code> is in your load-path.
<strong>Note:</strong> This version of lightning completion does not
work in Emacs 18; if you are using Emacs 18, you have to stick to the
old-fashioned version. (And see the notes on the file
<code>light18.el</code>.) <p>
<strong>light18.el:</strong> <p>
This is a new file. The file <code>light.el</code> is now no longer
completely compatible with Emacs 18. Instead, you should use
<code>light18.el</code>, which in turn loads <code>light.el</code>.
So you need to have both of these files in your load-path, and then
run
<pre>
(load "light18")
</pre>
Since the <code>lightnify</code> function was changed rather
dramatically in Emacs 19 (and XEmacs), the old version is now called
<code>lightnify18</code>. So if you are using Emacs 18, you need to
change all of your calls to <code>lightnify</code> to
<code>lightnify18</code>. <p>
<strong>lightnify-old.el:</strong> <p>
This is a new file. It contains the old version of the
<code>lightnify</code> function, in case you want to use that instead
of the improved one. Load this file after you've loaded
<code>light.el</code>.
<p>
<hr>
<h4>Changes made on 21 November 1996:</h4>
<strong>aucify.el:</strong> <p>
Lightnified <code>TeX-command-master</code>, etc. Also added some
code to determine whether to run xdvi with a landscape option or not. <p>
<strong>ultex-setup.el:</strong> <p>
Fixed changes from 20 November, so that <code>imenu</code> and
<code>bib-cite</code> work well together or separately.
<hr>
<h4>Changes made on 20 November 1996:</h4>
<strong>ultex.el:</strong> <p>
Two little changes: I defined a new function, called
<code>ultex-imenu-create-index</code>, for imenu support. Also,
<code>ultra-tex-mode</code> now runs <code>tex-mode-hook</code> when
it starts up, as well as <code>text-mode-hook</code> and
<code>ultra-tex-mode-hook</code>, which it has always run). <p>
<strong>ultex-setup.el:</strong> <p>
Added two new variables: <code>ultex-use-imenu</code> and
<code>ultex-use-bib-cite</code>. If non-nil, these tell Ultra-TeX to
use the imenu package and the bib-cite package, respectively. See
ultex-setup.el for a bit more documentation. <p>
<hr>
<h4>Changes made on 19 November 1996:</h4>
<strong>light.el:</strong> <p>
Messed around a bit so that when you enter lightning completion mode,
there is a menu called "Light" rather than a menu called "Minibuf"
(the way there used to be). <p>
<strong>aucify.el:</strong> <p>
(This is the file that adds the AUC-TeX feature of running (La)TeX on
the current document, and things like that.) There were some bugs
here--we left some things out when we were stealing things from the
AUC-TeX package, and now we've put them back in. <p>
<hr>
<h4>Changes made on 14 November 1996:</h4>
<strong>light.el:</strong> <p>
First of all, I've changed the default key bindings for lightning
completion, so that there is some consistency with the default Emacs
completion. In particular, the <kbd>TAB</kbd> key opens up a
<code>*Completions*</code> buffer with a list of possible completions;
the <kbd>RET</kbd> key acts like <kbd>LFD</kbd>: it ends completion
(and exits the minibuffer, if you're in the minibuffer). To cycle
through the possible completions, you hit <kbd>C-f</kbd>. To cycle
backwards, hit <kbd>C-b</kbd>. If you want to keep using the old
keybindings, put the following in your <code>.emacs</code> file
(before you load <code>light.el</code>):
<pre>
(setq lc-use-old-lc-keymap t)
</pre>
I've changed the documentation to take these changes into
consideration. <p>
(By the way, the more I play with the keymap code in
<code>light.el</code>, the less satisfied I am with this code when
combined with XEmacs. Some day I'll have to rewrite the keybindings
for XEmacs, but getting things to work well with GNU Emacs 19 is my
highest priority.) <p>
Next, I've made the <code>*Completions*</code> buffer work better, at
least in GNU Emacs 19. If you hit <kbd>TAB</kbd> (with the new key
bindings), this buffer is opened, and it should say something like
this at the top:
<pre>
Click mouse-2 on a completion to select it.
In this buffer, type RET to select the completion near point.
</pre>
(I suppose the first line might not be there, or it might be
different, if you're not using X windows.) If you hit <kbd>M-v</kbd>
(or the <kbd>Page Up</kbd> key), the cursor is moved to the
<code>*Completions*</code> buffer. You can move around in this buffer
as usual, and hitting <kbd>RET</kbd> selects the choice nearest the
cursor as your completion. <p>
Lastly, all the stuff discussed below about
<code>lc-override-flag</code> may be unnecessary. I do not set this
flag to <code>t</code>, and I never have any problems. So don't be
too quick about changing the default setting of this variable. <p>
I also changed the version number to 0.21. <p>
<hr>
<h4>Changes made between 6 November 1996 and 13 November 1996:</h4>
<strong>light.el:</strong> <p>
Back in August (or so), I changed light-mode so that it would work
better with minor modes like outline mode that use <kbd>C-c</kbd> for
a prefix character. Well, this produced a minor conflict: if you were
in lightning completion mode and you hit <kbd>RET</kbd> to get a list
of possible completions, you couldn't select one with the mouse the
way you were supposed to. I don't feel like fixing this properly, so
there is a temporary fix. By default now, the mouse thing will work,
but you will have problems if you use minor modes that use
<kbd>C-c</kbd> as a prefix character. To reverse this situation, put
the following line in your <code>.emacs</code> file:
<pre>
(setq lc-override-flag t)
</pre>
<hr>
<h4>Changes made between 27 October 1996 and 6 November 1996:</h4>
Started using version numbers. Since the packages are at least 6 years
old, I decided to start with version 0.2. <p>
<strong>light.el:</strong> <p>
Only the addition of a version number. <p>
<strong>ultex.el:</strong> <p>
There are two major changes here. First of all, installation is
different. Rather than having lines like
<pre>
(defun tex-mode nil (interactive) (ultra-tex-mode))
(defun latex-mode nil (interactive) (ultra-tex-mode))
(defun LaTeX-mode nil (interactive) (ultra-tex-mode))
</pre>
in your <code>.emacs</code> file, you instead load the file
<code>ultex-setup.el</code>. For example, my <code>.emacs</code> file
contains the following line:
<pre>
(load "ultex-setup")
</pre>
Other Ultra-TeX customization can be done either in
<code>.emacs</code>, or in a file called <code>.ultex</code>. Here
are the contents of my <code>.ultex</code> file, more or less:
<pre>
(setq ultex-tree-file "~/tex/inputs/ultra-tex/textree.el"
ultex-greek-keys-file "~/tex/inputs/ultra-tex/greek.el"
ultex-latex-skel-file "~/tex/inputs/ultra-tex/skel.tex"
ultex-alist-local-flag t
ultex-use-color t
ultex-use-font-latex t
ultex-use-auctex t)
(add-hook 'ultra-tex-mode-hook
...
etc
...)
</pre>
The file <code>ultex-setup.el</code> not only replaces the
<code>(defun tex-mode ...)</code> lines, but (as you might infer from
my <code>.ultex</code> file) it also does some other stuff:
<ul>
<li> If you set the variable <code>ultex-use-color</code> to t, then
(when using X windows with a color display, together with Emacs 19 or
XEmacs) your TeX buffers will be colorized.
<li> If <code>ultex-use-font-latex</code> is nil (the default), then
Emacs uses colors according to its standard colorization of TeX
buffers; if this variable is t, then Emacs colorizes (I suppose
"fontifies" is the more appropriate "word") things according to the
instructions in the file <code>font-latex.el</code>. (This file is
not included with the Ultra-TeX distribution, because I didn't write
it and don't maintain it. There are instructions for how to get it in
the <a name="TOC12" href="ultra_3.html#SEC12">Installation section</a>
of the Ultra-TeX documentation.)
<li> Mark Hovey threw together some code to do the following: if the
variable <code>ultex-use-auctex</code> is non-nil, then you can use
AUC-TeX commands for doing things like running LaTeX on a buffer, or
spawning a previewer, or printing your document. (This requires one
file, <code>tex-buf.el</code>, from the AUC-TeX distribution. Again,
this is not included in the Ultra-TeX package--see the <a name="TOC12"
href="ultra_3.html#SEC12">Installation section</a> of the Ultra-TeX
documentation for information about where to get it.)
</ul>
There are one or two other changes in <code>ultex.el</code>: it used
to be that whenever you edited a TeX document, your tex-tree file
would be open in some other buffer. That is no longer the case--now,
your tex-tree file is opened, read, and then closed, whenever Emacs
needs to read the default list of TeX commands; it does not hang
around to clutter up your buffer list. Similarly, if you have a
Greek keyboard displayed, once it is no longer visible, then that
buffer is deleted (so you don't end up with lots of buffers called
<samp>*greek keyboard*</samp> and things like that).
<hr>
<h4>Changes made between 5 September 1996 and 27 October 1996:</h4>
<strong>ultex.el:</strong> <p>
Introduced a new variable, <code>ultex-alist-local-flag</code>. Its
default value is nil; if you set it to be non-nil (in your
<code>.emacs</code> file, for instance), then the ultex-current-alist
will be buffer-local. <p>
Changed <code>ultex-grab-defs</code> in two ways. First, in the old
version, calling this function with some argument, say "bozo.tex",
would leave you with the a buffer containing the file bozo.tex (so,
for instance, <code>ultra-tex-mode</code> would be started for that
file, and if you were using <code>font-lock-mode</code> in X windows,
then the buffer would be fontified; all this caused a noticeable
delay). In the new version, this shouldn't happen--a temporary buffer
is created, scanned, and then deleted. Second, in the old version, if
the variable <code>ultex-alist-local-flag</code> were non-nil, so that
the ultex-current-alist were buffer-local, then grabbing definitions
from another buffer would have no effect on the definitions in the
current one. This has been changed, so that running
<code>ultex-grab-defs</code> on the file bozo.tex adds the TeX
commands from bozo.tex to the ultex-current-alist associated to the
current buffer. (So if <code>ultex-alist-local-flag</code> is
non-nil, then the commands from bozo.tex are only valid in the buffer
from which you gave the ultex-grab-defs command; if the variable is
nil, then those commands are valid in all buffers running
ultra-tex-mode.) <p>
Fixed a small bug in <code>ultex-scan-bbl</code> that caused problems
with GNU Emacs 18.
<hr>
<h4>Changes made between June 1996 and September 1996:</h4>
<strong>light.el:</strong> <p>
In GNU Emacs and XEmacs, gave light-mode its own minor-mode-keymap.
This (mostly) shouldn't affect the behavior of lightning completion,
but it should make the package a bit more compliant with guidelines
set out by the GNU people. (The one way in which it might affect the
behavior is as follows: if you are using some minor mode, like
outline-mode, which makes use of the key <kbd>C-c</kbd>, then that
definition of <kbd>C-c</kbd> would take precedence over the
lightning completion one. So you couldn't stop lightning completion
with <kbd>C-c</kbd> if you were using outline-mode. Now you can.) <p>
<strong>ultex.el:</strong> <p>
Some of the default values for certain variables have been changed.
For example, the variables ultex-math-start, ultex-math-end,
paragraph-start, and paragraph-separate have been changed, so (in
LaTeX2e, at least) hitting <kbd>M-q</kbd> to fill a paragraph works
better than it did before. <p>
Hitting the key <kbd>M-X</kbd> (that's meta-shift-x, not meta-x) gives
\text{}, beeping if you're not in math mode. <p>
Emacs understands the environment variable BIBINPUTS pretty well, so
it can probably find your .bib file (if you use a \bibliography
command, that is). <p>
<hr>
<h4>Changes made before June 1996:</h4>
<strong>light.el:</strong> <p>
One or two things were rewritten, but this shouldn't affect things
from the user's viewpoint. (For instance, lightnification uses the
<code>minibuffer-setup-hook</code>.) This was done to make the code
cleaner and (I hope) more robust. <p>
Light.el is now reasonably compatible with GNU Emacs 18, GNU Emacs 19,
XEmacs. ("Reasonably compatible" means that it seems to work, as
far as I've tested it. It doesn't mean that it is written in the
most elegant and/or straightforward manner, or anything like that.)
I've been using GNU Emacs 19, mainly, and I haven't noticed any
glitches... <p>
<strong>ultex.el:</strong> <p>
The behavior of the dollar key has been changed: now when you hit
<kbd>$</kbd> repeatedly, ultra-tex cycles through the elements of the
variable <code>ultex-dollar-array</code>. The default setting is so
that first you get <samp>$$</samp>, with the point in between the
dollar signs, then <samp>$$\n\n$$</samp> (<samp>\n</samp> means
newline, so this means a pair of dollar signs, followed by two
newlines, then another pair of dollar signs) with the point on the
blank line, then
<samp>\begin{equation}\label{}\n\n\end{equation}</samp> with the point
inside the label argument, then
<samp>\begin{equation*}\n\n\end{equation*}</samp>, then
<samp>\begin{eqnarray}\n\n\end{eqnarray}</samp>, then
<samp>\begin{eqnarray*}\n\n\end{eqnarray*}</samp>, then it goes back
to <samp>$$\n\n$$</samp>. To modify this, in your <code>.emacs</code>
file change the variable <code>ultex-dollar-array</code>, and also
include the line <pre>
(setq ultex-dollar-max (length ultex-dollar-array))
</pre>
after you've set <code>ultex-dollar-array</code>. For instance, I
use:
<pre>
(setq ultex-dollar-array
'[
("$$" . -1)
("\\[\n\n\\]" . -3)
("\\begin{equation}\\label{}\n\n\\end{equation}" . -17)
("\\begin{equation*}\n\n\\end{equation*}" . -16)
("\\begin{align}\\label{}\n\n\\end{align}" . -14)
("\\begin{align*}\n\n\\end{align*}" . -13)
("\\begin{gather}\\label{}\n\n\\end{gather}" . -15)
("\\begin{gather*}\n\n\\end{gather*}" . -14)
("\\begin{multline}\\label{}\n\n\\end{multline}" . -17)
("\\begin{multline*}\n\n\\end{multline*}" . -16)
])
(setq ultex-dollar-max (length ultex-dollar-array))
</pre>
(The number at the end is how many spaces to move forward (well,
backward, since they're all negative) from the end. So <samp>("$$"
. -1)</samp> means: insert "$$", then move backward 1 space.) <p>
Fonts are handled a little differently, to take into account the
difference between Latex 2.09 with the old font selection scheme and
Latex 2e (and probably Latex 2.09) with the new font selection scheme.
It used to be that meta-shift-e (a.k.a. <kbd>M-E</kbd>) would insert
<samp>{\em }</samp>, with the point just inside the right brace. Now
it inserts <samp>\emph{}</samp>, with the point inside the braces.
Similarly, <kbd>M-B</kbd> used to insert <samp>{\bf }</samp>; now it
inserts <samp>\mathbf{}</samp> or <samp>\textbf{}</samp>, depending on
whether you're in math mode or not. <p>
Ultra-tex is better at scanning your file for things on which to
complete, when it first opens the file. Some new LaTeX commands
(like <code>\DeclareMathOperator</code>) have been taken into account;
ultra-tex also completes citation keys. For example, if you have a
bibliography in your tex file with commands
<pre>
\bibitem{bozo} blah blah blah
\bibitem{clown} blah blah blah
</pre>
then <samp>\cite[]{bozo}</samp> and <samp>\cite[]{clown}</samp> will
be added to the completion list (where the point goes inside the
square brackets). The same holds if you are editing junk.tex and
there is a file junk.bbl with <samp>\bibitem</samp> commands in it.
(Caveat: these <samp>\bibitem</samp> commands need to appear between
<samp>\begin{thebibliography}</samp> and
<samp>\end{thebibliography}</samp> or else they will be ignored--this
is true for both the tex file and the bbl file.) If your file junk.tex
has a <samp>\bibliography</samp> command, such as
<pre>
\bibliography{bib-file}
</pre>
then (assuming you have the environment variable
<code>BIBINPUTS</code> set), ultra-tex should be able to find the file
bib-file.bib, scan it for things like
<pre>
@article{bozo-clown,
author = "Bozo the Clown", etc.}
</pre>
and then add <samp>\cite[]{bozo-clown}</samp> to its completion
list. <p>
Naturally, the "smart return key" knows about this sort of thing. If
you have <samp>\cite[]{bozo}</samp>, and the cursor is in the empty
square brackets, hitting <kbd>RET</kbd> deletes the brackets and moves
you all the way past <samp>{bozo}</samp>. If you have
<samp>\cite[Theorem A]{bozo}</samp>, hitting <kbd>RET</kbd> from
anywhere inside the square brackets should move you all the way past
<samp>{bozo}</samp>, without deleting the square brackets or their
contents. <p>
<hr>
Last modified 28 April 1998.
<p>
<a href="index.html">Back</a> to the Lightning Completion/Ultra-TeX
home page. <p>
<a href="http://www.nd.edu/~jpalmier">Back</a> to John
Palmieri's home page.
</body>
</html>
|