]> code.delx.au - gnu-emacs/commitdiff
Sync with Org git commit 374c56b.
authorBastien Guerry <bastien1@free.fr>
Thu, 26 Apr 2012 17:30:04 +0000 (19:30 +0200)
committerBastien Guerry <bastien1@free.fr>
Thu, 26 Apr 2012 17:30:04 +0000 (19:30 +0200)
15 files changed:
doc/misc/ChangeLog
etc/ChangeLog
etc/org/OrgOdtStyles.xml
lisp/org/ChangeLog
lisp/org/ob-python.el
lisp/org/org-agenda.el
lisp/org/org-clock.el
lisp/org/org-ctags.el
lisp/org/org-faces.el
lisp/org/org-footnote.el
lisp/org/org-list.el
lisp/org/org-mouse.el
lisp/org/org-odt.el
lisp/org/org-table.el
lisp/org/org.el

index ea549e41b582606fa803e6a8dd2c64d611274ad7..b2e34bac56d56eaf3d2d876ed721de7694022e64 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-26  Ippei Furuhashi  <top.tuna+orgmode@gmail.com>  (tiny change)
+
+       * org.texi (Agenda commands): Fix two typos: give corresponding
+       function names, according to `org-agenda-view-mode-dispatch'.
+
 2012-04-21  Glenn Morris  <rgm@gnu.org>
 
        * faq.texi (Major packages and programs): Remove section.
index d69d066f2923e98c68b34d6116070449eec9f341..6ca6017be98d3d860b0beab7dd8eb19c3efdb020 100644 (file)
@@ -1,3 +1,13 @@
+2012-04-26  Jambunathan K  <kjambunathan@gmail.com>
+
+       * org/README: Update Copyright year.
+
+2012-04-26  Jambunathan K  <kjambunathan@gmail.com>
+
+       * org/OrgOdtStyles.xml (OrgDescriptionList): Modify style.  With
+       this change, in a description list, if the description paragraph
+       spawns multiple lines then it will correctly indented.
+
 2012-04-20  Glenn Morris  <rgm@gnu.org>
 
        * CONTRIBUTE: Expand a bit on copyright assignments.
index 470b7b134a775db29cd63b9d81505427e3bff031..84125c96d8a90c3f1ba6da9ff091be05e6b31781 100644 (file)
   <!-- Description List -->
   <text:list-style style:name="OrgDescriptionList">
    <text:list-level-style-number text:level="1" style:num-format="">
-    <style:list-level-properties text:space-before="0.635cm" text:min-label-width="0.635cm"/>
+    <style:list-level-properties text:space-before="0.635cm"/>
    </text:list-level-style-number>
    <text:list-level-style-number text:level="2" style:num-format="">
-    <style:list-level-properties text:space-before="1.27cm" text:min-label-width="0.635cm"/>
+    <style:list-level-properties text:space-before="1.27cm"/>
    </text:list-level-style-number>
    <text:list-level-style-number text:level="3" style:num-format="">
-    <style:list-level-properties text:space-before="1.905cm" text:min-label-width="0.635cm"/>
+    <style:list-level-properties text:space-before="1.905cm"/>
    </text:list-level-style-number>
    <text:list-level-style-number text:level="4" style:num-format="">
-    <style:list-level-properties text:space-before="2.54cm" text:min-label-width="0.635cm"/>
+    <style:list-level-properties text:space-before="2.54cm"/>
    </text:list-level-style-number>
    <text:list-level-style-number text:level="5" style:num-format="">
-    <style:list-level-properties text:space-before="3.175cm" text:min-label-width="0.635cm"/>
+    <style:list-level-properties text:space-before="3.175cm"/>
    </text:list-level-style-number>
    <text:list-level-style-number text:level="6" style:num-format="">
-    <style:list-level-properties text:space-before="3.81cm" text:min-label-width="0.635cm"/>
+    <style:list-level-properties text:space-before="3.81cm"/>
    </text:list-level-style-number>
    <text:list-level-style-number text:level="7" style:num-format="">
-    <style:list-level-properties text:space-before="4.445cm" text:min-label-width="0.635cm"/>
+    <style:list-level-properties text:space-before="4.445cm"/>
    </text:list-level-style-number>
    <text:list-level-style-number text:level="8" style:num-format="">
-    <style:list-level-properties text:space-before="5.08cm" text:min-label-width="0.635cm"/>
+    <style:list-level-properties text:space-before="5.08cm"/>
    </text:list-level-style-number>
    <text:list-level-style-number text:level="9" style:num-format="">
-    <style:list-level-properties text:space-before="5.715cm" text:min-label-width="0.635cm"/>
+    <style:list-level-properties text:space-before="5.715cm"/>
    </text:list-level-style-number>
    <text:list-level-style-number text:level="10" style:num-format="">
-    <style:list-level-properties text:space-before="6.35cm" text:min-label-width="0.635cm"/>
+    <style:list-level-properties text:space-before="6.35cm"/>
    </text:list-level-style-number>
   </text:list-style>
 
index 9c85a75d16aa4489aabbfcc8ad685389b45f1854..806acd8f446d3145a1d268651885b8fe2106aaae 100644 (file)
@@ -1,3 +1,72 @@
+2012-04-26  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+       * org-table.el (org-table-number-fraction): Fix typo.
+
+2012-04-26  Eric Schulte  <eric.schulte@gmx.com>
+
+       * ob-python.el (org-babel-execute:python): Ensure newline precedes
+       automatically-added returns.
+
+2012-04-26  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+       * org-mouse.el (org-mode-hook): Do not move point when clicking on
+       a footnote reference.
+
+2012-04-26  Bastien Guerry  <bzg@gnu.org>
+
+       * org-faces.el (org-date-selected): Fix docstring.
+
+2012-04-26  Bastien Guerry  <bzg@gnu.org>
+
+       * org-ctags.el (org-ctags-new-topic-template): Remove * character
+       in front of variable docstring.
+
+2012-04-26  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+       * org-list.el (org-list-struct-indent): Follow
+       `org-list-demote-modify-bullet' specifications for ordered
+       bullets.
+       (org-list-indent-item-generic, org-indent-item-tree)
+       (org-outdent-item-tree): Fix bug when operating on a region.
+       (org-outdent-item, org-indent-item): Allow to operate on a region.
+
+       * org.el (org-shiftmetaleft, org-shiftmetaright): Allow to operate
+       on a region.
+
+2012-04-26  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+       * org-footnote.el (org-footnote-normalize): Fix positionning in
+       HTML export without a footnote section.
+
+2012-04-26  Madan Ramakrishnan  <madanr79@gmail.com>  (tiny change)
+
+       * org-agenda.el (org-agenda-bulk-mark): Truly make arg optional as
+       advertised by the function.
+
+2012-04-26  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
+
+       * org.el (org-read-date-display): Fix bug when displaying the
+       overlay.
+
+2012-04-26  Bastien Guerry  <bzg@gnu.org>
+
+       * org.el (org-mode): Don't use `buffer-face-mode' by default.
+
+2012-04-26  Bastien Guerry  <bzg@gnu.org>
+
+       * org-faces.el (org-date-selected): New face.
+
+2012-04-26  Jambunathan K  <kjambunathan@gmail.com>
+
+       * org-odt.el (org-odt-format-org-link): Pay no heed to whether the
+       internal links destined for headlines provide a description or
+       not.  In fact, the `org-store-link' and `org-insert-link' create
+       internal links which do have a description.
+
+2012-04-26  Bastien Guerry  <bzg@gnu.org>
+
+       * org-clock.el (org-program-exists): Fix docstring.
+
 2012-04-11  Bastien Guerry  <bzg@gnu.org>
 
        * org.el (org-point-at-end-of-empty-headline): Only try to match
