From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GN36GVJxoWAQPwAAgWs5BA (envelope-from ) for ; Sun, 16 May 2021 21:24:02 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gJeCFVJxoWDqfQAAbx9fmQ (envelope-from ) for ; Sun, 16 May 2021 19:24:02 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D39A4179B6 for ; Sun, 16 May 2021 21:24:01 +0200 (CEST) Received: from localhost ([::1]:37314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liMMq-0006Gv-RS for larch@yhetil.org; Sun, 16 May 2021 15:24:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liMMR-0006Ds-3m for emacs-orgmode@gnu.org; Sun, 16 May 2021 15:23:35 -0400 Received: from mailer-211-160.hitrost.net ([91.185.211.160]:58075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liMMO-00011M-Mn for emacs-orgmode@gnu.org; Sun, 16 May 2021 15:23:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: In-reply-to:Subject:Cc:To:From:References:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kkRlijBHM/5wpUrLUf3mWAQNqJ7vjgKN8DjEyFlP3bA=; b=IPh3pkq+7R3KKCoDRstSQMQQ2 SEctPtmL/1pSAelHveU9z7A0D21BP26t6s9bf4S1CO1golshF9P9sJDbYALS3tbAWc1ZUlsGkcXnz 5K3PhKulDyZnSXVnyOvyaNuVCf6xMiHu2/VsYXs8wP0i/+08wifChHhlMWMtces6XLkLzDNITkXe6 cLCadYSwN5YTQXPjx3e+skkO+V6VwNbs2F1bBd5putcebqghKseDdUOefYPcE6PJVA33eFqRC2MrE mmB7Rb7zP0hURg6u4M+3hxtA/UkrNpNaiVDZzOlzApUdTdRbpz3htAIDicELoOO/rgvFFOpsMbY+8 Tsc49B7xA==; Received: from lk.84.20.234.47.dc.cable.static.lj-kabel.net ([84.20.234.47] helo=Tauriel) by b1.hitrost.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1liMMK-00DDaj-KC; Sun, 16 May 2021 21:23:28 +0200 References: <87wnsjx5rs.fsf@posteo.net> <87o8duyhxr.fsf@bzg.fr> <87sg36u5wa.fsf@nicolasgoaziou.fr> <87k0oinmy2.fsf@posteo.net> <87h7jkdesz.fsf@christianmoe.com> User-agent: mu4e 0.9.19; emacs 25.3.2 From: Christian Moe To: Maxim Nikulin Subject: Re: [PATCH] Possibility of using alternative separators in macros In-reply-to: Date: Sun, 16 May 2021 21:21:31 +0200 Message-ID: <87o8dascw4.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain X-GeoIP: Country [IP], SI [84.20.234.47] X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-Authenticated-Id: mail@christianmoe.com Received-SPF: pass client-ip=91.185.211.160; envelope-from=mail@christianmoe.com; helo=mailer-211-160.hitrost.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621193042; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=kkRlijBHM/5wpUrLUf3mWAQNqJ7vjgKN8DjEyFlP3bA=; b=FtNLb/WcypMoJ/KNdryiJZZd6h07/m9P/yb/w/p25GObYh49gfhxOkVQxfdtwYOW78JzR2 9OfJWHegp5EX8CiVdihuVQ4peDNnuZKmoW+HbkSHgx/tvlsBwx///srHuYqI2PSdMQaAsX jzVqjQYXpTk7lALD1drySe/xb81mJkzGYOxitueT9NHNExCbsHgXit0JL+G/RWYIQaQ2PA 01X9h5cmo8G23skKPn1a+WO0Z6ffinfyIh6OEWVzPmZxHzAOx62fR7dxIXLRC8KD7UbFHQ mIZxxuIn/p8aLYT4bfma79KZGVcK5I7QP2XNdbeG3G60aUl1PJtvLdw4UGaTOQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621193042; a=rsa-sha256; cv=none; b=AppcHPJ45z4dKhw6gEkKDaf32cDhb2l/dG7vVZQ9eyt9nk5BApaJJaE9J2YQKOp5YQnQkZ Sahy1trNDtUjoTg7Wz8Xh1TuL4TS1YHKaHYh9lGpHZNkCOEomN8TM+I6bGL2nmobDA09xO pY/PwR/vWq4ZyO1n4SELK91KxUNtTHFCgT6wgfQs77SO31qrruqwFwi759MhhJDveBBFna QJ2ubHM+kKXrncjMEOfFalAfyDxCWwjjsZRCqv+ljBDU92rvhNK2OGsKhNExpQOy7BQNfW 2y7BmcEExNHbZNBbNM4RV2/PS0e0Vwy29Nk3IF5sr/uyEHDv0UJv8KH3nIJRPg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=IPh3pkq+; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -0.95 Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=IPh3pkq+; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: D39A4179B6 X-Spam-Score: -0.95 X-Migadu-Scanner: scn0.migadu.com X-TUID: AHR1R2mNsSUT Maxim Nikulin writes: > On 03/05/2021 04:08, Christian Moe wrote: [snip] >> Something that would help, without adding new syntax, is >> making macro expansion smart enough to *ignore* separators when the >> macro definition contains only *one* argument anyway, as in the cases >> above. > > I think, this is an idea of the best approach. Unsure concerning > precise form. Maybe e.g. "$_" could expand into all arguments greater > than maximum referenced number. No promise of forward compatibility of > the following hack since it relies on undocumented implementation > details. > > #+MACRO: allargshack (eval (format "- /%s/ :: %s" $1 (mapconcat > #'identity _ ","))) > > {{{allargshack(one, two, three)}}} > > I do not know if Eric can swap order of arguments of his credits > macro. Extracting namely last argument requires a bit more lisp code. Yes, I didn't think that far. This would provide a comprehensive backwards-compatible solution to the comma-escaping problem, though perhaps not the most newbie-friendly one. It would also make macros more flexible and powerful in the bargain (I'm sure people will think of other uses for this than commas). Yours, Christian