all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#44107: set-window-dedicated-p: args should be marked as optional
@ 2020-10-20 22:55 Boruch Baum
  2020-10-21  0:13 ` Basil L. Contovounesios
  0 siblings, 1 reply; 6+ messages in thread
From: Boruch Baum @ 2020-10-20 22:55 UTC (permalink / raw)
  To: 44107

The definition for function `set-window-dedicated-p' indicates that its
two arguments are required, but the docstring indicates that the
arguments are optional. I haven't looked at the C source code, but my
testing indicates that the arguments really are optional, so the
description should mark them as such, ie.

  (set-window-dedicated-p &optional WINDOW FLAG)

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0





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

* bug#44107: set-window-dedicated-p: args should be marked as optional
  2020-10-20 22:55 bug#44107: set-window-dedicated-p: args should be marked as optional Boruch Baum
@ 2020-10-21  0:13 ` Basil L. Contovounesios
  2020-10-21  0:18   ` Boruch Baum
  0 siblings, 1 reply; 6+ messages in thread
From: Basil L. Contovounesios @ 2020-10-21  0:13 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 44107

Boruch Baum <boruch_baum@gmx.com> writes:

> The definition for function `set-window-dedicated-p' indicates that its
> two arguments are required, but the docstring indicates that the
> arguments are optional.

I assume you're referring to the following sentence:

  WINDOW must be a live window and defaults to the selected one.

The default case in question is when WINDOW is specified as nil.
Perhaps this could be made more explicit, but it's a pretty pervasive
idiom.

In other words, set-window-dedicated-p takes two positional arguments
and its docstring does not intentionally try to suggest otherwise.

> I haven't looked at the C source code, but my
> testing indicates that the arguments really are optional, so the
> description should mark them as such, ie.
>
>   (set-window-dedicated-p &optional WINDOW FLAG)

Could you please describe your testing in more detail?  Evaluating

  (set-window-dedicated-p)

gives me

  (wrong-number-of-arguments set-window-dedicated-p 0)

since at least as far back as Emacs 24.5, so I'm not sure how you
reached that conclusion.

Or are you suggesting that the function's arguments _be made_ optional,
since they are both allowed to be nil?  (A positional argument that can
be nil is not the same as an optional argument.)

-- 
Basil





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

* bug#44107: set-window-dedicated-p: args should be marked as optional
  2020-10-21  0:13 ` Basil L. Contovounesios
@ 2020-10-21  0:18   ` Boruch Baum
  2020-10-21  0:25     ` Basil L. Contovounesios
  0 siblings, 1 reply; 6+ messages in thread
From: Boruch Baum @ 2020-10-21  0:18 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 44107

On 2020-10-21 01:13, Basil L. Contovounesios wrote:
> Or are you suggesting that the function's arguments _be made_ optional,
> since they are both allowed to be nil?  (A positional argument that can
> be nil is not the same as an optional argument.)

Yes, I see I was unclear about that. They should be made optional since
both may be nil.

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0





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

* bug#44107: set-window-dedicated-p: args should be marked as optional
  2020-10-21  0:18   ` Boruch Baum
@ 2020-10-21  0:25     ` Basil L. Contovounesios
  2020-10-21  0:47       ` Boruch Baum
  0 siblings, 1 reply; 6+ messages in thread
From: Basil L. Contovounesios @ 2020-10-21  0:25 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 44107

Boruch Baum <boruch_baum@gmx.com> writes:

> On 2020-10-21 01:13, Basil L. Contovounesios wrote:
>> Or are you suggesting that the function's arguments _be made_ optional,
>> since they are both allowed to be nil?  (A positional argument that can
>> be nil is not the same as an optional argument.)
>
> Yes, I see I was unclear about that. They should be made optional since
> both may be nil.

I don't think that would make sense, since

  (set-window-dedicated-p nil nil)

undedicates the selected window, but if I saw its (proposed) equivalent

  (set-window-dedicated-p)

I'd think the opposite.

-- 
Basil





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

* bug#44107: set-window-dedicated-p: args should be marked as optional
  2020-10-21  0:25     ` Basil L. Contovounesios
@ 2020-10-21  0:47       ` Boruch Baum
  2020-10-21  8:28         ` Basil L. Contovounesios
  0 siblings, 1 reply; 6+ messages in thread
From: Boruch Baum @ 2020-10-21  0:47 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 44107

On 2020-10-21 01:25, Basil L. Contovounesios wrote:
> Boruch Baum <boruch_baum@gmx.com> writes:
>
> > On 2020-10-21 01:13, Basil L. Contovounesios wrote:
> >> Or are you suggesting that the function's arguments _be made_ optional,
> >> since they are both allowed to be nil?  (A positional argument that can
> >> be nil is not the same as an optional argument.)
> >
> > Yes, I see I was unclear about that. They should be made optional since
> > both may be nil.
>
> I don't think that would make sense, since
>
>   (set-window-dedicated-p nil nil)
>
> undedicates the selected window, but if I saw its (proposed) equivalent
>
>   (set-window-dedicated-p)
>
> I'd think the opposite.

Good point. And since WINDOW is sequentially the first arg, it alone
can't be optional. Unless you or someone else has a better idea then,
this report should be closed.

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0





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

* bug#44107: set-window-dedicated-p: args should be marked as optional
  2020-10-21  0:47       ` Boruch Baum
@ 2020-10-21  8:28         ` Basil L. Contovounesios
  0 siblings, 0 replies; 6+ messages in thread
From: Basil L. Contovounesios @ 2020-10-21  8:28 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 44107-done

tags 44107 wontfix
close 44107
quit

Boruch Baum <boruch_baum@gmx.com> writes:

> Good point. And since WINDOW is sequentially the first arg, it alone
> can't be optional. Unless you or someone else has a better idea then,
> this report should be closed.

Thanks, I'll close it for now then.  If someone comes up with a better
idea we can just reopen it.

-- 
Basil





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

end of thread, other threads:[~2020-10-21  8:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-20 22:55 bug#44107: set-window-dedicated-p: args should be marked as optional Boruch Baum
2020-10-21  0:13 ` Basil L. Contovounesios
2020-10-21  0:18   ` Boruch Baum
2020-10-21  0:25     ` Basil L. Contovounesios
2020-10-21  0:47       ` Boruch Baum
2020-10-21  8:28         ` Basil L. Contovounesios

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.