Archive-Date: Sun, 03 Nov 1996 18:48:35 +0100
Sender: owner-emacs-testers@lp.se
Date: Sun,  3 Nov 1996 18:48:21 MET
Message-ID: <12924.59637.271755.feedmail.pl5.LEVITTE@devil.bofh.se>
From: Richard Levitte - VMS Whacker <levitte@lp.se>
Reply-To: emacs-testers@LISTS.VMS.GNU.AI.MIT.EDU
To: emacs-testers@lists.vms.gnu.ai.mit.edu
CC: dyson@blanc.physics.uiowa.edu
Subject: Another bug in Emacs has been solved...

With Emacs 19.22, there was a lot of work put into getting a suspended
Emacs to parse arguments given on the command line, and do that correctly.
Apparently, the FSF did something of the same kind, because with Emacs 19.28
for VMS, our scheme didn't work any more.  I discovered a few days ago that
it was because startup.el doesn't look at default-directory any more.  It
looks at command-line-default-directory instead.  The following patches
will addapt the code in vms-patch.el to the new startup.el, as well as
doing a few simplifications:

*** [.lisp]vms-patch.el;3	Sat Sep 21 04:05:08 1996
--- [.lisp]vms-patch.el	Sun Nov  3 17:52:49 1996
***************
*** 193,209 ****
  ;;;
  (defun vms-suspend-resume-hook ()
    "When resuming suspended Emacs, check for file to be found.
! If the logical name `EMACS_FILE_NAME' is defined, `find-file' that file."
!   (let ((file (vms-system-info "LOGICAL" "EMACS_FILE_NAME"))
! 	(args (vms-system-info "LOGICAL" "EMACS_COMMAND_ARGS"))
! 	(line (vms-system-info "LOGICAL" "EMACS_FILE_LINE")))
!     (if (not args)
! 	(if file
! 	    (progn (find-file file)
! 		   (if line (goto-line (string-to-int line)))))
!       (let ((dir (and file (file-name-directory file))))
! 	(if (and file dir) (cd dir))
! 	(vms-command-line-again args)))))
  
  (add-hook 'suspend-resume-hook 'vms-suspend-resume-hook)
  
--- 193,204 ----
  ;;;
  (defun vms-suspend-resume-hook ()
    "When resuming suspended Emacs, check for file to be found.
! If the logical name `EMACS_COMMAND_ARGS' is defined, use the value as
! command line arguments (except the first argument is the new default
! directory."
!   (let ((args (vms-system-info "LOGICAL" "EMACS_COMMAND_ARGS")))
!     (if args
! 	(vms-command-line-again args))))
  
  (add-hook 'suspend-resume-hook 'vms-suspend-resume-hook)
  
***************
*** 275,291 ****
  					; redo the initial display, and
  					; other things that should not be
  					; done now.
! 		       (default-directory def-dir) ; Set up the default
! 					; directory from which possible
  					; files will be loaded.
  		       )
! 		  (command-line-1 command-line-args-left)
! 		  (setq def-dir default-directory))
! 		;; This is necessary, because the default-directory in
! 		;; the let* will be restored to its original value,
! 		;; which is very confusing when it happens to the last
! 		;; buffer just loaded...
! 		(setq default-directory def-dir)))))))
  
  (setq dired-listing-switches
        ;; "/SIZE/DATE/OWNER/WIDTH=(FILENAME=32,SIZE=5)"
--- 270,280 ----
  					; redo the initial display, and
  					; other things that should not be
  					; done now.
! 		       (command-line-default-directory def-dir) ; Set up the
! 					; default directory from which possible
  					; files will be loaded.
  		       )
! 		  (command-line-1 command-line-args-left))))))))
  
  (setq dired-listing-switches
        ;; "/SIZE/DATE/OWNER/WIDTH=(FILENAME=32,SIZE=5)"
*** [.vms]kepteditor.com;1	Sun Feb 25 17:42:04 1996
--- [.vms]kepteditor.com	Sun Nov  3 18:28:24 1996
***************
*** 115,125 ****
  $	message_status	= f$environment("message")
  $	set noon
  $	on control_y then goto quit
  $	set message /nofacility/noidentification/noseverity/notext
  $	if f$edit(args,"COLLAPSE") .eqs. "" then goto no_logical
  $	! We have to include the current directory as first item in the value
  $	definee/nolog/job emacs_command_args -
! 	"''f$trnlnm(""SYS$DISK"")'''f$directory()' ''args'"
  $ no_logical:
  $ 	write sys$error -
  "[Attaching to process ''NAME']"
--- 115,126 ----
  $	message_status	= f$environment("message")
  $	set noon
  $	on control_y then goto quit
+ $	if a .eqs. "-NW" then args = args - f$edit(p'i',"lowercase")
  $	set message /nofacility/noidentification/noseverity/notext
  $	if f$edit(args,"COLLAPSE") .eqs. "" then goto no_logical
  $	! We have to include the current directory as first item in the value
  $	definee/nolog/job emacs_command_args -
! 	       "''f$trnlnm(""SYS$DISK"")'''f$directory()' ''args'"
  $ no_logical:
  $ 	write sys$error -
  "[Attaching to process ''NAME']"

Thanks to Rick Dyson (it *was* you, wasn't it?), who notified me on this
one.

-- 
R Levitte, Levitte Programming; Spannvägen 38, I; S-161 43  Bromma; SWEDEN
                  Tel: +46-8-26 52 47;  No fax right now
  PGP key fingerprint = A6 96 C0 34 3A 96 AA 6C  B0 D5 9A DF D2 E9 9C 65
   Check http://www.lp.se/~levitte for my public key.   bastard@bofh.se
