Emacs Manual:Important Text-Changing Commands

As a special exception, repeated invocations of M-h extend the region to subsequent paragraphs. This is convenient for indenting, case-converting, or killing entire paragraphs.

Finally, C-x h (mark-whole-buffer) sets up the entire buffer as the region, by putting point at the beginning and the mark at the end. (In some programs this is called “select all.”)

Replace text within it using M-% (see Query Replace).

これでAporoposだかで検索できるわけか。

Most commands that operate on the text in the region have the word region in their names.

The command C-x C- (pop-global-mark) jumps to the buffer and position of the latest entry in the global ring. It also rotates the ring, so that successive uses of C-x C- take you to earlier buffers and mark positions.

M-\
Delete spaces and tabs around point (delete-horizontal-space).

C-x C-o
Delete blank lines around the current line (delete-blank-lines).

M- (just-one-space) does likewise but leaves a single space after point, regardless of the number of spaces that existed previously (even if there were none before). With a numeric argument n, it leaves n spaces after point.

M-y
Replace text just yanked with an earlier batch of killed text (yank-pop).

ちょっと適当によみはじめた。

Some users like the full-screen scroll commands to keep point at the same screen position. To enable this behavior, set the variable scroll-preserve-screen-position to a non-nil value. Then, whenever a command scrolls the text around point offscreen (or within scroll-margin lines of the edge), Emacs moves point to keep it at the same vertical and horizontal position within the window. This mode is convenient for browsing through a file by scrolling by screenfuls; if you come back to the screen where you started, point goes back to the line where it started.

というかこういう読み方にしてあぁやっぱり楽しいことをするのが一番だなぁと思うから困る。

C-sで検索、もう一回C-sで次の同単語を検索。C-rで同単語をリバース。覚えた。
M-% (query-replace)だが置換はもっと色々便利なコマンドありすぎ。

すげーなEmacs。マクロを保存しておいてそれをグローバルキーバインドに設定できたりできるのか。

というわけで途中で適当に読み始めてしまったのでMajor Structures of Emacsも適当に読んでみるる。

C-x 4 f
Visit a file, in another window (find-file-other-window). Don't alter what is displayed in the selected window.
C-x 5 f
Visit a file, in a new frame (find-file-other-frame). Don't alter what is displayed in the selected frame.

M-x copy-file reads the file old and writes a new file named new with the same contents. M-x copy-directory does the same for directories, by recursive copying all files and subdirectories.

TRAMPとかを使えばFTP経由でWebsiteにあるファイルをそのままEmacsで編集閲覧、作成出来て便利になるのかなぁ。シームレスな感じになって。でも、ReStructuredTextでやるつもりだから、変換がやはり必要か。Emacs上でReStrucuturedTextに変換できるのかなぁ、それってShellをEmacs上で使えば可能なのか?でもそれでまたTRAMP使ってFTPサイトに置くとか出来るのか?

後、ファイルネームかなにかの時に、$を先頭に置くと変数みたいになって指定された単語になるらしいのが気になる。bookmark並かそれ以上に便利そう。
それと学んでおくのはDiredぐらいだろうか。後シェルまわり。とLisp.クリアしたいのはフォント・フェイス。

FFAPモード?で

C-x C-f filename
Find filename, guessing a default from text around point (find-file-at-point).

すればファイルネームとその用途中身コンテンツ使用コンテキストみたいなのをテキストファイルで記述しておけばそこからアクセスできるような感じになるのかなぁ。メジャーモードでffapモードになるんじゃないのか?なんかM-x ffapしたらその場でファイルネームに反応しやがったwむしろこの方が便利かも。モンスターだわEmacs.

22.18 Filesetsも便利そう。セッションとどう違うのかまだわかってないけど。

C-x b buffer
Select or create a buffer named buffer (switch-to-buffer).
C-x 4 b buffer
Similar, but select buffer in another window (switch-to-buffer-other-window).
C-x 5 b buffer
Similar, but select buffer in a separate frame (switch-to-buffer-other-frame).

