Gnus development mailing list
 help / color / mirror / Atom feed
* problem with (display . [not expire]) with git emacs
@ 2024-01-31 20:10 Dan Christensen
  2024-01-31 23:41 ` Dan Christensen
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Christensen @ 2024-01-31 20:10 UTC (permalink / raw)
  To: ding

I'm using Gnus with git emacs, and noticed that since commit 8525be6d
from Nov 29, 2023 (see below), Gnus isn't honouring my group parameter

  (display . [not expire])

I used the debugger to find that there is an error involving
byte-compilation.  The top of the debug output contains:

Debugger entered--returning value: "Malformed function ‘#[0 \"\\301\\300!\\207\" [expire gnus-article-marked-p] 2]’"
  format-message("Malformed function `%S'" #f(compiled-function () #<bytecode 0x1980828eb86e>))
* #f(compiled-function (form env extend func forms) #<bytecode 0x11fbce68545d80cf>)(((#f(compiled-function () #<bytecode 0x1980828eb86e>))) (nil) (nil) #f(compiled-function () #<bytecode 0x1980828eb86e>) nil)

and an earlier call that could probably be used to reproduce this is:

* gnus-summary-display-make-predicate((not expire))

The full stack trace is below, as is the text of the commit.

Can anyone else using git emacs more recent than Nov 29 tell me
whether (display . [not expire]) is working for them?  Note that
(display . [expire]) *does* seem to work correctly.

If we determine that it's not just a quirk in my set-up, I could move
this discussion to an emacs list, but I thought I would start here.

Dan


The commit that is causing trouble is:

