ReallySoft

Here you find some snippets of my eLisp code for XEmacs

Content:
 
  Comment defuns Build/update comment blocks Comment out current line
  Parenthesis Defuns concerned with parenthesis matching
  Surround by.. Surround word or region by ...
  Whitespace Automatically delete superfluous whitespace when saving buffer
  Buffer switching Functions for convenient buffer-switching. Usage examples for buffer switching defuns.
  Quick answer Answer questions with multiple possible answers by pressing one key
  Path correction Correct filenames under Win9x
  Resize frame Resize current XEmacs frame to size of current buffer
  Small ones Some small defuns (intended to be bound to keys)
  Helper defuns Some defuns needed by other.
  Defun index

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)
Download file comment.el
insert-comment-line
build-comment-block
rebuild-comment-block
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.
Download file cmtline.el
comment-line
Size: 1.8 Kb / Last update: 17.Dec.2002

Parenthesis Defuns concerned with parenthesis matching
Download file paren.el
goto-opening-parenthesis
goto-closing-parenthesis
goto-matching-paren
mark-parenthesis
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
an active region
by anything you can imagine.
Download file inspair.el
insert-pair
insert-pair-detailed
insert-double-quotes
insert-single-quotes
insert-square-brackets
insert-round-brackets
Size: 1.2 Kb / Last update: 17.Dec.2002

Whitespace Automatically delete superfluous whitespace when saving buffer
Download file delwhite.el
delete-whitespace-at-end-of-lines
Size: 0.7 Kb / Last update: 17.Dec.2002
Download file befsave.el
my-write-content-hook
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.
Download file switintr.el
switches to previous invisible, but interesting buffer.
switch-to-previous-interesting-buffer
Size: 1.5 Kb / Last update: 17.Dec.2002
Download file bufswit2.el
switch to buffer using regular-expression for buffer name or using mode name
switch-to-buffer-named
switch-to-buffer-recent-mode
Size: 1.3 Kb / Last update: 17.Dec.2002
Download file bufswit3.el
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.
Download file bufswit.el
my personal buffer/mode/etc switch defun
my-switch-buffer
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.
Download file select.el
ask questions with multiple answers
select-option
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.
Download file pathcorr.el
contains my personal path-correction routine (much specific stuff)
cygwin32-to-emacs-path
Size: 4 Kb / Last update: 22.Dec.2002
Download file advices.el
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
Download file autosize.el
auto-resize-frame-to-buffersize
goto-longest-line
count-columns-buffer
hide-toolbar-and-menu
toggle-toolbar-and-menu
Size: 4.4 Kb / Last update: 17.Dec.2002

Small ones Some small defuns (intended to be bound to keys)
Download file addline.el
Add and indent lines
add-line
add-newline
Size: 1 Kb / Last update: 17.Dec.2002
Download file dupline.el
Duplicate current line
duplicate-line
Size: 0.4 Kb / Last update: 17.Dec.2002
Download file dupkill.el
Copy one (or several subsequent) line(s) to the kill-ring
duplicate-and-kill-line
Size: 0.4 Kb / Last update: 17.Dec.2002

Helper defuns Some defuns needed by other.
Download file modefun.el
Mode attribute defuns
mode-is-autoindented
modes-are-equal
Size: 0.7 Kb / Last update: 17.Dec.2002
Download file bufhelp.el
Helpers for buffer switching
buffer-visible-in-current-frame
buffer-visible-in-any-frame
invisible-in-current-frame-buffers
invisible-in-any-frame-buffers
buffers-matching-name
buffers-with-mode
Size: 2 Kb / Last update: 17.Dec.2002
Download file smartbnd.el
Other helper defuns
get-smart-bounds
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 Mail Thanks for your help.

http://www.ReallySoft.de/ Last update: 22.Dec.2002