The command C-x 2 (split-window-vertically) breaks the selected window into two windows, one above the other. Both windows start out displaying the same buffer, with the same value of point. By default the two windows each get half the height of the window that was split; a numeric argument specifies how many lines to give to the top window.

C-x 3 (split-window-horizontally) breaks the selected window into two side-by-side windows. A numeric argument specifies how many columns to give the one on the left. If you are not using scrollbars, a vertical line separates the two windows.

To select a different window, click with Mouse-1 on its mode line. With the keyboard, you can switch windows by typing C-x o (other-window). That is an o, for “other,” not a zero. When there are more than two windows, this command moves through all the windows in a cyclic order, generally top to bottom and left to right. After the rightmost and bottommost window, it goes back to the one at the upper left corner. A numeric argument means to move several steps in the cyclic order of windows. A negative argument moves around the cycle in the opposite order. When the minibuffer is active, the minibuffer is the last window in the cycle; you can switch from the minibuffer window to one of the other windows, and later switch back and finish supplying the minibuffer argument that is requested. See Minibuffer Edit.

C-x 0
Delete the selected window (delete-window). The last character in this key sequence is a zero.
C-x 1
Delete all windows in the selected frame except the selected window (delete-other-windows).
C-x 4 0
Delete the selected window and kill the buffer that was showing in it (kill-buffer-and-window). The last character in this key sequence is a zero.
C-x ^
Make selected window taller (enlarge-window).
C-x }
Make selected window wider (enlarge-window-horizontally).
C-x {
Make selected window narrower (shrink-window-horizontally).
C-x -
Shrink this window if its buffer doesn't need so many lines (shrink-window-if-larger-than-buffer).
C-x +
Make all windows the same height (balance-windows).

M-x winner-mode is a global minor mode that records the changes in the window configuration (i.e. how the frames are partitioned into windows), so that you can “undo” them. To undo, use C-c left (winner-undo). If you change your mind while undoing, you can redo the changes you had undone using C-c right (M-x winner-redo). Another way to enable Winner mode is by customizing the variable winner-mode.

The Windmove commands move directionally between neighboring windows in a frame. M-x windmove-right selects the window immediately to the right of the currently selected one, and similarly for the “left,” “up,” and “down” counterparts. M-x windmove-default-keybindings binds these commands to S-right etc. (Not all terminals support shifted arrow keys, however.)

Any editing you do in one frame affects the other frames. For instance, if you put text in the kill ring in one frame, you can yank it in another frame. If you exit Emacs through C-x C-c in one frame, it terminates all the frames. To delete just one frame, use C-x 5 0 (that is zero, not o).

You can customize the variable x-select-enable-clipboard to make the Emacs yank functions consult the clipboard before the primary selection, and to make the kill functions to store in the clipboard as well as the primary selection. Otherwise, these commands do not access the clipboard at all. Using the clipboard is the default on MS-Windows and Mac OS, but not on other systems.

Load Bookmark Commandっていうのがあるからにして、Bookmarkをいくつも作って操作することが想定されてるっぽいなぁ。

You can control the appearance of new frames you create by setting the frame parameters in default-frame-alist. You can use the variable initial-frame-alist to specify parameters that affect only the initial frame. See Initial Parameters, for more information.

Here is an example of using default-frame-alist to specify the default foreground color and font:

(add-to-list 'default-frame-alist '(font . "10x20"))
(add-to-list 'default-frame-alist '(foreground-color . "blue"))

By putting such customizations in your init file, you can control the appearance of all the frames Emacs creates, including the initial one (see Init File). See Fonts, for other ways to set the default font.

C-x 5 o
Select another frame, raise it, and warp the mouse to it. If you repeat this command, it cycles through all the frames on your terminal.

とりあえずOn Windowsでもこれやるだけで効いてくれないかなぁ。

# If you are running Emacs on the GNOME desktop, you can tell Emacs to use the default system font by setting the variable font-use-system-font to t (the default is nil). For this to work, Emacs must be compiled with Gconf support; this is done automatically if the libraries are present at compile time.

へぇ、Speedbarっての楽しいな。
このモードあるだけで他のエディタには勝ってるような感じするわ。玄人はなんとなく使ってなさそうな機能だけど、中級ぐらいまでは普通に勝ってると思いますな感じ。これ普通にキーバインドでトグルっても便利そうだなぁ。

You can make certain chosen buffers, which Emacs normally displays in “another window,” appear in special frames of their own. To do this, set the variable special-display-buffer-names to a list of buffer names; any buffer whose name is in that list automatically gets a special frame, when an Emacs command wants to display it “in another window.”

この機能も便利そうなんだよなぁ。

You can turn display of menu bars on or off with M-x menu-bar-mode or by customizing the variable menu-bar-mode. With no argument, this command toggles Menu Bar mode, a minor mode. With an argument, the command turns Menu Bar mode on if the argument is positive, off if the argument is not positive. You can use the X resource ‘menuBar’ to control the initial setting of Menu Bar mode. See Resources.

Expert users often turn off the menu bar, especially on text-only terminals, where this makes one additional line available for text. If the menu bar is off, you can still pop up a menu of its contents with C-Mouse-3 on a display which supports pop-up menus. See Menu Mouse Clicks.

M-x menu-bar-modeとM-x tool-bar-mode

Firstly, Emacs hides the mouse pointer each time you type a self-inserting character, if the pointer lies inside an Emacs frame; moving the mouse pointer makes it visible again. To disable this feature, set the variable make-pointer-invisible to nil.

Secondly, you can use Mouse Avoidance mode, a minor mode, to keep the mouse pointer away from point. To use Mouse Avoidance mode, customize the variable mouse-avoidance-mode. You can set this to various values to move the mouse in several ways:

これをやると、現在の僕のEmacsでは日本語はIPAPゴシック、英語はLucidaで表示されていることがわかる。ふむむ。

With a prefix argument (C-u C-x =), this command displays a detailed description of the character in a window:

26.16 Modifying Fontsets
Fontsets do not always have to be created from scratch. If only minor changes are required it may be easier to modify an existing fontset. Modifying ‘fontset-default’ will also affect other fontsets that use it as a fallback, so can be an effective way of fixing problems with the fonts that Emacs chooses for a particular script.

Fontsets can be modified using the function set-fontset-font, specifying a character, a charset, a script, or a range of characters to modify the font for, and a font-spec for the font to be used. Some examples are:

この辺がもしかしたら役に立つかもしれん。

26.19 Charsets
One example is font selection (see Fonts). Each language environment (see Language Environments) defines a “priority list” for the various charsets. When searching for a font, Emacs initially attempts to find one that can display the highest-priority charsets. For instance, in the Japanese language environment, the charset japanese-jisx0208 has the highest priority, so Emacs tries to use a font whose registry property is ‘JISX0208.1983-0’.

There are two commands that can be used to obtain information about charsets. The command M-x list-charset-chars prompts for a charset name, and displays all the characters in that character set. The command M-x describe-character-set prompts for a charset name, and displays information about that charset, including its internal representation within Emacs.

To display a list of all supported charsets, type M-x list-character-sets. The list gives the names of charsets and additional information to identity each charset (see http://www.itscj.ipsj.or.jp/ISO-IR/ for details). In this list, charsets are divided into two categories: normal charsets are listed first, followed by supplementary charsets. A supplementary charset is one that is used to define another charset (as a parent or a subset), or to provide backward-compatibility for older Emacs versions.

To find out which charset a character in the buffer belongs to, put point before it and type C-u C-x = (see International Chars).

これも役立つかもしれない。