GNU bug report logs - #52341
Fwd: 29.0.50; org-priority 'SPC to remove' doesn't work

Previous Next

Package: org-mode;

Reported by: bruce robertson <brucer42 <at> gmail.com>

Date: Mon, 6 Dec 2021 23:53:02 UTC

Severity: normal

Merged with 52392

Found in version 29.0.50

Done: Kyle Meyer <kyle <at> kyleam.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52341 in the body.
You can then email your comments to 52341 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#52341; Package emacs. (Mon, 06 Dec 2021 23:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to bruce robertson <brucer42 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 06 Dec 2021 23:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: bruce robertson <brucer42 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Fwd: 29.0.50; org-priority 'SPC to remove' doesn't work
Date: Mon, 6 Dec 2021 15:52:00 -0800
[Message part 1 (text/plain, inline)]
whoops

---------- Forwarded message ---------
From: bruce robertson <brucer42 <at> gmail.com>
Date: Mon, Dec 6, 2021 at 2:18 PM
Subject: 29.0.50; org-priority 'SPC to remove' doesn't work
To: <bug-gnus-emacs <at> gnu.org>


I'm sending this again because I'm not confident my emacs/macos email iface
is good.
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
 <return>      ;; 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. )

Thank you, thank you, thank you for emacs and org-mode and ...

In GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin21.1.0, NS appkit-2113.00
Version 12.0.1 (Build 21A559))
 of 2021-11-23 built on brucer42s-MacBook-Pro.local
Repository revision: c760ffa25e11fa442406d290a8ddb5d4208394dc
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.0.1

Configured using:
 'configure --with-ns --with-modules
 '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --with-xwidgets --with-native-compilation
 'CFLAGS=-I/usr/local/opt/gcc/include -I/usr/local/opt/libgccjit/include
 -O2' 'LDFLAGS=-L/usr/local/opt/gcc/lib/gcc/11
 -L/usr/local/opt/gcc/lib/gcc/11/gcc/x86_64-apple-darwin20/11.2.0
 -L/usr/local/opt/libgccjit/lib/gcc/11 -I/usr/local/opt/gcc/include
 -I/usr/local/opt/libgccjit/include -Wl,-headerpad_max_install_names''

Configured features:
ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS WEBP
XIM XWIDGETS ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ELisp/l

Minor modes in effect:
  shell-dirtrack-mode: t
  ido-everywhere: t
  save-place-mode: t
  global-hl-line-mode: t
  global-auto-revert-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  prettify-symbols-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail files-x grep rng-xsd xsd-regexp
rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse
rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln
nxml-rap sgml-mode nxml-util nxml-enc xmltok sh-script smie log-view
dired-aux cperl-mode facemenu make-mode vc-mtn vc-hg vc-bzr vc-src
vc-sccs vc-svn vc-cvs vc-rcs vc-dir ewoc etags fileloop xref project
log-edit pcvs-util add-log shell compile ledger-mode ledger-check
ledger-texi ledger-test ledger-sort ledger-report ledger-reconcile
ledger-occur ledger-fonts ledger-fontify ledger-state ledger-complete
ledger-schedule ledger-init ledger-xact ledger-post ledger-exec
ledger-navigate eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg
esh-module esh-groups esh-util ledger-context ledger-commodities
ledger-regex bookmark pp tabify org-capture smerge-mode diff vc shortdoc
help-fns radix-tree edmacro kmacro crm executable org-clock misearch
multi-isearch diary-lib diary-loaddefs cal-iso org-duration vc-git
diff-mode vc-dispatcher org-element avl-tree generator disp-table ol-eww
eww xdg url-queue thingatpt mm-url ol-rmail ol-mhe ol-irc ol-info
ol-gnus nnselect gnus-search eieio-opt speedbar ezimage dframe gnus-art
mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr kinsoku svg dom
gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap
nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int gnus-range
message yank-media rmc puny rfc822 mml mml-sec epa derived epg rfc6068
epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-search
mail-utils mm-util mail-prsvr wid-edit ol-docview doc-view jka-compr
image-mode exif dired dired-loaddefs ol-bibtex ol-bbdb ol-w3m ol-doi
org-link-doi face-remap org-agenda org-refile ido saveplace ob-gnuplot
ob-dot ob-ruby hl-line netrc autorevert filenotify comp comp-cstr
warnings delsel cl-extra org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro org-footnote org-src ob-comint org-pcomplete pcomplete comint
ansi-color ring org-list org-faces org-entities noutline outline
easy-mmode org-version ob-emacs-lisp ob-core ob-eval org-table oc-basic
bibtex iso8601 time-date ol rx org-keys oc org-compat advice org-macs
org-loaddefs format-spec find-func help-mode cal-menu calendar
cal-loaddefs finder-inf info package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq
gv subr-x byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize
mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads xwidget-internal kqueue cocoa
ns lcms2 multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 1321045 588964)
 (symbols 48 35709 2)
 (strings 32 184989 63848)
 (string-bytes 1 9552482)
 (vectors 16 76633)
 (vector-slots 8 2062758 499224)
 (floats 8 551 895)
 (intervals 56 90184 35949)
 (buffers 992 108))

