From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Symbol's value as variable is void: defun Date: Fri, 02 Feb 2018 04:27:23 +0100 Organization: Aioe.org NNTP Server Message-ID: <861si43wbo.fsf@zoho.com> 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 1517542156 6328 195.159.176.226 (2 Feb 2018 03:29:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Feb 2018 03:29:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) 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 04:29: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 1ehS1l-0007Vb-Rf for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Feb 2018 04:28:37 +0100 Original-Received: from localhost ([::1]:59286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehS3k-00064d-VJ for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Feb 2018 22:30:41 -0500 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: VFF8n9P1H/v9pfNWKwEKwA.user.gioia.aioe.org Original-X-Complaints-To: abuse@aioe.org Cancel-Lock: sha1:l1siISF/Rv4KP0OmUBvgmXx8Csg= X-Notice: Filtered by postfilter v. 0.8.2 Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:221778 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:115895 Archived-At: Davin Pearson wrote: > (defun load-file-most-recent (file) ... Man, you have some serious style issues! - lots of `setq's, and sequential `setq' to the same variable! here, rely on `let' and `let*' instead, and do it one thing at a time, then stay out - long function - everything tangled up: `setq' within `cond', deeply nested `if's within `setq', ... You don't need explicit nils for single-branch `if's: (if t 1) ; 1 (if nil 1) ; nil But for `if's with only one branch you are benefitted from instead using `when' (and `unless' for "if not") as this will drop the need for explicit `progn's for the multiform branch. (when t 1) ; 1 (unless t 1) ; nil (when nil 1) ; nil (unless nil 1) ; 1 (when nil 1 2) ; nil (unless nil 1 2) ; 2 is return but "1" also happens (when t 1 2) ; ditto (unless t 1 2) ; nil -- underground experts united http://user.it.uu.se/~embe8573