commit 8525be6d5eca0c75008ec1dc799cae537156feea (HEAD, refs/bisect/bad)
Author: Mattias Engdegård <mattiase@acm.org>
Date:   Wed Nov 29 17:51:46 2023 +0100

    Move malformed-function warning from byte-opt to cconv (bug#67483)
    
    We shouldn't be warning inside the optimiser in the first place.
    
    * lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
    Remove byte-compile-form-stack manipulation.
    (byte-optimize-form-code-walker): Move malformed function warning
    from here...
    * lisp/emacs-lisp/cconv.el: ...to here.

The backtrace:

Debugger entered--returning value: "Malformed function ‘#[0 \"\\301\\300!\\207\" [expire gnus-article-marked-p] 2]’"
  format-message("Malformed function `%S'" #f(compiled-function () #<bytecode 0x1980828eb86e>))
* #f(compiled-function (form env extend func forms) #<bytecode 0x11fbce68545d80cf>)(((#f(compiled-function () #<bytecode 0x1980828eb86e>))) (nil) (nil) #f(compiled-function () #<bytecode 0x1980828eb86e>) nil)
* cconv-convert((#f(compiled-function () #<bytecode 0x1980828eb86e>)) nil nil)
* #f(compiled-function (form) #<bytecode 0x17f2bb4623db6b39>)((#f(compiled-function () #<bytecode 0x1980828eb86e>)))
* mapcar(#f(compiled-function (form) #<bytecode 0x17f2bb4623db6b39>) ((#f(compiled-function () #<bytecode 0x1980828eb86e>))))
* #f(compiled-function (form env extend func forms) #<bytecode 0x11fbce68545d80cf>)(((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) (nil) (nil) not ((#f(compiled-function () #<bytecode 0x1980828eb86e>))))
* cconv-convert((not (#f(compiled-function () #<bytecode 0x1980828eb86e>))) nil nil)
* #f(compiled-function (form) #<bytecode 0x428b1114056ca6a>)((not (#f(compiled-function () #<bytecode 0x1980828eb86e>))))
* mapcar(#f(compiled-function (form) #<bytecode 0x428b1114056ca6a>) ((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
* cconv--convert-funcbody(nil ((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil #'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
* cconv--convert-function(nil ((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil #'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil)
* cconv-convert(#'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil nil)
* cconv-closure-convert(#'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil)
* byte-compile-preprocess((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
* #f(compiled-function (form) #<bytecode 0x1493bc771fcd2c44>)((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
* byte-compile((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
* gnus-byte-compile((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
* gnus-category-make-function((not expire))
* gnus-get-predicate((not expire))
* gnus-summary-display-make-predicate((not expire))
* (cond ((not (= 0 (or (car-safe read-all) 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons (let ((tmp ...)) (if (> tmp 0) tmp 1)) (cdr (gethash group gnus-active-hashtb))))) nil) (t nil))
* (setq gnus-newsgroup-display (cond ((not (= 0 (or (car-safe read-all) 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons (let (...) (if ... tmp 1)) (cdr (gethash group gnus-active-hashtb))))) nil) (t nil)))
  (let ((display (gnus-group-find-parameter group 'display))) (debug) (setq gnus-newsgroup-display (cond ((not (= 0 (or (car-safe read-all) 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons (let ... ...) (cdr ...)))) nil) (t nil))))
  (let* ((entry (gethash group gnus-newsrc-hashtb)) (gnus-summary-ignore-duplicates (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual) t gnus-summary-ignore-duplicates)) (info (nth 1 entry)) articles fetched-articles cached) (if (gnus-check-server (set (make-local-variable 'gnus-current-select-method) (gnus-find-method-for-group group))) nil (error "Couldn't open server")) (or (and entry (not (eq (car entry) t))) (gnus-activate-group group) (progn (if (derived-mode-p 'gnus-summary-mode) (progn (gnus-kill-buffer (current-buffer)))) (error "Couldn't activate group %s: %s" group (gnus-status-message group)))) (if (gnus-request-group group t nil info) nil (if (derived-mode-p 'gnus-summary-mode) (progn (gnus-kill-buffer (current-buffer)))) (error "Couldn't request group %s: %s" group (gnus-status-message group))) (if (and gnus-agent (gethash group gnus-active-hashtb)) (progn (gnus-agent-possibly-alter-active group (gethash group gnus-active-hashtb) info) (setq gnus-summary-use-undownloaded-faces (gnus-agent-find-parameter group 'agent-enable-undownloaded-faces)))) (progn (setq gnus-newsgroup-name group) (setq gnus-newsgroup-unselected nil) (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group))) (let ((display (gnus-group-find-parameter group 'display))) (debug) (setq gnus-newsgroup-display (cond ((not (= 0 (or ... 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons ... ...))) nil) (t nil)))) (gnus-summary-setup-default-charset) (if (gnus-virtual-group-p group) (progn (setq cached gnus-newsgroup-cached))) (setq gnus-newsgroup-unreads (gnus-sorted-ndifference (gnus-sorted-ndifference gnus-newsgroup-unreads gnus-newsgroup-marked) gnus-newsgroup-dormant)) (setq gnus-newsgroup-processable nil) (gnus-update-read-articles group gnus-newsgroup-unreads t) (if info (progn (gnus-adjust-marked-articles info))) (if (setq articles select-articles) (setq gnus-newsgroup-unselected (gnus-sorted-difference gnus-newsgroup-unreads articles)) (setq articles (gnus-articles-to-read group read-all))) (cond ((null articles) 'quit) ((eq articles 0) nil) (t (setq gnus-newsgroup-dependencies (gnus-make-hashtable (length articles))) (if (gnus-buffer-live-p gnus-group-buffer) (gnus-set-global-variables) (set-default 'gnus-newsgroup-name gnus-newsgroup-name)) (setq gnus-newsgroup-headers (gnus-fetch-headers articles)) (if cached (progn (setq gnus-newsgroup-cached cached))) (if gnus-suppress-duplicates (progn (gnus-dup-suppress-articles))) (setq gnus-newsgroup-limit (copy-sequence articles)) (setq fetched-articles (mapcar #'mail-header-number gnus-newsgroup-headers)) (setq gnus-newsgroup-articles fetched-articles) (setq gnus-newsgroup-unreads (gnus-sorted-nintersection gnus-newsgroup-unreads fetched-articles)) (gnus-compute-unseen-list) (gnus-update-missing-marks (gnus-sorted-difference articles fetched-articles)) (if (and gnus-fetch-old-headers (eq gnus-headers-retrieved-by 'nov)) (progn (if (eq gnus-fetch-old-headers 'invisible) (gnus-build-all-threads) (gnus-build-old-threads)))) (if gnus-agent (progn (gnus-agent-get-undownloaded-list))) (gnus-summary-remove-list-identifiers) (setq gnus-newsgroup-auto-expire (and (gnus-group-auto-expirable-p group) (not (gnus-group-read-only-p group)))) (if (and gnus-single-article-buffer (equal gnus-article-buffer "*Article*")) nil (gnus-article-setup-buffer)) (if gnus-newsgroup-headers (progn (progn (setq gnus-newsgroup-begin (let* ... ...)) (setq gnus-newsgroup-end (let* ... ...))))) (or gnus-newsgroup-headers t))))
  gnus-select-newsgroup("nnimap+rocky:INBOX" 9 nil)
  gnus-summary-read-group-1("nnimap+rocky:INBOX" 9 t nil nil nil)
  gnus-summary-read-group("nnimap+rocky:INBOX" 9 t nil nil nil nil)
  gnus-group-read-group(9 t "nnimap+rocky:INBOX")
  jdc-gnus-group-select-inbox(9)
  funcall-interactively(jdc-gnus-group-select-inbox 9)
  call-interactively(jdc-gnus-group-select-inbox nil nil)
  command-execute(jdc-gnus-group-select-inbox)



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

* Re: problem with (display . [not expire]) with git emacs
  2024-01-31 20:10 problem with (display . [not expire]) with git emacs Dan Christensen
@ 2024-01-31 23:41 ` Dan Christensen
  2024-02-01 22:29   ` Eric Abrahamsen
  2024-02-01 22:33   ` Eric Abrahamsen
  0 siblings, 2 replies; 7+ messages in thread
From: Dan Christensen @ 2024-01-31 23:41 UTC (permalink / raw)
  To: ding

Two additional things.  First, I should have said that Gnus does not
raise an error.  It just silently ignores my [not expire] setting.

Second, here is a link to the relevant commit, which shows the diff:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8525be6d5eca0c75008ec1dc799cae537156feea

Is anyone else using git emacs since Nov 29 and also using (display
. [not expire])?

Dan

On Jan 31, 2024, Dan Christensen <jdc@uwo.ca> wrote:

> I'm using Gnus with git emacs, and noticed that since commit 8525be6d
> from Nov 29, 2023 (see below), Gnus isn't honouring my group parameter
>
>   (display . [not expire])
>
> I used the debugger to find that there is an error involving
> byte-compilation.  The top of the debug output contains:
>
> Debugger entered--returning value: "Malformed function ‘#[0 \"\\301\\300!\\207\" [expire gnus-article-marked-p] 2]’"
>   format-message("Malformed function `%S'" #f(compiled-function () #<bytecode 0x1980828eb86e>))
> * #f(compiled-function (form env extend func forms) #<bytecode 0x11fbce68545d80cf>)(((#f(compiled-function () #<bytecode 0x1980828eb86e>))) (nil) (nil) #f(compiled-function () #<bytecode 0x1980828eb86e>) nil)
>
> and an earlier call that could probably be used to reproduce this is:
>
> * gnus-summary-display-make-predicate((not expire))
>
> The full stack trace is below, as is the text of the commit.
>
> Can anyone else using git emacs more recent than Nov 29 tell me
> whether (display . [not expire]) is working for them?  Note that
> (display . [expire]) *does* seem to work correctly.
>
> If we determine that it's not just a quirk in my set-up, I could move
> this discussion to an emacs list, but I thought I would start here.
>
> Dan
>
> The commit that is causing trouble is:
>
> commit 8525be6d5eca0c75008ec1dc799cae537156feea (HEAD, refs/bisect/bad)
> Author: Mattias Engdegård <mattiase@acm.org>
> Date:   Wed Nov 29 17:51:46 2023 +0100
>
>     Move malformed-function warning from byte-opt to cconv (bug#67483)
>
>     We shouldn't be warning inside the optimiser in the first place.
>
>     * lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
>     Remove byte-compile-form-stack manipulation.
>     (byte-optimize-form-code-walker): Move malformed function warning
>     from here...
>     * lisp/emacs-lisp/cconv.el: ...to here.
>
> The backtrace:
>
> Debugger entered--returning value: "Malformed function ‘#[0 \"\\301\\300!\\207\" [expire gnus-article-marked-p] 2]’"
>   format-message("Malformed function `%S'" #f(compiled-function () #<bytecode 0x1980828eb86e>))
> * #f(compiled-function (form env extend func forms) #<bytecode 0x11fbce68545d80cf>)(((#f(compiled-function () #<bytecode 0x1980828eb86e>))) (nil) (nil) #f(compiled-function () #<bytecode 0x1980828eb86e>) nil)
> * cconv-convert((#f(compiled-function () #<bytecode 0x1980828eb86e>)) nil nil)
> * #f(compiled-function (form) #<bytecode 0x17f2bb4623db6b39>)((#f(compiled-function () #<bytecode 0x1980828eb86e>)))
> * mapcar(#f(compiled-function (form) #<bytecode 0x17f2bb4623db6b39>) ((#f(compiled-function () #<bytecode 0x1980828eb86e>))))
> * #f(compiled-function (form env extend func forms) #<bytecode 0x11fbce68545d80cf>)(((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) (nil) (nil) not ((#f(compiled-function () #<bytecode 0x1980828eb86e>))))
> * cconv-convert((not (#f(compiled-function () #<bytecode 0x1980828eb86e>))) nil nil)
> * #f(compiled-function (form) #<bytecode 0x428b1114056ca6a>)((not (#f(compiled-function () #<bytecode 0x1980828eb86e>))))
> * mapcar(#f(compiled-function (form) #<bytecode 0x428b1114056ca6a>) ((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
> * cconv--convert-funcbody(nil ((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil #'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
> * cconv--convert-function(nil ((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil #'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil)
> * cconv-convert(#'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil nil)
> * cconv-closure-convert(#'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil)
> * byte-compile-preprocess((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
> * #f(compiled-function (form) #<bytecode 0x1493bc771fcd2c44>)((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
> * byte-compile((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
> * gnus-byte-compile((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
> * gnus-category-make-function((not expire))
> * gnus-get-predicate((not expire))
> * gnus-summary-display-make-predicate((not expire))
> * (cond ((not (= 0 (or (car-safe read-all) 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons (let ((tmp ...)) (if (> tmp 0) tmp 1)) (cdr (gethash group gnus-active-hashtb))))) nil) (t nil))
> * (setq gnus-newsgroup-display (cond ((not (= 0 (or (car-safe read-all) 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons (let (...) (if ... tmp 1)) (cdr (gethash group gnus-active-hashtb))))) nil) (t nil)))
>   (let ((display (gnus-group-find-parameter group 'display))) (debug) (setq gnus-newsgroup-display (cond ((not (= 0 (or (car-safe read-all) 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons (let ... ...) (cdr ...)))) nil) (t nil))))
>   (let* ((entry (gethash group gnus-newsrc-hashtb)) (gnus-summary-ignore-duplicates (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual) t gnus-summary-ignore-duplicates)) (info (nth 1 entry)) articles fetched-articles cached) (if (gnus-check-server (set (make-local-variable 'gnus-current-select-method) (gnus-find-method-for-group group))) nil (error "Couldn't open server")) (or (and entry (not (eq (car entry) t))) (gnus-activate-group group) (progn (if (derived-mode-p 'gnus-summary-mode) (progn (gnus-kill-buffer (current-buffer)))) (error "Couldn't activate group %s: %s" group (gnus-status-message group)))) (if (gnus-request-group group t nil info) nil (if (derived-mode-p 'gnus-summary-mode) (progn (gnus-kill-buffer (current-buffer)))) (error "Couldn't request group %s: %s" group (gnus-status-message group))) (if (and gnus-agent (gethash group gnus-active-hashtb)) (progn (gnus-agent-possibly-alter-active group (gethash group gnus-active-hashtb) info) (setq gnus-summary-use-undownloaded-faces (gnus-agent-find-parameter group 'agent-enable-undownloaded-faces)))) (progn (setq gnus-newsgroup-name group) (setq gnus-newsgroup-unselected nil) (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group))) (let ((display (gnus-group-find-parameter group 'display))) (debug) (setq gnus-newsgroup-display (cond ((not (= 0 (or ... 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons ... ...))) nil) (t nil)))) (gnus-summary-setup-default-charset) (if (gnus-virtual-group-p group) (progn (setq cached gnus-newsgroup-cached))) (setq gnus-newsgroup-unreads (gnus-sorted-ndifference (gnus-sorted-ndifference gnus-newsgroup-unreads gnus-newsgroup-marked) gnus-newsgroup-dormant)) (setq gnus-newsgroup-processable nil) (gnus-update-read-articles group gnus-newsgroup-unreads t) (if info (progn (gnus-adjust-marked-articles info))) (if (setq articles select-articles) (setq gnus-newsgroup-unselected (gnus-sorted-difference gnus-newsgroup-unreads articles)) (setq articles (gnus-articles-to-read group read-all))) (cond ((null articles) 'quit) ((eq articles 0) nil) (t (setq gnus-newsgroup-dependencies (gnus-make-hashtable (length articles))) (if (gnus-buffer-live-p gnus-group-buffer) (gnus-set-global-variables) (set-default 'gnus-newsgroup-name gnus-newsgroup-name)) (setq gnus-newsgroup-headers (gnus-fetch-headers articles)) (if cached (progn (setq gnus-newsgroup-cached cached))) (if gnus-suppress-duplicates (progn (gnus-dup-suppress-articles))) (setq gnus-newsgroup-limit (copy-sequence articles)) (setq fetched-articles (mapcar #'mail-header-number gnus-newsgroup-headers)) (setq gnus-newsgroup-articles fetched-articles) (setq gnus-newsgroup-unreads (gnus-sorted-nintersection gnus-newsgroup-unreads fetched-articles)) (gnus-compute-unseen-list) (gnus-update-missing-marks (gnus-sorted-difference articles fetched-articles)) (if (and gnus-fetch-old-headers (eq gnus-headers-retrieved-by 'nov)) (progn (if (eq gnus-fetch-old-headers 'invisible) (gnus-build-all-threads) (gnus-build-old-threads)))) (if gnus-agent (progn (gnus-agent-get-undownloaded-list))) (gnus-summary-remove-list-identifiers) (setq gnus-newsgroup-auto-expire (and (gnus-group-auto-expirable-p group) (not (gnus-group-read-only-p group)))) (if (and gnus-single-article-buffer (equal gnus-article-buffer "*Article*")) nil (gnus-article-setup-buffer)) (if gnus-newsgroup-headers (progn (progn (setq gnus-newsgroup-begin (let* ... ...)) (setq gnus-newsgroup-end (let* ... ...))))) (or gnus-newsgroup-headers t))))
>   gnus-select-newsgroup("nnimap+rocky:INBOX" 9 nil)
>   gnus-summary-read-group-1("nnimap+rocky:INBOX" 9 t nil nil nil)
>   gnus-summary-read-group("nnimap+rocky:INBOX" 9 t nil nil nil nil)
>   gnus-group-read-group(9 t "nnimap+rocky:INBOX")
>   jdc-gnus-group-select-inbox(9)
>   funcall-interactively(jdc-gnus-group-select-inbox 9)
>   call-interactively(jdc-gnus-group-select-inbox nil nil)
>   command-execute(jdc-gnus-group-select-inbox)



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

* Re: problem with (display . [not expire]) with git emacs
  2024-01-31 23:41 ` Dan Christensen
@ 2024-02-01 22:29   ` Eric Abrahamsen
  2024-02-02 14:58     ` Dan Christensen
  2024-02-01 22:33   ` Eric Abrahamsen
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Abrahamsen @ 2024-02-01 22:29 UTC (permalink / raw)
  To: ding

Dan Christensen <jdc@uwo.ca> writes:

> Two additional things.  First, I should have said that Gnus does not
> raise an error.  It just silently ignores my [not expire] setting.
>
> Second, here is a link to the relevant commit, which shows the diff:
>
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8525be6d5eca0c75008ec1dc799cae537156feea
>
> Is anyone else using git emacs since Nov 29 and also using (display
> . [not expire])?

I just tried it out, and actually got a popup buffer with the "Malformed
function" error you mentioned in your first message.

Looks like the culprit is effectively this:

(gnus-byte-compile
  `(lambda ()
    ,(cdr (assoc 'expire gnus-summary-display-cache))))

That's pretty much what `gnus-category-make-function' is doing, given
that at that point `gnus-category-predicate-alist' has been let-bound to
the value of `gnus-summary-display-cache'. I don't see where that
variable gets all its values, but one of its elements is:

(expire . #f(compiled-function () #<bytecode 0xc27be483>))

And apparently that's what is barfing when it gets byte compiled.
Weirdly, after fooling around with it a bit, the bytecode there must
have gotten "fixed" somehow, and the display parameter stopped giving me
an error (and started working correctly). Dunno what's happening there.

Eric



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

* Re: problem with (display . [not expire]) with git emacs
  2024-01-31 23:41 ` Dan Christensen
  2024-02-01 22:29   ` Eric Abrahamsen
@ 2024-02-01 22:33   ` Eric Abrahamsen
  1 sibling, 0 replies; 7+ messages in thread
From: Eric Abrahamsen @ 2024-02-01 22:33 UTC (permalink / raw)
  To: ding

Dan Christensen <jdc@uwo.ca> writes:

> Two additional things.  First, I should have said that Gnus does not
> raise an error.  It just silently ignores my [not expire] setting.
>
> Second, here is a link to the relevant commit, which shows the diff:
>
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8525be6d5eca0c75008ec1dc799cae537156feea
>
> Is anyone else using git emacs since Nov 29 and also using (display
> . [not expire])?
>
> Dan
>
> On Jan 31, 2024, Dan Christensen <jdc@uwo.ca> wrote:
>
>> I'm using Gnus with git emacs, and noticed that since commit 8525be6d
>> from Nov 29, 2023 (see below), Gnus isn't honouring my group parameter
>>
>>   (display . [not expire])
>>
>> I used the debugger to find that there is an error involving
>> byte-compilation.  The top of the debug output contains:
>>
>> Debugger entered--returning value: "Malformed function ‘#[0 \"\\301\\300!\\207\" [expire gnus-article-marked-p] 2]’"
>>   format-message("Malformed function `%S'" #f(compiled-function () #<bytecode 0x1980828eb86e>))
>> * #f(compiled-function (form env extend func forms) #<bytecode 0x11fbce68545d80cf>)(((#f(compiled-function () #<bytecode 0x1980828eb86e>))) (nil) (nil) #f(compiled-function () #<bytecode 0x1980828eb86e>) nil)
>>
>> and an earlier call that could probably be used to reproduce this is:
>>
>> * gnus-summary-display-make-predicate((not expire))
>>
>> The full stack trace is below, as is the text of the commit.
>>
>> Can anyone else using git emacs more recent than Nov 29 tell me
>> whether (display . [not expire]) is working for them?  Note that
>> (display . [expire]) *does* seem to work correctly.
>>
>> If we determine that it's not just a quirk in my set-up, I could move
>> this discussion to an emacs list, but I thought I would start here.
>>
>> Dan
>>
>> The commit that is causing trouble is:
>>
>> commit 8525be6d5eca0c75008ec1dc799cae537156feea (HEAD, refs/bisect/bad)
>> Author: Mattias Engdegård <mattiase@acm.org>
>> Date:   Wed Nov 29 17:51:46 2023 +0100
>>
>>     Move malformed-function warning from byte-opt to cconv (bug#67483)
>>
>>     We shouldn't be warning inside the optimiser in the first place.
>>
>>     * lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
>>     Remove byte-compile-form-stack manipulation.
>>     (byte-optimize-form-code-walker): Move malformed function warning
>>     from here...
>>     * lisp/emacs-lisp/cconv.el: ...to here.
>>
>> The backtrace:
>>
>> Debugger entered--returning value: "Malformed function ‘#[0 \"\\301\\300!\\207\" [expire gnus-article-marked-p] 2]’"
>>   format-message("Malformed function `%S'" #f(compiled-function () #<bytecode 0x1980828eb86e>))
>> * #f(compiled-function (form env extend func forms) #<bytecode 0x11fbce68545d80cf>)(((#f(compiled-function () #<bytecode 0x1980828eb86e>))) (nil) (nil) #f(compiled-function () #<bytecode 0x1980828eb86e>) nil)
>> * cconv-convert((#f(compiled-function () #<bytecode 0x1980828eb86e>)) nil nil)
>> * #f(compiled-function (form) #<bytecode 0x17f2bb4623db6b39>)((#f(compiled-function () #<bytecode 0x1980828eb86e>)))
>> * mapcar(#f(compiled-function (form) #<bytecode 0x17f2bb4623db6b39>) ((#f(compiled-function () #<bytecode 0x1980828eb86e>))))
>> * #f(compiled-function (form env extend func forms) #<bytecode 0x11fbce68545d80cf>)(((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) (nil) (nil) not ((#f(compiled-function () #<bytecode 0x1980828eb86e>))))
>> * cconv-convert((not (#f(compiled-function () #<bytecode 0x1980828eb86e>))) nil nil)
>> * #f(compiled-function (form) #<bytecode 0x428b1114056ca6a>)((not (#f(compiled-function () #<bytecode 0x1980828eb86e>))))
>> * mapcar(#f(compiled-function (form) #<bytecode 0x428b1114056ca6a>) ((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
>> * cconv--convert-funcbody(nil ((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil #'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
>> * cconv--convert-function(nil ((not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil #'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil)
>> * cconv-convert(#'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil nil)
>> * cconv-closure-convert(#'(lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))) nil)
>> * byte-compile-preprocess((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
>> * #f(compiled-function (form) #<bytecode 0x1493bc771fcd2c44>)((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
>> * byte-compile((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
>> * gnus-byte-compile((lambda nil (not (#f(compiled-function () #<bytecode 0x1980828eb86e>)))))
>> * gnus-category-make-function((not expire))
>> * gnus-get-predicate((not expire))
>> * gnus-summary-display-make-predicate((not expire))
>> * (cond ((not (= 0 (or (car-safe read-all) 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons (let ((tmp ...)) (if (> tmp 0) tmp 1)) (cdr (gethash group gnus-active-hashtb))))) nil) (t nil))
>> * (setq gnus-newsgroup-display (cond ((not (= 0 (or (car-safe read-all) 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons (let (...) (if ... tmp 1)) (cdr (gethash group gnus-active-hashtb))))) nil) (t nil)))
>>   (let ((display (gnus-group-find-parameter group 'display))) (debug) (setq gnus-newsgroup-display (cond ((not (= 0 (or (car-safe read-all) 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons (let ... ...) (cdr ...)))) nil) (t nil))))
>>   (let* ((entry (gethash group gnus-newsrc-hashtb)) (gnus-summary-ignore-duplicates (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual) t gnus-summary-ignore-duplicates)) (info (nth 1 entry)) articles fetched-articles cached) (if (gnus-check-server (set (make-local-variable 'gnus-current-select-method) (gnus-find-method-for-group group))) nil (error "Couldn't open server")) (or (and entry (not (eq (car entry) t))) (gnus-activate-group group) (progn (if (derived-mode-p 'gnus-summary-mode) (progn (gnus-kill-buffer (current-buffer)))) (error "Couldn't activate group %s: %s" group (gnus-status-message group)))) (if (gnus-request-group group t nil info) nil (if (derived-mode-p 'gnus-summary-mode) (progn (gnus-kill-buffer (current-buffer)))) (error "Couldn't request group %s: %s" group (gnus-status-message group))) (if (and gnus-agent (gethash group gnus-active-hashtb)) (progn (gnus-agent-possibly-alter-active group (gethash group gnus-active-hashtb) info) (setq gnus-summary-use-undownloaded-faces (gnus-agent-find-parameter group 'agent-enable-undownloaded-faces)))) (progn (setq gnus-newsgroup-name group) (setq gnus-newsgroup-unselected nil) (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group))) (let ((display (gnus-group-find-parameter group 'display))) (debug) (setq gnus-newsgroup-display (cond ((not (= 0 (or ... 0))) #'gnus-not-ignore) ((eq display 'all) #'gnus-not-ignore) ((arrayp display) (gnus-summary-display-make-predicate (mapcar #'identity display))) ((numberp display) (setq select-articles (range-uncompress (cons ... ...))) nil) (t nil)))) (gnus-summary-setup-default-charset) (if (gnus-virtual-group-p group) (progn (setq cached gnus-newsgroup-cached))) (setq gnus-newsgroup-unreads (gnus-sorted-ndifference (gnus-sorted-ndifference gnus-newsgroup-unreads gnus-newsgroup-marked) gnus-newsgroup-dormant)) (setq gnus-newsgroup-processable nil) (gnus-update-read-articles group gnus-newsgroup-unreads t) (if info (progn (gnus-adjust-marked-articles info))) (if (setq articles select-articles) (setq gnus-newsgroup-unselected (gnus-sorted-difference gnus-newsgroup-unreads articles)) (setq articles (gnus-articles-to-read group read-all))) (cond ((null articles) 'quit) ((eq articles 0) nil) (t (setq gnus-newsgroup-dependencies (gnus-make-hashtable (length articles))) (if (gnus-buffer-live-p gnus-group-buffer) (gnus-set-global-variables) (set-default 'gnus-newsgroup-name gnus-newsgroup-name)) (setq gnus-newsgroup-headers (gnus-fetch-headers articles)) (if cached (progn (setq gnus-newsgroup-cached cached))) (if gnus-suppress-duplicates (progn (gnus-dup-suppress-articles))) (setq gnus-newsgroup-limit (copy-sequence articles)) (setq fetched-articles (mapcar #'mail-header-number gnus-newsgroup-headers)) (setq gnus-newsgroup-articles fetched-articles) (setq gnus-newsgroup-unreads (gnus-sorted-nintersection gnus-newsgroup-unreads fetched-articles)) (gnus-compute-unseen-list) (gnus-update-missing-marks (gnus-sorted-difference articles fetched-articles)) (if (and gnus-fetch-old-headers (eq gnus-headers-retrieved-by 'nov)) (progn (if (eq gnus-fetch-old-headers 'invisible) (gnus-build-all-threads) (gnus-build-old-threads)))) (if gnus-agent (progn (gnus-agent-get-undownloaded-list))) (gnus-summary-remove-list-identifiers) (setq gnus-newsgroup-auto-expire (and (gnus-group-auto-expirable-p group) (not (gnus-group-read-only-p group)))) (if (and gnus-single-article-buffer (equal gnus-article-buffer "*Article*")) nil (gnus-article-setup-buffer)) (if gnus-newsgroup-headers (progn (progn (setq gnus-newsgroup-begin (let* ... ...)) (setq gnus-newsgroup-end (let* ... ...))))) (or gnus-newsgroup-headers t))))
>>   gnus-select-newsgroup("nnimap+rocky:INBOX" 9 nil)
>>   gnus-summary-read-group-1("nnimap+rocky:INBOX" 9 t nil nil nil)
>>   gnus-summary-read-group("nnimap+rocky:INBOX" 9 t nil nil nil nil)
>>   gnus-group-read-group(9 t "nnimap+rocky:INBOX")
>>   jdc-gnus-group-select-inbox(9)
>>   funcall-interactively(jdc-gnus-group-select-inbox 9)
>>   call-interactively(jdc-gnus-group-select-inbox nil nil)
>>   command-execute(jdc-gnus-group-select-inbox)

Oh, of course, here's where the function cache comes from:

  (unless gnus-summary-display-cache
    (dolist (elem (append '((unread . unread)
			    (read . read)
			    (unseen . unseen))
			  gnus-article-mark-lists))
      (push (cons (cdr elem)
                  (let ((x (cdr elem)))
		    (lambda () (gnus-article-marked-p x))))
	    gnus-summary-display-cache)))

So the bytecode is for (lambda () (gnus-article-marked-p 'expire)).



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

* Re: problem with (display . [not expire]) with git emacs
  2024-02-01 22:29   ` Eric Abrahamsen
@ 2024-02-02 14:58     ` Dan Christensen
  2024-02-05 13:47       ` Dan Christensen
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Christensen @ 2024-02-02 14:58 UTC (permalink / raw)
  To: ding

On Feb  1, 2024, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:

> I just tried it out, and actually got a popup buffer with the "Malformed
> function" error you mentioned in your first message.

Glad to hear that it's not just me.  I wish I could get that pop-up as
well, or that I could make emacs enter the debugger when this happens.
It would be easier to figure out that way.  Any idea why we would have
different behaviour here?

> Looks like the culprit is effectively this:
>
> (gnus-byte-compile
>   `(lambda ()
>     ,(cdr (assoc 'expire gnus-summary-display-cache))))

I think it's like that but with '(not expire).  When the predicate
is a single symbol, it looks like this code skips byte compilation:

    (if (and (= (length func) 1)
	     (symbolp (car func)))
	(car func)
      (gnus-byte-compile `(lambda () ,func)))))

(But I'm not sure how (display . expire) results in a *list* of length
one.)  Can you confirm that you don't get the error with (display . expire)?

Do you think the issue is that we're trying to byte-compile an already
compiled function?  Do you think the commit I referenced introduces a
bug, or that it reveals an existing bug in Gnus?  Do you suggest that
I post to an emacs devel list, or can we fix it here?

Dan



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

* Re: problem with (display . [not expire]) with git emacs
  2024-02-02 14:58     ` Dan Christensen
@ 2024-02-05 13:47       ` Dan Christensen
  2024-02-05 15:18         ` Eric Abrahamsen
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Christensen @ 2024-02-05 13:47 UTC (permalink / raw)
  To: ding

I've reported this to the emacs bug tracker:

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68931



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

* Re: problem with (display . [not expire]) with git emacs
  2024-02-05 13:47       ` Dan Christensen
@ 2024-02-05 15:18         ` Eric Abrahamsen
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Abrahamsen @ 2024-02-05 15:18 UTC (permalink / raw)
  To: ding

Dan Christensen <jdc@uwo.ca> writes:

> I've reported this to the emacs bug tracker:
>
>   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68931

Thanks!



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

end of thread, other threads:[~2024-02-05 15:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31 20:10 problem with (display . [not expire]) with git emacs Dan Christensen
2024-01-31 23:41 ` Dan Christensen
2024-02-01 22:29   ` Eric Abrahamsen
2024-02-02 14:58     ` Dan Christensen
2024-02-05 13:47       ` Dan Christensen
2024-02-05 15:18         ` Eric Abrahamsen
2024-02-01 22:33   ` Eric Abrahamsen

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 NNTP newsgroup(s).