diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-2011-02-12  Jude Nagurney  <jude@pwan-central>
+2011-04-07  Jude Nagurney  <jude@pwan.org>
+
+	* Released version 0.4.0
+	* Added aug_span API support
+
+2011-02-12  Jude Nagurney  <jude@pwan.org>
 
 	* Released version 0.3.5
 	* Updated source comment heads to refer to LGPL instead of GPL.
diff --git a/Config.h.in b/Config.h.in
--- a/Config.h.in
+++ b/Config.h.in
@@ -51,6 +51,9 @@
 /* Augeas library has the aug_setm function. */
 #undef HAS_AUGEAS_SETM
 
+/* Augeas library has the aug_span function. */
+#undef HAS_AUGEAS_SPAN
+
 /* Define to 1 if you have the <augeas.h> header file. */
 #undef HAVE_AUGEAS_H
 
diff --git a/HUnitAug.hs b/HUnitAug.hs
--- a/HUnitAug.hs
+++ b/HUnitAug.hs
@@ -50,7 +50,7 @@
 --  assertEqual "Should get Nothing after a bad root" Nothing aug_ptr)
 with_augptr :: (Ptr Augeas -> IO ()) -> IO ()
 with_augptr func = do cwd <- getCurrentDirectory
-                      maybe_aug_ptr <- aug_init (Data.ByteString.Char8.pack (cwd++"/testroot")) empty [save_newfile]
+                      maybe_aug_ptr <- aug_init (Data.ByteString.Char8.pack (cwd++"/testroot")) empty [save_newfile, enable_span]
                       case maybe_aug_ptr of
                         Nothing -> assertFailure "aug_ptr shouldn't be nothing in with_augptr"
                         Just aug_fp -> (withForeignPtr aug_fp $ \aug_ptr -> func aug_ptr)
@@ -228,6 +228,82 @@
                              )
 #endif
 
