[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/posframe bf5bd24 14/40: Improve logic in 'posframe-func

From: Feng Shu
Subject: [elpa] externals/posframe bf5bd24 14/40: Improve logic in 'posframe-funcall'
Date: Wed, 5 Feb 2020 04:27:18 -0500 (EST)

branch: externals/posframe
commit bf5bd2470ac8ac6f501abaf31045598ad1897432
Author: Štěpán Němec <address@hidden>
Commit: Štěpán Němec <address@hidden>

    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)))))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]