Path: utzoo!attcan!uunet!husc6!bbn!uwmcsd1!ig!agate!ucbvax!mitre-bedford.ARPA!sdl From: sdl@mitre-bedford.ARPA (Litvintchouk) Newsgroups: comp.emacs Subject: GNU Emacs: site specific vs. personal hooks Message-ID: <8805132121.AA00704@mitre-bedford.ARPA> Date: 13 May 88 21:21:03 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 50 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.