Skip to content

Commit

Permalink
Merge remote-tracking branch 'gh/refactor-external-editor-program-api'
Browse files Browse the repository at this point in the history
  • Loading branch information
aadcg committed Nov 26, 2023
2 parents 45afcec + 5f9d8d2 commit 5d36c28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 7 additions & 6 deletions source/browser.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ The handlers take the `prompt-buffer' as argument.")
(or (uiop:getenvp "VISUAL")
(uiop:getenvp "EDITOR")
(when (sera:resolve-executable "gio") "gio open"))
:type (or (cons string *) string null)
:type (or string null)
:reader nil
:writer t
:export t
Expand Down Expand Up @@ -304,12 +304,13 @@ prevents otherwise.")
(make-instance 'theme:theme))

(defmethod external-editor-program ((browser browser))
"Specialized reader for `external-editor-program' slot."
"Specialized reader for `external-editor-program' slot.
A list of strings is returned, as to comply with `uiop:launch-program' or
`uiop:run-program'."
(with-slots ((cmd external-editor-program)) browser
(typecase cmd
(list (unless (sera:blankp (first cmd)) cmd))
(string (unless (sera:blankp cmd) (str:split " " cmd)))
(t (echo-warning "Invalid value of `external-editor-program' browser slot.") nil))))
(if (str:blank? cmd)
(progn (echo-warning "Invalid value of `external-editor-program' browser slot.") nil)
(str:split " " cmd))))

(defmethod get-containing-window-for-buffer ((buffer buffer) (browser browser))
"Get the window containing a buffer."
Expand Down
5 changes: 4 additions & 1 deletion source/migration.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ major versions."
(:p "Deprecated in favor of " (:nxref :slot 'style :class-name 'message-buffer) ".")

(ffi-window-message-buffer-height)
(:p "Deprecated since it is now handled by " (:nxref :function 'ffi-height) "."))
(:p "Deprecated since it is now handled by " (:nxref :function 'ffi-height) ".")

(external-editor-program)
(:p "Deprecated support for lists as a value. Strings are the only valid values."))

(define-migration "3"
(%slot-default)
Expand Down

0 comments on commit 5d36c28

Please sign in to comment.