emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/ivy-posframe 187288c 167/195: accept declare form


From: Feng Shu
Subject: [elpa] externals/ivy-posframe 187288c 167/195: accept declare form
Date: Sat, 3 Oct 2020 07:12:06 -0400 (EDT)

branch: externals/ivy-posframe
commit 187288c873f8838b170cc962da8f655af26acb2e
Author: conao3 <conao3@gmail.com>
Commit: conao3 <conao3@gmail.com>

    accept declare form
---
 ivy-posframe.el | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/ivy-posframe.el b/ivy-posframe.el
index 9627cd4..8e75bbe 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -478,11 +478,18 @@ The return value is undefined.
 
 \(fn NAME ARGLIST &optional DOCSTRING DECL &rest BODY)"
   (declare (doc-string 3) (indent 2))
-  `(defun ,name ,arglist
-     ,(when (stringp docstring) docstring)
-     (when (display-graphic-p)
-       ,(unless (stringp docstring) docstring)
-       ,@body)))
+  (let ((decls (cond
+                ((eq (car-safe docstring) 'declare)
+                 (prog1 (cdr docstring) (setq docstring nil)))
+                ((and (stringp docstring)
+                      (eq (car-safe (car body)) 'declare))
+                 (prog1 (cdr (car body)) (setq body (cdr body)))))))
+    `(defun ,name ,arglist
+       ,(when (stringp docstring) docstring)
+       (declare ,@decls)
+       (when (display-graphic-p)
+         ,(unless (stringp docstring) docstring)
+         ,@body))))
 
 (ivy-posframe--defun-advice ivy-posframe--minibuffer-setup (fn &rest args)
   "Advice function of FN, `ivy--minibuffer-setup' with ARGS."



reply via email to

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