help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Emacs as an IDE


From: Thorsten Bonow
Subject: Re: Emacs as an IDE
Date: Tue, 16 Oct 2007 00:33:57 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.20 (linux)

>>>>> "Richard" == Richard G Riley <Richard> writes:

    [...]

    >> If you are interested, I can post my setup here, but be warned: there are
    >> a lot of settings related to cedet and ecb, and I have no time to sort
    >> everything superflous for your problem out.
    >>
    >> Toto

    Richard> Please do.

Here it comes; you have been warned :-)

Feel free to ask questions... I hope I have more time in the next days...

Toto

;; ** cedet and ecb
(defvar my-cedet-directory
  (concat "~" init-file-user "/elisp/" "emacs/" "cedet-1.0pre3")
  "Directory where cedet is installed.")
(if (not (file-exists-p my-cedet-directory))
    (message "Not loading cedet...")
  (message "Loading cedet...")
  ;; Load CEDET
  ;; (setq semantic-load-turn-useful-things-on t)
  (load-file (concat my-cedet-directory "/common/" "cedet.elc"))
  ;; Enabling various SEMANTIC minor modes.  See semantic/INSTALL for more 
ideas.
  ;; Select one of the following
  (semantic-load-enable-code-helpers)
  ;; (semantic-load-enable-guady-code-helpers)
  ;; (semantic-load-enable-excessive-code-helpers)
  (if (file-exists-p "/var/tmp/semantic")
      (setq semanticdb-default-save-directory "/var/tmp/semantic")
    (message "/var/tmp/semantic directory does not exist!"))
  ;; ECB
  (defvar my-ecb-directory
    (concat "~" init-file-user "/elisp/" "emacs/" "ecb-2.32")
    "Directory where cedet is installed.")
  (if (not (file-exists-p my-ecb-directory))
      (message "Not loading ECB...")
    (message "Loading ECB...")
    (add-to-list 'load-path my-ecb-directory)
    (require 'ecb)
    (setq ecb-tip-of-the-day nil)
    (set-face-background 'ecb-tag-header-face "brown")
    (set-face-background 'ecb-default-highlight-face "maroon")
    ;; *** my-ecb-goto-other-edit-window
    ;; bound to viper macro "ESC ee"
    (defun my-ecb-goto-other-edit-window ()
      "Call ecb-goto-window-edit2, if that returns nil,
call ecb-goto-window-edit1."
      (interactive)
      (if (ecb-goto-window-edit2)
          ()
        (ecb-goto-window-edit1)))
    ;; *** solve incompatibilities of ecb with other packages
    ;; **** ecb and partial windows
  (setq truncate-partial-width-windows nil)
  ;; **** ecb and calendar
  (add-hook 'initial-calendar-window-hook
            (function (lambda ()
                        (or (one-window-p t)
                            (/= (frame-width) (window-width))
                            (and ecb-minor-mode (ecb-point-in-edit-window)))
                        (shrink-window (- (window-height) 9)))))
  ;; **** ecb and calculator (not calc)
  (setq calculator-electric-mode t)
  ;; **** ecb and calc
  (defvar my-ecb-windows-hidden-for-calc nil
    "Indicate if ECB windows were visible before `calc' was called.")
  (defun my-ecb-calc-adapt ()
    "This defun hides ECB windows if ECB is active and
ECB windows are not hidden. Only to be called by advice to `calc' function."
    (if (equal ecb-minor-mode nil)
        (setq my-ecb-windows-hidden-for-calc nil)
      (ecb-deactivate)
      (setq my-ecb-windows-hidden-for-calc t)))
  (defun my-ecb-calc-quit-adapt ()
    "This defun unhides ECB windows if ECB is active and
ECB windows are hidden and my-ecb-windows-hidden-for-calc is t.
Only to be called by advice to `calc-quit'."
    (if (equal my-ecb-windows-hidden-for-calc t)
        (ecb-activate)))
  (defadvice calc (before my-ecb-calc-advise)
    "Delete other windows and hide ECB windows before running `calc'."
    (delete-other-windows)
    (my-ecb-calc-adapt))
  (defadvice calc-quit (after my-ecb-calc-quit-advise)
    "Restore ECB windows when quitting `calc' if necessary."
    (my-ecb-calc-quit-adapt))
  (ad-activate 'calc)
  (ad-activate 'calc-quit)
  ;; **** ecb and mew
  (defvar my-ecb-windows-hidden-for-mew nil
    "Indicate if ECB windows were visible before `mew' was called.")
  (defun my-ecb-mew-adapt ()
    "This defun hides ECB windows if ECB is active and
ECB windows are not hidden. Only to be called by advice to `mew' function."
    (if (equal ecb-minor-mode t)
        (if (equal ecb-frame (selected-frame))
            (if (equal ecb-windows-hidden t)
                (setq my-ecb-windows-hidden-for-mew nil)
              (ecb-toggle-ecb-windows)
              (setq my-ecb-windows-hidden-for-mew t)))))
  (defun my-ecb-mew-summary-suspend-or-quit-adapt ()
    "This defun unhides ECB windows if ECB is active and
ECB windows are hidden and my-ecb-windows-hidden-for-mew is t.
Only to be called by advice to `mew-summary-suspend' or `mew-summary-quit'."
    (if (equal ecb-minor-mode t)
        (if (equal ecb-frame (selected-frame))
            (if (equal ecb-windows-hidden t)
                (if (equal my-ecb-windows-hidden-for-mew t)
                    (ecb-toggle-ecb-windows)))))
    (setq my-ecb-windows-hidden-for-mew nil))
  (defadvice mew (before my-ecb-mew-advise)
    "Delete other windows and hide ECB windows before running `mew'."
    (delete-other-windows)
    (my-ecb-mew-adapt))
  (defadvice mew-summary-suspend (after my-ecb-mew-summary-suspend-advise)
    "Restore ECB windows when suspending `mew-summary' if necessary."
    (my-ecb-mew-summary-suspend-or-quit-adapt))
  (defadvice mew-summary-quit (after my-ecb-mew-summary-quit-advice)
    "Restore ECB windows when quitting `mew-summary' if necessary."
    (my-ecb-mew-summary-suspend-or-quit-adapt))
  (ad-activate 'mew)
  (ad-activate 'mew-summary-suspend)
  (ad-activate 'mew-summary-quit)
  ;; *** ecb customization
  (setq ecb-process-non-semantic-files t)
  (setq ecb-fix-window-size 'auto)
  (setq ecb-layout-name "left3")
  (setq ecb-toggle-layout-sequence '("leftright1" "left3"))
  (cond ((string-match "herrrossi" (system-name))
         (setq ecb-windows-width 0.20)
         )
        ((string-match "gastone" (system-name))
         (setq ecb-windows-width 0.31)
         ))
  (add-hook 'ecb-activate-hook
            (lambda ()
              'vc-delete-logbuf-window nil))
  (add-hook 'ecb-deactivate-hook
            (lambda ()
              'vc-delete-logbuf-window t))
  (defun my-ecb-toggle-ecb-windows()
    "Call `ecb-toggle-ecb-windows' or `ecb-activate' if ECB has not been
  activated before."
    (interactive)
    (if (equal ecb-minor-mode t)
        (ecb-toggle-ecb-windows)
      (ecb-activate)))
  (global-set-key [f3] 'my-ecb-toggle-ecb-windows)
  (global-set-key [S-f3] 'ecb-toggle-layout)
  ))


-- 
Contact information and PGP key at
http://www-users.rwth-aachen.de/thorsten.bonow

It was Christmas Eve and all the salamis in the window of the
Carnegie Deli had been hung with care. It was two o'clock in the
morning and I was drifting by the window like a secular ghost in
the rain when suddenly, between two salamis, I saw something that
made me stop on a dime and pick it up.

Kinky Friedman: Musical Chairs


reply via email to

[Prev in Thread] Current Thread [Next in Thread]