displaying javadoc in separate frame [was: Re: jde + emacs-w3m problem]

2003-10-08 Thread Charles Sutton
On Wednesday, October 8, 2003, at 03:03  PM, Suraj Acharya wrote:

Is there a way to get the javadocs into a separate frame that gets 
reused?
Adding "*w3m*" to special-display-buffer-names did not do the trick.

Suraj

I have code that does this on my website at

  http://eksl.cs.umass.edu/~casutton/jde/w3m-javadoc.el

Cheers,

Charles

--
Charles Sutton
University of Massachusetts, Amherst
[EMAIL PROTECTED]
URL: http://www.cs.umass.edu/~casutton/


Re: jde + emacs-w3m problem

2003-10-08 Thread Suraj Acharya
Is there a way to get the javadocs into a separate frame that gets reused?
Adding "*w3m*" to special-display-buffer-names did not do the trick.
Suraj

Nick Sieger wrote:

"JC" == James Cox <[EMAIL PROTECTED]> writes:


JC> Hi Paul,
JC>  If I remember correctly, integration was pretty much a snap.
JC>  After
JC> installing emacs-w3m-1.3.4, and w3m 0.4.1, I needed to modify
JC> jde-file-to-url because there seemed to be some discrepancy in how
JC> jdee and w3m handle URL file notation.  (see previous email).  I
JC> also added:
JC> (setq browse-url-browser-function 'w3m-browse-url)

JC> to my .emacs.

Indeed, it was easy for me as well.  [Aside: I was also pleasantly
surprised that cygwin gcc handled w3m out of the box.  Guess I don't
realize just how good an emulation layer cygwin is.]
In addition to the above plus '(jde-help-use-frames nil), I added this
advice which causes the javadoc to jump up in another window.  Good
for javadoc, probably less so if you use emacs-w3m a lot for other
browsing.  There's probably a better way to do this from within the
JDEE, but for me it works great.
(defadvice w3m-browse-url (before
   njs-w3m-browse-url-new-window
   activate compile)
  "Always w3m-browse links in a new window."
  (ad-set-arg 1 t))





Re: jde + emacs-w3m problem

2003-10-06 Thread Katsumi Yamaoka
Hi,

> In [emacs-w3m : No.05886]
>   Paul Kinnucan <[EMAIL PROTECTED]> wrote:

> Hi Katsumi,

> I have succeeded in patching vm to work with emacs-w3m. It works
> very well.

Wonderful!  We are glad to hear that emacs-w3m can be used for
VM.

> I did have one problem, however, with emacs-w3m.  The function
> w3m-rendering-extract-title kept failing with an argument out of
> range error when attempting to delete the region containing the
> title. I believe the reason it fails is that the match data for the
> title string is invalidated by the subsequent call to
> w3m-decode-entities-string. This should not happen because
> w3m-decode-entities-string uses save-match-data to save and restore
> match data. However, it does happen.

That's weird.  The match-data function returns a copy of the
search result:

(with-temp-buffer
  (insert "a b")
  (goto-char (point-min))
  (search-forward "b" nil t)
  (eq (match-data) (match-data)))

It means two match-data are not identical Lisp objects even if
they are the same values.  And the save-match-data macro saves
and restores the return value of the match-data function, so I
think it is hard to destroy the saved value by performing setcar
or any other functions.  However, I found Kyle's comment in the
vm-save.el file:

  ;; It appears that get-buffer-create clobbers the match-data.

Although I may misread what Kyle really meant, we may have to
use save-match-data as follows if it generally occurs literally,
since the with-temp-buffer macro uses get-buffer-create:

(defun w3m-decode-entities-string (str)
  "Decode entities in the string STR."
  (save-match-data
(with-temp-buffer
  (insert str)
  (w3m-decode-entities)
  (buffer-string

However, I have not seen such a problem.  Does anyone know what
is happening?
-- 
Katsumi Yamaoka <[EMAIL PROTECTED]>


Re: jde + emacs-w3m problem

2003-10-05 Thread Paul Kinnucan
Katsumi Yamaoka writes:
 > 
 > I'm sorry to say that there is no person knowing VM well in the
 > emacs-w3m community.  Although Gnus, Wanderlust and Mew fully
 > support emacs-w3m.  If those who make the patch for VM appear,
 > we will highly appreciate.
 > 

Hi Katsumi,

I have succeeded in patching vm to work with emacs-w3m. It works
very well. I did have one problem, however, with emacs-w3m.
The function w3m-rendering-extract-title kept failing with
an argument out of range error when attempting to delete the
region containing the title. I believe the reason it fails
is that the match data for the title string is invalidated
by the subsequent call to w3m-decode-entities-string. This
should not happen because w3m-decode-entities-string uses
save-match-data to save and restore match data. However, it
does happen. The match data is not restored after the 
call to w3m-decode-entities-string. I fixed the problem by
the following change to w3m-rendering-extract-title: 

(defun w3m-rendering-extract-title ()
  "Extract the title from the half-dumped data in this buffer."
  (goto-char (point-min))
  (or (when (re-search-forward ""
   nil t)
;;; OLD ;
;;  (prog1 (w3m-decode-entities-string (match-string 1)
;;(delete-region (match-beginning 0) (match-end 0
;;

;;; NEW ;
(let* ((start (match-beginning 0))
   (end (match-end 0))
   (title (w3m-decode-entities-string (match-string 1
   (delete-region start end)
   title))
;
  (when (and (stringp w3m-current-url)
 (string-match "/\\([^/]+\\)/?\\'" w3m-current-url))
(match-string 1 w3m-current-url))
  ""))

With this small change, w3m-region renders vm mail buffers 
perfectly--at least on the few samples of HTML mail I've received
so far. 

Paul



Re: jde + emacs-w3m problem

2003-10-05 Thread Ole Arndt
Hi Paul, hi Jim, hi everyone,

Paul Kinnucan <[EMAIL PROTECTED]> writes:

> Hi James,
>
> Allowing JDEE users to browse javadoc, the JDK API, and the JDEE
> User's Guide from within Emacs sounds like a great idea. Perhaps I
> could build support into the JDEE for using w3m for this purpose and
> include a Windows binary of w3m in the JDEE distribution (and any
> other binaries users care to contribute).

I thought I comment on this because I use this combination for over a
year now and it works great. It is a very smooth experience to have
the javadoc in an emacs buffer. On Linux it ran out of the box, on
cygwin I had to make the same changes to jde-help.el James described.

There is no need to provide binaries for platforms other than
windows. There exists a w3m package/port for all distributions I know.
I don't know OS X, though.

> From your experience, what is necessary to configure Emacs to allow
> this capability?

because JDEE uses browse-url there isn't much need for configuration.
Just set the browse-url-browser-function to w3m-browse-url.  If you
prefer to view the javadoc in the `other-window' alongside the source
this function helps:

(defun w3m-browse-url-other-window (url &optional newwin)
  (interactive "s")
  (w3m-browse-url url t))

To browse only the Javadoc from JDEE in a new window and all other
urls in a full window (or in mozilla) you can set the
browse-url-browser-function to:

(setq browse-url-browser-function 
  '(("jde_meta" . w3m-browse-url-other-window)
(".*" . w3m-browse-url)
; or if you prefer:
;   (".*" . browse-url-mozilla)
))
 
Now every url containing "jde_meta" will be opened with
w3m-browse-url-other-window all others with w3m-browse-url (or
browse-url-mozilla).

I also want to recommend the cool w3m-type-ahead package by Matthew
P. Hodges. Very useful to jump to another class/method in the javadoc.

-- 
Ole Arndt http://www.sugarshark.com
---
After the last of 16 mounting screws has been removed from an access
cover, it will be discovered that the wrong access cover has been removed.



RE: jde + emacs-w3m problem

2003-10-04 Thread Nick Sieger
> "JC" == James Cox <[EMAIL PROTECTED]> writes:

JC> Hi Paul,
JC> If I remember correctly, integration was pretty much a snap.
JC> After
JC> installing emacs-w3m-1.3.4, and w3m 0.4.1, I needed to modify
JC> jde-file-to-url because there seemed to be some discrepancy in how
JC> jdee and w3m handle URL file notation.  (see previous email).  I
JC> also added:

JC> (setq browse-url-browser-function 'w3m-browse-url)

JC> to my .emacs.

Indeed, it was easy for me as well.  [Aside: I was also pleasantly
surprised that cygwin gcc handled w3m out of the box.  Guess I don't
realize just how good an emulation layer cygwin is.]

In addition to the above plus '(jde-help-use-frames nil), I added this
advice which causes the javadoc to jump up in another window.  Good
for javadoc, probably less so if you use emacs-w3m a lot for other
browsing.  There's probably a better way to do this from within the
JDEE, but for me it works great.

(defadvice w3m-browse-url (before
   njs-w3m-browse-url-new-window
   activate compile)
  "Always w3m-browse links in a new window."
  (ad-set-arg 1 t))



RE: jde + emacs-w3m problem

2003-10-04 Thread Nick Sieger
> "JC" == James Cox <[EMAIL PROTECTED]> writes:

JC> I had to modify jde-help.el.  I think w3m was choking on the file
JC> url - I believe that this was a problem with w3m, not jdee, so I
JC> never submitted this.

JC> I changed the line in jde-file-to-url from:
JC> (format "file://localhost/%s"
JC> to:
JC> (format "file:///%s"

JC> everything seemed to work fine after that...


JC> hope this helps someone, Jim

I did this too, except I simply redefined `jde-file-to-url' in my
.emacs.  Would it be straightforward to make that format string a user
variable?

Regards,
/Nick



RE: RE: jde + emacs-w3m problem

2003-10-03 Thread Jayakrishnan Nair
Here is something I saw few days back related to displaying
documentation using frames.

http://www.peerfear.org/rss/permalink/2003/09/23/FramePerformanceAndEmac
s/


-Original Message-
From: Pierre Gaston [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 03, 2003 5:19 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: RE: jde + emacs-w3m problem

>
>Hi James,
>
>Allowing JDEE users to browse javadoc, the JDK API, and the JDEE User's
Guide
>from within Emacs sounds like a great idea. Perhaps I could build
support
>into the JDEE for using w3m for this purpose and include a Windows
binary
>of w3m in the JDEE distribution (and any other binaries users care
>to contribute).
>
>From your experience, what is necessary to configure Emacs to allow
>this capability?
>
>Paul
>
Hi 

are you aware of this package :

* http://www.on.cs.keio.ac.jp/~maru/java-help/

Yet another browsing function browse-url-w3m is contained. It uses w3m,
a text-based nifty browser written by Akinori Ito, for formatting java
documents. w3m is fast and can render tables. You can browse java
documents in Emacs very quickly.

You can use this package with JDEE, with java-mode defined in cc-mode,
or independently.

Pierre.
PS (Paul sorry for the double post)



Re: RE: jde + emacs-w3m problem

2003-10-03 Thread Pierre Gaston
>
>Hi James,
>
>Allowing JDEE users to browse javadoc, the JDK API, and the JDEE User's Guide
>from within Emacs sounds like a great idea. Perhaps I could build support
>into the JDEE for using w3m for this purpose and include a Windows binary
>of w3m in the JDEE distribution (and any other binaries users care
>to contribute).
>
>From your experience, what is necessary to configure Emacs to allow
>this capability?
>
>Paul
>
Hi 

are you aware of this package :

* http://www.on.cs.keio.ac.jp/~maru/java-help/

Yet another browsing function browse-url-w3m is contained. It uses w3m, a text-based 
nifty browser written by Akinori Ito, for formatting java documents. w3m is fast and 
can render tables. You can browse java documents in Emacs very quickly.

You can use this package with JDEE, with java-mode defined in cc-mode, or 
independently.

Pierre.
PS (Paul sorry for the double post)



RE: jde + emacs-w3m problem

2003-10-02 Thread James Cox
Hi Paul,

If I remember correctly, integration was pretty much a snap.  After
installing emacs-w3m-1.3.4, and w3m 0.4.1, I needed to modify
jde-file-to-url because there seemed to be some discrepancy in how jdee and
w3m handle URL file notation.  (see previous email).  I also added:

(setq browse-url-browser-function 'w3m-browse-url)

to my .emacs.

One of the things I love about emacs is never having to leave my
editor for other tasks - (sql development and xml editing for example).  I
think it would be a great idea to allow users to browse javadoc from within
emacs, but it would be nice to maintain the old functionality as well.
Maybe a jdee-browse-url-browser-function?



> -Original Message-
> From: Paul Kinnucan [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 02, 2003 12:06 PM
> To: James Cox
> Cc: 'Jose A. Ortega Ruiz'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: jde + emacs-w3m problem
> 
> 
> James Cox writes:
>  > I don't think this is the same problem as Jose's, but...
>  > 
>  >  A few months ago, I was able to get jdee and w3m to play 
> nicely.  (I was
>  > able to browse a local javadoc from within emacs).  I was 
> using jdee
>  > 2.3.3beta2, emacs-w3m-1.3.4, and w3m 0.4.1.
>  > 
>  > I had to modify jde-help.el.  I think w3m was choking on 
> the file url - I
>  > believe that this was a problem with w3m, not jdee, so I 
> never submitted
>  > this.
>  > 
>  > I changed the line in jde-file-to-url from:
>  > (format "file://localhost/%s"
>  > to:
>  > (format "file:///%s"
>  > 
>  > everything seemed to work fine after that...
>  > 
> 
> Hi James,
> 
> Allowing JDEE users to browse javadoc, the JDK API, and the 
> JDEE User's Guide
> from within Emacs sounds like a great idea. Perhaps I could 
> build support
> into the JDEE for using w3m for this purpose and include a 
> Windows binary
> of w3m in the JDEE distribution (and any other binaries users care
> to contribute).
> 
> From your experience, what is necessary to configure Emacs to allow
> this capability?
> 
> Paul
> 
> 
> 
>  > 
>  > hope this helps someone,
>  > Jim
>  > 
>  > 
>  > > -Original Message-
>  > > From: Jose A. Ortega Ruiz [mailto:[EMAIL PROTECTED]
>  > > Sent: Thursday, October 02, 2003 10:01 AM
>  > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>  > > Subject: Re: jde + emacs-w3m problem
>  > > 
>  > > 
>  > > 
>  > > hi,
>  > > 
>  > > Paul Kinnucan <[EMAIL PROTECTED]> writes:
>  > > 
>  > > >
>  > > > Anyway, it looks like Jose's problem is either with the version
>  > > > of Emacs he is using or his setup.
>  > > >
>  > > hmmm... i don't think so: i can reproduce the problem 
> after invoking
>  > > emacs with the -q flag (i.e., avoiding that it reads my local
>  > > configuration). btw, i've got the problem with some sites (e.g.
>  > > slashdot.net), while not with others, but i've been 
> unable to discover
>  > > what is the offending item :(
>  > > 
>  > > thanks,
>  > > jao
>  > > -- 
>  > > The mind commands the body and the body obeys. The mind 
>  > > commands itself and
>  > > finds resistance. -St. Augustine (354-430)
>  > > 
>  > 
>  > 
>  > This E-mail message is for the sole use of the intended 
> recipient(s) and may
>  > contain confidential and privileged information.  Any 
> unauthorized review,
>  > use, disclosure or distribution is prohibited.  If you are 
> not the intended
>  > recipient, please contact the sender by reply E-mail, and 
> destroy all copies
>  > of the original message. 
>  > 
>  > 
> 


This E-mail message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information.  Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply E-mail, and destroy all copies
of the original message. 




Re: jde + emacs-w3m problem

2003-10-02 Thread Jose A . Ortega Ruiz

hi again,

i've found a (partial) solution to my problem: if i use w3mmee instead
of w3m, everything works fine.

i've been also stepping through the w3m-el code with edebug, and found
where the infinite loop raises:

when the page has a form, w3m-form-parse-and-fontify is eventually
called. it parses the buffer and, at a given point, looks for the
 tags and, inside them, the corresponding s. the
first one is found, and w3m-parse-attributes is invoked (w3m-form.el,
line 612). upon returning from this macro invocation (and only when
the backend is w3m) _the point has been positioned at the beginning of
the buffer_, and, therefore, the next search for an  tag
re-reads the first one ad infinitum. when the backend is w3mmee (or
jde has not been loaded), w3m-parse-attributes behaves as expected
(i.e., leaves point at the beginning of the _next_ .)

i don't know the cause of this strange behaviour, but maybe it will
ring a bell in the jde and/or w3m-el developers' minds :). my guess is
that, somehow, loading jde interferes with the regexps used by
w3m-el/w3m to find the form tags...

anyway, thanks a lot for two great pieces of software!

cheers,
jao
-- 
You give but little when you give of your possessions. It is when you give
of yourself that you truly give.
-Kahlil Gibran, mystic, poet and artist (1883-1931)


RE: jde + emacs-w3m problem

2003-10-02 Thread Paul Kinnucan
James Cox writes:
 > I don't think this is the same problem as Jose's, but...
 > 
 >  A few months ago, I was able to get jdee and w3m to play nicely.  (I was
 > able to browse a local javadoc from within emacs).  I was using jdee
 > 2.3.3beta2, emacs-w3m-1.3.4, and w3m 0.4.1.
 > 
 > I had to modify jde-help.el.  I think w3m was choking on the file url - I
 > believe that this was a problem with w3m, not jdee, so I never submitted
 > this.
 > 
 > I changed the line in jde-file-to-url from:
 > (format "file://localhost/%s"
 > to:
 > (format "file:///%s"
 > 
 > everything seemed to work fine after that...
 > 

Hi James,

Allowing JDEE users to browse javadoc, the JDK API, and the JDEE User's Guide
from within Emacs sounds like a great idea. Perhaps I could build support
into the JDEE for using w3m for this purpose and include a Windows binary
of w3m in the JDEE distribution (and any other binaries users care
to contribute).

>From your experience, what is necessary to configure Emacs to allow
this capability?

Paul



 > 
 > hope this helps someone,
 > Jim
 > 
 > 
 > > -Original Message-
 > > From: Jose A. Ortega Ruiz [mailto:[EMAIL PROTECTED]
 > > Sent: Thursday, October 02, 2003 10:01 AM
 > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 > > Subject: Re: jde + emacs-w3m problem
 > > 
 > > 
 > > 
 > > hi,
 > > 
 > > Paul Kinnucan <[EMAIL PROTECTED]> writes:
 > > 
 > > >
 > > > Anyway, it looks like Jose's problem is either with the version
 > > > of Emacs he is using or his setup.
 > > >
 > > hmmm... i don't think so: i can reproduce the problem after invoking
 > > emacs with the -q flag (i.e., avoiding that it reads my local
 > > configuration). btw, i've got the problem with some sites (e.g.
 > > slashdot.net), while not with others, but i've been unable to discover
 > > what is the offending item :(
 > > 
 > > thanks,
 > > jao
 > > -- 
 > > The mind commands the body and the body obeys. The mind 
 > > commands itself and
 > > finds resistance. -St. Augustine (354-430)
 > > 
 > 
 > 
 > This E-mail message is for the sole use of the intended recipient(s) and may
 > contain confidential and privileged information.  Any unauthorized review,
 > use, disclosure or distribution is prohibited.  If you are not the intended
 > recipient, please contact the sender by reply E-mail, and destroy all copies
 > of the original message. 
 > 
 > 



RE: jde + emacs-w3m problem

2003-10-02 Thread James Cox
I don't think this is the same problem as Jose's, but...

 A few months ago, I was able to get jdee and w3m to play nicely.  (I was
able to browse a local javadoc from within emacs).  I was using jdee
2.3.3beta2, emacs-w3m-1.3.4, and w3m 0.4.1.

I had to modify jde-help.el.  I think w3m was choking on the file url - I
believe that this was a problem with w3m, not jdee, so I never submitted
this.

I changed the line in jde-file-to-url from:
(format "file://localhost/%s"
to:
(format "file:///%s"

everything seemed to work fine after that...


hope this helps someone,
Jim


> -Original Message-
> From: Jose A. Ortega Ruiz [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 02, 2003 10:01 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: jde + emacs-w3m problem
> 
> 
> 
> hi,
> 
> Paul Kinnucan <[EMAIL PROTECTED]> writes:
> 
> >
> > Anyway, it looks like Jose's problem is either with the version
> > of Emacs he is using or his setup.
> >
> hmmm... i don't think so: i can reproduce the problem after invoking
> emacs with the -q flag (i.e., avoiding that it reads my local
> configuration). btw, i've got the problem with some sites (e.g.
> slashdot.net), while not with others, but i've been unable to discover
> what is the offending item :(
> 
> thanks,
> jao
> -- 
> The mind commands the body and the body obeys. The mind 
> commands itself and
> finds resistance. -St. Augustine (354-430)
> 


This E-mail message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information.  Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply E-mail, and destroy all copies
of the original message. 




Re: jde + emacs-w3m problem

2003-10-02 Thread Jose A . Ortega Ruiz

hi,

Paul Kinnucan <[EMAIL PROTECTED]> writes:

>
> Anyway, it looks like Jose's problem is either with the version
> of Emacs he is using or his setup.
>
hmmm... i don't think so: i can reproduce the problem after invoking
emacs with the -q flag (i.e., avoiding that it reads my local
configuration). btw, i've got the problem with some sites (e.g.
slashdot.net), while not with others, but i've been unable to discover
what is the offending item :(

thanks,
jao
-- 
The mind commands the body and the body obeys. The mind commands itself and
finds resistance. -St. Augustine (354-430)


Re: jde + emacs-w3m problem

2003-10-02 Thread Jose A . Ortega Ruiz

hello,

Katsumi Yamaoka <[EMAIL PROTECTED]> writes:

> Hello,
>
> Unfortunately, it seems very hard for me to begin to use JDE.
> It requires SEMANTIC, EIEIO..., what is avltree? Hmm...  Can
> anyone help it?  Otherwise, if you can get the Lisp backtrace,
> someone may possibly be able to solve the problem.  To do that:
>
> Evaluate the following form:
>
> (setq debug-on-quit t)
>
> Type the C-g key when Emacs hangs.
>

unfortunately, emacs hangs so bad that it does not respond to C-g: i
have to kill it sending a signal from a term with killall. but then,
emacs exits immediately without a trace. is there a signal i could use
that prevents emacs from exiting?

thanks for your help,
jao
-- 
He will always be a slave who does not know how to live upon a little.
-Horace, poet and satirist (65-8 BCE)


Re: jde + emacs-w3m problem

2003-10-02 Thread Katsumi Yamaoka
> In [emacs-w3m : No.05856]
>   Paul Kinnucan <[EMAIL PROTECTED]> wrote:

> Ohaiyogozaimas Yamaoka-san,

Thanks for your Japanese greeting.  I was a bit surprised. :)

> I just got done compiling w3m under cygwin, installing emacs-w3m,
> browsing the JDEE website and downloading the latest version of the
> JDEE inside Emacs 21.3.1 on Windows (after loading a Java source
> file). No problem...and very sweet.

That's good to hear.

> Now I want to see if I can use emacs-w3m to read HTML-encoded email
> inside vm.

I'm sorry to say that there is no person knowing VM well in the
emacs-w3m community.  Although Gnus, Wanderlust and Mew fully
support emacs-w3m.  If those who make the patch for VM appear,
we will highly appreciate.

> Anyway, it looks like Jose's problem is either with the version
> of Emacs he is using or his setup.

> Arigatogozaimas.

> Paul

Thanks again,
-- 
Katsumi Yamaoka <[EMAIL PROTECTED]>