From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: append, push, and add-to-list. Date: Mon, 5 Jul 2021 10:16:45 +0800 Message-ID: References: <8735suaw71.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33310"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 05 04:17:24 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0EAm-0008ST-BG for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 04:17:24 +0200 Original-Received: from localhost ([::1]:35930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0EAk-0002k3-BQ for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 04 Jul 2021 22:17:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0EAP-0002js-Qp for help-gnu-emacs@gnu.org; Sun, 04 Jul 2021 22:17:01 -0400 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:33728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0EAN-0003rU-6M for help-gnu-emacs@gnu.org; Sun, 04 Jul 2021 22:17:01 -0400 Original-Received: by mail-lf1-x12f.google.com with SMTP id t17so29763556lfq.0 for ; Sun, 04 Jul 2021 19:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Zjc0jBlGFtsxbsO9p5GhYj4hq9R1cfF8M8OYpQO6C/8=; b=ZBJxTOvh1mS9ZV8UPvXj0zVqXvu0J9zirQVC3Za0MbzP0ugBNcGd+e9rAlUoz17urh Nh0Z8gcwSFI+N3Jnp2btB3NTiZmQ2YKH8xvpAhWUPjAkGBfWMqqg8oh9yrD1ijHwnUYM mavteVCHL1TODkJFF5Aols5FVlqFZjTb2aWk9oigFbwrFZH04REEG9hiIXb6k4qYQXB9 s/EMFyB67/c1uujz3jjSXgAHQffrEN6gP5p4Ab3IQe8UF2oDtqdGBejGlxWckZZStnal Zp98WjsalVJcTpxj1Ihd2zX8kgLiip3u9dEsQ1rMMtzkgYvEUlpJQRaTSt6LkVH/uuv1 ZbEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Zjc0jBlGFtsxbsO9p5GhYj4hq9R1cfF8M8OYpQO6C/8=; b=HY3Zbx40qe+AbvoBhMjyZdz7jqNJz5rPQzQSsBHEtpUE3Q8DYW6NyxcVVRoW/dGyAH bldZru12sC3CD+Y8/hf8u55HXgutuctrBhTUXb9qxhUjRPB+GVHUEXMEcIxHfkjxXcJb TA67Uka77n2u8JdxrqOxUyZOl5rulYXfpezeZh4X+0uWQqyj0lE3LTF69DTIBCeS6Lr9 HWSGwZVhKUa5/BdXDqcHIrVZKFF5UmatJDNXHcbg6AQFixovCaq68sM1U2qKhSft53XC IXVP//JA6Hmv1jhDq90BjYR2+ijvE1TCVOZVqW+TGIrbB6j8PNAklDEt5T4t6o0Go3jo OvvA== X-Gm-Message-State: AOAM5331m1d74HkC8DlbntBxd5IMjq82jxjswniOlxf4Y3XnTXqKAPrk mHc4DQ6whsgAzYDXmwe3hGVhAec/ghPQx9K2yGY= X-Google-Smtp-Source: ABdhPJxxHrgpUvoSwZC6hBUymhzKtGenLIuYn2D1fQ2tOjNOLZ0SB/2vbB7NuYCDeyVyIjkNZRC2rtXWeecOf9oR8i0= X-Received: by 2002:a05:6512:2291:: with SMTP id f17mr8717047lfu.466.1625451417082; Sun, 04 Jul 2021 19:16:57 -0700 (PDT) In-Reply-To: <8735suaw71.fsf@zoho.eu> Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=hongyi.zhao@gmail.com; helo=mail-lf1-x12f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:131466 Archived-At: On Mon, Jul 5, 2021 at 12:19 AM Emanuel Berg via Users list for the GNU Emacs text editor wrote: > > Hongyi Zhao wrote: > > > I've noticed there are some similar functions, i.e., append, > > push, and add-to-list, for revising/updating the content of > > a list. But I'm still not so clear on the specific use > > scenarios for them. Consider the following command [1] > > `nconc', `cl-pushnew', (setq lst `(,@lst el)) ... Does the following append `el' to `lst'? (setq lst `(,@lst el)) > > > [...] Which methods are preferable? > > Good question, perhaps in the manual somewhere they listed > and explained all in one place, if not, the help (`C-h f') > should be your friend. > > But my intuition tells me, just because there are many options > a, b, ..., and z, that doesn't mean necessarily that one is > optimal for that situation. This is one of the reasons that baffles me the most - there are so many functions in Emacs. HY -- Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering NO. 552 North Gangtie Road, Xingtai, China