unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41888: 27.0.91; fix ACTION argument of display-buffer
@ 2020-06-16  6:30 Richard Kim
  2020-06-20 14:57 ` bug#41888: further explanation of the patch against gud.el Richard Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Richard Kim @ 2020-06-16  6:30 UTC (permalink / raw)
  To: 41888

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


gud-common-init function in emacs 27 seems to have a bug in how it calls
display-buffer. The second argument passed is ACTION. According to
docstring of display-buffer, the list of functions need to be a list
within a list. The attached patch adds the missing extra pair of
parenthesis.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix one display-buffer call --]
[-- Type: text/x-diff, Size: 1111 bytes --]

From f89f87c6997fe26b4d8859dafd85c886c753a5c6 Mon Sep 17 00:00:00 2001
From: Richard Kim <emacs18@gmail.com>
Date: Mon, 15 Jun 2020 23:20:57 -0700
Subject: [PATCH] fixed ACTION argument of display-buffer call

---
 lisp/progmodes/gud.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index d5fd1dce6f..540bc9ce7f 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2621,9 +2621,9 @@ comint mode, which see."
     (select-window
      (display-buffer
       (get-buffer-create (concat "*gud" filepart "*"))
-      '(display-buffer-reuse-window
-        display-buffer-in-previous-window
-        display-buffer-same-window display-buffer-pop-up-window)))
+      '((display-buffer-reuse-window
+         display-buffer-in-previous-window
+         display-buffer-same-window display-buffer-pop-up-window))))
     (when (and existing-buffer (get-buffer-process existing-buffer))
       (error "This program is already being debugged"))
     ;; Set the dir, in case the buffer already existed with a different dir.
-- 
2.25.1


[-- Attachment #3: Type: text/plain, Size: 1140 bytes --]


In GNU Emacs 27.0.91 (build 8, x86_64-pc-linux-gnu, GTK+ Version 3.24.18)
 of 2020-06-12 built on kimr-laptop
Repository revision: 22f4fba8a903874ba63f8f479fa40b1dfe12850f
Repository branch: emacs-27
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Ubuntu 20.04 LTS

Recent messages:
Saving file /home/kimr/repos/e/emacs/lisp/progmodes/gud.el...
Wrote /home/kimr/repos/e/emacs/lisp/progmodes/gud.el
~/repos/e/emacs/lisp/progmodes 
Quit
Mark set [2 times]
Using try-expand-line
No further expansions found
No expansion found [5 times]
Quit
Mark set [5 times]

Configured using:
 'configure '--program-transform-name=s/^ctags$/ctags.emacs/'
 --with-file-notification=yes --with-imagemagick --with-modules
 --with-pdumper=yes --with-sound=yes --with-x-toolkit=yes --with-xml2
 --without-compress-install --with-gif=no --prefix
 /home/kimr/opt/emacs27/20200612 CFLAGS=-O3'

Configured features:
XPM JPEG TIFF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS PDUMPER LCMS2 GMP


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

* bug#41888: further explanation of the patch against gud.el
  2020-06-16  6:30 bug#41888: 27.0.91; fix ACTION argument of display-buffer Richard Kim
@ 2020-06-20 14:57 ` Richard Kim
  2020-06-27  7:41 ` bug#41888: 27.0.91; fix ACTION argument of display-buffer Eli Zaretskii
  2020-06-28  2:41 ` bug#41888: gdb does not work with spacemacs on emacs 27 Richard Kim
  2 siblings, 0 replies; 6+ messages in thread
From: Richard Kim @ 2020-06-20 14:57 UTC (permalink / raw)
  To: 41888

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

Let me explain my understanding of the problem and my rationale for the
patch I emailed to emacs list.

Emacs 27 has the following code in `gud.el' starting around line 2622:

,----
|      (display-buffer
|       (get-buffer-create (concat "*gud" filepart "*"))
|       '(display-buffer-reuse-window
|         display-buffer-in-previous-window
|         display-buffer-same-window display-buffer-pop-up-window))
`----

The patch I emailed to emacs list is to add extra pair of parenthesis
like this:

,----
|      (display-buffer
|       (get-buffer-create (concat "*gud" filepart "*"))
|       '((display-buffer-reuse-window
|          display-buffer-in-previous-window
|          display-buffer-same-window display-buffer-pop-up-window)))
`----

The change affects the second argument passed to `display-buffer'
function, i.e., the `ACTION' argument. The doc-string for this argument
is quoted here:

      Optional argument ACTION, if non-nil, should specify a
      buffer display action of the form (FUNCTIONS . ALIST).
      FUNCTIONS is either an "action function" or a possibly empty
      list of action functions. ALIST is a possibly empty "action
      alist".

The question is the syntax of `FUNCTIONS' portion of `ACTION' argument.
The doc-string clearly says that `FUNCITONS' is either a function or a
list of functions. If `FUNCTIONS' is a list such as `(f1 f2 f3)', then
`ACTION' should be something like `((f1 f2 f3))' assuming that `ALIST'
is `nil'. Well the list of functions is surrounded by two pairs of
parenthesis rather than one pair.

This observation along with the fact that adding the extra pair of
parenthesis allows me to launch `gdb' is the reason why I sent the patch
to emacs list.

