ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nascif A. Abousalh Neto" <nas...@acm.org>
Subject RE: Where is Antidote? - try emacs for now
Date Wed, 06 Feb 2002 23:21:13 GMT
I use plain sgml-mode, I like the syntax coloring and indentation resources better.

Anyway, because I also could not remember all the options for the Ant tasks/types, I created
a small hack to create a simple "context-sensitive" help based 
on the keyword under point (the command is called jde-ant-manual-find-tag).

It assumes that the Ant User Manual is installed on the current machine in its regular place.
It wouldn't be hard to extend it to point to the version on the web.

Still needs to be refined for the Optional Tasks (names don't map nicely to html files) and
to handle anchors (need to copy code from jde-help.el)

Enjoy!

;; ------------------------------------------------------------
; Provides context help for Ant task and core types 
; (using local Ant HTML manual)
(defvar jde-ant-manual-sections
  '(("CoreTasks" 
     ("ant"
      "antcall"
      "antstructure"
      "apply"
      "available"
      "chmod"
      "common"
      "condition"
      "copy"
      "copydir"
      "copyfile"
      "cvs"
      "cvspass"
      "delete"
      "deltree"
      "dependset"
      "ear"
      "echo"
      "exec"
      "fail"
      "filter"
      "fixcrlf"
      "genkey"
      "get"
      "gunzip"
      "gzip"
      "jar"
      "java"
      "javac"
      "javadoc"
      "mail"
      "mkdir"
      "move"
      "overview"
      "parallel"
      "patch"
      "pathconvert"
      "property"
      "recorder"
      "rename"
      "replace"
      "rmic"
      "sequential"
      "signjar"
      "sleep"
      "sql"
      "style"
      "tar"
      "taskdef"
      "touch"
      "tstamp"
      "typedef"
      "untar"
      "unzip"
      "uptodate"
      "war"
      "zip"))
    ("CoreTypes" 
     ("description"
      "filelist"
      "fileset"
      "filterset"
      "mapper"
      "patternset"))
    ("OptionalTasks" 
     ("BorlandEJBTasks"
      "BorlandGenerateClient"
      "antlr"
      "cab"
      "ccm"
      "clearcase"
      "depend"
      "dotnet"
      "ejb"
      "ftp"
      "icontract"
      "javacc"
      "javah"
      "jdepend"
      "jjtree"
      "jlink"
      "jpcoverage"
      "junit"
      "junitreport"
      "maudit"
      "mimemail"
      "mmetrics"
      "mparse"
      "native2ascii"
      "netrexxc"
      "perforce"
      "propertyfile"
      "pvcstask"
      "renameextensions"
      "rpm"
      "script"
      "sound"
      "starteam"
      "stylebook"
      "telnet"
      "test"
      "vss"
      "wljspc"
      "xmlvalidate"))
    (("using" "buildfile")
     ("project"))
    (("using" "path")
     ("classpath"
      "path"
      "pathelement"))
    (("using" "references")
     ("refid"
      "id"))))

(defun jde-ant-manual-find-section (tag sections)
  (if sections
      (if (member tag (cadar sections))
          (caar sections)
        (jde-ant-manual-find-section tag (cdr sections)))))

(defun build-ant-manual-url (ant-manual-section)
  (concat 
   "file://localhost/"
   (if (string= "" jde-ant-home)
       (jde-normalize-path (getenv "ANT_HOME"))
     (jde-normalize-path jde-ant-home)) 
   "/docs/manual/"
   (if (atom ant-manual-section)
     (concat ant-manual-section "/" tag ".html")
     ; not working, check JDE mailing list
     (concat (car ant-manual-section) ".html#" (cadr ant-manual-section)))))
    
(defun jde-ant-manual-find-tag (tag)
  (interactive (list (read-string "tag: " (current-word))))
  (let ((ant-manual-section (jde-ant-manual-find-section (downcase tag) jde-ant-manual-sections)))
    (if ant-manual-section
        (browse-url (build-ant-manual-url ant-manual-section))
      (message "unkonwn tag"))))




--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message