[comp.emacs] x11 and unwanted command line options

jad@HPCNDNM.CND.HP.COM (John Dilley) (10/20/90)

	In return for help on a previous subject, I thought I'd post
some modest e-lisp code I put together.  I use the HP Visual User
Environment (VUE -- provides workspaces, among other features -- this is
not a commercial message, it's vital information ...).  When starting up
x11emacs, I can give it -geometry and -xrm (X Resource Manager) options
to say where to go, how big, *and in which workspace(s) to reside*.
Now, the -geometry option is handled fine.  But the -xrm option tends to
show up as a buffer associated with no file (in a brand new x11emacs
session I had two buffers "-xrm" and "*workspaceList: Home Debug").
This was annoying, so I finally figured out how to make them go away.

	The following emacs lisp code, in your .emacs file, will look at
the command line options and blow away then ones you don't want.  If
you have options with no arguments (mine both have two), use only one
cdr instead (cdr (cdr ...)).  Enjoy...

;;;;
;;  Parse through the argument list getting rid of undesirable arguments
;;  which would show up as buffers corresponding to non-existent files.
;;;;
(if (and (boundp 'args) args)
    (let ( rem-args arg )
      (while (setq arg (car args))
	(cond
	 ((string= arg "-xrm")
	  (setq args (cdr (cdr args))))
	 ((string= arg "-geometry")
	  (setq args (cdr (cdr args))))
	 (t
	  (setq rem-args (cons arg rem-args))
	  (setq args (cdr args)))))
      (setq args rem-args)))


Please forgive me if I have incorrectly cross-posted.  I'm a former gnus
convert (from notes) and this is my first cross post.  Regards,

                          --      jad      --
			      John Dilley
			    Hewlett-Packard
                       Colorado Networks Division
UX-mail:      		     jad@cnd.hp.com
Phone:                       (303) 229-2787