Subject: A late adapter's notes

From: Charles Curley <[email-masked]>
Date: Fri, 13 Nov 1998 13:08:13 -0700

These are my notes on upgrading from Emacs 19.34.6 to 20.3.1.

First, my thanks to Geoff, Andrew, RMS and everyone else associated with
Emacs and NT Emacs for producing a wonderful product! Now, on to the
bitching. :-)

I chose to slurp in the source and compile it. I don't recall reading this
in the FAQ, but you only need emacs-20_3_1-src_tar.gz, not the lisp
package. The lisp is contained in the source archive.

I downloaded the archive to one directory and unpacked from a copy in
another. That way, when I am finished with the unpacked tar file, I can
just delete it instead of recompressing it for storage.

The first thing I did was clear out enough space on my C: drive so I could
untar the archive. The tar file, decompressed, is 54 Mb, and you get 51 Mb
in the tree when you unpack, so you need about 110 Mb while you are
unpacking. It's worse if you are working on a FAT volume because of the
large cluster size.

I unpacked into C:\gnu\emacs-20.3.1, so all my paths below will be relative
to C:\gnu\emacs-20.3.1. Your pathology may vary.

I installed with the tar options including -m, which means tar does not
affect the permission of the files, so a lot of them came out read-only.
Since I have BASH, I used the following command line to solve that problem
(from the directory C:\gnu\emacs-20.3.1):

find -exec attrib -r {} \;

