Thanks for everyone's help with this. I'd like to get this "warning
face" working on columns > 80. I've tried this suggestion, but nothing
is happening. Below is my .emacs. If anyone can see anything wrong,
I'd appreciate the help. (I'm kind of a newbie with customizing my
emacs - have been using it "out of the box" for years, so sorry for
bother this list again) ...
;; required by jdee
(load-file "/usr/share/emacs/site-lisp/cedet-common/cedet.el")
;; for all modes
;; display column numbers
(setq column-number-mode t)
;; no more than 80 columns
(setq-default fill-column 80)
; Tell emacs to use sgml/xml mode for the following file types.
(setq auto-mode-alist
(append
'(("\\.wsdd" . xml-mode)
("\\.wsdl" . xml-mode)
("\\.xsl" . xml-mode)
("\\.xsd" . xml-mode))
auto-mode-alist))
(setq auto-mode-alist
(append '(("\.sgml$" . sgml-mode))
auto-mode-alist))
;; use xxml.el to get colors working in XML files
(autoload 'xxml-mode-routine "xxml")
(add-hook 'sgml-mode-hook 'xxml-mode-routine)
;; put all semantic.cache in same place
(setq semanticdb-default-save-directory "/home/mhansen/.semantic.d")
;; jdee customizations
(setq user-mail-address "[EMAIL PROTECTED]")
;; highlight (my warning face is red)
;; the part of lines that extend past 80 characters using this:
(defun my-font-lock-prepends (mode)
"Adds a 80 character line-width"
(font-lock-add-keywords
mode
'(("\\(.\\{80\\}\\)\\(.+\\)"
2 font-lock-warning-face prepend))))
(my-font-lock-prepends 'jde-mode)
;; mozilla as standard browser
(setq browse-url-default-browser "mozilla")
;; keyboard bindings like a PC
(pc-selection-mode)
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste
it!
;; Your init file should contain only one such instance.
'(auto-raise-tool-bar-buttons t t)
'(auto-resize-tool-bars t t)
'(auto-revert-mode nil t)
'(auto-save-file-format t t)
'(c-basic-offset 2)
'(c-ignore-auto-fill (quote (string cpp)))
'(case-fold-search t)
'(column-number-mode t)
'(current-language-environment "English")
'(debug-on-error nil)
'(debug-on-signal nil t)
'(debugger (quote debug) t)
'(edebug-all-defs nil t)
'(edebug-all-forms nil t)
'(fill-column 80)
'(generated-autoload-file "loaddefs.el" t)
'(global-font-lock-mode t nil (font-lock))
'(jde-ant-args "-emacs")
'(jde-ant-build-hook (quote (jde-compile-finish-kill-buffer
jde-compile-finish-refresh-speedbar
jde-compile-finish-flush-completion-cache)))
'(jde-ant-enable-find t)
'(jde-ant-home "$ANT_HOME")
'(jde-ant-program "/home/mhansen/bin/ant-jde")
'(jde-ant-read-target t)
'(jde-auto-parse-buffer-interval 60)
'(jde-auto-parse-max-buffer-size 500000)
'(jde-build-function (quote (jde-ant-build)))
'(jde-global-classpath (quote ("/mnt/z/book/build/classes")))
'(jde-sourcepath (quote ("/mnt/z/book/src" "/mnt/z/book/samples"
"/mnt/z/book/build/src")))
'(mouse-wheel-mode t nil (mwheel))
'(sgml-always-quote-attributes t t)
'(sgml-angle-distance 4000 t)
'(sgml-auto-activate-dtd nil t)
'(sgml-auto-insert-required-elements t t)
'(sgml-balanced-tag-edit t t)
'(sgml-buggy-subst-char-in-region nil t)
'(sgml-custom-markup nil t)
'(sgml-declaration nil t)
'(sgml-default-doctype-name nil t)
'(sgml-default-dtd-file nil t)
'(sgml-doctype nil t)
'(sgml-exposed-tags nil t)
'(sgml-general-insert-case (quote lower) t)
'(sgml-ignore-undefined-elements nil t)
'(sgml-indent-data nil t)
'(sgml-indent-step 2 t)
'(sgml-insert-defaulted-attributes nil t)
'(sgml-insert-end-tag-on-new-line nil t)
'(sgml-insert-missing-element-comment t t)
'(sgml-leave-point-after-insert nil t)
'(sgml-live-element-indicator nil t)
'(sgml-local-catalogs nil t)
'(sgml-local-ecat-files nil t)
'(sgml-max-menu-size 32 t)
'(sgml-minimize-attributes nil t)
'(sgml-namecase-general t t)
'(sgml-normalize-trims t t)
'(sgml-offer-save t t)
'(sgml-omittag t t)
'(sgml-omittag-transparent nil t)
'(sgml-parent-document nil t)
'(sgml-range-indicator-max-length 9 t)
'(sgml-recompile-out-of-date-cdtd (quote ask) t)
'(sgml-shorttag t t)
'(sgml-slash-distance 1000 t)
'(sgml-system-identifiers-are-preferred nil t)
'(sgml-tag-region-if-active nil t)
'(sgml-trace-entity-lookup nil t)
'(sgml-validate-command "nsgmls -e -g -s -u %s %s")
'(sgml-warn-about-undefined-elements t t)
'(sgml-warn-about-undefined-entities t t)
'(sgml-xml-declaration "/usr/share/sgml/declaration/xml.dcl" t)
'(sgml-xml-validate-command "/bin/sh xmlwf %s" t)
'(show-paren-mode t nil (paren))
'(speedbar-supported-extension-expressions (quote (".wy" ".by"
".[ch]\\(\\+\\+\\|pp\\|c\\|h\\|xx\\)?" ".tex\\(i\\(nfo\\)?\\)?" ".el"
".emacs" ".l" ".lsp" ".p" ".java" ".f\\(90\\|77\\|or\\)?" ".ada"
".p[lm]" ".tcl" ".m" ".scm" ".pm" ".py" ".g" ".s?html" ".ma?k"
"[Mm]akefile\\(\\.in\\)?" ".xml" ".properties" ".xsl" ".xslt")))
'(standard-indent 2)
'(transient-mark-mode t))
(custom-set-faces
;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
)
(put 'upcase-region 'disabled nil)
-- Mark
> -----Original Message-----
> From: Jeffrey Phillips [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 14, 2004 9:56 AM
> To: Mark D. Hansen
> Cc: [EMAIL PROTECTED]
> Subject: Re: Auto-format code to width <= 80
>
>
> Not sure about auto-format, but I highlight (my warning face is red)
> the part of lines that extend past 80 characters using this:
>
> (defun my-font-lock-prepends (mode)
> "Adds a 80 character line-width"
> (font-lock-add-keywords
> mode
> '(("\\(.\\{80\\}\\)\\(.+\\)"
> 2 font-lock-warning-face prepend))))
>
> (my-font-lock-prepends 'jde-mode)
>
> -jeffrey
>
> On Tue, 14 Dec 2004 09:01:20 -0500, Mark D. Hansen
> <[EMAIL PROTECTED]> wrote:
> > Can anyone tell me how to configure emacs/jde so that my
> java code will
> > auto-format to have column width 80?
> >
> > Thanks,
> >
> > Mark
> >
>