At 12:14 AM 2/11/00 -0800, you wrote:
>Hi, Paul,
>
>Much obliged for the reply.
>
>Would you be willing to look at my .emacs file. It's short:
>
>-------
>
>(setq load-path (nconc '("~/emacs/site") load-path))
>
>;(pc-selection-mode) 
>;(load "cua-mode")
>;(CUA-mode t) 
>
>(setq binary-process-input t)
>          (setq w32-quote-process-args ?\")
>          (setq shell-file-name "bash")
>          (setenv "SHELL" shell-file-name)
>          (setq explicit-shell-file-name shell-file-name)
>          (setq explicit-sh-args '("-login" "-i"))
>
>(setq load-path (nconc '("~/emacs/site/jde-2.1.5") load-path))
>
>(require 'jde)
>
>
>(setq scroll-step 1)
>(delete-selection-mode t)
>(setq next-line-add-newlines nil)
>(custom-set-variables
> '(jde-build-use-make t)
> '(jde-jdk-doc-url "file:///C|/jdk1.2.2/docs/index.html")
> '(jde-enable-abbrev-mode t))
>(custom-set-faces)
>
>(defun my-jde-mode-hook ()
>        (c-add-style
>          "my-java"
>          '("java"
>           (c-basic-offset . 2)
>        (c-set-style "my-java"))
>
>      (add-hook 'jde-mode-hook 'my-jde-mode-hook)
>
>-----
>
>This last bit is what I copied and pasted out of the FAQ. 
>
>How would you determine whether the hook was being executed, 
>other than observing that when I edit .java files, the indent size is 4?
>

Amend your hook function to read as follows:

(defun my-jde-mode-hook ()
   (message "my-jde-mode-hook executed.")
        (c-add-style
         "my-java"
         '("java"
           (c-basic-offset . 2)
        (c-set-style "my-java"))

After opening a Java source buffer, look in your *messages* buffer and
see if the hook function left its trace.

>And if I conclude that the hook isn't being executed, how would I 
>cause it to be executed?
>

The hook function is the last thing the jde-mode function executes. If
jde-mode
is interrupted by an error before it runs to completion, the hook function
never
gets executed and hence the indent variable is never set locally in the
buffer.
So the first thing to do is to ensure that jde-mode runs to completion. The 
easiest way to do this is to put the following

;; Set the debug option when there is trouble...
(setq debug-on-error t)

at the head of your .emacs file. Also look for error messages in your
*messages* buffer
after opening a Java source file.

BTW, you should download JDE 2.1.6beta. It has a ton of new features. It is
beta only
because its major new feature, *JDEbug*, is not complete.

- Paul

Reply via email to