[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-modern d2bda1d449 29/65: Improve table editability
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-modern d2bda1d449 29/65: Improve table editability |
Date: |
Mon, 7 Mar 2022 12:57:46 -0500 (EST) |
branch: externals/org-modern
commit d2bda1d449f73549312eb376a5b0d291d8311b57
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Improve table editability
---
org-modern.el | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/org-modern.el b/org-modern.el
index e369b6a666..dcda258c58 100644
--- a/org-modern.el
+++ b/org-modern.el
@@ -33,6 +33,8 @@
;;; Code:
(require 'org)
+(eval-when-compile
+ (require 'cl-lib))
(defgroup org-modern nil
"Modern looks for Org."
@@ -86,9 +88,9 @@ Set to nil to disable styling the time stamps."
Set to nil to hide the vertical lines."
:type '(choice (const nil) integer))
-(defcustom org-modern-table-horizontal t
+(defcustom org-modern-table-horizontal 0.1
"Prettify horizontal table lines."
- :type 'boolean)
+ :type '(choice (const nil) number))
(defcustom org-modern-priority
'((?A . "🅐") ;; Ⓐ
@@ -360,6 +362,7 @@ Set to nil to disable the indicator."
(save-excursion
(let* ((beg (match-beginning 0))
(end (match-end 0))
+ (color (face-attribute 'org-table :foreground nil t))
(inner (progn
(goto-char beg)
(forward-line)
@@ -379,19 +382,19 @@ Set to nil to disable the indicator."
`(display (space :width
(,org-modern-table-vertical))
face (:inherit org-table
:inverse-video t))))
((and org-modern-table-horizontal separator)
- (put-text-property a b 'display `(space :width
(,org-modern-table-vertical)))
- (add-face-text-property a b '(:overline t) 'append))
+ (put-text-property a b 'display `(space :width
(,org-modern-table-vertical))))
(t (put-text-property a b 'face 'org-hide)))))
(goto-char beg)
(when separator
- (add-face-text-property beg (1+ end) '(:height 1) 'append)
+ (when (numberp org-modern-table-horizontal)
+ (add-face-text-property beg end `(:overline ,color) 'append)
+ (add-face-text-property beg (1+ end) `(:height
,org-modern-table-horizontal) 'append))
(while (re-search-forward "-+" end 'noerror)
(let ((a (match-beginning 0))
(b (match-end 0)))
;; TODO Text scaling breaks the table formatting since the space
is not scaled accordingly
- (put-text-property a b 'display `(space :width ,(- b a)))
- (when org-modern-table-horizontal
- (add-face-text-property a b '(:overline t) 'append))))))))
+ (cl-loop for i from a below b do
+ (put-text-property i (1+ i) 'display (list 'space :width
1)))))))))
(defun org-modern--block ()
"Prettify blocks."
- [elpa] externals/org-modern a84994dc77 15/65: Improve cursor placement on timestamps (See #2), (continued)
- [elpa] externals/org-modern a84994dc77 15/65: Improve cursor placement on timestamps (See #2), ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern b17d32c576 16/65: README rewording, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 6b925b71ee 19/65: Add org-modern-label-border, do not overwrite line-spacing, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 7ceca7a3cc 20/65: More beautiful checkboxes, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 58252d0955 21/65: Fix typo (Fix #4), ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 8abe22886a 22/65: Improve checkboxes, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern a37053e995 23/65: More elegant progress indicator, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 8a0bce9661 26/65: Blocks: Add wrap-prefix to support visual-line-mode, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 008f6baa8a 27/65: Improve block font locking, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern a63a427991 28/65: Fix docstring, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern d2bda1d449 29/65: Improve table editability,
ELPA Syncer <=
- [elpa] externals/org-modern d6e8889e32 31/65: Fix indented tables, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern f0532357fe 32/65: Handle upper case block keywords, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 14637f0a5f 34/65: Fix source block indicators for source blocks with empty lines, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 6b13500969 38/65: Improve docstring, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern f45be59ff5 46/65: org-modern-keyword: Configurable replacement, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern b4d6b37eba 47/65: README: Expand on the current limitations, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 5f132cd720 54/65: Fix statistics face, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 7d741dba51 60/65: Take advantage of more flexible boxes on Emacs 28, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern e13be0f433 40/65: Preserve line-prefix and wrap-prefix if org-indent-mode is enabled (Fix #7), ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 4f5d010a9f 42/65: Use en-dash for list bullets, ELPA Syncer, 2022/03/07