>Most of the people who have chimed in have mentioned they could live w/o the
>long compilation window at the bottom, but I've grown to like it.  When
>coding in java, source file path names tend to be long -
>/path/to/source/com/companyname/application/module/subpackage/FileToEdit.jav
>a - just the filename alone takes up 2/3 to 3/4 the width of my screen.
>Because of this I have

>(add-hook 'compilation-mode-hook #'(lambda () (setq truncate-lines nil)))

I have the following:

(defun line-wrap-toggle (&optional arg)
  "Toggle the line-wrap (line-truncate) function.
Covers (and equates) both horizontal and vertical splits.
If ARG > 0 then activate line-wrapping, if ARG < 0 then deactivate it. If
ARG is nil then toggle."
  (interactive "P")
  (if (and arg (numberp arg))
      (setq truncate-lines (if (> arg 0) t nil)))
  (setq truncate-lines (setq truncate-partial-width-windows (not
                                                             truncate-lines)))
  (recenter)
  (if (interactive-p)
      (message (if truncate-lines
                   "truncating lines (as '... $')"
                 "wrapping lines (as '...\\')")))
  )

(add-hook 'compilation-mode-hook #'(lambda () (line-wrap-toggle 1)))

>in my .emacs so I can see all of the error messages without having to scroll
>(I usually have truncate-lines set to t for all other modes).  (Aside of my
>own - auto-show-mode sometimes doesn't work in the ecb edit window, and
>turning truncate-lines off doesn't make the lines wrap - does anyone else
>see this behavior?)

No, with my setting above i have never seen this behavior.

>So, getting back to my point, I like being able to read more of the error
>message without having to follow the wrapped line off of the right side and
>continuing on the left.  Also other temp buffers, like *buffer-selection*
>view nicely for me with a long compile window.

For temp-buffers and or *Buffer-Selection* you can do:

(add-hook 'help-mode-hook #'(lambda () (line-wrap-toggle 1)))

This works for the command 'list-buffers:
(add-hook 'buffer-menu-mode-hook #'(lambda () (line-wrap-toggle 1)))

IMO each well designed mode which displays buffers like compilation, temp-buffers,
in general lists, where i can choose, click one should/must offer a hook which
is called after preparing the buffer.
In this hook you can always add the line-wrapping code!

In all other points you are right, in compilation-mode buffers and temp-buffers
all text should be readable without scrolling. But even with a window which has
the whole frame-width you will get java-compiler messages (errors and warnings)
which will exceed one line-length.

So, with *every* window-width your lines must be wrapped in such a window and IMHO
it doesn�t then really matter if the window has frame-width or something smaller.
With the three hooks i have described above you should always get line-wrapping
in a compilation output or a temp-buffer.

Therefore IMHO the compilation-window with whole frame-width is not really needed.
But of course this is a question of personal taste!

What do you think?

Klaus


Reply via email to