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 8234575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:31:37+00:00 2026-06-07T18:31:37+00:00

I am dabbling in Emacs Lisp and I am trying to write the following

  • 0

I am dabbling in Emacs Lisp and I am trying to write the following function:

(defun buffer-file-name-body ()
  (last (split-string (buffer-file-name) "/")))

What I am trying to achieve is to extract just the file name and extension from the full path given by (buffer-file-name). However, this implementation returns a list of one item ("scratch.el") … I tried several things such as passing the result of (last) through (string) but that raises an error… Google did not return anything useful when I searched for Emacs List convert list to string. How to I do this?

  • 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-06-07T18:31:39+00:00Added an answer on June 7, 2026 at 6:31 pm

    It sounds to me like what you want is (file-name-nondirectory (buffer-file-name)) which returns the simple file name, sans any directory information, as a string.

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

Sidebar

Related Questions

I am currently dabbling in expert systems, emacs lisp, and reading up about artificial
So I have been dabbling around in jQuery a bit this week. Trying to
For a new application I want to start dabbling in BDD and I'm trying
I have been dabbling around this morning trying to modify the jQuery cycle script
I'm dabbling in clojure and am having a little trouble trying to determine the
I am just dabbling with Spring framework. Here I was trying out the parent
Hey I just started dabbling with android programming, and from my short period of
I'm dabbling in functional languages and I have found some algorithms (especially those that
I have been dabbling a little with clisp. It is a little perplexing that
I've been dabbling with socket servers in Java and now I'm ready to get

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.