(As the Volkswagen commercials used to say, "It's ugly but it gets you
there.")

The next step is to read the README. The one you want is the nt directory.

I compiled using VC++ 6.0, and everything worked fine. My experience with
Emacs 19.34.6 is that VC++ 6 chopped 64K off the executable, compared to
VC++ 5.

Per the directions, I changed the installation directory:

!ifndef INSTALL_DIR
# INSTALL_DIR     = C:\emacs
INSTALL_DIR     = C:\gnu\emacs-20.3.1
!endif

I don't think you have to edit nt\paths.h. Under item (4) in INSTALL, it
says, "NOTE: You should not have to edit src\paths.h to get Emacs to run
correctly.  All of the variables in src\paths.h are configured during start
up using the nt\emacs.bat file." Addpm updates these paths in the registry,
which over-rides the compiled-in defaults. I did it anyway. Note that if
you do have to change the paths in paths.h, then you also have to change
your paths if you use a directory on C: other than the default, so the
write-up in INSTALL item (3) is misleading.

Then go ahead, be brave, compile. Note the size difference between 19.34.6
and 20.3:

C:\>fn -l gnu emacs.exe
     1953684 gnu\EMACS-19.34\BIN\EMACS.EXE
     5264396 gnu\emacs-20.3.1\src\obj\i386\emacs.exe

(The utility fn is available on my web page.)

However, the size difference does not appear to affect the memory footprint
all that much.

While item (5) of the INSTALL file is correct, it is irrelevant. Rather
than use emacs.bat, follow the instructions to install, and run Emacs by
calling runemacs.exe, not emacs.bat. (Is there any reason to continue
emacs.bat support?)

Since I am not installing to the default c:\emacs directory, I gave the
target directory to the installation batch file:

c:\gnu\emacs-20.3.1\nt>install C:\gnu\emacs-20.3.1

This is probably not necessary

I then launched Emacs from the shortcut addpm.exe creates. It ran (cool!)
but choked on a few things in my .emacs. For one thing, the new version of
Emacs looks at different directories for its lisp and site-lisp. Since it
is possible that there are newer versions of things in the 20.3
distribution, I copied the files I needed in one at a time. I copied the
source only, and byte-compiled each one as needed.

Here are the ones I ended up copying. Your mileage may vary.

biff-mode.el
epop3-riit20.el
epop3.el
epop3hash.el
epop3mail.el
generic-extras.el
generic-mode.el
gnuserv.el
html-helper-mode.el
htmlize.el

Another adjustment to make is the path.

Then you get to adjust every shortcut you have. I have lots of them. Gnrrr.
The solution is to put a batch file somewhere and have all your shortcuts
point to that. Then you need only edit the one batch file to change
Emacsen, should you need to go back to 19.34.6.

My batch file is as follows:

c:\gnu\emacs-20.3.1\bin\runemacs.exe %1 %2 %3 %4 %5

The %1, etc, are to pass parameters such as file names to Emacs.

If you do this, you will see a window displayed briefly when you launch
Emacs. That is the batch file's window, which runs only long enough to
launch Emacs.

Icon follies: I set a new shortcut on the desktop to point to the batch
file. The desktop picked out its standard batch file icon (which is pretty
good, considering some of the follies I've seen with NT icons). A while ago
I had compiled a gnu icon into emacs 19.34.6, and it showed up on the
desktop in the shortcut eventually. Well, when I created this shortcut, I
picked the icon from the 20.3.1 emacs, which has the kitchen sink icon.
Guess which icon showed up on the desktop for the shortcut. Yeah. Makes you
want to become an iconoclast.

I thought that somehow in the whole process my Emacs desktop got clobbered.
My solution has been to delete my emacs.dsk file and let the desktop
software rebuild it for me. That worked this time, but with a new file
name, .emacs.desktop. Sneaky. Run M-x desktop-save to force it to save the
first time. If you have both 19.34.6 and 20.3.1, this means you can have
two different desktop files, one for each version. Cool.

Since file extension associations are to gnuclientw, not runemacs or emacs,
you can handle them by having gnuclientw in your path and changing your
path so that it picks up the new runemacs as needed. However, you will have
to reboot to make this work.

Two notes on installing Ispell: the link to the ispell info page from the
file "dir" goes to the "History" node in the ispell file. This is probably
not the intended destination. I was not able to find a work-around for
this. I did, however, email the Keeper of Ispell, Brian Tibbits. Also, I
put the version of ispell.el that comes with ispell into ../site-lisp,
byte-compiled it, and re-named the four ispell files in ../lisp. BTW, the
auto-spell-checking mode that comes with the new Ispell is worth the
upgrade. It's much easier to use than the auto spell checking on a certain
Microsoft product.

If you use Visemacs on Visual C++ and you keep your binary in the Emacs
../bin directory, copy that over to the new ../bin directory, and update
where VC++ finds the dll. Eventually, you may delete the old Emacs
directory tree, and the Visemacs dll with it. So copy it over now.

I did try to byte-compile html-helper-mode.el (my own customized version)
with 20.3.1, and Emacs bombed. I was able to byte-compile it with 19.34.6,
and got these error messages:

Compiling file c:/gnu/EMACS-19.34/site-lisp/html-helper-mode.el at Thu Nov
12 12:29:12 1998
  ** reference to free variable epoch::version
  ** reference to free variable browse-url-browser-function
  ** reference to free variable html-helper-list-map
  ** reference to free variable html-helper-list-menu
  ** assignment to free variable html-helper-list-menu
  ** reference to free variable browse-url-browser-function
While compiling html-helper-mode:
  ** reference to free variable html-helper-font-lock-keywords
  ** assignment to free variable font-lock-no-comments
While compiling the end of the data:
  ** The following functions are not known to be defined: 
    tempo-template-html-definition-item, tempo-template-html-list-item,
    tempo-template-html-skeleton, hilit-set-mode-patterns

I also am seeing Emacs crash while it has a file in html-helper-mode
loaded. This may be due to the font-locking problem. Then again, it may
not. I did close that buffer and still have Emacs crash on me. I had to
close down the buffer and then exit Emacs quickly so desktop-save would
take effect before it could crash. The lazy-lock fix in the FAQ seems to
help, though. 

Printing setup was rather painless. I ended up with the following:

;; Begin setup for printing on Win32, Emacs 20.3.1
(if (and  (>= emacs-major-version 20)
	  (or (eq window-system 'w32) (eq window-system 'win32)))
    (progn (setq printer-name "//server/HP DJ 500")
	   (setq ps-printer-name "//ccurley1/AppleLas"))
;   (setq ps-printer-name "RPT3")
  )
;; End setup for printing on Win32, Emacs 20.3.1

Note that printing to the postscript printer required a kludge. If I try to
print to RPT3, Emacs creates a file of that name. Oops. Instead, I had to
make it sharable by name and address it by the share name.

		-- C^2

	I have sworn upon the altar of God eternal hostility against every form of
tyranny over the mind of man.
-- Thomas Jefferson, letter to Benjamin Rush, 1800 A.D.

Thomas Jefferson, Patron Saint of the Internet:
http://w3.trib.com/~ccurley/Jefferson.html