[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/latex-table-wizard da4a2e3540 24/70: Made into a minor
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/latex-table-wizard da4a2e3540 24/70: Made into a minor mode |
|
Date: |
Sat, 13 May 2023 08:59:11 -0400 (EDT) |
branch: externals/latex-table-wizard
commit da4a2e354026e0e88cb24283b68c42a7b742db49
Author: Enrico Flor <nericoflor@gmail.com>
Commit: Enrico Flor <nericoflor@gmail.com>
Made into a minor mode
---
latex-table-wizard.el | 46 +++++++++++++++-------------------------------
1 file changed, 15 insertions(+), 31 deletions(-)
diff --git a/latex-table-wizard.el b/latex-table-wizard.el
index be33738338..c514f5c827 100644
--- a/latex-table-wizard.el
+++ b/latex-table-wizard.el
@@ -813,7 +813,6 @@ THING is either \\='cell\\=', \\='column\\=' or
\\='row\\='."
;;; Interactive functions
-;;;###autoload
(defun latex-table-wizard-clean-whitespace ()
"Remove excess whitespace from cell borders."
(interactive)
@@ -827,7 +826,6 @@ THING is either \\='cell\\=', \\='column\\=' or
\\='row\\='."
(goto-char x)
(just-one-space)))))
-;;;###autoload
(defun latex-table-wizard-align ()
"Align and format table at point.
@@ -862,7 +860,6 @@ delimiters."
(string-to-char " ")))))))
(setq count (1+ count)))))))
-;;;###autoload
(defun latex-table-wizard-right (&optional n)
"Move point N cells to the right.
@@ -875,7 +872,6 @@ leftmost cell of the row below where point is."
(interactive "p")
(latex-table-wizard--jump 'forward nil n))
-;;;###autoload
(defun latex-table-wizard-left (&optional n)
"Move point N cells to the left.
@@ -888,7 +884,6 @@ rightmost cell of the row above where point is."
(interactive "p")
(latex-table-wizard--jump 'backward nil n))
-;;;###autoload
(defun latex-table-wizard-down (&optional n)
"Move point N cells down.
@@ -901,7 +896,6 @@ the column to the right of where point is."
(interactive "p")
(latex-table-wizard--jump 'next nil n))
-;;;###autoload
(defun latex-table-wizard-up (&optional n)
"Move point N cells up.
@@ -914,45 +908,38 @@ of the column to the left of where point is."
(interactive "p")
(latex-table-wizard--jump 'previous nil n))
-;;;###autoload
(defun latex-table-wizard-end-of-row ()
"Move point to the rightmost cell in current row."
(interactive)
(latex-table-wizard--jump 'forward t))
-;;;###autoload
(defun latex-table-wizard-beginning-of-row ()
"Move point to the leftmost cell in current row."
(interactive)
(latex-table-wizard--jump 'backward t))
-;;;###autoload
(defun latex-table-wizard-bottom ()
"Move point to the bottom cell in current column."
(interactive)
(latex-table-wizard--jump 'next t))
-;;;###autoload
(defun latex-table-wizard-top ()
"Move point to the top cell in current column."
(interactive)
(latex-table-wizard--jump 'previous t))
-;;;###autoload
(defun latex-table-wizard-end-of-cell ()
"Move point to the end of the current cell."
(interactive)
(let ((cell (latex-table-wizard--get-thing 'cell)))
(goto-char (plist-get cell :end))))
-;;;###autoload
(defun latex-table-wizard-beginning-of-cell ()
"Move point to the beginning of the current cell."
(interactive)
(let ((cell (latex-table-wizard--get-thing 'cell)))
(goto-char (plist-get cell :start))))
-;;;###autoload
(defun latex-table-wizard-mark-cell ()
"Mark current cell.
@@ -964,55 +951,46 @@ TABLE is a list of cell plists. If it is nil, evaluate
(push-mark (plist-get cell :start) nil t)
(goto-char (plist-get cell :end))))
-;;;###autoload
(defun latex-table-wizard-swap-column-right ()
"Swap current column and the one to the right."
(interactive)
(latex-table-wizard--swap-adjacent-line 'forward 'column))
-;;;###autoload
(defun latex-table-wizard-swap-column-left ()
"Swap current column and the one to the left."
(interactive)
(latex-table-wizard--swap-adjacent-line 'backward 'column))
-;;;###autoload
(defun latex-table-wizard-swap-row-up ()
"Swap current row and the one above."
(interactive)
(latex-table-wizard--swap-adjacent-line 'previous 'row))
-;;;###autoload
(defun latex-table-wizard-swap-row-down ()
"Swap current row and the one below."
(interactive)
(latex-table-wizard--swap-adjacent-line 'next 'row))
-;;;###autoload
(defun latex-table-wizard-swap-cell-right ()
"Swap content of current cell and the one to the right."
(interactive)
(latex-table-wizard--swap-adjacent-line 'forward 'cell))
-;;;###autoload
(defun latex-table-wizard-swap-cell-left ()
"Swap content of current cell and the one to the left."
(interactive)
(latex-table-wizard--swap-adjacent-line 'backward 'cell))
-;;;###autoload
(defun latex-table-wizard-swap-cell-down ()
"Swap content of current cell and the one below."
(interactive)
(latex-table-wizard--swap-adjacent-line 'next 'cell))
-;;;###autoload
(defun latex-table-wizard-swap-cell-up ()
"Swap content of current cell and the one above."
(interactive)
(latex-table-wizard--swap-adjacent-line 'previous 'cell))
-;;;###autoload
(defun latex-table-wizard-insert-column ()
"Insert empty column to the right of the one at point."
(interactive)
@@ -1024,7 +1002,6 @@ TABLE is a list of cell plists. If it is nil, evaluate
(goto-char (plist-get x :end))
(insert " " col-del " ")))))
-;;;###autoload
(defun latex-table-wizard-kill-column ()
"Kill content of column at point."
(interactive)
@@ -1042,7 +1019,6 @@ TABLE is a list of cell plists. If it is nil, evaluate
(kill-new (latex-table-wizard--disjoin
(nreverse kills) "\n")))))
-;;;###autoload
(defun latex-table-wizard-insert-row ()
"Insert empty row below the one at point."
(interactive)
@@ -1067,7 +1043,6 @@ TABLE is a list of cell plists. If it is nil, evaluate
(insert " " col-del))
(insert " " row-del "\n")))))
-;;;###autoload
(defun latex-table-wizard-kill-row ()
"Kill row at point."
(interactive)
@@ -1077,19 +1052,16 @@ TABLE is a list of cell plists. If it is nil, evaluate
(latex-table-wizard--get-thing 'row table))))
(kill-region (car b-e) (cdr b-e)))))
-;;;###autoload
(defun latex-table-wizard-select-cell ()
"Add cell at point to selection for swapping."
(interactive)
(latex-table-wizard--select-thing 'cell))
-;;;###autoload
(defun latex-table-wizard-select-row ()
"Add row at point to selection for swapping."
(interactive)
(latex-table-wizard--select-thing 'row))
-;;;###autoload
(defun latex-table-wizard-select-column ()
"Add column at point to selection for swapping."
(interactive)
@@ -1120,7 +1092,6 @@ TABLE is a list of cell plists. If it is nil, evaluate
(latex-table-wizard--remove-overlays)
(setq latex-table-wizard--selection nil))
-;;;###autoload
(defun latex-table-wizard-swap ()
"Swap selection and thing at point.
@@ -1256,16 +1227,29 @@ Only remove them in current buffer."
(1-)
(goto-char))))
+(define-minor-mode latex-table-wizard-mode
+ "Minor mode for editing LaTeX table-like environemnts."
+ :init-value nil
+ :global nil
+ :lighter " ltw"
+ :group 'convenience
+ (if latex-table-wizard-mode
+ (progn
+ (add-hook 'before-save-hook #'latex-table-wizard--cleanup nil t)
+ (add-hook 'transient-exit-hook #'latex-table-wizard--cleanup nil t))
+ (remove-hook 'before-save-hook #'latex-table-wizard--cleanup t)
+ (remove-hook 'transient-exit-hook #'latex-table-wizard--cleanup t)))
+
;;;###autoload
(defun latex-table-wizard-do ()
"Edit table-like environment with a transient interface."
(interactive)
+ (unless latex-table-wizard-mode
+ (latex-table-wizard-mode 1))
(latex-table-wizard--get-out)
(latex-table-wizard--hide-rest)
(call-interactively #'latex-table-wizard-prefix))
-(advice-add #'transient-quit-one :before #'latex-table-wizard--cleanup)
-
(provide 'latex-table-wizard)
;;; _
- [elpa] externals/latex-table-wizard 723e619753 09/70: Generalize insert functions, (continued)
- [elpa] externals/latex-table-wizard 723e619753 09/70: Generalize insert functions, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard b4b8b8bf52 13/70: Update readme for 0.0.3, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard de5a922da6 14/70: Remove useless calls to format, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard e3119802f7 15/70: Expand Commentary section, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 3b53c528c7 19/70: Clarify commentary and fix typo, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 1abac6974f 08/70: Fix problem when no space before delimiters, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 809dff99ef 11/70: Make syntax-quoted forms everywhere, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 74d169f8df 20/70: Two bug fixes, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 4f3f4011ab 22/70: Add group for face and remove before-save-hook, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard acdd4d8b56 23/70: New interactive function that calls transient prefix, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard da4a2e3540 24/70: Made into a minor mode,
ELPA Syncer <=
- [elpa] externals/latex-table-wizard f9fb0ae878 28/70: Cleanup and some bug fixed, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 9ce3165694 32/70: Add center and right alignment, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard e3553c7759 34/70: Add feedback about cell jumps, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 13359e40f6 44/70: rename readme, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard f290f87949 45/70: add empty changelog file, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 3bafcbefeb 49/70: Update commentary section, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 36e68b0fd8 48/70: Add .elpaignore, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 85af90dac4 52/70: Use TeX-comment-forward, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard ff8c832ad0 53/70: Version 1.1.0, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 71b7b2c252 55/70: Update copyright year and fix bug, ELPA Syncer, 2023/05/13