[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hint / Call to use emacs outline mode



"Karl M. Hegbloom" <karlheg@inetarena.com> wrote:
:  Where do you get 'Ctrl-C-keymap' from?  I get an error when I try
: your .emacs code.
: 

 Oh, thank you!  Excuse me for giving a too thin exerpt from
my ~/.emacs file.  here it comes again, cleaned up a bit and
completele.  Try the outline mode with the startup ~/.emacs
file and do a
    "C-c r" (to init outline mode) and a 
    "C-c R" (to show all headers)

 Have fun!  Andreas

-- 
Uni Wuppertal, FB Elektrotechnik, Tel/Fax: (0202) 439 - 3009
Dr. Andreas Wehler;  wehler2@welfa4.elektro.uni-wuppertal.de

below is added my complete ~/.emacs startup file:
---------- snip ---------- snip ---------- snip ----------
;*_* file description, comment
; this is my ~/.emacs startup file, prepared to handle
; the GREAT emacs outline mode
; Uni Wuppertal, FB Elektrotechnik, Tel/Fax: +49 (0202) 439 - 3009
; Dr.-Ing. Andreas Wehler;  wehler2@welfa4.elektro.uni-wuppertal.de

;*_* character set
;
(standard-display-european 1)

;*_* preselect a few emacs modes of operation
;*_** auto select text mode for these given files
;
(setq auto-mode-alist (mapcar 'purecopy
							   '(("\\.c$" . text-mode)
								 ("\\.h$" . text-mode)
                                ("\\.tex$" . text-mode)
                                ("\\.pas$" . text-mode)
                                ("\\.txt$" . text-mode)
                        )))
;
;*_** Ctl-C-prefix
;
(defun Ctl-C-prefix ()
  Ctl-C-keymap)
(setq Ctl-C-keymap (make-keymap))
(global-set-key "\C-c" (Ctl-C-prefix))
;
;*_** enable narrowing og regions
(put 'narrow-to-region 'disabled nil)
;
;*_** enable upcase regions and downcase regions
;
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)

;*_* prepare outline mode
;
;*_** definitions/functions
;
;*_*** reset_outline
;
(fset 'reset_outline
   "\C-[1\C-[xoutline-minor-mode\C-m\C-[xhide-other")
;
;*_*** show-all-branches
;
(fset 'show-all-branches
   "\C-[9\C-[xhide-sublevels")
;
;*_** set outline regex
;
(setq-default outline-regexp ".[*]_[*]+")
;
;*_** self defined functions
;
(fset 'reset_outline
   "\C-[1\C-[xoutline-minor-mode\C-m\C-[xhide-other")
(fset 'show-all-branches
   "\C-cA\C-ca")
;
;*_** my preferences for outline mode keys
;
;*_*** show/hide headers without text
; ===================================
; C-c R	show: all levels
; C-c r	hide: all but level 0; init/reset outline mode
; C-c S	show: subtree
; C-c s	hide: subtree
; C-c T	show: only this sublevel
; C-c t	hide: only this sub level

(define-key Ctl-C-keymap "R" 'show-all-branches)
(define-key Ctl-C-keymap "r" 'reset_outline)
(define-key Ctl-C-keymap "S" 'show-branches)
(define-key Ctl-C-keymap "s" 'hide-subtree)
(define-key Ctl-C-keymap "T" 'show-children)
(define-key Ctl-C-keymap "t" 'hide-subtree)
;
;*_*** show/hide text and headers
; ===============================
; C-c A	show all text, e. g. everything
; C-c a	hide all text, show only headers
; C-c B	show subtree with text
; C-c b	hide subtree 
; C-c C	show text of this sub level
; C-c c	hide text of just this level

(define-key Ctl-C-keymap "A" 'show-all)
(define-key Ctl-C-keymap "a" 'hide-body)
(define-key Ctl-C-keymap "B" 'show-subtree)
(define-key Ctl-C-keymap "b" 'hide-subtree)
(define-key Ctl-C-keymap "C" 'show-entry)
(define-key Ctl-C-keymap "c" 'hide-entry)
;
;*_*** Cursor movement within the outline tree
; ============================================
; C-c C-p	previous header line
; C-c C-n	next header line
; C-c C-f	forward, same level
; C-c C-g	dito
; C-c C-b	backward, same level
; C-c C-u	upward in the tree

(define-key Ctl-C-keymap "\C-p" 'outline-previous-visible-heading)
(define-key Ctl-C-keymap "\C-n" 'outline-next-visible-heading)
(define-key Ctl-C-keymap "\C-f" 'outline-forward-same-level)
; for some reason C-f doesn't work as expected, but C-c C-g does
(define-key Ctl-C-keymap "\C-g" 'outline-forward-same-level)
(define-key Ctl-C-keymap "\C-b" 'outline-backward-same-level)
(define-key Ctl-C-keymap "\C-u" 'outline-up-heading)
;
;*_** don't know, old default entries
; 
; (make-variable-buffer-local 'outline-prefix-char)
; (setq-default outline-prefix-char "\C-l")
; (make-variable-buffer-local 'outline-regexp)
; (make-variable-buffer-local 'outline-level-function)
; (setq-default outline-level-function 'outline-level-default)
; (define-key Ctl-C-keymap "o" 'outline-minor-mode)

;*_* Tabulator
;
(setq-default tab-width 4)
(setq-default tab-stop-list 
		 '(4 8 12 16 20 24 28 32 36 40 44
		  48 52 56 60 64 68 72 76 ))

;*_* email
;
(setq mail-default-reply-to "wehler2@welfa4.elektro.uni-wuppertal.de")
(setq mail-self-blind t)
(setq rmail-delete-after-output t)


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: