emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: vitalij@gmx.com
To: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <871q42qbn7.fsf@gmx.com> (raw)

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	other threads:[~2024-07-10  1:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10  1:27 vitalij [this message]
2024-07-10 13:43 ` [BUG] List: org-shiftright brake list by indentation. Patch. [9.6.28 ( @ /home/u/.emacs.d/elpa/org-9.6.28/)] 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871q42qbn7.fsf@gmx.com \
    --to=vitalij@gmx.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).