+-- --------------
+-- aug_setm tests
+-- --------------
+#ifdef HAS_AUGEAS_SETM
+testBadBaseSetm :: Test
+testBadBaseSetm = TestCase ( with_augptr $ \aug_ptr -> do
+
+                        ret_setm <- aug_setm aug_ptr (Data.ByteString.Char8.pack "badbase") (Just (Data.ByteString.Char8.pack "sub")) (Data.ByteString.Char8.pack "value")
+                        assertEqual "testBadBaseSetm (1)" (AugRet 0) ret_setm
+
+                    )
+
+testBadPathSetm :: Test
+testBadPathSetm = TestCase ( with_augptr $ \aug_ptr -> do
+
+                        ret_setm <- aug_setm aug_ptr (Data.ByteString.Char8.pack "/") (Just (Data.ByteString.Char8.pack "/blah/*/blah/**")) (Data.ByteString.Char8.pack "value")
+                        assertEqual "testBadPathSetm (1)" (AugRet (-1)) ret_setm
+
+                    )
+
+testSetm :: Test
+testSetm = TestCase ( with_augptr $ \aug_ptr -> do
+
+                        ret_set <- aug_set aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical") (Data.ByteString.Char8.pack "haskell-augeas.org")
+                        assertEqual "set OK" success ret_set
+
+                        ret_setm <- aug_setm aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical") (Just (Data.ByteString.Char8.pack "sub/1")) (Data.ByteString.Char8.pack "value")
+                        assertEqual "testSetm (1)" (AugRet 1) ret_setm
+
+                        ret_get <- aug_get aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/1")
+                        assertEqual "set OK" (Right (Just "value")) ret_get
+
+                        ret_setm2 <- aug_setm aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/1") Nothing (Data.ByteString.Char8.pack "value2")
+                        assertEqual "testSetm (2)" (AugRet 1) ret_setm2
+
+                        ret_get2 <- aug_get aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/1")
+                        assertEqual "set OK" (Right (Just "value2")) ret_get2
+
+                        ret_setm3 <- aug_setm aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical") (Just (Data.ByteString.Char8.pack "sub/2")) (Data.ByteString.Char8.pack "value3")
+                        assertEqual "testSetm (3)" (AugRet 1) ret_setm3
+
+                        ret_get3 <- aug_get aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/2")
+                        assertEqual "set OK" (Right (Just "value3")) ret_get3
+
+                        ret_setm4 <- aug_setm aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/*") Nothing (Data.ByteString.Char8.pack "value4")
+                        assertEqual "testSetm (4)" (AugRet 2) ret_setm4
+
+                        ret_get4 <- aug_get aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/1")
+                        assertEqual "set OK" (Right (Just "value4")) ret_get4
+
+                        ret_get5 <- aug_get aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/2")
+                        assertEqual "set OK" (Right (Just "value4")) ret_get5
+
+
+                    )
+#endif
+
+-- --------------
+-- aug_span tests
+-- --------------
+#ifdef HAS_AUGEAS_SPAN
+
+testSpanNoFile :: Test
+testSpanNoFile = TestCase (with_augptr $ \aug_ptr -> do
+                        ret_span <- aug_span aug_ptr (Data.ByteString.Char8.pack "/files/etc/missing")
+                        assertEqual "Missing file span test" Nothing ret_span
+                        )
+
+testSpan :: Test
+testSpan = TestCase (with_augptr $ \aug_ptr -> do
+                        cwd <- getCurrentDirectory
+                        ret_span <- aug_span aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts")
+                        assertEqual "Normal span test" (Just (cwd ++ "/testroot/etc/hosts", 0, 0, 0, 0, 0, 290)) ret_span
+                        )
+#endif 
+
 -- ----------------
 -- aug_insert tests
 -- ----------------
@@ -505,65 +581,10 @@
 #endif
 
 
--- --------------
--- aug_setm tests
--- --------------
-#ifdef HAS_AUGEAS_SETM
-testBadBaseSetm :: Test
-testBadBaseSetm = TestCase ( with_augptr $ \aug_ptr -> do
 
-                        ret_setm <- aug_setm aug_ptr (Data.ByteString.Char8.pack "badbase") (Just (Data.ByteString.Char8.pack "sub")) (Data.ByteString.Char8.pack "value")
-                        assertEqual "testBadBaseSetm (1)" (AugRet 0) ret_setm
 
-                    )
 
-testBadPathSetm :: Test
-testBadPathSetm = TestCase ( with_augptr $ \aug_ptr -> do
 
-                        ret_setm <- aug_setm aug_ptr (Data.ByteString.Char8.pack "/") (Just (Data.ByteString.Char8.pack "/blah/*/blah/**")) (Data.ByteString.Char8.pack "value")
-                        assertEqual "testBadPathSetm (1)" (AugRet (-1)) ret_setm
-
-                    )
-
-testSetm :: Test
-testSetm = TestCase ( with_augptr $ \aug_ptr -> do
-
-                        ret_set <- aug_set aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical") (Data.ByteString.Char8.pack "haskell-augeas.org")
-                        assertEqual "set OK" success ret_set
-
-                        ret_setm <- aug_setm aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical") (Just (Data.ByteString.Char8.pack "sub/1")) (Data.ByteString.Char8.pack "value")
-                        assertEqual "testSetm (1)" (AugRet 1) ret_setm
-
-                        ret_get <- aug_get aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/1")
-                        assertEqual "set OK" (Right (Just "value")) ret_get
-
-                        ret_setm2 <- aug_setm aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/1") Nothing (Data.ByteString.Char8.pack "value2")
-                        assertEqual "testSetm (2)" (AugRet 1) ret_setm2
-
-                        ret_get2 <- aug_get aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/1")
-                        assertEqual "set OK" (Right (Just "value2")) ret_get2
-
-                        ret_setm3 <- aug_setm aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical") (Just (Data.ByteString.Char8.pack "sub/2")) (Data.ByteString.Char8.pack "value3")
-                        assertEqual "testSetm (3)" (AugRet 1) ret_setm3
-
-                        ret_get3 <- aug_get aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/2")
-                        assertEqual "set OK" (Right (Just "value3")) ret_get3
-
-                        ret_setm4 <- aug_setm aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/*") Nothing (Data.ByteString.Char8.pack "value4")
-                        assertEqual "testSetm (4)" (AugRet 2) ret_setm4
-
-                        ret_get4 <- aug_get aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/1")
-                        assertEqual "set OK" (Right (Just "value4")) ret_get4
-
-                        ret_get5 <- aug_get aug_ptr (Data.ByteString.Char8.pack "/files/etc/hosts/1000/canonical/sub/2")
-                        assertEqual "set OK" (Right (Just "value4")) ret_get5
-
-
-                    )
-#endif
-
-
-
 main :: IO Counts
 main = runTestTT $ TestList [
         -- testBadRoot,
@@ -598,6 +619,17 @@
         ,testSetMultiMatch
 #endif
 
+#ifdef HAS_AUGEAS_SETM
+        ,testBadBaseSetm
+        ,testBadPathSetm
+        ,testSetm
+#endif
+
+#ifdef HAS_AUGEAS_SPAN
+        ,testSpanNoFile
+        ,testSpan
+#endif
+
 #ifdef HAS_AUGEAS_INSERT
         ,testInsertBadPath
         ,testInsertMultiMatch
@@ -642,12 +674,6 @@
         -- aug_error_minor_message
         -- aug_error_details
         ,testErrMessage
-#endif
-
-#ifdef HAS_AUGEAS_SETM
-        ,testBadBaseSetm
-        ,testBadPathSetm
-        ,testSetm
 #endif
 
         -- aug_close already handled in ForeignPtr, so there's no need to surface it to Haskell users at all.
diff --git a/System/Augeas.hs b/System/Augeas.hs
--- a/System/Augeas.hs
+++ b/System/Augeas.hs
@@ -40,6 +40,9 @@
     Augeas
     , AugFlag(..)
     , none, save_backup, save_newfile, type_check, no_stdinc, save_noop, no_load, no_modl_autoload
+#ifdef HAS_AUGEAS_SPAN
+    , enable_span
+#endif
     , AugMatch
     , exactly_one, no_match, invalid_match
     , AugRet(..)
@@ -48,6 +51,9 @@
     , just_before, just_after
     , AugErrCode(..)
     , no_error,  err_no_memory, err_internal, err_bad_path, err_no_match, err_multi_matches, err_syntax, err_no_lens, err_multi_xfm
+#ifdef HAS_AUGEAS_SPAN
+    , err_no_span
+#endif
                
     -- * Functions
     , aug_init
@@ -55,6 +61,8 @@
     , aug_defnode
     , aug_get
     , aug_set
+    , aug_setm
+    , aug_span
     , aug_insert
     , aug_rm
     , aug_mv
@@ -66,7 +74,6 @@
     , aug_error_message        
     , aug_error_minor_message
     , aug_error_details
-    , aug_setm
     ) where
 
 import System.IO
@@ -412,7 +419,7 @@
         -> IO (AugRet) -- ^ return value
 aug_set aug_ptr bs1 bs2 = 
 #ifndef HAS_AUGEAS_SET
-    Prelude.error "aug_insert requires at least augeas version 0.0.1"
+    Prelude.error "aug_set requires at least augeas version 0.0.1"
 #else
     useAsCString bs1 $ \path -> do
       useAsCString bs2 $ \value -> do
@@ -420,6 +427,113 @@
          return ret
 #endif
 
+-- --------
+-- aug_setm
+-- --------
+#ifdef HAS_AUGEAS_SETM
+foreign import ccall safe "augeas.h aug_setm"
+        c_aug_setm :: Ptr Augeas  -- aug
+                      -> CString -- base
+                      -> CString -- sub
+                      -> CString -- value
+                      -> IO (AugRet) --return value
+#endif 
+
+{-|
+ Set the value of multiple nodes in one operation. Find or create a node
+ matching SUB by interpreting SUB as a path expression relative to each
+ node matching BASE. SUB may be NULL, in which case all the nodes
+ matching BASE will be modified.
+
+ Returns:
+ number of modified nodes on success, -1 on error
+-}
+aug_setm :: Ptr Augeas          -- ^Augeas pointer
+         -> ByteString          -- base
+         -> (Maybe ByteString)  -- sub
+         -> ByteString          -- value
+         -> IO (AugRet)         -- retval
+aug_setm aug_ptr bstr1 maybe_bstr2 bstr3  =
+#ifndef HAS_AUGEAS_SETM
+    Prelude.error "aug_setm requires at least augeas version 0.7.2"
+#else
+    useAsCString bstr1 $ \base -> do
+      useAsCString bstr3 $ \value -> do
+         ret <- (case maybe_bstr2 of
+                   (Just bstr2) -> useAsCString bstr2 $ \sub -> do c_aug_setm aug_ptr base sub value
+                   (Nothing) ->  c_aug_setm aug_ptr base nullPtr value
+                ) 
+         return ret
+
+#endif
+-- --------
+-- aug_span
+-- --------
+#ifdef HAS_AUGEAS_SPAN
+foreign import ccall safe "augeas.h aug_span"
+        c_aug_span :: Ptr Augeas                 -- aug
+                  -> CString                     -- path
+                  -> (Ptr CString)               -- filename
+                  -> (Ptr CInt)                  -- label_start
+                  -> (Ptr CInt)                  -- label_end
+                  -> (Ptr CInt)                  -- value_start
+                  -> (Ptr CInt)                  -- value_end
+                  -> (Ptr CInt)                  -- span_start
+                  -> (Ptr CInt)                  -- span_end
+                  -> IO (CInt)                   -- return value
+#endif
+
+{-|
+ Function: aug_span
+ 
+ Get the span according to input file of the node associated with PATH. If
+ the node is associated with a file, the filename, label and value start and
+ end positions are set, and return value is 0. The caller is responsible for
+ freeing returned filename. If an argument for return value is NULL, then the
+ corresponding value is not set. If the node associated with PATH doesn't
+ belong to a file or is doesn't exists, filename and span are not set and
+ return value is Nothing.
+ 
+ Returns:
+    on success Just (filename, label_start, label_stop, value_start, value_end, start_span, end_span)
+    on error Nothing
+
+-}
+aug_span :: Ptr Augeas  -- ^ Augeas pointer
+         -> ByteString  -- ^ Path
+         -> IO (Maybe (String, CInt, CInt, CInt, CInt, CInt, CInt))
+aug_span aug_ptr bs1 =
+#ifndef HAS_AUGEAS_SPAN
+    Prelude.error "aug_span requires at least augeas version 0.8.0"
+#else
+    useAsCString bs1 $ \path -> do
+      alloca $ \filename -> do
+      alloca $ \label_start -> do
+      alloca $ \label_end -> do      
+      alloca $ \value_start -> do
+      alloca $ \value_end -> do
+      alloca $ \span_start -> do
+      alloca $ \span_end -> do
+        ret <- c_aug_span aug_ptr path filename label_start label_end value_start value_end span_start span_end
+        if ret == 0
+           then do
+             p_filename <- peek filename
+             ps_filename <- peekCString p_filename
+             p_label_start <- peek label_start
+             p_label_end <- peek label_end
+             p_value_start <- peek value_start
+             p_value_end <- peek value_end
+             p_span_start <- peek span_start
+             p_span_end <- peek span_end
+
+-- From http://www.haskell.org/haskellwiki/FFI_Introduction
+-- The haskell report only guarantees that Int has 30 bits of signed precision, so converting CInt to Int is not safe! 
+
+             return (Just (ps_filename, p_label_start, p_label_end, p_value_start, p_value_end, p_span_start, p_span_end))
+           else do
+             return Nothing
+#endif
+
 -- ----------
 -- aug_insert
 -- ----------
@@ -445,7 +559,7 @@
 
 -}
 aug_insert :: Ptr Augeas   -- ^ Augeas pointer
-           -> ByteString   -- ^ PTH
+           -> ByteString   -- ^ PATH
            -> ByteString   -- ^ LABEL
            -> AugBefore    -- ^ BEFORE
            -> IO (AugRet)  -- ^ return value
@@ -480,7 +594,7 @@
        -> IO (CInt)   -- ^ number of entries removed
 aug_rm aug_ptr bs_path = 
 #ifndef HAS_AUGEAS_RM
-    Prelude.error "aug_mv requires at least augeas version 0.0.1"
+    Prelude.error "aug_rm requires at least augeas version 0.0.1"
 #else
     useAsCString bs_path $ \path -> do    
       ret <- c_aug_rm aug_ptr path
@@ -823,42 +937,3 @@
       return(ret)
 #endif
 
--- --------
--- aug_setm
--- --------
-#ifdef HAS_AUGEAS_SETM
-foreign import ccall safe "augeas.h aug_setm"
-        c_aug_setm :: Ptr Augeas  -- aug
-                      -> CString -- base
-                      -> CString -- sub
-                      -> CString -- value
-                      -> IO (AugRet) --return value
-#endif 
-
-{-|
- Set the value of multiple nodes in one operation. Find or create a node
- matching SUB by interpreting SUB as a path expression relative to each
- node matching BASE. SUB may be NULL, in which case all the nodes
- matching BASE will be modified.
-
- Returns:
- number of modified nodes on success, -1 on error
--}
-aug_setm :: Ptr Augeas          -- ^Augeas pointer
-         -> ByteString          -- base
-         -> (Maybe ByteString)  -- sub
-         -> ByteString          -- value
-         -> IO (AugRet)         -- retval
-aug_setm aug_ptr bstr1 maybe_bstr2 bstr3  =
-#ifndef HAS_AUGEAS_SETM
-    Prelude.error "aug_setm requires at least augeas version 0.7.2"
-#else
-    useAsCString bstr1 $ \base -> do
-      useAsCString bstr3 $ \value -> do
-         ret <- (case maybe_bstr2 of
-                   (Just bstr2) -> useAsCString bstr2 $ \sub -> do c_aug_setm aug_ptr base sub value
-                   (Nothing) ->  c_aug_setm aug_ptr base nullPtr value
-                ) 
-         return ret
-
-#endif
diff --git a/System/AugeasHsc.hsc b/System/AugeasHsc.hsc
--- a/System/AugeasHsc.hsc
+++ b/System/AugeasHsc.hsc
@@ -23,6 +23,11 @@
 
 {-# LANGUAGE CPP, ForeignFunctionInterface #-}
 
+#ifndef _config_h
+#include "Config.h"
+#define _config_h
+#endif
+
 module System.AugeasHsc where
 
 import Foreign.C.Types
@@ -46,6 +51,9 @@
        , save_noop = AUG_SAVE_NOOP
        , no_load = AUG_NO_LOAD
        , no_modl_autoload = AUG_NO_MODL_AUTOLOAD
+#ifdef HAS_AUGEAS_SPAN
+       , enable_span = AUG_ENABLE_SPAN
+#endif
 }
 
 -- ---------------------------------
@@ -65,9 +73,7 @@
        , err_syntax = AUG_ESYNTAX
        , err_no_lens = AUG_ENOLENS
        , err_multi_xfm = AUG_EMXFM
+#ifdef HAS_AUGEAS_SPAN
+       , err_no_span = AUG_ENOSPAN
+#endif
 }
-
-
-
-
-
diff --git a/augeas.cabal b/augeas.cabal
--- a/augeas.cabal
+++ b/augeas.cabal
@@ -1,5 +1,5 @@
 Name: augeas
-Version: 0.3.5
+Version: 0.4.0
 Synopsis:  A Haskell FFI wrapper for the Augeas API
 Description: A Haskell FFI wrapper for the Augeas API
 Author: Jude Nagurney
@@ -12,7 +12,7 @@
 Category: System
 Stability: Alpha
 HomePage: http://trac.haskell.org/augeas
-Package-URL: http://hackage.haskell.org/packages/archive/augeas/0.3.3/augeas-0.3.3.tar.gz
+Package-URL: http://hackage.haskell.org/packages/archive/augeas/0.4.0/augeas-0.4.0.tar.gz
 Extra-Source-Files: Makefile, configure.ac, configure, Config.h.in
 
 library 
@@ -20,12 +20,14 @@
         Other-Modules: System.AugeasHsc
         Build-Depends: base >= 4.0 && <5, directory, unix >=2.3.0.0, bytestring >= 0.9.0.1
         GHC-options: -Wall -fwarn-dodgy-imports
+        Include-Dirs: .
         Extensions: CPP
         Pkgconfig-Depends: augeas
 
 executable "test-haskell-augeas"
         Main-is: HUnitAug.hs
         Build-Depends: HUnit
+        Include-Dirs: .
         Other-Modules: System.Augeas, System.AugeasHsc
         extra-libraries: augeas
         GHC-options: -Wall -fwarn-dodgy-imports 
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -3662,6 +3662,134 @@
 fi
 
 
+has_aug_setm=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing aug_setm" >&5
+$as_echo_n "checking for library containing aug_setm... " >&6; }
+if test "${ac_cv_search_aug_setm+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char aug_setm ();
+int
+main ()
+{
+return aug_setm ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' augeas; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_aug_setm=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if test "${ac_cv_search_aug_setm+set}" = set; then :
+  break
+fi
+done
+if test "${ac_cv_search_aug_setm+set}" = set; then :
+
+else
+  ac_cv_search_aug_setm=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_aug_setm" >&5
+$as_echo "$ac_cv_search_aug_setm" >&6; }
+ac_res=$ac_cv_search_aug_setm
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  has_aug_setm=yes
+fi
+
+if test "x${has_aug_setm}" = "xyes"; then
+
+$as_echo "#define HAS_AUGEAS_SETM /**/" >>confdefs.h
+
+fi
+
+
+has_aug_span=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing aug_span" >&5
+$as_echo_n "checking for library containing aug_span... " >&6; }
+if test "${ac_cv_search_aug_span+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char aug_span ();
+int
+main ()
+{
+return aug_span ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' augeas; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_aug_span=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if test "${ac_cv_search_aug_span+set}" = set; then :
+  break
+fi
+done
+if test "${ac_cv_search_aug_span+set}" = set; then :
+
+else
+  ac_cv_search_aug_span=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_aug_span" >&5
+$as_echo "$ac_cv_search_aug_span" >&6; }
+ac_res=$ac_cv_search_aug_span
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  has_aug_span=yes
+fi
+
+if test "x${has_aug_span}" = "xyes"; then
+
+$as_echo "#define HAS_AUGEAS_SPAN /**/" >>confdefs.h
+
+fi
+
+
 has_aug_insert=no
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing aug_insert" >&5
 $as_echo_n "checking for library containing aug_insert... " >&6; }
