From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: gmane.emacs.help Subject: Re: Symbol's value as variable is void: defun Date: Fri, 02 Feb 2018 11:39:49 +0000 Organization: A noiseless patient Spider Message-ID: <87zi4r39iy.fsf@bsb.me.uk> References: <4d2444cf-cca2-49b6-9afa-524aa7d28569@googlegroups.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1517571545 31574 195.159.176.226 (2 Feb 2018 11:39:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Feb 2018 11:39:05 +0000 (UTC) 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 12:39:01 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 1ehZfr-0006Da-Ve for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Feb 2018 12:38:32 +0100 Original-Received: from localhost ([::1]:55374 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehZhr-0004Xk-7X for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Feb 2018 06:40:35 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!2a00:1d38:fa:105::183.MISMATCH!feed.usenet.farm!feeder3.usenet.farm!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 56 Original-Injection-Info: reader02.eternal-september.org; posting-host="82640f9cb11131964ec8e6da91512604"; logging-data="27177"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18JtvYlOi0xX2Oe3Dz9rLblXqkwCl1zwlw=" Cancel-Lock: sha1:PbeSfmcqcbFmYX0P85mG2LOfrm4= sha1:1U10wVotTjikhb8q3a+nbFrxotY= X-BSB-Auth: 1.022985225d5edfbb8970.20180202113949GMT.87zi4r39iy.fsf@bsb.me.uk Original-Xref: usenet.stanford.edu gnu.emacs.help:221780 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:115897 Archived-At: Davin Pearson writes: > ;; 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. > > Here is the contents of the offending file: > > http://davinpearson.com/binaries/c++2lisp++-stage-1-purge-comments.elc The problem is reported to be in that file and is (as far as I can tell) unrelated to the code you show above. You'd have to post the source for that compiler file to more help. -- Ben.