[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/latex-table-wizard 174739aad8 06/70: Fix byte-compilati
From: |
ELPA Syncer |
Subject: |
[elpa] externals/latex-table-wizard 174739aad8 06/70: Fix byte-compilations warnings about docstrings |
Date: |
Sat, 13 May 2023 08:59:10 -0400 (EDT) |
branch: externals/latex-table-wizard
commit 174739aad8784c11d86cfac0a1c808d20dad7591
Author: Enrico Flor <nericoflor@gmail.com>
Commit: Enrico Flor <nericoflor@gmail.com>
Fix byte-compilations warnings about docstrings
---
latex-table-wizard.el | 129 ++++++++++++++++++++++++++------------------------
1 file changed, 67 insertions(+), 62 deletions(-)
diff --git a/latex-table-wizard.el b/latex-table-wizard.el
index bf733c4264..6d827946fa 100644
--- a/latex-table-wizard.el
+++ b/latex-table-wizard.el
@@ -370,8 +370,8 @@ Each value is an integer, S and E are markers."
(defsubst latex-table-wizard--sort (dir x y)
"Return t if cell X precedes Y.
-Precedence depends on the value of DIR (either 'next',
-'previous', 'forward' or 'backward')."
+Precedence depends on the value of DIR (either \\='next\\=',
+\\='previous\\=', \\='forward\\=' or \\='backward\\=')."
(let ((rows (list (plist-get x :row) (plist-get y :row)))
(cols (list (plist-get x :column) (plist-get y :column))))
(if (or (eq dir 'next) (eq dir 'previous))
@@ -389,7 +389,8 @@ The goal is to get to the last cell in the same row or same
column as CURRENT-CELL.
Whether to look for the last column or row depends on the value
-of DIR (either 'next', 'previous', 'forward' or 'backward')."
+of DIR (either \\='next\\=', \\='previous\\=', \\='forward\\=' or
+\\='backward\\=')."
(let* ((prop (if (or (eq dir 'backward) (eq dir 'forward)) :column :row))
(curr-prop (if (eq prop :column) :row :column))
(curr-value (plist-get current-cell curr-prop))
@@ -449,13 +450,14 @@ beginning of the available portion of the buffer."
"Return cell plist from TABLE.
The cell that is returned is the one found moving COUNT cells
-from current cell CURR in direction DIR (either 'forward',
-'backward', 'next' or 'previous').
+from current cell CURR in direction DIR (either \\='forward\\=',
+\\='backward\\=', \\='next\\=' or \\='previous\\=').
If SAME-LINE is non-nil, loop over the current row (if DIR is
-'forward' or 'backward'), or column (if DIR is 'next' or
-'previous'). Otherwise continue search for cell in a different
-row or column if no cell is left in the current DIR."
+\\='forward\\=' or \\='backward\\='), or column (if DIR is
+\\='next\\=' or \\='previous\\='). Otherwise continue search for
+cell in a different row or column if no cell is left in the
+current DIR."
(let* ((sorted (if same-line
(let* ((prop (if (or (eq dir 'forward)
(eq dir 'backward))
@@ -494,7 +496,7 @@ row or column if no cell is left in the current DIR."
"Remove table internal overlays generated by latex-table-wizard.
These are the overlays that have a non-nil value for the name
-property 'table-inside-ol'.
+property \\='table-inside-ol\\='.
Optional arguments BEG and END are passed, they are buffer
positions or markers indicating beginning and end of the table.
@@ -512,7 +514,7 @@ given, a value is retrieved with
"Highlight cells in LIST-OF-CELLS with an overlay.
The overlay has a non-nil value for the name property
-'table-inside-ol'."
+\\='table-inside-ol\\='."
(let ((ols '()))
(dolist (x list-of-cells)
(push (make-overlay (plist-get x :start)
@@ -527,41 +529,6 @@ The overlay has a non-nil value for the name property
(defvar latex-table-wizard--selection nil
"Current selection, a list of cell objects.")
-(defun latex-table-wizard--jump (dir &optional absolute count same-line)
- "Move point to the beginning of a cell in the table.
-
-DIR is either 'next', 'previous', 'forward' or 'backward' and
-determines the direction of motion. This function assumes being
-evaluated with point inside of a tabular-like environment.
-
-With ABSOLUTE being t, move to the last or first cell in the row
-or column (depending on the value of DIR) point is currently in.
-
-COUNT is a positive integer that determines how many steps in
-direction DIR to take.
-
-If SAME-LINE is non-nil, never leave current column or row."
- (unless (ignore-errors (save-excursion (LaTeX-find-matching-begin)))
- (user-error "Not in a LaTeX environment"))
- (when-let ((macro-at-point
- (latex-table-wizard--point-on-regexp-p
- latex-table-wizard--macro-re
- 0 (line-beginning-position))))
- (cond ((string-prefix-p "\\begin" (nth 0 macro-at-point))
- (goto-char (nth 1 macro-at-point)))
- ((string-prefix-p "\\end" (nth 0 macro-at-point))
- (goto-char (nth 2 macro-at-point)))))
- (let* ((cells (latex-table-wizard--parse-table))
- (curr (latex-table-wizard--get-thing 'cell cells))
- (target (if absolute
- (latex-table-wizard--get-extreme dir cells curr)
- (latex-table-wizard--get-other-cell
- dir same-line count cells curr))))
- (latex-table-wizard--remove-overlays cells)
- (goto-char (plist-get target :start))
- (latex-table-wizard--hl-cells (list target))
- (latex-table-wizard--hl-cells latex-table-wizard--selection)))
-
(defsubst latex-table-wizard--locate-point (pos table)
"Return cell from TABLE in which position POS is in.
@@ -589,12 +556,12 @@ POS is a buffer position or a marker."
(defsubst latex-table-wizard--get-thing (thing &optional table)
"Return THING point is in.
-THING can be either 'cell', 'column' or 'row.
+THING can be either \\='cell\\=', \\='column\\=' or \\='row\\='.
TABLE is a list of cell plists. If it is nil, evaluate
`latex-table-wizard--parse-table' to get a value.
-If THING is 'cell', return one plist, else return a list of
+If THING is \\='cell\\=', return one plist, else return a list of
plists."
(let* ((pos (point))
(cells-list (or table (latex-table-wizard--parse-table)))
@@ -609,6 +576,42 @@ plists."
(lambda (x y) (> (plist-get x other-prop)
(plist-get y other-prop))))))))
+(defun latex-table-wizard--jump (dir &optional absolute count same-line)
+ "Move point to the beginning of a cell in the table.
+
+DIR is either \\='next\\=', \\='previous\\=', \\='forward\\=' or
+\\='backward\\=' and determines the direction of motion. This
+function assumes being evaluated with point inside of a
+tabular-like environment.
+
+With ABSOLUTE being t, move to the last or first cell in the row
+or column (depending on the value of DIR) point is currently in.
+
+COUNT is a positive integer that determines how many steps in
+direction DIR to take.
+
+If SAME-LINE is non-nil, never leave current column or row."
+ (unless (ignore-errors (save-excursion (LaTeX-find-matching-begin)))
+ (user-error "Not in a LaTeX environment"))
+ (when-let ((macro-at-point
+ (latex-table-wizard--point-on-regexp-p
+ latex-table-wizard--macro-re
+ 0 (line-beginning-position))))
+ (cond ((string-prefix-p "\\begin" (nth 0 macro-at-point))
+ (goto-char (nth 1 macro-at-point)))
+ ((string-prefix-p "\\end" (nth 0 macro-at-point))
+ (goto-char (nth 2 macro-at-point)))))
+ (let* ((cells (latex-table-wizard--parse-table))
+ (curr (latex-table-wizard--get-thing 'cell cells))
+ (target (if absolute
+ (latex-table-wizard--get-extreme dir cells curr)
+ (latex-table-wizard--get-other-cell
+ dir same-line count cells curr))))
+ (latex-table-wizard--remove-overlays cells)
+ (goto-char (plist-get target :start))
+ (latex-table-wizard--hl-cells (list target))
+ (latex-table-wizard--hl-cells latex-table-wizard--selection)))
+
;;; Swapping functions
@@ -616,9 +619,9 @@ plists."
(defsubst latex-table-wizard--swap-substrings (x y)
"Swap two buffer substrings.
-X and Y are each a list of the form '(B E)', where B and E are
-markers corresponding to the beginning and the end of the buffer
-substring."
+X and Y are each a list of the form \\='(B E)\\=', where B and E
+are markers corresponding to the beginning and the end of the
+buffer substring."
(save-excursion
(let ((x-string (concat " "
(string-trim
@@ -651,8 +654,8 @@ substring."
(defsubst latex-table-wizard--type-of-selection (sel)
"Return type of list of cells SEL.
-Non-nil values that are returned are is either 'cell' (if SEL
-only contains one cell), 'column' or 'row'.
+Non-nil values that are returned are is either \\='cell\\=' (if
+SEL only contains one cell), \\='column\\=' or \\='row\\='.
If SEL is a list of more than one cell such that not all the
cells have the same value for either :column or :row, it means
@@ -677,7 +680,7 @@ returned."
(defun latex-table-wizard--swap-line (type line1 line2)
"Swap columns or rows LINE1 and LINE2.
-TYPE is either 'column' or 'row'."
+TYPE is either \\='column\\=' or \\='row\\='."
(save-excursion
(let ((prop (if (eq type 'column) :row :column)))
(dolist (x line1)
@@ -692,9 +695,10 @@ TYPE is either 'column' or 'row'."
(defun latex-table-wizard--swap-adjacent-line (dir type)
"Swap current thing of type TYPE with the one in direction DIR.
-DIR is either 'forward', 'backward', 'next' or 'previous'.
+DIR is either \\='forward\\=', \\='backward\\=', \\='next\\=' or
+\\='previous\\='.
-TYPE is either 'cell', 'column' or 'row'."
+TYPE is either \\='cell\\=', \\='column\\=' or \\='row\\='."
(let* ((table (latex-table-wizard--parse-table))
(current-cell (latex-table-wizard--get-thing 'cell table))
@@ -724,7 +728,7 @@ TYPE is either 'cell', 'column' or 'row'."
(defun latex-table-wizard--select-thing (thing)
"Add THING point is at to list `latex-table-wizard--selection'.
-THING is either 'cell', 'column' or 'row'."
+THING is either \\='cell\\=', \\='column\\=' or \\='row\\='."
(let* ((table (latex-table-wizard--parse-table))
(sel (latex-table-wizard--get-thing thing table)))
(if (eq thing 'cell)
@@ -995,6 +999,7 @@ TABLE is a list of cell plists. If it is nil, evaluate
(insert "\n")
(let ((how-many (length current-row)))
(dotimes (i (1- how-many))
+ (ignore i)
(insert " &"))
(insert " \\\\")))))
@@ -1081,7 +1086,7 @@ at point. If it is none of those object, return nil."
;;; Transient
-(defconst latex-table-wizard--motion-suffixes
+(defvar latex-table-wizard--motion-suffixes
'(("f" "move right" latex-table-wizard-right :transient t)
("b" "move left" latex-table-wizard-left :transient t)
("p" "move down" latex-table-wizard-up :transient t)
@@ -1097,7 +1102,7 @@ at point. If it is none of those object, return nil."
""
("u" "universal argument" universal-argument :transient t)))
-(defconst latex-table-wizard--mark-suffixes
+(defvar latex-table-wizard--mark-suffixes
'(("x" "exchange point and mark" exchange-point-and-mark :transient t)
("m c" "mark cell" latex-table-wizard-mark-cell :transient t)
("i c" "insert column right" latex-table-wizard-insert-column :transient t)
@@ -1105,19 +1110,19 @@ at point. If it is none of those object, return nil."
("k c" "kill current column" latex-table-wizard-kill-column :transient t)
("k r" "kill current row" latex-table-wizard-kill-row :transient t)))
-(defconst latex-table-wizard--swap-cell-suffixes
+(defvar latex-table-wizard--swap-cell-suffixes
'(("C-f" "swap cell right" latex-table-wizard-swap-cell-right :transient t)
("C-b" "swap cell left" latex-table-wizard-swap-cell-left :transient t)
("C-p" "swap cell up" latex-table-wizard-swap-cell-up :transient t)
("C-n" "swap cell down" latex-table-wizard-swap-cell-down :transient t)))
-(defconst latex-table-wizard--swap-line-suffixes
+(defvar latex-table-wizard--swap-line-suffixes
'(("M-f" "swap column right" latex-table-wizard-swap-column-right :transient
t)
("M-b" "swap column left" latex-table-wizard-swap-column-left :transient t)
("M-p" "swap row up" latex-table-wizard-swap-row-up :transient t)
("M-n" "swap row down" latex-table-wizard-swap-row-down :transient t)))
-(defconst latex-table-wizard--select-suffixes
+(defvar latex-table-wizard--select-suffixes
'(("SPC" "select cell" latex-table-wizard-select-cell :transient t)
("c" "select column" latex-table-wizard-select-column :transient t)
("r" "select row" latex-table-wizard-select-row :transient t)
@@ -1127,7 +1132,7 @@ at point. If it is none of those object, return nil."
""
("s" "swap selection" latex-table-wizard-swap :transient t)))
-(defconst latex-table-wizard--other-suffixes
+(defvar latex-table-wizard--other-suffixes
'(("w" "compress table" latex-table-wizard-clean-whitespace :transient t)
("TAB" "align table" latex-table-wizard-align :transient t)
("/" "undo" undo :transient t)
- [elpa] branch externals/latex-table-wizard created (now b41aac096b), ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard e738b1c094 02/70: Remove comments, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 7137ca9641 01/70: First commit, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard d71174b247 03/70: Alignment commands added, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard a28e0f0ec5 04/70: Some cleanup, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 06d0453f60 10/70: Version bump to 0.0.3, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard f9394894f7 05/70: Fix parsing if 0, 0 cell starts in same line as \begin macro, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 29c65891e6 07/70: Fix transient autoload and remove transient change function, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 174739aad8 06/70: Fix byte-compilations warnings about docstrings,
ELPA Syncer <=
- [elpa] externals/latex-table-wizard 8402bc0ed9 12/70: Don't call face -face (as per elisp manual ch 40), ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 972e8eeba1 16/70: Optimize for compilation and simplify, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard c75063522b 17/70: Extend overlay limit to beginning of \end{} macro, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 293bbfc9ed 18/70: Actually remove function definition made useless, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 7ac03c0a51 26/70: Correct readme, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard a53d3f6158 30/70: Version 0.2.0, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard a0e0aff19c 31/70: Reduce the need to re-parse the table, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 482380db44 38/70: Update docstring, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 02ddb6e01c 41/70: Fix bug occurring when in Emacs 27, ELPA Syncer, 2023/05/13
- [elpa] externals/latex-table-wizard 230bb852fa 43/70: Add .texi file, ELPA Syncer, 2023/05/13