File: cvsbook.el

package info (click to toggle)
cvsbook 1.10-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 620 kB
  • ctags: 6
  • sloc: makefile: 102; lisp: 24
file content (31 lines) | stat: -rw-r--r-- 791 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;;; Some code to help with the conversion to Texinfo format.
;;;
;;; I'm probably the only person interested in this, but what the heck,
;;; I'll include it in the dist anyway.

(global-set-key "\C-c6" 'kf-codeize-ahead)
(global-set-key "\C-c7" 'kf-examplize-region)

(defun kf-examplize-region (b e)
  (interactive "r")
  (setq e (copy-marker e))
  (goto-char b)
  (insert "@example\n")
  (goto-char e)
  (insert "@end example\n"))

(defun kf-codeize-ahead (&optional parg)
  (interactive "P")
  (if parg
      (skip-chars-forward " 	")
    (search-forward "")
    (delete-backward-char 1))
  (insert "@code{")
  (if parg
      (progn 
        (re-search-forward "\\s-")
        (forward-char -1))
    (search-forward "")
    (delete-backward-char 1))
  (insert "}")
  (forward-char -1))