From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#41410: Patch: Add function ffap-other-tab Date: Mon, 25 May 2020 01:05:22 +0300 Organization: LINKOV.NET Message-ID: <87d06tugyl.fsf@mail.linkov.net> References: <87d06z8slz.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="79797"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: ej32u@protonmail.com To: 41410@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 25 00:11:16 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jcypw-000Kgf-3W for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 00:11:16 +0200 Original-Received: from localhost ([::1]:38984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jcypv-0003If-3T for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 May 2020 18:11:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jcypk-0003Ar-6Z for bug-gnu-emacs@gnu.org; Sun, 24 May 2020 18:11:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jcypj-0001jh-U4 for bug-gnu-emacs@gnu.org; Sun, 24 May 2020 18:11:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jcypj-0000CA-Pe for bug-gnu-emacs@gnu.org; Sun, 24 May 2020 18:11:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 May 2020 22:11:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41410 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41410-submit@debbugs.gnu.org id=B41410.1590358246698 (code B ref 41410); Sun, 24 May 2020 22:11:03 +0000 Original-Received: (at 41410) by debbugs.gnu.org; 24 May 2020 22:10:46 +0000 Original-Received: from localhost ([127.0.0.1]:38998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcypS-0000BA-9l for submit@debbugs.gnu.org; Sun, 24 May 2020 18:10:46 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:42587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcyp9-0000A4-OM for 41410@debbugs.gnu.org; Sun, 24 May 2020 18:10:28 -0400 X-Originating-IP: 91.129.108.6 Original-Received: from mail.gandi.net (m91-129-108-6.cust.tele2.ee [91.129.108.6]) (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id A10B8FF804; Sun, 24 May 2020 22:10:20 +0000 (UTC) In-Reply-To: <87d06z8slz.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 20 May 2020 01:31:04 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:180931 Archived-At: >> Attached is a patch to add a function to open files at point in another >> tab. It is basically the same as the function ffap-other-window. >> >> +(defun ffap-other-tab (filename) >> + "Like `ffap', but put buffer in another tab. >> +Only intended for interactive use." >> + (interactive (list (ffap-prompter nil " other tab"))) >> + (pcase (save-window-excursion (find-file-at-point filename)) >> + ((or (and (pred bufferp) b) `(,(and (pred bufferp) b) . ,_)) >> + (switch-to-buffer-other-tab b)))) >> + >> (defun ffap--toggle-read-only (buffer-or-list) >> (dolist (buffer (if (listp buffer-or-list) >> buffer-or-list >> @@ -2013,6 +2023,7 @@ ffap-bindings >> >> (global-set-key [remap find-file-other-window] 'ffap-other-window) >> (global-set-key [remap find-file-other-frame] 'ffap-other-frame) >> + (global-set-key [remap find-file-other-tab] 'ffap-other-tab) >> (global-set-key [remap find-file-read-only-other-window] 'ffap-read-only-other-window) >> (global-set-key [remap find-file-read-only-other-frame] 'ffap-read-only-other-frame) > > Thanks, this is a useful addition. Please push it to master. Maybe someone could check if this requires papers and could push it to master when I'm away from computer.