unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41410: Patch: Add function ffap-other-tab
@ 2020-05-19 21:43 ej32u--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-05-19 22:31 ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: ej32u--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-05-19 21:43 UTC (permalink / raw)
  To: 41410


[-- Attachment #1.1: Type: text/plain, Size: 172 bytes --]

Hello,

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.

Please use it.

Thank you.

[-- Attachment #1.2: Type: text/html, Size: 539 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-ffap-other-tab.patch --]
[-- Type: text/x-patch; name="0001-Add-ffap-other-tab.patch", Size: 1384 bytes --]

---
 lisp/ffap.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lisp/ffap.el b/lisp/ffap.el
index d656b37372..ceba9d2622 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -54,6 +54,8 @@
 ;; C-x 5 r		ffap-read-only-other-frame
 ;; C-x 5 d		ffap-dired-other-frame
 ;;
+;; C-x t f		ffap-other-tab
+;;
 ;; S-mouse-3     ffap-at-mouse
 ;; C-S-mouse-3   ffap-menu
 ;;
@@ -1758,6 +1760,14 @@ ffap-other-frame
       (set-window-dedicated-p win wdp))
     value))

+(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)

--
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#41410: Patch: Add function ffap-other-tab
  2020-05-19 21:43 bug#41410: Patch: Add function ffap-other-tab ej32u--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-05-19 22:31 ` Juri Linkov
  2020-05-24 22:05   ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2020-05-19 22:31 UTC (permalink / raw)
  To: 41410; +Cc: ej32u

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

Thanks, this is a useful addition.  Please push it to master.

> +(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)





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#41410: Patch: Add function ffap-other-tab
  2020-05-19 22:31 ` Juri Linkov
@ 2020-05-24 22:05   ` Juri Linkov
  2020-05-24 22:26     ` Stefan Kangas
  0 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2020-05-24 22:05 UTC (permalink / raw)
  To: 41410; +Cc: ej32u

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






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#41410: Patch: Add function ffap-other-tab
  2020-05-24 22:05   ` Juri Linkov
@ 2020-05-24 22:26     ` Stefan Kangas
  2020-05-25  0:46       ` Noam Postavsky
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Kangas @ 2020-05-24 22:26 UTC (permalink / raw)
  To: Juri Linkov, 41410; +Cc: ej32u

Juri Linkov <juri@linkov.net> writes:

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

OK.

I could find no previous commit by ej32u@protonmail.com, and this patch
is only 11 lines.  I therefore believe we could safely install it as
Copyright-paperwork-exempt.  Unless anyone disagrees with that analysis,
I'll push this to master in the next couple of days.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#41410: Patch: Add function ffap-other-tab
  2020-05-24 22:26     ` Stefan Kangas
@ 2020-05-25  0:46       ` Noam Postavsky
  0 siblings, 0 replies; 5+ messages in thread
From: Noam Postavsky @ 2020-05-25  0:46 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Juri Linkov, ej32u, 41410

tags 41410 fixed
close 41410 28.1
quit

Stefan Kangas <stefankangas@gmail.com> writes:

> I could find no previous commit by ej32u@protonmail.com, and this patch
> is only 11 lines.  I therefore believe we could safely install it as
> Copyright-paperwork-exempt.  Unless anyone disagrees with that analysis,
> I'll push this to master in the next couple of days.

There's an assignment on file for that address; I've pushed to master.

[1: 0cdedf612b]: 2020-05-24 20:45:05 -0400
  Add command ffap-other-tab (Bug#41410)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0cdedf612b9da14fccc39c4a4e81cbf400e4552f





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-25  0:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 21:43 bug#41410: Patch: Add function ffap-other-tab ej32u--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-19 22:31 ` Juri Linkov
2020-05-24 22:05   ` Juri Linkov
2020-05-24 22:26     ` Stefan Kangas
2020-05-25  0:46       ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).