@@ -4364,71 +4492,6 @@
 $as_echo "#define HAS_AUGEAS_ERROR_DETAILS /**/" >>confdefs.h
 
 fi
-
-
-has_aug_setm=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing aug_setm" >&5
-$as_echo_n "checking for library containing aug_setm... " >&6; }
-if test "${ac_cv_search_aug_setm+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char aug_setm ();
-int
-main ()
-{
-return aug_setm ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' augeas; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_aug_setm=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if test "${ac_cv_search_aug_setm+set}" = set; then :
-  break
-fi
-done
-if test "${ac_cv_search_aug_setm+set}" = set; then :
-
-else
-  ac_cv_search_aug_setm=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_aug_setm" >&5
-$as_echo "$ac_cv_search_aug_setm" >&6; }
-ac_res=$ac_cv_search_aug_setm
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  has_aug_setm=yes
-fi
-
-if test "x${has_aug_setm}" = "xyes"; then
-
-$as_echo "#define HAS_AUGEAS_SETM /**/" >>confdefs.h
-
-fi
-
 
 
 ## fdopen
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ(2.65)
-AC_INIT([haskell-augeas],[0.3.5])
+AC_INIT([haskell-augeas],[0.4.0])
 AC_CONFIG_SRCDIR(Setup.hs)
 AC_CONFIG_HEADERS([Config.h])
 
