Hello Ole,
 I copied your code to my init.el file and getting the
following error when trying to use the method ( called
by M-x jde-indent-complete):

Signaling: (void-function mark-or-region-active)
  (mark-or-region-active)
  (if (mark-or-region-active) (indent-region (mark)
(point) nil) (if (save-excursion ... ...)
(indent-for-tab-command) (if ... ... ...)))
  (lambda nil "A special indent/complete function. I
calls three different\nfunctions depending on
context:\n\n- The region is active:\n        reindent
the region.\n\n- The point is in front of the text on
this line:\n        try to reindent the line. \n\n-
The point is directly after a dot character (\".\") or
in/at\n   the end of a word starting with a dot:\n    
   call `jde-complete'\n\n- Otherwise:\n        call
`hippie-expand'\n" (interactive) (if
(mark-or-region-active) (indent-region ... ... nil)
(if ... ... ...)))()
  call-interactively(jde-indent-complete)
  command-execute(jde-indent-complete t)
  execute-extended-command(nil)
  call-interactively(execute-extended-command)

--- Ole Arndt <[EMAIL PROTECTED]> wrote:
> 
> Hi Jeba, Hi Paul,
> 
> Paul Kinnucan <[EMAIL PROTECTED]> writes:
> > Jeba Bhaskaran writes:
> >  > I am currently using dabbrev-completion to
> complete
> >  > variable names in a Java buffer. How difficult
> would
> >  > it be to add this functionality to the JDE
> Complete
> >  > Menu function? For example, if there is a ".",
> then
> >  > the jde-complete-menu as it now would be called
> and if
> >  > a "." is not present then dabbrev-completion
> function
> >  > would be called. Can this be added to the wish
> list? 
> >  > 
> > 
> > This would be easy to do but I don't believe it is
> > the right thing to do. I don't see the point of
> calling
> > dabbrev to complete field and method names defined
> > or inherited by the class in the current buffer.
> > 
> > - Paul
> 
> I have a function `jde-indent-complete' which
> provides this
> functionality.
> 
> Instead of dabbrev-expand I use hippie-expand,
> because of the support
> semantic provides for it. Semantic automatically
> adds
> `senator-try-expand-semantic' to your
> `hippie-expand-try-functions-list'.
> This gives you local member name completion via
> semantic. If this fails,
> hippie-expand calls abbrev-expand and dabbrev-expand
> afterwards.
> For words with a dot in front `jde-complete' will be
> called.
> 
> I have bound this to function to TAB, so completion
> feels the same
> as in the shell and in the rest of emacs. I couldn't
> live without it :-)
> 
> The function has gone though various
> changes/optimizations as my elisp
> knowledge slowly grew from clueless to dilettante,
> here comes the
> current version:
> 
> (defun jde-indent-complete ()
>   "A special indent/complete function. I calls three
> different
> functions depending on context:
> 
> - The region is active:
>         reindent the region.
> 
> - The point is in front of the text on this line:
>         try to reindent the line. 
> 
> - The point is directly after a dot character
> (\".\") or in/at
>    the end of a word starting with a dot:
>         call `jde-complete'
> 
> - Otherwise:
>         call `hippie-expand'
> "
>   (interactive)
>   (if (mark-or-region-active)
>       (indent-region (mark) (point) nil)
>     (if (save-excursion (skip-chars-backward " \t")
> (bolp))
>       (indent-for-tab-command)
>       (if (not (equal major-mode 'jde-mode))
>         (hippie-expand 1)
>       (if (or (char-equal (char-before) ?.)
>               (save-excursion (backward-word 1) 
>                               (char-equal (char-before) ?.)))
>           (jde-complete)
>         (hippie-expand 1))))))
> 
> 
> ; you probably need this also:
> 
> (require 'hippie-exp)
> (setq hippie-expand-try-functions-list
>       '(try-expand-all-abbrevs
>       try-expand-dabbrev
>       try-expand-dabbrev-all-buffers
>       try-expand-dabbrev-from-kill))
> 
> 
> -- 
> Ole Arndt                    
> http://www.sugarshark.com
>
-------------------------------------------------------
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Reply via email to