From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id mBiYNPpsQ2WmaQEAauVa8A:P1 (envelope-from ) for ; Thu, 02 Nov 2023 10:33:46 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mBiYNPpsQ2WmaQEAauVa8A (envelope-from ) for ; Thu, 02 Nov 2023 10:33:46 +0100 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 7C78A5E15E for ; Thu, 2 Nov 2023 10:33:46 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=k9oG3bNv; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698917626; a=rsa-sha256; cv=none; b=YJQuz0BtwqfYbem8UYIOIEQCI8EIEFe6h6NCoxuB4lGL5Z6FqyYIexcSjO4NmVzhCUsei7 9SNbLLG+lng4aJu8IasERxEGn2DBfXvazNpWsWI1a24X9o6+NW+Ih72b5/eeBp1T3K+gh0 Csr/odSAPaIUH2TNY24NN9fJpNz/kBNfiGFkFCAwAaAGNZSi10lZkcrQv3V/es3p+2GBta /38lMSDqqX9Hzy+EJqh9MZiA/7w8heKRNq7vCqkWemYpdEywmRQP4BFL7h+UdVZL8c26Ba tyUgdkyYtTg90bOx+zNPjGhsek3tZdb+Cl11vMlXWNfELe8z0mq8Q7RmmCYVhw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=k9oG3bNv; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698917626; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=bWkRcmgTz6spXfzo0iP/zDygzpm4URAO1cN44/R37uQ=; b=eQOHR6vJkE7kwz0e2RkjB0CgLFL4Au4i0MRfYaaQERchOYWVo3I7H49MRssYOx23ldiv+Z dz9JyDKzk0w65ZpGnLf/LKQzX79IV7+zoFKUWlt3uFopRObH01dLCagDKV+okXoiQrz1I7 9XeNJTbhqMoSQyHey03WfXWxg7dtg6LfEaHJjfUd98z9/JtezQ+ec1zzQPFcH8oVsHR9gc OxTJHIUjZoe+lId2d8YAqcooGm0jnH9QEarWrIJVbWkvrHsNpaPwrnZz5mN/uHtGuJRt/1 Rv4ACt3Iv/eLZ4LwpDhqVZ9Znsom0GkpvuaD+EQ5KIImATHV7X3ITPS5I5sG7Q== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyU4x-0004Dl-6A; Thu, 02 Nov 2023 05:33:31 -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 1qyU4t-0004Bb-J5 for bug-guix@gnu.org; Thu, 02 Nov 2023 05:33:27 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyU4t-0005wn-AX for bug-guix@gnu.org; Thu, 02 Nov 2023 05:33:27 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyU5S-0008Kh-4Y for bug-guix@gnu.org; Thu, 02 Nov 2023 05:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44272: guix edit doesn't work when $EDITOR is set to VSCode Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 02 Nov 2023 09:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44272 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Leo Prikler Cc: ncdehnel@gmail.com, 44272@debbugs.gnu.org Received: via spool by 44272-submit@debbugs.gnu.org id=B44272.169891759531968 (code B ref 44272); Thu, 02 Nov 2023 09:34:02 +0000 Received: (at 44272) by debbugs.gnu.org; 2 Nov 2023 09:33:15 +0000 Received: from localhost ([127.0.0.1]:53919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyU4h-0008JY-1r for submit@debbugs.gnu.org; Thu, 02 Nov 2023 05:33:15 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:39950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyU4e-0008JI-6x for 44272@debbugs.gnu.org; Thu, 02 Nov 2023 05:33:12 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-408434ce195so1183335e9.0 for <44272@debbugs.gnu.org>; Thu, 02 Nov 2023 02:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698917551; x=1699522351; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=bWkRcmgTz6spXfzo0iP/zDygzpm4URAO1cN44/R37uQ=; b=k9oG3bNvNSE4L4qswW5C13Nl23grrl+AQGLXpOPX0uxKPFJx1k3te6TPV6+poZsdhx uCdniyWRWhQelEn6LxaU7NWugZlfl+CobtNnncCt/lzZkPWs5JhYy1NbzEEPGJDQ1FDP ncdwg8D1J8AV5pa2p8KNBye2TQbG0jVEbMrIJrFeZFKGa/zLBfFDdUal+6Tir/BzyAZT hCxiuNw2VaIoTPHc93SU7L1FMWnBkkLLJs8cdnuh8OQzZCroUNoodvrPc+lwjK5qf9qQ 5Jrjwu5VbXmsuCpm+vXq25v1t4jrApBdNGsTfbVZuN50mgqEycPjk7/cwKUHZ8TGvIPB iPUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698917551; x=1699522351; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bWkRcmgTz6spXfzo0iP/zDygzpm4URAO1cN44/R37uQ=; b=eFMJLUHaWiqL8xuphLzM8zlcPE7tcuVc2Z6DoiCAzSsOv4J6hEBViuTw/viOlpejWk P1b19RyiTNTnp0crVjHcnw43h3wQrLF2GcukwPjiusM4sA2o8ZldddSmjHcQiqhkQMyI gjf7c5XmF/M9g2Sx1sXzMAbL8KOdgvprZOQstqwDZPSYfceSfE4M7Aq3M2ECaFavcLMs BTnrdmAIpFW0xyj1sw4uHdROkFpkikCVpXnEE6YqdnRn4ArvlT5lO9afMV9DCr+8Pyq8 IdZBL81LVh01+ImS44sDW5lwdG3vyYhIfwWyor8jzWht2tx13Z+GN2gG1jJqkWfXfMXI 2DLg== X-Gm-Message-State: AOJu0YzC12k7o+ck3ptR6z82ebLBOhsudSWtZNaDDm9fmuLTNsngFCV7 rc11Ky521xSjvH+f0lVBELnF/oRe1e0= X-Google-Smtp-Source: AGHT+IGFj1Wd32+kv/keZkOx2e4mei5rHOpN1DwORmLGEaDeV+jVgHCAOlBn2IdcMCmh6kBM4dIDJw== X-Received: by 2002:a05:600c:5128:b0:401:c07f:72bd with SMTP id o40-20020a05600c512800b00401c07f72bdmr14642284wms.4.1698917551347; Thu, 02 Nov 2023 02:32:31 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id ha7-20020a05600c860700b003fc16ee2864sm2135527wmb.48.2023.11.02.02.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 02:32:30 -0700 (PDT) From: Simon Tournier References: <1a275264117e14a20f28757d8f6511acfd9ea5c9.camel@student.tugraz.at> <868sbq2yjh.fsf@gmail.com> Date: Thu, 02 Nov 2023 10:32:27 +0100 In-Reply-To: <868sbq2yjh.fsf@gmail.com> (zimoun's message of "Wed, 28 Oct 2020 15:52:18 +0100") Message-ID: <865y2kpkk4.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 7C78A5E15E X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -4.01 X-Spam-Score: -4.01 X-TUID: I8uRIo1XRn8J Hi, PS: I write it here for later discovery. The bug remains closed. :-) I will open another thread for discussing it. On Wed, 28 Oct 2020 at 15:52, zimoun wrote: > Instead =E2=80=99kate=E2=80=99 use =E2=80=99--line/-l=E2=80=99 and not = =E2=80=99+N=E2=80=99. You could wrap, something > along these lines: > > #!/bin/sh > > kate -l $(echo "$*" | tr "+" " ") > > then: > > export EDITOR=3D/path/to/kate-wrapper.sh > guix edit emacs VSCode does not respect the usual convention, too! For instance, $ code +9 path/to/file open files named =E2=80=9C+9=E2=80=9D and =E2=80=9Cpath/to/file=E2=80=9D. = Instead, VSCode expects: $ code --goto path/to/file:9 Therefore, it makes annoying to use VSCode with =E2=80=9Cguix edit=E2=80=9D= . Here a tiny wrapper to still be able to compose the both. Well, $ EDITOR=3Dvscode-wrapper guix edit hello opens at the correct location. Cheers, simon --8<---------------cut here---------------start------------->8--- #!/usr/bin/env -S guix repl -q -- ;; -*- mode: scheme -*- !# ;;; Copyright =C2=A9 2023 Simon Tournier ;;; ;;; VSCode does not respect the convention: ;;; ;;; $EDITOR +line file ;;; ;;; and instead relies on: ;;; ;;; code --goto file:line ;;; ;;; ;;; This wrapper is a workaround. It is Scheme but it could be whatever el= se ;;; as Bash, Python, etc. It uses "guix repl" although no Guix library is ;;; required. Because we assume the invokation, ;;; ;;; EDITOR=3Dvscode-wrapper guix edit foo bar ;;; ;;; relying on "guix repl" allows to easily get Guile. ;;; (use-modules (ice-9 match) ((ice-9 string-fun) #:select (string-replace-substring))) (define %vscode--goto "code --goto ") (define +line-files (match (command-line) ((wrapper rest ...) (if (eqv? 0 (modulo (length rest) 2)) rest (begin (write "Error with 'guix edit'") (exit 1)))))) (define files (let loop ((files:lines '()) (lst +line-files)) (if (null? lst) (reverse files:lines) (match lst ((n file rest ...) (loop (cons (string-append file ":" (string-replace-substring n "+" "")) files:lines) rest)))))) (catch 'system-error (lambda () (for-each (lambda (file) (system (string-append %vscode--goto file))) files)) (lambda _ (write "failed to launch!"))) --8<---------------cut here---------------end--------------->8---