Tim Johnson <[EMAIL PROTECTED]> writes: > > There are lots of ways, depending on what you mean by query. Does `C-h m' > > do what you want? > > Oops! Poorly phrased question. My apologies. What I would like to > do is perform this query programmatically. > > Is that possible? > > Now perhaps I should elaborate in case I am barking up the wrong > tree and there is a better way: > > Let's suppose I want to write a subroutine that first, queries > the major mode, and then calls the appropriate subroutine for > the mode. > > *pseudo-code* example: > > (defun previous-subroutine () > (cond > (eq major-mode "python")(previous-python-subroutine) > (eq major-mode "C")(previous-C-subroutine) > (eq major-mode "rebol")(previous-rebol-subroutine) > )) > > ;; and then keymap of course. >
You pseudo code pretty much has all the elements you need - there is a variable called major-mode which you can use to do something based on the mode you are in. However, I would suggest you check out using mode hooks instead. Nearly all modes have a 'hook' you can set to do things in a mode when it is loaded - this is the normal place to put mode specific customizations. Many modes have multiple hooks that are run at different times e.g. before loading the mode code, after loadinig it etc. Tim -- Tim Cross The e-mail address on this message is FALSE (obviously!). My real e-mail is to a company in Australia called rapttech and my login is tcross - if you really need to send mail, you should be able to work it out! _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs