pages tagged emacs http://meng6net.localhost/tag/emacs/ <p><small>Copyright © 2005-2020 by <code>Meng Lu &lt;lumeng3@gmail.com&gt;</code></small></p> Meng Lu's home page ikiwiki Tue, 16 May 2017 23:59:39 +0000 installing and configuring emacs http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_emacs/ http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_emacs/ computing configuration documentation emacs installation note software Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <h2>Emacs modes</h2> <table class="datatable"> <thead> <tr> <th>name</th> <th>instruction</th> <th>description</th> <th>type</th> <th>comment</th> </tr> </thead> <tbody> <tr> <td><code>follow-mode</code></td> <td>split a frame to two vertical windows that show the same buffer by <kbd>C</kbd>-<kbd>x</kbd> <kbd>3</kbd>, then <kbd>M</kbd>-<kbd>x</kbd> <code>follow-mode</code></td> <td>edit parts of a long file that are vertically far apart</td> <td colspan="2">editing</td> </tr> <tr> <td><code>shell</code></td> <td><kbd>M</kbd>-<kbd>x</kbd> <code>shell</code></td> <td>run a shell through an Emacs buffer</td> <td colspan="2">software</td> </tr> <tr> <td><code>whitespace-mode</code></td> <td><kbd>M</kbd>-<kbd>x</kbd> <code>whitespace-mode</code></td> <td>display various kinds of whitespace characters</td> <td colspan="2">viewing</td> </tr> <tr> <td><code>markdown-mode</code></td> <td><kbd>M</kbd>-<kbd>x</kbd> <code>markdown-mode</code></td> <td>for viewing and editting files using markdown markup language</td> <td colspan="2">viewing, editting</td> </tr> <tr> <td><code>yasnippet</code></td> <td>enter different mode, e.g. <code>xml-mode</code>, <code>lisp-mode</code>, etc., start typing the beginning of code snippets, and press <kbd>Tab</kbd> to autocomplete the rest</td> <td>for quickly entering code snippets in different modes</td> <td colspan="2">editting</td> </tr> </tbody> </table> <p><a href="http://meng6net.localhost/data/emacs_modes.dsv">Direct data download</a></p> <h2>Emacs packages</h2> <table class="datatable"> <thead> <tr> <th colspan="2"><code>company</code></th> <th>Modular text completion framework.</th> <th colspan="2">viewing, editting</th> </tr> </thead> <tbody> <tr> <td colspan="2"><code>flycheck</code></td> <td>On-the-fly syntax checking.</td> <td colspan="2">editting</td> </tr> <tr> <td colspan="2"><code>helm</code></td> <td>Helm is an Emacs incremental and narrowing framework.</td> <td colspan="2">?</td> </tr> <tr> <td colspan="2"><code>use-package</code></td> <td>A use-package declaration for simplifying your .emacs.</td> <td colspan="2">configuration</td> </tr> <tr> <td colspan="2"><code>which-key</code></td> <td>Display available keybindings in popup.</td> <td colspan="2">UI</td> </tr> <tr> <td colspan="2"><code>yasnippet</code></td> <td>Yet another snippet extension for Emacs.</td> <td colspan="2">Editting</td> </tr> </tbody> </table> <p><a href="http://meng6net.localhost/data/emacs_packages.dsv">Direct data download</a></p> <h2>References</h2> <h2>Related pages</h2> <h2>External links</h2> key bindings of emacs http://meng6net.localhost/computing/key_bindings/key_bindings_of_emacs/ http://meng6net.localhost/computing/key_bindings/key_bindings_of_emacs/ Emacs computing keyboard shortcut Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <h2>Types of key bindings</h2> <ul> <li>navigate in a buffer</li> <li>edit a buffer</li> <li>query a buffer</li> <li>manage buffers, frames, and windows</li> <li>manage commands</li> </ul> <h2>Key bindings I frequently use</h2> <table class="datatable"> <thead> <tr> <th>key binding</th> <th>command</th> <th>description</th> <th>type</th> <th colspan="2">comment</th> </tr> </thead> <tbody> <tr> <td><kbd>C</kbd>-<kbd>a</kbd></td> <td></td> <td>move to the beginning of line</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>e</kbd></td> <td></td> <td>move to the end of line</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>&gt;</kbd></td> <td></td> <td>move to the bottom of the buffer</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>&lt;</kbd></td> <td></td> <td>move to the top of the buffer</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td></td> <td><code>goto-line</code></td> <td>move to a certain line</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>f</kbd></td> <td></td> <td>move forward to next word</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>b</kbd></td> <td></td> <td>move backward to previous word</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>v</kbd></td> <td></td> <td>move to the next screen of the buffer</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>v</kbd></td> <td></td> <td>move to the previous screen of the buffer</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>o</kbd></td> <td></td> <td>move curser to different windows</td> <td></td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>b</kbd></td> <td></td> <td>switching between open buffers in current frame</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>b</kbd></td> <td></td> <td>list open buffers</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>r</kbd> <kbd>l</kbd></td> <td></td> <td>list bookmarks</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>r</kbd> <kbd>m</kbd></td> <td></td> <td>add a bookmark for the current buffer</td> <td>navigate</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>8</kbd> <kbd>Enter</kbd></td> <td></td> <td>insert a Unicode character by its Unicode name, e.g. "em dash" or hexidecimal number, e.g. "0x2E3B"</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>r</kbd> <kbd>t</kbd> <code>xxx</code></td> <td><code>string-rectangle</code></td> <td>enter <code>xxx</code> on multiple lines in a rectangle area</td> <td>edit</td> <td>the rectangle area can be defined/selected by <kbd>M</kbd>-<kbd>@</kbd></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>;</kbd></td> <td><code>comment-dwin</code></td> <td>comment multiple lines</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>_</kbd> or <kbd>C</kbd>-<kbd>x</kbd> <kbd>u</kbd></td> <td></td> <td>undo</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>y</kbd></td> <td></td> <td>yank, reinsert the most recent killed text</td> <td>edit</td> <td colspan="2"><a href= "http://www.gnu.org/software/libtool/manual/emacs/Kill-Ring.html#Kill-Ring"> the kill ring</a></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>u</kbd> <kbd>3</kbd> <kbd>C</kbd>-<kbd>y</kbd></td> <td></td> <td>yank, reinsert the third most recent killed text</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>k</kbd></td> <td></td> <td>delete characters after cursur of the current line</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>d</kbd></td> <td></td> <td>delete the next characters after cursur</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>i</kbd></td> <td></td> <td>insert content of another file</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>@</kbd></td> <td><code>set-mark-command</code></td> <td>set the mark where the point is</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>%</kbd></td> <td><code>query-replace</code></td> <td>Query replace</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>M</kbd>-<kbd>%</kbd></td> <td><code>query-replace-regexp</code></td> <td>Query replace regexp</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>u</kbd> <kbd>C</kbd>-<kbd>x</kbd> <kbd>Tab</kbd></td> <td><code>?</code></td> <td>indent a block of text rightward by a tab</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>i</kbd></td> <td><code>?</code></td> <td>indent a block of text rightward by a whitespace</td> <td>edit</td> <td colspan="2">To select a block of text, move cursor to the front, <kbd>C</kbd>-<kbd>Space</kbd> to activate the selection, then move the cursor to the end, <kbd>C</kbd>-<kbd>Space</kbd> to end the selection.</td> </tr> <tr> <td><kbd>C</kbd>-<kbd>u</kbd> <code>5</code> <kbd>C</kbd>-<kbd>x</kbd> <kbd>Tab</kbd></td> <td><code>?</code></td> <td>indent a block of text rightward by 5 spaces</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>u</kbd> <code>5</code> <kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>i</kbd></td> <td><code>?</code></td> <td>indent a block of text rightward by 5 spaces</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>l</kbd></td> <td></td> <td>convert the following word to lower case</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>Tab</kbd> (with cursor near an English word)</td> <td></td> <td>check dictionary for alternative spellings</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>q</kbd> (with a highlight region)</td> <td><code>fill-paragraph</code></td> <td>automatically line wraps a pragraph of text</td> <td>edit</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>M</kbd>-<kbd>@</kbd></td> <td><code>mark-sexp</code></td> <td>undo</td> <td>edit</td> <td>1) move cursor to the beginning of a block of text by mouse or up arrow key<br /> 2) <kbd>C</kbd>-<kbd>M</kbd>-<kbd>@</kbd> to mark the beginning of the block<br /> 3) move cursor to the end of the block<br /> 4) operate on the block, e.g. indent rightward by 1 whitespace with <kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>i</kbd>, or indent rightward by 4 whitespaces with <kbd>C</kbd>-<kbd>u</kbd> -4 <kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>i</kbd></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>s</kbd></td> <td><code>isearch-forward</code></td> <td>I-search</td> <td>query</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>r</kbd></td> <td><code>isearch-backward</code></td> <td>I-search backward</td> <td>query</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>M</kbd>-<kbd>s</kbd></td> <td><code>isearch-forward-regexp</code></td> <td>Regexp I-search</td> <td>query</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>M</kbd>-<kbd>r</kbd></td> <td><code>isearch-backward-regexp</code></td> <td>Regexp I-search backward</td> <td>query</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>b</kbd></td> <td><a href= "https://www.gnu.org/software/emacs/manual/html_node/emacs/List-Buffers.html"> <code>list-buffers</code></a></td> <td>list open buffers</td> <td>manage buffer</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>r</kbd></td> <td><code>recentf-open-files</code></td> <td>list recently opened files</td> <td>manage buffer</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>f</kbd></td> <td><code>find-file</code></td> <td>load file to current buffer</td> <td>manage buffer</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>w</kbd></td> <td></td> <td>write current buffer to a file</td> <td>manage buffer</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>v</kbd> <kbd>Ret</kbd></td> <td><code>find-another-file</code></td> <td>load another file to current buffer, by default reload the same file</td> <td>manage buffer</td> <td></td> <td colspan="2"></td> </tr> <tr> <td></td> <td><code>revert-buffer</code></td> <td>get rid of extensive changes made to current buffer and revert back to</td> <td>manage buffer</td> <td colspan="2"><a href= "http://www.gnu.org/software/libtool/manual/emacs/Reverting.html">"Reverting a buffer." <em>GNU Emacs Manual</em>.</a></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>b</kbd></td> <td><code>switch-to-buffer</code></td> <td>switch to buffer</td> <td>manage buffer</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>w</kbd></td> <td></td> <td>save buffer to another file</td> <td>manage buffer</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>+</kbd></td> <td></td> <td>increase font size</td> <td>manage buffer</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>+</kbd></td> <td></td> <td>decrease font size</td> <td>manage buffer</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>b</kbd> arrow key</td> <td></td> <td>select buffer to load into current frame</td> <td>manage buffer</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>0</kbd></td> <td></td> <td>close current window</td> <td>manage frame/window</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>0</kbd> <kbd>5</kbd></td> <td></td> <td>close current frame</td> <td>manage frame/window</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>3</kbd></td> <td></td> <td>split frame vertically</td> <td>manage frame/window</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>2</kbd></td> <td></td> <td>split frame horizontally</td> <td>manage frame/window</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>5</kbd> <kbd>2</kbd></td> <td></td> <td>open a new frame</td> <td>manage frame/window</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>o</kbd></td> <td><code>other-window</code></td> <td>move cursor to other window in the current frame</td> <td>manage frame/window</td> <td></td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>q</kbd></td> <td></td> <td>cancel current command</td> <td>manage commands</td> <td colspan="2"></td> </tr> <tr> <td><kbd>C</kbd>-<kbd>l</kbd> <kbd>C</kbd>-<kbd>\</kbd> <code>chinese-punct</code></td> <td></td> <td>type Chinese punctuation</td> <td>misc</td> <td colspan="2">Type <kbd>C</kbd>-<kbd>l</kbd> <kbd>C</kbd>-<kbd>\</kbd> to turn on/off the input method</td> </tr> <tr> <td><kbd>C</kbd>-<kbd>x</kbd> <kbd>C</kbd>-<kbd>h</kbd></td> <td></td> <td>get help text in another buffer</td> <td>misc</td> <td colspan="2"></td> </tr> <tr> <td><kbd>M</kbd>-<kbd>Tab</kbd></td> <td></td> <td>find possible word completion</td> <td>misc</td> <td colspan="2"></td> </tr> </tbody> </table> <p><a href="http://meng6net.localhost/data/key_binding_emacs.dsv">Direct data download</a></p> <h2>Modifier keys</h2> <ul> <li> <p><code>C-</code>: <kbd>Ctrl</kbd></p> </li> <li> <p><code>M-</code>: <kbd>Meta</kbd>, <kbd>M</kbd>, which is usually the <kbd>Alt</kbd> key on most keyboards, and possibly <kbd>Esc</kbd> on Mac computers</p> </li> <li> <p><code>s-</code>: <kbd>Super</kbd>, <kbd>s</kbd>, which can be typed in with <kbd>C</kbd>-<kbd>x</kbd> <kbd>@</kbd> <kbd>s</kbd></p> </li> <li> <p><code>H-</code>: <kbd>Hyper</kbd>, <kbd>H</kbd>, which can be typed in with <kbd>C</kbd>-<kbd>x</kbd> <kbd>@</kbd> <kbd>h</kbd></p> </li> <li> <p><code>A-</code>: <kbd>Alt</kbd>, <kbd>A</kbd>, which can be typed in with <kbd>C</kbd>-<kbd>x</kbd> <kbd>@</kbd> <kbd>a</kbd></p> </li> </ul> <h2>References</h2> <ul> <li><a href= "http://www.gnu.org/software/libtool/manual/emacs/"><em>GNU Emacs Manual</em>.</a> <ul> <li><a href= "http://www.gnu.org/software/libtool/manual/emacs/Key-Index.html#Key-Index"> "Key (Character) Index." <em>GNU Emacs Manual</em>.</a></li> <li><a href= "http://www.gnu.org/software/libtool/manual/emacs/Command-Index.html#Command-Index"> "Command and Function Index." <em>GNU Emacs Manual</em>.</a></li> <li><a href= "http://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html"> "Modifier Keys." <em>GNU Emacs Manual</em>. http://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html</a></li> </ul> </li> </ul> <iframe src= "http://rcm.amazon.com/e/cm?t=melusbl-20&amp;o=1&amp;p=48&amp;l=st1&amp;mode=books&amp;search=emacs&amp;fc1=000000&amp;lt1=_blank&amp;lc1=3366FF&amp;bg1=FFFFFF&amp;f=ifr" marginwidth="0" marginheight="0" width="728" height="90" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe> Removing newline characters http://meng6net.localhost/blog/removing_newline_characters/ http://meng6net.localhost/blog/removing_newline_characters/ blog editing emacs tip 国学 文字学 Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <p>Meng Lu, 2013-7-6</p> <p>Suppose you want to remove newlines in between the Chinese characters:</p> <pre><code>南海少年遊俠客, 詩成嘯傲凌滄州, 曾因酒醉鞭名馬, 生怕情深累美人。 </code></pre> <p>-- note that the 1st and 2nd Chinese comma <code>,</code> actually have two or more white spaces following them -- and change it to a single line</p> <pre><code>南海少年遊俠客,詩成嘯傲凌滄州,曾因酒醉鞭名馬,生怕情深累美人。 </code></pre> <p>One way to do this is using Emacs.</p> <h2>Use <code>query-replace-regexp</code></h2> <p>Press <kbd>M</kbd>-<kbd>x</kbd>, and type <code>query-replace-regexp</code>, or as a shortcut <kbd>C</kbd>-<kbd>M</kbd>-<code>%</code>;</p> <p>Type regexp to match:</p> <pre><code>\([[:nonascii:\]]\) * *\([[:nonascii:\]]\) </code></pre> <p>Note the line break in the regexp need to be typed into the <a href= "http://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer.html"> Emacs minibuffer</a> with <kbd>C</kbd>-<kbd>q</kbd> <kbd>C</kbd>-<kbd>j</kbd>.</p> <p>Type regexp to substitute:</p> <pre><code>\1\2 </code></pre> <p>This means the white space character(s) (if any) and newline character between non-ASCII characters will be removed in the substituted version, so the result is the character on the first line followed by that on the second line.</p> <h2>Use <code>fill-paragraph</code></h2> <ul> <li> <p>Set <code>fill-column</code> variable, which controls how wide a line of text can go before line-wrapping to a very large value for the current buffer: <kbd>C</kbd>-<code>x</code> <code>f</code>, <code>10000000</code></p> </li> <li> <p>Highlight the paragraph you'd like to modify: move cursor to the beginning, hold <kbd>Shift</kbd> down and move up and down arrow to extend and decrease the selection;</p> </li> <li> <p>Press <kbd>M</kbd>-<kbd>x</kbd>, and type <code>fill-paragraph</code>.</p> </li> </ul> <p>This should remove all newline characters in the text. Interestingly, if there are multiple white space characters at the end of lines before the new line character, it will keep one of them:</p> <pre><code>南海少年遊俠客, 詩成嘯傲凌滄州, 曾因酒醉鞭名馬,生怕情深累美人。 </code></pre> <p>Note there is an additional white space after the 1st and the 2nd <code>,</code>.</p> <p>The single white space character is actually still redundant, that can be corrected by</p> <pre><code>M-x query-replace-regexp , * , </code></pre> /blog/removing_newline_characters/#comments How to switch font and theme in Emacs http://meng6net.localhost/blog/switch_emacs_font_theme/ http://meng6net.localhost/blog/switch_emacs_font_theme/ computing emacs font key binding theme Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <p>In my <code>.emacs</code>, I set "Source Code Pro" as my default font and <code>solarized-dark</code> as my default theme. But occasionally, I'd like to switch the theme and font in the current Emacs frame. After some Internet research, I find the commands to do this:</p> <ul> <li>to swith theme to <code>solarized-light</code>, do</li> </ul> <p><kbd>M</kbd>-<kbd>x</kbd>, <code>load-theme</code>, <kbd>Enter</kbd>, <code>solarized-light</code></p> <p>In Emacs 24+, one can also interactively set font using mouse by</p> <p><kbd>M</kbd>-<kbd>x</kbd>, <code>mouse-set-font</code>, and selecting font faimily, typeface, size in the Fonts pop-up window.</p> <ul> <li>to swith font, do</li> </ul> <p><kbd>M</kbd>-<kbd>x</kbd>, <code>set-frame-font</code>, <kbd>Enter</kbd>, <kbd>Space</kbd> (trigger auto-completition to look for candidates, and use <kbd>Up</kbd>, <kbd>Down</kbd> to switch font), <kbd>Enter</kbd></p> <h2>References</h2> <ul> <li><a href= "https://www.gnu.org/software/emacs/manual/html_node/emacs/Modifying-Fontsets.html"> <em>GNU Emacs manual, 22.16 Modifying Fontsets</em></a></li> <li><a href= "https://www.gnu.org/software/emacs/manual/html_node/emacs/Defining-Fontsets.html#Defining-Fontsets"> <em>GNU Emacs manual, 22.15 Defining fontsets</em></a></li> <li><a href= "http://www.emacswiki.org/emacs/FontSets"><em>EmacsWiki, Font Sets</em></a></li> </ul> /blog/switch_emacs_font_theme/#comments Installing and configuring input methods on Ubuntu Linux http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_input_methods_on_Ubuntu_Linux/ http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_input_methods_on_Ubuntu_Linux/ chinese computing configuration documentation draft emacs input method installation japanese note software to-do Mon, 23 Mar 2015 03:24:46 +0000 2017-05-16T21:18:29Z <p>This is a note on installing and configuring input methods for Chinese, English, and Japanese text on Ubuntu Linux.</p> <p>Updated: 2015-3-22, Ubuntu Linux 14.04</p> <p>Install and configure Sougou Pinyin for Chinese, Mocz for Japanese.</p> <h2>Install packages</h2> <p>sudo apt-get install im-switch fcitx fcitx-mozc fcitx-anthy</p> <ul> <li><code>fcitx</code>: Flexible Input Method Framework</li> <li><code>fcitx-mozc</code>: Mozc engine for fcitx - Client of the Mozc input method</li> <li>Mozc: https://code.google.com/p/mozc/</li> </ul> <p>Install <a href="http://pinyin.sogou.com/linux/">Sougou Pinyin</a>.</p> <h2>Configure Emacs to use fcitx</h2> <p>In order to use fcitx input methods in Emacs, the following configuration needs to be placed in <code>$HOME/.bashrc</code>:</p> <pre><code>export LC_CTYPE="zh_CN.UTF-8" </code></pre> <h2>References</h2> <ul> <li> http://www.cnblogs.com/pylemon/archive/2012/01/05/2312682.html</li> <li>http://moritzmolch.com/1453</li> </ul>