branch: externals/objed
commit 4fe7ed0bb60f2377bf33ba246f38116df78c178e
Author: Clemens Radermacher <[email protected]>
Commit: Clemens Radermacher <[email protected]>
Improve block expansion
---
objed.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/objed.el b/objed.el
index 38cb3a3..532010d 100644
--- a/objed.el
+++ b/objed.el
@@ -1436,20 +1436,21 @@ Objects which are built by lines of text.")
If IGNORE is non-nil it should be an object of
`objed--block-objects' which should be ignored."
- (let ((os (cond ((bound-and-true-p outline-minor-mode)
- objed--block-objects)
- ((eq major-mode 'org-mode)
+ (let ((os (cond ((eq major-mode 'org-mode)
(let ((os nil))
;; TODO: sort by object size?
(dolist (o objed--block-objects (nreverse os))
(unless (memq o '(indent textblock block))
(push o os)))))
+ ((and (derived-mode-p 'prog-mode)
+ (objed--in-string-or-comment-p))
+ objed--block-objects)
(t
;; performance is poor on slow
;; machines when searching after
;; every char with objed--get in case
;; there are no outlines/mode not active
- (remq 'section objed--block-objects)))))
+ (remq 'textblock objed--block-objects)))))
(remq ignore
(if (save-excursion
(and (or (not (derived-mode-p 'text-mode))