Skip to content

Commit 6262821

Browse files
committed
feat(_prepare.el): Add program temp buffer
1 parent c26eb1d commit 6262821

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

lisp/_prepare.el

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,30 @@ and INHERIT-INPUT-METHOD see function `read-string' for more information."
306306
(let ((str (read-string prompt initial-input history default-value inherit-input-method)))
307307
(eask-s-replace "\"" "" str)))
308308

309+
(defun eask--goto-line (line)
310+
"Go to LINE."
311+
(goto-char (point-min))
312+
(forward-line (1- line)))
313+
314+
(defun eask--column-at-point (point)
315+
"Get column at POINT."
316+
(save-excursion (goto-char point) (current-column)))
317+
318+
(defcustom eask-buffer-name "*eask*"
319+
"Buffer name is used for temporary storage throughout the life cycle."
320+
:type 'string
321+
:group 'eask)
322+
323+
(defmacro eask-with-buffer (&rest body)
324+
"Create a temporary buffer (for this program), and evaluate BODY there."
325+
(declare (indent 0) (debug t))
326+
`(with-current-buffer (get-buffer-create ,eask-buffer-name) ,@body))
327+
328+
(defmacro eask-with-temp-buffer (&rest body)
329+
"Create a temporary buffer (for this program), and evaluate BODY there."
330+
(declare (indent 0) (debug t))
331+
`(eask-with-buffer (erase-buffer) ,@body))
332+
309333
;;
310334
;;; Progress
311335

0 commit comments

Comments
 (0)