From 6c1017d637698bcb411f0facffe44036cf3388a4 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 7 Oct 2023 14:58:38 +0200 Subject: [PATCH] ; Fix excluding new predicate body from replacement after extraction --- sweeprolog.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sweeprolog.el b/sweeprolog.el index e3cb3bb..283d6c2 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -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 -- 2.39.5