![](/style/images/good.png)
![](/style/images/bad.png)
How do I insert text in a buffer without the & ldquo; Nil & rdquo;
source link: https://www.codesd.com/item/how-do-i-insert-text-in-a-buffer-without-the-nil.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How do I insert text in a buffer without the & ldquo; Nil & rdquo;
I've got a function to insert the current date into my file
(defun insert-date ()
(interactive)
(insert
(format-time-string "%m-%d-%Y")))
This works for inserting the date into my current buffer, however the output is 01-24-2011nil
How can I remove the nil from the input.
As noted above, insert
returns nil
and inserts the arguments as a side effect. Since you've declared your function interactive
, you can call it using M-x. Even if you don't declare it interactive, you can say M-: (insert-date)
.
Related Articles
How do I get Visual Studio 2010 to refresh the & ldquo; Latest & rdquo; Status of locally deleted file
How do I perform aggregation without the & ldquo; By & rdquo; In Linq?
How do I know if my PostgreSQL server uses the & ldquo; C & rdquo; place?
How do I tell Visual Studio to always extend the "& ldquo; Find" & rdquo; group in the Find dialog box?
IntelliJ: How to add JavaDoc to an existing class using the & ldquo; Class & rdquo; model
How to stop Linux using C ++ or Qt without calling & ldquo; system () & rdquo;
How to close a modal box without the & ldquo; x & rdquo;
How do I get my program to stop once the & ldquo; Q & rdquo; Is the button pressed in AutoIt?
How to use String.format () in Java to replicate the & ldquo; \ t & rdquo;
How do I insert text in the TextBox at the cursor point?
How can I insert a pandas data frame into the database without duplicating data?
How to check a text box is disabled when the item has no read-only and enabled attributes
How can I insert text into a string in Perl?
How can I insert text behind the character specified in Vim?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK