Skip to content

Remove fboundp checks for functions found in Emacs 28.2#922

Merged
matsl merged 30 commits intomasterfrom
pr_remove_old_not_needed_stuff
Mar 29, 2026
Merged

Remove fboundp checks for functions found in Emacs 28.2#922
matsl merged 30 commits intomasterfrom
pr_remove_old_not_needed_stuff

Conversation

@matsl
Copy link
Copy Markdown
Collaborator

@matsl matsl commented Mar 28, 2026

What

Remove code and checks not needed now since we only support Emacs 28.2
going forward.

  • Remove defalias of display-color-p
  • Use repeat-mode, defined since Emacs 28.1
  • Use button-at, defined in Emacs before version 28
  • Use macroexp-file-name, defined since Emacs 28.1
  • Use dired-do-flagged-delete, defined since before Emacs 28
  • Use current-time-zone, defined in Emacs 25.1
  • Use last, defined before Emacs 28
  • Use make-directory, defined since Emacs 19.34
  • Always use split-window-vertically
  • Remove XEmacs functions, don't check for Emacs functions
  • Use window-edges
  • Use text-scale-increase and text-scale-decrease
  • Use use-region-p, defined since Emacs 23.1
  • locate-data-file is not an Emacs function
  • Do not use none Emacs functions
  • Use vc-print-root-log, defined since Emacs 24.1
  • Use locate-dominating-file, defined before Emacs 28
  • Use get-text-property and gnus-article-press-button
  • Use outline-minor-mode, defined since Emacs 19.1
  • Use mouse-drag-frame-move, defined since Emacs 28
  • Use frame-list-z-order, defined since Emacs 26.1
  • Use find-library, defined since Emacs 25.2
  • Use find-function-noselect, defined before Emacs 28
  • Use reveal-hide-revealed, defined since Emacs 28.1
  • Use reveal-auto-hide, defined since Emacs 28.1
  • locate-data-file is not an Emacs function
  • Use mail-fetch-field, defined before Emacs 28

Why

Not needed fboundp checks makes the code harder to read and
understand.

Since we require at least Emacs 28.2 we can safely drop checking for
functions that has been defined since then and for checking for and
calling functions that was never part of Emacs 28.2 or even never was
part of Emacs. The later due to historical support for XEmacs.

Note

Each change is in its own commit so it is easy to remove if review
tells my analysis it wrong. The trickiest cases are a few for symbols
that are not pre- or autoloaded but is used in a context where it must
have been loaded.

To help the review see this gist
where each symbol is checked in Emacs 28.2 for fboundp, preload, and
autoload. The docstring is also there which for some symbols tell when
it was introduced.

Text in square brackets with the form [Comment: ...] is additional
info added by me.

@matsl matsl requested a review from rswgnu March 28, 2026 17:40
matsl added 27 commits March 28, 2026 22:03
display-color-p has been defined since Emacs 21.1.

* hproperty.el: Remove defalias of display-color-p, defined since
Emacs 21.1
* hsys-flymake.el (flymake-mode-hook): Use repeat-mode, defined since
Emacs 28.1.
* hui-mouse.el (hkey-alist): Use button-at, defined in Emacs before
version 28.
* hyperbole.el: Use macroexp-file-name, defined since Emacs 28.1.
Used in smart-dired where dired must have been loaded.

* hui-mouse.el (smart-dired): Use dired-do-flagged-delete, defined
since before Emacs 28.
* htz.el (htz:zone-to-hour): Use current-time-zone, defined in Emacs 25.1
* hui-window.el (assist-key-modeline-click-left-edge): Use last,
defined before Emacs 28.
* hinit.el (hyperb:check-dir-user): Use make-directory, defined since
Emacs 19.34.
The preferred function split-window-quietly is admittedly mentioned in the
Emacs Lisp Intro and can be found at archives in the file slowsplit.el.
Implemented 1989.  Questionable if it relevant today.  Having it as a
preferred alternative seems confusing.

* hui-window.el (hmouse-horizontal-action-drag): Use split-window-vertically.
Info-global-next and Info-global-prev is not Emacs functions but in XEmacs.

mouse-event-p and Info-mouse-follow-link is defined before Emacs 28.

* hmouse-info.el (smart-info): Use Info-next and mouse-event-p.
(smart-info-assist): Use Info-prev and mouse-event-p.
C source code function defined long before Emacs 28

* hui-window.el (smart-coords-in-window-p): Use window-edges, defined
before Emacs 28.
Functions have been in Emacs since before Emacs 28 and is used elsewhere
without fboundp guard.

* hycontrol.el (hycontrol-windows-mode-map): Use text-scale-increase
and text-scale-decrease.
* hui-select.el (hui-select-thing): Use use-region-p, defined since
Emacs 23.1.
The function comes likely from old XEmacs supports since it is defined in
XEmacs.

* hypb.el (hypb:hkey-help-file): Do not check for locate-data-file, it
is not an Emacs function.
Remove use of compiled-function-interactive and
compiled-function-arglist. Not Emacs functions. Comes from XEmacs.

* hact.el (action:commandp): Do not use compiled-function-interactive.
(action:params): Do not use compiled-function-arglist. Not Emacs
functions.
* hib-social.el (git-reference): Use vc-print-root-log, defined since
Emacs 24.1.
* hib-social.el (hibtypes-git-find): Use locate-dominating-file,
defined before Emacs 28.
Defined at least since Emacs 28.

Text property 'gnus-callback ensures gnus is loaded.

* hibtypes.el (gnus-push-button): Use get-text-property and
gnus-article-press-button.
* hmoccur.el (moccur):
* hui.el (hui:ebut-search): Use outline-minor-mode, defined since Emacs 19.1.
* hmouse-drv.el (mouse-drag-mode-line): Use mouse-drag-frame-move,
defined since Emacs 28.
* hmouse-drv.el (hmouse-window-at-absolute-pixel-position): Use
frame-list-z-order, defined since Emacs 26.1.
* hmouse-tag.el (smart-lisp):
(smart-lisp-at-known-identifier-p): Use find-library, defined since Emacs 25.2.
* hmouse-tag.el (smart-lisp-find-tag):
(smart-lisp-at-known-identifier-p): Use find-function-noselect,
defined before Emacs 28.
Used in hyrolo after requiring reveal.

* hyrolo.el (reveal-hide-revealed): Use reveal-hide-revealed, defined
since Emacs 28.1.
Used in hyrolo after requiring reveal.

* hyrolo.el (reveal-auto-hide): Use reveal-auto-hide, defined since
Emacs 28.1.
The function comes likely from old XEmacs supports since it is defined in
XEmacs.

* hypb.el (hypb:insert-hyperbole-banner): Do not check for
locate-data-file, not an Emacs function.
* hyrolo.el (hyrolo-add): Use mail-fetch-field, defined before Emacs
28.
@matsl matsl force-pushed the pr_remove_old_not_needed_stuff branch from 27bd622 to 57769b4 Compare March 28, 2026 21:03
@matsl matsl changed the title pr remove old not needed stuff Remove fboundp checks for functions found in Emacs 28.2 Mar 29, 2026
@matsl matsl merged commit ad03aff into master Mar 29, 2026
4 checks passed
@matsl matsl deleted the pr_remove_old_not_needed_stuff branch March 29, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants