Is it possible to write a function with completion that act on region?
A mix of:
(defun function-style (style) (interactive (list (completing-read "Style: " styles-list))) ...
(defun function-style (beg end) (interactive "r") ....
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
You can use any elisp functions to generate the arguments for an
interactive call. The code you use should return a list that matches the function arguments:
(defun my-function (beg end style) (interactive (let ((string (completing-read "Style: " styles-list))) (list (region-beginning) (region-end) string))) <function body> )
See the the manual node (elisp) Using Interactive for details.