From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0AqVMNX3F2elIQEAe85BDQ:P1 (envelope-from ) for ; Tue, 22 Oct 2024 19:07:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 0AqVMNX3F2elIQEAe85BDQ (envelope-from ) for ; Tue, 22 Oct 2024 21:07:01 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lN5h4LT2; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729624021; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=S7JUObOnleGkUAC6AEp0zP21EkYQOaXLlJsuUs+hMko=; b=N0fCCW4yGJ9NuGGushCKLjnSTjQGAqdRUpVr4Fnm84m7uxX7kJ9z5CI+iobn7Dbhyp3vKQ LGmcAGajEmyt4o6zWsnlg/y5pA8KCWVGv7PQaAw5mniqYexPrvS14N9yrSb5bdqGu0S2pS z0vHqqnwIGHeaOZAv66BzI+rPex71eJ1zlPExFF7ovU2lh/0wcwTbrl3nWC9JtGWbcD1ru nusbGtJHiotIRgx4tWWRzoUPf5u5N1G3HlSCpurAivy/PQoAg0xEWA5smomuSJLqBP+b/X 3kVS+J7tXlqSnYURswSGlvje4xvTviBuu8OghmI9Bd1+hhNWmfyUW2VG+ovKRQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1729624021; a=rsa-sha256; cv=none; b=DEr4U+Zrm+WIfYpvOfw92tgON7HFrkkBWumj6oKseNnZpspffhI0vyZYdU+IGErcK3d1Pe sL3tm7NuCO25epAftXrlyZCwdWPCfCMgB1xDIZs55Syx/s9z4z9tBOO4I2ym7E4P+VxIrF O4PvPobZ5wy4EzUdArv8b9XZJ2hUPAXn5slRTaHykcI7ENW3JgSfo2/EN9PwwsyaDl3alv zn1PvB2ixhejmIejfZUYqUHX7kjDiAxmvgBLYydce5uZpprHZ1YR/3WjGWboHZYVCt6Ya6 0kqVvcRWgsO2Z4fTOp+QLfaI198We53SAZYI/UdYeaY5m7bLeyNsaEFWBIZSbg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lN5h4LT2; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com 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 62A78786FA for ; Tue, 22 Oct 2024 21:07:00 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3KCw-0002HY-DD; Tue, 22 Oct 2024 15:06:18 -0400 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 1t3KCo-0002Gq-6u for emacs-orgmode@gnu.org; Tue, 22 Oct 2024 15:06:10 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3KCk-00060C-NO for emacs-orgmode@gnu.org; Tue, 22 Oct 2024 15:06:09 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a99f629a7aaso23509366b.1 for ; Tue, 22 Oct 2024 12:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729623962; x=1730228762; darn=gnu.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=S7JUObOnleGkUAC6AEp0zP21EkYQOaXLlJsuUs+hMko=; b=lN5h4LT2MNZRk36Vs6xONHoDAcAe/Qw5TZakesVmg0CQDMX3JyCUhiOQUwV7MT4cSq kPp9OHRkZX2hOqSvq6q5hTK5aHZlGVjF2zgbA2225XE8Rs63/NF+67tXHsdGXVzaZWle OR3BmnRKiX0uSjthOmW0DnuSv8ofOcWxBb12O2JXsvYLWHfsw94hVcxCeZ1WgckklVL1 N5pqBwCLdtr2NBOllwIVfpvE2rHMq7D7EkZ0TSC37z+/AUUGdqkIK46K7dPYv8EMQjsj HoojNoC97W3q3EAwrvPi2wjVp8skeNcNz0+S78uFWzJPwFDFrL6UIMQKzynR2N+lqshR +HSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729623962; x=1730228762; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=S7JUObOnleGkUAC6AEp0zP21EkYQOaXLlJsuUs+hMko=; b=fNS2KN1wsaHTZ1W6M24ZwpuAWlbQe4pkjAO0orNJkPX/7drkAC3C2Vt2qPwXU1D+SQ mivID2AAlez8BJ2b99uf1Wkwy/omYmkmzO7qJzV9SBSq7+PfWc6Bwn8nIntt0TQ7ktyo bDmY4Bn3TTNJVPtJBbdAcfLngL/XwHIz6F8doVovfv0aHZcuWZSZai0QICxSd1CXjtRH nE7eXufXRxZU7q14VCx/Ap9rXx6EK46ZVecRGYtf60t+96nTid/YjExpNVHbqLqAdVnS ez6p3RkZal1gN9AJr3Eff31BNVkVTjxQlsebhsrTAubCaXnV6PqH9YDGScukm9MGRVA/ dmRg== X-Gm-Message-State: AOJu0YxvCQxwgiSgASS9uGFDAb549h5XUJE8+9OKXus7AIAN3d+4tYdm 9hJbuinzOmDJXZvz2XJLup85z3iFmJxStH1R5dgy2eUJmpI4VYQA4trGKw== X-Google-Smtp-Source: AGHT+IEDYe1A5LbJXfJgomoijh1E3Jfu5PzMod6iVvws1B7fdBhbY+J9WZfMUvP4x+p2qMcaY8NRvg== X-Received: by 2002:a17:907:2d8e:b0:a9a:60b0:a8e7 with SMTP id a640c23a62f3a-a9abef2b5e2mr12264166b.2.1729623962188; Tue, 22 Oct 2024 12:06:02 -0700 (PDT) Received: from smtpclient.apple ([2a04:4540:6a2c:f800:6c34:79d:a431:707]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a913077basm375538366b.97.2024.10.22.12.06.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Oct 2024 12:06:01 -0700 (PDT) From: Pablo Padilla Content-Type: multipart/alternative; boundary="Apple-Mail=_22A04D3A-3C3D-446B-A8AB-681062D66555" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Org-mode+Babel: Refactor across files or code blocks Message-Id: Date: Tue, 22 Oct 2024 21:05:50 +0200 To: emacs-orgmode@gnu.org X-Mailer: Apple Mail (2.3774.500.171.1.1) Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=pgpb.padilla@gmail.com; helo=mail-ej1-x630.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.31 X-Spam-Score: -4.31 X-Migadu-Queue-Id: 62A78786FA X-Migadu-Scanner: mx13.migadu.com X-TUID: jfVS/pEQeALJ --Apple-Mail=_22A04D3A-3C3D-446B-A8AB-681062D66555 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi there, I have started to write some of my dotfiles using org-mode and = I have regularly felt the need to refactor certain parts of my = configuration. At the moment I mostly perform refactoring using find and = replace but would like to have more robust support to refactor across = distinct Babel blocks or across files. A more detailed example follows: I'm refactoring my Emacs config files so that they are generated with = [org-babel-tangle][1]. I am able to do everything I need but I really = miss better refactoring support. As an example, after I define a symbol (variable, function), there maybe = a lot of unrelated code and prose before the next usage: > Some explanation about `a` and `x`: > ```elisp > (defun a ...) > (defvar x ...) > ``` > Another paragraph ...=20 > ```elisp > ((((more))))(((lisp)))()()((((code))) > ``` > Using `a` or `x`: > ```elisp > (doSomething (a) ...) > (crashSystem x ...) > ``` To rename a symbol, I enter [edit mode (`C-c '`)][2], and there is some = limited refactoring support, e.g., rename symbol, extract variable, etc. = However, changes to a symbol across all Babel blocks or across files is = not supported. My workflow today is to use `helm-projectile-ag` to find usages in the = project (git repo) and then apply the required changes to each, one by = one, by hand. I have been googling for refactoring support across blocks/files so far = with little success. I have posted this question to gather some = pointers, references to Emacs packages that can improve my refactoring = workflow or maybe help me rethink my workflow. [1]: https://orgmode.org/manual/Extracting-Source-Code.html=20 [2]: https://orgmode.org/manual/Editing-Source-Code.html Originally posted in https://emacs.stackexchange.com/q/80858/11978=20 Regards, =E2=80=94 Pablo=20= --Apple-Mail=_22A04D3A-3C3D-446B-A8AB-681062D66555 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Hi there, I have started to write some of my dotfiles using org-mode and = I have regularly felt the need to refactor certain parts of my = configuration. At the moment I mostly perform refactoring using find and = replace but would like to have more robust support to refactor across = distinct Babel blocks or across files.

A more = detailed example follows:

I'm refactoring = my Emacs config files so that they are generated with = [org-babel-tangle][1]. I am able to do everything I need but I really = miss better refactoring support.

As an example, = after I define a symbol (variable, function), there maybe a lot of = unrelated code and prose before the next = usage:

> Some explanation about `a` and = `x`:
> ```elisp
> (defun a ...)
> = (defvar x ...)
> ```
> Another paragraph = ... 
> ```elisp
> = ((((more))))(((lisp)))()()((((code)))
> ```
> = Using `a` or `x`:
> ```elisp
> (doSomething = (a) ...)
> (crashSystem x ...)
> = ```


To rename a symbol, I enter = [edit mode (`C-c '`)][2], and there is some limited refactoring support, = e.g., rename symbol, extract variable, etc. However, changes to a symbol = across all Babel blocks or across files is not = supported.

My workflow today is to use = `helm-projectile-ag` to find usages in the project (git repo) and then = apply the required changes to each, one by one, by = hand.

I have been googling for refactoring = support across blocks/files so far with little success. I have posted = this question to gather some pointers, references to Emacs packages that = can improve my refactoring workflow or maybe help me rethink my = workflow.




Regards,
=E2=80=94
Pablo 
= --Apple-Mail=_22A04D3A-3C3D-446B-A8AB-681062D66555--