From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12314: 24.2.50; `add-to-history': use `setq' with `delete' Date: Sat, 08 Sep 2012 18:20:01 +0300 Message-ID: <83fw6smti6.fsf@gnu.org> References: <7602D24B74DE42CF9901322634B85CA2@us.oracle.com> <87sjas4mc2.fsf@gnu.org> <83ipbomv6e.fsf@gnu.org> <2C45207ADF0E46BC98AF1B486695F632@us.oracle.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1347117650 31476 80.91.229.3 (8 Sep 2012 15:20:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Sep 2012 15:20:50 +0000 (UTC) Cc: 12314@debbugs.gnu.org, cyd@gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 08 17:20:51 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TAMpx-0005Jj-Sn for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Sep 2012 17:20:46 +0200 Original-Received: from localhost ([::1]:37006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAMpu-0006jx-8o for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Sep 2012 11:20:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAMpr-0006jg-Qk for bug-gnu-emacs@gnu.org; Sat, 08 Sep 2012 11:20:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAMpq-0008G9-J6 for bug-gnu-emacs@gnu.org; Sat, 08 Sep 2012 11:20:39 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAMpq-0008G4-Fl for bug-gnu-emacs@gnu.org; Sat, 08 Sep 2012 11:20:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TAMqE-0005IB-1p for bug-gnu-emacs@gnu.org; Sat, 08 Sep 2012 11:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Sep 2012 15:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12314 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12314-submit@debbugs.gnu.org id=B12314.134711763220308 (code B ref 12314); Sat, 08 Sep 2012 15:21:01 +0000 Original-Received: (at 12314) by debbugs.gnu.org; 8 Sep 2012 15:20:32 +0000 Original-Received: from localhost ([127.0.0.1]:48768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TAMpk-0005HV-Aw for submit@debbugs.gnu.org; Sat, 08 Sep 2012 11:20:32 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:61933) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TAMph-0005HM-9e for 12314@debbugs.gnu.org; Sat, 08 Sep 2012 11:20:31 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MA100D00E3HNR00@a-mtaout22.012.net.il> for 12314@debbugs.gnu.org; Sat, 08 Sep 2012 18:19:59 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MA100D09ELB67B0@a-mtaout22.012.net.il>; Sat, 08 Sep 2012 18:19:59 +0300 (IDT) In-reply-to: <2C45207ADF0E46BC98AF1B486695F632@us.oracle.com> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63945 Archived-At: > From: "Drew Adams" > Cc: <12314@debbugs.gnu.org> > Date: Sat, 8 Sep 2012 07:57:12 -0700 > > > Does this mean the ELisp manual is in error? It says: > > > > -- Function: delete object sequence > > If `sequence' is a list, this function destructively removes all > > elements `equal' to OBJECT from SEQUENCE. > > ... > > If `sequence' is a vector or string, `delete' returns a copy of > > `sequence' with all elements `equal' to `object' removed. > > > > 'history' is a list, isn't it? > > Yes, it is a list. What is your point/question? That for a list, assigning the result is not necessary. At least that's my interpretation of what the manual says. > Keep reading the same section of the manual (section for `delete'): > > ;; If you want to change `l' reliably, > ;; write `(setq l (delete '(2) l))'. My interpretation of "reliably" here is "without assuming that l is a list". Is that a wrong interpretation? > There is more explanation higher up in the same node, under `delq': 'delq' is not identical to 'delete', so assumptions that somethiong described there is pertinent to 'delete' are unsafe. And how should the reader know that she needs to read something under 'delq' to fully understand what 'delete' does, anyway? > I would imagine that you already know this, so I'm likely missing something in > your question. I'm not sure who is missing what. All I'm saying is that the manual seems to suggest that an explicit assignment is unnecessary, and yet Chong did exactly that. If just "(delete 'foo bar)", with 'bar' a list, is sometimes not enough, the manual should say when. And if it is enough, why should we make the change in add-to-history? IOW, it sounds like some kind of black magic is going on under the hood, but the manual is too shy to talk about it. It shouldn't; doing so could easily spread confusion. I'm not sure the code in question was written as it was due to that confusion.