branch: externals/posframe
commit bf5bd2470ac8ac6f501abaf31045598ad1897432
Author: Štěpán Němec <[email protected]>
Commit: Štěpán Němec <[email protected]>
Improve logic in 'posframe-funcall'
There is not much point in searching for a buffer and selecting
a frame if we don't have a function to call.
Also touch up the doc string.
---
posframe.el | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/posframe.el b/posframe.el
index b0f01ca..d41a7f4 100644
--- a/posframe.el
+++ b/posframe.el
@@ -698,13 +698,12 @@ This posframe's buffer is BUFFER-OR-NAME."
(kill-buffer buffer-or-name)))
(defun posframe-funcall (buffer-or-name function &rest arguments)
- "Select posframe of BUFFER-OR-NAME's, and call FUNCTION.
-passing remaining ARGUMENTS to it."
- (when (get-buffer buffer-or-name)
- (with-current-buffer buffer-or-name
- (when (framep posframe--frame)
- (with-selected-frame posframe--frame
- (when (functionp function)
+ "Select posframe of BUFFER-OR-NAME and call FUNCTION with ARGUMENTS."
+ (when (functionp function)
+ (when (get-buffer buffer-or-name)
+ (with-current-buffer buffer-or-name
+ (when (framep posframe--frame)
+ (with-selected-frame posframe--frame
(apply function arguments)))))))
;;;###autoload