GNU bug report logs - #42668
26.1; Undefined functions when calling invoking project.el

Previous Next

Package: emacs;

Reported by: philipk <at> posteo.net (Philip K.)

Date: Sun, 2 Aug 2020 09:08:01 UTC

Severity: normal

Found in version 26.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42668 in the body.
You can then email your comments to 42668 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#42668; Package emacs. (Sun, 02 Aug 2020 09:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to philipk <at> posteo.net (Philip K.):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 02 Aug 2020 09:08:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: philipk <at> posteo.net (Philip K.)
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; Undefined functions when calling invoking project.el
Date: Sun, 02 Aug 2020 11:07:27 +0200
When trying to to use some project.el commands, and noticed that there
are a (at least) two undefined functions right after loading project.el
in a vanilla session:

- The first complaint is seq-every-p, used by
  project--read-project-list, but this is "easily" solved by loading
  seq.el.
- The more critical complaint is that assoc-delete-all, used by 
  project--add-to-project-list-front and
  project--remove-from-project-list are not loaded or defined in Emacs
  26.
  My guess is that this function should be replaced by it's functionally
  equivalent code, that only uses functions available in Emacs 26?
  
In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
 of 2019-09-23, modified by Debian built on x86-grnet-01
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description:	Debian GNU/Linux 10 (buster)

Recent messages:
Type C-x 1 to delete the help window.
custom-initialize-reset: Symbol’s function definition is void: assoc-delete-all
Saving file /home/phi/.emacs.d/elpa/project-0.5.0/project.el...
Wrote /home/phi/.emacs.d/elpa/project-0.5.0/project.el
Quit
Entering debugger...
Mark set
Back to top level
Entering debugger...
Back to top level

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --build
 x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
 --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --with-x=yes
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-StqULU/emacs-26.1+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  paredit-mode: t
  ivy-mode: t
  display-time-mode: t
  electric-pair-mode: t
  recentf-mode: t
  save-place-mode: t
  savehist-mode: t
  show-paren-mode: t
  winner-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/phi/.emacs.d/elpa/project-0.5.0/project hides /usr/share/emacs/26.1/lisp/progmodes/project
/home/phi/.emacs.d/elpa/flymake-1.0.9/flymake hides /usr/share/emacs/26.1/lisp/progmodes/flymake
/home/phi/.emacs.d/elpa/let-alist-1.0.6/let-alist hides /usr/share/emacs/26.1/lisp/emacs-lisp/let-alist

Features:
(shadow emacsbug eieio-opt speedbar sb-image ezimage dframe xref
find-func cl-print debug swiper bug-reference bookmark map vc-mtn vc-hg
vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher project
subr-x help-fns radix-tree char-fold network-stream starttls url-http
tls gnutls url-gw nsm url-cache url-auth eww mm-url url-queue url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap shr svg xml dom browse-url nnmail gnus-int
gnus-range mail-source sort ffap tramp tramp-compat tramp-loaddefs
trampver ucs-normalize shell pcomplete parse-time advice misearch
multi-isearch flyspell ispell mail-extr cl-extra help-mode vc-git
diff-mode easy-mmode time-stamp qp vc-fossil rmailmm message rmc puny
rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader mail-parse rfc2231 paredit init ivy
delsel colir color ivy-overlay edmacro kmacro rx pcase dired-x dired
dired-loaddefs holidays hol-loaddefs cal-menu calendar cal-loaddefs
erc-goodies erc thingatpt pp erc-backend erc-compat format-spec gnus
nnheader gnus-util time sendmail rmail rmail-loaddefs rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils compile hippie-exp comint
ansi-color elec-pair recentf tree-widget saveplace savehist paren winner
ring cus-edit cus-start cus-load wid-edit tex-site finder-inf
slime-autoloads info package easymenu epg-config url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs cl-lib devhelp time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 465615 101116)
 (symbols 48 38230 1)
 (miscs 40 693 3645)
 (strings 32 115237 17474)
 (string-bytes 1 3036144)
 (vectors 16 57732)
 (vector-slots 8 1037505 74204)
 (floats 8 304 1052)
 (intervals 56 6627 2315)
 (buffers 992 27))

-- 
	Philip K.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42668; Package emacs. (Sun, 02 Aug 2020 14:24:02 GMT) Full text and rfc822 format available.

Message #8 received at 42668 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: philipk <at> posteo.net (Philip K.)
Cc: 42668 <at> debbugs.gnu.org
Subject: Re: bug#42668: 26.1;
 Undefined functions when calling invoking project.el
