[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/corfu-popup 3b649cce35 07/26: Patch out display-graphic-p
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/corfu-popup 3b649cce35 07/26: Patch out display-graphic-p call at compile time |
Date: |
Sun, 22 May 2022 12:58:15 -0400 (EDT) |
branch: elpa/corfu-popup
commit 3b649cce355f604602c0469814df937be49fdbf3
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Patch out display-graphic-p call at compile time
---
corfu-popup.el | 49 ++++++++++++++++++++++++-------------------------
1 file changed, 24 insertions(+), 25 deletions(-)
diff --git a/corfu-popup.el b/corfu-popup.el
index 047c032913..bf89f3f212 100644
--- a/corfu-popup.el
+++ b/corfu-popup.el
@@ -140,31 +140,30 @@ Show a vertical scroll bar of size BAR + 1 from LOth
line."
popon-pos))
nil))
-(eval-and-compile
- (defun corfu-popup--patch-out-display-graphic-p (fn name)
- "Patch out `display-graphic-p' in FN and define NAME to that \
-definition."
- (let* ((vc-follow-symlinks t)
- (definition (let ((position (find-function-noselect fn)))
- (with-current-buffer (car position)
- (save-excursion
- (goto-char (cdr position))
- (read (current-buffer)))))))
- (setf (nth 1 definition) name)
- (cl-labels ((patch-out
- (form)
- (cond
- ((equal form '(display-graphic-p))
- t)
- ((proper-list-p form)
- (mapcar #'patch-out form))
- (t
- form))))
- (eval (patch-out definition)))))
- (corfu-popup--patch-out-display-graphic-p
- 'corfu--auto-post-command 'corfu-popup--auto-post-command)
- (corfu-popup--patch-out-display-graphic-p
- 'corfu--in-region 'corfu-popup--in-region))
+(defmacro corfu-popup--patch-out-display-graphic-p (fn name)
+ "Patch out `display-graphic-p' in FN and define NAME to that definition."
+ (let* ((vc-follow-symlinks t)
+ (definition (let ((position (find-function-noselect fn)))
+ (with-current-buffer (car position)
+ (save-excursion
+ (goto-char (cdr position))
+ (read (current-buffer)))))))
+ (setf (nth 1 definition) name)
+ (cl-labels ((patch-out
+ (form)
+ (cond
+ ((equal form '(display-graphic-p))
+ t)
+ ((proper-list-p form)
+ (mapcar #'patch-out form))
+ (t
+ form))))
+ (patch-out definition))))
+
+(corfu-popup--patch-out-display-graphic-p
+ corfu--auto-post-command corfu-popup--auto-post-command)
+(corfu-popup--patch-out-display-graphic-p
+ corfu--in-region corfu-popup--in-region)
(define-minor-mode corfu-popup-mode
"Corfu popup on terminal."
- [nongnu] elpa/corfu-popup 73db5e4484 02/26: Add COPYING, (continued)
- [nongnu] elpa/corfu-popup 73db5e4484 02/26: Add COPYING, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup d46fe01493 05/26: Remove functions copied from Corfu, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 6ef3a87d69 08/26: Add some screenshots, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup aa0acdd12a 11/26: Clarify installation instructions, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup a52091075d 12/26: Fix typo, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup a75c704796 13/26: Add autoload cookie, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup cca92ac666 01/26: Working implementation, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 2c789f87f3 04/26: Remove hardcoded file path, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup e5c7035190 06/26: Fix byte compilation error, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 0effb93594 03/26: Fix typo, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 3b649cce35 07/26: Patch out display-graphic-p call at compile time,
ELPA Syncer <=
- [nongnu] elpa/corfu-popup 7a1fbd2676 09/26: Fix README, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup b2dd179e57 10/26: Fix typo, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 03b5c7a74c 14/26: Update terminal screenshots, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 9e1e2d3f04 16/26: Lower required Emacs version, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 0b2fd81ac0 17/26: Remove obsolete use of define-minor-mode, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 3a8e98a982 21/26: Rename corfu-popup to corfu-terminal, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 59730db33b 23/26: Don't ship images in packages, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 323a92088c 20/26: Fix popon breaking when right fringe is zero on graphical display (#3), ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup fcb35a8c45 24/26: Add user option to disable on GUI, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 2b4a7d7d16 18/26: Remove hardcoded popon height, ELPA Syncer, 2022/05/22