From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: goncholden Newsgroups: gmane.emacs.help Subject: Re: Adding functionality to a minor mode Date: Mon, 07 Feb 2022 19:18:47 +0000 Message-ID: References: <8735kvtdvh.fsf@ericabrahamsen.net> <87k0e6zh4u.fsf@web.de> Reply-To: goncholden Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37273"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 07 20:22:26 2022 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 1nH9ak-0009Sv-GO for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 07 Feb 2022 20:22:26 +0100 Original-Received: from localhost ([::1]:34698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nH9ai-0003v5-Vl for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 07 Feb 2022 14:22:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nH9XI-0002fx-LW for help-gnu-emacs@gnu.org; Mon, 07 Feb 2022 14:18:53 -0500 Original-Received: from mail-4324.protonmail.ch ([185.70.43.24]:45525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nH9XG-0008Vz-Mi for help-gnu-emacs@gnu.org; Mon, 07 Feb 2022 14:18:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1644261528; bh=GV6VIRIi9vF5MxdOvwxjDdBdVLsugAGk/sN7q6pUG94=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=BYG6USpjPQa9vM47a6+aTb+h+VP+Em2Ekb1SaEm7+krb8Yw7A8AbwkxqoyCvG2O+w SxB0rZNDOEEL1xIm+0YX9940UqGpCbf2EAfAXhp+J0QAWn3naE4A1g6/Lw9UVSxhsD dTEDdUG+U7Vq2MXY5PBOdDRK1NiqJ0p3r53/Fc1CCBytoiClVCdnVrubqhyGhA33Z9 //+MVOng7gllh6JJqzkxe2fEWFXSvQFA7qHWaOKm+FkzUTklUjvTXKDTslRYUaM83X UFntJ+NIa90Tt50u2wyufo6kHKRyUecBYDzxSI/j6Yf2jkyWH8ChJxi/wgLKH4hKDf RRvc0yZSG6FyA== In-Reply-To: <87k0e6zh4u.fsf@web.de> Received-SPF: pass client-ip=185.70.43.24; envelope-from=goncholden@protonmail.com; helo=mail-4324.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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:135801 Archived-At: ------- Original Message ------- On Monday, February 7th, 2022 at 6:05 PM, Michael Heerdegen wrote: > goncholden goncholden@protonmail.com writes: > > > I am also struck about what happens when "(define-minor-mode > > rich-minor-mode" is used to disable the mode. I suppose that "(when > > richerenkov-minor-mode" would evaluate to false, but the other parts > > would evaluate. > > Yes. Whenever you turn the mode on or off, the complete body is > evaluated normally, with the mode variable bound to a non-nil value when > the mode has been enabled and nil else. > > M-: (macroexpand-1 '(define-minor-mode rich-minor-mode ...)) RET to see > the macroexpanded code of your definition - helps in understanding. > > Michael. Am not sure whether I am executing your suggestion good. What should I loo= k for? -------- Debugger entered--Lisp error: (wrong-type-argument stringp \.\.\.) string-match("\\bARG\\b" \.\.\. nil) easy-mmode--mode-docstring(\.\.\. "Rich minor mode" rich-minor-mode-map) #f(compiled-function (mode doc &optional init-value lighter keymap &rest = body) #)(rich-minor-mode \.\.\.) apply(#f(compiled-function (mode doc &optional init-value lighter keymap = &rest body) #) (rich-minor-mode \.\.\.)) macroexpand-1((define-minor-mode rich-minor-mode \.\.\.)) eval((macroexpand-1 '(define-minor-mode rich-minor-mode \.\.\.)) t) eval-expression((macroexpand-1 '(define-minor-mode rich-minor-mode \.\.\.= )) nil nil 127) funcall-interactively(eval-expression (macroexpand-1 '(define-minor-mode = rich-minor-mode \.\.\.)) nil nil 127) call-interactively(eval-expression nil nil) command-execute(eval-expression)