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

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

[elpa] externals/latex-table-wizard 04b3d59de7 65/70: Four new commands


From: ELPA Syncer
Subject: [elpa] externals/latex-table-wizard 04b3d59de7 65/70: Four new commands added to edit cell content
Date: Sat, 13 May 2023 08:59:15 -0400 (EDT)

branch: externals/latex-table-wizard
commit 04b3d59de71690e393a3ebeda26819deac6253d0
Author: Enrico Flor <enrico@eflor.net>
Commit: Enrico Flor <enrico@eflor.net>

    Four new commands added to edit cell content
---
 NEWS                    |   6 ++
 latex-table-wizard.el   | 162 ++++++++++++++++++++++++++++++++++++------------
 latex-table-wizard.info |  80 +++++++++++++++++-------
 latex-table-wizard.org  |  55 ++++++++++++----
 latex-table-wizard.texi |  54 ++++++++++++++--
 5 files changed, 279 insertions(+), 78 deletions(-)

diff --git a/NEWS b/NEWS
index 45ef96410d..5ba050d123 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,11 @@
 -*- mode: org -*-
 
+* 1.4
+** New commands:
+*** latex-table-wizard-edit-cell
+*** latex-table-wizard-copy-cell-content
+*** latex-table-wizard-yank-cell-content
+*** latex-table-wizard-kill-cell-content
 * 1.3.1
 ** Added new hook: latex-table-wizard-after-table-modified-hook
 This hook is ran whenever a latex-table-wizard command is called that
diff --git a/latex-table-wizard.el b/latex-table-wizard.el
index 805f479ae5..ad045cfaeb 100644
--- a/latex-table-wizard.el
+++ b/latex-table-wizard.el
@@ -5,7 +5,7 @@
 ;; Author: Enrico Flor <enrico@eflor.net>
 ;; Maintainer: Enrico Flor <enrico@eflor.net>
 ;; URL: https://github.com/enricoflor/latex-table-wizard
-;; Version: 1.3.2
+;; Version: 1.4.0
 ;; Keywords: convenience
 
 ;; Package-Requires: ((emacs "27.1") (auctex "12.1") (transient "0.3.7"))
@@ -271,8 +271,8 @@ measures needed for the parser not to be confused."
   (unless latex-table-wizard-allow-detached-args
     (let ((message-log-max 0))
       (message (concat "Warning: suspect detached macro found.\n"
-                       "If the table isn't parsed correctly,"
-                       "try to not separate arguments from macro,\n"
+                       "If the table isn't parsed correctly, "
+                       "try not to separate arguments from macro,\n"
                        "or set latex-table-wizard-allow-detached-args"
                        "to t.")))))
 
