I have the following code(posted sometime ago in this list) in my
.emacs 
to complete words that are already used in another buffer with C-tab.

(require 'dabbrev) 
 (setq dabbrev-always-check-other-buffers t) 
 (setq dabbrev-abbrev-char-regexp "\\sw\\|\\s_") 
 (add-hook 'jde-mode-hook 
           '(lambda () 
              (local-set-key [C-Tab]     'my-tab) 
              (set (make-local-variable 'dabbrev-case-fold-search)
nil) 
              (set (make-local-variable 'dabbrev-case-replace) nil))) 
  
 (defun my-tab (&optional pre-arg) 
 "If preceeding character is part of a word then dabbrev-expand, 
 else if right of non whitespace on line then tab-to-tab-stop or 
 indent-relative, else if last command was a tab or return then dedent 
 one step, else indent 'correctly'" 
   (interactive "*P") 
   (cond ((= (char-syntax (preceding-char)) ?w) 
          (let ((case-fold-search t)) (dabbrev-expand pre-arg))) 
         ((> (current-column) (current-indentation)) 
          (indent-relative)) 
         (t (indent-according-to-mode))) 
   (setq this-command 'my-tab)) 
 
But it only works with .java-Files.
I want to know, if its possible to use the completion in other kind of
Files,
for example perl-Files.
Excuses, that this question hha nothing to do with JDE directly.

Gruse
Carsten

Reply via email to