MMM : resources

Beyond settings that can be configured in the preference control panels, some advanced options can be modified or set only by directly editing the preference file. These resources are located necessarily in the first part of the preference file, that is before the line

!!! Don't edit below this line !!!
A resource definition has the form:
*name: value
or, if it spans over multiple lines:
*name: this is \
       a long resource definition
Lines beginning with an exclamation mark (!) are comments.

External viewers

Since MMM knows how to display only HTML and plain text (as well as in-lined images), it delegates the display of all other document types to external viewers. The choice of a viewer for a given document type is the responsability of the metamail program, whose configuration is defined in the $HOME/.mailcap file. Report to man mailcap for more details.

However, it is possible to tell to MMM

When receiving a document whose type does not belong to one of the above categories, MMM asks more directions from the user between attempting to handle the document.

Example

!! Types for which we should save to disk
*savedTypes: \
    application/zip, \
    application/x-tar
!! Types for which metamail knows a viewer
!! The star (*) can be used only in MIME subtype
*externalViewers: \
    audio/x-midi, audio/midi, \
    image/*, \
    video/*, \
    application/postscript, \
    application/pdf, \
    application/x-dvi, \
    application/x-world, application/x-vrml, \
    application/x-ical, \
    application/mac-binhex

Menu shortcuts

Menu shortcuts are key combinations or sequences to activate a menu entry directly from the keyboard. MMM offers shortcuts for most menu entries, but if they are not convenient, they can be redefined through resources.

Each action has a Name. For this action, the shortcut is specified by the resource par la ressource shortcutName, whose value is the description of a Tk event (see Tk documentation : man n bind).

The names of the actions are:
Menu title Action name
About About
New Window NewWindow
Open Selection OpenSelection
Open File... OpenFile
Save Save
Print Print
Close Window Close
Quit Quit
Home Home
Back Back
Forward Forward
Reload Reload
Abort Abort
Update Update
Redisplay Redisplay
Add to Hotlist AddToHotlist
Load images LoadImages
View source ViewSource

Example

!! Definition of a shortcut for Home (key F2)
*shortcutHome : <F2>

Warning

There are many key combinations used in some part of the MMM interface. It is thus not guaranteed that a new definition of a shortcut will work as expected.

Navigation bindings

Navigation actions available with the mouse can also be redefined. For a given action name, the resource is bind<nom>, and its value is the description of a Tk event (see Tk doumentation : man n bind). The names of navigation actions are:
Action name Action purpose
goto displays the document pointed to by this link in the same window,
except when specified otherwise by the document author (frames)
save save the document pointed to by this link
(after asking a file name in a dialog box)
gotonew displays the document pointed to by this link in a new window
hypermenu pops up a link activation menu, containing the above functionalities and possible more
Other context-dependent action are available:
Action name Context Action purpose
tachy_about in the tachymeter displays the about
tachy_gc in the tachymeter opens the memory gauge window
tachy_new in the tachymeter opens a new window
tachy_sel in the tachymeter opens a new window on the document pointed to by
the contents of the current X selection
stopanim on animated images stops the animation
restartanim on animated images starts the animation
copyimgurl on images copies the address of the image in the X selection
loadimage on a non-loaded image loads this image
alt_imap on a non-loaded active image displays the menu of links defined by this active image

Example

!! Open a new window : use button 2 instead of default button 3
*bind<gotonew>: <2>

Warning

Many mouse bindings are used elsewhere in the MMM interface. It is therefore not guaranteed that a new definition will work as expected.

Fonts

Font setting is accessible by a preference control panel. However, the list of possible choices of settings is governed by resources.
font families
The resource is fontFamilies, and its value is a comma (,) separated list of families
font sizes
The resource is fontPixels, and its value is a comma (,) separated list of sizes
A simple method for computing these lists is to use xlsfonts:
$ xlsfonts | awk -F- 'NF==15 {print $3}' | sort -u
# displays the list of families available on your system
$ xlsfonts | awk -F- 'NF==15 {print $8}' | sort -u
# displays the list of sizes available on your system
Of course, if your X server knows how to compute fonts on the fly when they are requested, you are not constrainted by these values that reflect only the pre-computed fonts.

Example

!! Family choice
*fontFamilies: *, \
	courier, \
	helvetica, \
	lucida, lucidatypewriter,\
	new century schoolbook,\
	times, \
	fixed
!! Size choice
*fontPixels: 8,10,11,12,13,14,15,16,17,18,19,20,24,26,30,34,40

Source Editing

The View source menu gives access to the HTML source of a document in an editor window. You can see this source annotated in colors, with a different color for each HTML element.

For each element e, the resource name is Source<e> and its value is a color

Example

! bleu pour les ancres
*Source<a>: #4e5cd7
! vert pour les entetes
*Source<h1>: PaleGreen4
*Source<h2>: PaleGreen3
*Source<h3>: PaleGreen2
*Source<h4>: PaleGreen1
! autres
*Source<p>: SandyBrown
*Source<img>: yellow
! orange pour les tables
*Source<table>: #f05e28
*Source<tr>: #f05e28
*Source<td>: #f05e28
*Source<th>: #f05e28
! rose pour les formes
*Source<form>: #f05cd7
*Source<input>: #f05cd7
*Source<select>: #f05cd7
*Source<option>: #f05cd7
*Source<textarea>: #f05cd7

Tk settings

You can also naturally specifiy resources that will be interpreted by Tk itself (check the Tk manuals).

Example for a small screen (laptop)

*font: -*-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*
*padX:1
*padY:0
*buttons.BorderWidth: 2