Skip to content

Commit

Permalink
move utilities to avoid circular dependency
Browse files Browse the repository at this point in the history
(post-rebase issue)
  • Loading branch information
countvajhula committed Dec 7, 2024
1 parent 0ecfca9 commit 6f570bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
16 changes: 16 additions & 0 deletions symex-primitives.el
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,22 @@ symexes, returns the end point of the last one found."
(symex-lisp-select-nearest))
(point))

(defun symex--fix-leading-whitespace ()
"Fix leading whitespace."
;; fix leading whitespace
(fixup-whitespace)
;; fixup may move point into the whitespace - restore it
(when (looking-at-p "[[:space:]]")
(symex--go-to-next-non-whitespace-char)))

(defun symex--fix-trailing-whitespace (count)
"Fix trailing whitespace."
(condition-case nil
(save-excursion
(symex-select-end count)
(fixup-whitespace))
(error nil)))

(defun symex--primitive-exit ()
"Take necessary actions as part of exiting Symex mode, at a primitive level."
(symex--delete-overlay)
Expand Down
17 changes: 0 additions & 17 deletions symex-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
;;; Code:

(require 'cl-lib)
(require 'symex-primitives)

(defun symex--current-line-empty-p ()
"Check if the current line is empty.
Expand Down Expand Up @@ -216,22 +215,6 @@ preceding one as the accumulator. "
(let ((latest (symex--kill-ring-pop)))
(kill-append latest nil)))

(defun symex--fix-leading-whitespace ()
"Fix leading whitespace."
;; fix leading whitespace
(fixup-whitespace)
;; fixup may move point into the whitespace - restore it
(when (looking-at-p "[[:space:]]")
(symex--go-to-next-non-whitespace-char)))

(defun symex--fix-trailing-whitespace (count)
"Fix trailing whitespace."
(condition-case nil
(save-excursion
(symex-select-end count)
(fixup-whitespace))
(error nil)))


(provide 'symex-utils)
;;; symex-utils.el ends here

0 comments on commit 6f570bb

Please sign in to comment.