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

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

bug#41888: further explanation of the patch against gud.el


From: Richard Kim
Subject: bug#41888: further explanation of the patch against gud.el
Date: Sat, 20 Jun 2020 07:57:53 -0700

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.

reply via email to

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