From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Symbol's value as variable is void: defun Date: Fri, 2 Feb 2018 08:48:20 +0100 Message-ID: <20180202074820.GA6898@tuxteam.de> References: <4d2444cf-cca2-49b6-9afa-524aa7d28569@googlegroups.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed X-Trace: blaine.gmane.org 1517585896 413 195.159.176.226 (2 Feb 2018 15:38:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Feb 2018 15:38:16 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 02 16:38:11 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehdPZ-0007R1-4J for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Feb 2018 16:37:57 +0100 Original-Received: from localhost ([::1]:36776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehdRa-0006l8-8v for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Feb 2018 10:40:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehcoc-0006AQ-AX for help-gnu-emacs@gnu.org; Fri, 02 Feb 2018 09:59:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehcoY-00036G-Hs for help-gnu-emacs@gnu.org; Fri, 02 Feb 2018 09:59:46 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:59024) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehcoY-0002uS-3O for help-gnu-emacs@gnu.org; Fri, 02 Feb 2018 09:59:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=20171004; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=GPOWFHpDhbHrraAUfR44M6I0RNvGKjX5WKZl279ow3s=; b=UCjmnMVbuGe2/T2cZY0+BclpQNelGloP2D6QlFpW4UbtWnXejEx75AJ33spnBOdOI6Mje7e+93IAFoB10NvGq7mF1u2h9xavxD73s5OjbIflz94UuutYlcwG6/OFfkvkXLHxJ7xEAOlQLub2ZQBkzrMBMKjBc4vlhk++Y4ER5oI+/91jWCEaWz4aV81ZJGhrBxZYFC8kYs31PsT6VajM6uYK94qzUyLeGavRz88gmOAsVC5sCBUEfgI1oSoY9SVA3ege/SFNqU+stDhgSHjfKGJfXdozudgG19P6XQ+SwHDcW0oRAkfSC5RcQa99hOjCsTvvbXVkSO3lAKuiL7fC6w==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1ehW56-0001vD-K2 for help-gnu-emacs@gnu.org; Fri, 02 Feb 2018 08:48:20 +0100 In-Reply-To: <4d2444cf-cca2-49b6-9afa-524aa7d28569@googlegroups.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115898 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, Feb 01, 2018 at 06:54:16PM -0800, Davin Pearson wrote: > ;; With the following defun in effect: > > (defun load-file-most-recent (file) > ;;(setq file (concat (car load-path) "/" file)) > (assert (string-match "\\.el$" file)) > (setq other (substring file 0 (match-beginning 0))) > (setq other (concat other ".elc")) > (cond > ((and (file-exists-p file) (file-exists-p other)) > (setq date-modified-file (nth 5 (file-attributes file))) > (setq date-modified-other (nth 5 (file-attributes other))) > (setq file-older-than-other-p > (if (>= (nth 0 date-modified-file) (nth 0 date-modified-other)) > (if (>= (nth 1 date-modified-file) (nth 1 date-modified-other)) > (if (>= (nth 2 date-modified-file) (nth 2 date-modified-other)) > t > nil) > nil) > nil)) > (if file-older-than-other-p > (progn > (message "loading file %s" file) > (load-file file)) > (message "loading file %s" other) > (load-file other)) > ) > ((file-exists-p file) > (load-file file) > ) > ((file-exists-p other) > (load-file other) > ) > (t > (assert (not (file-exists-p file))) > (assert (not (file-exists-p other))) > (error "Should never happen, file=%s, other=%s" file other)) > ) > ) > > (load-file-most-recent "~/lisp++-projects/c++2lisp++-stage-1-purge-comments.el") > > ;; gives the following diagnostic: Symbol's value as variable is void: > ;; defun. I don't quite understand: the problem seems to be in the file loaded, i.e. in "c++2lisp++-stage-1-purge-comments.el", right? Can we see that? > Here is the contents of the offending file: > > http://davinpearson.com/binaries/c++2lisp++-stage-1-purge-comments.elc Hm. I can't read .elc too well :-) do you have an uncompiled version? Cheers - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlp0F8QACgkQBcgs9XrR2kbSBQCfUeZJmM/fPGWBVyIADq7h297Z cKIAn2q60X1Q+HaRIoZaqrovTPmCf5Ul =LMp9 -----END PGP SIGNATURE-----