Function: org-mouse-keyword-replace-menu
org-mouse-keyword-replace-menu is a byte-compiled function defined in
org-mouse.el.gz.
Signature
(org-mouse-keyword-replace-menu KEYWORDS &optional GROUP ITEMFORMAT NOSURROUND)
Documentation
A helper function.
Returns a menu fragment consisting of KEYWORDS. When a keyword is selected, group GROUP of the current match is replaced by the keyword. The method ensures that both ends of the replacement are separated from the rest of the text in the buffer by individual spaces (unless NOSURROUND is non-nil).
The final entry of the menu is always "None", which removes the match.
ITEMFORMAT governs formatting of the elements of KEYWORDS. If it is a function, it is invoked with the keyword as the only argument. If it is a string, it is interpreted as the format string to (format ITEMFORMAT keyword). If it is neither a string nor a function, elements of KEYWORDS are used directly.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-mouse.el.gz
(defun org-mouse-keyword-replace-menu (keywords &optional group itemformat
nosurround)
"A helper function.
Returns a menu fragment consisting of KEYWORDS. When a keyword
is selected, group GROUP of the current match is replaced by the
keyword. The method ensures that both ends of the replacement
are separated from the rest of the text in the buffer by
individual spaces (unless NOSURROUND is non-nil).
The final entry of the menu is always \"None\", which removes the
match.
ITEMFORMAT governs formatting of the elements of KEYWORDS. If it
is a function, it is invoked with the keyword as the only
argument. If it is a string, it is interpreted as the format
string to (format ITEMFORMAT keyword). If it is neither a string
nor a function, elements of KEYWORDS are used directly."
(setq group (or group 0))
(let ((replace (org-mouse-match-closure
(if nosurround #'replace-match
#'org-mouse-replace-match-and-surround))))
(append
(org-mouse-keyword-menu
keywords
(lambda (keyword) (funcall replace keyword t t nil group))
(match-string group)
itemformat)
`(["None" org-mouse-remove-match-and-spaces
:style radio
:selected ,(not (member (match-string group) keywords))]))))