-- 
λέγει αὐτῷ Ἰησοῦς Ἐγώ εἰμι ἡ ὁδὸς καὶ ἡ ἀλήθεια καὶ ἡ ζωή· οὐδεὶς ἔρχεται
πρὸς τὸν Πατέρα εἰ μὴ δι' ἐμοῦ. ΚΑΤΑ ΙΩΑΝΝΗΝ


-- 
λέγει αὐτῷ Ἰησοῦς Ἐγώ εἰμι ἡ ὁδὸς καὶ ἡ ἀλήθεια καὶ ἡ ζωή· οὐδεὶς ἔρχεται
πρὸς τὸν Πατέρα εἰ μὴ δι' ἐμοῦ. ΚΑΤΑ ΙΩΑΝΝΗΝ
[Message part 2 (text/html, inline)]

Information forwarded to emacs-orgmode <at> gnu.org:
bug#52341; Package org-mode. (Tue, 07 Dec 2021 01:49:01 GMT) Full text and rfc822 format available.

Message #8 received at 52341 <at> debbugs.gnu.org (full text, mbox):

From: Kyle Meyer <kyle <at> kyleam.com>
To: bruce robertson <brucer42 <at> gmail.com>
Cc: Bastien <bzg <at> gnu.org>, 52341 <at> debbugs.gnu.org
Subject: Re: bug#52341: Fwd: 29.0.50; org-priority 'SPC to remove' doesn't work
Date: Mon, 06 Dec 2021 20:48:46 -0500
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
>  <return>      ;; 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




Information forwarded to emacs-orgmode <at> gnu.org:
bug#52341; Package org-mode. (Tue, 07 Dec 2021 10:43:02 GMT) Full text and rfc822 format available.

Message #11 received at 52341 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Kyle Meyer <kyle <at> kyleam.com>
Cc: Bastien <bzg <at> gnu.org>, 52341 <at> debbugs.gnu.org,
 bruce robertson <brucer42 <at> gmail.com>
Subject: Re: bug#52341: Fwd: 29.0.50; org-priority 'SPC to remove' doesn't work
Date: Tue, 07 Dec 2021 11:41:55 +0100
>>>>> On Mon, 06 Dec 2021 20:48:46 -0500, Kyle Meyer <kyle <at> kyleam.com> said:
    Kyle> Right, this stems from org-priority feeding " " to string-to-number and
    Kyle> ending up with 0 instead of the ?\s (32) that's used downstream to
    Kyle> signal "remove".  The problem goes back to when support for numeric
    Kyle> priorities was added in Org v9.4's 4f98694bf (Allow numeric values for
    Kyle> priorities, 2020-01-30).

    Kyle> I suppose one solution would be to check for " " and translate that to
    Kyle> the ?\s so that the remove is triggered.  I'll plan to apply the change
    Kyle> below to Org's bugfix branch in a day or two unless the author of the
    Kyle> above commit (+cc) or someone else has another suggestion.

