emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: Re: Org release 7.8.07 (BUGFIX-only release)
Date: Sun, 01 Apr 2012 12:39:01 +0200	[thread overview]
Message-ID: <87r4w7pwhm.fsf@Rainer.invalid> (raw)
In-Reply-To: 87ehs7hmqb.fsf@gnu.org

Bastien writes:
>> In org-find-library-name:
>> org-compat.el:341:14:Warning: find-library called with 3 arguments, but
>>     accepts only 1
> Well, this is the culprit compatibility defun:
> (defun org-find-library-name (library)
>   (if (fboundp 'find-library-name)
>       (file-name-directory (find-library-name library))
>     ; XEmacs does not have `find-library-name'
>     (flet ((find-library-name-helper (filename ignored-codesys)
> 				     filename)
> 	   (find-library-name (library)
> 	    (find-library library nil 'find-library-name-helper)))  <<<<<
>       (file-name-directory (find-library-name library)))))
> I don't know how to circumvent this warning and btw I don't have this
> warning in Emacs

I also do not have this warning when compiling org-compat.el in
isolation, but I do have this warning when I do a
batch-byte-recompile-directory.  That is never a good sign...

Anyway, I think that most if not all these defuns in org-compat.el
should really be macros (although careful quoting has to be applied) so
that the byte-compiler only needs to compile whatever is appropriate.

(defmacro org-find-library-name (library)
  (if (fboundp 'find-library-name)
      `(file-name-directory (find-library-name ,library))
    ; XEmacs does not have `find-library-name'
    `(flet ((find-library-name-helper (filename ignored-codesys)
	    (find-library-name (library)
	    (find-library library nil 'find-library-name-helper)))
      (file-name-directory (find-library-name ,library)))))

I also don't think an flet macro should be used here (or it should also
be expanded at compile time, which I can't see how to do easily), maybe
replace with a lambda expression?  Looking at the definition of
find-library in XEmacs makes me a bit queasy, but I think it needs three
arguments to tell it not to display the file in a window...

(defmacro org-find-library-name (library)
  (if (fboundp 'find-library-name)
      `(file-name-directory (find-library-name ,library))
    ; XEmacs does not have `find-library-name'
    `(file-name-directory (find-library ,library nil (lambda (lib ignore) lib)))))

Anyway, something to do after Emacs 24.1 is out.

+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:

  reply	other threads:[~2012-04-01 10:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-31 10:07 Org release 7.8.07 (BUGFIX-only release) Bastien
2012-03-31 13:22 ` Achim Gratz
2012-04-01  8:37   ` Bastien
2012-04-01 10:39     ` Achim Gratz [this message]
2012-04-02 19:53       ` Achim Gratz
2012-03-31 17:00 ` Eric Schulte
2012-03-31 17:05   ` Eric Schulte
2012-04-01  8:40     ` Bastien
2012-04-01 10:03 ` Bastien

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:

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87r4w7pwhm.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \


* 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 public inbox


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 read-only IMAP folder(s) and NNTP newsgroup(s).