emacs-orgmode
[Top][All Lists]
Advanced

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

[BUG] List: org-shiftright brake list by indentation. Patch. [9.6.28 ( @


From: vitalij
Subject: [BUG] List: org-shiftright brake list by indentation. Patch. [9.6.28 ( @ /home/u/.emacs.d/elpa/org-9.6.28/)]
Date: Wed, 10 Jul 2024 01:27:40 -0000

Hello. I use fill-paragraph function with (setq fill-prefix " ") variable.
If I have list:
1) text text text texttext texttext texvttext texttext texttext
 texttext texttext texttext texttext texttext text
2) text text text texttext texttext texttext texttext texttext
 texttext texttext texttext texttext texttext text

After org-shiftright I have:

- text text text texttext texttext texvttext texttext texttext
texttext texttext texttext texttext texttext text
- text text text texttext texttext texttext texttext texttext
texttext texttext texttext texttext texttext text

This breakes list strcuture. I don't want to use (setq fill-prefix "  ")
 with two spaces.

I created this patch that don't change indentation of list by shifting.

diff --git a/org-list.el b/org-list.el
index 502e61b..2867149 100644
--- a/org-list.el
+++ b/org-list.el
@@ -1813,6 +1813,12 @@ This function modifies STRUCT."
     (setq end-list (sort end-list (lambda (e1 e2) (< (cdr e1) (cdr e2)))))
     (org-list-struct-assoc-end struct end-list)))

+(defcustom org-list-shift-body-ind nil
+  "Indent text of column when bullet was changed."
+  :group 'org-plain-lists
+  :group 'org-cycle
+  :type 'boolean)
+
 (defun org-list-struct-apply-struct (struct old-struct)
   "Apply set difference between STRUCT and OLD-STRUCT to the buffer.

@@ -1956,7 +1962,8 @@ Initial position of cursor is restored after the changes."
       ;;    end to beginning.  Take a special action when beginning is
       ;;    at item bullet.
       (dolist (e sliced-struct)
-       (unless (zerop (nth 2 e)) (apply shift-body-ind e))
+        (if org-list-shift-body-ind
+           (unless (zerop (nth 2 e)) (apply shift-body-ind e)))
        (let* ((beg (nth 1 e))
               (cell (assq beg struct)))
          (unless (or (not cell) (equal cell (assq beg old-struct)))


Emacs  : GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, X toolkit)
 of 2024-06-23
Package: Org mode version 9.6.28 ( @ /home/u/.emacs.d/elpa/org-9.6.28/)
--
Best regards,
Python Middle Data Scientist. I am looking for a job for 1.5 years.



reply via email to

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