From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#12314: 24.2.50; `add-to-history': use `setq' with `delete' Date: Sun, 09 Sep 2012 15:53:34 +0800 Message-ID: <87r4qbr5s1.fsf@gnu.org> References: <7602D24B74DE42CF9901322634B85CA2@us.oracle.com> <87sjas4mc2.fsf@gnu.org> <83ipbomv6e.fsf@gnu.org> <2C45207ADF0E46BC98AF1B486695F632@us.oracle.com> <83fw6smti6.fsf@gnu.org> <9A8F619FD7584123A6319BD089E444E4@us.oracle.com> <83bohgmrdv.fsf@gnu.org> <83a9x0mq5e.fsf@gnu.org> <8E40573C868D4B339513A16A02588F5E@us.oracle.com> <837gs4mcqy.fsf@gnu.org> <852E534DA6A342708069D17B8C3C3DFF@us.oracle.com> <834nn7nbno.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1347177280 23204 80.91.229.3 (9 Sep 2012 07:54:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2012 07:54:40 +0000 (UTC) Cc: 12314@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 09 09:54:42 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 1TAcLp-00031T-Lw for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Sep 2012 09:54:41 +0200 Original-Received: from localhost ([::1]:46367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAcLm-0007Pt-9w for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Sep 2012 03:54:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAcLk-0007Po-0A for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2012 03:54:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAcLi-0004iY-QJ for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2012 03:54:35 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAcLi-0004iU-Mr for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2012 03:54:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TAcMA-0004QY-0m for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2012 03:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Sep 2012 07:55: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.134717725016957 (code B ref 12314); Sun, 09 Sep 2012 07:55:01 +0000 Original-Received: (at 12314) by debbugs.gnu.org; 9 Sep 2012 07:54:10 +0000 Original-Received: from localhost ([127.0.0.1]:49507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TAcLJ-0004PR-Lr for submit@debbugs.gnu.org; Sun, 09 Sep 2012 03:54:09 -0400 Original-Received: from mail-iy0-f172.google.com ([209.85.210.172]:33209) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TAcLH-0004PK-Vg for 12314@debbugs.gnu.org; Sun, 09 Sep 2012 03:54:08 -0400 Original-Received: by iabz21 with SMTP id z21so935630iab.3 for <12314@debbugs.gnu.org>; Sun, 09 Sep 2012 00:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=QtZZGDd5zcRwZRwh9aaiiP1m1Z5bKh1rUESBQ6D67nY=; b=Q1iCyKT9BsCPsSLXcREMqHlcvGDWN3QYc5Uynu//sMwQdbWp4QNYhKsP84/xke4eyt LbtDDlElQdG6R65QIK29Os8mAE+Fiy06DOSAjDhIzeCJGE9Km74imbcNqg4rSm3yMr9S NEH9c2JnR8y7Y0TzYarp0c+nEUt0oR1jj3ddMimuHuyX3fVwXI+VPvsH4NsQzyKe47v+ TKHHIYNQAFHWkmeVGY6RmMWvhOZ49aTAHCqckq1hhpvnJxEDV05O0mflECj9jg0M1K6u ddxeRNgsTqrxqtWHusyra07S+tfRhIqEC1G0xZb/N183ReVCcaCNgiibGs1OU5xmcwJE 4epg== Original-Received: by 10.50.10.166 with SMTP id j6mr6065998igb.13.1347177219478; Sun, 09 Sep 2012 00:53:39 -0700 (PDT) Original-Received: from ulysses ([155.69.172.88]) by mx.google.com with ESMTPS id a10sm11399451igd.1.2012.09.09.00.53.36 (version=SSLv3 cipher=OTHER); Sun, 09 Sep 2012 00:53:38 -0700 (PDT) In-Reply-To: <834nn7nbno.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 09 Sep 2012 06:00:11 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) 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:63993 Archived-At: Eli Zaretskii writes: > But the manual should cater first and foremost to newbies. The rest > will get the point when they read the detailed description of how the > list is modified. I modified the manual to hopefully make the situation clearer. In particular, the descriptions of delq and delete explicitly say that you typically ought to use the return value. The docstrings are harder, since they should be succinct. Here is what I suggest; WDYT? (delq ELT LIST) Delete by side effect occurrences of ELT as a member of LIST. Comparison is done with `eq'. Return the resulting list. More precisely, this function skips any occurrences of ELT at the front of LIST, then removes occurrences of ELT from the remaining sublist by modifying the list structure, then returns the resulting sublist. Therefore, write `(setq foo (delq element foo))' to be sure of changing the value of `foo'. (delete ELT SEQ) Delete occurrence of ELT as a member of SEQ. SEQ must be a sequence (i.e. a list, a vector, or a string). Comparison is done with `equal'. Return the resulting sequence. If SEQ is a list, this behaves like `delq', except that it compares with `equal' instead of `eq'. In particular, it may remove elements by altering the list structure. If SEQ is not a list, deletion is not a side effect; this function creates and returns a new sequence. Therefore, write `(setq foo (delete element foo))' to be sure of changing the value of `foo'.