From owner-ntemacs-users@trout  Fri May  2 07:53:19 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Fri" " 2" "May" "1997" "10:14:36" "-0400" "Kevin Greiner" "kgreiner@geosys.com" nil "108" "Re: Thanks to all." "^From:" nil nil "5" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id HAA03990 for <voelker@june.cs.washington.edu>; Fri, 2 May 1997 07:53:17 -0700
Received: from trout.cs.washington.edu (trout.cs.washington.edu [128.95.1.178]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id HAA39838 for <voelker@joker.cs.washington.edu>; Fri, 2 May 1997 07:53:16 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) with ESMTP id HAA12793 for <ntemacs-users@trout.cs.washington.edu>; Fri, 2 May 1997 07:17:46 -0700 (PDT)
Received: from atlas.geosys.com (atlas.geosys.com [204.241.53.50]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with ESMTP id HAA00716 for <ntemacs-users@cs.washington.edu>; Fri, 2 May 1997 07:17:40 -0700
Received: from kgreiner.geosys.com ([204.241.54.69]) by atlas.geosys.com           (Netscape Mail Server v2.02) with ESMTP id AAA10702;           Fri, 2 May 1997 09:16:07 -0500
Message-ID: <3369F6CC.5C2B16F3@geosys.com>
Reply-To: kevingreiner@iname.com
Organization: GeoSystems Global Corp.
X-Mailer: Mozilla 4.0b3 [en] (Win95; I)
MIME-Version: 1.0
X-Priority: 3 (Normal)
References: <B0E879402932CF11B94700805F14E35C044302EB@RED-71-MSG.dns.microsoft.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: kgreiner@geosys.com (Kevin Greiner)
To: Ashish Sikka <ashishs@MICROSOFT.com>
CC: List EMACS <ntemacs-users@cs.washington.edu>
Subject: Re: Thanks to all.
Date: Fri, 02 May 1997 10:14:36 -0400

Many thanks again those who've helped me get started on emacs for NT/95.
Following are the questions that I had and how I resolved them.

-----------------------------------------------------
-Complete "editing session" saving and restoration

	Turns out that standard emacs includes a library to do exactly this.
Only, they call it "desktop saving." Search in the emacs manual for
"desktop" for more info on the default configuration. Franklin Lee sent
me some macros that are pretty useful. Here they are. If you want to use
them, just copy them into your .emacs file. Also, be sure to follow the
directions in the emacs manual for using desktops.

desktop-ask-read: asks before loading a desktop file.
(defun desktop-ask-read()
  "asks politely if desktop read is desired -- in the current
directory only."
  (interactive)
  (let ((filename))
    (if (file-exists-p (concat "./" desktop-basefilename))
        (setq desktop-dirname (expand-file-name "./"))
      (setq desktop-dirname nil))
    (if (and desktop-dirname (y-or-n-p "desktop file found.  read it?
"))
        (desktop-read))))

goto: changes the emacs default directory, checks for a desktop file,
and asks if you want read it.

(defun goto (str)
  "does a cd and also reads desktop there, if any."
  (interactive "Dgoto directory: ")
  (cd str)
  (desktop-ask-read))

desktop-ask-kill: upon leaving emacs, asks if you want to save the
current desktop

(remove-hook 'kill-emacs-hook 'desktop-kill)
(add-hook 'kill-emacs-hook 'desktop-ask-kill)
(defun desktop-ask-kill ()
  "when exiting, ASKS if you want to save the desktop first."
  (if desktop-dirname
      (if (y-or-n-p
           (format "Save desktop configuration to %s? "
desktop-dirname))
          (condition-case err
              (desktop-save desktop-dirname)
            (file-error
             (if (yes-or-no-p
                  "Error while saving the desktop.  Quit anyway? ")
                 nil
               (signal (car err) (cdr err))))))))

-answer from Franklin Lee-


-----------------------------------------------------
-What happens when another program changes a file that emacs has open?

emacs can tell when the disk file is newer than a buffer. However, it
only detects this when the buffer is first changed. Meaning, if you want
to use the Visual C++ ClassWizard to add classes and such, you must be
sure that all you files are saved before using the ClassWizard. Then,
when you attempt to change a file in emacs that the ClassWizard updated,
emacs will tell you. Emacs gives you several options. I always choose
'r', I guess it stands for Revert.
-answer from Franklin Lee-

A second approach involves using gnuserv and batch/command files. I
didn't check into this. I don't have the time or interest as my current
method works very well. For compilation, I just switch to the Visual C++
IDE and hit the keystroke to do a conditional compilation. Someday,
perhaps, I'd like to do the compilation right from within emacs so I can
fix the compile errors more easily.

-----------------------------------------------------
-Changing .h to use automatic C++ formatting (instead of standard C)

(setq auto-mode-alist
      (append '(("\\.h$"       . c++-mode)   ; Changed to C++
                ) auto-mode-alist))

-thanks to many, this snip from Peter Breton


-----------------------------------------------------
-PC-like keystrokes and marking

Enter these commands at the keyboard (or put their equivalent in
.emacs).

to activate pc-selection mode:
    M-x load-l RET pc-select
    M-x pc-selection-mode
to activate pc-mode:
    M-x load-l RET pc-mode
    M-x pc-bindings-mode

-thanks to Wojciech Komornicki



Many thanks again to all the contributors! Have a good weekend. I'm off
for a few days of back-packing in the foothills of the Appalachian
mountains in northeast USA. See ya'll Monday!

-Kevin

