unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32628: 26; Rename `window-setup-hook'
@ 2018-09-03 20:31 Drew Adams
  2018-09-04 21:41 ` Juri Linkov
  2022-01-29 15:26 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 9+ messages in thread
From: Drew Adams @ 2018-09-03 20:31 UTC (permalink / raw)
  To: 32628

The doc string even admits that this name is bad:

  (The name of this hook is due to historical reasons, and does not
   reflect its purpose very well.)

Why not rename it now, and deprecate the old name, aliasing it to the
new name?

What should the new name be?  Maybe something like
`after-set-frame-parameters-startup-hook'?

In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-30
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor `Microsoft Corp.', version 10.0.16299
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





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

* bug#32628: 26; Rename `window-setup-hook'
  2018-09-03 20:31 bug#32628: 26; Rename `window-setup-hook' Drew Adams
@ 2018-09-04 21:41 ` Juri Linkov
  2018-09-04 22:13   ` Drew Adams
  2022-01-29 15:26 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2018-09-04 21:41 UTC (permalink / raw)
  To: Drew Adams; +Cc: 32628

> The doc string even admits that this name is bad:
>
>   (The name of this hook is due to historical reasons, and does not
>    reflect its purpose very well.)
>
> Why not rename it now, and deprecate the old name, aliasing it to the
> new name?
>
> What should the new name be?  Maybe something like
> `after-set-frame-parameters-startup-hook'?

This is the clear winner of the contest for the longest hook name.





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

* bug#32628: 26; Rename `window-setup-hook'
  2018-09-04 21:41 ` Juri Linkov
@ 2018-09-04 22:13   ` Drew Adams
  2018-09-05 22:11     ` Juri Linkov
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2018-09-04 22:13 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 32628

> > What should the new name be?  Maybe something like
> > `after-set-frame-parameters-startup-hook'?
> 
> This is the clear winner of the contest for the longest hook name.

So far...  ;-)  Please suggest a good name.

I'm probably OK with nearly any name that tries to suggest what this is really for.

`*-startup-hook' makes sense, I think, given the context and the other `*-startup-hook'.

`after-*' is conventional.

Not sure how to shorten `set-frame-parameters', to get across what is done. Maybe `set-frame-params'?





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

* bug#32628: 26; Rename `window-setup-hook'
  2018-09-04 22:13   ` Drew Adams
@ 2018-09-05 22:11     ` Juri Linkov
  2018-09-05 22:35       ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2018-09-05 22:11 UTC (permalink / raw)
  To: Drew Adams; +Cc: 32628

>> > What should the new name be?  Maybe something like
>> > `after-set-frame-parameters-startup-hook'?
>> 
>> This is the clear winner of the contest for the longest hook name.
>
> So far...  ;-)  Please suggest a good name.
>
> I'm probably OK with nearly any name that tries to suggest what this is really for.
>
> `*-startup-hook' makes sense, I think, given the context and the other `*-startup-hook'.
>
> `after-*' is conventional.
>
> Not sure how to shorten `set-frame-parameters', to get across what is done. Maybe `set-frame-params'?

Looking at the existing hooks in startup.el:

before-init-hook
after-init-hook
emacs-startup-hook
term-setup-hook
inhibit-startup-hooks
window-setup-hook

maybe a better rename for window-setup-hook would be

after-init-frames-hook

or even

after-frames-setup-hook





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

* bug#32628: 26; Rename `window-setup-hook'
  2018-09-05 22:11     ` Juri Linkov
@ 2018-09-05 22:35       ` Drew Adams
  2018-09-06 21:44         ` Juri Linkov
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2018-09-05 22:35 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 32628

>> > `after-set-frame-parameters-startup-hook'
> > I'm probably OK with nearly any name that tries to suggest what this is really for.
>
> Looking at the existing hooks in startup.el:
> before-init-hook
> after-init-hook
> emacs-startup-hook
> term-setup-hook
> inhibit-startup-hooks
> window-setup-hook
> 
> maybe a better rename for window-setup-hook would be after-init-frames-hook
> or even after-frames-setup-hook

The frame settings involved are user settings; it's not about the init frame without user settings.

The latter name is OK: after-frames-setup-hook.





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

* bug#32628: 26; Rename `window-setup-hook'
  2018-09-05 22:35       ` Drew Adams
@ 2018-09-06 21:44         ` Juri Linkov
  2018-09-07  0:31           ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2018-09-06 21:44 UTC (permalink / raw)
  To: Drew Adams; +Cc: 32628

