Here you find some snippets of my eLisp code for XEmacs
|
|
|
This page lists snippets from various eLisp files.
|
Some snippets require the presence of other snippets. |
|
If you encounter a missing reference to a defun please
take a look at the Defun index to find the needed snippet.
|
|
The snippets:
|
|
Comment defuns
|
Build/update comment blocks |
|
Easily build or update comment blocks for any mode that has correct comment defs.
| Lisp-Example: |
|
;; --------------------------------------- ;; (defun rebuild-comment-block () ;; --------------------------------------- (defun rebuild-comment-block ()
|
|
| C++-Example: |
|
// --------------------------------------------- // string strf(const char *format, ...) // --------------------------------------------- string strf(const char *format, ...) {
|
|
| C-Example: |
|
/* ---------------------------------------------------------- */ /* int start_child(char* cmdline, int wait_for_child) */ /* ---------------------------------------------------------- */ int start_child(char* cmdline, int wait_for_child)
|
|
|
|
|
|
|
|
Size: 6.2 Kb /
Last update: 17.Dec.2002 |
|
| Comment out current line |
|
Intended to be bound to '/'.
Comments out current line if point is at beginning of line - otherwise it just inserts
a '/'.
Repeated usage comments out successive lines.
|
|
|
|
Size: 1.8 Kb /
Last update: 17.Dec.2002 |
|
|
|
|
Parenthesis
|
Defuns concerned with parenthesis matching
|
|
|
|
|
|
|
Size: 8.8 Kb /
Last update: 17.Dec.2002 |
|
|
|
|
Surround by..
|
Surround word or region by ...
|
| Provides simple defuns to enclose either |
| the word currently under the cursor |
|
| |
| by anything you can imagine. |
|
|
|
|
|
|
|
|
Size: 1.2 Kb /
Last update: 17.Dec.2002 |
|
|
|
|
Whitespace
|
Automatically delete superfluous whitespace when saving buffer |
|
|
delete-whitespace-at-end-of-lines |
|
Size: 0.7 Kb /
Last update: 17.Dec.2002 |
|
|
|
|
Size: 4.4 Kb /
Last update: 22.Dec.2002 |
This snippet shows how to call some defuns directly before saving a buffer |
|
|
|
|
Buffer switching
|
Functions for convenient buffer-switching. |
|
|
switches to previous invisible, but interesting buffer. |
switch-to-previous-interesting-buffer |
|
Size: 1.5 Kb /
Last update: 17.Dec.2002 |
|
|
|
switch to buffer using regular-expression for buffer name
or using mode name |
|
switch-to-buffer-recent-mode |
|
Size: 1.3 Kb /
Last update: 17.Dec.2002 |
|
|
|
circle through buffers with current mode |
switch-to-previous-buffer-current-mode |
|
switch-to-next-buffer-current-mode |
|
Size: 2.9 Kb /
Last update: 17.Dec.2002 |
|
| Usage examples for buffer switching defuns. |
|
|
my personal buffer/mode/etc switch defun |
|
Size: 3.4 Kb /
Last update: 22.Dec.2002 |
|
|
|
|
Quick answer
|
Answer questions with multiple possible answers by pressing one key |
|
This is much alike y-or-n-p with one big difference:
You can define the possible answers with an argument.
|
|
|
ask questions with multiple answers |
|
Size: 2.5 Kb /
Last update: 17.Dec.2002 |
|
|
Look at my-switch-buffer for an usage example.
|
|
|
|
Path correction
|
Correct filenames under Win9x |
|
If you edit the same file using different names to
load the file, you´ll
get into trouble if you change both loaded versions.
|
|
|
contains my personal path-correction routine
(much specific stuff) |
|
Size: 4 Kb /
Last update: 22.Dec.2002 |
|
|
|
contains some advices
(needed to make path-correction work) |
Size: 1.3 Kb /
Last update: 22.Dec.2002 |
|
|
|
|
Resize frame
|
Resize current XEmacs frame to size of current buffer
|
|
|
|
|
auto-resize-frame-to-buffersize |
|
|
|
|
|
Size: 4.4 Kb /
Last update: 17.Dec.2002 |
|
|
|
|
Small ones
|
Some small defuns (intended to be bound to keys) |
|
|
Add and indent lines |
|
|
Size: 1 Kb /
Last update: 17.Dec.2002 |
|
|
|
Duplicate current line |
|
Size: 0.4 Kb /
Last update: 17.Dec.2002 |
|
|
|
Copy one (or several subsequent) line(s) to the kill-ring |
|
Size: 0.4 Kb /
Last update: 17.Dec.2002 |
|
|
|
|
Helper defuns
|
Some defuns needed by other. |
|
|
Mode attribute defuns |
|
|
Size: 0.7 Kb /
Last update: 17.Dec.2002 |
|
|
|
Helpers for buffer switching |
buffer-visible-in-current-frame |
|
buffer-visible-in-any-frame |
|
invisible-in-current-frame-buffers |
|
invisible-in-any-frame-buffers |
|
|
|
Size: 2 Kb /
Last update: 17.Dec.2002 |
|
|
|
Other helper defuns |
|
Size: 0.9 Kb /
Last update: 17.Dec.2002 |
|
|
|
Defun index |
If you detect any errors, missing defuns
or have suggestions
please feel free to send a
Thanks for your help.
|