[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed bb5d097 11/21: Improve file object
From: |
Clemens Radermacher |
Subject: |
[elpa] externals/objed bb5d097 11/21: Improve file object |
Date: |
Sun, 17 Mar 2019 15:00:17 -0400 (EDT) |
branch: externals/objed
commit bb5d097ee6c98cf13117abeffe757f2a25da0e76
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>
Improve file object
---
objed-objects.el | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/objed-objects.el b/objed-objects.el
index 66ee922..6c5a6f0 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1605,15 +1605,27 @@ comments."
:atp
(looking-at "/\\|\\\\")
:get-obj
- ;; TODO: inner bounds without extension
(let* ((bounds (bounds-of-thing-at-point 'filename))
(file (and bounds (buffer-substring (car bounds) (cdr bounds)))))
- (when (and file (string-match "/\\|\\\\" file))
- bounds))
+ (when (and file (string-match (rx (or (and bos (or "/" "\\"))
+ (and "." (* alnum) eos)))
+ file))
+ (objed-make-object :obounds bounds
+ :ibounds
+ (let ((ifile (or (file-name-directory file)
+ (file-name-sans-extension file))))
+ (when ifile
+ (goto-char (car bounds))
+ (search-forward ifile)
+ (cons (match-beginning 0) (match-end 0)))))))
:try-next
- (re-search-forward "/\\|\\\\" nil t)
+ (re-search-forward (rx (or (or "/" "\\")
+ (and "." (* alnum))))
+ nil t)
:try-prev
- (re-search-backward "/\\|\\\\" nil t))
+ (re-search-backward (rx (or (or "/" "\\")
+ (and "." (* alnum))))
+ nil t))
(objed-define-object nil mail
:get-obj
- [elpa] externals/objed 4bb1b90 12/21: Add url object, (continued)
- [elpa] externals/objed 4bb1b90 12/21: Add url object, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed 7627082 13/21: Don't ignore search errors, error with not other object found msg., Clemens Radermacher, 2019/03/17
- [elpa] externals/objed 998563a 06/21: Remove redundant :group declarations, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed e9bf605 07/21: Refactor objec-replace, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed 85019a8 14/21: Add raise command, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed c9b7c2a 05/21: Fix var not defined for edit-indirect, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed 2274a94 02/21: Add package-lint to linting tests, and fix its errors/warnings, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed 6ea0268 01/21: Buffer switch: Keep objed--object if possible, and update highlight, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed 1054cd8 03/21: Compile tests like elpa does, and fix the compile errors in tests, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed f5cc1ce 15/21: Remove binding for disfunct objed repeat, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed bb5d097 11/21: Improve file object,
Clemens Radermacher <=
- [elpa] externals/objed 96d5bc9 10/21: Add mail object, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed cc6c36f 08/21: Derive package name from current dir, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed be0cd7c 09/21: Fix identifier immediate jumping if used as last command, Clemens Radermacher, 2019/03/17
- [elpa] externals/objed 5a52e13 04/21: Remove load message, Clemens Radermacher, 2019/03/17