emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] new exporter


From: Nicolas Goaziou
Subject: Re: [O] new exporter
Date: Thu, 07 Jun 2012 22:24:50 +0200

Achim Gratz <address@hidden> writes:

> Nicolas Goaziou writes:
>> declarations (instead of requires) are here to avoid circular
>> dependencies. Why do you want to revert that in the first place?
>
> ...because so many of them were missing that it seemed easier to simply
> pull in the definitions by requirement.

But it isn't easier in the end, as you can see.

By the way, I have a (ugly and mostly working) function to add those
declarations.

#+begin_src emacs-lisp
(defun ngz-declare-function (package)
  "Insert necessary declare-function calls at point.
PACKAGE is the package from which functions should be declared."
  (interactive "sPackage name: ")
  (dolist (obj (save-excursion
                 (goto-char (point-min))
                 (let (acc (re (format "\\(^\\|[^`]\\)\\(%s-[-a-z]+\\)"
                                       package)))
                   (while (re-search-forward re nil t)
                     (let ((func (org-match-string-no-properties 2)))
                       (unless (member func acc) (push func acc))))
                   (sort acc 'string<))))
    (cond
     ((fboundp (intern obj))
      (let ((args
             (let* ((desc (save-window-excursion
                            (describe-function (intern obj))))
                    (args
                     (and (string-match (format "(%s \\([^)]+\\)?)" obj) desc)
                          (downcase
                           (replace-regexp-in-string
                            "[ \t]*\n[ \t]*" " "
                            (org-match-string-no-properties 1 desc))))))
               (insert
                (format "(declare-function %s \"%s\" (%s))\n"
                        obj package (or args ""))))))))
     ((boundp (intern obj)) (insert (format "(defvar %s)\n" obj))))))
#+end_src

> Yes, that was what I was thinking as well.  But that is not actually the
> problem with the compilation, but rather your use of cl macros in some
> places.  Somehow this messes up the compilation in a non-obvious way,
> see my other post.  If you want to try it yourself, delete one of the
> org-e-*.elc files after the first compilation and try to compile that
> again and watch it explode...

I do not notice anything like this.  There are many compilation errors
on some files, but they are the same before and after removing an
org-e-*.el file.


Regards,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]