From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: [PATCH] extend doc strings of priority defcustoms Date: Mon, 30 May 2011 23:10:13 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QR9j5-0006FM-Jn for emacs-orgmode@gnu.org; Mon, 30 May 2011 17:10:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QR9j4-0004F8-Hg for emacs-orgmode@gnu.org; Mon, 30 May 2011 17:10:15 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:49872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QR9j4-0004F2-DD for emacs-orgmode@gnu.org; Mon, 30 May 2011 17:10:14 -0400 Received: by eyd9 with SMTP id 9so1604659eyd.0 for ; Mon, 30 May 2011 14:10:13 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode In the meantime I understand better what happens. I rewrote the doc strings and added an error message to avoid the wrong error "No priority cookie found in line" for the case of org-default-priority out of range. My previous patch is to be replaced by this one: * org.el (org-default-priority): Document dependency on org-priority-start-cycle-with-default. (org-priority-start-cycle-with-default): Document dependency on org-default-priority. (org-priority): Error added for case of org-default-priority out of range. --- lisp/org.el | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 498c606..241fa11 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -2488,14 +2488,20 @@ Must have a larger ASCII number than `org-highest-priority'." (defcustom org-default-priority ?B "The default priority of TODO items. -This is the priority an item get if no explicit priority is given." +This is the priority an item gets if no explicit priority is given. +When starting to cycle on an empty priority the first step in the cycle +depends on `org-priority-start-cycle-with-default'. The resulting first +step priority must not exceed the range from `org-highest-priority' to +`org-lowest-priority' which means that `org-default-priority' has to be +in this range exclusive or inclusive the range boundaries." :group 'org-priorities :type 'character) (defcustom org-priority-start-cycle-with-default t "Non-nil means start with default priority when starting to cycle. When this is nil, the first step in the cycle will be (depending on the -command used) one higher or lower that the default priority." +command used) one higher or lower than the default priority. +See also `org-default-priority'." :group 'org-priorities :type 'boolean) @@ -12306,12 +12312,18 @@ ACTION can be `set', `up', `down', or a character." (if (and (not have) (eq last-command this-command)) (setq new org-lowest-priority) (setq new (if (and org-priority-start-cycle-with-default (not have)) - org-default-priority (1- current))))) + org-default-priority (1- current))) + (when (< (upcase new) org-highest-priority) + (error + "See `org-default-priority' for range limit exceeded here")))) ((eq action 'down) (if (and (not have) (eq last-command this-command)) (setq new org-highest-priority) (setq new (if (and org-priority-start-cycle-with-default (not have)) - org-default-priority (1+ current))))) + org-default-priority (1+ current))) + (when (> (upcase new) org-lowest-priority) + (error + "See `org-default-priority' for range limit exceeded here")))) (t (error "Invalid action"))) (if (or (< (upcase new) org-highest-priority) (> (upcase new) org-lowest-priority)) -- 1.7.4.2