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: Re: Making ielm behave like a shell (getting to previous commands using the up-arrow key) Date: Fri, 18 Dec 2020 22:53:59 +0300 Message-ID: References: <874kklyqi2.fsf@web.de> <87im90dq2s.fsf@web.de> <87mtyb32ud.fsf@web.de> <5f8911eb-b20c-400e-86c6-a6ea6ca3d437@default> <1e2c45df-dd81-4248-b41e-e90469570c98@default> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6742"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: Michael Heerdegen , help-gnu-emacs@gnu.org To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 18 20:57:28 2020 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 1kqLsV-0001dd-25 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 20:57:27 +0100 Original-Received: from localhost ([::1]:48822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqLsU-0001Yn-2f for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 14:57:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqLrG-0001Cf-GZ for help-gnu-emacs@gnu.org; Fri, 18 Dec 2020 14:56:10 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:32951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqLrB-0007yH-CN for help-gnu-emacs@gnu.org; Fri, 18 Dec 2020 14:56:10 -0500 Original-Received: from localhost ([::ffff:41.202.241.37]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001E535.000000005FDD094F.000033E8; Fri, 18 Dec 2020 12:55:58 -0700 Content-Disposition: inline In-Reply-To: <1e2c45df-dd81-4248-b41e-e90469570c98@default> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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:126525 Archived-At: * Drew Adams [2020-12-18 22:12]: > > Programs do not run with `setq' > > there, it is inserted temporary to assign some variables step by step > > until I find what is wrong. > > I see. I misunderstood. So you are not evaluating > the `let*' as written. You are evaluating individual > `setq' sexps you added to it. > > > > (_IGNORED (setq fred 'nope-24)) > > > > I have seen it works with _ alone > > Yes, of course. I want to make it obvious to myself. > > It "works" with any symbol whatsoever, no need for > "_" - that's just an informal convention. It's all > about communicating to human readers (e.g. yourself). I guess that _ will then not complain when byte compiled as unused variable or similar. > > How do you debug? You use edebug-defun? > > I use `debug', not `edebug'. But many people use > `edebug'. I use `debug-on-entry', `debug-on-error', > and explicit calls to `debug' inserted as breakpoints. > For the latter, `(debug nil SOME-SEXP)' evaluates > SOME-SEXP in the debugging context, and prints it > at the top of the debugger when it's entered. So > it acts like an extra call to `message' (more > precisely, it does an implicit `e'). OK I find `message' example and I see it is not necessary as I anyway evaluate with one key in my rudimentary method. It uses message basically. (defun eval-with-setq-sexp () (interactive) (let* ((sexp (thing-at-point 'list)) (end (length sexp)) (_ (set-text-properties 0 end nil sexp)) (sexp (replace-regexp-in-string "^(" "(setq-local " sexp))) (message "%s" (eval (car (read-from-string sexp)))))) If I move cursor to sexp above, it will assign the rest of the form to variable `sexp' and there will be no change of the code. I can see in minibuffer: (sexp (thing-at-point 'list)) but then I have not used `message'. I do use message and I open separate buffer for my particular messages when program is running that I can see if there is some problem overall. Sometimes program finds comma , in the name and cannot send it as email. Messages come there handy. For that I use this function to add to special buffer my private messages and not to mix it with Emacs messages. (defun rcd-mailing-message (s) (let ((buffer "*RCD Mailings Messages and Errors*") (current (current-buffer))) (get-buffer-create buffer) (switch-to-buffer buffer) (goto-char (point-max)) (insert (concat (prin1-to-string s) "\n")) (switch-to-buffer current))) >From there I understand it. Basically I do the same but I was referring to individual line debugging of let form rather than debugging in continual run of the program. I got it now what you mean in regards to `message'.