From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "R. Diez" Newsgroups: gmane.emacs.help Subject: Re: Surprising behaviour of 'append' with string Date: Sun, 6 Nov 2022 17:02:48 +0100 Message-ID: <17b9a480-cff1-212e-7d8a-894285d03646@yahoo.de> References: <17b9a480-cff1-212e-7d8a-894285d03646.ref@yahoo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20932"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Cc: help-gnu-emacs@gnu.org To: stephen.berman@gmx.net Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 06 17:03:33 2022 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 1ori7Q-0005C5-RZ for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 06 Nov 2022 17:03:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ori6x-0004DM-Nh; Sun, 06 Nov 2022 11:03:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ori6v-0004Cw-8m for help-gnu-emacs@gnu.org; Sun, 06 Nov 2022 11:03:01 -0500 Original-Received: from sonic312-26.consmr.mail.ir2.yahoo.com ([77.238.178.97]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ori6s-0004qD-9G for help-gnu-emacs@gnu.org; Sun, 06 Nov 2022 11:03:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1667750571; bh=qzmX23cH5xLuroDvlB3WrU/tQsBwlVCc0BWEXiWpGZw=; h=Date:From:Subject:To:Cc:References:From:Subject:Reply-To; b=fl9QKTxTSF6FSS7xrrKJpvQlLBz7QF6+t3PA5WYarnIdfMQ2b+Yecb13goRzYdDrJvuyCzHs+/r6aM5cKtwNxXnkZLmljw+1O4c/7MBZ6nrQ+O3rjK5bwc1cVvbwzjzoMezGizb1u6ca8NuO0YK5o1sAMDvawy013k0uOpMuwpcP2LQspfIPjFHZQbbX8hWewXp6rR6YkGxWzVkf0rvX5ZAnVVrMdEBj4VObsXonuMtNcLtPwTtaW5lRFnfpwkYdW3ZnrinqS3PC9cpOFn2FfZCCqm3NgQJwYICju5NuoT6yMWCu5CT9v5pxQJOJzO0gY251E+ZCmk2+OLzttNG9bQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1667750571; bh=Cljyn1uAcicA5QePxWVx9mUVVgx+Z9cS06DW3Ltl8W5=; h=X-Sonic-MF:Date:From:Subject:To:From:Subject; b=bqCbS/WiL4MY9wxt3ujYIDMHrycgVHQTDoXsVaI9wGL+hMdVHNJ5OzQb08Zaos0hqcAduWV+jH8J61fKjNdtVvieR9SZ2EqL55sDrUARcHMjfw9YbpafigY8XR8SrmgmIP4mEDfSb6DcEoG3gahMe/TVOvqkjearxm9hA5iGWSu8Dr483sqg+PAfMXUMB0Boj0qGKjrGUue6n1OL38moMObYQXqkECKoNS6BiWZFGp2VWKROyTDrZQHbrAI8NrEO98i9XvRIqqi/vV4jZ9f1EVaKQwLrG3b7KrGzMryv3msz1dwtuO2smukdJOgf1nNvRBy+iT1nUz7au2pLRkuAvw== X-YMail-OSG: ByDKn4gVM1lppApfy8W2qUJ2GSpY7exu5zCMongMXxRArdP7YJ8O5MnGO9Hvns4 RnWqXB2p.OwDfHd.L3qN.PWsmuHUD1.AraU2ZI.tZhuMe_le9Ac5xvl3xECkrrN38YKDcWxKYBjj hl4ZlblWTAuelEdh5qhKo37vrVs_YoPHNhnSSLYPFSyeRYYlnEXcq6xQfbsqKcW8mdafAHYCue3H LHE40mNVXiUHTeGTMXJ1vRBly0MU4ZwbvI8SfCZeY_ZIAtKAbPCIWYKGyVEq.bwyOhLqdXmReKSs Sct1Cc2s8.vm007FqB42Fl0NPcWfyV9abizr9j9zYt6dDYsDIRfw95Q0G11uu6CI3Tzob.QftPCs m_Zmraa3L5N3pOCECR0JiKSlecwp4ofOtHmnJSKQvkK9BTynlvjyHCd1O.xWRfQxI31k8iakvFWu GKyCzFXV5_9uPgwOfO7v8r8nsjJKFNJDeK6cpdWzEP43jQd3yEAy9d4nvlKO90I1AVoRDu4BjHws FkPtYudT3LXJE._EsTWa8znwPD823z6FwI9ZRC5ZZfnDH.0nLx7nJDGxwpdUDPNXrY28dzpSHoZ6 j0BJb65HZAQqfmTdqd5Jo4I7.QeiWLGl.4_h4t.Qdw2qIhf0k7nH_6TX5nG9xZOSMJlGLJ.B5o7a H6Sr3hznTX4AaEUz_aDnLUpjEWBhmLkUDQdUaInjSypUaFYhil5O.E1N5deSzddrzcbLIXqdEE7o vmb2Y6zRmX0jNufuXbtUBA6nvEi7QAkGrowUYx4hTI6wUuTdFrrUc.FkuLZTpT1yNoAwNftnZ5nW q709WQGVOlg2jYBrLMMi9lU8JN2kBPlUXO7lDfDT5l X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ir2.yahoo.com with HTTP; Sun, 6 Nov 2022 16:02:51 +0000 Original-Received: by hermes--production-ir2-74cf6dc4df-j2qjv (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7a4c4ad16d763020a89c5d52e664f853; Sun, 06 Nov 2022 16:02:50 +0000 (UTC) Content-Language: en-GB, es-CO X-Mailer: WebService/1.1.20826 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=77.238.178.97; envelope-from=ruben10post@yahoo.de; helo=sonic312-26.consmr.mail.ir2.yahoo.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.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "help-gnu-emacs" Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:140739 Archived-At: > then flatten-tree should do the job. To also check that the elements > are either a string or a list of strings, you could use this: > [...] Thanks for your help. Your routine fits the bill perfectly. > It appears you didn't appreciate the preceding line of the doc string: > [...] Well, yes. Like I said, I am no Lisp expert and I get easily mislead. Don't you think that 'append' and its documentation are not really user friendly? Its behaviour is not what you would normally expect. It doesn't make sense to join list elements with the first characters of strings. At least some example and/or warning about it would prevent unwary users like me from wasting time and feeding the general sentiment that Emacs and Lisp are not user friendly. I'm only saying this as a hint to improve the situation for other users (to improve Emacs). I am now fine myself with regards to 'append', thanks to your code. > Isn't it better to use a shell script language then? Whether shell is better than Lisp is debatable. But say I want to write the logic in shell. Then I would need to pass the information (flags and config settings) down from Emacs (where they live now), in form of command-line arguments, and that's the kind of routine I am looking for in order to help me do that, isn't it? Regards, rdiez