Discussion:
bug#25552: 26.0.50; load cl unintendedly
Glenn Morris
2017-01-30 22:35:02 UTC
Permalink
The real (and apparently long-standing) bug here is that

emacs -Q -l mh-e

loads cl.
Glenn Morris
2017-01-31 22:39:45 UTC
Permalink
Post by Glenn Morris
emacs -Q -l mh-e
loads cl.
This seems to fix it for me, though I do not use mh-e and so cannot test
it properly.

--- i/lisp/mh-e/mh-compat.el
+++ w/lisp/mh-e/mh-compat.el
@@ -40,7 +40,7 @@
;; Items are listed alphabetically (except for mh-require which is
;; needed sooner it would normally appear).

-(require 'mh-acros)
+(eval-when-compile (require 'mh-acros))

(mh-do-in-gnu-emacs
(defalias 'mh-require 'require))
@@ -374,7 +374,6 @@ mh-write-file-functions
(provide 'mh-compat)

;; Local Variables:
-;; no-byte-compile: t
;; indent-tabs-mode: nil
;; sentence-end-double-space: nil
;; End:
Katsumi Yamaoka
2017-02-01 01:09:05 UTC
Permalink
Hi mh-e developers,

Please refer to this bug thread beginning with:
<http://lists.gnu.org/archive/html/bug-gnu-emacs/2017-01/msg00997.html>
Post by Glenn Morris
Post by Glenn Morris
emacs -Q -l mh-e
loads cl.
This seems to fix it for me, though I do not use mh-e and so cannot test
it properly.
I cannot test it since I'm not an mh-e user, too, but the patch
(attached below) looks reasonable. Though I think it is no more
than a workaround (a better way would probably be to replace cl
runtime functions with something), it will help Emacs people.
I kindly ask for your consideration.

Thanks in advance.
Regards,
Mike Kupfer
2017-02-01 04:02:20 UTC
Permalink
Hi Katsumi and Glenn, I applied Glenn's patch to 25.1.90, and I'm afraid
that it introduced a failure. When I tried to compose an email,
pressing the space key in the subject line got me

Debugger entered--Lisp error: (wrong-type-argument syntax-table-p nil)
set-syntax-table(nil)
mh-beginning-of-word()
mh-letter-complete-or-space(1)
funcall-interactively(mh-letter-complete-or-space 1)
call-interactively(mh-letter-complete-or-space nil nil)
command-execute(mh-letter-complete-or-space)

I vaguely recall there was some reason for not compiling mh-acros.el,
but I don't remember the specifics. I'll look into this some more when
I have more time (this Thursday).

regards,
mike
n***@users.sourceforge.net
2017-02-01 13:51:05 UTC
Permalink
Post by Mike Kupfer
Hi Katsumi and Glenn, I applied Glenn's patch to 25.1.90, and I'm afraid
that it introduced a failure. When I tried to compose an email,
pressing the space key in the subject line got me
Debugger entered--Lisp error: (wrong-type-argument syntax-table-p nil)
set-syntax-table(nil)
mh-beginning-of-word()
mh-letter-complete-or-space(1)
funcall-interactively(mh-letter-complete-or-space 1)
call-interactively(mh-letter-complete-or-space nil nil)
command-execute(mh-letter-complete-or-space)
I vaguely recall there was some reason for not compiling mh-acros.el,
but I don't remember the specifics. I'll look into this some more when
I have more time (this Thursday).
I guess it's because defun-mh checks whether the alias target is fbound
at compile time:

(defmacro defun-mh (name function arg-list &rest body)
"Create function NAME.
If FUNCTION exists, then NAME becomes an alias for FUNCTION.
Otherwise, create function NAME with ARG-LIST and BODY."
(let ((defined-p (fboundp function)))
(if defined-p
`(defalias ',name ',function)
`(defun ,name ,arg-list ,@body))))

It would be better to check at runtime:

(defmacro defun-mh (name function arg-list &rest body)
`(if (fboundp ',function)
(defalias ',name ',function)
(defun ,name ,arg-list ,@body)))

And/or require `mail-abbrev' at compile time

--- i/lisp/mh-e/mh-compat.el
+++ w/lisp/mh-e/mh-compat.el
@@ -260,7 +260,7 @@ 'mh-line-end-position
'line-end-position
'point-at-eol))

-(mh-require 'mailabbrev nil t)
+(eval-and-compile (mh-require 'mailabbrev nil t))
(defun-mh mh-mail-abbrev-make-syntax-table
mail-abbrev-make-syntax-table ()
"Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
Mike Kupfer
2017-02-03 02:05:55 UTC
Permalink
Post by n***@users.sourceforge.net
Post by Mike Kupfer
Hi Katsumi and Glenn, I applied Glenn's patch to 25.1.90, and I'm afraid
that it introduced a failure.
[...]
Post by n***@users.sourceforge.net
I guess it's because defun-mh checks whether the alias target is fbound
(defmacro defun-mh (name function arg-list &rest body)
"Create function NAME.
If FUNCTION exists, then NAME becomes an alias for FUNCTION.
Otherwise, create function NAME with ARG-LIST and BODY."
(let ((defined-p (fboundp function)))
(if defined-p
`(defalias ',name ',function)
(defmacro defun-mh (name function arg-list &rest body)
`(if (fboundp ',function)
(defalias ',name ',function)
And/or require `mail-abbrev' at compile time
--- i/lisp/mh-e/mh-compat.el
+++ w/lisp/mh-e/mh-compat.el
@@ -260,7 +260,7 @@ 'mh-line-end-position
'line-end-position
'point-at-eol))
-(mh-require 'mailabbrev nil t)
+(eval-and-compile (mh-require 'mailabbrev nil t))
(defun-mh mh-mail-abbrev-make-syntax-table
mail-abbrev-make-syntax-table ()
"Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
Thanks, Noam!

I did some light testing of Noam's change to defun-mh plus Glenn's
patch. The problem that I reported is gone, and I haven't seen any
other issues. I did the testing with both Emacs 25.1.90 and master
(7cb7a58).

Does anyone on the MH-E dev team have any concerns about this
combination of changes?

mike
Jeffrey Honig
2017-02-03 02:21:22 UTC
Permalink
Bill should weigh in on this change, he did extensive work in this area.

Thanks

Jeff
--
Jeffrey C. Honig <***@honig.net>
http://jch.honig.net
GnuPG ID:14E29E13 <http://jch.honig.net/Home/pgp_key>
Keybase: jchonig <https://keybase.io/jchonig>
Post by Mike Kupfer
Post by n***@users.sourceforge.net
Post by Mike Kupfer
Hi Katsumi and Glenn, I applied Glenn's patch to 25.1.90, and I'm
afraid
Post by n***@users.sourceforge.net
Post by Mike Kupfer
that it introduced a failure.
[...]
Post by n***@users.sourceforge.net
I guess it's because defun-mh checks whether the alias target is fbound
(defmacro defun-mh (name function arg-list &rest body)
"Create function NAME.
If FUNCTION exists, then NAME becomes an alias for FUNCTION.
Otherwise, create function NAME with ARG-LIST and BODY."
(let ((defined-p (fboundp function)))
(if defined-p
`(defalias ',name ',function)
(defmacro defun-mh (name function arg-list &rest body)
`(if (fboundp ',function)
(defalias ',name ',function)
And/or require `mail-abbrev' at compile time
--- i/lisp/mh-e/mh-compat.el
+++ w/lisp/mh-e/mh-compat.el
@@ -260,7 +260,7 @@ 'mh-line-end-position
'line-end-position
'point-at-eol))
-(mh-require 'mailabbrev nil t)
+(eval-and-compile (mh-require 'mailabbrev nil t))
(defun-mh mh-mail-abbrev-make-syntax-table
mail-abbrev-make-syntax-table ()
"Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
Thanks, Noam!
I did some light testing of Noam's change to defun-mh plus Glenn's
patch. The problem that I reported is gone, and I haven't seen any
other issues. I did the testing with both Emacs 25.1.90 and master
(7cb7a58).
Does anyone on the MH-E dev team have any concerns about this
combination of changes?
mike
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mh-e-devel mailing list
https://lists.sourceforge.net/lists/listinfo/mh-e-devel
Bill Wohler
2017-02-03 06:30:57 UTC
Permalink
I don't have any objections if it runs on all supported versions of
Emacs that we support (a conversation we should probably have again
since we've had an Emacs release).

I'm happy to say we support the version of Emacs in Debian stable, which
is 24 and is what I'm running. I'll test the patch this weekend and reply.

Jeff, in the past, you ran the oldest version. What are you running now?
If it's older than 24 or 25, can you please test this patch as well?
Post by Jeffrey Honig
Bill should weigh in on this change, he did extensive work in this area.
Thanks
Jeff
--
http://jch.honig.net
GnuPG ID:14E29E13
Keybase: jchonig
Post by n***@users.sourceforge.net
Post by Mike Kupfer
Hi Katsumi and Glenn, I applied Glenn's patch to 25.1.90, and I'm afraid
that it introduced a failure.
[...]
Post by n***@users.sourceforge.net
I guess it's because defun-mh checks whether the alias target is fbound
     (defmacro defun-mh (name function arg-list &rest body)
       "Create function NAME.
     If FUNCTION exists, then NAME becomes an alias for FUNCTION.
     Otherwise, create function NAME with ARG-LIST and BODY."
       (let ((defined-p (fboundp function)))
         (if defined-p
             `(defalias ',name ',function)
     (defmacro defun-mh (name function arg-list &rest body)
       `(if (fboundp ',function)
            (defalias ',name ',function)
And/or require `mail-abbrev' at compile time
--- i/lisp/mh-e/mh-compat.el
+++ w/lisp/mh-e/mh-compat.el
@@ -260,7 +260,7 @@ 'mh-line-end-position
        'line-end-position
      'point-at-eol))
-(mh-require 'mailabbrev nil t)
+(eval-and-compile (mh-require 'mailabbrev nil t))
  (defun-mh mh-mail-abbrev-make-syntax-table
    mail-abbrev-make-syntax-table ()
    "Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
Thanks, Noam!
I did some light testing of Noam's change to defun-mh plus Glenn's
patch.  The problem that I reported is gone, and I haven't seen any
other issues.  I did the testing with both Emacs 25.1.90 and master
(7cb7a58).
Does anyone on the MH-E dev team have any concerns about this
combination of changes?
mike
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mh-e-devel mailing list
https://lists.sourceforge.net/lists/listinfo/mh-e-devel
----------------------------------------------------
----------------------------------------------------
--
Bill Wohler <***@newt.com> aka <***@nasa.gov>
http://www.newt.com/wohler/
GnuPG ID:610BD9AD
Jeffrey Honig
2017-02-06 01:25:35 UTC
Permalink
Post by Bill Wohler
Jeff, in the past, you ran the oldest version. What are you running now?
If it's older than 24 or 25, can you please test this patch as well?
I'm on 25 and occasionally build and run master.

Thanks

Jeff
--
Jeffrey C. Honig <***@honig.net>
http://jch.honig.net
GnuPG ID:14E29E13 <http://jch.honig.net/Home/pgp_key>
Keybase: jchonig <https://keybase.io/jchonig>
Glenn Morris
2017-02-06 02:03:40 UTC
Permalink
Post by Bill Wohler
I don't have any objections if it runs on all supported versions of
Emacs that we support (a conversation we should probably have again
since we've had an Emacs release).
I'm happy to say we support the version of Emacs in Debian stable, which
is 24 and is what I'm running. I'll test the patch this weekend and reply.
I see that Debian stable ships Emacs 24.4, which includes cl-lib (so
does 24.3, which is 4 years old). It's fine to load cl-lib at runtime.
So if you were willing to make a larger change (cl to cl-lib), you can
have code which is simpler going forwards (no need for mh-require-cl etc).
cl-lib is also available from elpa.gnu.org for Emacs older than 24.3.

Separate from the above:
i) I think all uses of mh-require should be placed within eval-and-compile
(the compiler does this automatically for plain "require", but does not
know to do it for mh-require).

ii) If you make that defun-mh change, I'm guessing there will no longer
be a need for mh-gnus to be no-byte-compile.
n***@users.sourceforge.net
2017-04-09 12:01:12 UTC
Permalink
Ping?
Post by Mike Kupfer
I did some light testing of Noam's change to defun-mh plus Glenn's
patch. The problem that I reported is gone, and I haven't seen any
other issues. I did the testing with both Emacs 25.1.90 and master
(7cb7a58).
Does anyone on the MH-E dev team have any concerns about this
combination of changes?
Bill should weigh in on this change, he did extensive work in this area.
I don't have any objections if it runs on all supported versions of
Emacs that we support (a conversation we should probably have again
since we've had an Emacs release).
I'm happy to say we support the version of Emacs in Debian stable, which
is 24 and is what I'm running. I'll test the patch this weekend and reply.
Jeff, in the past, you ran the oldest version. What are you running now?
If it's older than 24 or 25, can you please test this patch as well?
I'm on 25 and occasionally build and run master.
Mike Kupfer
2017-04-09 14:25:46 UTC
Permalink
Ping?
MH-E has an internal test suite that I've been meaning to try with the 2
patches, but I've been distracted with other things like getting the
family taxes done. I'll try to get that done before the end of the
week. Sorry about the delay.

I'm confused by Bill Wohler's statement about supported versions of
Emacs. I thought we had switched to just supporting the current Emacs
version, rather than doing a separate MH-E release that supports
multiple Emacs versions. I'll follow up with Bill about that.

mike
Mike Kupfer
2017-04-09 14:37:16 UTC
Permalink
'Morning, Bill. Noam pinged me this morning about this issue. To
refresh your memory: we have 2 patches that make the cl problem go away
and don't seem to introduce other issues, but they haven't gotten a lot
of testing. I told Noam that I want to run the patches through the MH-E
test suite and that I'll try get that done this week.

You raised the issue of whether the patches work with multiple Emacs
versions. Are we good on that? I confess I'm confused by the
question--I thought we had moved to just trying to support the Emacs
version that MH-E is bundled with (i.e., whatever's the current
version). Did I misunderstand?

mike
Bill Wohler
2017-04-09 15:13:56 UTC
Permalink
Post by Mike Kupfer
'Morning, Bill. Noam pinged me this morning about this issue. To
refresh your memory: we have 2 patches that make the cl problem go away
and don't seem to introduce other issues, but they haven't gotten a lot
of testing. I told Noam that I want to run the patches through the MH-E
test suite and that I'll try get that done this week.
You raised the issue of whether the patches work with multiple Emacs
versions. Are we good on that? I confess I'm confused by the
question--I thought we had moved to just trying to support the Emacs
version that MH-E is bundled with (i.e., whatever's the current
version). Did I misunderstand?
Here was the first message of that discussion:

Message-ID: <***@olgas.newt.com>

It's not clear that there was a consensus since there were only two
replies. But if you're on board, let's make it so.
Post by Mike Kupfer
mike
--
Bill Wohler <***@newt.com> aka <***@nasa.gov>
http://www.newt.com/wohler/
GnuPG ID:610BD9AD
Mike Kupfer
2017-04-14 01:30:13 UTC
Permalink
Post by Mike Kupfer
MH-E has an internal test suite that I've been meaning to try with the 2
patches, but I've been distracted with other things like getting the
family taxes done. I'll try to get that done before the end of the
week.
Done. The 2 patches do not introduce any problems with the internal
tests.
Post by Mike Kupfer
I thought we had switched to just supporting the current Emacs
version, rather than doing a separate MH-E release that supports
multiple Emacs versions.
Yes, I've confirmed with Bill Wohler that that's what we're doing.

I'm happy for either you or Glenn to push those patches, but I can do it
if you prefer (probably next week sometime).

Oh, and to close the loop with some suggestions that Glenn made back in
February (e.g., use cl-lib instead of cl)... I do plan to look into
those suggestions, but I don't know how long it will take me. So fixing
the immediate cl problem now seems to me like a good thing.

cheers,
mike
Bill Wohler
2017-04-14 04:15:59 UTC
Permalink
Post by Mike Kupfer
Post by Mike Kupfer
MH-E has an internal test suite that I've been meaning to try with the 2
patches, but I've been distracted with other things like getting the
family taxes done. I'll try to get that done before the end of the
week.
Done. The 2 patches do not introduce any problems with the internal
tests.
Post by Mike Kupfer
I thought we had switched to just supporting the current Emacs
version, rather than doing a separate MH-E release that supports
multiple Emacs versions.
Yes, I've confirmed with Bill Wohler that that's what we're doing.
I'm happy for either you or Glenn to push those patches, but I can do it
if you prefer (probably next week sometime).
Thanks very much, Mike. Much appreciated!
Post by Mike Kupfer
Oh, and to close the loop with some suggestions that Glenn made back in
February (e.g., use cl-lib instead of cl)... I do plan to look into
those suggestions, but I don't know how long it will take me. So fixing
the immediate cl problem now seems to me like a good thing.
cheers,
mike
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mh-e-devel mailing list
https://lists.sourceforge.net/lists/listinfo/mh-e-devel
--
Bill Wohler <***@newt.com> aka <***@nasa.gov>
http://www.newt.com/wohler/
GnuPG ID:610BD9AD
Noam Postavsky
2017-04-14 14:36:02 UTC
Permalink
Post by Mike Kupfer
Post by Mike Kupfer
I thought we had switched to just supporting the current Emacs
version, rather than doing a separate MH-E release that supports
multiple Emacs versions.
Yes, I've confirmed with Bill Wohler that that's what we're doing.
I'm happy for either you or Glenn to push those patches, but I can do it
if you prefer (probably next week sometime).
Oh, and to close the loop with some suggestions that Glenn made back in
February (e.g., use cl-lib instead of cl)... I do plan to look into
those suggestions, but I don't know how long it will take me. So fixing
the immediate cl problem now seems to me like a good thing.
That all sounds fine, push at your convenience, there's no special urgency.
Bill Wohler
2017-05-01 05:10:40 UTC
Permalink
Post by Noam Postavsky
Post by Mike Kupfer
Post by Mike Kupfer
I thought we had switched to just supporting the current Emacs
version, rather than doing a separate MH-E release that supports
multiple Emacs versions.
Yes, I've confirmed with Bill Wohler that that's what we're doing.
I'm happy for either you or Glenn to push those patches, but I can do it
if you prefer (probably next week sometime).
Oh, and to close the loop with some suggestions that Glenn made back in
February (e.g., use cl-lib instead of cl)... I do plan to look into
those suggestions, but I don't know how long it will take me. So fixing
the immediate cl problem now seems to me like a good thing.
That all sounds fine, push at your convenience, there's no special urgency.
I tested what I think we have so far (appended) and haven't noticed
anything amiss. Please push what you have at your convenience, as I
don't think I see it on master yet.

I tried to add eval-and-compile to mailabbrev, but got the following
compilation error:

mh-e/mh-compat.el:263:1:Error: Symbol’s function definition is void: mh-require
--
Bill Wohler <***@newt.com> aka <***@nasa.gov>
http://www.newt.com/wohler/
GnuPG ID:610BD9AD
n***@users.sourceforge.net
2017-05-01 13:03:55 UTC
Permalink
Post by Bill Wohler
I tried to add eval-and-compile to mailabbrev, but got the following
mh-e/mh-compat.el:263:1:Error: Symbol’s function definition is void: mh-require
Oh, you need to wrap the mh-require definition in eval-and-compile as well.

(eval-and-compile
(mh-do-in-gnu-emacs
(defalias 'mh-require 'require))
...
Glenn Morris
2017-04-14 17:05:45 UTC
Permalink
Post by Mike Kupfer
Post by Mike Kupfer
I thought we had switched to just supporting the current Emacs
version, rather than doing a separate MH-E release that supports
multiple Emacs versions.
Yes, I've confirmed with Bill Wohler that that's what we're doing.
So just to give you another thing to think about... :)

Is it then worth it to retain a separate mh-e repository, or does it
just make more work? Eg Gnus abandoned its standalone repo in favour of
the Emacs one.

PS Regardless of the above it would also be nice to get the tests you
referred to into the test/ directory in the Emacs repo.
Bill Wohler
2017-04-15 18:17:39 UTC
Permalink
Post by Glenn Morris
Post by Mike Kupfer
Post by Mike Kupfer
I thought we had switched to just supporting the current Emacs
version, rather than doing a separate MH-E release that supports
multiple Emacs versions.
Yes, I've confirmed with Bill Wohler that that's what we're doing.
So just to give you another thing to think about... :)
Any time!
Post by Glenn Morris
Is it then worth it to retain a separate mh-e repository, or does it
just make more work? Eg Gnus abandoned its standalone repo in favour of
the Emacs one.
There's a couple of scripts that can probably be moved to a new
admin/mh-e directory.

There are files for XEmacs and Debian. Those could probably be retired.

However, we also maintain the files for http://mh-e.sourceforge.net/. I
don't see the files for http://www.gnus.org in the Emacs repository.
Post by Glenn Morris
PS Regardless of the above it would also be nice to get the tests you
referred to into the test/ directory in the Emacs repo.
No objection.
--
Bill Wohler <***@newt.com> aka <***@nasa.gov>
http://www.newt.com/wohler/
GnuPG ID:610BD9AD
Mike Kupfer
2017-05-01 13:43:16 UTC
Permalink
Post by Bill Wohler
I tested what I think we have so far (appended) and haven't noticed
anything amiss. Please push what you have at your convenience, as I
don't think I see it on master yet.
Yeah, I haven't quite found the time to finish this off. If I don't get
to it today, it's on my calendar for Thursday.

mike

Loading...