From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2FMeEEz8e1/9VQAA0tVLHw (envelope-from ) for ; Tue, 06 Oct 2020 05:10:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id l07zC0z8e18XVgAA1q6Kng (envelope-from ) for ; Tue, 06 Oct 2020 05:10:36 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DD4A894053B for ; Tue, 6 Oct 2020 05:10:34 +0000 (UTC) Received: from localhost ([::1]:53706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPfFA-00010y-Fh for larch@yhetil.org; Tue, 06 Oct 2020 01:10:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPfE7-00010E-N1 for emacs-orgmode@gnu.org; Tue, 06 Oct 2020 01:09:27 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:55156) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPfE5-0000c6-8f for emacs-orgmode@gnu.org; Tue, 06 Oct 2020 01:09:27 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 44E887E60A; Tue, 6 Oct 2020 01:09:22 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=AMuaUjLPd0pS6XAO4qSOp0MXQ0A=; b=lIvJQY GcA2dXc3mlNJfOGz+XBw3lysWnH5SA5Jly0lXekwfpICoy/t30EH9kjvTJgdSZ6J N7VzEBrQhNhg47WpSUYlcvpQnau8m5NGIlq+Vf+Ri9CHLUzexQUklfAaRkWyBXpM wBOGv1dqoOPM3NMKtrhm7mqd9tRtled+oZ97c= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 3C7757E609; Tue, 6 Oct 2020 01:09:22 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=mesmtp; bh=ghVRQUHMT0lF/avOnHjfodYBDm48QemyTWSyVAtz+dw=; b=Pe9ZYZnA4svBDsXEr9QPLMJGqdAN1Nnf8NJf5v/n4U74oGYkkzfNkK1odiRfhJQJUGDpp+dAD0e9ZvWhYGwdup4FBdTxh4MRJIpUrwpGoJYmoD0pTuyEmwSjGnUJsW0MsRSEY/E3o9AMJFJT1NQIAaZlrkCygEaeIl+EjZrkueg= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 7D1177E608; Tue, 6 Oct 2020 01:09:21 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: joakim@verona.se Subject: Re: problem with org-highest-priority In-Reply-To: <878sckz66g.fsf@tanaka.verona.se> References: <878sckz66g.fsf@tanaka.verona.se> Date: Tue, 06 Oct 2020 01:09:19 -0400 Message-ID: <87v9fovt34.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 18103E90-0792-11EB-A93A-74DE23BA3BAF-24757444!pb-smtp2.pobox.com Received-SPF: pass client-ip=64.147.108.71; envelope-from=kyle@kyleam.com; helo=pb-smtp2.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/06 01:09:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=lIvJQY G; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=Pe9ZYZnA; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: nWg3NFNxsmjs joakim@verona.se writes: > This used to work: > (defun jv-org-priorities () > (setq org-highest-priority ?0 ;; 64 @ 48 0, bugs start happening if you have higher prios tnan 0, like '!' > org-lowest-priority ?E ;; E > org-default-priority ?0 ;; 0 > org-priority-regexp ".*?\\(\\[#\\([;:<=>?@A-Z0-9]\\)\\] ?\\)" > )) > > I could then have priority cookies from [#0] to [#E]. > > With the current org I get [#48] instead of [#0]. > > Is there any way to restore the previous behaviour? The change in behavior you describe came with 4f98694bf (Allow numeric values for priorities, 2020-01-30). Based on quickly skimming that commit, I think the issue boils down to intentionally not supporting a mix of numbers and letters. I'm out of time tonight to look at it too closely, but I think support for your use case could be restored with something like the lightly tested patch below. diff --git a/lisp/org.el b/lisp/org.el index 425e9391b..8237f39f6 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11166,8 +11166,7 @@ (defun org-priority (&optional action show) (unless org-priority-enable-commands (user-error "Priority commands are disabled")) (setq action (or action 'set)) - (let ((nump (< org-priority-lowest 65)) - current new news have remove) + (let (current new news have remove) (save-excursion (org-back-to-heading t) (when (looking-at org-priority-regexp) @@ -11181,27 +11180,18 @@ (defun org-priority (&optional action show) (integerp action)) (if (not (eq action 'set)) (setq new action) - (setq - new - (if nump - (string-to-number - (read-string (format "Priority %s-%s, SPC to remove: " - (number-to-string org-priority-highest) - (number-to-string org-priority-lowest)))) - (progn (message "Priority %c-%c, SPC to remove: " - org-priority-highest org-priority-lowest) - (save-match-data - (setq new (read-char-exclusive))))))) + (setq new + (progn (message "Priority %c-%c, SPC to remove: " + org-priority-highest org-priority-lowest) + (save-match-data + (setq new (read-char-exclusive)))))) (when (and (= (upcase org-priority-highest) org-priority-highest) (= (upcase org-priority-lowest) org-priority-lowest)) (setq new (upcase new))) (cond ((equal new ?\s) (setq remove t)) ((or (< (upcase new) org-priority-highest) (> (upcase new) org-priority-lowest)) - (user-error - (if nump - "Priority must be between `%s' and `%s'" - "Priority must be between `%c' and `%c'") - org-priority-highest org-priority-lowest)))) + (user-error "Priority must be between `%c' and `%c'" + org-priority-highest org-priority-lowest)))) ((eq action 'up) (setq new (if have (1- current) ; normal cycling @@ -11235,7 +11225,7 @@ (defun org-priority (&optional action show) (setq remove t))) ;; Numerical priorities are limited to 64, beyond that number, ;; assume the priority cookie is a character. - (setq news (if (> new 64) (format "%c" new) (format "%s" new))) + (setq news (format "%c" new)) (if have (if remove (replace-match "" t t nil 1)