emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Patch] M-Right and M-Left behave differently on headings and list items
@ 2010-04-19 22:29 Matti De Craene
  2010-04-21 12:53 ` Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Matti De Craene @ 2010-04-19 22:29 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

Hello all,

When operating on a heading, M-Right/M-Left promotes or demotes one
heading only, and M-S-Right/M-S-Left promotes or demotes an entire
subtree.

When operating on list items however, there is no distinction between
M-Right/M-Left and M-S-Right/M-S-Left. Both key combinations operate
on the current item and on all subitems

Example: No difference between M-Right and M-S-Right on item 1 below:
- item 1
    - item 2
    - item 3

I find this behaviour somewhat confusing.

Attached patch seems to fix that for me.

Kind Regards,

Matti

[-- Attachment #2: M-right-M-left-on-list-items.patch --]
[-- Type: text/x-patch, Size: 970 bytes --]

diff --git a/lisp/org-list.el b/lisp/org-list.el
index d3bfb6b..05793e7 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -975,12 +975,15 @@ I.e. to the text after the last item."
     (setq firstp (org-first-list-item-p))
     (save-excursion
       (setq end (and (org-region-active-p) (region-end)))
-      (if (memq last-command '(org-shiftmetaright org-shiftmetaleft))
+      (if (and (memq last-command '(org-shiftmetaright org-shiftmetaleft))
+	        (memq this-command '(org-shiftmetaright org-shiftmetaleft)))
 	  (setq beg org-last-indent-begin-marker
 		end org-last-indent-end-marker)
 	(org-beginning-of-item)
 	(setq beg (move-marker org-last-indent-begin-marker (point)))
-	(org-end-of-item)
+	(if (memq this-command '(org-shiftmetaright org-shiftmetaleft))
+	  (org-end-of-item)
+	  (org-end-of-line))
 	(setq end (move-marker org-last-indent-end-marker (or end (point)))))
       (goto-char beg)
       (setq ind-bul (org-item-indent-positions)

[-- Attachment #3: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2010-04-27  9:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-19 22:29 [Patch] M-Right and M-Left behave differently on headings and list items Matti De Craene
2010-04-21 12:53 ` Carsten Dominik
2010-04-21 13:19   ` Sébastien Vauban
2010-04-21 13:27   ` Anthony Lander
2010-04-21 13:32   ` Bastien
2010-04-21 13:54     ` Carsten Dominik
2010-04-21 14:04       ` Bernt Hansen
2010-04-21 14:44       ` Dan Davison
2010-04-22 16:02         ` Carsten Dominik
2010-04-23  8:26           ` Carsten Dominik
2010-04-21 20:27       ` Matti De Craene
2010-04-21 21:07         ` Carsten Dominik
2010-04-22 10:15           ` Bastien
2010-04-22 20:37             ` Matti De Craene
2010-04-23  8:26             ` Carsten Dominik
2010-04-26 22:07               ` Matti De Craene
2010-04-27  5:57                 ` Carsten Dominik

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).