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

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

[elpa] externals/valign 07585a7 142/198: Change advice


From: Stefan Monnier
Subject: [elpa] externals/valign 07585a7 142/198: Change advice
Date: Tue, 1 Dec 2020 18:19:35 -0500 (EST)

branch: externals/valign
commit 07585a7b8a71231983afc7eafe6f4327750efc33
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Change advice
    
    * valign.el (valign-mode, valign-remove-advice): Change
    'org-table--align-field' to 'org-cycle' and 'org-table-blank-field'.
---
 valign.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/valign.el b/valign.el
index 9b6b3a9..a0eec4c 100644
--- a/valign.el
+++ b/valign.el
@@ -635,7 +635,8 @@ FLAG is the same as in ‘org-flag-region’."
 (defun valign-remove-advice ()
   "Remove advices added by valign."
   (interactive)
-  (dolist (fn '(org-table--align-field
+  (dolist (fn '(org-cycle
+                org-table-blank-field
                 markdown-table-align))
     (advice-remove fn #'valign--tab-advice))
   (dolist (fn '(text-scale-increase
@@ -659,7 +660,15 @@ FLAG is the same as in ‘org-flag-region’."
     (if valign-mode
         (progn
           (add-hook 'jit-lock-functions #'valign-region 98 t)
-          (dolist (fn '(org-table--align-field
+          (dolist (fn '(org-cycle
+                        ;; Why this function?  If you tab into an org
+                        ;; field (cell) and start typing right away,
+                        ;; org clears that field for you with this
+                        ;; function.  The problem is, this functions
+                        ;; messes up the overlay and makes the bar
+                        ;; invisible.  So we have to fix the overlay
+                        ;; after this function.
+                        org-table-blank-field
                         markdown-table-align))
             (advice-add fn :after #'valign--tab-advice))
           (dolist (fn '(text-scale-increase



reply via email to

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