-*- mode:outline; coding:latin-1 -*- Emacs Tips * Abbreviations, expansion, run region through filter `M-/' Expand the word in the buffer before point as a "dynamic abbrev", by searching in the buffer for words starting with that abbreviation (`dabbrev-expand'). `C-M-/' Complete the word before point as a dynamic abbrev (`dabbrev-completion'). * Editing `C-x C-l' `downcase-region' `C-x C-u' `upcase-region' ** Manipulate text in region by an external command `M-1 M-|' or `M-1 M-x shell-command-on-region' run region through filter, replace region by the output of the external command (M-| with numeric argument) ** Join lines/split lines Join this line to previous and fix up whitespace at join. `join-lines' Split current line, moving portion beyond point vertically down: `C-M o' `split-line' * Navigation within emacs ** Scroll only one line when I move past the bottom of the screen Place the following Lisp form in your `.emacs' file: (setq scroll-step 1) ** Show only lines which are not indented `C-x $' `set-selective-display' to arg arg: lines with text beginning in arg'th column become invisible, clear with no arg ** Problems with syntax highlighting `ARG M-x font-lock-fontify-block' `ARG M-g M-g' * Problems with encoding ** Enforce Latin-1 or UTF-8 coding %% Local Variables: %% coding: latin-1 %% End: oder Local Variables: coding: latin-1 End: another option: write into the first line of the file: -*- coding:latin-1 -*- This issue is descibed in "Local variables in files" of the emacs documentation. ** Change encoding `M-x set-language-environment latin-1' or `M-x set-language-environment utf-8' or `C-x l latin-1' You may also select the menu option Options, Mule, Set language environment utf-8 ** Obtain information about the current encoding `M-x describe-current-coding-system' * Lisp ** Load a library `M-x load-library' ** Byte compile an elisp file `M-x byte-compile-file' then emacs prompts you for the file name ** Evaluate elisp expressions Put cursor after Emacs Lisp code and execute `M-x eval-last-sexp' or `C-x C-e' test this with: (+ 12 14) if you wish to get the result printed into the buffer: `C-u C-x C-e' ** Calculating with Emacs Lisp *** formatting strings The printf equivalent in Emacs Lisp is `format', e. g. calculate 2/7 with four digits precision: (format "Result %.4f" (/ 2 7.0)) ** Configure Emacs with .emacs (setq make-backup-files nil) (desktop-load-default) (desktop-read) (mouse-wheel-mode t) (setq visible-bell t) (setq-default truncate-lines t) (setq-default fill-column 78) (auto-fill-mode t) ;; show column numbers in status line (column-number-mode t) ;; from Camerin, Rosenblatt, Raymond: Learning GNU Emacs, 2nd ed. p. 392 (setq load-path (append load-path (list "~/emacs-scripts"))) ** Spelling Change the dictionary `M-x ispell-change-dictionary' Switch to flyspell-mode `M-x flyspell-mode' * Appearance of emacs buffers ** Whitespace-mode `M-x whitespace-mode' * Miscellanea ** Save minibuffer-history `M-x savehist-mode' Volker Kiefel last change: March 28, 2010