[comp.sys.next] How do you find all of an Apps possible defaults.

velasco@beowulf.ucsd.edu (Gabriel Velasco) (11/13/90)

In particular, how do I find all of the possible defaults for something
like Workspace or Edit.  I found as least some of them for Terminal and
Shell in the on-line documentation at one time, but I can't remember
where it was.  The names of the files when you use the Digital
Librarian aren't very useful.

Right now I'm actually wondering if there is a default for making the
Workspace open up an icon window instead of the browser so that I can
set this using dwrite.  In general, I'd like to know how to find out
what all of my options are.

-- 
                              ________________________________________________
 <>___,     /             /  | ... and he called out and said, "Gabriel, give |
 /___/ __  / _  __  ' _  /   | this man an understanding of the vision."      |
/\__/\(_/\/__)\/ (_/_(/_/|_  |_______________________________________Dan_8:16_|

declan@remus.rutgers.edu (Declan McCullagh/LZ) (11/13/90)

In article <velasco.658466079@beowulf>, velasco@beowulf.ucsd.edu (Gabriel Velasco) writes:
> In particular, how do I find all of the possible defaults for something
> like Workspace or Edit.  I found as least some of them for Terminal and
> Shell in the on-line documentation at one time, but I can't remember
> where it was.  The names of the files when you use the Digital
> Librarian aren't very useful.
 
"dread -l" will do the trick (next time, you might want to read the
man pages first before posting a question to the net at large).  If
you dislike command line utilities, Marc Davidson, the NeXT Campus
Consultant for the University of Arizona, has written a very good
application which lets you change values in your defaults database
(like dwrite).  You can pick it up at your friendly archive server.

--------------------------------------------------------------------
Declan McCullagh / NeXT Campus Consultant \ declan@remus.rutgers.edu
--------------------------------------------------------------------

eps@toaster.SFSU.EDU (Eric P. Scott) (11/13/90)

In article <Nov.13.00.51.39.1990.17427@remus.rutgers.edu>
	declan@remus.rutgers.edu (Declan McCullagh/LZ) writes:
>In article <velasco.658466079@beowulf>, velasco@beowulf.ucsd.edu
	(Gabriel Velasco) writes:
>> In particular, how do I find all of the possible defaults for something
>> like Workspace or Edit.  I found as least some of them for Terminal and
>> Shell in the on-line documentation at one time, but I can't remember
>> where it was.  The names of the files when you use the Digital
>> Librarian aren't very useful.
> 
>"dread -l" will do the trick (next time, you might want to read the
>man pages first before posting a question to the net at large).

I'm sure he's tried that and it didn't answer his question; the
Defaults Database usually only contains "non-default defaults."
He wants ALL possible defaults.  Rudimentary reverse engineering
on 1.0a comes up with:

Workspace
  Documented in SysRefMan/10_Support.wn:
    ApplicationPaths
    BrowserColWidth
    BrowserH
    BrowserW
    BrowserX
    BrowserY
    CoreLimit
    IconsSnapTo
    LaunchThese
  
  Documented in SysAdmin/ApA_BootSequence.wn:
    LoginProgram
  
  Documented in NextAnswers:
    Expert
  
  Undocumented:
    Debug
    DoTimings
    Pause
    Preferences
  
  System (rather than Workspace) defaults:
    Umask
    UnixExpert
  
Edit
  Documented in SysRefMan/18_Tools.wn:
    DeleteBackup
    HeightInChars
    IndentWidth
    NXFont
    NXFontSize
    RTF
    Tags
    WidthInChars

  Not documented, but settable in Preferences:
    AutoIndent
    TabWidth
  
  Undocumented (controls defaults for Page Layout Panel):
    Orientation
    PagesPerSheet

					-=EPS=-

velasco@beowulf.ucsd.edu (Gabriel Velasco) (11/13/90)

declan@remus.rutgers.edu (Declan McCullagh/LZ) writes:

>In article <velasco.658466079@beowulf>, velasco@beowulf.ucsd.edu (Gabriel Velasco) writes:
>> In particular, how do I find all of the possible defaults for something
>> like Workspace or Edit.  I found as least some of them for Terminal and
>> Shell in the on-line documentation at one time, but I can't remember
>> where it was.  The names of the files when you use the Digital
>> Librarian aren't very useful.
> 
>"dread -l" will do the trick (next time, you might want to read the
>man pages first before posting a question to the net at large).  If
>you dislike command line utilities, Marc Davidson, the NeXT Campus
>Consultant for the University of Arizona, has written a very good
>application which lets you change values in your defaults database
>(like dwrite).  You can pick it up at your friendly archive server.

I'm familiar with dread (-l) and dwrite.  I'm also familiar with the
Defaults App that you mention.  The problem is if there exists a
possible default which is not set in the defaults database then how do
you know that it is even possible.  For instance, you can bring up the
Shell and Terminal Apps with "-Console YES" or something like that to
send console output to the window.  You can also do a "dwrite Shell
Console YES" to make that the default, but if it wasn't set in the
first place then a "dread Shell" won't show it to you.

Dread -l shows you the defaults that are set already.  I need to know
how to find the defaults that are not set, but that I may want to set.


-- 
                              ________________________________________________
 <>___,     /             /  | ... and he called out and said, "Gabriel, give |
 /___/ __  / _  __  ' _  /   | this man an understanding of the vision."      |
/\__/\(_/\/__)\/ (_/_(/_/|_  |_______________________________________Dan_8:16_|

alexn@xgate.x.austin.ibm.com (11/13/90)

In article <Nov.13.00.51.39.1990.17427@remus.rutgers.edu> declan@remus.rutgers.edu (Declan McCullagh/LZ) writes:
>In article <velasco.658466079@beowulf>, velasco@beowulf.ucsd.edu (Gabriel Velasco) writes:
>> In particular, how do I find all of the possible defaults for something
>> like Workspace or Edit.  I found as least some of them for Terminal and
>> Shell in the on-line documentation at one time, but I can't remember
>> where it was.  The names of the files when you use the Digital
>> Librarian aren't very useful.
> 
As far as I know, you can use dread -l to find the CURRENT defaults of
all the clients.  You can use dread -o to find the current defaults for
a given clients, i.e, dread -o Terminal will produce all the current
defaults for Terminal.  However, I don't know of a way of finding all
the possible defaults which a client will support.  Until the parameter for
a given client is added to the database, there is no way (as far as I know)
to know the parameter.  For example, by default the Window Server is
non-public but when you do a dread -o System, there is not even an entry
for the PublicWindowServer parameter unless someone has already set it; in
other words, if there is not an entry for a parameter for a given client,
the client usually assumes a default behavior.


Hope this helps....



Alex

glenn@heaven.woodside.ca.us (Glenn Reid) (11/14/90)

In article <Nov.13.00.51.39.1990.17427@remus.rutgers.edu> declan@remus.rutgers.edu (Declan McCullagh/LZ) writes:
>In article <velasco.658466079@beowulf>, velasco@beowulf.ucsd.edu (Gabriel Velasco) writes:
>> In particular, how do I find all of the possible defaults for something
>> like Workspace or Edit.  I found as least some of them for Terminal and
>> Shell in the on-line documentation at one time, but I can't remember
>> where it was.  The names of the files when you use the Digital
>> Librarian aren't very useful.
> 
>"dread -l" will do the trick (next time, you might want to read the
>man pages first before posting a question to the net at large).

No, "dread -l" will not do the trick (and I will resist the temptation
to point out that next time, you might want to read the question before
posting to the net at large :-)  The question was to find ALL of
the possible defaults.  "dread -l" will only show you the defaults that
have been set already, not the ones that potentially might be set if
you only knew about them.

For example, Mail has an option to use Emacs-style key bindings, but you
won't find that out by using "dread -l", because it isn't in there.  You
have to find out about it by reading the net.  [Incidentally, you can
turn it on with "dwrite Mail KeyBindings YES"].

Unfortunately, it is the responsibility of the application itself to
make its defaults known, and there is no general way to find out.  The
correct way to do this is to have a Preferences panel and to make all
of the preferences configurable from inside the App, but there are always
a few hidden goodies that the programmer didn't want to make into a
feature (I guess).

-- 
 Glenn Reid				RightBrain Software
 glenn@heaven.woodside.ca.us		PostScript/NeXT developers
 ..{adobe,next}!heaven!glenn		415-851-1785

mdixon@parc.xerox.com (Mike Dixon) (11/14/90)

    > In particular, how do I find all of the possible defaults for something
    > like Workspace or Edit.

    "dread -l" will do the trick (next time, you might want to read the
    man pages first before posting a question to the net at large).

actually, dread *won't* do the trick -- it only tells you what defaults
are already set.  if you want to find them all, try this:

    start the program you're interested in under gdb
    (e.g. 'gdb /NextApps/Librarian.app/Librarian')

    give gdb the following string of commands:

	break  *0x605d89e
	commands 1
	silent
	printf "%s: ", *$a2
	output {char *}(4+$a2)
	echo \n
	cont
	end
	run

    this should give you something like the following:
    (the values given are the application defaults, i.e. what you'll
     get if there's nothing in your defaults database)

	Sort: (char *) 0x1a02c "Weight"
	SummaryFont: (char *) 0x1a134 "Helvetica"
	SummarySize: (char *) 0x1a234 "12"
	ContentFont: (char *) 0x1a1b4 "Helvetica"
	ContentSize: (char *) 0x1a2b4 "12"
	AutoOpen: (char *) 0x1a334 "YES"
	DoLaunchTiming: (char *) 0x0
	HomeDirectory: (char *) 0x0
	LaunchTime: (char *) 0x6006259 "0 0"
	MachLaunch: (char *) 0x0
	SavePanelTiming: (char *) 0x0
	Uid: (char *) 0x0
	UserName: (char *) 0x0
	BoldSystemFont: (char *) 0x60062d5 "Helvetica-Bold"
	BrowserSpeed: (char *) 0x60062f1 "50"
	Printer: (char *) 0x60062fc "Local_Printer"
	PrinterHost: (char *) 0x6006316 ""
	PrinterResolution: (char *) 0x6006329 "400"
	ScrollerButtonDelay: (char *) 0x6006341 "0.5"
	ScrollerButtonPeriod: (char *) 0x600635a "0.025"
	ScrollerKnobDelay: (char *) 0x6006372 "0.001"
	ScrollerKnobCount: (char *) 0x600638a "2"
	SystemFont: (char *) 0x6006397 "Helvetica"
	UnixExpert: (char *) 0x60063ac "NO"
	NXAutoLaunch: (char *) 0x60063ac "NO"
	NXCaseSensitiveBrowser: (char *) 0x0
	NXHost: (char *) 0x0
	NXMargins: (char *) 0x6006445 "72 72 90 90"
	NXMenuX: (char *) 0x6006459 "-1.0"
	NXMenuY: (char *) 0x6006466 "1000000.0"
	NXOpen: (char *) 0x0
	NXOpenTemp: (char *) 0x0
	NXPSName: (char *) 0x0
	NXPaperType: (char *) 0x6006497 "Letter"
	NXShowAllWindows: (char *) 0x0
	NXShowPS: (char *) 0x0
	NXFont: (char *) 0x6006397 "Helvetica"
	NXFontSize: (char *) 0x60064ca "12"
	NXFixedPitchFont: (char *) 0x60064de "Ohlfs"
	NXFixedPitchFontSize: (char *) 0x60064f9 "10"
	NXMallocDebug: (char *) 0x600650a "32"

(note that most of the preferences are loaded by appkit, and have
nothing to do with librarian specifically.)

this also starts the program running; you'll probably want to quit it,
and then quit gdb (by typing 'quit').

by the way, the magic number in the first line is an address in the shared
library (NXRegisterDefaults+70), and almost certainly will have to be
changed to work under 2.0.

have fun...
                                             .mike.
--

                                             .mike.

rbeach@slate.mines.colorado.edu (Captain Entropy 312 Green Center 0 9867977) (11/18/90)

In article <Nov.13.00.51.39.1990.17427@remus.rutgers.edu> declan@remus.rutgers.edu (Declan McCullagh/LZ) writes:
>In article <velasco.658466079@beowulf>, velasco@beowulf.ucsd.edu (Gabriel Velasco) writes:
>> In particular, how do I find all of the possible defaults for something

[...stuff deleted...]

> 
>"dread -l" will do the trick (next time, you might want to read the
>man pages first before posting a question to the net at large).  If

[.. stuff deleted...]

Yes dread will tell you what all the defaults that have been set are, but
only those that have been set.  If the question is the same one I asked
a year or so ago (and never got an answer to) it is how to find all the
defaults that can be changed, regardless of whether they have been given a
value or not yet.  I know under 0.8 and 0.9 only things that had been
changed were set in the defaults database.  I gave up looking so it may
have changed under 1.0 (or 2.0) and I am speaking unawares (pardon me if
this is the case).  If it has not changed though, and you want to change the
font size in your shell (yes this is a bad example because I know it is in
the online documentation and I think it gets a deafult value set in the
database instead of in the program) you can't simply do a dread and find
out what you want to dwrite.

	If I am wrong, I would like to know.  If I am right, I would
like to know if there is anyway to get an App to tell you what it 
considers configurable defaults.


---------------------------------------------------------------------------
Richard Beach   @   Colorado School of Mines        Golden, Colorado   USA
I-Net and BitNet : rbeach@mines                     |     CS/CH
             or  : rbeach@slate.mines.colorado.edu  |
UUCP             : ...isis!csm9a!rbeach             |  

geoff@ITcorp.com (Geoff Kuenning) (11/19/90)

In article <MDIXON.90Nov13135818@thelonius.parc.xerox.com>
mdixon@parc.xerox.com (Mike Dixon) writes:

> (a tricky list of gdb commands which uses a breakpoint in
> NXRegisterDefaults to figure out the legal defaults for an
> application).

Very nice, but I tried it on Icon (I'm trying to figure out how to get
the 5th menu, the Shapes menu, to stop coming up on launch) and
got an interesting list that is *completely* disjoint from what
"dread -l" lists as my current set of defaults!  What's going on here?

(And BTW, can anyone tell me how to suppress that damn Shapes menu?)
I already have "Icon Menu4Visible 0" in my defaults and it doesn't
help.)
-- 
	Geoff Kuenning   geoff@ITcorp.com   uunet!desint!geoff