@@ -469,6 +469,9 @@ to the one that precedes point."
          (env-beg (save-excursion
                     (LaTeX-find-matching-begin)
                     (latex-table-wizard--goto-end-of-macro)
+                    (ignore-errors
+                      (latex-table-wizard--goto-end-of-macro
+                       (regexp-opt latex-table-wizard--current-hline-macros)))
                     (point-marker)))
          (env-end (save-excursion
                     (LaTeX-find-matching-end)
@@ -802,26 +805,28 @@ jump would move point to a different column (if DIR is 
either
 DIR is either \\='next\\=', \\='previous\\=')."
   (unless (ignore-errors (save-excursion (LaTeX-find-matching-begin)))
     (user-error "Not in a LaTeX environment"))
-  (let* ((message-log-max 0)
-         (cells (latex-table-wizard--parse-table))
-         (curr (latex-table-wizard--get-thing 'cell cells))
-         (target (if (not absolute)
-                     (latex-table-wizard--get-other-cell
-                      dir same-line count cells curr)
-                   (let ((sorted (latex-table-wizard--sort cells t dir)))
-                     (if (memq dir '(previous backward))
-                         (car sorted)
-                       (car (last sorted))))))
-         (stop (and nocycle (not (latex-table-wizard--shift dir curr cells)))))
-    (latex-table-wizard--remove-overlays cells)
-    (unless stop
+  (with-silent-modifications
+    (let* ((message-log-max 0)
+           (cells (latex-table-wizard--parse-table))
+           (curr (latex-table-wizard--get-thing 'cell cells))
+           (target (if (not absolute)
+                       (latex-table-wizard--get-other-cell
+                        dir same-line count cells curr)
+                     (let ((sorted (latex-table-wizard--sort cells t dir)))
+                       (if (memq dir '(previous backward))
+                           (car sorted)
+                         (car (last sorted))))))
+           (stop (and nocycle (not (latex-table-wizard--shift dir curr 
cells)))))
+
+      (latex-table-wizard--remove-overlays cells)
+      (unless stop
         ;; (goto-char (plist-get curr :start))
-      (goto-char (plist-get target :start))
-      (latex-table-wizard--hl-cells `(,target))
-      (latex-table-wizard--hl-cells latex-table-wizard--selection)
-      (message "Col X Row (%d,%d)"
-               (plist-get target :column)
-               (plist-get target :row)))))
+        (goto-char (plist-get target :start))
+        (latex-table-wizard--hl-cells `(,target))
+        (latex-table-wizard--hl-cells latex-table-wizard--selection)
+        (message "Col X Row (%d,%d)"
+                 (plist-get target :column)
+                 (plist-get target :row))))))
 
 
 
@@ -1501,12 +1506,96 @@ at point.  If it is none of those object, return nil."
       (setq latex-table-wizard--selection nil)
       (run-hooks 'latex-table-wizard-after-table-modified-hook))))
 
+(defun latex-table-wizard--fit-string (str len)
+  "If lenght of string STR is <= than number LEN, trim STR.
+
+That means, apply `string-trim' to STR.  Otherwise, pad STR left
+and right with equal amount of whitespace for it to reach length
+LEN."
+  (let ((nstr (string-trim str)))
+    (if (> (length nstr) len)
+      nstr
+      (let* ((diff (- len (length nstr)))
+
+             (right (make-string (/ diff 2) ?\s))
+             (left (make-string (- diff (/ diff 2)) ?\s)))
+        (concat left nstr right)))))
+
+(defun latex-table-wizard-edit-cell ()
+  "Edit cell at point."
+  (interactive)
+  (let* ((cell (latex-table-wizard--get-thing 'cell))
+         (current-text (buffer-substring (plist-get cell :start)
+                                         (plist-get cell :end)))
+         (len (length current-text))
+         (new-text (read-string "" (string-trim current-text) nil nil t)))
+    (delete-region (plist-get cell :start) (plist-get cell :end))
+    (goto-char (plist-get cell :start))
+    (insert (latex-table-wizard--fit-string new-text len))))
+
+(defvar-local latex-table-wizard--copied-cell-content nil
+  "The return value of `latex-table-wizard-copy-cell-content'.
+
+It replaces the content of current cell upon calling
+`latex-table-wizard-yank-cell-content'.")
+
+(defun latex-table-wizard-copy-cell-content ()
+  "Add content of current cell to the `kill-ring'.
+
+Also set the value of `latex-table-wizard--copied-cell-content'
+to it."
+  (interactive)
+  (let* ((cell (latex-table-wizard--get-thing 'cell))
+         (cont (buffer-substring (plist-get cell :start)
+                                 (plist-get cell :end))))
+    (setq latex-table-wizard--copied-cell-content cont)
+    (kill-new cont)
+    (message "Content of cell (%s,%s) copied"
+             (plist-get cell :column) (plist-get cell :row))))
+
+(defun latex-table-wizard-yank-cell-content ()
+  "Replace content of current cell with a previously copied one.
+
+That is whatever the current value of
+`latex-table-wizard--copied-cell-content'."
+  (interactive)
+  (if (not latex-table-wizard--copied-cell-content)
+      (user-error "No cell content copied")
+    (let* ((cell (latex-table-wizard--get-thing 'cell))
+           (len (length (buffer-substring (plist-get cell :start)
+                                          (plist-get cell :end)))))
+      (delete-region (plist-get cell :start) (plist-get cell :end))
+      (goto-char (plist-get cell :start))
+      (insert (latex-table-wizard--fit-string
+               latex-table-wizard--copied-cell-content
+               len)))))
+
+(defun latex-table-wizard-kill-cell-content ()
+  "Kill content of current cell and add it to the `kill-ring'.
+
+Also set the value of `latex-table-wizard--copied-cell-content'
+to it."
+  (interactive)
+  (let* ((cell (latex-table-wizard--get-thing 'cell))
+         (cont  (buffer-substring (plist-get cell :start)
+                                  (plist-get cell :end))))
+    (delete-region (plist-get cell :start) (plist-get cell :end))
+    (insert " ")
+    (kill-new cont)
+    (setq latex-table-wizard--copied-cell-content cont)
+    (message "Content of cell (%s,%s) copied"
+             (plist-get cell :column) (plist-get cell :row))))
+
 
 
 ;;; Transient
 
 (defconst latex-table-wizard-default-transient-keys
-  '((toggle-truncate-lines                   "t" "toggle truncate-lines")
+  '((latex-table-wizard-copy-cell-content    "w" "copy cell content")
+    (latex-table-wizard-yank-cell-content    "y" "yank cell content")
+    (latex-table-wizard-edit-cell            "." "edit cell")
+    (toggle-truncate-lines                   "t" "toggle truncate-lines")
+    (latex-table-wizard-kill-cell-content    "k k" "kill cell content")
     (latex-table-wizard-kill-row-content     "k r" "kill row content")
     (latex-table-wizard-kill-column-content  "k c" "kill column content")
     (latex-table-wizard-delete-row           "D r" "delete row")
@@ -1560,13 +1649,7 @@ information.")
 (defconst latex-table-wizard--interactive-commands
   (seq-concatenate
    'list
-   '(latex-table-wizard-comment-out-content
-     latex-table-wizard-comment-out
-     latex-table-wizard-kill-row-content
-     latex-table-wizard-kill-column-content
-     latex-table-wizard-delete-column
-     latex-table-wizard-delete-row
-     latex-table-wizard-align-left
+   '(latex-table-wizard-align-left
      latex-table-wizard-align-right
      latex-table-wizard-center
      latex-table-wizard-compress
@@ -1671,6 +1754,7 @@ suffixes provided by evaluating 
`latex-table-wizard--make-suffix'."
         ,(latex-table-wizard--make-suffix 'latex-table-wizard-insert-row)
         ,(latex-table-wizard--make-suffix 
'latex-table-wizard-kill-column-content)
         ,(latex-table-wizard--make-suffix 'latex-table-wizard-kill-row-content)
+        ,(latex-table-wizard--make-suffix 
'latex-table-wizard-kill-cell-content)
         ,(latex-table-wizard--make-suffix 'latex-table-wizard-delete-column)
         ,(latex-table-wizard--make-suffix 'latex-table-wizard-delete-row)
         ]
@@ -1678,12 +1762,14 @@ suffixes provided by evaluating 
`latex-table-wizard--make-suffix'."
         ,(latex-table-wizard--make-suffix 'latex-table-wizard-select-column)
         ,(latex-table-wizard--make-suffix 'latex-table-wizard-select-row)
         ,(latex-table-wizard--make-suffix 'latex-table-wizard-deselect-all)
-        ""
         ,(latex-table-wizard--make-suffix 'latex-table-wizard-swap)
         ""
         ,(latex-table-wizard--make-suffix 'latex-table-wizard-comment-out)
         ,(latex-table-wizard--make-suffix 
'latex-table-wizard-comment-out-content)
         ""
+        ,(latex-table-wizard--make-suffix 'latex-table-wizard-edit-cell)
+        ,(latex-table-wizard--make-suffix 
'latex-table-wizard-copy-cell-content)
+        ,(latex-table-wizard--make-suffix 
'latex-table-wizard-yank-cell-content)
         ,(latex-table-wizard--make-suffix 'toggle-truncate-lines)
         ,(latex-table-wizard--make-suffix 'latex-table-wizard-align)
         ,(latex-table-wizard--make-suffix 'undo)
@@ -1807,17 +1893,17 @@ Only remove them in current buffer.
 Remove unconditionally if IF-NOT-IN-CHAIN is nil, otherwise only
 remove if `last-command' but not `this-command' is in
 `latex-table-wizard--interactive-commands'."
-  (let ((exited (and (memq last-command
+  (let* ((this-comm-wiz (memq this-command
+                              latex-table-wizard--interactive-commands))
+         (exited (and (memq last-command
                            latex-table-wizard--interactive-commands)
-                     (not (memq this-command
-                                latex-table-wizard--interactive-commands)))))
+                      (not this-comm-wiz))))
     ;; now we want to remove stuff either if this function was called
     ;; "unconditionally" of if it seems like we exited a chain of
     ;; latex-table-wizard operations
-    (when (or (not if-not-in-chain) exited)
-      (when-let ((lims (car latex-table-wizard--parse)))
-        (remove-overlays (point-min) (point-max) 'tabl-inside-ol t)
-        (remove-overlays (point-min) (point-max) 'tabl-outside-ol t)))))
+    (when (or (not if-not-in-chain) exited (not this-comm-wiz))
+      (remove-overlays (point-min) (point-max) 'tabl-inside-ol t)
+      (remove-overlays (point-min) (point-max) 'tabl-outside-ol t))))
 
 (defsubst latex-table-wizard--clear-parse ()
   "Set value of `latex-table-wizard--parse' to nil.
diff --git a/latex-table-wizard.info b/latex-table-wizard.info
index 4e9a63e16c..11502f0156 100644
--- a/latex-table-wizard.info
+++ b/latex-table-wizard.info
@@ -1,4 +1,4 @@
-This is latex-table-wizard.info, produced by makeinfo version 6.8 from
+This is latex-table-wizard.info, produced by makeinfo version 7.0.2 from
 latex-table-wizard.texi.
 
 INFO-DIR-SECTION Emacs misc features
@@ -33,6 +33,7 @@ modify this GNU manual.”
 * Available commands::
 * Known issues::
 * Customization::
+* Example setup without Transient interface (Emacs 28 and later)::
 
 — The Detailed Node Listing —
 
@@ -223,16 +224,27 @@ File: latex-table-wizard.info,  Node: Mark kill and 
insert commands,  Next: Swap
 ==================================
 
 Command                                    Default key
---------------------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------------
+‘latex-table-wizard-edit-cell’             ‘.’           edit current cell
 ‘latex-table-wizard-mark-cell’             ‘m c’         mark current cell
 ‘latex-table-wizard-insert-column’         ‘i c’         insert empty column 
to the right
 ‘latex-table-wizard-insert-row’            ‘i r’         insert row below
+‘latex-table-wizard-copy-cell-content’     ‘w’           copy content of 
current cell
+‘latex-table-wizard-yank-cell-content’     ‘y’           replace and yank into 
current cell
+‘latex-table-wizard-kill-cell-content’     ‘k k’         kill content of 
current cell
 ‘latex-table-wizard-kill-column-content’   ‘k c’         kill content of 
current column
 ‘latex-table-wizard-kill-row-content’      ‘k r’         kill content of 
current row
 ‘latex-table-wizard-delete-column’         ‘D c’         delete current column
 ‘latex-table-wizard-delete-row’            ‘D r’         delete current row
 ‘exchange-point-and-mark’                  ‘x’
 
+   ‘latex-table-wizard-kill-cell-content’ and
+‘latex-table-wizard-copy-cell-content’ add the content of current cell
+both to the kill ring (like the default kill and copy commands) and to
+the value of a special variable: ‘latex-table-wizard-yank-cell-content’
+will replace the content of the current cell with whatever that value
+is.
+
    ‘latex-table-wizard-delete-column’ and
 ‘latex-table-wizard-delete-row’ modify the structure of the table (they
 actually remove the column/table, not just the content of the cells in
@@ -472,7 +484,7 @@ parser sees some text.
    So instead of ‘\\ \\’ we will have ‘\\ \blk{} \\’.
 
 
-File: latex-table-wizard.info,  Node: Customization,  Prev: Known issues,  Up: 
Top
+File: latex-table-wizard.info,  Node: Customization,  Next: Example setup 
without Transient interface (Emacs 28 and later),  Prev: Known issues,  Up: Top
 
 4 Customization
 ***************
@@ -668,28 +680,52 @@ suspect detached arguments.  The warning is just a 
message in the echo
 area right after the table is parsed.  If you want this, set the value
 of ‘latex-table-wizard-warn-about-detached-args’ to t.
 
+
+File: latex-table-wizard.info,  Node: Example setup without Transient 
interface (Emacs 28 and later),  Prev: Customization,  Up: Top
+
+5 Example setup without Transient interface (Emacs 28 and later)
+****************************************************************
+
+Since the interactive commands work independently from the
+functionalities provided by transient.el, you can build your own
+alternative interfaces easily if you prefer so.  For example, the code
+below uses ‘repeat-mode’ (built-in with Emacs 28 and later):
+
+     (require 'repeat)
+
+     (define-prefix-command 'latex-table-wizard-map)
+
+     (define-key global-map (kbd "C-c C-|") 'latex-table-wizard-map)
+
+     (dolist (c latex-table-wizard-transient-keys)
+       (define-key latex-table-wizard-map (kbd (cdr c)) (car c)))
+
+     (dolist (cmd (mapcar #'car latex-table-wizard-transient-keys))
+       (put cmd 'repeat-map 'latex-table-wizard-map))
+
 
 
 Tag Table:
-Node: Top97
-Node: Introduction1561
-Node: Available commands3702
-Node: Start editing4436
-Node: Relative motion commands4951
-Node: Absolute motion commands6897
-Node: Mark kill and insert commands7813
-Node: Swap adjacent fields9070
-Node: Swap arbitrary fields11126
-Node: Comment out cells13213
-Node: Format the table14092
-Node: Extra commands in the transient prefix16778
-Node: Known issues17455
-Node: Empty cells in single-column tables17649
-Node: Customization18429
-Node: Customize transient prefix18816
-Node: Define rules for new environments19605
-Node: Customizing faces23457
-Node: Detached arguments24825
+Node: Top99
+Node: Introduction1630
+Node: Available commands3771
+Node: Start editing4505
+Node: Relative motion commands5020
+Node: Absolute motion commands6966
+Node: Mark kill and insert commands7882
+Node: Swap adjacent fields9859
+Node: Swap arbitrary fields11915
+Node: Comment out cells14002
+Node: Format the table14881
+Node: Extra commands in the transient prefix17567
+Node: Known issues18244
+Node: Empty cells in single-column tables18438
+Node: Customization19218
+Node: Customize transient prefix19676
+Node: Define rules for new environments20465
+Node: Customizing faces24317
+Node: Detached arguments25685
+Node: Example setup without Transient interface (Emacs 28 and later)27946
 
 End Tag Table
 
diff --git a/latex-table-wizard.org b/latex-table-wizard.org
index b69cf894c6..0e8c141fc5 100644
--- a/latex-table-wizard.org
+++ b/latex-table-wizard.org
@@ -4,8 +4,8 @@
 #+EMAIL: enrico@eflor.net
 
 #+OPTIONS: ':t toc:t author:t email:t
-#+MACRO: version 1.3.0
-#+MACRO: updated last updated 18 December 2022
+#+MACRO: version 1.4.0
+#+MACRO: updated last updated 2 May 2023
 
     
[[https://melpa.org/#/latex-table-wizard][file:https://melpa.org/packages/latex-table-wizard-badge.svg]]
 
@@ -145,16 +145,27 @@ following expressions will return nil and won't move 
point:
 | ~latex-table-wizard-bottom~            | ~N~           | bottom cell in 
current column |
 | ~latex-table-wizard-top~               | ~P~           | top cell in current 
column    |
 ** Mark, kill and insert commands
-| Command                                | Default key |                       
           |
-|----------------------------------------+-------------+----------------------------------|
-| ~latex-table-wizard-mark-cell~           | ~m c~         | mark current cell 
               |
-| ~latex-table-wizard-insert-column~       | ~i c~         | insert empty 
column to the right |
-| ~latex-table-wizard-insert-row~          | ~i r~         | insert row below  
               |
-| ~latex-table-wizard-kill-column-content~ | ~k c~         | kill content of 
current column   |
-| ~latex-table-wizard-kill-row-content~    | ~k r~         | kill content of 
current row      |
-| ~latex-table-wizard-delete-column~       | ~D c~         | delete current 
column            |
-| ~latex-table-wizard-delete-row~          | ~D r~         | delete current 
row               |
-| ~exchange-point-and-mark~                | ~x~           |                   
               |
+| Command                                | Default key |                       
             |
+|----------------------------------------+-------------+------------------------------------|
+| ~latex-table-wizard-edit-cell~           | ~.~           | edit current cell 
                 |
+| ~latex-table-wizard-mark-cell~           | ~m c~         | mark current cell 
                 |
+| ~latex-table-wizard-insert-column~       | ~i c~         | insert empty 
column to the right   |
+| ~latex-table-wizard-insert-row~          | ~i r~         | insert row below  
                 |
+| ~latex-table-wizard-copy-cell-content~   | ~w~           | copy content of 
current cell       |
+| ~latex-table-wizard-yank-cell-content~   | ~y~           | replace and yank 
into current cell |
+| ~latex-table-wizard-kill-cell-content~   | ~k k~         | kill content of 
current cell       |
+| ~latex-table-wizard-kill-column-content~ | ~k c~         | kill content of 
current column     |
+| ~latex-table-wizard-kill-row-content~    | ~k r~         | kill content of 
current row        |
+| ~latex-table-wizard-delete-column~       | ~D c~         | delete current 
column              |
+| ~latex-table-wizard-delete-row~          | ~D r~         | delete current 
row                 |
+| ~exchange-point-and-mark~                | ~x~           |                   
                 |
+
+~latex-table-wizard-kill-cell-content~ and
+~latex-table-wizard-copy-cell-content~ add the content of current cell
+both to the kill ring (like the default kill and copy commands) and to
+the value of a special variable: ~latex-table-wizard-yank-cell-content~
+will replace the content of the current cell with whatever that value
+is.
 
 ~latex-table-wizard-delete-column~ and ~latex-table-wizard-delete-row~
 modify the structure of the table (they actually remove the
@@ -576,3 +587,23 @@ have the option to be warned when ~latex-table-wizard~ 
finds cases of
 suspect detached arguments.  The warning is just a message in the echo
 area right after the table is parsed.  If you want this, set the value
 of ~latex-table-wizard-warn-about-detached-args~ to t.
+
+* Example setup without Transient interface (Emacs 28 and later)
+Since the interactive commands work independently from the
+functionalities provided by transient.el, you can build your own
+alternative interfaces easily if you prefer so.  For example, the code
+below uses ~repeat-mode~ (built-in with Emacs 28 and later):
+
+#+begin_src emacs-lisp
+(require 'repeat)
+
+(define-prefix-command 'latex-table-wizard-map)
+
+(define-key global-map (kbd "C-c C-|") 'latex-table-wizard-map)
+
+(dolist (c latex-table-wizard-transient-keys)
+  (define-key latex-table-wizard-map (kbd (cdr c)) (car c)))
+
+(dolist (cmd (mapcar #'car latex-table-wizard-transient-keys))
+  (put cmd 'repeat-map 'latex-table-wizard-map))
+#+end_src
diff --git a/latex-table-wizard.texi b/latex-table-wizard.texi
index 7a062281ff..63508384a5 100644
--- a/latex-table-wizard.texi
+++ b/latex-table-wizard.texi
@@ -9,7 +9,7 @@
 @finalout
 @titlepage
 @title @LaTeX{} table wizard - Magic editing of @LaTeX{} tables
-@subtitle for version 1.3.0
+@subtitle for version 1.4.0
 @author Enrico Flor (@email{enrico@@eflor.net})
 @end titlepage
 
@@ -40,6 +40,7 @@ modify this GNU manual.”
 * Available commands::
 * Known issues::
 * Customization::
+* Example setup without Transient interface (Emacs 28 and later)::
 
 @detailmenu
 --- The Detailed Node Listing ---
@@ -49,7 +50,7 @@ Available commands
 * Start editing::
 * Relative motion commands::
 * Absolute motion commands::
-* Mark, kill and insert commands: Mark kill and insert commands. 
+* Mark, kill and insert commands: Mark kill and insert commands.
 * Swap adjacent fields::
 * Swap arbitrary fields::
 * Comment out cells::
@@ -133,7 +134,7 @@ Whenever we say ``current'' we mean ``at point''.
 * Start editing::
 * Relative motion commands::
 * Absolute motion commands::
-* Mark, kill and insert commands: Mark kill and insert commands. 
+* Mark, kill and insert commands: Mark kill and insert commands.
 * Swap adjacent fields::
 * Swap arbitrary fields::
 * Comment out cells::
@@ -245,10 +246,13 @@ following expressions will return nil and won't move 
point:
 @node Mark kill and insert commands
 @section Mark, kill and insert commands
 
-@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaa} 
{aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaa} 
{aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
 @headitem Command
 @tab Default key
-@tab 
+@tab
+@item @code{latex-table-wizard-edit-cell}
+@tab @code{.}
+@tab edit current cell
 @item @code{latex-table-wizard-mark-cell}
 @tab @code{m c}
 @tab mark current cell
@@ -258,6 +262,15 @@ following expressions will return nil and won't move point:
 @item @code{latex-table-wizard-insert-row}
 @tab @code{i r}
 @tab insert row below
+@item @code{latex-table-wizard-copy-cell-content}
+@tab @code{w}
+@tab copy content of current cell
+@item @code{latex-table-wizard-yank-cell-content}
+@tab @code{y}
+@tab replace and yank into current cell
+@item @code{latex-table-wizard-kill-cell-content}
+@tab @code{k k}
+@tab kill content of current cell
 @item @code{latex-table-wizard-kill-column-content}
 @tab @code{k c}
 @tab kill content of current column
@@ -272,9 +285,16 @@ following expressions will return nil and won't move point:
 @tab delete current row
 @item @code{exchange-point-and-mark}
 @tab @code{x}
-@tab 
+@tab
 @end multitable
 
+@code{latex-table-wizard-kill-cell-content} and
+@code{latex-table-wizard-copy-cell-content} add the content of current cell
+both to the kill ring (like the default kill and copy commands) and to
+the value of a special variable: @code{latex-table-wizard-yank-cell-content}
+will replace the content of the current cell with whatever that value
+is.
+
 @code{latex-table-wizard-delete-column} and 
@code{latex-table-wizard-delete-row}
 modify the structure of the table (they actually remove the
 column/table, not just the content of the cells in them).
@@ -761,4 +781,26 @@ suspect detached arguments.  The warning is just a message 
in the echo
 area right after the table is parsed.  If you want this, set the value
 of @code{latex-table-wizard-warn-about-detached-args} to t.
 
+@node Example setup without Transient interface (Emacs 28 and later)
+@chapter Example setup without Transient interface (Emacs 28 and later)
+
+Since the interactive commands work independently from the
+functionalities provided by transient.el, you can build your own
+alternative interfaces easily if you prefer so.  For example, the code
+below uses @code{repeat-mode} (built-in with Emacs 28 and later):
+
+@lisp
+(require 'repeat)
+
+(define-prefix-command 'latex-table-wizard-map)
+
+(define-key global-map (kbd "C-c C-|") 'latex-table-wizard-map)
+
+(dolist (c latex-table-wizard-transient-keys)
+  (define-key latex-table-wizard-map (kbd (cdr c)) (car c)))
+
+(dolist (cmd (mapcar #'car latex-table-wizard-transient-keys))
+  (put cmd 'repeat-map 'latex-table-wizard-map))
+@end lisp
+
 @bye
\ No newline at end of file



reply via email to

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