@@ -45,6 +45,8 @@
 HAS_AUGEAS_FUNC(aug_defnode,HAS_AUGEAS_DEFNODE)
 HAS_AUGEAS_FUNC(aug_get,HAS_AUGEAS_GET)
 HAS_AUGEAS_FUNC(aug_set,HAS_AUGEAS_SET)
+HAS_AUGEAS_FUNC(aug_setm,HAS_AUGEAS_SETM)
+HAS_AUGEAS_FUNC(aug_span,HAS_AUGEAS_SPAN)
 HAS_AUGEAS_FUNC(aug_insert,HAS_AUGEAS_INSERT)
 HAS_AUGEAS_FUNC(aug_rm,HAS_AUGEAS_RM)
 HAS_AUGEAS_FUNC(aug_mv,HAS_AUGEAS_MV)
@@ -56,8 +58,6 @@
 HAS_AUGEAS_FUNC(aug_error_message,HAS_AUGEAS_ERROR_MESSAGE)
 HAS_AUGEAS_FUNC(aug_error_minor_message,HAS_AUGEAS_ERROR_MINOR_MESSAGE)
 HAS_AUGEAS_FUNC(aug_error_details,HAS_AUGEAS_ERROR_DETAILS)
-HAS_AUGEAS_FUNC(aug_setm,HAS_AUGEAS_SETM)
-
 
 ## fdopen
 ## fflush