That fixes part of the issue, but still when using numeric priorities,
removal will be 'SPC RET' rather than 'SPC'.

Robert
-- 




Information forwarded to emacs-orgmode <at> gnu.org:
bug#52341; Package org-mode. (Wed, 08 Dec 2021 02:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 52341 <at> debbugs.gnu.org (full text, mbox):

From: Kyle Meyer <kyle <at> kyleam.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Bastien <bzg <at> gnu.org>, 52341 <at> debbugs.gnu.org,
 bruce robertson <brucer42 <at> gmail.com>
Subject: Re: bug#52341: Fwd: 29.0.50; org-priority 'SPC to remove' doesn't work
Date: Tue, 07 Dec 2021 20:58:52 -0500
Robert Pluim writes:

>>>>>> On Mon, 06 Dec 2021 20:48:46 -0500, Kyle Meyer <kyle <at> kyleam.com> said:
>     Kyle> Right, this stems from org-priority feeding " " to string-to-number and
>     Kyle> ending up with 0 instead of the ?\s (32) that's used downstream to
>     Kyle> signal "remove".  The problem goes back to when support for numeric
>     Kyle> priorities was added in Org v9.4's 4f98694bf (Allow numeric values for
>     Kyle> priorities, 2020-01-30).
>
>     Kyle> I suppose one solution would be to check for " " and translate that to
>     Kyle> the ?\s so that the remove is triggered.  I'll plan to apply the change
>     Kyle> below to Org's bugfix branch in a day or two unless the author of the
>     Kyle> above commit (+cc) or someone else has another suggestion.
>
> That fixes part of the issue, but still when using numeric priorities,
> removal will be 'SPC RET' rather than 'SPC'.

If someone 1) uses numeric priorities and 2) has org-priority-lowest
above 9, read-string is used to prompt with "Priority M-N, SPC to
remove: ".  They need to use 'SPC RET' just as they need to use, say, '3
RET'.  That is, it's consistent with the prompt behavior for entering
the actual priorities.

Perhaps that should change in some way (though I'm not planning on
working on it myself), but in my view that behavior shouldn't be
conflated with SPC not being translated to "remove the priority".




Forcibly Merged 52341 52392. Request was from Kyle Meyer <kyle <at> kyleam.com> to control <at> debbugs.gnu.org. (Fri, 10 Dec 2021 01:00:03 GMT) Full text and rfc822 format available.

Information forwarded to emacs-orgmode <at> gnu.org:
bug#52341; Package org-mode. (Fri, 10 Dec 2021 03:50:02 GMT) Full text and rfc822 format available.

Message #19 received at 52341 <at> debbugs.gnu.org (full text, mbox):

From: Kyle Meyer <kyle <at> kyleam.com>
To: bruce robertson <brucer42 <at> gmail.com>
Cc: Bastien <bzg <at> gnu.org>, 52341 <at> debbugs.gnu.org
Subject: Re: bug#52341: Fwd: 29.0.50; org-priority 'SPC to remove' doesn't work
Date: Thu, 09 Dec 2021 22:48:55 -0500
close 52341
quit

Kyle Meyer writes:

> 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.

Applied to the Org repo (4aca51fcb).




bug closed, send any further explanations to 52341 <at> debbugs.gnu.org and bruce robertson <brucer42 <at> gmail.com> Request was from Kyle Meyer <kyle <at> kyleam.com> to control <at> debbugs.gnu.org. (Fri, 10 Dec 2021 03:50:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 07 Jan 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 101 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.