Suggest region contents in highlight-regexp when region active
* lisp/hi-lock.el (hi-lock-face-buffer): Use the region in the prompt if the region is active in transient-mark-mode (bug#43641).
This commit is contained in:
parent
3a95f4fc12
commit
27e1649977
1 changed files with 7 additions and 1 deletions
|
@ -484,7 +484,13 @@ the major mode specifies support for Font Lock."
|
|||
(interactive
|
||||
(list
|
||||
(hi-lock-regexp-okay
|
||||
(read-regexp "Regexp to highlight" 'regexp-history-last))
|
||||
(read-regexp "Regexp to highlight"
|
||||
(if (use-region-p)
|
||||
(prog1
|
||||
(buffer-substring (region-beginning)
|
||||
(region-end))
|
||||
(deactivate-mark))
|
||||
'regexp-history-last)))
|
||||
(hi-lock-read-face-name)
|
||||
current-prefix-arg))
|
||||
(or (facep face) (setq face 'hi-yellow))
|
||||
|
|
Loading…
Add table
Reference in a new issue