all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [BUG] List: org-shiftright brake list by indentation. Patch. [9.6.28 ( @ /home/u/.emacs.d/elpa/org-9.6.28/)]
@ 2024-07-10  1:27 vitalij
  2024-07-10 13:43 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: vitalij @ 2024-07-10  1:27 UTC (permalink / raw)
  To: emacs-orgmode

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.


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-11 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-10  1:27 [BUG] List: org-shiftright brake list by indentation. Patch. [9.6.28 ( @ /home/u/.emacs.d/elpa/org-9.6.28/)] vitalij
2024-07-10 13:43 ` Ihor Radchenko
     [not found]   ` <871q40lvhm.fsf@gmx.com>
2024-07-11 13:40     ` Ihor Radchenko
     [not found]       ` <87bk333ojl.fsf@gmx.com>
2024-07-11 16:08         ` Ihor Radchenko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.