about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-07-10 14:21:26 +0000
committerLudovic Courtès <ludo@gnu.org>2009-07-10 14:21:26 +0000
commit059ffb766ee6186ac7ab8205f45545fb8f62b244 (patch)
treedb21a190a534c18babaab602e590a7bbf67a2f3d /pkgs
parent5c7cc2ffdb7b5d177aa306f314ce5deebcb7fe2e (diff)
downloadnixlib-059ffb766ee6186ac7ab8205f45545fb8f62b244.tar
nixlib-059ffb766ee6186ac7ab8205f45545fb8f62b244.tar.gz
nixlib-059ffb766ee6186ac7ab8205f45545fb8f62b244.tar.bz2
nixlib-059ffb766ee6186ac7ab8205f45545fb8f62b244.tar.lz
nixlib-059ffb766ee6186ac7ab8205f45545fb8f62b244.tar.xz
nixlib-059ffb766ee6186ac7ab8205f45545fb8f62b244.tar.zst
nixlib-059ffb766ee6186ac7ab8205f45545fb8f62b244.zip
JDEE: Fix `jde-help-find-javadoc'.
svn path=/nixpkgs/trunk/; revision=16319
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/editors/emacs-modes/jdee/default.nix1
-rw-r--r--pkgs/applications/editors/emacs-modes/jdee/jde-help-find-javadoc.patch46
2 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/applications/editors/emacs-modes/jdee/default.nix b/pkgs/applications/editors/emacs-modes/jdee/default.nix
index 8983b6d210e2..0ea68d4d7425 100644
--- a/pkgs/applications/editors/emacs-modes/jdee/default.nix
+++ b/pkgs/applications/editors/emacs-modes/jdee/default.nix
@@ -18,6 +18,7 @@ in
     patches = [
       ./installation-layout.patch ./cedet-paths.patch ./elib-avltree.patch
       ./java-directory.patch ./jde-directory-files-recurs.patch
+      ./jde-help-find-javadoc.patch
     ];
 
     configurePhase = ''
diff --git a/pkgs/applications/editors/emacs-modes/jdee/jde-help-find-javadoc.patch b/pkgs/applications/editors/emacs-modes/jdee/jde-help-find-javadoc.patch
new file mode 100644
index 000000000000..8746a5687a77
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/jdee/jde-help-find-javadoc.patch
@@ -0,0 +1,46 @@
+Fix `jde-help-find-javadoc' so that it correctly infers whether
+an HTML page exists.
+
+Previously it would consider that Wget succeeded if its output
+contained the string "200".  This doesn't work as Wget's output
+starts with something like:
+
+  --2009-07-10 16:15:37--  http://java.sun.com/javase/6/docs/api/foobar
+
+This patch makes it check the exit code of Wget instead, which is
+more reliable.
+
+--- jde/lisp/jde-help.el	(revision 90)
++++ jde/lisp/jde-help.el	(working copy)
+@@ -138,7 +138,7 @@ one of the the sites in `jde-help-docset
+ 		 (const :tag "Disable timeout checking" :value 0)
+                  (integer :tag "Timeout (seconds)" :value 900)))
+ 
+-(defcustom jde-help-wget-command-line-options nil
++(defcustom jde-help-wget-command-line-options "--quiet"
+   "Specifies additional options (beyond --spider, --tries and
+ --timeout) to pass to wget, if wget is used for
+ `jde-help-remote-file-exists-function'."
+@@ -208,18 +208,15 @@ to verify the existence of pages located
+ 	    (error "Cannot find url-file-exists function"))
+         (if (executable-find 
+ 	     (if (eq system-type 'windows-nt) "wget.exe" "wget"))
+-            (if (not
+-                 (string-match
+-                  "200"
+-                  (shell-command-to-string
+-                   (concat "wget --spider "
++	    (let ((cmd (concat "wget --spider "
+ 			   (if jde-help-wget-tries
+ 			       (concat "--tries=" jde-help-wget-tries))
+ 			   (if jde-help-wget-timeout
+ 			       (concat "--timeout=" jde-help-wget-timeout))
+ 			   jde-help-wget-command-line-options
+-			   " " url))))
+-                (setq url nil))
++			       " " url)))
++	      (unless (= 0 (shell-command cmd))
++		(setq url nil)))
+           (error
+            (concat "Cannot find wget. This utility is needed "
+                    "to access javadoc on remote systems.")))))