From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Davin Pearson Newsgroups: gmane.emacs.help Subject: Fwd: How do I go about debugging my Elisp code? Date: Thu, 13 Jan 2022 14:22:34 +1300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3891"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 13 02:26:46 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 1n7ot3-0000u6-9z for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 13 Jan 2022 02:26:45 +0100 Original-Received: from localhost ([::1]:58454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7ot2-0004tI-3q for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 12 Jan 2022 20:26:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7opW-0002r6-Ue for help-gnu-emacs@gnu.org; Wed, 12 Jan 2022 20:23:07 -0500 Original-Received: from [2a00:1450:4864:20::136] (port=34494 helo=mail-lf1-x136.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n7opL-00058k-Jo for help-gnu-emacs@gnu.org; Wed, 12 Jan 2022 20:23:06 -0500 Original-Received: by mail-lf1-x136.google.com with SMTP id p27so2574460lfa.1 for ; Wed, 12 Jan 2022 17:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=7mgh8PMl6x9lzb/V7IOczsDrY30h9MWYt/iYmGr0wLQ=; b=D/sQRHKrak89f2qXo+h1xYdkO0RXlbycLGW8arDANKd7G1tkl6eKAtUmC33IUlSzsn q9JIU1PyhWpeRzboeoHtG2QrL6uYAqWw3ojXyu9x7XBSVao9agoCDhr0s6QLQuu2ld/I fIOkg3Iq12M4I3w8nWQXL8IT+qjMOw87F9uQEbphAESkKx6rrou/kTNoO7TzzMDfz+uF j+mhi91HOzfoK2iuGSZt+37rWd6EcEzi5NcPGXDckrGAvUAYk0YURezOAbUF9XxOIZkJ BXqLwTLbeXqKf9Y89DkYK/nkZiL65ynQBsdk7PBn1nXupcDsmjSGGSUkzHSV8t1rFfXZ l0uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=7mgh8PMl6x9lzb/V7IOczsDrY30h9MWYt/iYmGr0wLQ=; b=deTbz1Vfrgm9D2v6sy5hqhcgyXyyLsRiq/ESIaq7psCjjU18ddGlZ4fNcdgn4zXT0h qBDAr3WoFUNMzZ8nbwowi5tcqN7uOuLu2GKN/AWN3IO/KcxgPEBDd4YK6uQTridym0A9 zvqoFes+682v9H3llVyDSIaW4dx/mQQOQYKtn0pw2pX83rFudTIHBFLrLfEr7urGNoNZ NjV2yEjBTSKNYSjYmEnrsvlRHO0RZa2zwYZWY3wgAaZhufg9nCgAOtg2dMvfDK5GJYsh EKz6rUII+clpATQ4MFY13Hyj9qlk7n4sQPstNgpzE0DYw4Q8jjQ+2dY/5yPebgqQs70s ltAQ== X-Gm-Message-State: AOAM5337L4eGBXhAILqgI0EpZPbCnlXf7U+bjtAqC+uoEhoM4XFdHTEk 0EeRW6qBaiNi+QXGWPzJbeESfRxj1q97+V1AZLNDn3vpTpk= X-Google-Smtp-Source: ABdhPJyiqTAT5jNRpqhCiVWNuTZZamPc3uoVGS5ez02XQ9M6GmxNVCFUbVOphHSxoyphhT9xvRCKJw6bYPFCvnVzcvg= X-Received: by 2002:ac2:531c:: with SMTP id c28mr1634391lfh.74.1642036966395; Wed, 12 Jan 2022 17:22:46 -0800 (PST) In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::136 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=davin.pearson@gmail.com; helo=mail-lf1-x136.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:135261 Archived-At: ---------- Forwarded message --------- From: Davin Pearson Date: Sat, 8 Jan 2022 at 18:20 Subject: How do I go about debugging my Elisp code? To: emacs-devel I sent this email to the google group gnu.emacs.help but got no reply :-( My problem is with the GNU Elisp Debugger... When it comes up with a back trace it notifies you of the problematic line of code but doesn't tell you which line or file the error comes from. What I have to do with this is to put debugger checkpoints on every second line of Elisp code. At least that gives you the location of the error message, by looking at the *Messages* buffer you can see the last checkpoint before the debugger was entered... See the file at the following URL location for an example. In this file debug lines are commented out like so ;;(message "#Monkey-Man:123:") http://davinpearson.nz/binaries/dmp-padderise2.el Here is my choice of syntax highlighting so that my checkpoints appear in a dimmer face so they don't unnecessarily clutter up the screen. http://davinpearson.nz/binaries/screenshot.png Executing the command in this file called dmp-padderise2.el: M-x dmp-padderise--uncomment-hash-lines makes all the debug lines visible to the Elisp system. Executing the following command: M-x dmp-padderise--comment-hash-lines comments out the debug lines. Is there a better way to hunt down error messages? Could someone email me a hyperlink to a superior debugging system?