-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow custom 'word', 'symbol' definitions (#596)
* Allow custom 'word', 'symbol' definitions Allows users to customize the behavior of the commands related to marking and moving by words and symbols. Make all commands related to words and symbols rely on `forward-thing' and `bounds-of-thing-at-point'. Then, define the 'thing's that these functions are called on in `meow-word-thing' and `meow-symbol-thing'. Now the user can define their own things and make Meow use them by setting these variables. Meow users may find Emacs' default notions of 'word' and 'symbol' to be unsatisfactory for modal editing. For example, word movements tend to skip over non-alphanumeric characters, meaning that `meow-next-word' and `meow-back-word' will skip them when not expanding a selection. This commit allows users to redefine these notions via `thingatpt'. With this change, every Meow motion is now customizable. The only exception is `meow-line'; it should not be necessary to change its behavior since Meow already provides `meow-visual-line'. * Consolidate, thingatpt-ify 'word', 'symbol' logic In addition to all commands related to words and symbols now relying `forward-thing' and `bounds-of-thing-at-point', which use the things defined in `meow-word-thing' and `meow-symbol-thing', this commit consolidates the logic used by these commands into `meow-mark-thing', `meow-next-thing', `meow--fix-thing-selection-mark', `meow--forward-thing-1', and `meow--backward-thing-1'. This results in much less code duplication.
- Loading branch information
Showing
5 changed files
with
165 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters