all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#52688: 29.0.50; term / use display-buffer
@ 2021-12-20 22:55 dal-blazej--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-21 10:48 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: dal-blazej--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-20 22:55 UTC (permalink / raw)
  To: 52688

[-- Attachment #1: Type: text/plain, Size: 218 bytes --]


The function 'term' use actually 'switch-to-buffer'. I think it's better
to let users decide where the window will appear with
'display-buffer-alist' or 'display-buffer-base-action', and so, to use
'display-buffer'.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: use_display-buffer --]
[-- Type: text/x-diff, Size: 829 bytes --]

From ae03d8bb6e10027334c2dd6c37bd0e8faf74932c Mon Sep 17 00:00:00 2001
From: Dal Blazej <dal-blazej@onenetbeyond.org>
Date: Mon, 20 Dec 2021 23:48:11 +0100
Subject: [PATCH] Use display-buffer with term* lisp/term.el (term):

* list/term.el (term): Let users decides which window 'term' will take.
---
 lisp/term.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/term.el b/lisp/term.el
index 698bef08b2..5374815c69 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1532,7 +1532,7 @@ commands to use in that buffer.
 					     shell-file-name))))
   (set-buffer (make-term "terminal" program))
   (term-char-mode)
-  (switch-to-buffer "*terminal*"))
+  (display-buffer "*terminal*"))
 
 (defun term-exec (buffer name command startfile switches)
   "Start up a process in buffer for term modes.
-- 
2.30.2


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

* bug#52688: 29.0.50; term / use display-buffer
  2021-12-20 22:55 bug#52688: 29.0.50; term / use display-buffer dal-blazej--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-21 10:48 ` Lars Ingebrigtsen
       [not found]   ` <87ee65svov.fsf@onenetbeyond.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-21 10:48 UTC (permalink / raw)
  To: dal-blazej; +Cc: 52688

dal-blazej@onenetbeyond.org writes:

> The function 'term' use actually 'switch-to-buffer'. I think it's better
> to let users decide where the window will appear with
> 'display-buffer-alist' or 'display-buffer-base-action', and so, to use
> 'display-buffer'.

[...]

> -  (switch-to-buffer "*terminal*"))
> +  (display-buffer "*terminal*"))

This would change the behaviour considerably from the current one, so I
don't think this would fly.  But we could use
`pop-to-buffer-same-window', I guess?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#52688: 29.0.50; term / use display-buffer
       [not found]   ` <87ee65svov.fsf@onenetbeyond.org>
@ 2021-12-22 12:01     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-22 12:01 UTC (permalink / raw)
  To: dal-blazej; +Cc: 52688

dal-blazej@onenetbeyond.org writes:

> Yes, I forgot about the selection of the
> window.  `pop-to-buffer-same-window' seems better.

OK; I've now done that in Emacs 29.





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

end of thread, other threads:[~2021-12-22 12:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-20 22:55 bug#52688: 29.0.50; term / use display-buffer dal-blazej--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-21 10:48 ` Lars Ingebrigtsen
     [not found]   ` <87ee65svov.fsf@onenetbeyond.org>
2021-12-22 12:01     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.