[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 08ef38d 29/33: posframe: Add posframe-default-initialize-f
From: |
Feng Shu |
Subject: |
[elpa] master 08ef38d 29/33: posframe: Add posframe-default-initialize-function |
Date: |
Fri, 14 Dec 2018 06:21:18 -0500 (EST) |
branch: master
commit 08ef38d27dad266fb3f666890df4994db2346427
Author: Feng Shu <address@hidden>
Commit: Feng Shu <address@hidden>
posframe: Add posframe-default-initialize-function
* posframe.el (posframe-default-initialize-function): New variable,
user can use this function to set posframe buffer globally.
---
posframe.el | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/posframe.el b/posframe.el
index b629596..bb10ef5 100644
--- a/posframe.el
+++ b/posframe.el
@@ -123,6 +123,13 @@
:group 'posframe
:type 'boolean)
+(defcustom posframe-default-initialize-function nil
+ "The default :initialize function of `posframe-show'.
+
+If :initialize argument of `posframe-show' is nil, this function
+will be called as fallback."
+ :type 'function)
+
(defvar-local posframe--frame nil
"Record posframe's frame.")
@@ -377,7 +384,9 @@ user can set FACE-REMAP, more setting details can be found:
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 speed reason.
+in posframe-show, and only run once for speed reason, If INITIALIZE
+is nil, `posframe-default-initialize-function' will be used as
+fallback, user can use this variable to global set posframe buffer.
OVERRIDE-PARAMETERS is very powful, *all* the frame parameters
used by posframe's frame can be overrided by it.
@@ -416,9 +425,10 @@ you can use `posframe-delete-all' to delete all posframes."
;; Initialize
(unless posframe--initialized-p
- (when (functionp initialize)
- (funcall initialize)
- (setq posframe--initialized-p t)))
+ (let ((func (or initialize posframe-default-initialize-function)))
+ (when (functionp func)
+ (funcall func)
+ (setq posframe--initialized-p t))))
;; Move mouse to (0 . 0)
(posframe--mouse-banish parent-frame)
- [elpa] master 1ed5492 20/33: posframe: Add face-remap argument, (continued)
- [elpa] master 1ed5492 20/33: posframe: Add face-remap argument, Feng Shu, 2018/12/14
- [elpa] master baa2289 30/33: Change to looser line-end-style specification, Feng Shu, 2018/12/14
- [elpa] master a0dfcde 22/33: use empty posframe title for window manager, Feng Shu, 2018/12/14
- [elpa] master 9768b0a 18/33: posframe: support internal-border-width, Feng Shu, 2018/12/14
- [elpa] master d09e283 28/33: * posframe.el (posframe-show, posframe--initialized-p): Rename posframe--initialize-p to posframe--initialized-p, Feng Shu, 2018/12/14
- [elpa] master 02b446a 27/33: posframe: Add initialize argument to posframe-show, Feng Shu, 2018/12/14
- [elpa] master a8e1bda 16/33: Update README again., Feng Shu, 2018/12/14
- [elpa] master 09e3f19 32/33: bump to version 0.4.2, Feng Shu, 2018/12/14
- [elpa] master 575e902 26/33: * posframe.el (posframe-show): Remove useless space, Feng Shu, 2018/12/14
- [elpa] master 1b309a2 24/33: posframe: Add posframe-poshandler-frame-top-center, Feng Shu, 2018/12/14
- [elpa] master 08ef38d 29/33: posframe: Add posframe-default-initialize-function,
Feng Shu <=
- [elpa] master 945761d 21/33: posframe: cache posframe/parent-frame/parent-window's more info, Feng Shu, 2018/12/14
- [elpa] master 769adaa 33/33: Merge commit '09e3f1937d19243cfb02178540aaf5c78f2e2939', Feng Shu, 2018/12/14