>>> > `after-set-frame-parameters-startup-hook'
>> > I'm probably OK with nearly any name that tries to suggest what this is really for.
>>
>> Looking at the existing hooks in startup.el:
>> before-init-hook
>> after-init-hook
>> emacs-startup-hook
>> term-setup-hook
>> inhibit-startup-hooks
>> window-setup-hook
>>
>> maybe a better rename for window-setup-hook would be after-init-frames-hook
>> or even after-frames-setup-hook
>
> The frame settings involved are user settings; it's not about the init frame without user settings.
>
> The latter name is OK: after-frames-setup-hook.

Actually the prefix after- implies there is its counterpart before- like in
before-init-hook and after-init-hook.  So we don't need the prefix after-,
that leaves just frames-setup-hook.  Is it better than window-setup-hook?





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

* bug#32628: 26; Rename `window-setup-hook'
  2018-09-06 21:44         ` Juri Linkov
@ 2018-09-07  0:31           ` Drew Adams
  2018-09-11 23:58             ` Juri Linkov
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2018-09-07  0:31 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 32628

> >> maybe a better rename for window-setup-hook would be after-init-frames-hook
> >> or even after-frames-setup-hook
> >
> > The frame settings involved are user settings; it's not about the init frame without user settings. The latter name is OK: after-frames-setup-hook.
> 
> Actually the prefix after- implies there is its counterpart before- 

I don't think it does.

> like in before-init-hook and after-init-hook. 

The existence of some such pairs doesn't at all suggest, let alone
imply, that either before or after must be paired with the other.

The point of before and after is to signify occurrence relative to
some other action/time.

There is after-change-major-mode-hook. No such before hook.
There is after-setting-font-mode-hook. No such before hook.
There is bookmark-after-jump-hook. No such before hook.
There is change-major-mode-after-body-hook. No such before hook.
There is dframe-after-select-attached-frame-hook. No such before hook.
There is ediff-after-quit-hook-internal. No such before hook. 
There is find-function-after-hook. No such before hook.
There is imenu-after-jump-hook. No such before hook.
There is input-method-after-insert-chunk-hook. No such before hook.
There is rmail-after-get-new-mail-hook. No such before hook.
There is speedbar-after-create-hook. No such before hook.

There is before-hack-local-variables-hook. No such after hook.
There is before-make-frame -hook. No such after hook.
There is ediff-before-setup-hook. No such after hook. 
There is speedbar-before-delete-hook. No such after hook. 
There is speedbar-before- popup-hook. No such after hook.
There is speedbar-before-visiting-file-hook. No such after hook.
There is speedbar-before-visiting-tag-hook. No such after hook.
There is vc-before-checkin-hook. No such after hook.

> So we don't need the prefix after-,

I think we do. Or rather, I think it helps.

> that leaves just frames-setup-hook.  Is it better than window-setup-hook?

I prefer after-frames-setup-hook. But I've already said that I'm probably OK with whatever you decide. I'm OK with it.





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

* bug#32628: 26; Rename `window-setup-hook'
  2018-09-07  0:31           ` Drew Adams
@ 2018-09-11 23:58             ` Juri Linkov
  0 siblings, 0 replies; 9+ messages in thread
From: Juri Linkov @ 2018-09-11 23:58 UTC (permalink / raw)
  To: Drew Adams; +Cc: 32628

> I prefer after-frames-setup-hook.

Not a bad name.  There is also the prefix post- used for some hooks
like post-command-hook, so post-frames-setup-hook is another variant.

It's difficult to choose a good name, but I agree that the current
window-setup-hook is misleading.  I guess it was meant to be named
window-system-setup-hook.





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

* bug#32628: 26; Rename `window-setup-hook'
  2018-09-03 20:31 bug#32628: 26; Rename `window-setup-hook' Drew Adams
  2018-09-04 21:41 ` Juri Linkov
@ 2022-01-29 15:26 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-29 15:26 UTC (permalink / raw)
  To: Drew Adams; +Cc: 32628

Drew Adams <drew.adams@oracle.com> writes:

> The doc string even admits that this name is bad:
>
>   (The name of this hook is due to historical reasons, and does not
>    reflect its purpose very well.)
>
> Why not rename it now, and deprecate the old name, aliasing it to the
> new name?

I think that would disconvenience users too much, so I don't think we
should do that, and I'm therefore closing this bug report.

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





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

end of thread, other threads:[~2022-01-29 15:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-03 20:31 bug#32628: 26; Rename `window-setup-hook' Drew Adams
2018-09-04 21:41 ` Juri Linkov
2018-09-04 22:13   ` Drew Adams
2018-09-05 22:11     ` Juri Linkov
2018-09-05 22:35       ` Drew Adams
2018-09-06 21:44         ` Juri Linkov
2018-09-07  0:31           ` Drew Adams
2018-09-11 23:58             ` Juri Linkov
2022-01-29 15:26 ` Lars Ingebrigtsen

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