[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed 781f0ee 031/166: Make word object behave correctl
From: |
Clemens Radermacher |
Subject: |
[elpa] externals/objed 781f0ee 031/166: Make word object behave correctly with superword/subword-mode |
Date: |
Sun, 29 Dec 2019 08:20:55 -0500 (EST) |
branch: externals/objed
commit 781f0eeedb8e68862a895e83f1811775eac13983
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>
Make word object behave correctly with superword/subword-mode
---
objed-objects.el | 21 ++++++++++-----------
objed.el | 36 ++++++++++++++++++++++++++----------
2 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/objed-objects.el b/objed-objects.el
index f0bedf5..a4f5940 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1518,6 +1518,7 @@ comments."
:try-prev
(search-backward " " nil t))
+
(objed-define-object nil word
:atp
(looking-at "\\<")
@@ -1527,17 +1528,15 @@ comments."
'identifier)
:get-obj
(objed-make-object
- :obounds (if (bound-and-true-p subword-mode)
- (let ((find-word-boundary-function-table
subword-empty-char-table))
- (bounds-of-thing-at-point 'word))
- (bounds-of-thing-at-point 'word))
- :ibounds (if (and (bound-and-true-p subword-mode)
- (eq this-command 'forward-word))
- (save-excursion
- (forward-word -1)
- (bounds-of-thing-at-point 'word))
- (let ((find-word-boundary-function-table
- subword-find-word-boundary-function-table))
+ :obounds (bounds-of-thing-at-point 'word)
+ :ibounds (let* ((subword-mode t)
+ (superword-mode nil)
+ (find-word-boundary-function-table
+ subword-find-word-boundary-function-table))
+ (if (eq this-command 'forward-word)
+ (save-excursion
+ (forward-word -1)
+ (bounds-of-thing-at-point 'word))
(bounds-of-thing-at-point 'word))))
:try-next
(re-search-forward "\\<." nil t)
diff --git a/objed.el b/objed.el
index 8510a87..4044be5 100644
--- a/objed.el
+++ b/objed.el
@@ -661,12 +661,32 @@ selected one."
(define-key map "~" 'objed-undo-in-object)
;; general movement
- (define-key map "s" (objed--call-and-switch
- forward-word
- word))
- (define-key map "r" (objed--call-and-switch
- backward-word
- word))
+ (define-key map "s" (defun objed-forward-word ()
+ "Call `forward-word' and switch to object word"
+ (interactive)
+ (if (objed--inner-p)
+ (let* ((subword-mode t)
+ (superword-mode nil)
+ (find-word-boundary-function-table
+
subword-find-word-boundary-function-table))
+ (setq this-command 'forward-word)
+ (call-interactively 'forward-word))
+ (setq this-command 'forward-word)
+ (call-interactively 'forward-word))
+ (objed--switch-to 'word objed--obj-state)))
+ (define-key map "r" (defun objed-backward-word ()
+ "Call `forward-word' and switch to object word"
+ (interactive)
+ (if (objed--inner-p)
+ (let* ((subword-mode t)
+ (superword-mode nil)
+ (find-word-boundary-function-table
+
subword-find-word-boundary-function-table))
+ (setq this-command 'backward-word)
+ (call-interactively 'backward-word))
+ (setq this-command 'backward-word)
+ (call-interactively 'backward-word))
+ (objed--switch-to 'word objed--obj-state)))
(define-key map "S" 'objed-move-word-forward)
(define-key map "R" 'objed-move-word-backward)
@@ -1879,10 +1899,6 @@ Default to sexp at point."
Switches to inner object or object inside current one."
(interactive)
- (if (bound-and-true-p subword-mode)
- (subword-mode -1)
- (unless (objed--inner-p)
- (subword-mode 1)))
(objed--toggle-state))
- [elpa] externals/objed 4de1520 008/166: Improve paren insertion and wrapping in lisp modes, (continued)
- [elpa] externals/objed 4de1520 008/166: Improve paren insertion and wrapping in lisp modes, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 25111a3 010/166: Dont check buffer whe objed--buffer is gone, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 333b58c 014/166: Change indentation object to include leading ws, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 89e1e18 016/166: Also activate mc if only one fake cursor, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 0cb2593 017/166: Tweak sexp object, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed dc673b8 022/166: Fix for mc counting non fake cursor as cursor, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 252a1d3 021/166: For brackets, strings and comments switch to sexp on continuation, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 0fa1ea3 024/166: Default to sexp for continuation object, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed be2c78c 027/166: Fix word object for subword-mode, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 0956db5 029/166: Don't add additional undo bounds for numeric repeats, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 781f0ee 031/166: Make word object behave correctly with superword/subword-mode,
Clemens Radermacher <=
- [elpa] externals/objed a16418c 040/166: Refactor object-toggle-state, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed f9c3819 020/166: Tweak sexp object again, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 2701f73 026/166: Fix backward kill for continuation, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed bddcb432 032/166: Fix dosctring, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 8babcfc 030/166: Make obj state buffer local and keep it on movement, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed e6d306b 033/166: Don't exclude current object for objed-ace, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 32221a6 041/166: Remember object type for marked object, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 74204af 037/166: Add ability to jump to objects inside current one, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 87cdeee 039/166: Improve toggle state, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 6ae9bff 042/166: When repeating backward/forward until proceed to object boundary, Clemens Radermacher, 2019/12/29