Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 462759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:06:26+00:00 2026-05-12T23:06:26+00:00

I started using defaultcontent.el to fill newly-created buffers with content. Apparently this module is

  • 0

I started using defaultcontent.el to fill newly-created buffers with content.
Apparently this module is not widely used. I think there are 3 people including me and the author who use it, because when I do a search on it, my published emacs.el comes up as the first hit.

Despite that, I find it useful. I specify a template for each file type, and every time I create a new file of that type (or extension), it gets filled with the content in the template file. The template supports well-known tags set off with “@@”, that get substituted at runtime:

  • AUTHOR inserts the user name;
  • DATE (obvious);
  • FILENAME, inserts the name of the file being created;
  • ENV(xxx), inserts the value of the environment variable xxx;
  • and there are a few other tags.

eg, whereever @@AUTHOR@@ is found in the template, it gets replaced with your user name at runtime in the newly created file.

ok, this isn’t an advertisement for defaultcontent.el, I just thought I’d explain it a little.


here’s the question.

One of the well-known tags in the template is LISP – it purports to run arbitrary elisp code to generate content to insert into the new buffer. (usage: @@LISP(lisp content here)@@). It depends on a function read-closest-sexp, which I guess would just read the sexp at point.

I can’t find this function. It’s not included in defaultcontent.el, and I’m not up enough on elisp to create it easily. I looked in emacs-lisp\lisp.el for hints but it seemed non obvious.

Question: how can I read the sexp at point into a variable?

I’m guessing this is 2 lines in elisp…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:06:27+00:00Added an answer on May 12, 2026 at 11:06 pm

    Try thing-at-point:

    (require 'thingatpt)
    (let ((sexp (thing-at-point 'sexp)))
      (do-something-with sexp))
    

    Indeed two lines if you ignore the do-something 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 524k
  • Answers 524k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I found the problem, but did not find a way… May 16, 2026 at 10:02 pm
  • Editorial Team
    Editorial Team added an answer For an indepth explanation see: http://www.mediawiki.org/wiki/Category:Wiki_page_URLs However, here is a… May 16, 2026 at 10:02 pm
  • Editorial Team
    Editorial Team added an answer volatile qualifier is a common part of the entire declaration.… May 16, 2026 at 10:02 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Started using PDO prepared statements not too long ago, and, as i understand, it
I started using NHibernate this week (struggling). I have a small application with 3
I started using subversion for one of my projects and it would be absolutely
I started using NetBeans for Python development, and so far it looks pretty good.
I started using the jquery ui library to add some enhanced UI elements to
We started using Google Maps on our web application rather extensively. It worked fine
I started using bazaar after a long camping in the svn field. I had
I started using Pyant recenently to do various build/release tasks but have recently discovered
We started using C# (.NET 3.0) and I wonder how you guys are using
I started using Python in 2001. I loved the simplicity of the language, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.