]> code.delx.au - gnu-emacs/commitdiff
2009-01-27 Carsten Dominik <carsten.dominik@gmail.com>
authorCarsten Dominik <dominik@science.uva.nl>
Tue, 27 Jan 2009 11:39:48 +0000 (11:39 +0000)
committerCarsten Dominik <dominik@science.uva.nl>
Tue, 27 Jan 2009 11:39:48 +0000 (11:39 +0000)
* org.el (org-todo): Return correct state type even if the blocker
throws an error.
(org-modifier-cursor-error): Renamed from
`org-shiftcursor-error'.
(org-shiftmetaleft, org-shiftmetaright, org-shiftmetaup)
(org-shiftmetadown): Call `org-modifier-cursor-error'.

* org-agenda.el (org-agenda-todo): Call `org-todo' interactively,
to get real errors from the blocker hook.

* org.el (org-shiftselect-error, org-call-for-shift-select): New
functions.
(org-set-visibility-according-to-property): Turn off the setting
of `org-show-entry-below', to avoid overruling a FOLDED visibility
property.

* org.el (org-support-shift-select): New option.
(org-shiftup, org-shiftdown, org-shiftright, org-shiftleft)
(org-shiftcontrolright, org-shiftcontrolleft): Support for shift
selection outside contexts.

* org-list.el (org-at-item-bullet-p): New function.

* org-jsinfo.el (org-infojs-handle-options): Remove unnecessary
variables.

* org-footnote.el (org-footnote-normalize): Remove unnecessary
variable.
(org-insert-footnote-reference-near-definition): Remove
unnecessary let form.

35 files changed:
doc/misc/ChangeLog
lisp/org/ChangeLog
lisp/org/org-agenda.el
lisp/org/org-archive.el
lisp/org/org-attach.el
lisp/org/org-bbdb.el
lisp/org/org-bibtex.el
lisp/org/org-clock.el
lisp/org/org-colview.el
lisp/org/org-compat.el
lisp/org/org-exp.el
lisp/org/org-export-latex.el
lisp/org/org-faces.el
lisp/org/org-footnote.el
lisp/org/org-gnus.el
lisp/org/org-id.el
lisp/org/org-info.el
lisp/org/org-irc.el
lisp/org/org-jsinfo.el
lisp/org/org-list.el
lisp/org/org-mac-message.el
lisp/org/org-macs.el
lisp/org/org-mew.el
lisp/org/org-mhe.el
lisp/org/org-mouse.el
lisp/org/org-plot.el
lisp/org/org-publish.el
lisp/org/org-remember.el
lisp/org/org-rmail.el
lisp/org/org-table.el
lisp/org/org-timer.el
lisp/org/org-vm.el
lisp/org/org-w3m.el
lisp/org/org-wl.el
lisp/org/org.el

index f46514d21730c02759c4eab5547d53bd39240f7e..81bd01e76642427f2484defcc2278acd7d33e044 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-27  Carsten Dominik  <dominik@science.uva.nl>
+
+       * org.texi (Plain lists, TODO basics, Priorities)
+       (Multiple sets in one file, Conflicts): Document interaction with
+       `shift-selection-mode'.
+
 2009-01-27  Jay Belanger  <jay.p.belanger@gmail.com>
 
        * calc.texi (Embedded Mode, Algebraic-Style Calculations):
index 61852f6b37f6eef5cabe1af2964cde7724737eb4..846dcabf26e864d3c760dead9b6224d6a7fce707 100644 (file)
@@ -1,3 +1,36 @@
+2009-01-27  Carsten Dominik  <carsten.dominik@gmail.com>
+
+       * org.el (org-todo): Return correct state type even if the blocker
+       throws an error.
+       (org-modifier-cursor-error): Renamed from
+       `org-shiftcursor-error'.
+       (org-shiftmetaleft, org-shiftmetaright, org-shiftmetaup)
+       (org-shiftmetadown): Call `org-modifier-cursor-error'.
+
+       * org-agenda.el (org-agenda-todo): Call `org-todo' interactively,
+       to get real errors from the blocker hook.
+
+       * org.el (org-shiftselect-error, org-call-for-shift-select): New
+       functions.
+       (org-set-visibility-according-to-property): Turn off the setting
+       of `org-show-entry-below', to avoid overruling a FOLDED visibility
+       property.
+
+       * org.el (org-support-shift-select): New option.
+       (org-shiftup, org-shiftdown, org-shiftright, org-shiftleft)
+       (org-shiftcontrolright, org-shiftcontrolleft): Support for shift
+       selection outside contexts.
+
+       * org-list.el (org-at-item-bullet-p): New function.
+
+       * org-jsinfo.el (org-infojs-handle-options): Remove unnecessary
+       variables.
+
+       * org-footnote.el (org-footnote-normalize): Remove unnecessary
+       variable.
+       (org-insert-footnote-reference-near-definition): Remove
+       unnecessary let form.
+
 2009-01-26  Carsten Dominik  <dominik@science.uva.nl>
 
        * org-export-latex.el (org-export-as-latex): Call
index 698c6244ac4fa71d1cbe962e58f30c0b780c11a9..97d68d5aa9fb7bcfbd666d31eda8a26ce2d221e5 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -2612,7 +2612,7 @@ in `org-agenda-text-search-extra-files'."
                      'keymap org-agenda-keymap
                      'help-echo (format "mouse-2 or RET jump to location")))
         regexp rtn rtnall files file pos
