all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Has something changed in the autoload mechanism in Emacs 29?
@ 2024-07-25  2:05 Pierre Rouleau
  2024-07-25 18:38 ` Michael Heerdegen via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre Rouleau @ 2024-07-25  2:05 UTC (permalink / raw)
  To: help-gnu-emacs

 Hi all,

I stumbled upon a behaviour that is surprising to me when using something I
wrote in my
PEL system ( https://github.com/pierre-rouleau/pel) :  the autoloading of
the PEL functions
fails for at least one function (a non-interactive one) and when I use
`describe-symbol` on
the name of that function, the help buffer shows information identifying
that function as
being implemented in the wrong file.

This is the first time I noticed this.  I assume something must be wrong in
my code,
but I've used it on emacs 26, 27, 28 on various computers without any
problem.

My system probably differs from others in the way it starts:
- My ~/.emacs.d/init.el only hold some basic logic that must be located
there
   but does not activate the packages I used, for the most part;
   that job is done by my pel-init function which then checks user options
   and activates the features requested by it.

The pel-init() function has the following code:

(unless (fboundp 'pel-build)
  ;; autoload all PEL functions
  (require 'pel-autoload)
  (if (fboundp 'pel--autoload-init)
      (pel--autoload-init)))

The 'pel-build symbol is normally not bound, that's only used for testing.

The pel--autoload-init function, located inside the pel-autuload.el file,
has the following:
(defmacro pel-autoload-function (fname for: &rest functions)
  "Schedule the autoloading of FNAME for specified FUNCTIONS.

Argument FOR: just a required separator keyword to make code look better."
  (declare (indent 2))
  (ignore for:)
  (if (> (length functions) 1)
      `(dolist (fct (quote (,@functions)))
         (autoload fct ,fname))
    `(autoload (quote ,@functions) ,fname)))

(defmacro pel-autoload (fname for: &rest functions)
  "Schedule the autoloading of FNAME for specified interactive FUNCTIONS.

Argument FOR: just a required separator keyword to make code look better."
  (declare (indent 2))
  (ignore for:)
  (if (> (length functions) 1)
      `(dolist (fct (quote (,@functions)))
         (autoload fct ,fname nil :interactive))
    `(autoload (quote ,@functions) ,fname nil :interactive)))

And then the definition of pel--autoload-init which schedules the
autoloading
of the PEL functions explicitly with the above macros:

It start with this:

(defun pel--autoload-init ()
  "Intialize the PEL system -- prepare automatic loading of all function."

  (require 'pel--options)

And then has several blocks like the following:

  (pel-autoload "pel-abbrev" for:
    pel-ispell-word-then-abbrev
    pel-abbrev-info)

  (pel-autoload "pel-align" for:
    pel-newline-and-indent-below
    pel-align-info
    pel-toggle-newline-indent-align
    pel-multi-align-regexp)

  (when (eq system-type 'darwin)
    (pel-autoload "pel-applescript" for:
      pel-pel-say-word
      pel-say-sentence
      pel-say-paragraph
      pel-say-region
      pel-say
      pel-say-words)
    (pel-autoload-function "pel-applescript" for:
      pel-run-applescript))

These all work, but one does not seem to work:

  (pel-autoload-function "pel-ffind" for:
    pel-ffind
    pel-generic-find-file)

The pel--find is found in the right file, but not pel-generic-find-file.

It registers as if it was defined in the pel_keys.el file where pel-init()
is defined:
the *help* message displays :
  pel-generic-find-file is an autoloaded byte-compiled Lisp function in
  ‘pel_keys.el’.
And this is wrong.
The rest of the help is correct.  It shows the function signature and the
correct docstring.
 Note I byte-compile *all* my code.  I have a make file that does that.

Does anyone have ideas as to where I should be looking?

Thanks (and sorry for the long description).


-- 
/Pierre


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

end of thread, other threads:[~2024-08-06  1:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25  2:05 Has something changed in the autoload mechanism in Emacs 29? Pierre Rouleau
2024-07-25 18:38 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-07-25 19:21   ` Pierre Rouleau
2024-07-26 11:59     ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-07-26 14:07       ` Pierre Rouleau
2024-07-26 15:59         ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-08-05 23:16           ` Pierre Rouleau
2024-08-06  1:25             ` Michael Heerdegen via Users list for the GNU Emacs text editor

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.