[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/prop-menu 632ac43 4/9: Execute property-getting functions
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/prop-menu 632ac43 4/9: Execute property-getting functions with point at click location |
Date: |
Sun, 29 Aug 2021 11:29:15 -0400 (EDT) |
branch: elpa/prop-menu
commit 632ac43b7bc3acd8aade1b1487ca31702b4118c5
Author: David Raymond Christiansen <david@davidchristiansen.dk>
Commit: David Raymond Christiansen <david@davidchristiansen.dk>
Execute property-getting functions with point at click location
---
prop-menu.el | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/prop-menu.el b/prop-menu.el
index 8d47875..69b88a4 100644
--- a/prop-menu.el
+++ b/prop-menu.el
@@ -82,17 +82,23 @@ this variable with appropriate functions.")
When called interactively, WHERE defaults to point."
(interactive "d")
- (let* ((menu-items (prop-menu--items-for-location where))
- (selection (completing-read "Command: " menu-items nil t)))
- (when selection
- (let ((cmd (assoc selection menu-items)))
- (when cmd (funcall (cadr cmd)))))))
+ (let ((menu-items (prop-menu--items-for-location where)))
+ (when menu-items
+ (let ((selection (completing-read "Command: " menu-items nil t)))
+ (when selection
+ (let ((cmd (assoc selection menu-items)))
+ (when cmd (funcall (cadr cmd)))))))))
(defun prop-menu-show-menu (click)
- "Show a menu based on the location of CLICK, computed from the value of
`prop-menu-item-functions'."
+ "Show a menu based on the location of CLICK, computed from the value of
`prop-menu-item-functions'.
+
+When calling `prop-menu-item-functions', point is at the clicked
+location."
(interactive "e")
(let* ((where (posn-point (event-end click)))
- (menu-items (prop-menu--items-for-location where)))
+ (menu-items (save-excursion
+ (goto-char where)
+ (prop-menu--items-for-location where))))
(when menu-items
(let* ((menu (make-sparse-keymap))
(todo (cl-loop for (str action) in menu-items
- [nongnu] branch elpa/prop-menu created (now 50b102c), ELPA Syncer, 2021/08/29
- [nongnu] elpa/prop-menu 01ae5d4 1/9: Initial commit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/prop-menu 67db928 2/9: Increase the range of compatible Emacsen, ELPA Syncer, 2021/08/29
- [nongnu] elpa/prop-menu 0b38577 6/9: Initial Travis setup, ELPA Syncer, 2021/08/29
- [nongnu] elpa/prop-menu 65df241 3/9: Remove stale testing code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/prop-menu 632ac43 4/9: Execute property-getting functions with point at click location,
ELPA Syncer <=
- [nongnu] elpa/prop-menu 97a0ab1 7/9: Make Emacs 24.3 happy, ELPA Syncer, 2021/08/29
- [nongnu] elpa/prop-menu 2b0de81 5/9: Get properties from correct window on click, ELPA Syncer, 2021/08/29
- [nongnu] elpa/prop-menu 50b102c 9/9: Merge pull request #2 from david-christiansen/travis, ELPA Syncer, 2021/08/29
- [nongnu] elpa/prop-menu 1edda80 8/9: Version bump, ELPA Syncer, 2021/08/29