Hello
I would like my TAB to do different things according to the position of
the curser, the best way to express the desired behavoir would be this
java code.
if (course before any code) {
indent-relative (1)
} else if(course at a place where jde-complete-at-point makes sence) {
jde-complemte-at-point (2)
} else {
Tab completion of variable and class names etc...(3)
}
I have support for (1) and (3) in my .emacs (se below) file, but how do I
make jde use jde-complete-at-point whenever it makes sence (ie. the
preceding word contains a '.')?
T2
;; =============== Tab-completion of methods, variables... ===============
;;================Found somewhere on the net=============================
(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-i" '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))
Info: emacs 20.7.1@redhat 7.0 jde-2.2.6beta3