0

How do I insert text in a buffer without the & ldquo; Nil & rdquo;

 2 years ago
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;

advertisements

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

I'm new to TFS & VS2010, but I don't seem to be able to find an answer to this question anywhere... I have previously checked out word documents from VS2010, made changes, checked them back in, and then deleted the local copy on my machine. How can I

How do I perform aggregation without the & ldquo; By & rdquo; In Linq?

Everything I can find in linq for aggregation has a "group by" clause. How would I write this query in LINQ? I have a list of date-value pairs, and I want to take the average of the values: SELECT AVG(MySuff.Value) AS AvgValue FROM MyStuff The a

How do I know if my PostgreSQL server uses the & ldquo; C & rdquo; place?

I'm trying to optimize my PostgreSQL 8.3 DB tables to the best of my ability, and I'm unsure if I need to use varchar_pattern_ops for certain columns where I'm performing a LIKE against the first N characters of a string. According to this documentat

How do I tell Visual Studio to always extend the "& ldquo; Find" & rdquo; group in the Find dialog box?

I expand it, but it collapses sometimes, and it gets very annoying. How do I make it always be expanded?You use the CTRL+F key combination to open find options. If you want to open find dialog pop-up, you can use CTRL+SHIFT+F key combination. It is a

IntelliJ: How to add JavaDoc to an existing class using the & ldquo; Class & rdquo; model

When I create a new test class with CTRL + SHIFT + T in IntelliJ (using 13.1.3), the new class has no class JavaDoc. I do have a template for new Class, and for new Interface, but those do not get used when I create a new test class as described abov

How to stop Linux using C ++ or Qt without calling & ldquo; system () & rdquo;

I want to shutdown an Embedded Linux when a close button is pushed on the UI. I know I can do it with a call to system: system("shutdown -P now"); Ref: Link But knowing that using system is not advised, I'ld like to know if there is another way

How to close a modal box without the & ldquo; x & rdquo;

I'm trying to build a modal box in HTML / Javascript and I've found this sample (rif. https://www.w3schools.com/howto/howto_css_modals.asp), that's quite good for me ... I've modified it in this way .... <html> <head> <style> /* The Moda

How do I get my program to stop once the & ldquo; Q & rdquo; Is the button pressed in AutoIt?

I currently have a program set up in AutoIt. This is what's written as the code, as well as some notes that may be useful to answering my question: ;File with data is pw.txt $fh = FileOpen("pw.txt") ;Loops 5 times, every time it loops $attempt s

How to use String.format () in Java to replicate the & ldquo; \ t & rdquo;

I'm printing data line by line and want it to be organized like a table. I initially used firstName + ", " + lastName + "\t" + phoneNumber. But for some of the larger names, the phone number gets pushed out of alignment I'm trying to u

How do I insert text in the TextBox at the cursor point?

How can you insert text into a TextBox at the current cursor position?Text can be inserted at the current cursor position of a TextBox by setting SelText to a string: TextBox1.SelText = "text to be inserted"

How can I insert a pandas data frame into the database without duplicating data?

I used .to_sql function to insert data. But it can't check duplicated insert data. (It only can check the duplicated tables) source code) when I run twice of the source code below. userData.to_sql(con=engine, name='test_quest_complete', schema='test'

How to check a text box is disabled when the item has no read-only and enabled attributes

How to verify a text-box is disabled when the element has no read-only and enabled attributes using selenium webdriver and java? " " I tried "isenabled" and "getattribute(readonly)" - but both do not work in my case WebElemen

How can I insert text into a string in Perl?

If I had: $foo= "12."bar bar bar"|three"; how would I insert in the text ".." after the text 12. in the variable?Perl allows you to choose your own quote delimiters. If you find you need to use a double quote inside of an int

How can I insert text behind the character specified in Vim?

Here is the raw material I'm working with: First. This is the second line. The third. I want to insert "insert something behind 4 character" in the text, to make it become Firsinsert something behind 4 charactert. Thisinsert something behind 4 c

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK