sdl@mitre-bedford.ARPA (Litvintchouk) (05/14/88)
We would like to have a *site wide* mode hook for each of the common GNU Emacs modes, as well as allowing the user to write his own personal mode hooks. Specifically, at our company, we have a menu system which activates a mode-specific Suntools popup menu for each GNU Emacs mode. (We may soon ditch it in favor of X windows/menus, but the principle is the same.) The problem is, how to invoke such mode-specific functions for all users at our site? Consider mail-mode for example: -- If we set the standard mode hooks (e.g. mail-mode-hook) to do site-wide things for everyone at our company (in default.el, say), then this will deprive users of the ability to write their own mail-mode-hook to do their own personal customizations. -- If we insist that each user write their own mail-mode-hook to invoke the site-wide stuff, then enforcement of conventions is impossible, as the site-wide stuff may change. -- If we physically modify the mail-mode function to add a second hook; for example, in the "defun mail-mode," add: (run-hooks 'corporate-mail-mode-hook 'mail-mode-hook) then every time that a new release of GNU Emacs becomes available, we will need to modify the newly released version of the mail-mode function to put back this site-wide hook. I don't see any good solution to this problem. It's beginning to look to me that each GNU Emacs mode needs to have at least *two* hooks for each mode: one to run site-wide customizations, followed by one to run user's personal customizations. This is especially true if one of the site-wide customizations is to invoke menus from a standard window system, such as Suntools or X, for which you really do want to enforce some company-wide conventions. Comments? Steven Litvintchouk MITRE Corporation Burlington Road Bedford, MA 01730 (617)271-7753 ARPA: sdl@mitre-bedford.arpa UUCP: ...{cbosgd,decvax,genrad,ll-xn,mit-eddie,philabs,utzoo}!linus!sdl "Those who will be able to conquer software will be able to conquer the world." -- Tadahiro Sekimoto, president, NEC Corp.
wolfgang@mgm.mit.edu (Wolfgang Rupprecht) (05/14/88)
>We would like to have a *site wide* mode hook for each of the common >GNU Emacs modes, as well as allowing the user to write his own >personal mode hooks. [...] It's beginning to look to me that each >GNU Emacs mode needs to have at least *two* hooks for each mode: one >to run site-wide customizations, followed by one to run user's >personal customizations. The -mode-hook variables can *either* conatain a SINGLE function to call, or a LIST of functions to call (in sequence). One can always append yet another function to the mode-hook. --- Wolfgang Rupprecht ARPA: wolfgang@mgm.mit.edu (IP 18.82.0.114) TEL: (617) 267-4365 UUCP: mit-eddie!mgm.mit.edu!wolfgang
rlk@think.com (Robert Krawitz) (05/15/88)
In article <8805132121.AA00704@mitre-bedford.ARPA>, sdl@mitre-bedford (Litvintchouk) writes:
] -- If we set the standard mode hooks (e.g. mail-mode-hook) to do
] site-wide things for everyone at our company (in default.el,
] say), then this will deprive users of the ability to write
] their own mail-mode-hook to do their own personal customizations.
No, either they can set inhibit-default-init in their .emacs file or
you can write the mail-mode-hook to first run your customizations,
then theirs. For example,
(setq mail-mode-hook (list 'progn system-mail-mode-hook mail-mode-hook))
] -- If we insist that each user write their own mail-mode-hook to
] invoke the site-wide stuff, then enforcement of conventions
] is impossible, as the site-wide stuff may change.
Also put quite a burden on the user...
]I don't see any good solution to this problem. It's beginning to look
]to me that each GNU Emacs mode needs to have at least *two* hooks for
]each mode: one to run site-wide customizations, followed by one to
]run user's personal customizations. This is especially true if one of
]the site-wide customizations is to invoke menus from a standard window
]system, such as Suntools or X, for which you really do want to enforce
]some company-wide conventions.
Well, the only time you need two hooks is if you want to "mix" two
modes. For example, mail-mode runs text-mode-hook and mail-mode-hook
since mail mode is a small enhancement of text mode. In any case,
menus seem to be a particularly bad example, since those are normally
personal preference type items.
--
harvard >>>>>> | Robert Krawitz <rlk@think.com>
bloom-beacon > |think!rlk
ihnp4 >>>>>>>> . rlk@a.HASA.disorg