mirror of
https://github.com/protesilaos/dotfiles.git
synced 2026-09-10 07:16:20 -04:00
emacs: tweak prot-spell-spell-dwim
This commit is contained in:
parent
dccf91bbc8
commit
b3fd9ff91f
|
|
@ -13959,15 +13959,19 @@ Used by `prot-spell-change-dictionary'."
|
|||
|
||||
;;;###autoload
|
||||
(defun prot-spell-spell-dwim (beg end)
|
||||
"Spellcheck between BEG END, current word, or select dictionary.
|
||||
"Spell check between BEG END, current word, or select a dictionary.
|
||||
|
||||
Use `flyspell-region' on the active region. With point over a
|
||||
word and no active region invoke `ispell-word'. Else call
|
||||
`prot-spell-change-dictionary'."
|
||||
Use `flyspell-region' on the active region and deactivate the
|
||||
mark.
|
||||
|
||||
With point over a word and no active region invoke `ispell-word'.
|
||||
|
||||
Else call `prot-spell-change-dictionary'."
|
||||
(interactive "r")
|
||||
(cond
|
||||
((use-region-p)
|
||||
(flyspell-region beg end))
|
||||
(flyspell-region beg end)
|
||||
(deactivate-mark))
|
||||
((thing-at-point 'word)
|
||||
(call-interactively 'ispell-word))
|
||||
(t
|
||||
|
|
|
|||
|
|
@ -73,15 +73,19 @@ Used by `prot-spell-change-dictionary'."
|
|||
|
||||
;;;###autoload
|
||||
(defun prot-spell-spell-dwim (beg end)
|
||||
"Spellcheck between BEG END, current word, or select dictionary.
|
||||
"Spell check between BEG END, current word, or select a dictionary.
|
||||
|
||||
Use `flyspell-region' on the active region. With point over a
|
||||
word and no active region invoke `ispell-word'. Else call
|
||||
`prot-spell-change-dictionary'."
|
||||
Use `flyspell-region' on the active region and deactivate the
|
||||
mark.
|
||||
|
||||
With point over a word and no active region invoke `ispell-word'.
|
||||
|
||||
Else call `prot-spell-change-dictionary'."
|
||||
(interactive "r")
|
||||
(cond
|
||||
((use-region-p)
|
||||
(flyspell-region beg end))
|
||||
(flyspell-region beg end)
|
||||
(deactivate-mark))
|
||||
((thing-at-point 'word)
|
||||
(call-interactively 'ispell-word))
|
||||
(t
|
||||
|
|
|
|||
Loading…
Reference in a new issue