all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Felix Dietrich <felix.dietrich@sperrhaken.name>
To: help-gnu-emacs@gnu.org
Subject: Re: Problem with native-compilation
Date: Sat, 26 Mar 2022 14:58:00 +0100	[thread overview]
Message-ID: <87v8w0lst3.fsf@sperrhaken.name> (raw)
In-Reply-To: <834k3mcy33.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 25 Mar 2022 10:04:16 +0300")

[-- Attachment #1: Type: text/plain, Size: 2592 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

> What is org-contacts.el?  I don't see it in Emacs.

Itʼs part of org-contrib whose package currently resides here
<https://elpa.nongnu.org/nongnu/org-contrib.html>.  Org-contrib used to
be part of the org-mode repository but was removed with version 9.5.  I
do not know whether it was, together with org-mode, imported into the
Emacs tree.

>> From: Jonas Damm <emails@jonas-damm.de>
>> Date: Thu, 24 Mar 2022 23:17:38 +0100
>
>> After installing
>> the org-contacts package from nongnu org-contrib, at first everything
>> works as expected.
>> 
>> However, after the compiling in the background is done, some functions
>> are broken:
>> 
>> 
>> Warning (comp): org-contacts.el:648:13: Warning: the function ‘start’ is not known to be defined. Disable showing Disable logging
>> Warning (comp): org-contacts.el:593:12: Warning: the function ‘lexical-let*’ is not known to be defined. Disable showing Disable logging
>> Warning (comp): org-contacts.el:505:4: Warning: the function ‘list*’ is not known to be defined. Disable showing Disable logging
>> Warning (comp): org-contacts.el:459:4: Warning: the function ‘lexical-let’ is not known to be defined. Disable showing Disable logging
>> Warning (comp): org-contacts.el:372:28: Warning: the function ‘values’ is not known to be defined. Disable showing Disable logging
>> Warning (comp): org-contacts.el:330:44: Warning: the function ‘first’ is not known to be defined. Disable showing Disable logging
>
> From the messages you show, it sounds like org-contacts.el has
> problems that are flagged by the native compilation, in particular it
> needs to (require 'cl) (for lexical-let*) and probably other packages
> to resolve the other "not known to be defined" problems.

Can or should (require 'cl) be wrapped in a ‘eval-when-compile’?  What
is the state of the cl library?  It is marked as obsolete.  Are there
plans on how long it will be supported?

Anyway, Jonas, attached is a patch that cleans up the compilation errors
and warnings (at least ‘batch-byte-compile’ is satisfied).  If you have
not yet gotten around to it yourself then this might be useful for you.
I did not dispense with ‘lexical-let’ by activating ‘lexical-binding’
because I did not want to read all of the code to see whether
org-contacts makes use of implicitly dynamically bound variables.  The
patch applies to the current master (8c138dc) of the git repository of
the org-contrib package <https://git.sr.ht/~bzg/org-contrib/tree>.


[-- Attachment #2: Patch to clean-up compilation errors in org-contacts.el --]
[-- Type: text/x-diff, Size: 2317 bytes --]

From b4444ae5f46b6edbb9064d2f2be5c4e2e1851948 Mon Sep 17 00:00:00 2001
From: Felix Dietrich <felix.dietrich@sperrhaken.name>
Date: Sat, 26 Mar 2022 13:58:03 +0100
Subject: [PATCH] org-contacts: Fix compilation warnings and erros

---
 lisp/org-contacts.el | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lisp/org-contacts.el b/lisp/org-contacts.el
index 94be38a..2866fff 100644
--- a/lisp/org-contacts.el
+++ b/lisp/org-contacts.el
@@ -62,6 +62,7 @@
 ;;; Code:
 
 (require 'cl-lib)
+(eval-when-compile (require 'cl)) ; for ‘lexical-let’
 (require 'org)
 (require 'gnus-util)
 (require 'gnus-art)
@@ -749,8 +750,8 @@ This function should be called from `gnus-article-prepare-hook'."
       (with-current-buffer (marker-buffer marker)
         (save-excursion
           (goto-char marker)
-          (let* ((org-email-link-description-format (or org-contacts-email-link-description-format
-                                                        org-email-link-description-format))
+          (let* ((org-link-email-description-format (or org-contacts-email-link-description-format
+                                                        org-link-email-description-format))
                  (link (gnus-with-article-buffer (org-store-link nil))))
             (org-set-property org-contacts-last-read-mail-property link)))))))
 
@@ -1169,14 +1170,14 @@ are effectively trimmed).  If nil, all zero-length substrings are retained."
 	     (member (buffer-file-name) (mapcar 'expand-file-name org-contacts-files)))
     (if (bound-and-true-p org-id-link-to-org-use-id)
 	(org-id-store-link)
-      (let ((headline-str (substring-no-properties (org-get-heading t t t t))))
-	(org-store-link-props
+      (let* ((headline-str (substring-no-properties (org-get-heading t t t t)))
+	     (link (concat "org-contact:" headline-str)))
+	(org-link-store-props
 	 :type "org-contact"
 	 :link headline-str
 	 :description headline-str)
-        (setq desc headline-str)
-        (setq link (concat "org-contact:" headline-str))
-        (org-add-link-props :link link :description desc)
+        (org-link-add-props :link link
+			    :description headline-str)
         link))))
 
 (defun org-contacts--all-contacts ()
-- 
2.35.1


[-- Attachment #3: Type: text/plain, Size: 20 bytes --]


-- 
Felix Dietrich

  reply	other threads:[~2022-03-26 13:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 22:17 Problem with native-compilation Jonas Damm
2022-03-25  7:04 ` Eli Zaretskii
2022-03-26 13:58   ` Felix Dietrich [this message]
2022-03-26 14:38     ` Eli Zaretskii
2022-04-04 10:50       ` Felix Dietrich
2022-04-03 17:57     ` Jonas Damm
2022-04-04 13:01       ` Felix Dietrich
     [not found] <87wngio1qo.fsf@jonas-damm.de>
2022-03-25 10:17 ` Eli Zaretskii
2022-03-25 10:36   ` Jonas Damm
2022-03-25 11:24     ` Eli Zaretskii
2022-03-25 18:01     ` Emanuel Berg via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8w0lst3.fsf@sperrhaken.name \
    --to=felix.dietrich@sperrhaken.name \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.