help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Toggle appointment notification


From: Jean Louis
Subject: Re: Toggle appointment notification
Date: Thu, 3 Dec 2020 00:41:34 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* tomas@tuxteam.de <tomas@tuxteam.de> [2020-12-03 00:14]:
> On Wed, Dec 02, 2020 at 06:08:24PM +0300, Jean Louis wrote:
> 
> [...]
> 
> > I was forgetting that (message) is formatting itself and wanted to
> > forget about it when debugging.
> > 
> > Often I wish to show value of a function in buffer, so I used
> > `message-any', it appeared easier, but need not be. If I forget "%s"
> > then it would not work. 
> 
> Strange. I don't have `message-any'.
> 
> When I want to have in the current buffer, I do
> 
>   (insert (format ...))


In current buffer evaluation is easy with:

{M-x lisp-interaction-mode}

as then with C-j you get result in the next line:

(+ 2 2)
4

Otherwise in any buffer one could bind eval-print-last-sexp to a key
to get same effect, then undo to delete it.

I am often inserting things like pricing by replacing the current
expression:

(defun replace-last-sexp ()
  "Eval last sexp and replaces it in the buffer with its result."
  (interactive)
  (let ((result (eval (elisp--preceding-sexp))))
    (kill-sexp -1)
    (insert (format "%s" result))))

Then when writing emails I write sometimes expression that replaces
itself even with complicated sentences something like this:

With 3 machines and 10 hours of work per day and grade of 0.70 we
can make 1260.00 units, equivalent to US $64863.38 per month.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]