From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hrvoje Niksic Newsgroups: gmane.emacs.devel Subject: Re: Saving minibuffer history Date: 18 Oct 2005 16:27:35 +0200 Message-ID: <87hdbe2948.fsf@xemacs.org> References: <87u0fkfc8c.fsf@xemacs.org> <873bn2s9cz.fsf@xemacs.org> <87zmp9sd0o.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129645855 25484 80.91.229.2 (18 Oct 2005 14:30:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Oct 2005 14:30:55 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 18 16:30:53 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ERsRt-0007wk-9B for ged-emacs-devel@m.gmane.org; Tue, 18 Oct 2005 16:28:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ERsRs-0004kC-1S for ged-emacs-devel@m.gmane.org; Tue, 18 Oct 2005 10:28:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ERsRK-0004iy-Q0 for emacs-devel@gnu.org; Tue, 18 Oct 2005 10:27:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ERsRJ-0004iO-6t for emacs-devel@gnu.org; Tue, 18 Oct 2005 10:27:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ERsRJ-0004iI-2O for emacs-devel@gnu.org; Tue, 18 Oct 2005 10:27:41 -0400 Original-Received: from [195.29.150.97] (helo=ls405.htnet.hr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ERsRI-0008V2-72; Tue, 18 Oct 2005 10:27:40 -0400 Original-Received: from ls401.t-com.hr (ls401.t-com.hr [195.29.150.236]) by ls405.htnet.hr (0.0.0/8.12.10) with ESMTP id j9IERdWj014634; Tue, 18 Oct 2005 16:27:39 +0200 Original-Received: from ls401.t-com.hr (localhost.localdomain [127.0.0.1]) by ls401.t-com.hr (Qmlai) with ESMTP id 052A270003; Tue, 18 Oct 2005 16:27:39 +0200 (CEST) X-Envelope-Sender: hniksic@xemacs.org X-Envelope-Sender: hniksic@xemacs.org X-Envelope-Sender: hniksic@xemacs.org Original-Received: from localhost.localdomain (83-131-16-128.adsl.net.t-com.hr [83.131.16.128]) by ls401.t-com.hr (Qmlai) with ESMTP id 67CEDA8036; Tue, 18 Oct 2005 16:27:37 +0200 (CEST) Original-Received: by localhost.localdomain (Postfix, from userid 1000) id 9EDA0434003; Tue, 18 Oct 2005 16:27:36 +0200 (CEST) Original-To: Stefan Monnier In-Reply-To: <87zmp9sd0o.fsf-monnier+emacs@gnu.org> Original-Lines: 61 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:44263 Archived-At: Stefan Monnier writes: > Thank you. Installed. Along with a few minor changes, mostly to > remove run-time dependency on CL These changes seem to make the code less readable. For example: (delete-if-not #'savehist-printable value) is changed to: (delq nil (mapcar (lambda (x) (if (savehist-printable x) x)) value)) And: (subseq value 0 savehist-length) is changed to: (setq value (copy-sequence value)) (setcdr (nthcdr savehist-length value) nil) While I understand the desire to leave the namespace unfettered by cl compatibility code, maybe you should at least leave the original forms commented-out, so that the intention is clear(er)? > and to get rid of most checks for XEmacs, replaced by checks for > features. This is a bad idea. There are extensions out there that approach cross-emacs compatibility by defining functions normally not present in the other implementation. For example, w3 used to define (and maybe still does) `map-extents' under Emacs. There are extensions that define `run-with-timer' under XEmacs. Such emulations are incomplete and one does not wish to use them unless necessary. In other words, I intentionally checked for XEmacs to decide which API to use. I would appreciate if you left this intact. > I have one question: what's the point of savehist-no-conversion? The code simply needs to check whether the buffer contents has changed since the last save. I wanted to checksum the raw buffer data, which 'no-conversion achieves in Emacs, and 'binary in XEmacs. To make the intentions clear and remove an `if' from the code, I used a defconst. > Also see attached a proposed patch (100% guaranteed untested). If > nobody objects, I'll install it. > > I could also get rid of savehist-history-variables altogether. What is your intended replacement? If I understand minibuffer-history-variable, it only records the minibuffer history for minibuffer input whose history is not otherwise specified. Which means that it doesn't record the history of M-x, M-:, C-x C-f, etc. But the point of savehist is to be as easy as possible to set up, because other editors have such a feature built-in. Being easy to set up means saving the most important minibuffer histories by default, with the ability to save more (or less!) if one chooses to. As the commentary says, putting (savehist-load) to `.emacs' should be enough.