]> git.eshelyaron.com Git - sweep.git/commitdiff
; Fix excluding new predicate body from replacement after extraction
authorEshel Yaron <me@eshelyaron.com>
Sat, 7 Oct 2023 12:58:38 +0000 (14:58 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 7 Oct 2023 12:58:38 +0000 (14:58 +0200)
sweeprolog.el

index e3cb3bb27066adb385553aec0225a0cd5437e1a5..283d6c23a8e6853214bd969c061bc52a89315e26 100644 (file)
@@ -7130,8 +7130,7 @@ clause.
 The user option `sweeprolog-new-predicate-location-function' says
 where in the buffer to insert the newly created predicate."
   (interactive "r\nsNew predicate functor: \nP" sweeprolog-mode)
-  (let* ((module (sweeprolog-buffer-module))
-         (pred-beg nil)
+  (let* ((pred-beg nil)
          (pred-end nil)
          (clause-beg (save-excursion
                        (goto-char end)
@@ -7178,8 +7177,8 @@ where in the buffer to insert the newly created predicate."
                     functor arity neck)
            (setq pred-beg (1+ (point)))
            (insert "\n" head " " neck "\n" body ".\n")
+           (indent-region-line-by-line pred-beg (point))
            (setq pred-end (point))
-           (indent-region-line-by-line pred-beg pred-end)
            (goto-char pred-beg))
          (deactivate-mark)
          (when all