index 0dc744aaa73af607c60824408d4a96443b357aec..348248f35cf37382d5f92735ce77a74240c91145 100644 (file)
@@ -64,7 +64,7 @@ This function is called by `org-babel-execute-src-block'."
         (preamble (cdr (assoc :preamble params)))
          (full-body
          (org-babel-expand-body:generic
-          (concat body (if return-val (format "return %s" return-val) ""))
+          (concat body (if return-val (format "\nreturn %s" return-val) ""))
           params (org-babel-variable-assignments:python params)))
          (result (org-babel-python-evaluate
                  session full-body result-type result-params preamble)))
index 3bb0fc84897f80b61b2e62aa84db90371d142590..ddb56ca4bac9860ce77c6299aeaaedef86069f0e 100644 (file)
@@ -8294,7 +8294,7 @@ This is a command that has to be installed in `calendar-mode-map'."
 (defun org-agenda-bulk-mark (&optional arg)
   "Mark the entry at point for future bulk action."
   (interactive "p")
-  (dotimes (i (max arg 1))
+  (dotimes (i (or arg 1))
     (unless (org-get-at-bol 'org-agenda-diary-link)
       (let* ((m (org-get-at-bol 'org-hd-marker))
             ov)
index 434f6a1d5f6a00e527c98454cc984f7b1f30129e..aabcfc187db3f018a9c22eac2eba954a8205637f 100644 (file)
@@ -664,7 +664,7 @@ Use alsa's aplay tool if available."
              (error (beep t) (beep t)))))))))
 
 (defun org-program-exists (program-name)
-  "Checks whenever we can locate program and launch it."
+  "Checks whenever we can locate PROGRAM-NAME using the `which' executable."
   (if (member system-type '(gnu/linux darwin))
       (= 0 (call-process "which" nil nil nil program-name))))
 
index 48656190a0cb04923ae7ce1d0b8722bc512fe86d..5874646ff48846e0ab1bd54df37a9e8acc6a7a2b 100644 (file)
@@ -188,7 +188,7 @@ See the ctags documentation for more information.")
 Created as a local variable in each buffer.")
 
 (defcustom org-ctags-new-topic-template
-  "<<%t>>\n\n\n\n\n\n"
+  "<<%t>>\n\n\n\n\n\n"
   "Text to insert when creating a new org file via opening a hyperlink.
 The following patterns are replaced in the string:
     `%t' - replaced with the capitalized title of the hyperlink"
index 481d662eca1d6f159bdd132f497a51ca502daf80..58f879dd51a36e096b14efcf91f2032bf973c9ef 100644 (file)
@@ -285,6 +285,16 @@ column view defines special faces for each outline level.  See the file
   "Face for date/time stamps."
   :group 'org-faces)
 
+(defface org-date-selected
+  (org-compatible-face nil
+    '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold nil))
+      (((class color) (min-colors 16) (background dark))  (:foreground "Pink" :bold nil))
+      (((class color) (min-colors 8)  (background light)) (:foreground "red"  :bold nil))
+      (((class color) (min-colors 8)  (background dark))  (:foreground "red"  :bold nil))
+      (t (:inverse-video t))))
+  "Face for highlighting the calendar day when using `org-read-date'."
+  :group 'org-faces)
+
 (defface org-sexp-date
   '((((class color) (background light)) (:foreground "Purple"))
     (((class color) (background dark)) (:foreground "Cyan"))
index 9319e0813c0528b5165ead2dff50185de0bfa698..a9ba8d7510baae6262acebeda1a0ba3fbe76267f 100644 (file)
@@ -716,8 +716,8 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
        ((and org-footnote-section (eq major-mode 'org-mode))
        (goto-char (point-min))
        (if (re-search-forward
-             (concat "^\\*[ \t]+" (regexp-quote org-footnote-section)
-                     "[ \t]*$") nil t)
+            (concat "^\\*[ \t]+" (regexp-quote org-footnote-section)
+                    "[ \t]*$") nil t)
            (delete-region (match-beginning 0) (org-end-of-subtree t t)))
        ;; A new footnote section is inserted by default at the end of
        ;; the buffer.
@@ -727,7 +727,14 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
        (unless (bolp) (newline)))
        ;; No footnote section set: Footnotes will be added at the end
        ;; of the section containing their first reference.
-       ((eq major-mode 'org-mode))
+       ;; Nevertheless, in an export situation, set insertion point to
+       ;; `point-max' by default.
+       ((eq major-mode 'org-mode)
+       (when export-props
+         (goto-char (point-max))
+         (skip-chars-backward " \r\t\n")
+         (forward-line)
+         (delete-region (point) (point-max))))
        (t
        ;; Remove any left-over tag in the buffer, if one is set up.
        (when org-footnote-tag-for-non-org-mode-files
index c3775888325b159023cde0e1c16c15fe40ff19a5..4498280ac771b28c05b04b482f561bd379c33a37 100644 (file)
@@ -1484,8 +1484,19 @@ bullets between START and END."
         (change-bullet-maybe
          (function
           (lambda (item)
-            (let* ((bul (org-trim (org-list-get-bullet item struct)))
-                   (new-bul-p (cdr (assoc bul org-list-demote-modify-bullet))))
+            (let ((new-bul-p
+                   (cdr (assoc
+                         ;; Normalize ordered bullets.
+                         (let ((bul (org-trim
+                                     (org-list-get-bullet item struct))))
+                           (cond ((string-match "[A-Z]\\." bul) "A.")
+                                 ((string-match "[A-Z])" bul) "A)")
+                                 ((string-match "[a-z]\\." bul) "a.")
+                                 ((string-match "[a-z])" bul) "a)")
+                                 ((string-match "[0-9]\\." bul) "1.")
+                                 ((string-match "[0-9])" bul) "1)")
+                                 (t bul)))
+                         org-list-demote-modify-bullet))))
               (when new-bul-p (org-list-set-bullet item struct new-bul-p))))))
         (ind
          (lambda (cell)
@@ -2500,7 +2511,6 @@ STRUCT is the list structure.
 
 Return t if successful."
   (save-excursion
-    (beginning-of-line)
     (let* ((regionp (org-region-active-p))
           (rbeg (and regionp (region-beginning)))
           (rend (and regionp (region-end)))
@@ -2509,7 +2519,8 @@ Return t if successful."
           (prevs (org-list-prevs-alist struct))
           ;; Are we going to move the whole list?
           (specialp
-           (and (= top (point))
+           (and (not regionp)
+                (= top (point-at-bol))
                 (cdr (assq 'indent org-list-automatic-rules))
                 (if no-subtree
                     (error
@@ -2523,12 +2534,12 @@ Return t if successful."
            (progn
              (set-marker org-last-indent-begin-marker rbeg)
              (set-marker org-last-indent-end-marker rend))
-         (set-marker org-last-indent-begin-marker (point))
+         (set-marker org-last-indent-begin-marker (point-at-bol))
          (set-marker org-last-indent-end-marker
                      (cond
                       (specialp (org-list-get-bottom-point struct))
-                      (no-subtree (1+ (point)))
-                      (t (org-list-get-item-end (point) struct))))))
+                      (no-subtree (1+ (point-at-bol)))
+                      (t (org-list-get-item-end (point-at-bol) struct))))))
       (let* ((beg (marker-position org-last-indent-begin-marker))
             (end (marker-position org-last-indent-end-marker)))
        (cond
@@ -2583,19 +2594,35 @@ Return t if successful."
   "Outdent a local list item, but not its children.
 If a region is active, all items inside will be moved."
   (interactive)
-  (if (org-at-item-p)
-      (let ((struct (org-list-struct)))
-       (org-list-indent-item-generic -1 t struct))
-    (error "Not at an item")))
+  (let ((regionp (org-region-active-p)))
+    (cond
+     ((or (org-at-item-p)
+         (and regionp
+              (save-excursion (goto-char (region-beginning))
+                              (org-at-item-p))))
+      (let ((struct (if (not regionp) (org-list-struct)
+                     (save-excursion (goto-char (region-beginning))
+                                     (org-list-struct)))))
+       (org-list-indent-item-generic -1 t struct)))
+     (regionp (error "Region not starting at an item"))
+     (t (error "Not at an item")))))
 
 (defun org-indent-item ()
   "Indent a local list item, but not its children.
 If a region is active, all items inside will be moved."
   (interactive)
-  (if (org-at-item-p)
-      (let ((struct (org-list-struct)))
-       (org-list-indent-item-generic 1 t struct))
-    (error "Not at an item")))
+  (let ((regionp (org-region-active-p)))
+    (cond
+     ((or (org-at-item-p)
+         (and regionp
+              (save-excursion (goto-char (region-beginning))
+                              (org-at-item-p))))
+      (let ((struct (if (not regionp) (org-list-struct)
+                     (save-excursion (goto-char (region-beginning))
+                                     (org-list-struct)))))
+       (org-list-indent-item-generic 1 t struct)))
+     (regionp (error "Region not starting at an item"))
+     (t (error "Not at an item")))))
 
 (defun org-outdent-item-tree ()
   "Outdent a local list item including its children.
@@ -2604,10 +2631,12 @@ If a region is active, all items inside will be moved."
   (let ((regionp (org-region-active-p)))
     (cond
      ((or (org-at-item-p)
-         (and (org-region-active-p)
-              (goto-char (region-beginning))
-              (org-at-item-p)))
-      (let ((struct (org-list-struct)))
+         (and regionp
+              (save-excursion (goto-char (region-beginning))
+                              (org-at-item-p))))
+      (let ((struct (if (not regionp) (org-list-struct)
+                     (save-excursion (goto-char (region-beginning))
+                                     (org-list-struct)))))
        (org-list-indent-item-generic -1 nil struct)))
      (regionp (error "Region not starting at an item"))
      (t (error "Not at an item")))))
@@ -2619,10 +2648,12 @@ If a region is active, all items inside will be moved."
   (let ((regionp (org-region-active-p)))
     (cond
      ((or (org-at-item-p)
-         (and (org-region-active-p)
-              (goto-char (region-beginning))
-              (org-at-item-p)))
-      (let ((struct (org-list-struct)))
+         (and regionp
+              (save-excursion (goto-char (region-beginning))
+                              (org-at-item-p))))
+      (let ((struct (if (not regionp) (org-list-struct)
+                     (save-excursion (goto-char (region-beginning))
+                                     (org-list-struct)))))
        (org-list-indent-item-generic 1 nil struct)))
      (regionp (error "Region not starting at an item"))
      (t (error "Not at an item")))))
index 5a87bd6469738cda1320614e2129491b20e55fcc..b467064b888043284a2466dddbeab566e4159339 100644 (file)
@@ -915,6 +915,7 @@ This means, between the beginning of line and the point."
          ((assq :checkbox context) (org-toggle-checkbox))
          ((assq :item-bullet context)
           (let ((org-cycle-include-plain-lists t)) (org-cycle)))
+         ((org-footnote-at-reference-p) nil)
          (t ad-do-it))))))
 
 (defun org-mouse-move-tree-start (event)
index 234272a378df2624de0bc0da60365e9857457367..2e984a575bd32e34c2453c645659bfb24bd85020 100644 (file)
@@ -1689,7 +1689,6 @@ ATTR is a string of other attributes of the a element."
             (or (not thefile) (string= thefile ""))
             (plist-get org-lparse-opt-plist :section-numbers)
             (setq sec-frag fragment)
-            (org-find-text-property-in-string 'org-no-description fragment)
             (or (string-match  "\\`sec\\(\\(-[0-9]+\\)+\\)" sec-frag)
                 (and (setq sec-frag
                            (loop for alias in org-export-target-aliases do
index 08981b57e498762183c6f2978d7086205e9b47c8..37e5c4f91a6794c8d192733d42b57c0cf550ab66 100644 (file)
@@ -135,8 +135,8 @@ Other options offered by the customize interface are more restrictive."
 
 (defcustom org-table-number-fraction 0.5
   "Fraction of numbers in a column required to make the column align right.
-In a column all non-white fields are considered.  If at least this
-fraction of fields is matched by `org-table-number-fraction',
+In a column all non-white fields are considered.  If at least
+this fraction of fields is matched by `org-table-number-regexp',
 alignment to the right border applies."
   :group 'org-table-settings
   :type 'number)
index c2cc2354439018767217a4d66b182b9567455117..838a9a18ad463bb8ca5b196730282f9d915c57f3 100644 (file)
@@ -5057,8 +5057,7 @@ The following commands are available:
        'org-parse-arguments)
   (set (make-local-variable 'pcomplete-termination-string) "")
   (when (>= emacs-major-version 23)
-    (set (make-local-variable 'buffer-face-mode-face) 'org-default)
-    (buffer-face-mode))
+    (set (make-local-variable 'buffer-face-mode-face) 'org-default))
 
   ;; If empty file that did not turn on org-mode automatically, make it to.
   (if (and org-insert-mode-line-in-empty-file
@@ -14915,7 +14914,7 @@ So these are more for recording a certain time/date."
   (org-time-stamp arg 'inactive))
 
 (defvar org-date-ovl (make-overlay 1 1))
-(overlay-put org-date-ovl 'face 'org-warning)
+(overlay-put org-date-ovl 'face 'org-date-selected)
 (org-detach-overlay org-date-ovl)
 
 (defvar org-ans1) ; dynamically scoped parameter
@@ -15131,35 +15130,35 @@ user."
   (when org-read-date-display-live
     (when org-read-date-overlay
       (delete-overlay org-read-date-overlay))
-    (let ((p (point)))
-      (end-of-line 1)
-      (while (not (equal (buffer-substring
-                         (max (point-min) (- (point) 4)) (point))
-                        "    "))
-       (insert " "))
-      (goto-char p))
-    (let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
-                       " " (or org-ans1 org-ans2)))
-          (org-end-time-was-given nil)
-          (f (org-read-date-analyze ans org-def org-defdecode))
-          (fmts (if org-dcst
-                    org-time-stamp-custom-formats
-                  org-time-stamp-formats))
-          (fmt (if (or org-with-time
-                       (and (boundp 'org-time-was-given) org-time-was-given))
-                   (cdr fmts)
-                 (car fmts)))
-          (txt (concat "=> " (format-time-string fmt (apply 'encode-time f)))))
-      (when (and org-end-time-was-given
-                (string-match org-plain-time-of-day-regexp txt))
-       (setq txt (concat (substring txt 0 (match-end 0)) "-"
-                         org-end-time-was-given
-                         (substring txt (match-end 0)))))
-      (when org-read-date-analyze-futurep
-       (setq txt (concat txt " (=>F)")))
-      (setq org-read-date-overlay
-           (make-overlay (1- (point-at-eol)) (point-at-eol)))
-      (org-overlay-display org-read-date-overlay txt 'secondary-selection))))
+    (when (minibufferp (current-buffer))
+      (save-excursion
+       (end-of-line 1)
+       (while (not (equal (buffer-substring
+                           (max (point-min) (- (point) 4)) (point))
+                          "    "))
+         (insert " ")))
+      (let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
+                         " " (or org-ans1 org-ans2)))
+            (org-end-time-was-given nil)
+            (f (org-read-date-analyze ans org-def org-defdecode))
+            (fmts (if org-dcst
+                      org-time-stamp-custom-formats
+                    org-time-stamp-formats))
+            (fmt (if (or org-with-time
+                         (and (boundp 'org-time-was-given) org-time-was-given))
+                     (cdr fmts)
+                   (car fmts)))
+            (txt (concat "=> " (format-time-string fmt (apply 'encode-time f)))))
+       (when (and org-end-time-was-given
+                  (string-match org-plain-time-of-day-regexp txt))
+         (setq txt (concat (substring txt 0 (match-end 0)) "-"
+                           org-end-time-was-given
+                           (substring txt (match-end 0)))))
+       (when org-read-date-analyze-futurep
+         (setq txt (concat txt " (=>F)")))
+       (setq org-read-date-overlay
+             (make-overlay (1- (point-at-eol)) (point-at-eol)))
+       (org-overlay-display org-read-date-overlay txt 'secondary-selection)))))
 
 (defun org-read-date-analyze (ans org-def org-defdecode)
   "Analyze the combined answer of the date prompt."
@@ -17969,28 +17968,34 @@ See the individual commands for more information."
 
 (defun org-shiftmetaleft ()
   "Promote subtree or delete table column.
-Calls `org-promote-subtree', `org-outdent-item',
-or `org-table-delete-column', depending on context.
-See the individual commands for more information."
+Calls `org-promote-subtree', `org-outdent-item-tree', or
+`org-table-delete-column', depending on context.  See the
+individual commands for more information."
   (interactive)
   (cond
    ((run-hook-with-args-until-success 'org-shiftmetaleft-hook))
    ((org-at-table-p) (call-interactively 'org-table-delete-column))
    ((org-at-heading-p) (call-interactively 'org-promote-subtree))
-   ((org-at-item-p) (call-interactively 'org-outdent-item-tree))
+   ((if (not (org-region-active-p)) (org-at-item-p)
+      (save-excursion (goto-char (region-beginning))
+                     (org-at-item-p)))
+    (call-interactively 'org-outdent-item-tree))
    (t (org-modifier-cursor-error))))
 
 (defun org-shiftmetaright ()
   "Demote subtree or insert table column.
-Calls `org-demote-subtree', `org-indent-item',
-or `org-table-insert-column', depending on context.
-See the individual commands for more information."
+Calls `org-demote-subtree', `org-indent-item-tree', or
+`org-table-insert-column', depending on context.  See the
+individual commands for more information."
   (interactive)
   (cond
    ((run-hook-with-args-until-success 'org-shiftmetaright-hook))
    ((org-at-table-p) (call-interactively 'org-table-insert-column))
    ((org-at-heading-p) (call-interactively 'org-demote-subtree))
-   ((org-at-item-p) (call-interactively 'org-indent-item-tree))
+   ((if (not (org-region-active-p)) (org-at-item-p)
+      (save-excursion (goto-char (region-beginning))
+                     (org-at-item-p)))
+    (call-interactively 'org-indent-item-tree))
    (t (org-modifier-cursor-error))))
 
 (defun org-shiftmetaup (&optional arg)