From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Why is defun not executed during load-file? Date: Sun, 30 May 2021 12:02:25 +0300 Message-ID: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27399"; mail-complaints-to="usenet@ciao.gmane.io" To: Help GNU Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 30 11:05:00 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lnHNS-0006j7-Av for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 30 May 2021 11:04:58 +0200 Original-Received: from localhost ([::1]:54236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnHNR-0005CD-Dp for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 30 May 2021 05:04:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnHMv-0005C4-RA for help-gnu-emacs@gnu.org; Sun, 30 May 2021 05:04:25 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:39981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnHMu-0000wG-5o for help-gnu-emacs@gnu.org; Sun, 30 May 2021 05:04:25 -0400 Original-Received: from localhost ([::ffff:41.210.145.96]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000AE2D6.0000000060B354F5.00002689; Sun, 30 May 2021 02:03:49 -0700 Received-SPF: pass client-ip=217.170.207.13; envelope-from=support1@rcdrun.com; helo=stw1.rcdrun.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130319 Archived-At: I have this in the hyperscope.el and upon load-file the last function is not executed, it does not generate the functions. But if I evaluate it specifically, it generates functions. Is there any reason for that? (defun hyperscope-generate-the-add-function-by-hyperdocument-type (type-name id function-name) (eval `(defun ,(intern (symbol-name function-name)) () ,(format "Add new `%s' hyperdocument to Hyperscope." type-name) (interactive) (let* ((parent (hyperscope-select-set)) (prompt ,(format "New `%s' hyperdocument name: " type-name)) (name (read-from-minibuffer prompt))) (hlink-add-generic name "" ,id parent nil))))) (defun hyperscope-generate-add-functions-by-hyperdocument-types () (let ((types (hyperscope-hyperdocument-types))) (while types (let* ((type (pop types)) (id (nth 0 type)) (type (nth 1 type)) (type-name type) (type (downcase (string-replace " " "-" type))) (function-name (intern (format "hyperscope-add-new-%s-hyperdocument" type)))) (hyperscope-generate-the-add-function-by-hyperdocument-type type-name id function-name))))) (hyperscope-generate-add-functions-by-hyperdocument-types)