;;; pickle.el - tutorial file for workshop 23/02/2008 pickled feet ;; Copyright (C) 2008 Free Software Foundation, Inc. ;; Author: Martin Howse (m AT 1010 DOT co DOT uk) ;; Maintainer: Martin Howse (m AT 1010 DOT co DOT uk) ;; URL: http://www.1010.co.uk/pickel.el ;; Compatibility: Emacs20, Emacs21, Emacs22, Emacs23 ;; This file is not part of GNU Emacs. ;; This is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; This is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;; Boston, MA 02110-1301, USA. ;;; Commentary: ;; -1] what is GNU Emacs - overview. Code as interface. Pluggability. Central spider(-web) [in org-mode or: [[elisp:(describe-mode)]] ] ;; 0] Starting - graphical or text only emacs -nw pickle.el options for menus usw. see .emacs ;; 1] Moving around: scrolling, files, killring, buffers, windows, frames, modes, bookmarking ;;; .0 Basics Control and Meta: C- and M-x [and history up/down] C-x C-f find file C-x i insert file C-x C-s save file C-x C-w save-as file C-x u or C-_ undo! see: (info "(emacs)undo") to see how to re-do C-g get out of jail C-x C-c exit emacs M-x help-with-tutorial ;;; .1 Movement C-a and C-e end of line // for words usw. M->//M-< - beginning and end of buffer C-v M-v up and down page C-n C-p up down line C-f forward letter M-f forward word C-b M-b same as backwards ;;; .2 buffers, window(=subdivision) and frames C-x b switch to buffer // C-x C-b - list the buffers C-x left/right move through buffers C-x k kill buffer C-x 2 (C-x 1) split C-x 3 C-x o other window [ C-M-v scroll other window ] C-x 1 ;;; .25 frames frames: C-x 5 2 - buffer as new frame C-x 5 o shift frames C-x 5 0 kill frame and various b, f, d options which follow window use: C-x 4 b - buffer in new window d as dired in new window, m as mail, r filename as read only ;;; .3 killring/regions mark and point. point is cursor C-[space] set mark C-k kill line C-w kill text into killring M-w copy into killring C-y/M-y yank text ;;; .4 modes and formatting minor and major - behaviours, key strokes usw. M-x auto-fill-mode or M-q wrap M-x flyspell-mode M-x text-mode [what other modes: M-x python-mode M-x lisp-mode M-x org-mode] C-h m documentation on mode ;;; .5 searching/replacing C-s search forward [ use C-w and C-y to add words/lines from current buffer to search - M-p and M-n to cycle search history) C-r search backward M-% search and replace M-x re-builder (M-x re-search-forward) ;;; .6 bookmarking C-x r m - mark C-x r b - retrieve C-x r l - list //in list e - to annotate ;;; .7 misc M-/ complete M(ESC)-TAB - complete for Emacs Lisp lisp-complete-symbol M-x ange-ftp-copy-file /newlife@ftp.1010.co.uk:/ M-x calendar: g d - goto day i d - insert diary entry at day s - show all diary entries d - show entry for date ;; 2] Getting help: on keystrokes, apropos, info, man various help options: C-h C-h f - for Emacs Lisp function C-h i m - info mode for menu item [navigating info mode] M-x describe-mode M-x describe-bindings M-x apropos (C-h a) example in Emacs Lisp: (info "(elisp)Change Hooks") : C-x C-e - evaluate last s-expression eg. (/ 2456 13) errors: M-x toggle-debug-on-error M-x man ;; 2.5] keyboard macros: C-x ( C-x ) C-x e to re-play ;; 2.6] shell commands M-! shell command M-| shell command on region try prefixing with C-u (universal argument command) ;; 3] Other modes: dired, wdired, image-dired, iimage, picture-mode, artist-mode, w3m, org-mode ;;; dired: M-x dired (or just find-file C-x C-f) Keystrokes: d/u flag/unflag for deletion x delete flagged files i insert sub-directory RET visit file v view file m mark file *t toggle marked files C copy marked files R rename S soft links A search ! shell command ;; wdired. M-x wdired-change-to-wdired-mode (from dired buffer) ;;; picture-mode: M-x picture-mode C-c C-r - draw rectangle C-c <>.^ change direction of insertion ;;; artist-mode: M-x artist-mode ;;; org-mode M-x org-mode outlining, categories, planning, publishing usw. * introduction to outline mode this is an intro here: also links: C-c l (create) C-c C-l [[also%20links][also links]] C-c C-o (to follow) inc: [[shell:ls *]] A shell command [[elisp:(find-file-other-frame "steg.el")]] An elisp form to evaluate ** second level *** third [[file:steg.el::defun%20erc%20steg%20decode][okay]] [[shell:[altext]] **** fourth ;;; fun(?) M-x doctor M-x zone M-x dissociated-press ;; 4] The .emacs file: customisation, extensions (eg. erc, remember, org-mode, eev, muse, emacswiki) M-x customize and M-x customize-group http://1010.co.uk/.emacs Describe and offer examples of each mode. ;; 5] Emacs Lisp: interpreting, basics, a few examples of my own extensions,,, (load "x-dict") and (require 'x-dict) C-x C-e evaluate M-x eval-buffer (info "(emacs)Arguments") ;;; basic interactive functions (defun fc-eval-and-replace () "Replace the preceding sexp with its value." (interactive) (backward-kill-sexp) (prin1 (eval (read (current-kill 0))) (current-buffer))) (defun pd-send-region() (interactive) (shell-command (concat "echo \"" (buffer-substring (region-beginning) (region-end)) ";\" | pdsend 9999 127.0.0.1 udp"))) ;;; loading files (require 'ange-ftp) (add-to-list 'load-path "/usr/share/emacs/site-lisp/") (load "remem.el") annotation: http://1010.co.uk/annotate131207.el promiscuous networking: http://www.1010.co.uk/prmscnet.el -- basic development process and principles (buffers, strings, processes, searching, finding out help, hooks) make-local-variable ;; for buffer local variables Change hooks: (info "(elisp)Change Hooks") ;; also as for finding out Also on subject of hooks see: http://1010.co.uk/steg.el ;; 6] Interface: Common Lisp [SLIME], SuperCollider, Pure Data [PD], Eshell, comint usw. ;;; eshell M-x eshell - show grep usw. ;;; the components eg. jack.el usw. media: //audio: http://delysid.org/emacs/osc.el http://delysid.org/emacs/rme.el http://delysid.org/emacs/jack.el ecasound: http://1010.co.uk/ecatest.el http://1010.co.uk/pd.el SC-> (add-to-list 'load-path "/root/SuperCollider3/linux/scel/el") (require 'sclang) start Emacs with emacs -sclang sclang should be initialised change [ C-x C-b ] to *scratch* buffer and evaluate (C-x C-e after each line - the following): (sclang-start) (sclang-eval-expression "EvalListener.init") (sclang-server-boot) first may not be necessary but... switch back to our Sclang buffer and to test: s = Server.local; SynthDef("mysynth", { Out.ar(0, PinkNoise.ar(0.25)) }).play(s); s.freeAll Using C-c C-c to evaluate each line in turn... //video: http://www.1010.co.uk/gneve.el http://1010.co.uk/orgmedia.el networking/promiscuOS: http://www.1010.co.uk/prmscnet.el http://www.1010.co.uk/leaks.el text processing: http://1010.co.uk/cutup.el development: SLIME - M-x slime other: http://1010.co.uk/permute.el http://1010.co.uk/steg.el http://www.1010.co.uk/platform02.el http://1010.co.uk/platform.el ;; 6] extras : ffap, ido (completion), persistence with desktop-save and session.el, iswitchb.el (switching buffers), goby for presentations, version control (psvn.el), apt-mode, ediff, org-toc, iimage (inlining images) and howm: http://howm.sourceforge.jp/ see .emacs ;; 7] project collaborative editing possibilities: http://www.emacswiki.org/cgi-bin/wiki/CollaborativeEditing in particular: http://fresh.homeunix.net/~luke/shbuf/ (looking particularly at shbuf.el in client) (require 'shbuf) [ to start server: 1. Start an erlang shell by running "erl" 2. Start a server with "shbuf:start_link()." ] to work towards a networked/hypertext diagram rendering/editing mode also builds on artist-mode