[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 450cf9d9e7 5/6: Remove content-handler
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu 450cf9d9e7 5/6: Remove content-handler |
Date: |
Sat, 4 Jun 2022 13:57:23 -0400 (EDT) |
branch: externals/corfu
commit 450cf9d9e77906a986f82d6f1d409b5fc66e9175
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Remove content-handler
It is better to instead run
(with-current-buffer " *corfu-doc*"
(visual-line-mode 1))
after frame creation. Also instead of calling visual-line-mode
it may make more sense to instead set the variables directly.
The mode doesn't do much more than setting a bunch of variables.
---
corfu.el | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/corfu.el b/corfu.el
index 978b90162a..734d33ddf4 100644
--- a/corfu.el
+++ b/corfu.el
@@ -369,7 +369,7 @@ The completion backend can override this with
map)
"Ignore all mouse clicks.")
-(defun corfu--make-buffer (content buffer-name &optional content-handler)
+(defun corfu--make-buffer (content buffer-name)
"Create buffer with CONTENT and a specified BUFFER-NAME.
CONTENT-HANDLER is a function called with the inserted buffer content."
@@ -388,12 +388,10 @@ CONTENT-HANDLER is a function called with the inserted
buffer content."
(inhibit-read-only t))
(erase-buffer)
(insert content)
- (when content-handler (funcall content-handler))
(goto-char (point-min))))
buffer))
-(defun corfu--make-frame-1 (content buffer-name frame frame-params
- &optional content-handler)
+(defun corfu--make-frame-1 (content buffer-name frame frame-params)
"Make child frame with CONTENT.
The BUFFER-NAME and CONTENT-HANDLER parameters are the same as
@@ -404,7 +402,7 @@ The extra frame parameters can be specified with
FRMAE-PARAMS.
The created frame can be accessed via FRAME."
(let* ((after-make-frame-functions)
(border (alist-get 'child-frame-border-width frame-params))
- (buffer (corfu--make-buffer content buffer-name content-handler))
+ (buffer (corfu--make-buffer content buffer-name))
(parent (window-frame)))
(unless (and (frame-live-p frame)
(eq (frame-parent frame) parent))
@@ -469,8 +467,7 @@ The created frame can be accessed via FRAME."
;; Function adapted from posframe.el by tumashu
(defun corfu--make-frame (x y width height content
- buffer-name frame frame-params
- &optional content-handler)
+ buffer-name frame frame-params)
"Show child frame at X/Y with WIDTH/HEIGHT and CONTENT.
The rest of the parameters are the same as the corresponding parameters
@@ -478,7 +475,7 @@ in `corfu--make-frame-1'."
(let ((parent (window-frame))
(frame
(corfu--make-frame-1
- content buffer-name frame frame-params content-handler)))
+ content buffer-name frame frame-params)))
(corfu--set-frame-position frame x y width height 'hack-redisplay)
(redirect-frame-focus frame parent)
frame))
- [elpa] externals/corfu updated (a262a21432 -> 0bc9262131), ELPA Syncer, 2022/06/04
- [elpa] externals/corfu 68891b5585 3/6: Add corfu--set-frame-position, ELPA Syncer, 2022/06/04
- [elpa] externals/corfu 450cf9d9e7 5/6: Remove content-handler,
ELPA Syncer <=
- [elpa] externals/corfu 4ca248a090 1/6: Generalize `corfu--make-buffer' and `corfu--make-frame', ELPA Syncer, 2022/06/04
- [elpa] externals/corfu 13a6f6b57d 2/6: Set the fringe background color for the created child frame, ELPA Syncer, 2022/06/04
- [elpa] externals/corfu 175835dc0c 4/6: Extract corfu--make-frame-1 from corfu--make-frame, ELPA Syncer, 2022/06/04
- [elpa] externals/corfu 0bc9262131 6/6: Refactor corfu--make-frame, ELPA Syncer, 2022/06/04