summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-12-17`expand-region-custom.el`: update docstrings to pass `checkdoc`externals/expand-regionMichael Hoffman
Especially, fixes the following warning when `expand-region.el` is installed: package-quickstart.el:***:2: Warning: defvar `expand-region-exclude-text-mode-expansions' docstring wider than 80 characters
2024-09-19Tree-sitter support for Emacs 29+Alexander Adolf
er-basic-expansions.el (er/mark-ts-node): New function for expanding the region using Tree-sitter parse tree nodes when Tree-sitter is available and can parse the buffer around point. The new function is safe to add to the global base value of `er/try-expand-list` since it leaves the region unchanged when Tree-sitter information is not available.
2024-01-19Revert "expand-region-core: Fix excursions when expensive"Magnar Sveen
This reverts commit e1b099a62ff3c718d1bd8a100f516b3dff035dd2.
2024-01-19Revert "expand-region: Memoize expansion results"Magnar Sveen
This reverts commit af2916b89d8b5e520ff4ee7214bab62a0fdb3cec.
2024-01-04expand-region: Memoize expansion resultsKarthik Chikmagalur
expand-region-core.el (er--expand-region-1, er--saved-expansions): Use a new buffer-local variable, `er--saved-expansions`, to hold information about the point/mark returned by `er/try-expand-list'. If using `er/expand-region' or `er/contract-region' repeatedly, use this memoized data instead of recomputing all expansions. This speeds up expand-region significantly when there are a large number of or expensive functions in `er/try-expand-list'. expand-region.el (er/expand-region): Clear the saved expansion data in `er--saved-expansions` on the first (non-chained) invocation of `er/expand-region' or `er-contract-region`.
2024-01-04expand-region-core: Fix excursions when expensiveKarthik Chikmagalur
expand-region-core.el (er--expand-region-1, er--save-excursion): When `er-save-excursion` is expensive, such as when using Org-mode's `org-save-outline-visibility`, calling it repeatedly for each function in `er/try-expand-list' is prohibitive. Fix by only calling it once around the expansion trials, and using `save-mark-and-excursion` around each expansion function.
2023-10-20Release 1.0.0Magnar Sveen
2023-10-15Merge remote-tracking branch 'upstream/expand-region/main' into ↵Stefan Monnier
externals/expand-region
2023-10-15Update code for lexical-binding, cl-lib, and advice-addStefan Monnier
Activate `lexical-binding`. Use `advice-add` rather than `defadvice`. Avoid deprectaed `point-at-bol/eol`. Prefer #' to quote function names. Fix a few docstrings to silence compiler warnings. * cc-mode-expansions.el (er/c-define-construct): Fix ' in docstring. * enh-ruby-mode-expansions.el: Require `expand-region-core`. * er-basic-expansions.el (er/mark-next-accessor): Remove unused var `symbol-regexp`. * expand-region-core.el: Don't require `cl`. (er--show-expansion-message): Declare it. (er--first-invocation): Move before first use. (er--expand-region-1): Remove unused var `set-mark-default-inactive`. (er/set-temporary-overlay-map): Hoist definition outside of `if`. * expand-region-custom.el (expand-region-preferred-python-mode): Fix custom type. * expand-region.el: Explicitly require Emacs-24.4. * js-mode-expansions.el: Require `er-basic-expansions`. * ruby-mode-expansions.el (expand-region-core): Require `cl-lib` rather than `cl`. Require `er-basic-expansions`. (er/ruby-backward-up): Use `cl-loop`. (er/get-ruby-block): Remove unused vars `beg` and `end`. * the-org-mode-expansions.el (er-basic-expansions): Require `er-basic-expansions`. * yaml-mode-expansions.el: Re-add now that the author signed the paperwork.
2022-10-30Add autoload to contract-regionJen-Chieh Shen
2022-07-29Fix wrong type argument on Emacs 28.1Paulus Esterhazy
After upgrading from Emacs 27 to 28.1, loading expand-region breaks with the error message "Wrong type argument: stringp, (require . package)" This is due to using eval-after-load with a string argument. This odd call style was introduced in https://github.com/magnars/expand-region.el/pull/213 However, the assertion that text-mode is missing a provide call hasn't been true in 6 years: https://github.com/emacs-mirror/emacs/commit/f70f9a58c438d8b0677b1649ea7084d688ed53c8
2021-12-31Add GPLv3 license file (#272)Stefan Kangas
2021-12-28Add GNU ELPA badgeStefan Kangas
2021-07-08Cleaner buildakater
2021-07-02Revert "Revert "feat: add `er/mark-yaml-outer-block` & ↵Magnar Sveen
`er/mark-yaml-inner-block`"" This reverts commit 4419d5d52e24db530ec407f33cef361f485f46b9.
2021-07-02Revert "Revert "fix: misplaced parenthesis""Magnar Sveen
This reverts commit 1c291daf14d4a763a28d3b19f32a2443c1e6dd82.
2021-07-02Revert "Revert "refact: replace `if` with `unless` or `when` for more ↵Magnar Sveen
idiomatic code"" This reverts commit dc161a33951e7a74020a71592f66f340477074f0.
2021-07-02Revert "Revert "feat: add `yaml-mode` expansions""Magnar Sveen
This reverts commit 09ebc2df5ce3aac05e82367b2e42e7d0f3ff1656.
2021-07-01Revert "feat: add `yaml-mode` expansions"Magnar Sveen
This reverts commit 4168da1b9d1ea5fda64754e2226af15c11140889.
2021-07-01Revert "refact: replace `if` with `unless` or `when` for more idiomatic code"Magnar Sveen
This reverts commit 8f1e82537dd633b09a764943d62c8da613a486b4.
2021-07-01Revert "fix: misplaced parenthesis"Magnar Sveen
This reverts commit 2690fd46026de87a416beab56bf9896422a0a189.
2021-07-01Revert "feat: add `er/mark-yaml-outer-block` & `er/mark-yaml-inner-block`"Magnar Sveen
This reverts commit 6ed37a7c58549da761f5d9b6864192ff5e535bec.
2021-07-01Merge pull request #265 from jcs-PR/badgeAaron Gonzales
2021-06-24feat: add `er/mark-yaml-outer-block` & `er/mark-yaml-inner-block`Aaron Gonzales
This also makes some fixes to marking for list items
2021-06-24fix: misplaced parenthesisAaron Gonzales
2021-06-24refact: replace `if` with `unless` or `when` for more idiomatic codeAaron Gonzales
2021-06-24feat: add `yaml-mode` expansionsAaron Gonzales
2021-02-17Add installation instruction for use-packageAaron W. Swenson
Include a copy/paste example for installation via `use-package`.
2020-10-26Add badges to README.Jen-Chieh
2020-03-04Make usage message optionalmuffinmad
2020-03-02Replace deprecated 'cl package by 'cl-libThomas Hisch
2020-02-25Fix copyright and packaging for GNU ELPAStefan Monnier
* expand-region.el: Add `Version:` and `URL:` headers. * expand-region-pkg.el: Delete since GNU ELPA auto-generates it. * ruby-mode-expansions.el: Require `cl` to fix miscompilation. * .gitignore: Add ELPA-generated files. * <foo>.el files: Fix copyright header.
2020-02-24fix er/mark-commentJiangbin Zhao
- Don't call (forward-char 1) when point is at end of buffer. - If there are trailing spaces and tabs in comment, include them. - Don't include the non-whitespace char right before the comment prefix. In the following C function declaration, when the point is in the comment, calling er/mark-comment now selects the region between the two slashes (including the slashes). Without this fix, the region would start at the '('. void func(/* int arg */);
2020-01-06feat(org): add marking by elementMatus Goljer
2019-04-16Enable web-mode expansions properly (#257)Pengji Zhang
2019-03-28Update changelog, copyright, melpa linkAndrew Whatson
2019-03-27Disable subword expansions by defaultAndrew Whatson
Adds customizable variable `expand-region-subword-enabled` to control whether subword expansions are used, nil by default. Also adds a check so that subword expansions are disabled after leaving `subword-mode`.
2019-03-27Restore subword-mode-expansionsAndrew Whatson
This reverts commit 672e7c1842234f8c2d68bd98dc539e2180f69317.
2019-03-27Alternative solution for org-mode unfoldsAndrew Whatson
Adds a new variable `er/save-mode-excursion` which will be used to wrap expansion attempts if set. In `org-mode` buffers this facility is used to wrap actions with `org-save-outline-visibility`.
2019-03-26The unnecessary org-mode unfolds turns out to be necessaryMagnar Sveen
Reverted this since (require 'org) breaks spacemacs for some reason. This reverts commit 53233a0bbaffe5094dd91152bcfce7b027aefd3c.
2019-03-22Remove subword-mode, it doesn't play well with expand-regionMagnar Sveen
2019-03-21Update README.mdMagnar Sveen
2019-03-20Add maintenance warningMagnar Sveen
2019-03-19Must require 'org to use org-save-outline-visibilityMagnar Sveen
2019-03-19Avoid unnecessary org-mode unfoldsMagnar Sveen
Thanks to @kevinjfoley Closes #241
2019-03-12Add option to disable subword modeMagnar Sveen
To disable subword mode: `(setq er/enable-subword-mode? nil)` Closes #254
2019-03-04Fix automatic loading of subword-mode expansionsAndrew Whatson
2018-12-27Include negative argument explicit shortcut in the README (#250)Arturo Puente
2018-08-17Rephrase how contract-region is used. (#193)André Lindhjem
Attempt to clarify contract-region. I misunderstood this at first and wasted time attempting to define another `global-set-key` for contracting.
2018-08-17Better web-mode expand behavior (#221)Renato F
This works much better on web-mode.