[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 46df681336 2/7: org.el: Improve performance of dele
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 46df681336 2/7: org.el: Improve performance of deletion commands |
Date: |
Thu, 9 Jun 2022 04:58:10 -0400 (EDT) |
branch: externals/org
commit 46df681336c83c826b367d2803f59560165bdeba
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
org.el: Improve performance of deletion commands
* lisp/org.el (org-delete-char):
(org-delete-backward-char): Wrap into
`org-fold-core-ignore-modifications'. These commands are for
interactive use anyway and they have no risk of not inheriting folding
properties.
---
lisp/org.el | 74 +++++++++++++++++++++++++++++++------------------------------
1 file changed, 38 insertions(+), 36 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 12629bb137..f40131ecb8 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16131,18 +16131,19 @@ front of the next \"|\" separator, to keep the table
aligned. The table will
still be marked for re-alignment if the field did fill the entire column,
because, in this case the deletion might narrow the column."
(interactive "p")
- (save-match-data
- (org-fold-check-before-invisible-edit 'delete-backward)
- (if (and (= N 1)
- (not overwrite-mode)
- (not (org-region-active-p))
- (not (eq (char-before) ?|))
- (save-excursion (skip-chars-backward " \t") (not (bolp)))
- (looking-at-p ".*?|")
- (org-at-table-p))
- (progn (forward-char -1) (org-delete-char 1))
- (backward-delete-char N)
- (org-fix-tags-on-the-fly))))
+ (org-fold-core-ignore-modifications
+ (save-match-data
+ (org-fold-check-before-invisible-edit 'delete-backward)
+ (if (and (= N 1)
+ (not overwrite-mode)
+ (not (org-region-active-p))
+ (not (eq (char-before) ?|))
+ (save-excursion (skip-chars-backward " \t") (not (bolp)))
+ (looking-at-p ".*?|")
+ (org-at-table-p))
+ (progn (forward-char -1) (org-delete-char 1))
+ (backward-delete-char N)
+ (org-fix-tags-on-the-fly)))))
(defun org-delete-char (N)
"Like `delete-char', but insert whitespace at field end in tables.
@@ -16151,30 +16152,31 @@ front of the next \"|\" separator, to keep the table
aligned. The table will
still be marked for re-alignment if the field did fill the entire column,
because, in this case the deletion might narrow the column."
(interactive "p")
- (save-match-data
- (org-fold-check-before-invisible-edit 'delete)
- (cond
- ((or (/= N 1)
- (eq (char-after) ?|)
- (save-excursion (skip-chars-backward " \t") (bolp))
- (not (org-at-table-p)))
- (delete-char N)
- (org-fix-tags-on-the-fly))
- ((looking-at ".\\(.*?\\)|")
- (let* ((update? org-table-may-need-update)
- (noalign (looking-at-p ".*? |")))
- (delete-char 1)
- (org-table-with-shrunk-field
- (save-excursion
- ;; Last space is `org-table-separator-space', so insert
- ;; a regular one before it instead.
- (goto-char (- (match-end 0) 2))
- (insert " ")))
- ;; If there were two spaces at the end, this field does not
- ;; determine the width of the column.
- (when noalign (setq org-table-may-need-update update?))))
- (t
- (delete-char N)))))
+ (org-fold-core-ignore-modifications
+ (save-match-data
+ (org-fold-check-before-invisible-edit 'delete)
+ (cond
+ ((or (/= N 1)
+ (eq (char-after) ?|)
+ (save-excursion (skip-chars-backward " \t") (bolp))
+ (not (org-at-table-p)))
+ (delete-char N)
+ (org-fix-tags-on-the-fly))
+ ((looking-at ".\\(.*?\\)|")
+ (let* ((update? org-table-may-need-update)
+ (noalign (looking-at-p ".*? |")))
+ (delete-char 1)
+ (org-table-with-shrunk-field
+ (save-excursion
+ ;; Last space is `org-table-separator-space', so insert
+ ;; a regular one before it instead.
+ (goto-char (- (match-end 0) 2))
+ (insert " ")))
+ ;; If there were two spaces at the end, this field does not
+ ;; determine the width of the column.
+ (when noalign (setq org-table-may-need-update update?))))
+ (t
+ (delete-char N))))))
;; Make `delete-selection-mode' work with Org mode and Orgtbl mode
(put 'org-self-insert-command 'delete-selection
- [elpa] externals/org updated (c02c0d660d -> d9963c58dc), ELPA Syncer, 2022/06/09
- [elpa] externals/org 819409baab 4/7: org-get-buffer-tags: Improve performance, ELPA Syncer, 2022/06/09
- [elpa] externals/org 0e7033e0ca 6/7: org-capture: Expand sexps in template with Org mode being active, ELPA Syncer, 2022/06/09
- [elpa] externals/org d9963c58dc 7/7: lisp/ol.el: Fix shadowed radio targets, ELPA Syncer, 2022/06/09
- [elpa] externals/org 96746438c0 1/7: org-element--cache-find: Do not hash section/org-data/table elements, ELPA Syncer, 2022/06/09
- [elpa] externals/org 46df681336 2/7: org.el: Improve performance of deletion commands,
ELPA Syncer <=
- [elpa] externals/org 4487acc630 5/7: org-element-cache: Do not compare buffer positions with cache keys, ELPA Syncer, 2022/06/09
- [elpa] externals/org 93821b431c 3/7: org-element--cache-for-removal: Improve performance, ELPA Syncer, 2022/06/09