From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0DUcAQS+rmH/KQEAgWs5BA (envelope-from ) for ; Tue, 07 Dec 2021 02:51:00 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CIVpNgO+rmFTRwAAbx9fmQ (envelope-from ) for ; Tue, 07 Dec 2021 01:50:59 +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 6E6F62AAA6 for ; Tue, 7 Dec 2021 02:50:59 +0100 (CET) Received: from localhost ([::1]:34488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muPdC-00077N-2S for larch@yhetil.org; Mon, 06 Dec 2021 20:50:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muPbJ-000771-Tk for emacs-orgmode@gnu.org; Mon, 06 Dec 2021 20:49:01 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:52426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muPbJ-00062T-Ls for emacs-orgmode@gnu.org; Mon, 06 Dec 2021 20:49:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1muPbJ-0003ha-Im for emacs-orgmode@gnu.org; Mon, 06 Dec 2021 20:49:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#52341: Fwd: 29.0.50; org-priority 'SPC to remove' doesn't work Resent-From: Kyle Meyer Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Tue, 07 Dec 2021 01:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52341 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: bruce robertson Received: via spool by 52341-submit@debbugs.gnu.org id=B52341.163884173214211 (code B ref 52341); Tue, 07 Dec 2021 01:49:01 +0000 Received: (at 52341) by debbugs.gnu.org; 7 Dec 2021 01:48:52 +0000 Received: from localhost ([127.0.0.1]:35739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muPb9-0003h9-VA for submit@debbugs.gnu.org; Mon, 06 Dec 2021 20:48:52 -0500 Received: from out1.migadu.com ([91.121.223.63]:44107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muPb8-0003h1-86 for 52341@debbugs.gnu.org; Mon, 06 Dec 2021 20:48:51 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1638841728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gfY+Z+rsnJIOfAo8RgIoP/NWcXz8eGJ5V7cddggKEJw=; b=S+4bnSOYC4G3S3vpdDXfDkvOgF4486+yUFBrAno7njaiytQyy5necUdOc07QJ56GBmNJJI Ay+1+tZuuQOjRYop43c0sew0wjuRwZD6Nb/38i0wFBdIQ1gdOzTmWUKCC61UTSlou0R4V0 8Fx037MFdhVrwcLOotlkFJG/8I2kNiREs4GVXBE3Jy8ln5h4nGPKFaGomyT+CVrHM/dhuy DRfOe3Skd1irsc5NXCUVt7Ap1W/QR5zfwpZOBob+7Az/BCY8OBErGCPgKc5SQ+jqY6yVSt Usne4ZcLsPbFkhZTCE8/DKhlTJahYfNJUfZgQ+TtoKamCgmVePHbIliunUjJyA== From: Kyle Meyer In-Reply-To: References: Date: Mon, 06 Dec 2021 20:48:46 -0500 Message-ID: <877dch89s1.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: emacs-orgmode@gnu.org List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastien , 52341@debbugs.gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638841859; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=gfY+Z+rsnJIOfAo8RgIoP/NWcXz8eGJ5V7cddggKEJw=; b=DaXltD1eVesxzD/EvpLd/d3Y/5xEoys3aaTQPqUVJPDILHnzuLZrO6WG+5pZ5wKcK94i5d C8AsG1pYkgRDtBbZMTtfG89lqa9akKxrWsUK6oLEhPva3w4uEgcfR8/l3vXcE3llPYVax2 Kx3PbABdhCeUy+bNNuj8x8Avt3ketKz+v9Gz6z33axRFIMPDjS6j4f2b3W3uGKIGkYbnoL +LVW1GpVFAIMaZNoxmE6Mp1YK2sshqCdHTJ4fwlcPTSI4GSYMqdLlNxJbEGjHQeIl6+O/+ QY2b3dyuEtpOUTvsKMmaTivGLTX3aPY3w49DpMWwo2BPqhsSy43VCLFBDER5LQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638841859; a=rsa-sha256; cv=none; b=PvV7YGGJpg/TOsNlBkDEiw5bDg+Btvrj/rAwzsyKcK3yHsRxYj0Jqh5qWbdTZuMum4Hucw 34W5YqCvYo9aY58P8Y7pA9Zwmt5L99ME2vnMCx/cSWh6D8/t/5lXGG6N4yiPIK82pyyFN0 8Xen/JnKDXVhx89uRGJAWrt643Kwo5K/4/d4c6DO6hvLxDW4fnb923CG71kdQuHRX51FBS /zeXcDa+LAYbZI5Jjj7GVwQr9zbp2AcGjPBfckf33xSuQSDxg2DjpKu7nQy0wBA4lxjPbW 50ZhOuS/YwlKkbNSG6ovmOn4lV7wnzfIkq9KVFZgQUCMqJfRHF3c4a7wXOVyYg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kyleam.com header.s=key1 header.b=S+4bnSOY; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.04 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kyleam.com header.s=key1 header.b=S+4bnSOY; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 6E6F62AAA6 X-Spam-Score: -2.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: iRzpHiJh+j19 bruce robertson writes: > 1. in init.el: > (custom-set-variables > '(org-priority-default 32) > '(org-priority-highest 0) > '(org-priority-lowest 31) > ) > 2. position to line in .org file: > ** TODO [#0] test line > > 3. from M-x view-lossage: > C-c , ;; org-priority > > 4. mini-buffer displays: > "Priority 0-31, SPC to remove: " > > 5. further in view-lossage: > SPC ;; self-insert-command > ;; exit-minibuffer > > 4. from *Messages* (and mini-buffer): > Priority of current item set to 0 > > 5. PROBLEM: > I wanted to remove priority. > > 6. WORK-AROUND: > set priority to 32. Then priority disappears. Perhaps this is because 32 > is space code or because I've set org-priority-default to 32. > ( I spent a medium amount of time to find this behavior. ) > > 7. SUGGESTION: > rewrite org-priority to have a clear distinction between numbers and > characters and whatever will be used to remove the priority. > ( I gave a look at this but my emacs-fu is too weak. Or my time-fu is > too small. ) Right, this stems from org-priority feeding " " to string-to-number and ending up with 0 instead of the ?\s (32) that's used downstream to signal "remove". The problem goes back to when support for numeric priorities was added in Org v9.4's 4f98694bf (Allow numeric values for priorities, 2020-01-30). I suppose one solution would be to check for " " and translate that to the ?\s so that the remove is triggered. I'll plan to apply the change below to Org's bugfix branch in a day or two unless the author of the above commit (+cc) or someone else has another suggestion. diff --git a/lisp/org.el b/lisp/org.el index 1a1375461..998da0656 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11323,13 +11323,14 @@ (defun org-priority (&optional action show) (setq new (if nump - (let ((msg (format "Priority %s-%s, SPC to remove: " - (number-to-string org-priority-highest) - (number-to-string org-priority-lowest)))) - (if (< 9 org-priority-lowest) - (string-to-number (read-string msg)) - (message msg) - (string-to-number (char-to-string (read-char-exclusive))))) + (let* ((msg (format "Priority %s-%s, SPC to remove: " + (number-to-string org-priority-highest) + (number-to-string org-priority-lowest))) + (s (if (< 9 org-priority-lowest) + (read-string msg) + (message msg) + (char-to-string (read-char-exclusive))))) + (if (equal s " ") ?\s (string-to-number s))) (progn (message "Priority %c-%c, SPC to remove: " org-priority-highest org-priority-lowest) (save-match-data