Date: Sun, 02 Aug 2020 17:23:01 +0300
> From: philipk <at> posteo.net (Philip K.)
> Date: Sun, 02 Aug 2020 11:07:27 +0200
> 
> 
> When trying to to use some project.el commands, and noticed that there
> are a (at least) two undefined functions right after loading project.el
> in a vanilla session:
> 
> - The first complaint is seq-every-p, used by
>   project--read-project-list, but this is "easily" solved by loading
>   seq.el.
> - The more critical complaint is that assoc-delete-all, used by 
>   project--add-to-project-list-front and
>   project--remove-from-project-list are not loaded or defined in Emacs
>   26.
>   My guess is that this function should be replaced by it's functionally
>   equivalent code, that only uses functions available in Emacs 26?

To make sure I understand the report: you are using project.el from
GNU ELPA in conjunction with Emacs 26?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42668; Package emacs. (Sun, 02 Aug 2020 14:37:02 GMT) Full text and rfc822 format available.

Message #11 received at 42668 <at> debbugs.gnu.org (full text, mbox):

From: "Philip K." <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42668 <at> debbugs.gnu.org
Subject: Re: bug#42668: 26.1; Undefined functions when calling invoking
 project.el
Date: Sun, 02 Aug 2020 16:36:23 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: philipk <at> posteo.net (Philip K.)
>> Date: Sun, 02 Aug 2020 11:07:27 +0200
>> 
>> 
>> When trying to to use some project.el commands, and noticed that there
>> are a (at least) two undefined functions right after loading project.el
>> in a vanilla session:
>> 
>> - The first complaint is seq-every-p, used by
>>   project--read-project-list, but this is "easily" solved by loading
>>   seq.el.
>> - The more critical complaint is that assoc-delete-all, used by 
>>   project--add-to-project-list-front and
>>   project--remove-from-project-list are not loaded or defined in Emacs
>>   26.
>>   My guess is that this function should be replaced by it's functionally
>>   equivalent code, that only uses functions available in Emacs 26?
>
> To make sure I understand the report: you are using project.el from
> GNU ELPA in conjunction with Emacs 26?

Yes, I open Emacs 26, and load ~/.emacs.d/elpa/project-0.5.0/project.el.

-- 
	Philip K.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42668; Package emacs. (Sun, 02 Aug 2020 22:03:01 GMT) Full text and rfc822 format available.

Message #14 received at 42668 <at> debbugs.gnu.org (full text, mbox):

From: "Philip K." <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42668 <at> debbugs.gnu.org
Subject: Re: bug#42668: 26.1; Undefined functions when calling invoking
 project.el
Date: Mon, 03 Aug 2020 00:02:34 +0200
[Message part 1 (text/plain, inline)]
> To make sure I understand the report: you are using project.el from
> GNU ELPA in conjunction with Emacs 26?

I see that seq has been added as a dependency in the git repository
(that appears to not have been released to ELPA yet).

The patch attached below should fix the assoc-delete-all issue.

-- 
	Philip K.

[0001-Replace-assoc-delete-all-with-26.1-compatible-altern.patch (text/x-diff, inline)]
From 4c073d987273807ff7bfb932d72c584afdad9315 Mon Sep 17 00:00:00 2001
From: Philip K <philipk <at> posteo.net>
Date: Sun, 2 Aug 2020 23:59:40 +0200
Subject: [PATCH] Replace assoc-delete-all with 26.1 compatible alternatives

---
 lisp/progmodes/project.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 51b9347bb9..06864ccf60 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1166,7 +1166,9 @@ project-remember-project
   (project--ensure-read-project-list)
   (let ((dir (project-root pr)))
     (unless (equal (caar project--list) dir)
-      (setq project--list (assoc-delete-all dir project--list))
+      (dolist (elem project--list)
+        (when (equal dir (car elem))
+          (setq project--list (delq elem project--list))))
       (push (list dir) project--list)
       (project--write-project-list))))
 
@@ -1176,8 +1178,8 @@ project--remove-from-project-list
 result in `project-list-file'.  Announce the project's removal
 from the list."
   (project--ensure-read-project-list)
-  (when (assoc pr-dir project--list)
-    (setq project--list (assoc-delete-all pr-dir project--list))
+  (when-let ((ent (assoc pr-dir project--list)))
+    (delq ent project--list)
     (message "Project `%s' not found; removed from list" pr-dir)
     (project--write-project-list)))
 
-- 
2.20.1


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42668; Package emacs. (Sun, 02 Aug 2020 22:07:02 GMT) Full text and rfc822 format available.

Message #17 received at 42668 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: "Philip K." <philipk <at> posteo.net>, 42668 <at> debbugs.gnu.org
Subject: Re: bug#42668: 26.1; Undefined functions when calling invoking
 project.el
Date: Mon, 3 Aug 2020 01:06:36 +0300
Hi Philip,

