From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CGUvCSdzLGBDFwAA0tVLHw (envelope-from ) for ; Wed, 17 Feb 2021 01:36:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SL3/BCdzLGDBBgAA1q6Kng (envelope-from ) for ; Wed, 17 Feb 2021 01:36:39 +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 85AD81770A for ; Wed, 17 Feb 2021 02:36:38 +0100 (CET) Received: from localhost ([::1]:33514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCBld-00078K-Nx for larch@yhetil.org; Tue, 16 Feb 2021 20:36:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCBgm-0002y1-WD for emacs-orgmode@gnu.org; Tue, 16 Feb 2021 20:31:38 -0500 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]:37680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCBgl-0006vx-7v for emacs-orgmode@gnu.org; Tue, 16 Feb 2021 20:31:36 -0500 Received: by mail-qv1-xf2f.google.com with SMTP id c25so5597796qvb.4 for ; Tue, 16 Feb 2021 17:31:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=72k6XJji3G7jTTjIBzbWr1ZMATWLCM9I8iwZ6IL3Vm4=; b=Y2NWft2kMbYL0S/QTU71cg4MzfSysJRcR1EKNoaIKS8B22MDXosdzmCY+NiqQC/mtL bf9Nlhr2h0JaFPrtYApf5HJvNU3ZxYF9N4FLbLgzGwBfsCWrwLHvpPKJkCEXIx9uzkN0 JNkmkrYDRgUvf7Qee/cYkb/8PhCGwweP0YDHA69OieFQOlaTIPlUQ2OP2xiCywo9tYT1 CD3GiIpMpqFdrB0anJjyPvwlHt3nLaBV+/w0+U3YVWSkzqczbD5g3oRVoiDOy19bsOLj qrv1KsNJEUBDet4kggPAjed6DtRBM6CmFsjr7A2HjawS4wcWqlrK9NH5nNa1wIt4BCNl f7Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=72k6XJji3G7jTTjIBzbWr1ZMATWLCM9I8iwZ6IL3Vm4=; b=ZOvJy0GWsKhJ8gzdD1LrMX/X18D33pjdIvtaxftJgeuXUE3Eb/Di40YxpXvl9Ngw8l nT+Qv05tcvN6NdBIUcTaU8JfAIOup1cAw35PO5XaV9sIU1G2SUOZUXo2Nu/Wi1cGZlV/ 8DB6+9zyw073k0Q/4fvZ94rftAz6gs5zJCo0Zwi3q21hEqW8eZZGhtOfa9jD+bqImdvr 7oykCGZ71ntZMGtfXg1gzd+UGgzp9K83ikhCllc/DR2/HzUv5Ok2D4Xpl83dB9QDPs4B QTs0XB5nbIzfDNRxf0dmKAtw54QgbqJTa+idtUMPwu3zo8CZSGYfJwBCGtYVN3r5VLTf vO+w== X-Gm-Message-State: AOAM5333ntcowWeDSigBqpeobQiMHBgkfcNZcvHKZ9qB2iAzZzhau2Zn TnhYXTWncWiJIo4N03fxaso= X-Google-Smtp-Source: ABdhPJxsLb2BIlyib44iBjhvmoNOF19I3ix037rPqVDHgD3GEQzBYKHJJkmpqkuF4FSrNetBjICcvA== X-Received: by 2002:ad4:44f0:: with SMTP id p16mr20790557qvt.61.1613525494276; Tue, 16 Feb 2021 17:31:34 -0800 (PST) Received: from localhost ([190.239.232.181]) by smtp.gmail.com with ESMTPSA id b20sm256639qto.45.2021.02.16.17.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 17:31:33 -0800 (PST) References: <87wnv9b0na.fsf@gmail.com> <87tuqc43ur.fsf@ucl.ac.uk> User-agent: mu4e 1.4.14; emacs 27.1 From: Rodrigo Morales To: Eric S Fraga Subject: Re: How do you name your code blocks? In-reply-to: <87tuqc43ur.fsf@ucl.ac.uk> Date: Tue, 16 Feb 2021 20:27:54 -0500 Message-ID: <87sg5vlbz9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::f2f; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-qv1-xf2f.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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: 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 X-Migadu-Spam-Score: -2.06 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Y2NWft2k; dmarc=pass (policy=none) header.from=gmail.com; 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: 85AD81770A X-Spam-Score: -2.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: +3+yJY43yqaj Eric S Fraga writes: > Yes. Fully qualified and detailed. And then rely on completion to jump > to code blocks (using org-babel-goto-named-src-block). Thanks for the answer. I didn't know about =org-babel-goto-named-src-block=. Regarding using fully qualified and detailed names: I feel like it is not a good idea for the use case I have with Org Mode. I have multiple big Org files for each programming languages I've used and while using long names might avoid name conflicts, there would be a time in which a name conflict would occur because it is necessary to avoid using a name which has already been used, so for example if I name a code block with =generate-data-for-plotting=, I can't use that same name again. For this reason, I was thinking in the following workaround: use use the ID of the subtree as the prefix of the name of the code blocks. Thus, name conflicts are less likely to occur (see example below). #+begin_src org ,* DONE How to get the number of lines in a file? :PROPERTIES: :ID: ec1f7066-213c-458e-a0f9-786b722218f4 :END: ,#+NAME: ec1f7066-213c-458e-a0f9-786b722218f4/create-file ,#+begin_src dash :results silent cat << EOF > main.txt first second third EOF ,#+end_src ,* DONE How to print most repeated word in a file? :PROPERTIES: :ID: e0768c19-080f-47db-9dc2-3bd00efdd036 :END: ,#+NAME: e0768c19-080f-47db-9dc2-3bd00efdd036/create-file ,#+begin_src dash :results silent cat << EOF > main.txt fizz fizz fizz buzz buzz buzz buzz foo bar bar EOF ,#+end_src #+end_src As we can see above, both =dash= code blocks are given the name =create-file= because both of them create a file but the ID of the heading is used a the prefix in order to avoid a name conflict. Let me know your thoughts on this workaround :) -- Rodrigo Morales. IRC: rdrg109 (freenode)