]> code.delx.au - gnu-emacs-elpa/blob - README.md
Merge remote-tracking branch 'origin/master'
[gnu-emacs-elpa] / README.md
1 EmacsUtils
2 ==========
3
4 Handy Emacs utilities
5
6 I've been using Gnu Emacs since it was publicly available (1985?), and have contributed some packages which are included with Emacs, notably the [Allout outliner](http://myriadicity.net/software-and-systems/craft/emacs-allout), [icomplete mode](http://www.emacswiki.org/emacs/IcompleteMode), and python-mode's [pdbtrack functionality](http://myriadicity.net/software-and-systems/craft/crafty-hacks#section-1). Like many long-time Emacs users, I've use some custom code, some of which I wouldn't do without. Here's a few items that I particularly like, and think might be useful to others - I hope to include more, as time allows.
7
8 * **[poptoshell.el](./poptoshell.el)**
9
10 I use the emacs shell a lot. This code enables me to streamline and
11 extend how I can a single one, or multiple ones in a project-oriented
12 fashion:
13
14 * It simplifies getting to the input prompt, by doing the right thing when
15 I hit the key I have bound to pop-to-shell (I use [M-space], ie
16 meta-space:
17 * If the cursor is in a buffer that has no subprocess, pop the window to
18 the primary shell buffer
19 * If there is no shell buffer, start one.
20 * If the cursor is in a buffer which has a process, move the cursor to
21 the process input point.
22 * With a universal argument, even if the current buffer has a subprocess,
23 solicit the name of the target shell buffer - defaulting to the currently
24 chosen primary one - and pop to that.
25 * This enables starting an alternate shell buffer, for instance, and/or
26 switching between the main and alternate ones.
27 * (The expected name is without the surrounding asterisks, and
28 completion is done against existing shell buffer names stripped of
29 their asterisks.)
30 * With a doubled universal arg, prompt for the target shell buffer and
31 use the provided name as the ensuing default. This is how the "primary"
32 is chosen.
33
34 The last few things enable a kind of project-focus mode. I often have
35 various shell buffers, each one associated with a project. As I switch
36 which project is currently my primary focus, I use the double universal
37 argument to switch which shell buffer is the default. I can still use the
38 single universal argument to easily switch to any of the shells, but most
39 easily to my current primary.
40
41 (This code has grown gradually over many years, and undoubtedly could stand
42 cleaning and clarifying. It works quite reliably, though, and in a choice
43 between spending the time cleaning versus spending the time releasing it, I'm
44 choosing to release.)
45
46 * **[xsel.el](./xsel.el)**
47
48 X copy and paste emacs region from emacs tty sessions, using a shell command.
49
50 If xsel or linux or cygwin equivalent is installed, and DISPLAY is
51 working, use `klm:xsel-copy` to copy the region to the X clipboard and
52 `klm:xsel-paste` to paste the contents of the clipboard at point.
53
54 One benefit is that `klm:xsel-paste` pastes are single units, rather than
55 a sequence of individual keystrokes that constitute regular X pastes to a
56 terminal. This avoids layers of parsing, indenting, auto-paren insertion,
57 and so forth. (You can always do a regular X paste on occasions when you
58 want that processing.)
59
60 * **[pdbtrack.el](./pdbtrack.el)**
61
62 [I've moved my standalone version of pdbtrack aside. I hadn't realized
63 that the version that I derived this code from lacks my source-buffer
64 fallback provisions. It looks like I'm going to have to do some
65 unraveling to reconstruct the best basis.]
66
67 Add sensitivity to comint shells so the source file lines are automatically
68 presented in a separate window when the Python PDB debugger steps to them.
69
70 This is derived from the pdb tracking code, which I originally wrote, and
71 which has been included in (various) official Emacs Python modes. I wanted
72 a version that I could more easily tweak and maintain, independently of
73 the python-mode code.
74
75 It would be nice to eventually generalize this code, to work for things
76 like the node.js debugger. We'll see if I (or anyone) ever gets around to
77 that.