unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Drew Adams <drew.adams@oracle.com>
Cc: Michael Heerdegen <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <X90I1+jbyrHRR/Xp@protected.rcdrun.com> (raw)
In-Reply-To: <1e2c45df-dd81-4248-b41e-e90469570c98@default>

* Drew Adams <drew.adams@oracle.com> [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'.




  reply	other threads:[~2020-12-18 19:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17  3:02 Making ielm behave like a shell (getting to previous commands using the up-arrow key) steve-humphreys
2020-12-17  3:34 ` Okam
2020-12-17  4:27 ` Michael Heerdegen
2020-12-17  4:44   ` steve-humphreys
2020-12-17  5:02     ` Michael Heerdegen
2020-12-17  5:17       ` steve-humphreys
2020-12-17  9:06         ` Jean Louis
2020-12-17  9:13           ` Jean Louis
2020-12-17 22:29           ` Michael Heerdegen
2020-12-18  5:05             ` Jean Louis
2020-12-18  9:01               ` Michael Heerdegen
2020-12-18 11:19                 ` Jean Louis
2020-12-18 17:14                   ` Drew Adams
2020-12-18 18:36                     ` Jean Louis
2020-12-18 19:11                       ` Drew Adams
2020-12-18 19:53                         ` Jean Louis [this message]
2020-12-18 21:15                           ` Drew Adams
2020-12-19  2:07                   ` Michael Heerdegen
2020-12-19  2:51                     ` Drew Adams
2020-12-18 11:28                 ` Jean Louis
2020-12-19  1:55                   ` Michael Heerdegen
2020-12-19  2:45                     ` Drew Adams
2020-12-19  1:57               ` Michael Heerdegen
2020-12-17  8:22   ` Joost Kremers
2020-12-18 10:20     ` Philip K.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X90I1+jbyrHRR/Xp@protected.rcdrun.com \
    --to=bugs@gnu.support \
    --cc=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).