emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/objed 1f09072 064/216: Improve file object


From: Stefan Monnier
Subject: [elpa] externals/objed 1f09072 064/216: Improve file object
Date: Tue, 8 Jan 2019 12:29:12 -0500 (EST)

branch: externals/objed
commit 1f09072048eccaabaf6eeb39f65a31b0d38169dd
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>

    Improve file object
---
 objed-objects.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index b761712..bcc07c1 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1371,14 +1371,17 @@ Ignores simple structured expressions like words or 
symbols."
 
 (objed-define-object nil file
   :atp
-  (looking-at "\\<")
+  (looking-at "/\\|\\\\")
   :get-obj
   ;; TODO: inner bounds without extension
-  (bounds-of-thing-at-point 'filename)
+  (let* ((bounds (bounds-of-thing-at-point 'filename))
+         (file (and bounds (buffer-substring (car bounds) (cdr bounds)))))
+    (when (and file (string-match "/\\|\\\\" file))
+      bounds))
   :try-next
-  (re-search-forward  "\\<." nil t)
+  (re-search-forward  "/\\|\\\\" nil t)
   :try-prev
-  (re-search-backward  ".\\>" nil t))
+  (re-search-backward  "/\\|\\\\" nil t))
 
 (objed-define-object nil defun
   :get-obj



reply via email to

[Prev in Thread] Current Thread [Next in Thread]