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

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

[elpa] externals/objed 37d8657 4/9: Fix object dispatch, don't init twic


From: Clemens Radermacher
Subject: [elpa] externals/objed 37d8657 4/9: Fix object dispatch, don't init twice, return object on init
Date: Mon, 18 Mar 2019 13:20:57 -0400 (EDT)

branch: externals/objed
commit 37d86576a03a5a28be2a5c882df3b47495ec221d
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Fix object dispatch, don't init twice, return object on init
---
 objed-objects.el |  2 +-
 objed.el         | 50 ++++++++++++++++++++++++++------------------------
 2 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index 3fa9ff3..bb3b1a0 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -2192,7 +2192,7 @@ non-nil the indentation block can contain empty lines."
        (or (looking-at "<")
            (looking-back ">" 1)))
   :get-obj
-  ;; TODO: fix detection if point inside <..|..>
+  ;; TODO: fix sgml-backward not working
   (when (derived-mode-p 'sgml-mode)
     ;; like with bracket detect at boundary
     (objed-make-object
diff --git a/objed.el b/objed.el
index f903259..264aafe 100644
--- a/objed.el
+++ b/objed.el
@@ -228,6 +228,7 @@ function should return nil if objed should not initialize."
     (comint-next-prompt . output)
     (forward-button . face)
     (backward-button . face)
+    (sgml-skip-tag-backward . tag)
     (Info-next-reference . face)
     (Info-prev-reference . face)
     (objed-next-identifier . identifier)
@@ -530,7 +531,7 @@ update to given object."
     (cond (binding
            (funcall (cdr binding) name))
           (t
-           (when (objed--switch-to name)
+           (when (objed--init name)
              (goto-char (objed--beg)))))))
 
 
@@ -1253,29 +1254,30 @@ or object position data."
   (set-cursor-color objed-cursor-color)
 
   ;; init object
-  (cond ((commandp sym)
-         (objed--switch-to-object-for-cmd sym))
-        ((symbolp sym)
-         (objed--switch-to sym))
-        (t
-         (unless objed--object
-           (setq objed--object 'char))
-         ;; uses objed--object
-         (objed--update-current-object sym)))
-  ;; make sure the object is highlighted
-  (hl-line-highlight)
-
-  ;; transient map
-  (fset #'objed--exit-objed
-        (set-transient-map objed-map
-                           #'objed--keep-transient-p
-                           #'objed--reset))
-
-  (when objed-modeline-hint-p
-    (funcall objed-modeline-setup-func objed-mode-line-format))
-  ;; show which key after redisplay if active
-  (when objed-auto-wk-top-level-p
-    (run-at-time 0 nil #'objed-show-top-level)))
+  (prog1 (cond ((commandp sym)
+                (objed--switch-to-object-for-cmd sym))
+               ((symbolp sym)
+                (objed--switch-to sym))
+               (t
+                (unless objed--object
+                  (setq objed--object 'char))
+                ;; uses objed--object
+                (objed--update-current-object sym)))
+
+    ;; make sure the object is highlighted
+    (hl-line-highlight)
+
+    ;; transient map
+    (fset #'objed--exit-objed
+          (set-transient-map objed-map
+                             #'objed--keep-transient-p
+                             #'objed--reset))
+
+    (when objed-modeline-hint-p
+      (funcall objed-modeline-setup-func objed-mode-line-format))
+    ;; show which key after redisplay if active
+    (when objed-auto-wk-top-level-p
+      (run-at-time 0 nil #'objed-show-top-level))))
 
 
 (defun objed--setup-mode-line (format &optional reset)



reply via email to

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