update packages
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
;; -*- no-byte-compile: t; lexical-binding: nil -*-
|
||||
(define-package "cfrs" "20220129.1149"
|
||||
(define-package "cfrs" "20250729.1422"
|
||||
"Child-frame based read-string."
|
||||
'((emacs "26.1")
|
||||
(dash "2.11.0")
|
||||
(s "1.10.0")
|
||||
(posframe "0.6.0"))
|
||||
:url "https://github.com/Alexander-Miller/cfrs"
|
||||
:commit "f3a21f237b2a54e6b9f8a420a9da42b4f0a63121"
|
||||
:revdesc "f3a21f237b2a"
|
||||
:commit "981bddb3fb9fd9c58aed182e352975bd10ad74c8"
|
||||
:revdesc "981bddb3fb9f"
|
||||
:authors '(("Alexander Miller" . "alexanderm@web.de"))
|
||||
:maintainers '(("Alexander Miller" . "alexanderm@web.de")))
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
;; Author: Alexander Miller <alexanderm@web.de>
|
||||
;; Package-Requires: ((emacs "26.1") (dash "2.11.0") (s "1.10.0") (posframe "0.6.0"))
|
||||
;; Package-Version: 20220129.1149
|
||||
;; Package-Revision: f3a21f237b2a
|
||||
;; Package-Version: 20250729.1422
|
||||
;; Package-Revision: 981bddb3fb9f
|
||||
;; Homepage: https://github.com/Alexander-Miller/cfrs
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
@@ -70,13 +70,21 @@ See also `cfrs-max-width'"
|
||||
Only the `:background' part is used."
|
||||
:group 'cfrs)
|
||||
|
||||
(defconst cfrs--buffer-name " *Pos-Frame-Read*")
|
||||
|
||||
(defun cfrs--detect-lost-focus (_)
|
||||
"Abort the read operation when focus is lost."
|
||||
(unless (eq major-mode 'cfrs-input-mode)
|
||||
(posframe-hide cfrs--buffer-name)
|
||||
(abort-recursive-edit)))
|
||||
|
||||
;;;###autoload
|
||||
(defun cfrs-read (prompt &optional initial-input)
|
||||
"Read a string using a pos-frame with given PROMPT and INITIAL-INPUT."
|
||||
(if (not (or (display-graphic-p)
|
||||
(not (fboundp #'display-buffer-in-side-window))))
|
||||
(read-string prompt initial-input)
|
||||
(let* ((buffer (get-buffer-create " *Pos-Frame-Read*"))
|
||||
(let* ((buffer (get-buffer-create cfrs--buffer-name))
|
||||
(border-color (face-attribute 'cfrs-border-color :background nil t))
|
||||
(cursor (cfrs--determine-cursor-type))
|
||||
(width (+ 2 ;; extra space for margin and cursor
|
||||
@@ -132,7 +140,7 @@ Prevents showing an invisible cursor with a height or width of 0."
|
||||
(defun cfrs--hide ()
|
||||
"Hide the current cfrs frame."
|
||||
(when (eq major-mode 'cfrs-input-mode)
|
||||
(posframe-hide (current-buffer))
|
||||
(posframe-hide cfrs--buffer-name)
|
||||
(x-focus-frame (frame-parent (selected-frame)))))
|
||||
|
||||
(defun cfrs--adjust-height ()
|
||||
@@ -150,11 +158,13 @@ Prevents showing an invisible cursor with a height or width of 0."
|
||||
;; XXX: workaround for persp believing we are in a different frame
|
||||
;; and need a new perspective when the recursive edit ends
|
||||
(set-frame-parameter (selected-frame) 'persp--recursive nil)
|
||||
(remove-hook 'window-selection-change-functions #'cfrs--detect-lost-focus :local)
|
||||
(exit-recursive-edit))
|
||||
|
||||
(defun cfrs-cancel ()
|
||||
"Cancel the `cfrs-read' call and the function that called it."
|
||||
(interactive)
|
||||
(remove-hook 'window-selection-change-functions #'cfrs--detect-lost-focus :local)
|
||||
(cfrs--hide)
|
||||
(abort-recursive-edit))
|
||||
|
||||
@@ -168,6 +178,7 @@ Prevents showing an invisible cursor with a height or width of 0."
|
||||
(define-derived-mode cfrs-input-mode fundamental-mode "Child Frame Read String"
|
||||
"Simple mode for buffers displayed in cfrs's input frames."
|
||||
(add-hook 'post-command-hook #'cfrs--adjust-height nil :local)
|
||||
(add-hook 'window-selection-change-functions #'cfrs--detect-lost-focus nil :local)
|
||||
(display-line-numbers-mode -1))
|
||||
|
||||
;; https://github.com/Alexander-Miller/treemacs/issues/775
|
||||
|
||||
Reference in New Issue
Block a user