]> code.delx.au - gnu-emacs-elpa/blob - README.md
include xsel.el and note that standalone pdbtrack is moved aside
[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 xsel
49
50 If xsel is installed and DISPLAY is working, use `klm:xsel-copy' to copy
51 the region to the X clipboard and `klm:xsel-paste' to paste the contents
52 of the clipboard at point. (The advantage of the latter over regular X
53 mouse paste is `klm:xsel-paste' looks unitary, to emacs, rather than
54 the mouse paste's continuous, parsed/indented/auto-parenned/etc input.)
55
56 * **[pdbtrack.el](./pdbtrack.el)**
57
58 [I've moved my standalone version of pdbtrack aside. I hadn't realized
59 that the version that I derived this code from lacks my source-buffer
60 fallback provisions. It looks like I'm going to have to do some
61 unraveling to reconstruct the best basis.]
62
63 Add sensitivity to comint shells so the source file lines are automatically
64 presented in a separate window when the Python PDB debugger steps to them.
65
66 This is derived from the pdb tracking code, which I originally wrote, and
67 which has been included in (various) official Emacs Python modes. I wanted
68 a version that I could more easily tweak and maintain, independently of
69 the python-mode code.
70
71 It would be nice to eventually generalize this code, to work for things
72 like the node.js debugger. We'll see if I (or anyone) ever gets around to
73 that.