emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Daniele Nicolodi <daniele@grinta.net>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode
Date: Mon, 23 Nov 2020 17:27:11 -0500	[thread overview]
Message-ID: <87blfnso8w.fsf@kyleam.com> (raw)
In-Reply-To: <938fa4a5-f162-6c03-072b-4f11546a95c8@grinta.net>

Daniele Nicolodi writes:

> On 23/11/2020 04:14, Kyle Meyer wrote:
>> Daniele Nicolodi writes:
[...]
>>> diff --git a/lisp/org-table.el b/lisp/org-table.el
>>> index 4baad2600..6b92656bd 100644
>>> --- a/lisp/org-table.el
>>> +++ b/lisp/org-table.el
>>> @@ -2447,11 +2447,12 @@ location of point."
>>>  		  (?e (org-table--set-calc-mode 'calc-float-format (list 'eng n)))))
>>>  	      ;; Remove matched flags from the mode string.
>>>  	      (setq fmt (replace-match "" t t fmt)))
>>> -	    (while (string-match "\\([tTUNLEDRFS]\\)" fmt)
>>> +	    (while (string-match "\\([tuTUNLEDRFS]\\)" fmt)
>>>  	      (let ((c (string-to-char (match-string 1 fmt))))
>>>  		(cl-case c
>>>  		  (?t (setq duration t numbers t
>>>  		      	    duration-output-format org-table-duration-custom-format))
>>> +		  (?u (org-table--set-calc-mode 'calc-simplify-mode 'units))
>>>  		  (?T (setq duration t numbers t duration-output-format nil))
>>>  		  (?U (setq duration t numbers t duration-output-format 'hh:mm))
>>>  		  (?N (setq numbers t))
>> 
>> A nit-pick about ordering: I think it'd be better to not nestle "u" in
>> between "t" and "T" because it invites the reader to incorrectly assume
>> that "u" is somehow connected to "t", "T", and "U".
>> 
>> You already mentioned that you plan to add documentation.  It'd also be
>> good to add a test to test-org-table.el and a NEWS entry.
>
> I thought alphabetical ordering was the most natural. Which other
> ordering would make sense?

I'd be more likely to agree that alphabetical is the most natural if the
list was already alphabetical, but instead it's grouped by "topic" (or
something :).  So I'd say just tacking u onto the end.  But I also don't
feel strongly about that, so I'm okay if you stick with the current
order.


  reply	other threads:[~2020-11-23 22:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-24 15:33 [PATCH] org-table: Add mode flag to enable Calc units simplification mode Daniele Nicolodi
2020-11-07 14:03 ` Daniele Nicolodi
2020-11-19  5:58   ` Kyle Meyer
2020-11-19 20:02     ` Daniele Nicolodi
2020-11-23  3:14 ` Kyle Meyer
2020-11-23 10:22   ` Daniele Nicolodi
2020-11-23 22:27     ` Kyle Meyer [this message]
2020-11-24  0:03       ` Daniele Nicolodi
2020-11-24  5:35         ` Kyle Meyer
2020-11-24  8:05           ` Daniele Nicolodi
2020-11-25  2:07             ` Kyle Meyer
2020-11-25  7:41               ` Christian Moe
2020-11-23 10:25   ` Daniele Nicolodi
2020-11-23 22:25     ` Kyle Meyer
2020-11-23 23:01       ` Daniele Nicolodi
  -- strict thread matches above, loose matches on Subject: below --
2020-10-19 15:38 Bug in org-table--set-calc-mode? Daniele Nicolodi
2020-10-20 13:30 ` [PATCH] org-table: Add mode flag to enable Calc units simplification mode Daniele Nicolodi
2020-10-20 13:44   ` Eric S Fraga
2020-10-20 14:00     ` Daniele Nicolodi
2020-10-20 14:22       ` Eric S Fraga
2020-10-20 14:19     ` Eric S Fraga
2020-10-20 14:32       ` Daniele Nicolodi
2020-10-20 14:53         ` Daniele Nicolodi
2020-10-20 15:35           ` Eric S Fraga
2020-10-20 15:35         ` Eric S Fraga
2020-10-21 15:57   ` Daniele Nicolodi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blfnso8w.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=daniele@grinta.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).