[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/cycle-at-point 0c07fc7f1f 16/18: Add cycle-at-point-preset
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/cycle-at-point 0c07fc7f1f 16/18: Add cycle-at-point-preset-override, useful for tree-sitter modes |
Date: |
Sun, 21 Apr 2024 21:59:38 -0400 (EDT) |
branch: elpa/cycle-at-point
commit 0c07fc7f1f4c2369fe59423f3227e32a7039b3b5
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Add cycle-at-point-preset-override, useful for tree-sitter modes
---
cycle-at-point.el | 12 +++++++++++-
readme.rst | 4 ++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/cycle-at-point.el b/cycle-at-point.el
index 566d632df3..56e81d0db4 100644
--- a/cycle-at-point.el
+++ b/cycle-at-point.el
@@ -54,6 +54,11 @@
;; ---------------------------------------------------------------------------
;; Custom Variables
+(defcustom cycle-at-point-preset-override nil
+ "The symbol to use for the preset, when nil the `major-mode' is used.
+You may wish to override this value to us a preset from a different major
mode."
+ :type '(choice (const nil) string))
+
(defvar-local cycle-at-point-list nil
"Buffer local list of literals to cycle.
@@ -303,7 +308,12 @@ The first is PRESET-ID to override the current
`major-mode'.
The second is QUIET, when non-nil, don't show a message
when the preset isn't found."
(unless preset-id
- (setq preset-id (symbol-name major-mode)))
+ (setq preset-id
+ (cond
+ (cycle-at-point-preset-override
+ cycle-at-point-preset-override)
+ (t
+ (symbol-name major-mode)))))
(let ((preset-sym (intern (concat "cycle-at-point-preset-" preset-id))))
(when (condition-case err
(progn
diff --git a/readme.rst b/readme.rst
index 74d5fb76e1..957fc2d825 100644
--- a/readme.rst
+++ b/readme.rst
@@ -112,6 +112,10 @@ Key binding example, using ``Alt-Shift-P``:
Customization
-------------
+``cycle-at-point-preset-override``
+ The identifier to use when loading a preset, this can be useful if you wish
the use the preset
+ from a different major-mode (especially in the case of tree-sitter major
modes).
+
``cycle-at-point-list``
Setting this value is optional, when left unset a preset will be used when
available.
- [nongnu] elpa/cycle-at-point c7e10161ab 18/18: Use important-return-value for functions, (continued)
- [nongnu] elpa/cycle-at-point c7e10161ab 18/18: Use important-return-value for functions, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point 18b1c9922a 09/18: Cleanup: remove redundant lambda quote, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point 83e9e4e674 04/18: Cleanup: use match-string without properties, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point 738a18d3b0 01/18: Change URL to codeberg, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point c88b42edea 07/18: Use recomplete-replace-in-region utility function, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point 319d30df35 08/18: Cleanup: emacs native format, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point 093c1cf2c9 10/18: Cleanup: formatting, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point e1529cda74 12/18: Cleanup: use pos-bol/eol as respecting fields isn't needed, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point 07bdd9c68c 14/18: Correct compatibility for pos-bol/eol for emacs <29.1, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point b80d6f8c95 13/18: Fix compatibility for pos-bol/eol for emacs <29.1, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point 0c07fc7f1f 16/18: Add cycle-at-point-preset-override, useful for tree-sitter modes,
ELPA Syncer <=
- [nongnu] elpa/cycle-at-point 3e7f631dea 15/18: Cleanup: reformat with updated elisp-autofmt, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point 215ea10e46 17/18: Bump emacs version 29.1, ELPA Syncer, 2024/04/21
- [nongnu] elpa/cycle-at-point 476172e214 11/18: Cleanup: add fill-column local variable, ELPA Syncer, 2024/04/21