Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!orion.oac.uci.edu!cedman From: cedman@golem.ps.uci.edu (Carl Edman) Newsgroups: comp.emacs Subject: Re: set automatic (default) vip-mode Message-ID: Date: 25 Jan 91 06:06:39 GMT References: <1991Jan25.022333.4987@cubmol.bio.columbia.edu> Organization: University of California, Irvine, USA. Lines: 36 Nntp-Posting-Host: lynx.ps.uci.edu In-reply-to: ping@cubmol.bio.columbia.edu's message of 25 Jan 91 02:23:33 GMT In article <1991Jan25.022333.4987@cubmol.bio.columbia.edu> ping@cubmol.bio.columbia.edu (Shiping Zhang) writes: I want to know how to turn on vip-mode automatically when I invoke emacs. I don't know what I should put in the .emacs file. Thanks for any information. -ping ping@cubmol.bio.columbia.edu Mode is not a global variable in emacs. Rather the mode depends on the buffer. What mode is selected for a specific buffer depends on the name of buffer and is determined with help of the variable auto-mode-alist. It is a list of dotted pairs of regular expressions and modes. Whenever a new file is loaded the name is checked against each of these regexps and the mode of the first matching regexp becomes the mode of the buffer. You can add automatic modes to your auto-mode-alist like this (an example from my "~/.emacs" file): (setq auto-mode-alist (cons '("\\.st$" . smalltalk-mode) auto-mode-alist)) If you only want to edit certain file types in vip mode simply add a corresponding line to your "~/.emacs" file. If on the other hand no regexp matches the buffer gets the contents of the variable default-major-mode as a mode. So if you wanted this type of behavior you would add a line like this to your "~/.emacs" file. (setq default-major-mode 'vip-mode) Carl Edman Theoretical Physicist,N.: A physicist whose | Send mail existence is postulated, to make the numbers | to balance but who is never actually observed | cedman@golem.ps.uci.edu in the laboratory. | edmanc@uciph0.ps.uci.edu * Did you know that you can have a typo in your signature, send 100s of * * mails and 100s of world-wide posts, and nobody will ever tell you ? *