Emacs學習筆記 hour3 Getting Started with Emacs

來源:互聯網
上載者:User
文章目錄
  • MajorModes
  • MinorModes

The Emacs way of doing this is to offer major and minor editing modes for differentfiles and programs.

MajorModes

Exactlyone majormode is enabled at a time for a given buffer. That is, the major mode is localfor each buffer, and every buffer is always in a given major mode. The majormode might contain different configurations. Most of them include the following:

  • Specialized keybindings-- Many major modes redefine the meanings of the Tab and Return keys, but other keys can also be redefined. To get a list of keybindings for the major mode, press C-h m (describe-mode) when it is enabled.

  • Specialized functions-- These are often available with C-c as a prefix (that is, type C-c and another key to get to the function). To see which bindings exists for the C-c prefix, press C-c C-h.

  • Adding functions to menus-- Some major modes create a menu entry for the major mode functions.

  • Configuration of variables-- Many different variables can be configured by the major mode. Examples of these include

  • Comment characters--These are used by functions that comment out a region, for example.

    Outline regular expression--This is used by the outline library, which makes it possible to get an outline of the buffer.

    Fontification descriptions--This is a set of variables that describe how a buffer can be colorized to make it a bit more readable.

MinorModes

Emacs has taken the customization grouping one step farther and developed a concept called minormodes. A minor mode is a set of customization options or functions that makes Emacs behave in a certain way. Any number of minor modes can be enabled at a time (this includes zero). Some minor modes are local to buffers, while others affect all of Emacs. The following list contains a few examples of some of the minor modes inEmacs:

  • font-lock-mode (local for a buffer)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.