update of packages
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
(define-package "posframe" "20221220.544" "Pop a posframe (just a frame) at point"
|
||||
(define-package "posframe" "20230714.227" "Pop a posframe (just a frame) at point"
|
||||
'((emacs "26.1"))
|
||||
:commit "aa88860a16e28a311f81e18f1d9ed2e7d9e33991" :authors
|
||||
:commit "017deece88360c7297265680d78a0bb316470716" :authors
|
||||
'(("Feng Shu" . "tumashu@163.com"))
|
||||
:maintainers
|
||||
'(("Feng Shu" . "tumashu@163.com"))
|
||||
:maintainer
|
||||
'("Feng Shu" . "tumashu@163.com")
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
;; Author: Feng Shu <tumashu@163.com>
|
||||
;; Maintainer: Feng Shu <tumashu@163.com>
|
||||
;; URL: https://github.com/tumashu/posframe
|
||||
;; Version: 1.3.2
|
||||
;; Version: 1.4.2
|
||||
;; Keywords: convenience, tooltip
|
||||
;; Package-Requires: ((emacs "26.1"))
|
||||
|
||||
@@ -149,6 +149,8 @@ effect.")
|
||||
internal-border-width
|
||||
internal-border-color
|
||||
font
|
||||
cursor
|
||||
window-point
|
||||
foreground-color
|
||||
background-color
|
||||
respect-header-line
|
||||
@@ -188,6 +190,8 @@ position. Its argument is a plist of the following form:
|
||||
:posframe-height xxx
|
||||
:posframe-buffer xxx
|
||||
:parent-frame xxx
|
||||
:parent-window-start xxx
|
||||
:parent-window-end xxx
|
||||
:parent-window-left xxx
|
||||
:parent-window-top xxx
|
||||
:parent-frame-width xxx
|
||||
@@ -213,21 +217,22 @@ The builtin poshandler functions are listed below:
|
||||
2. `posframe-poshandler-frame-top-center'
|
||||
3. `posframe-poshandler-frame-top-left-corner'
|
||||
4. `posframe-poshandler-frame-top-right-corner'
|
||||
5. `posframe-poshandler-frame-bottom-center'
|
||||
6. `posframe-poshandler-frame-bottom-left-corner'
|
||||
7. `posframe-poshandler-frame-bottom-right-corner'
|
||||
8. `posframe-poshandler-window-center'
|
||||
9. `posframe-poshandler-window-top-center'
|
||||
10. `posframe-poshandler-window-top-left-corner'
|
||||
11. `posframe-poshandler-window-top-right-corner'
|
||||
12. `posframe-poshandler-window-bottom-center'
|
||||
13. `posframe-poshandler-window-bottom-left-corner'
|
||||
14. `posframe-poshandler-window-bottom-right-corner'
|
||||
15. `posframe-poshandler-point-top-left-corner'
|
||||
16. `posframe-poshandler-point-bottom-left-corner'
|
||||
17. `posframe-poshandler-point-bottom-left-corner-upward'
|
||||
18. `posframe-poshandler-point-window-center'
|
||||
19. `posframe-poshandler-point-frame-center'
|
||||
5. `posframe-poshandler-frame-top-left-or-right-other-corner'
|
||||
6. `posframe-poshandler-frame-bottom-center'
|
||||
7. `posframe-poshandler-frame-bottom-left-corner'
|
||||
8. `posframe-poshandler-frame-bottom-right-corner'
|
||||
9. `posframe-poshandler-window-center'
|
||||
10. `posframe-poshandler-window-top-center'
|
||||
11. `posframe-poshandler-window-top-left-corner'
|
||||
12. `posframe-poshandler-window-top-right-corner'
|
||||
13. `posframe-poshandler-window-bottom-center'
|
||||
14. `posframe-poshandler-window-bottom-left-corner'
|
||||
15. `posframe-poshandler-window-bottom-right-corner'
|
||||
16. `posframe-poshandler-point-top-left-corner'
|
||||
17. `posframe-poshandler-point-bottom-left-corner'
|
||||
18. `posframe-poshandler-point-bottom-left-corner-upward'
|
||||
19. `posframe-poshandler-point-window-center'
|
||||
20. `posframe-poshandler-point-frame-center'
|
||||
|
||||
(3) POSHANDLER-EXTRA-INFO
|
||||
|
||||
@@ -279,25 +284,34 @@ derived from the current frame by default, but can be overridden
|
||||
using the FONT, FOREGROUND-COLOR and BACKGROUND-COLOR arguments,
|
||||
respectively.
|
||||
|
||||
(10) RESPECT-HEADER-LINE and RESPECT-MODE-LINE
|
||||
(10) CURSOR and WINDOW-POINT
|
||||
|
||||
By default, cursor is not showed in posframe, user can let cursor
|
||||
showed with this argument help by set its value to a `cursor-type'.
|
||||
|
||||
When cursor need to be showed in posframe, user may need to set
|
||||
WINDOW-POINT to the point of BUFFER, which can let cursor showed
|
||||
at this point.
|
||||
|
||||
(11) RESPECT-HEADER-LINE and RESPECT-MODE-LINE
|
||||
|
||||
By default, posframe will display no header-line, mode-line and
|
||||
tab-line. In case a header-line, mode-line or tab-line is
|
||||
desired, users can set RESPECT-HEADER-LINE and RESPECT-MODE-LINE
|
||||
to t.
|
||||
|
||||
(11) INITIALIZE
|
||||
(12) INITIALIZE
|
||||
|
||||
INITIALIZE is a function with no argument. It will run when
|
||||
posframe buffer is first selected with `with-current-buffer'
|
||||
in `posframe-show', and only run once (for performance reasons).
|
||||
|
||||
(12) LINES-TRUNCATE
|
||||
(13) LINES-TRUNCATE
|
||||
|
||||
If LINES-TRUNCATE is non-nil, then lines will truncate in the
|
||||
posframe instead of wrap.
|
||||
|
||||
(13) OVERRIDE-PARAMETERS
|
||||
(14) OVERRIDE-PARAMETERS
|
||||
|
||||
OVERRIDE-PARAMETERS is very powful, *all* the valid frame parameters
|
||||
used by posframe's frame can be overridden by it.
|
||||
@@ -305,7 +319,7 @@ used by posframe's frame can be overridden by it.
|
||||
NOTE: some `posframe-show' arguments are not frame parameters, so they
|
||||
can not be overrided by this argument.
|
||||
|
||||
(14) TIMEOUT
|
||||
(15) TIMEOUT
|
||||
|
||||
TIMEOUT can specify the number of seconds after which the posframe
|
||||
will auto-hide.
|
||||
@@ -315,12 +329,12 @@ will auto-hide.
|
||||
If REFRESH is a number, posframe's frame-size will be re-adjusted
|
||||
every REFRESH seconds.
|
||||
|
||||
(16) ACCEPT-FOCUS
|
||||
(17) ACCEPT-FOCUS
|
||||
|
||||
When ACCEPT-FOCUS is non-nil, posframe will accept focus.
|
||||
be careful, you may face some bugs when set it to non-nil.
|
||||
|
||||
(17) HIDEHANDLER
|
||||
(18) HIDEHANDLER
|
||||
|
||||
HIDEHANDLER is a function, when it return t, posframe will be
|
||||
hide, this function has a plist argument:
|
||||
@@ -332,7 +346,7 @@ The builtin hidehandler functions are listed below:
|
||||
|
||||
1. `posframe-hidehandler-when-buffer-switch'
|
||||
|
||||
(18) REFPOSHANDLER
|
||||
(19) REFPOSHANDLER
|
||||
|
||||
REFPOSHANDLER is a function, a reference position (most is
|
||||
top-left of current frame) will be returned when call this
|
||||
@@ -342,7 +356,7 @@ when it is nil or it return nil, child-frame feature will be used
|
||||
and reference position will be deal with in Emacs.
|
||||
|
||||
The user case I know at the moment is let ivy-posframe work well
|
||||
in EXWM environment (let posframe show on the other appliction
|
||||
in EXWM environment (let posframe show on the other application
|
||||
window).
|
||||
|
||||
DO NOT USE UNLESS NECESSARY!!!
|
||||
@@ -369,9 +383,12 @@ You can use `posframe-delete-all' to delete all posframes."
|
||||
(min (max height min-height) max-height)))
|
||||
(x-pixel-offset (or x-pixel-offset 0))
|
||||
(y-pixel-offset (or y-pixel-offset 0))
|
||||
(window-point (or window-point 0))
|
||||
;;-----------------------------------------------------
|
||||
(buffer (get-buffer-create buffer-or-name))
|
||||
(parent-window (selected-window))
|
||||
(parent-window-start (window-start parent-window))
|
||||
(parent-window-end (window-end parent-window))
|
||||
(parent-window-top (window-pixel-top parent-window))
|
||||
(parent-window-left (window-pixel-left parent-window))
|
||||
(parent-window-width (window-pixel-width parent-window))
|
||||
@@ -409,7 +426,9 @@ You can use `posframe-delete-all' to delete all posframes."
|
||||
(setq posframe
|
||||
(posframe--create-posframe
|
||||
buffer
|
||||
:position position
|
||||
:font font
|
||||
:cursor cursor
|
||||
:parent-frame
|
||||
(unless ref-position
|
||||
parent-frame)
|
||||
@@ -462,6 +481,8 @@ You can use `posframe-delete-all' to delete all posframes."
|
||||
:parent-frame-height parent-frame-height
|
||||
:ref-position ref-position
|
||||
:parent-window parent-window
|
||||
:parent-window-start parent-window-start
|
||||
:parent-window-end parent-window-end
|
||||
:parent-window-top parent-window-top
|
||||
:parent-window-left parent-window-left
|
||||
:parent-window-width parent-window-width
|
||||
@@ -485,7 +506,7 @@ You can use `posframe-delete-all' to delete all posframes."
|
||||
;; Make sure not hide buffer's content for scroll down.
|
||||
(let ((window (frame-root-window posframe--frame)))
|
||||
(when (window-live-p window)
|
||||
(set-window-point window 0)))
|
||||
(set-window-point window window-point)))
|
||||
|
||||
;; Hide posframe when switch buffer
|
||||
(let* ((parent-buffer (window-buffer parent-window))
|
||||
@@ -541,6 +562,7 @@ You can use `posframe-delete-all' to delete all posframes."
|
||||
|
||||
(cl-defun posframe--create-posframe (buffer-or-name
|
||||
&key
|
||||
position
|
||||
parent-frame
|
||||
foreground-color
|
||||
background-color
|
||||
@@ -551,6 +573,7 @@ You can use `posframe-delete-all' to delete all posframes."
|
||||
internal-border-width
|
||||
internal-border-color
|
||||
font
|
||||
cursor
|
||||
keep-ratio
|
||||
lines-truncate
|
||||
override-parameters
|
||||
@@ -600,12 +623,10 @@ ACCEPT-FOCUS."
|
||||
(setq-local right-fringe-width nil)
|
||||
(setq-local fringes-outside-margins 0)
|
||||
(setq-local fringe-indicator-alist nil)
|
||||
;; Need to use `lines-truncate' as our keyword variable instead of
|
||||
;; `truncate-lines' so we don't shadow the variable that we are trying to
|
||||
;; set.
|
||||
;; Need to use `lines-truncate' as our keyword variable instead
|
||||
;; of `truncate-lines' so we don't shadow the variable that we
|
||||
;; are trying to set.
|
||||
(setq-local truncate-lines lines-truncate)
|
||||
(setq-local cursor-type nil)
|
||||
(setq-local cursor-in-non-selected-windows nil)
|
||||
(setq-local show-trailing-whitespace nil)
|
||||
(setq-local posframe--accept-focus accept-focus)
|
||||
(unless respect-mode-line
|
||||
@@ -613,6 +634,13 @@ ACCEPT-FOCUS."
|
||||
(unless respect-header-line
|
||||
(setq-local header-line-format nil))
|
||||
|
||||
(if cursor
|
||||
(progn
|
||||
(setq-local cursor-type cursor)
|
||||
(setq-local cursor-in-non-selected-windows cursor))
|
||||
(setq-local cursor-type nil)
|
||||
(setq-local cursor-in-non-selected-windows nil))
|
||||
|
||||
;; Find existing posframe: buffer-local variables used by
|
||||
;; posframe can be cleaned by other packages, so we should find
|
||||
;; existing posframe first if possible.
|
||||
@@ -666,6 +694,8 @@ ACCEPT-FOCUS."
|
||||
(visibility . nil)
|
||||
(cursor-type . nil)
|
||||
(minibuffer . nil)
|
||||
(left . ,(if (consp position) (car position) 0))
|
||||
(top . ,(if (consp position) (cdr position) 0))
|
||||
(width . 1)
|
||||
(height . 1)
|
||||
(no-special-glyphs . t)
|
||||
@@ -855,7 +885,7 @@ of `posframe-show'."
|
||||
(t (error "Posframe: have no valid poshandler"))))))
|
||||
|
||||
(defun posframe--calculate-new-position (info position ref-position)
|
||||
"Calcuate new position according to INFO, POSITION and REF-POSITION."
|
||||
"Calculate new position according to INFO, POSITION and REF-POSITION."
|
||||
(let* ((parent-frame-width (plist-get info :parent-frame-width))
|
||||
(parent-frame-height (plist-get info :parent-frame-height))
|
||||
(posframe-width (plist-get info :posframe-width))
|
||||
@@ -1014,12 +1044,13 @@ BUFFER-OR-NAME can be a buffer or a buffer name."
|
||||
;; called, otherwise:
|
||||
;; (add-hook 'buffer-list-update-hook #'posframe-hide)
|
||||
;; will lead to infinite recursion.
|
||||
(let ((buffer-list-update-hook nil))
|
||||
(dolist (frame (frame-list))
|
||||
(let ((buffer-info (frame-parameter frame 'posframe-buffer)))
|
||||
(when (or (equal buffer-or-name (car buffer-info))
|
||||
(equal buffer-or-name (cdr buffer-info)))
|
||||
(posframe--make-frame-invisible frame))))))
|
||||
(when buffer-or-name
|
||||
(let ((buffer-list-update-hook nil))
|
||||
(dolist (frame (frame-list))
|
||||
(let ((buffer-info (frame-parameter frame 'posframe-buffer)))
|
||||
(when (or (equal buffer-or-name (car buffer-info))
|
||||
(equal buffer-or-name (cdr buffer-info)))
|
||||
(posframe--make-frame-invisible frame)))))))
|
||||
|
||||
(defun posframe-hidehandler-daemon ()
|
||||
"Run posframe hidehandler daemon."
|
||||
@@ -1251,6 +1282,25 @@ The structure of INFO can be found in docstring of
|
||||
`posframe-show'."
|
||||
'(-1 . 0))
|
||||
|
||||
(defun posframe-poshandler-frame-top-left-or-right-other-corner (info)
|
||||
"Posframe's position handler.
|
||||
|
||||
This poshandler function let posframe align to top left or top right corner of frame,
|
||||
based on whether current window is relatively at left or right in the current frame.
|
||||
If window is at left, place posframe on right, and vice versa.
|
||||
(This is calculated by whether current window center is left or right to frame center)
|
||||
|
||||
The structure of INFO can be found in docstring of
|
||||
`posframe-show'."
|
||||
(let ((window-left (plist-get info :parent-window-left))
|
||||
(window-width (plist-get info :parent-window-width))
|
||||
(frame-width (plist-get info :parent-frame-width)))
|
||||
;; when equal, put posframe on right because content in window tend to be on left
|
||||
(if (<= (+ window-left (/ window-width 2))
|
||||
(/ frame-width 2))
|
||||
'(-1 . 0)
|
||||
'(0 . 0))))
|
||||
|
||||
(defun posframe-poshandler-frame-bottom-left-corner (info)
|
||||
"Posframe's position handler.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user