[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: development
From: |
Ricardo Anguiano |
Subject: |
Re: development |
Date: |
06 Dec 2002 13:38:30 -0800 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
McClain <McClain@uni.de> writes:
> Hi ppl,
>
> I want to develop projects using Emacs as code editor. So my
> question is, what is the common way developing C/C++ code with
> Emacs, just use c(++)-mode
I mostly rely on the language mode.
> or are there any minor modes which parse your source code and create
> function and type lists?
Python mode gives a list of classes and members. Anybody know about a
similar feature for C or C++? A list of C and C++ functions/types in
the speed bar would be useful. Cscope (http://cscope.sourceforge.net/)
comes close.
> Maybe you've got experience developing with emacs and can recommend
> a certain elisp package or something like this...
I don't know about any elisp packages. I find these things handy:
;; Look and feel customizations.
; (emacs) Cursor Display
(blink-cursor-mode nil)
(setq cursor-in-non-selected-windows nil) ; remove cursor from
; non-selected windows
; I like lots of color.
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
(column-number-mode t)
;; ============
;; Keybindings.
(global-set-key "\C-ct" 'my-insert-current-time)
(global-set-key "\C-cc" 'compile)
(global-set-key "\C-cg" 'goto-line)
(global-set-key "\C-cr" 'rename-buffer)
(global-set-key "\C-cb" 'shell) ; b for bash
;; ==========
;; Functions.
;; current-time
(defun my-insert-current-time ()
(interactive)
(insert (current-time-string)))
;; ===========
; python mode
(setq auto-mode-alist
(cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
(cons '("python" . python-mode)
interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)
;================
; cscope in emacs
(require 'xcscope)
(define-key global-map [(control f3)] 'cscope-set-initial-directory)
(define-key global-map [(control f4)] 'cscope-unset-initial-directory)
(define-key global-map [(control f5)] 'cscope-find-this-symbol)
(define-key global-map [(control f6)] 'cscope-find-global-definition)
(define-key global-map [(control f7)]
'cscope-find-global-definition-no-prompting)
(define-key global-map [(control f8)] 'cscope-pop-mark)
(define-key global-map [(control f9)] 'cscope-next-symbol)
(define-key global-map [(control f10)] 'cscope-next-file)
(define-key global-map [(control f11)] 'cscope-prev-symbol)
(define-key global-map [(control f12)] 'cscope-prev-file)
(define-key global-map [(meta f9)] 'cscope-display-buffer)
(define-key global-map [(meta f10)] 'cscope-display-buffer-toggle)
--
Ricardo Anguiano
http://www.codesourcery.com