From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wOu8NxiOj2IdWAAAbAwnHQ (envelope-from ) for ; Thu, 26 May 2022 16:26:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MJ+pNhiOj2I5hQEAG6o9tA (envelope-from ) for ; Thu, 26 May 2022 16:26:32 +0200 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 90B9C37C7B for ; Thu, 26 May 2022 16:26:31 +0200 (CEST) Received: from localhost ([::1]:53418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nuERZ-00013w-Gh for larch@yhetil.org; Thu, 26 May 2022 10:26:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuEPB-0008MB-CS for emacs-orgmode@gnu.org; Thu, 26 May 2022 10:24:01 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:36717) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuEP9-0002Ke-Og for emacs-orgmode@gnu.org; Thu, 26 May 2022 10:24:01 -0400 Received: by mail-pj1-x1033.google.com with SMTP id u12-20020a17090a1d4c00b001df78c7c209so4572874pju.1 for ; Thu, 26 May 2022 07:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Ccg7sPy+B9lReGogUJvow+IqnCpjIU/LRyK/wgVBMqI=; b=U+wRfD+FTcoVzSGdoVrQE37SbQJtxaic3nCvMphEy19eOsIGvs+jKK1c7Bw9MB2cTn YLpCNyvy6yiJcORiO3dmFpj1+zexaRbqZdJ5ZFz3e5h2TdKthbXZY7vEL3KC0KwIDXOG J/9np0Cjy1Oo2fg4njoKiJ6j8lwdBeG2TybTI3VrN+hn/wflutVMcKOfMxTJQrCT6RL1 x/3vbqfUkrZQF/Wi6/qK4EJHhYgUOZOmXsNl6RZJmC4IRXItWHamsegGrKe0DGrbquyt lXHahMsUb5Eq+zgwJTCmdyTjRyqynmVSmFldjPww84VBYu/IBnhZ4YAVPsjS6ua0GsUX /MEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Ccg7sPy+B9lReGogUJvow+IqnCpjIU/LRyK/wgVBMqI=; b=F22XXC9lWR+zP6g0/nvLUy64X6ue86kgX9UI0jtQrOMtabeewrhk5EFPkUCsim5m97 6RF7vs8Dm+K2GIyl1GUg590Xx86JUCtUe8E9cNyF+DJxdWwFEYGj4co/Usg0yhCYex2z wDsrPuIHLb0/gWD2PlUoW9uoaxMuhCYyDsaZx+BzU+Lg/f/SmA0vBtHd+CGFkaYsuJoY e/4bIy6O/vsLQdvemwwpLyoZz+29jf5vvy5mUTfX/xp6iM0c58gA49Xd6S9HUEfA2inL WTt7kjL/kyOUCwylSsbnvIGOMXOJhdwzH/YccHQnxYOoAVa0gs0UaNS9HGmaagKJFKxH kyUg== X-Gm-Message-State: AOAM531RTdBVuWj1UBGSpfcf6w1uXxAKM0RlEO9TWicFyy9fHuEUCSDg RdSxJFxG7NIWrCFa/VTz0lo= X-Google-Smtp-Source: ABdhPJy+TX6xbdxiuBHxu3PeOzNdBV6czHZnaI/TJmhWHnucTx6pP4gU0pStX+QBpXwicEXI30gKoQ== X-Received: by 2002:a17:903:2443:b0:163:63a6:82b0 with SMTP id l3-20020a170903244300b0016363a682b0mr6621464pls.105.1653575038155; Thu, 26 May 2022 07:23:58 -0700 (PDT) Received: from localhost ([38.75.137.92]) by smtp.gmail.com with ESMTPSA id c11-20020a170902d48b00b0015ea8b4b8f3sm1591385plg.263.2022.05.26.07.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 07:23:57 -0700 (PDT) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-open-file immediately termininates when calling xdg-open that calls emacsclient In-Reply-To: References: <87ee0mp4hb.fsf@localhost> Date: Thu, 26 May 2022 22:24:13 +0800 Message-ID: <87bkvke5iq.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653575191; 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=Ccg7sPy+B9lReGogUJvow+IqnCpjIU/LRyK/wgVBMqI=; b=ePGSt2Q95WLi3uf9oVo9MQ9LOM7djSa0zn0zSBrPlKZ1HO8hYWxzfasLiMrnKyUpetiNFN dCR+8GJP0Z/zqMhyeVAwiqp79iJVEsHH2v3CdNba+uZRlBQdTfU2GOddw8sCaVQGvvqZUM OJ9SFnjV1M2Mm5ULDsQTy+5UDIFc1Ec4OH2IxyQt6gWjO7LqqyZ3Cy9rMSLXQTp5iScEeQ VkS9dzVB2Q6SJmqEZAklQaiAUDFAHqRQP9aXqjGKE43P5oXZSMlthWj+T54ySGU5E6eH1u LgHcg80+ULMQIY8ylOxVrkVFNy5CW+21ifeAJgjTOXXRroNvwqFp2LQxjl1ICQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653575191; a=rsa-sha256; cv=none; b=efB4/0+RppJeKIfWPHCWyF2A1I1OAgVNeTsbfIYKEzwqz7N0O6Da+XgaqLoqVrBEgEswhy DERuXYb+Zb9tGR1cpnj142q97JKRWzBBU20qgi487iT2DMOvMk0ZdGmEhzQGlitRK9mNc8 e7RtlxbynPhZM5vofmefsSNPSwQFy13X808nG27qBUljp8Y01T7qZp/CTeDc/ZIPjTI4h/ yJRSpcGozhP38HaNlosscLEkO3bQaAbeVak+h4up46HKOCKyRPYz99vfiIptrCHQY1bhMP NtdHEIURw1/q39oeAaWL3GlPhencbFzUfXOBrEAhlmAcXU6pbGeaXeU1EKa3iA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=U+wRfD+F; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Spam-Score: -7.34 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=U+wRfD+F; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Queue-Id: 90B9C37C7B X-Spam-Score: -7.34 X-Migadu-Scanner: scn0.migadu.com X-TUID: eoPnW+VRSx5B Max Nikulin writes: >> They both set process-connection-type to nil/'pipe. Somehow, this change >> breaks org-open-file for me when org-open-file calls xdg-open and xdg is >> confugured to open the file with emacsclient. I only see a flicker and >> the file does not open. Sometimes, Emacs even crashes. > > I can not reproduce a problem, however I tried to factor-out xdg-open. > Emacs-27.1, a minimal LXC container, so "&" to simulate kde-open5 > starting process in background. On the other hand I consider behavior > when emacsclient is called from emacs as confusing due to requirement of > C-x # to notify emacs about completion. Try the following: (start-process-shell-command "1" nil "emacsclient -c ~/.bashrc") (let ((process-connection-type nil)) (start-process-shell-command "1" nil "emacsclient -c ~/.bashrc")) The second command will cause flickering, though opens the file in the same frame (not the new as one would expect from -c switch). To reproduce what I am seeing, you may need to adjust xdg- database adding the following .desktop file: ~/.local/share/applications/emacsclient-local.desktop --------------- [Desktop Entry] Type=Application Version=1.0 Name=Emacs Client Exec=emacsclient -c %f Icon=emacs-icon Terminal=false MimeType=text/css;text/english;text/html;text/plain;text/x-c;text/x-chdr;text/x-csrc;text/x-c++;text/x-c++hdr;text/x-c++src;text/x-java;text/x-makefile;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;application/pdf;inode/directory;inode/mount-point;image/png;image/tiff; --------------- Then, make sure that xdg-open uses the desktop file for application/x-shellscript (xdg-mime query default application/x-shellscript) Finally, run (start-process-shell-command "1" nil "xdg-open -c ~/.bashrc") (let ((process-connection-type nil)) (start-process-shell-command "1" nil "xdg-open -c ~/.bashrc")) Observe flickering + Emacs not opening the file. > Do you see the same problem for a function from mailcap.el in the > development emacs version? Which function are you referring to? Best, Ihor