bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41410: Patch: Add function ffap-other-tab


From: Juri Linkov
Subject: bug#41410: Patch: Add function ffap-other-tab
Date: Mon, 25 May 2020 01:05:22 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> 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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]