[-- Attachment #2: Type: text/html, Size: 2041 bytes --]

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

* bug#41888: 27.0.91; fix ACTION argument of display-buffer
  2020-06-16  6:30 bug#41888: 27.0.91; fix ACTION argument of display-buffer Richard Kim
  2020-06-20 14:57 ` bug#41888: further explanation of the patch against gud.el Richard Kim
@ 2020-06-27  7:41 ` Eli Zaretskii
  2020-06-28  6:37   ` martin rudalics
  2020-06-28  2:41 ` bug#41888: gdb does not work with spacemacs on emacs 27 Richard Kim
  2 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2020-06-27  7:41 UTC (permalink / raw)
  To: emacs18, martin rudalics; +Cc: 41888

> From: Richard Kim <emacs18@gmail.com>
> Date: Mon, 15 Jun 2020 23:30:08 -0700
> 
> gud-common-init function in emacs 27 seems to have a bug in how it calls
> display-buffer. The second argument passed is ACTION. According to
> docstring of display-buffer, the list of functions need to be a list
> within a list. The attached patch adds the missing extra pair of
> parenthesis.

Martin, any comments or suggestions?





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

* bug#41888: gdb does not work with spacemacs on emacs 27
  2020-06-16  6:30 bug#41888: 27.0.91; fix ACTION argument of display-buffer Richard Kim
  2020-06-20 14:57 ` bug#41888: further explanation of the patch against gud.el Richard Kim
  2020-06-27  7:41 ` bug#41888: 27.0.91; fix ACTION argument of display-buffer Eli Zaretskii
@ 2020-06-28  2:41 ` Richard Kim
  2 siblings, 0 replies; 6+ messages in thread
From: Richard Kim @ 2020-06-28  2:41 UTC (permalink / raw)
  To: 41888

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

Without the patch I provided before, gdb fails to star on spacemacs as
reported via
https://github.com/syl20bnr/spacemacs/issues/13693

The root cause is that gdb problem is exposed when window-purpose package
is used.  For details see
https://github.com/bmag/emacs-purpose/issues/163

[-- Attachment #2: Type: text/html, Size: 515 bytes --]

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

* bug#41888: 27.0.91; fix ACTION argument of display-buffer
  2020-06-27  7:41 ` bug#41888: 27.0.91; fix ACTION argument of display-buffer Eli Zaretskii
@ 2020-06-28  6:37   ` martin rudalics
  2020-06-28 14:06     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: martin rudalics @ 2020-06-28  6:37 UTC (permalink / raw)
  To: Eli Zaretskii, emacs18; +Cc: 41888

 >> gud-common-init function in emacs 27 seems to have a bug in how it calls
 >> display-buffer. The second argument passed is ACTION. According to
 >> docstring of display-buffer, the list of functions need to be a list
 >> within a list. The attached patch adds the missing extra pair of
 >> parenthesis.
 >
 > Martin, any comments or suggestions?

I think that Richard is right and his patch will fix the problem.

martin





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

* bug#41888: 27.0.91; fix ACTION argument of display-buffer
  2020-06-28  6:37   ` martin rudalics
@ 2020-06-28 14:06     ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2020-06-28 14:06 UTC (permalink / raw)
  To: martin rudalics; +Cc: 41888-done, emacs18

> Cc: 41888@debbugs.gnu.org
> From: martin rudalics <rudalics@gmx.at>
> Date: Sun, 28 Jun 2020 08:37:56 +0200
> 
>  >> gud-common-init function in emacs 27 seems to have a bug in how it calls
>  >> display-buffer. The second argument passed is ACTION. According to
>  >> docstring of display-buffer, the list of functions need to be a list
>  >> within a list. The attached patch adds the missing extra pair of
>  >> parenthesis.
>  >
>  > Martin, any comments or suggestions?
> 
> I think that Richard is right and his patch will fix the problem.

Thanks, pushed to the emacs-27 branch.

Richard, in the future please accompany your changes with a
ChangeLog-style commit log message, as described in CONTRIBUTE.  (I
wrote the log message for you this time.)





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

end of thread, other threads:[~2020-06-28 14:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16  6:30 bug#41888: 27.0.91; fix ACTION argument of display-buffer Richard Kim
2020-06-20 14:57 ` bug#41888: further explanation of the patch against gud.el Richard Kim
2020-06-27  7:41 ` bug#41888: 27.0.91; fix ACTION argument of display-buffer Eli Zaretskii
2020-06-28  6:37   ` martin rudalics
2020-06-28 14:06     ` Eli Zaretskii
2020-06-28  2:41 ` bug#41888: gdb does not work with spacemacs on emacs 27 Richard Kim

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