On 02.08.2020 12:07, Philip K. wrote:
> 
> When trying to to use some project.el commands, and noticed that there
> are a (at least) two undefined functions right after loading project.el
> in a vanilla session:

Thank you for testing that.

> - The first complaint is seq-every-p, used by
>    project--read-project-list, but this is "easily" solved by loading
>    seq.el.

That is already fixed on master, should be in the next project.el release.

> - The more critical complaint is that assoc-delete-all, used by
>    project--add-to-project-list-front and
>    project--remove-from-project-list are not loaded or defined in Emacs
>    26.
>    My guess is that this function should be replaced by it's functionally
>    equivalent code, that only uses functions available in Emacs 26?

seq-remove, cl-delete-if (or even cl-delete with :key) seem like the 
prime candidates.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42668; Package emacs. (Sun, 02 Aug 2020 22:18:01 GMT) Full text and rfc822 format available.

Message #20 received at 42668 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: "Philip K." <philipk <at> posteo.net>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 42668 <at> debbugs.gnu.org
Subject: Re: bug#42668: 26.1; Undefined functions when calling invoking
 project.el
Date: Mon, 3 Aug 2020 01:16:54 +0300
On 03.08.2020 01:02, Philip K. wrote:
> The patch attached below should fix the assoc-delete-all issue.

Thanks!

Could you add a commit message as well, formatted according to CONTRIBUTE?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42668; Package emacs. (Wed, 05 Aug 2020 21:02:01 GMT) Full text and rfc822 format available.

Message #23 received at 42668 <at> debbugs.gnu.org (full text, mbox):

From: "Philip K." <philipk <at> posteo.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 42668 <at> debbugs.gnu.org, eliz <at> gnu.org
Subject: Re: bug#42668: 26.1; Undefined functions when calling invoking
 project.el
Date: Wed, 05 Aug 2020 23:00:50 +0200
[Message part 1 (text/plain, inline)]
(sorry for the delay)

Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 03.08.2020 01:02, Philip K. wrote:
>> The patch attached below should fix the assoc-delete-all issue.
>
> Thanks!
>
> Could you add a commit message as well, formatted according to CONTRIBUTE?

Sure, I hope this is ok:

[0001-Remove-usages-of-assoc-delete-all-in-project.el.patch (text/x-diff, inline)]
From 47dac7a9e6da05bb6303e4b10a0b8ce98aa12eeb Mon Sep 17 00:00:00 2001
From: Philip K <philipk <at> posteo.net>
Date: Wed, 5 Aug 2020 22:57:01 +0200
Subject: [PATCH] ; Remove usages of assoc-delete-all in project.el

assoc-delete-all is not available for users who have installed
project.el via ELPA on older Emacs versions.
* lisp/progmodes/project.el (project-remember-project,
  project--remove-from-project-list): Replace assoc-delete-all with
  equivalent alternatives
---
 lisp/progmodes/project.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 51b9347bb9..b6161351f0 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1166,7 +1166,9 @@ project-remember-project
   (project--ensure-read-project-list)
   (let ((dir (project-root pr)))
     (unless (equal (caar project--list) dir)
-      (setq project--list (assoc-delete-all dir project--list))
+      (dolist (ent project--list)
+        (when (equal dir (car ent))
+          (setq project--list (delq ent project--list))))
       (push (list dir) project--list)
       (project--write-project-list))))
 
@@ -1176,8 +1178,8 @@ project--remove-from-project-list
 result in `project-list-file'.  Announce the project's removal
 from the list."
   (project--ensure-read-project-list)
-  (when (assoc pr-dir project--list)
-    (setq project--list (assoc-delete-all pr-dir project--list))
+  (when-let ((ent (assoc pr-dir project--list)))
+    (setq project--list (delq ent project--list))
     (message "Project `%s' not found; removed from list" pr-dir)
     (project--write-project-list)))
 
-- 
2.20.1

[Message part 3 (text/plain, inline)]
-- 
	Philip K.

Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Thu, 06 Aug 2020 14:52:02 GMT) Full text and rfc822 format available.

Notification sent to philipk <at> posteo.net (Philip K.):
bug acknowledged by developer. (Thu, 06 Aug 2020 14:52:02 GMT) Full text and rfc822 format available.

Message #28 received at 42668-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: "Philip K." <philipk <at> posteo.net>
Cc: eliz <at> gnu.org, 42668-done <at> debbugs.gnu.org
Subject: Re: bug#42668: 26.1; Undefined functions when calling invoking
 project.el
Date: Thu, 6 Aug 2020 17:51:25 +0300
On 06.08.2020 00:00, Philip K. wrote:
> Sure, I hope this is ok:

Pushed, thank you.

(But see commit 09ba020328e9 with the further tweaks I made to the message.)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 04 Sep 2020 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.