[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/valign bf68d39 171/198: Remove single-column style
From: |
Stefan Monnier |
Subject: |
[elpa] externals/valign bf68d39 171/198: Remove single-column style |
Date: |
Tue, 1 Dec 2020 18:19:42 -0500 (EST) |
branch: externals/valign
commit bf68d397e66ab7b587f62dec83c575e18c52a7f0
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
Remove single-column style
* valign.el (valign--align-separator-row): Remove function, change the
other one to a normal defun.
(valign-separator-row-style): Remove custom option.
(valign-table-1): Use new 'valign--align-separator-row'.
---
valign.el | 47 +++--------------------------------------------
1 file changed, 3 insertions(+), 44 deletions(-)
diff --git a/valign.el b/valign.el
index dfb9155..e4ffb78 100644
--- a/valign.el
+++ b/valign.el
@@ -511,28 +511,6 @@ before event, ACTION is either 'entered or 'left."
STRING should have length 1."
(aref (aref (font-get-glyphs (font-at point) 0 1 string) 0) 4))
-(cl-defmethod valign--align-separator-row
- (type (style (eql single-column)) column-width-list)
- "Align the separator row (|---+---|) as “|---------|”.
-Assumes the point is after the left bar (“|”). TYPE can be
-either 'org-mode or 'markdown. STYLE is 'single-column.
-COLUMN-WIDTH-LIST is returned from
-`valign--calculate-cell-width'."
- (ignore type style)
- (let* ((p (point))
- (column-count (length column-width-list))
- (bar-width (valign--glyph-width-of "|" p))
- ;; Position of the right-most bar.
- (total-width (+ (apply #'+ column-width-list)
- (* bar-width (1+ column-count)))))
- ;; Render the left bar.
- (valign--maybe-render-bar (1- (point)))
- (when (re-search-forward "|" nil t)
- (valign--put-overlay p (1- (point)) total-width
- 'face '(:strike-through t))
- ;; Render the right bar.
- (valign--maybe-render-bar (1- (point))))))
-
(defun valign--separator-row-add-overlay (beg end right-pos)
"Add overlay to a separator row’s “cell”.
Cell ranges from BEG to END, the pixel position RIGHT-POS marks
@@ -558,13 +536,9 @@ Assumes point is on the right bar or plus sign."
'display (valign--space right-pos)
'face '(:strike-through t)))
-(cl-defmethod valign--align-separator-row
- (type (style (eql multi-column)) column-width-list)
+(defun valign--align-separator-row (column-width-list)
"Align the separator row in multi column style.
-TYPE can be 'org-mode or 'markdown-mode, STYLE is 'multi-column.
-COLUMN-WIDTH-LIST is returned from
-`valign--calculate-cell-width'."
- (ignore type style)
+COLUMN-WIDTH-LIST is returned by `valign--calculate-cell-width'."
(let ((bar-width (valign--glyph-width-of "|" (point)))
(space-width (valign--glyph-width-of " " (point)))
(column-start (point))
@@ -595,18 +569,6 @@ COLUMN-WIDTH-LIST is returned from
;;; Userland
-(defcustom valign-separator-row-style 'multi-column
- "The style of the separator row of a table.
-Valign can render it as “|-----------|”
-or as “|-----|-----|”. Set this option to 'single-column
-for the former, and 'multi-column for the latter.
-You need to restart valign mode or realign tables for this
-setting to take effect."
- :type '(choice
- (const :tag "Multiple columns" multi-column)
- (const :tag "A single column" single-column))
- :group 'valign)
-
(defcustom valign-fancy-bar nil
"Non-nil means to render bar as a full-height line.
You need to restart valign mode for this setting to take effect."
@@ -670,10 +632,7 @@ If FORCE non-nil, force align."
(re-search-forward "|" (line-end-position))
(if (valign--separator-p)
;; Separator row.
- (valign--align-separator-row
- (valign--guess-table-type)
- valign-separator-row-style
- column-width-list)
+ (valign--align-separator-row column-width-list)
;; Not separator row, align each cell. ‘column-start’ is the
;; pixel position of the current point, i.e., after the left
- [elpa] externals/valign b189102 194/198: ; * test.org: New test., (continued)
- [elpa] externals/valign b189102 194/198: ; * test.org: New test., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 44c747b 136/198: * valign.el (valign-table): Clean up table if error occurs., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 80cf682 121/198: Remove some internal variables, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 9daeab8 071/198: * valign.el (valign-table-quite): Really ignore errors., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 09e89aa 105/198: * valign.el (valign--at-table-p): Don’t align org blocks., Stefan Monnier, 2020/12/01
- [elpa] externals/valign e91abf2 112/198: Extract out boilerplate from valign-table, Stefan Monnier, 2020/12/01
- [elpa] externals/valign d799e31 181/198: ; * valign.el (valign--cell-content-config): Fix typo., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 9fc0c11 149/198: Use new function to calculate space and bar width, Stefan Monnier, 2020/12/01
- [elpa] externals/valign d18aea8 183/198: Improve error handling, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 62766e7 184/198: Add custom group, Stefan Monnier, 2020/12/01
- [elpa] externals/valign bf68d39 171/198: Remove single-column style,
Stefan Monnier <=
- [elpa] externals/valign ce1a53c 188/198: ; * test.org: Update., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 82be45d 198/198: Bug fix, Stefan Monnier, 2020/12/01
- [elpa] externals/valign cf3a794 099/198: Fix: cursor disappears on bars when fancy-bar is t, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 0e77a02 164/198: Add some commands that suppresses auto alignment, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 7afe578 182/198: Improve documentation, Stefan Monnier, 2020/12/01
- [elpa] externals/valign e0362c0 156/198: * valign.el (valign-region): Report to jit-lock the actual end of fontified region., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 841925f 189/198: Remove all advice when they are not needed, Stefan Monnier, 2020/12/01
- [elpa] externals/valign e438083 103/198: Change text property to overlay, Stefan Monnier, 2020/12/01
- [elpa] externals/valign cd2b563 191/198: * valign.el: Bump version to 3.0.0., Stefan Monnier, 2020/12/01