From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Daniel_Mart=C3=ADn?= Newsgroups: gmane.emacs.devel Subject: Re: macos: Finder's alias handling Date: Sun, 26 Sep 2021 18:31:51 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12211"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) Cc: Emacs developers To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 26 18:33:49 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mUX64-00030j-4b for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Sep 2021 18:33:48 +0200 Original-Received: from localhost ([::1]:48804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUX63-00071x-4D for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Sep 2021 12:33:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUX4L-0005Sw-KV for emacs-devel@gnu.org; Sun, 26 Sep 2021 12:32:01 -0400 Original-Received: from sonic303-20.consmr.mail.ir2.yahoo.com ([77.238.178.201]:34325) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUX4J-0004E3-CG for emacs-devel@gnu.org; Sun, 26 Sep 2021 12:32:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1632673916; bh=NjD4+ox7lBM2Qf2WXHkfcLvPgq8jab0WkfkGphLNe0M=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=dWTgnai2MiZGHkg7Rrjt9SkJDKV9/otHgBdLR1tv1zhf5UhzEMEVbnKiZfw614iqzTyhaZZHhusQ98Q0WFp6ltRnayuCBCui/PZJOzXehineb73lOIM44xD4A9ApzvcKbvgalZBF/mHlKu+qdGPbZCPP1tFN5b+OO1jwBG/aTTWcgWfD97cT0o6vo0tTJlk1oud8j840wONWGkVnzOhv8vk7KiHIqpklLX8gc2uuguHM2JUAhFZbBJyuVxXh19VP/2ttLhoVBLUSodQoIKoMUKKtpV8mEtVwIfKb2VjKSH3V84jKK1I7SHZjoQG3EojugWtL4uyP0Ey8cbxu88UQ8Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1632673916; bh=kByBayXROcBxB0qcmo+Pa3GGGV/gicNmkq8hQ/Oxxfc=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=lN2bepa5MNEXz6UqGi0QHbvOMfeaz+2xvX0SRL31jVZDzPoVrsP6oGelL9v/QTlTG1zbk8andnGbjFdTaZC2I0hj9kZPFe0fP19P3cGgIZBhpWX83X0UwMarLBkD/5gRGk7lAPlC4gLuuzg4VRByAcrsnk8l3T+tOI6jMbd/Y2yzqORzfAj7RV3ZTF0GbNA8gzlGBR6AqW4a534q4pFajqzLo4InLVUvuCTpe3iKrrLIHzepXICeAM9Fo1AGD6YMHoLJuRArlJ9A6Yzq1tOgHRR2CkGzAcXlA0Te9iu0KrQ9Vt1bOo0/hAQ/O5lP/Dvw2ATv35psIGRS4GVJwPsVTA== X-YMail-OSG: nkHRLUMVM1luACM0uxFewecRXxZp5OdscJ1TmwAEIuXrVMTiZG4jd0WkykiT32i 8TsiqZ8KsLLyqkYRO38qg1vHwau82iPyQM09c2vOqFMWp6XKLS2IUnZDV8mYfKg6xSUdu.PauUtS e4aH7D9jzn72cwJUYllfTkqR8BtEAjx9cJoB5JHIx5uHMH_a3ONk7MEtY8o9zS_5PkHU1HBdlvwO a3Cyjv9GdQig7.0mYP37Brj4KZMjNvJGN4P8oxM5U3dAzbnxawsIo75Jwcz.IWfAr_hp91EJ8Gfq Nua1QiUGmwRlmCZFKZH.SEBX6xPDmRnbh_5H3h_wFd1.wRXaFP.zVK.FtJh9OfuOi9FJEfPrpEbD .5UXmDmhPs3mvcJEgrttdctSb6e_xV.kpzbrQK.9_OIuY8iTJLq3RCUtut5sf7GvJ.ykYnYfSN22 KOgPS9IX8mM9DPkgnsJyGs1Q99F4cKKmngOqehSUTiHH.L5nGD9aLpzlms470Y1MXkCou70dD2IM 1R4WXBLkz_1jmN5LPHtLLduccw4ciJ2AKdX4uIOGVMZpJ8h.gNzGVmiCNUGR85vWJCVe9VJ4ojnE vO.A4ryIO22s2QA.PReXNxddqt4V7ggOLoGix5iUmXmZCxjizR.uq0VEz3qIBKQgtPZcMEc4VSV6 H0I_7XajR7uQCqQE0eMSyQZ4lj1yGicXkgeeebOFaTRjs8hnmECrZa74dsMvlA5Q0CrOwggLz6cK R.r1PQ0MZonEzsaZcUBmRZRQDcgb5CTjfBq4YmpkQ0zOEpxghs4d0whsfHzrBcYkWYkPjmVTp7W6 d5hBI9i9NNxyJqX4NaTCpNC4yT1brr2RvluRGXiR3p X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Sun, 26 Sep 2021 16:31:56 +0000 Original-Received: by kubenode530.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 64cd595e0d9c600eaf4f9dcd99340083; Sun, 26 Sep 2021 16:31:52 +0000 (UTC) In-Reply-To: (Jean-Christophe Helary's message of "Mon, 27 Sep 2021 00:42:55 +0900") X-Mailer: WebService/1.1.19043 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=77.238.178.201; envelope-from=mardani29@yahoo.es; helo=sonic303-20.consmr.mail.ir2.yahoo.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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275518 Archived-At: Jean-Christophe Helary writes: > > There is probably a way to use the contents of *Shell Command Output* > and insert that as an argument to find-file, but I don't find that > very elegant, and I'm probably missing something in the shell-command > because I can't see how I can use the output as a direct argument to > find-file... Did you try shell-command-to-string? I found it by doing C-h d "shell output string". > > 2) now, I'd like to generalize that so that Emacs automatically > triggers that code when entering such a file. So I guess that would > encompass dired and the likes, "find-file" and similar commands, > etc. Is that even possible? I guess the answer is yes, but at what > cost in terms of performance? And how would I go about that? If you see, macOS aliases always start with the same byte pattern, so you could modify magic-mode-alist and add a specific mapping between the regular expression that extracts that byte pattern and a new major mode that you create (macos-alias-mode, for example). This new major mode will ask osascript for the real path of the alias and then show its contents in the buffer, either on demand or automatically. That's how Emacs handle other binary file types like images or PDFs. This approach would work when visiting Finder aliases in general, not only from Dired.