all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 67310@debbugs.gnu.org, sbaugh@janestreet.com, juri@linkov.net
Subject: bug#67310: [PATCH] Include the project--list as history when prompting for a project
Date: Sat, 25 Nov 2023 16:05:03 +0200	[thread overview]
Message-ID: <96636783-62bb-0bb1-ecb5-c510630402e3@gutov.dev> (raw)
In-Reply-To: <83edgedy1j.fsf@gnu.org>

On 25/11/2023 10:42, Eli Zaretskii wrote:
>> Date: Sat, 25 Nov 2023 03:54:13 +0200
>> Cc: 67310@debbugs.gnu.org, juri@linkov.net
>> From: Dmitry Gutov <dmitry@gutov.dev>
>>
>> I'll try to answer some of the questions that are still relevant to the
>> latest patch, myself.
>>
>> On 23/11/2023 08:38, Eli Zaretskii wrote:
>>
>>>> +            ;; Iterate in reverse order so project--name-history is in
>>>> +            ;; the correct order.
>>>
>>> What is the "correct" order?
>>
>> Their order in project--list.
>>
>> Iteration and construction of a new list with 'push' leads to the
>> reverse order, hence the use of reversion at the beginning to counteract
>> that.
> 
> Then the comment should say
> 
>    Iterate in reverse order so project--name-history is in the same
>    order as project--list.

Sure.

>>>> -              (if-let (proj (project--find-in-directory dir))
>>>> -                  (push (cons (project-name proj) proj) ret)))
>>>> +              (when-let (proj (project--find-in-directory dir))
>>>> +                (let ((name (project-name proj)))
>>>> +                  (push name project--name-history)
>>>> +                  (push (cons name proj) ret))))
>>>
>>> Not sure I understand why you replaced if-let with when-let here.
>>
>> To reduce the amount of indentation, perhaps.
> 
> Why is that an advantage?
> 
> I generally request and expect people not to make unnecessary changes,
> since doing that makes forensics harder: you see changes which don't
> change the code's semantics, and need to waste time studying such
> "changes" and deciding that they are no-ops.
> 
> Please everyone keep this in mind when you make changes.

In general we don't frown in making minor cosmetic changes in the same 
area as major meaningful changes are done.

Conversely, we do frown on cosmetic changes when nothing else is added. 
Ergo, the only time to make such minor changes is when more meaningful 
changes are done.

If the latter was not the case, we could instead prefer the more common 
tactic of separating functional and cosmetic changes.

>>>> +        (let ((history-delete-duplicates t)
>>>> +              (history-length t))
>>>> +          (add-to-history 'project--list root))
>>>
>>> Why are you overriding the values of these two user options?
>>
>> To implement the current behavior (how additions to project--list)
>> happen. I've described that behavior in one of the earlier messages here.
> 
> I think this is not a good idea, regardless of the reasons.  Users
> have these options to control how history functionality behaves in
> Emacs, and here you take away that control with no "fire escape".

Actually, never mind: the latest version of the patch doesn't use 
'add-to-history', or reference these variables.





  reply	other threads:[~2023-11-25 14:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 19:58 bug#67310: [PATCH] Include the project--list as history when prompting for a project Spencer Baugh
2023-11-21 11:06 ` Dmitry Gutov
2023-11-21 11:14   ` Dmitry Gutov
2023-11-21 15:17     ` Spencer Baugh
2023-11-22  1:40       ` Dmitry Gutov
2023-11-22 16:18         ` Spencer Baugh
2023-11-22 18:44           ` Dmitry Gutov
2023-11-22 23:14             ` Spencer Baugh
2023-11-23  2:55               ` Dmitry Gutov
2023-11-24 15:50                 ` Spencer Baugh
2023-11-25  2:07                   ` Dmitry Gutov
2023-11-25 17:50                   ` Juri Linkov
2023-11-27 17:10                   ` Juri Linkov
2023-12-10  3:04                     ` Dmitry Gutov
2023-12-10 17:43                       ` Juri Linkov
2023-12-10 20:32                         ` Dmitry Gutov
2023-12-11 17:12                           ` Juri Linkov
2023-12-12  0:21                             ` Dmitry Gutov
2023-12-14  1:02                               ` sbaugh
2023-12-19 17:35                                 ` Juri Linkov
2023-11-23  6:38               ` Eli Zaretskii
2023-11-25  1:54                 ` Dmitry Gutov
2023-11-25  8:42                   ` Eli Zaretskii
2023-11-25 14:05                     ` Dmitry Gutov [this message]
2023-11-25 14:10                       ` Eli Zaretskii
2023-11-25 15:06                         ` Dmitry Gutov
2023-11-25 15:57                           ` Eli Zaretskii
2023-11-25 16:35                             ` Dmitry Gutov
2023-11-22  1:42       ` Dmitry Gutov
2023-11-22 16:21         ` Spencer Baugh

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

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

  git send-email \
    --in-reply-to=96636783-62bb-0bb1-ecb5-c510630402e3@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=67310@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    --cc=sbaugh@janestreet.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.