[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inserting some text in a working buffer
From: |
Emanuel Berg |
Subject: |
Re: Inserting some text in a working buffer |
Date: |
Sat, 08 May 2021 20:02:57 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
michael-franzese wrote:
> (defun insert-text (text)
> "Inserts text frem beginning of line located at cursor point."
> (interactive)
> (with-current-buffer (buffer-name)
> (goto-char (point))
> (insert text)
> (next-line)) )
Hahaha :)
"(with-current-buffer (buffer-name)" - you are already in that
buffer...
and "(goto-char (point))" - you are already there!
"(next-line)" - see the help, one should use `forward-line'...
There is nothing in the code to do it "frem" beginning of line
but you can use `beginning-of-line' for that...
--
underground experts united
https://dataswamp.org/~incal