all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liu Hui <liuhui1610@gmail.com>
To: Jim Porter <jporterbugs@gmail.com>
Cc: 66768@debbugs.gnu.org
Subject: bug#66768: 30.0.50; [PATCH] Improve read/append behavior of eshell history command
Date: Tue, 7 Nov 2023 18:14:30 +0800	[thread overview]
Message-ID: <CAOQTW-P_9G5jiCNUtOw4aFC7eYa0Erv7G98TZ+sNYt4UqK35DA@mail.gmail.com> (raw)
In-Reply-To: <3d7b6c5e-ee22-91a2-93bd-1fd99d3eb301@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1147 bytes --]

Jim Porter <jporterbugs@gmail.com> 于2023年11月4日周六 03:38写道:

> In the meantime though, this is a step in the right direction. Some
> comments on the code:
>
> > +(defvar eshell-hist--new-items 0
> > +  "The number of new history items that have not been written to
> > +file.  This variable is local in each eshell buffer.")
>
> To prevent mistakes, I'd set this to nil here, and then call
> '(setq-local eshell-hist--new-items 0)' in 'eshell-hist-initialize'.
>
> > -(defun eshell-write-history (&optional filename append)
> > +(defun eshell-write-history (&optional filename append new-items)
>
> I don't think this new argument is necessary. I suppose you did this for
> backwards-compatibility, but I'd say that the current appending behavior
> is just a bug, so you don't need to add an explicit way to opt into your
> new behavior; just do it whenever 'append' is non-nil.
>
> Some regression tests would also be nice. There are already a few in
> test/lisp/eshell/em-hist-tests.el that you should be able to use as a basis.

Thanks for your comments! I've updated the patch to address all
concerns.

[-- Attachment #2: 0001-Improve-read-append-behavior-of-eshell-history-comma.patch --]
[-- Type: application/x-patch, Size: 7814 bytes --]

  reply	other threads:[~2023-11-07 10:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27  4:15 bug#66768: 30.0.50; [PATCH] Improve read/append behavior of eshell history command Liu Hui
2023-11-03 19:38 ` Jim Porter
2023-11-07 10:14   ` Liu Hui [this message]
2023-11-11  2:03     ` Jim Porter

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=CAOQTW-P_9G5jiCNUtOw4aFC7eYa0Erv7G98TZ+sNYt4UqK35DA@mail.gmail.com \
    --to=liuhui1610@gmail.com \
    --cc=66768@debbugs.gnu.org \
    --cc=jporterbugs@gmail.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.