[PR]テレビ番組表
今夜の番組チェック

Software Library :: Masayuki Ataka

$Id: prog.html,v 1.10 2005/12/10 21:02:33 ataka Exp $

What's New

Contents


Emacs Lisp Programs

Emacs-wget

Emacs-wget is an interface program for GNU wget on Emacs. See Emacs-wget page, please.

fcopy -- Funny Copy

Funny copy is a minor mode to copy text; first, set the paste point, and next look for the text to copy. The past point is the point where fcopy-mode start. One stroke commands are prepared to search and copy the text. Copy commands automatically take the cursor back to the past point, insert the text, and exit fcopy-mode.

Install fcopy

Put this in your .emacs file:

(autoload 'fcopy-mode "fcopy" "copy lines or region without editing." t)

And bind it to any key, you like.

(define-key mode-specific-map "k" 'fcopy-mode)  ; C-c k for fcopy-mode

Usage of fcopy

M-x fcopy-mode takes you into Funny Copy mode. The place where you get in fcopy-mode is the paste point; the text you choose to copy will be inserted.

You can exit Funny Copy in 2 ways. C-g exits Funny Copy and takes your cursor back to the paste point. q just exits and does not move.

Some 1-stroke key commands are prepared, like view-mode. f, b, n, p, a, e are in common with C-f, C-b, C-n, C-a, C-a, C-e, respectively. Moving commands are as follows.

C-f (C-b)
forward (backward) char.
f (b)
forward (backward) word.
n (p)
next (previous) line with skipping blank lines.
a (e)
beginning (end) of line.
A (E)
beginning (end) of sentence.
N (P)
next (previous) paragraph.
SPACE (BackSpace)
scroll up (down).
s (r)
forward (backward) incremental search.
S (R)
forward (backward) incremental search with regexp.
< (>)
beginning (end) of buffer.
g
Go to line
o
Other buffer
, (comma)
Pop mark ring

Copy commands take us back to the past point, insert copy text, and exit Funny Copy.

. (period)
Set mark
k
copy the rest of the current line like C-k. If you type k just after entering fcopy-mode, Funny Copy copies text from above line.
RET
copy region like M-w. If mark is not active, copy the whole current line. With prefix arg, remove the white spaces around the copy text.
M-RET
copy rectangle.
w
copy word.
c
copy char.
C or Shift-Space
copy block text. Block text means text that separated by spaces. For example, one-to-one is regarded as 3 words by Emacs. However, for Funny Copy, it is regarded as one block.
( (left parenthesis)
copy text between the parens (ex. (...), {...}, [...], <...>). You should use this command in the parens, of course. If you don't need to copy the parens around text, use ) (right parenthesis) instead.
' (single quote)
copy text surrounded by the same chars (ex. '...', "...", $...$). You should use this command in the chars, of course. If you don't need to copy the chars around text, use " (double quote) instead.
; (semi-colon)
copy comments. Comment pattern is depende on major mode.

If you want not to copy text, but to cut, toggle delete flag with C-d. You can see a delete mark :d in mode line.

If you want modify the copy text before paste it, toggle modify flag with typing m. You can see a modify mark :m in mode line. When modify flag is on, modify buffer is opened before inserting the text. You can modify the text with replacement and insert the modified text with C-cC-c. See the commentary section in fcopy.el for details.

clgrep -- ChangeLog Grep

clgrep provides a grep command specialized in ChangeLog file. clgrep.el is a pure Emacs-Lisp program. No need to call grep command.

grep or occur are often used when searching keywords. But these commands only shows one line that containing a match. Almost ChangeLog, the topic has multi lines. clgrep shows all topics in the current ChangeLog containing a match for regexp.

Install clgrep

Put the following code into your .emacs:

(autoload 'clgrep "clgrep" "grep mode for ChangeLog file." t)
(autoload 'clgrep-title "clgrep" "grep first line of entry in ChangeLog." t)
(autoload 'clgrep-header "clgrep" "grep header line of ChangeLog." t)
(autoload 'clgrep-other-window "clgrep" "clgrep in other window." t)

And bind them to your favourite keys.

(add-hook 'change-log-mode-hook
     '(lambda ()
        (define-key change-log-mode-map "\C-c\C-g" 'clgrep)
        (define-key change-log-mode-map "\C-c\C-t" 'clgrep-title)))

Usage of clgrep

M-x clgrep shows all topics containing a match for regexp. With prefix arg, outputs are prented in reverse order.

M-x clgrep-title do the same as clgrep, but only search the first line of topics.

M-x clgrep-header do the same as clgrep, but only search ChangeLog date and author field.

Changes of clgrep

Ver. 0.9.0
Ver. 0.8.5

[Home] [Top]
Masayuki Ataka
e-mail: ataka@milk.freemail.ne.jp
Counter