Skip to content

Commit

Permalink
Fri 14 May 2021 16:57:35
Browse files Browse the repository at this point in the history
  • Loading branch information
mullikine committed May 14, 2021
1 parent 522dde8 commit ab542f1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
8 changes: 8 additions & 0 deletions pen-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
(defun pen-preceding-text ()
(str (buffer-substring (point) (max 1 (- (point) 1000)))))

(defun beginning-of-line-point ()
(save-excursion
(beginning-of-line)
(point)))

(defun pen-preceding-text-line ()
(str (buffer-substring (point) (max 1 (- (point) 1000)))))


;; TODO Figure out how to get the previous line start of line points
;; (tv (save-excursion (ntimes 5 (call-interactively 'previous-line)) (message (str (point)))))
Expand Down
22 changes: 14 additions & 8 deletions pen.el
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,14 @@ Function names are prefixed with pen-pf- for easy searching"
;; The first argument may be captured through selection
`(if (selectionp)
(my/selected-text)
(progn
(if ,(> (length (str2lines example)) 1)
(tvipe ;; ,(concat v ": ")
,example)
(read-string-hist ,(concat v ": ") ,example))))
`(read-string-hist ,(concat v ": ") ,example)))
(if ,(> (length (str2lines example)) 1)
(tvipe ;; ,(concat v ": ")
,example)
(read-string-hist ,(concat v ": ") ,example)))
`(if ,(> (length (str2lines example)) 1)
(tvipe ;; ,(concat v ": ")
,example)
(read-string-hist ,(concat v ": ") ,example))))
do
(progn
(setq iteration (+ 1 iteration))
Expand All @@ -217,7 +219,7 @@ Function names are prefixed with pen-pf- for easy searching"
,(sor doc title)
(interactive ,(cons 'list iargs))
(let* ((sh-update
(or sh-update (>= (prefix-numeric-value current-prefix-arg) 4)))
(or sh-update (>= (prefix-numeric-value current-global-prefix-arg) 4)))
(result
(chomp
(mapconcat 'identity
Expand Down Expand Up @@ -311,6 +313,11 @@ Function names are prefixed with pen-pf- for easy searching"
;; (line (car (str2lines response)))
;; (line response)
(res
;; (cl-loop
;; for i from 1 to 3 collect
;; (->>
;; preceding-text
;; (pen-pf-generic-file-type-completion (detect-language))))
(list response)
;; (if (>= (prefix-numeric-value current-prefix-arg) 8)
;; (list response)
Expand Down Expand Up @@ -411,6 +418,5 @@ Function names are prefixed with pen-pf- for easy searching"
(define-key org-brain-visualize-mode-map (kbd "C-c t") 'org-brain-show-topic)
(define-key org-brain-visualize-mode-map (kbd "C-c d") 'org-brain-describe-topic)


(provide 'my-openai)
(provide 'pen)

0 comments on commit ab542f1

Please sign in to comment.