-        marker priority category tags c neg re
+        marker category tags c neg re
         ee txt beg end words regexps+ regexps- hdl-only buffer beg1 str)
     (unless (and (not edit-at)
                 (stringp string)
@@ -3715,7 +3715,7 @@ FRACTION is what fraction of the head-warning time has passed."
         (regexp org-tr-regexp)
         (d0 (calendar-absolute-from-gregorian date))
         marker hdmarker ee txt d1 d2 s1 s2 timestr category todo-state tags pos
-        donep head)
+        head)
     (goto-char (point-min))
     (while (re-search-forward regexp nil t)
       (catch :skip
@@ -4324,7 +4324,7 @@ to switch to narrowing."
        (effort-prompt "")
        (inhibit-read-only t)
        (current org-agenda-filter)
-       char a n tag tags)
+       char a n tag)
     (unless char
       (message
        "%s by tag [%s ], [TAB], [/]:off, [+-]:narrow, [>=<]:effort: "
@@ -4423,7 +4423,7 @@ If the line does not have an effort defined, return nil."
       (while (not (eobp))
        (if (get-text-property (point) 'org-marker)
            (progn
-             (setq tags (get-text-property (point) 'tags))
+             (setq tags (get-text-property (point) 'tags)) ; used in eval
              (if (not (eval org-agenda-filter-form))
                  (org-agenda-filter-by-tag-hide-line))
              (beginning-of-line 2))
@@ -5084,7 +5084,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
        (save-excursion
          (and (outline-next-heading)
               (org-flag-heading nil)))   ; show the next heading
-       (org-todo arg)
+       (call-interactively 'org-todo)
        (and (bolp) (forward-char 1))
        (setq newhead (org-get-heading))
        (when (and (org-bound-and-true-p
@@ -5419,7 +5419,7 @@ TAB   Visit marked entry in other window
 
 The cursor may be at a date in the calendar, or in the Org agenda."
   (interactive)
-  (let (pos ans)
+  (let (ans)
     (message "Select action: [m]ark | [s]chedule [d]eadline [r]emember [ ]show")
     (setq ans (read-char-exclusive))
     (cond
index 8c2ef988030c303fe62a6d38eaa7a16a3d505834..045a505e45fa099d865d32f845864453dcddb5d7 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 9ee6af64efe7731527b36e58624b21beef4f0e55..d68fe410c9b58ce49ae6f0aa3c9035a3ea9df38c 100644 (file)
@@ -4,7 +4,7 @@
 
 ;; Author: John Wiegley <johnw@newartisans.com>
 ;; Keywords: org data task
-;; Version: 6.19a
+;; Version: 6.19e
 
 ;; This file is part of GNU Emacs.
 ;;
index b925151743fce784f667c026c311827ca39c1ed9..5656ba5f5e78a9ac5b1da44ee740822811c4bbf5 100644 (file)
@@ -7,7 +7,7 @@
 ;;         Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -292,7 +292,7 @@ This is used by Org to re-create the anniversary hash table."
          (y (nth 2 date))  ; year
          (annivs (gethash (list m d) org-bbdb-anniv-hash))
          (text ())
-         split class form rec recs)
+         rec recs)
 
     ;; we don't want to miss people born on Feb. 29th
     (when (and (= m 3) (= d 1)
index 0df5d4a05ac21274012545f130fd094035b8b2d9..968da0044a833cac33f11a2605a7c55d800ad0f8 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Bastien Guerry <bzg at altern dot org>
 ;;         Carsten Dominik <carsten dot dominik at gmail dot com>
 ;; Keywords: org, wp, remember
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 3703b52d1cb82d5cba318b56243553d0ba6e5f4c..44118471625440f7447cb7ee278bf7a1304c55bb 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -188,7 +188,7 @@ of a different task.")
 (defun org-clock-select-task (&optional prompt)
   "Select a task that recently was associated with clocking."
   (interactive)
-  (let (sel-list rpl file task (i 0) s)
+  (let (sel-list rpl (i 0) s)
     (save-window-excursion
       (org-switch-to-buffer-other-window
        (get-buffer-create "*Clock Task Select*"))
index 1de46fef303926727111811e2f677de57caba990..3de6ec958449a480db744cd134e95e0873aa7848 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -149,7 +149,7 @@ This is the compiled version of the format.")
         (face1 (list color 'org-agenda-column-dateline ref-face))
         (pl (or (get-text-property (point-at-bol) 'prefix-length) 0))
         (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
-        pom property ass width f string ov column val modval s1 s2 title)
+        pom property ass width f string ov column val modval s2 title)
     ;; Check if the entry is in another buffer.
     (unless props
       (if (eq major-mode 'org-agenda-mode)
index cc4a2fa9d6a37d8983318906e373576ef1fd4b31..e9e750437b5357967d63772f56c45f0f1396cc9f 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 14abae40507979f579f3d4e3b03385c91183611d..89cbd95d61b03571ef03fb9423aa2bb5a6eb14f5 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -981,7 +981,7 @@ modified) list.")
                    "LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE" "LATEX_HEADER"
                    "EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS")
                  (mapcar 'car org-export-inbuffer-options-extra))))
-           p key val text options js-up js-main js-css js-opt a pr style
+           p key val text options a pr style
            latex-header
            ext-setup-or-nil setup-contents (start 0))
        (while (or (and ext-setup-or-nil
@@ -1040,7 +1040,7 @@ modified) list.")
   "Parse an OPTIONS line and set values in the property list P."
   (let (o)
     (when options
-      (let ((op org-export-plist-vars) a)
+      (let ((op org-export-plist-vars))
        (while (setq o (pop op))
          (if (and (nth 1 o)
                   (string-match (concat (regexp-quote (nth 1 o))
@@ -1640,7 +1640,7 @@ on this string to produce the exported version."
 
 (defun org-export-kill-licensed-text ()
   "Remove all text that is marked with a :org-license-to-kill property."
-  (let (p q)
+  (let (p)
     (while (setq p (text-property-any (point-min) (point-max)
                                      :org-license-to-kill t))
       (delete-region
@@ -1849,7 +1849,7 @@ from the buffer."
        (tags (plist-get opts :tags))
        (pri  (plist-get opts :priority))
        (elts '(1 2 3 4 5))
-       rpl props)
+       rpl)
     (setq elts (delq nil (list 1 (if todo 2) (if pri 3) 4 (if tags 5))))
     (when (or (not todo) (not tags) (not pri))
       (goto-char (point-min))
@@ -1898,7 +1898,7 @@ from the buffer."
 (defun org-export-protect-colon-examples ()
   "Protect lines starting with a colon."
   (goto-char (point-min))
-  (let ((re "^[ \t]*:\\([ \t]\\|$\\)") beg end)
+  (let ((re "^[ \t]*:\\([ \t]\\|$\\)") beg)
     (while (re-search-forward re nil t)
       (beginning-of-line 1)
       (setq beg (point))
@@ -2133,7 +2133,7 @@ can work correctly."
 
 (defun org-export-get-title-from-subtree ()
   "Return subtree title and exclude it from export."
-  (let (title (m (mark)) (rbeg (region-beginning)) (rend (region-end)))
+  (let (title (rbeg (region-beginning)) (rend (region-end)))
     (save-excursion
       (goto-char rbeg)
       (when (and (org-at-heading-p)
@@ -2160,7 +2160,7 @@ can work correctly."
 
 (defun org-get-min-level (lines)
   "Get the minimum level in LINES."
-  (let ((re "^\\(\\*+\\) ") l min)
+  (let ((re "^\\(\\*+\\) ") l)
     (catch 'exit
       (while (setq l (pop lines))
        (if (string-match re l)
@@ -2363,7 +2363,7 @@ and `+n' for continuing previous numering.
 Code formatting according to language currently only works for HTML.
 Numbering lines works for all three major backends (html, latex, and ascii)."
   (save-match-data
-    (let (num cont rtn named rpllbl keepp textareap cols rows fmt)
+    (let (num cont rtn rpllbl keepp textareap cols rows fmt)
       (setq opts (or opts "")
            num (string-match "[-+]n\\>" opts)
            cont (string-match "\\+n\\>" opts)
@@ -4445,9 +4445,8 @@ If there are links in the string, don't modify these."
   "Apply all active conversions to translate special ASCII to HTML."
   (setq s (org-html-protect s))
   (if org-export-html-expand
-      (let ((start 0))
-       (while (string-match "@&lt;\\([^&]*\\)&gt;" s)
-         (setq s (replace-match "<\\1>" t nil s)))))
+      (while (string-match "@&lt;\\([^&]*\\)&gt;" s)
+       (setq s (replace-match "<\\1>" t nil s))))
   (if org-export-with-emphasize
       (setq s (org-export-html-convert-emphasize s)))
   (if org-export-with-special-strings
@@ -4747,7 +4746,7 @@ When COMBINE is non nil, add the category to each line."
              "DTSTART"))
        hd ts ts2 state status (inc t) pos b sexp rrule
        scheduledp deadlinep todo prefix due start
-       tmp pri categories entry location summary desc uid
+       tmp pri categories location summary desc uid
        (sexp-buffer (get-buffer-create "*ical-tmp*")))
     (org-refresh-category-properties)
     (save-excursion
index a6958860276ddd9985fef06f5d0c92996001fa06..ce79337b4f68cb46b6290320e0f87a43dfd304dd 100644 (file)
@@ -4,7 +4,7 @@
 ;;
 ;; Emacs Lisp Archive Entry
 ;; Filename: org-export-latex.el
-;; Version: 6.19a
+;; Version: 6.19e
 ;; Author: Bastien Guerry <bzg AT altern DOT org>
 ;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
 ;; Keywords: org, wp, tex
@@ -434,7 +434,8 @@ when PUB-DIR is set, use this as the publishing directory."
                     (region-p nil)
                     (t (plist-get opt-plist :skip-before-1st-heading))))
         (text (plist-get opt-plist :text))
-        (first-lines (if skip "" (org-export-latex-first-lines opt-plist rbeg)))
+        (first-lines (if skip "" (org-export-latex-first-lines
+                                  opt-plist rbeg)))
         (coding-system (and (boundp 'buffer-file-coding-system)
                             buffer-file-coding-system))
         (coding-system-for-write (or org-export-latex-coding-system
@@ -1306,7 +1307,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 
   ;; Convert LaTeX to \LaTeX{}
   (goto-char (point-min))
-  (let ((case-fold-search nil) rpl)
+  (let ((case-fold-search nil))
     (while (re-search-forward "\\([^+_]\\)LaTeX" nil t)
       (org-if-unprotected
        (replace-match (org-export-latex-protect-string
index eb415a4a154edfa4b7936a3194d0f0eb974c92e5..2ba13d2e965b727c1f06aec183a04bc851c52153 100644 (file)
@@ -1,12 +1,12 @@
 ;;; org-faces.el --- Face definitions for Org-mode.
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009;
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 05ebce54c0bfc3a10b184742727920f4888add8e..4372411c06d757aca0757c7713a0466fd7793ad5 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -255,7 +255,7 @@ or new, let the user edit the definition of the footnote."
   "Start the definition of a footnote with label LABEL."
   (interactive "sLabel: ")
   (setq label (org-footnote-normalize-label label))
-  (let (re p)
+  (let (re)
     (cond
      ((org-mode-p)
       (if (not org-footnote-section)
@@ -322,7 +322,7 @@ Org-mode exporters.
 When SORT-ONLY is set, only sort the footnote definitions into the
 referenced sequence."
   ;; This is based on Paul's function, but rewritten.
-  (let ((count 0) ref def idef ref-table liste beg beg1 marker a before
+  (let ((count 0) ref def idef ref-table beg beg1 marker a before
        ins-point)
      (save-excursion
       ;; Now find footnote references, and extract the definitions
@@ -443,12 +443,11 @@ referenced sequence."
   "Find first reference of footnote ENTRY and insert the definition there.
 ENTRY is (fn-label num-mark definition)."
   (when (car entry)
-    (let ((pos (point)))
-      (goto-char (point-min))
-      (when (re-search-forward (format ".\\[%s[]:]" (regexp-quote (car entry)))
-                              nil t)
-       (org-footnote-goto-local-insertion-point)
-       (insert (format "\n\n[%s] %s" (car entry) (nth 2 entry)))))))
+    (goto-char (point-min))
+    (when (re-search-forward (format ".\\[%s[]:]" (regexp-quote (car entry)))
+                            nil t)
+      (org-footnote-goto-local-insertion-point)
+      (insert (format "\n\n[%s] %s" (car entry) (nth 2 entry))))))
 
 (defun org-footnote-goto-local-insertion-point ()
   "Find insertion point for footnote, just before next outline heading."
index 3c56e7f6bc469a6a5218163855a0a802658f2816..393d47b25c9c3c677321e37bd4413e014e118ddf 100644 (file)
@@ -7,7 +7,7 @@
 ;;         Tassilo Horn <tassilo at member dot fsf dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 0623c6071a86117ed0161d53dc65df2e65d21bb2..659142b7191f07f3ec04808832581d71d1a30d84 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -499,7 +499,7 @@ When CHECK is given, prepare detailed information about duplicate IDs."
   (let ((res (make-hash-table
              :test 'equal
              :size (apply '+ (mapcar 'length list))))
-       f i)
+       f)
     (mapc
      (lambda (x)
        (setq f (car x))
@@ -540,7 +540,7 @@ If that files does not exist, or if it does not contain this ID,
 return nil.
 The position is returned as a cons cell (file-name . position).  With
 optional argument MARKERP, return the position as a new marker."
-  (let (org-agenda-new-buffers buf pos)
+  (let (org-agenda-new-buffers buf pos)
     (cond
      ((not file) nil)
      ((not (file-exists-p file)) nil)
index a2c8acffbd11eab7fea7c7ead905fe4a6a13b370..388ae9d8212b2de83eeaf3b04eb3a554afa37054 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 596f6a9d8e7c391dc54eb5db29f707f92e3b448b..ddf9e3bc6354ed0fa78ae0a7f674768960c54c7d 100644 (file)
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Philip Jackson <emacs@shellarchive.co.uk>
 ;; Keywords: erc, irc, link, org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 39462cf3266694d6deba1320cc6f5a7a8bfc8c6f..d2b49a007d4e9cb3ee454c22e3a2c684c93c91ca 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -130,7 +130,7 @@ Option settings will replace the %MANAGER-OPTIONS cookie."
     (let ((template org-infojs-template)
        (ptoc (plist-get exp-plist :table-of-contents))
        (hlevels (plist-get exp-plist :headline-levels))
-       tdepth sdepth p1 s p v a1 tmp e opt var val table default)
+       tdepth sdepth s v e opt var val table default)
     (setq sdepth hlevels
          tdepth hlevels)
     (if (integerp ptoc) (setq tdepth (min ptoc tdepth)))
index bf5bbdf234df7ae5b4f02146f87190c093f48c22..08140a348037996585e81547dd5ad4d90b52c26b 100644 (file)
@@ -7,7 +7,7 @@
 ;;        Bastien Guerry <bzg AT altern DOT org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -162,6 +162,12 @@ list, obtained by prompting the user."
        ((= llt ?\)) "\\([ \t]*\\([-+]\\|\\([0-9]+))\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
        (t (error "Invalid value of `org-plain-list-ordered-item-terminator'")))))))
 
+(defun org-at-item-bullet-p ()
+  "Is point at the bullet of a plain list item?"
+  (and (org-at-item-p)
+       (not (member (char-after) '(?\  ?\t)))
+       (< (point) (match-end 0))))
+
 (defun org-in-item-p ()
   "It the cursor inside a plain list item.
 Does not have to be the first line."
index b65bc20eae88b22f7b4a1283b23b159c3fb92e97..3a94d2feafa2a3d2a7e742a54b5a29d82cf3e8e0 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
-;; Version: 6.19a
+;; Version: 6.19e
 ;; Keywords: outlines, hypermedia, calendar, wp
 
 ;; This file is part of GNU Emacs.
index 2055fcf7c8b07ea82184885706c564e8105b4d0f..70c9fc390a84a31fcf9c16d972c6e7a96917a0bf 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 20a0f08fdcda6029580144031917ff2e55ceaee6..afbbe9a88f17dfa54b1ea1522c29f7358b343f48 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 
 ;; This file is part of GNU Emacs.
 
index ef32397ea283684adf63ee177afa79e24c0b0557..d8276f09e5367904924471dcdef020ad673bd7e4 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index c04acb2bf309d7abe694c4e509ffd36782754aef..a0597fec6ee4599d3adda982376e7d6824605285 100644 (file)
@@ -1,10 +1,10 @@
 ;;; org-mouse.el --- Better mouse support for org-mode
 
-;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation
 ;;
 ;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
 ;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index a0a79a82c395f09e831a509ee4537d2e99367622..fadd3541d0a62aa94a1730d0d9719f1b548bf589 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte <schulte dot eric at gmail dot com>
 ;; Keywords: tables, plotting
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 149975fac220a214a90d4f09ee820059cac313e4..1ad5ae6820baa5d2ae6c55af56b8c3a24586ce99 100644 (file)
@@ -4,7 +4,7 @@
 ;; Author: David O'Toole <dto@gnu.org>
 ;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
 ;; Keywords: hypermedia, outlines, wp
-;; Version: 6.19a
+;; Version: 6.19e
 
 ;; This file is part of GNU Emacs.
 ;;
index 8114d32dea75d1af0af558c8201d10569b432b81..74a7ada51db78e17aa1b052e6eb78345445e6153 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 45990f0f4dcb972c1225c7e028a3e21b5088d931..927d49edac6aa030f54c026bb62277437ad4b8b8 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -35,6 +35,7 @@
 (require 'org)
 
 ;; Declare external functions and variables
+(declare-function rmail-narrow-to-non-pruned-header "rmail" ())
 (declare-function rmail-show-message "rmail" (&optional n no-summary))
 (declare-function rmail-what-message "rmail" ())
 (defvar rmail-current-message)
index fbc7debe1b21bccebdcddab40285069c9bee3146..0c78685752c69a50878f79dc02ce8698ffbffd29 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 3320f77d2975695d105e84b3a7498b23889277d0..4c3584b4e7b2f2447785c9affc152f73434c1a50 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 225660b7da4653bee9a22632f7b3ff5ffb21ccd5..2f12d6de07f35f37227e65356ec47c055eb5c0a0 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index f1d2350b0ba3913eae5febea6d75a0c6b52a38b7..808199e4bbae021c9da50f4cc7197488c6c64f28 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 0863c7a4b48d181d25c9c521087a3481300e717e..91d29ff0d9c2b2c9f688f8ce209a6bc96c9e2d82 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
index 22db64a6ad69f8e3a597cccb6f15e89a1ad4d11c..5508b814f9947e09af6133a32d6ad4d1d4b4b2a2 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19a
+;; Version: 6.19e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -94,7 +94,7 @@
 
 ;;; Version
 
-(defconst org-version "6.19a"
+(defconst org-version "6.19e"
   "The version number of the file org.el.")
 
 (defun org-version (&optional here)
@@ -199,6 +199,48 @@ to add the symbol `xyz', and the package must have a call to
        (const :tag "C  sqlinsert:         Convert Org-mode tables to SQL insertions" orgtbl-sqlinsert)
        (repeat :tag "External packages" :inline t (symbol :tag "Package"))))
 
+(defcustom org-support-shift-select nil
+  "Non-nil means, make shift-cursor commands select text when possible.
+
+In Emacs 23, when `shift-select-mode' is on, shifted cursor keys start
+selecting a region, or enlarge thusly regions started in this way.
+In Org-mode, in special contexts, these same keys are used for other
+purposes, important enough to compete with shift selection.  Org tries
+to balance these needs by supporting `shift-select-mode' outside these
+special contexts, under control of this variable.
+
+The default of this variable is nil, to avoid confusing behavior.  Shifted
+cursor keys will then execute Org commands in the following contexts:
+- on a headline, changing TODO state (left/right) and priority (up/down)
+- on a time stamp, changing the time
+- in a plain list item, changing the bullet type
+- in a property definition line, switching between allowed values
+- in the BEGIN line of a clock table (changing the time block).
+Outside these contexts, the commands will throw an error.
+
+When this variable is t and the cursor is not in a special context,
+Org-mode will support shift-selection for making and enlarging regions.
+To make this more effective, the bullet cycling will no longer happen
+anywhere in an item line, but only if the cursor is exactly on the bullet.
+
+If you set this variable to the symbol `always', then the keys
+will not be special in headlines, property lines, and item lines, to make
+shift selection work there as well.  If this is what you want, you can
+use the following alternative commands: `C-c C-t' and `C-c ,' to
+change TODO state and priority, `C-u C-u C-c C-t' can be used to switch
+TODO sets, `C-c -' to cycle item bullet types, and properties can be
+edited by hand or in column view.
+
+However, when the cursor is on a timestamp, shift-cursor commands
+will still edit the time stamp - this is just too good to give up.
+
+XEmacs user should have this variable set to nil, because shift-select-mode
+is Emacs 23 only."
+  :group 'org
+  :type '(choice
+         (const :tag "Never" nil)
+         (const :tag "When outside special context" t)
+         (const :tag "Everywhere except timestamps" always)))
 
 (defgroup org-startup nil
   "Options concerning startup of Org-mode."
@@ -2341,7 +2383,6 @@ Changing this variable requires a restart of Emacs to take effect."
           (border (nth 2 e))
           (body (nth 3 e))
           (nl (nth 4 e))
-          (stacked (and nil (nth 5 e))) ; stacked is no longer allowed, forced to nil
           (body1 (concat body "*?"))
           (markers (mapconcat 'car org-emphasis-alist ""))
           (vmarkers (mapconcat
@@ -2361,17 +2402,17 @@ Changing this variable requires a restart of Emacs to take effect."
                               (int-to-string nl) "\\}")))
       ;; Make the regexp
       (setq org-emph-re
-           (concat "\\([" pre (if (and nil stacked) markers) "]\\|^\\)"
+           (concat "\\([" pre "]\\|^\\)"
                    "\\("
                    "\\([" markers "]\\)"
                    "\\("
                    "[^" border "]\\|"
-                   "[^" border (if (and nil stacked) markers) "]"
+                   "[^" border "]"
                    body1
-                   "[^" border (if (and nil stacked) markers) "]"
+                   "[^" border "]"
                    "\\)"
                    "\\3\\)"
-                   "\\([" post (if (and nil stacked) markers) "]\\|$\\)"))
+                   "\\([" post "]\\|$\\)"))
       (setq org-verbatim-re
            (concat "\\([" pre "]\\|^\\)"
                    "\\("
@@ -4404,7 +4445,7 @@ With a numeric prefix, show all headlines up to that level."
 (defun org-set-visibility-according-to-property (&optional no-cleanup)
   "Switch subtree visibilities according to :VISIBILITY: property."
   (interactive)
-  (let (state)
+  (let (org-show-entry-below state)
     (save-excursion
       (goto-char (point-min))
       (while (re-search-forward
@@ -4482,16 +4523,16 @@ This function is the default value of the hook `org-cycle-hook'."
      ((eq state 'subtree)  (or (org-subtree-end-visible-p) (recenter 1))))))
 
 (defun org-compact-display-after-subtree-move ()
-  (let (beg end)
-    (save-excursion
-      (if (org-up-heading-safe)
-         (progn
-           (hide-subtree)
-           (show-entry)
-           (show-children)
-           (org-cycle-show-empty-lines 'children)
-           (org-cycle-hide-drawers 'children))
-       (org-overview)))))
+  "Show a compacter version of the tree of the entry's parent."
+  (save-excursion
+    (if (org-up-heading-safe)
+       (progn
+         (hide-subtree)
+         (show-entry)
+         (show-children)
+         (org-cycle-show-empty-lines 'children)
+         (org-cycle-hide-drawers 'children))
+      (org-overview))))
 
 (defun org-cycle-show-empty-lines (state)
   "Show empty lines above all visible headlines.
@@ -5846,7 +5887,7 @@ exit by killing the buffer with \\[org-edit-src-exit]."
        (msg (substitute-command-keys
              "Edit, then exit with C-c ' (C-c and single quote)"))
        (org-mode-p (eq major-mode 'org-mode))
-       beg end lang lang-f)
+       beg end)
     (beginning-of-line 1)
     (if (looking-at "[ \t]*[^:\n \t]")
        nil
@@ -5913,7 +5954,7 @@ the language, a switch telling of the content should be in a single line."
            ("^#\\+ascii:" "\n" "ascii" single-line)
            )))
        (pos (point))
-       re re1 re2 single beg end lang lfmt match-re1)
+       re1 re2 single beg end lang lfmt match-re1)
     (catch 'exit
       (while (setq entry (pop re-list))
        (setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry)
@@ -7836,7 +7877,7 @@ operation has put the subtree."
     (apply
      'org-ido-completing-read prompt
      (lambda (string predicate &optional flag)
-       (let (rtn r f (l (length string)))
+       (let (rtn r f (l (length string)))
         (cond
          ((eq flag nil)
           ;; try completion
@@ -8275,6 +8316,7 @@ DONE are present, add TODO at the beginning of the heading.
 
 With C-u prefix arg, use completion to determine the new state.
 With numeric prefix arg, switch to that state.
+With a double C-u prefix, switch to the next set of TODO keywords (nextset).
 
 For calling through lisp, arg is also interpreted in the following way:
 'none             -> empty state
@@ -8285,6 +8327,7 @@ For calling through lisp, arg is also interpreted in the following way:
 \"WAITING\"         -> switch to the specified keyword, but only if it
                      really is a member of `org-todo-keywords'."
   (interactive "P")
+  (if (equal arg '(16)) (setq arg 'nextset))
   (save-excursion
     (catch 'exit
       (org-back-to-heading)
@@ -8368,6 +8411,8 @@ For calling through lisp, arg is also interpreted in the following way:
                                 :position startpos))
             dolog now-done-p)
        (when org-blocker-hook
+         (setq org-last-todo-state-is-todo
+               (not (member this org-done-keywords)))
          (unless (save-excursion
                    (save-match-data
                      (run-hook-with-args-until-failure
@@ -8659,7 +8704,7 @@ This function is run automatically after each state change to a DONE state."
         (org-log-done nil)
         (org-todo-log-states nil)
         (nshiftmax 10) (nshift 0)
-        re type n what ts mb0 time)
+        re type n what ts time)
     (when repeat
       (if (eq org-log-repeat t) (setq org-log-repeat 'state))
       (org-todo (if (eq interpret 'type) last-state head))
@@ -8682,8 +8727,7 @@ This function is run automatically after each state change to a DONE state."
              re (save-excursion (outline-next-heading) (point)) t)
        (setq type (if (match-end 1) org-scheduled-string
                     (if (match-end 3) org-deadline-string "Plain:"))
-             ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0)))
-             mb0 (match-beginning 0))
+             ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0))))
        (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts)
          (setq n (string-to-number (match-string 2 ts))
                what (match-string 3 ts))
@@ -10166,7 +10210,7 @@ the scanner.  The following items can be given here:
         (org-agenda-skip-function
          (car (org-delete-all '(comment archive) skip)))
         (org-tags-match-list-sublevels t)
-        matcher pos file res
+        matcher file res
         org-todo-keywords-for-agenda
         org-done-keywords-for-agenda
         org-todo-keyword-alist-for-agenda
@@ -10190,7 +10234,6 @@ the scanner.  The following items can be given here:
               (list (buffer-file-name (current-buffer))))
              (setq res (org-scan-tags func matcher)))
          ;; Get the right scope
-         (setq pos (point))
          (cond
           ((and scope (listp scope) (symbolp (car scope)))
            (setq scope (eval scope)))
@@ -10588,7 +10631,7 @@ With INCLUDE-DEFAULTS, also include properties that has special meaning
 internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING.
 With INCLUDE-COLUMNS, also include property names given in COLUMN
 formats in the current buffer."
-  (let (rtn range cfmt cols s p)
+  (let (rtn range cfmt s p)
     (save-excursion
       (save-restriction
        (widen)
@@ -12898,9 +12941,19 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names."
             'delete-backward-char 'org-delete-backward-char)
   (org-defkey org-mode-map "|" 'org-force-self-insert))
 
-(defun org-shiftcursor-error ()
+(defun org-modifier-cursor-error ()
+  "Throw an error, a modified cursor command was applied in wrong context."
+  (error "This command is active in special context like tables, headlines or items"))
+
+(defun org-shiftselect-error ()
   "Throw an error because Shift-Cursor command was applied in wrong context."
-  (error "This command is active in special context like tables, headlines or timestamps"))
+  (if (and (boundp 'shift-select-mode) shift-select-mode)
+      (error "To use shift-selection with Org-mode, customize `org-support-shift-select'.")
+    (error "This command works only in special context like headlines or timestamps.")))
+
+(defun org-call-for-shift-select (cmd)
+  (let ((this-command-keys-shift-translated t))
+    (call-interactively cmd)))
 
 (defun org-shifttab (&optional arg)
   "Global visibility cycling or move to previous table field.
@@ -12926,7 +12979,7 @@ See the individual commands for more information."
    ((org-at-table-p) (call-interactively 'org-table-delete-column))
    ((org-on-heading-p) (call-interactively 'org-promote-subtree))
    ((org-at-item-p) (call-interactively 'org-outdent-item))
-   (t (org-shiftcursor-error))))
+   (t (org-modifier-cursor-error))))
 
 (defun org-shiftmetaright ()
   "Demote subtree or insert table column.
@@ -12938,7 +12991,7 @@ See the individual commands for more information."
    ((org-at-table-p) (call-interactively 'org-table-insert-column))
    ((org-on-heading-p) (call-interactively 'org-demote-subtree))
    ((org-at-item-p) (call-interactively 'org-indent-item))
-   (t (org-shiftcursor-error))))
+   (t (org-modifier-cursor-error))))
 
 (defun org-shiftmetaup (&optional arg)
   "Move subtree up or kill table row.
@@ -12950,7 +13003,7 @@ for more information."
    ((org-at-table-p) (call-interactively 'org-table-kill-row))
    ((org-on-heading-p) (call-interactively 'org-move-subtree-up))
    ((org-at-item-p) (call-interactively 'org-move-item-up))
-   (t (org-shiftcursor-error))))
+   (t (org-modifier-cursor-error))))
 (defun org-shiftmetadown (&optional arg)
   "Move subtree down or insert table row.
 Calls `org-move-subtree-down' or `org-table-insert-row' or
@@ -12961,7 +13014,7 @@ commands for more information."
    ((org-at-table-p) (call-interactively 'org-table-insert-row))
    ((org-on-heading-p) (call-interactively 'org-move-subtree-down))
    ((org-at-item-p) (call-interactively 'org-move-item-down))
-   (t (org-shiftcursor-error))))
+   (t (org-modifier-cursor-error))))
 
 (defun org-metaleft (&optional arg)
   "Promote heading or move table column to left.
@@ -13019,13 +13072,20 @@ Calls `org-timestamp-up' or `org-priority-up', or `org-previous-item',
 depending on context.  See the individual commands for more information."
   (interactive "P")
   (cond
+   ((and org-support-shift-select (org-region-active-p))
+    (org-call-for-shift-select 'previous-line))
    ((org-at-timestamp-p t)
     (call-interactively (if org-edit-timestamp-down-means-later
                            'org-timestamp-down 'org-timestamp-up)))
-   ((org-on-heading-p) (call-interactively 'org-priority-up))
-   ((org-at-item-p) (call-interactively 'org-previous-item))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-on-heading-p))
+    (call-interactively 'org-priority-up))
+   ((and (not org-support-shift-select) (org-at-item-p))
+    (call-interactively 'org-previous-item))
    ((org-clocktable-try-shift 'up arg))
-   (t (call-interactively 'org-beginning-of-item) (beginning-of-line 1))))
+   (org-support-shift-select
+    (org-call-for-shift-select 'previous-line))
+   (t (org-shiftselect-error))))
 
 (defun org-shiftdown (&optional arg)
   "Decrease item in timestamp or decrease priority of current headline.
@@ -13033,12 +13093,20 @@ Calls `org-timestamp-down' or `org-priority-down', or `org-next-item'
 depending on context.  See the individual commands for more information."
   (interactive "P")
   (cond
+   ((and org-support-shift-select (org-region-active-p))
+    (org-call-for-shift-select 'next-line))
    ((org-at-timestamp-p t)
     (call-interactively (if org-edit-timestamp-down-means-later
                            'org-timestamp-up 'org-timestamp-down)))
-   ((org-on-heading-p) (call-interactively 'org-priority-down))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-on-heading-p))
+    (call-interactively 'org-priority-down))
+   ((and (not org-support-shift-select) (org-at-item-p))
+    (call-interactively 'org-next-item))
    ((org-clocktable-try-shift 'down arg))
-   (t (call-interactively 'org-next-item))))
+   (org-support-shift-select 
+    (org-call-for-shift-select 'next-line))
+   (t (org-shiftselect-error))))
 
 (defun org-shiftright (&optional arg)
   "Cycle the thing at point or in the current line, depending on context.
@@ -13051,12 +13119,24 @@ Depending on context, this does one of the following:
 - on a clocktable definition line, move time block into the future"
   (interactive "P")
   (cond
+   ((and org-support-shift-select (org-region-active-p))
+    (org-call-for-shift-select 'forward-char))
    ((org-at-timestamp-p t) (call-interactively 'org-timestamp-up-day))
-   ((org-on-heading-p) (org-call-with-arg 'org-todo 'right))
-   ((org-at-item-p) (org-call-with-arg 'org-cycle-list-bullet nil))
-   ((org-at-property-p) (call-interactively 'org-property-next-allowed-value))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-on-heading-p))
+    (org-call-with-arg 'org-todo 'right))
+   ((or (and org-support-shift-select
+            (not (eq org-support-shift-select 'always))
+            (org-at-item-bullet-p))
+       (and (not org-support-shift-select) (org-at-item-p)))
+    (org-call-with-arg 'org-cycle-list-bullet nil))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-at-property-p))
+    (call-interactively 'org-property-next-allowed-value))
    ((org-clocktable-try-shift 'right arg))
-   (t (org-shiftcursor-error))))
+   (org-support-shift-select 
+    (org-call-for-shift-select 'forward-char))
+   (t (org-shiftselect-error))))
 
 (defun org-shiftleft (&optional arg)
   "Cycle the thing at point or in the current line, depending on context.
@@ -13069,27 +13149,50 @@ Depending on context, this does one of the following:
 - on a clocktable definition line, move time block into the past"
   (interactive "P")
   (cond
+   ((and org-support-shift-select (org-region-active-p))
+    (org-call-for-shift-select 'backward-char))
    ((org-at-timestamp-p t) (call-interactively 'org-timestamp-down-day))
-   ((org-on-heading-p) (org-call-with-arg 'org-todo 'left))
-   ((org-at-item-p) (org-call-with-arg 'org-cycle-list-bullet 'previous))
-   ((org-at-property-p)
+   ((and (not (eq org-support-shift-select 'always))
+        (org-on-heading-p))
+    (org-call-with-arg 'org-todo 'left))
+   ((or (and org-support-shift-select
+            (not (eq org-support-shift-select 'always))
+            (org-at-item-bullet-p))
+       (and (not org-support-shift-select) (org-at-item-p)))
+    (org-call-with-arg 'org-cycle-list-bullet 'previous))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-at-property-p))
     (call-interactively 'org-property-previous-allowed-value))
    ((org-clocktable-try-shift 'left arg))
-   (t (org-shiftcursor-error))))
+   (org-support-shift-select 
+    (org-call-for-shift-select 'backward-char))
+   (t (org-shiftselect-error))))
 
 (defun org-shiftcontrolright ()
   "Switch to next TODO set."
   (interactive)
   (cond
-   ((org-on-heading-p) (org-call-with-arg 'org-todo 'nextset))
-   (t (org-shiftcursor-error))))
+   ((and org-support-shift-select (org-region-active-p))
+    (org-call-for-shift-select 'forward-word))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-on-heading-p))
+    (org-call-with-arg 'org-todo 'nextset))
+   (org-support-shift-select
+    (org-call-for-shift-select 'forward-word))
+   (t (org-shiftselect-error))))
 
 (defun org-shiftcontrolleft ()
   "Switch to previous TODO set."
   (interactive)
   (cond
-   ((org-on-heading-p) (org-call-with-arg 'org-todo 'previousset))
-   (t (org-shiftcursor-error))))
+   ((and org-support-shift-select (org-region-active-p))
+    (org-call-for-shift-select 'backward-word))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-on-heading-p))
+    (org-call-with-arg 'org-todo 'previousset))
+   (org-support-shift-select
+    (org-call-for-shift-select 'backward-word))
+   (t (org-shiftselect-error))))
 
 (defun org-ctrl-c-ret ()
   "Call `org-table-hline-and-move' or `org-insert-heading' dep. on context."
@@ -14846,7 +14949,7 @@ Show the heading too, if it is currently invisible."
         (re (concat "^" outline-regexp))
         (subs (make-vector (1+ n) nil))
         (last-level 0)
-        m tree level head)
+        m level head)
     (save-excursion
       (save-restriction
        (widen)
@@ -14899,7 +15002,7 @@ if no description is present"
 To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]."
   (interactive)
   (require 'org-agenda)
-  (let (p m tp np dir txt w)
+  (let (p m tp np dir txt)
     (cond
      ((setq p (text-property-any (point-at-bol) (point-at-eol)
                                 'org-imenu t))