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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:31:52+00:00 2026-06-14T22:31:52+00:00

In *scratch* buffer in Emacs Lisp after you evaluated an expression that evaluates to

  • 0

In *scratch* buffer in Emacs Lisp after you evaluated an expression that evaluates to a complex Lisp form, that form is “abbreviated”, i.e. some long lists or its inner parts are replaced by ellipses. Looks something like:

(let* ((--3 (make-hash-table)) d c (--5 (let ... ... ...)) (--6 0) (--0 (make-
hash-table)) b a (--1 0) --7) (catch (quote --2) (maphash (lambda ... ... ... 
... ... ... ...) --0)) (nreverse --7))

vs expanded version:

(let* ((--3 (make-hash-table)) d c (--5 (let (--4) (maphash (lambda (k v) 
(setq --4(cons k --4))) --3) (nreverse --4))) (--6 0) (--0 (make-hash-table)) 
b a (--1 0) --7) (catch (quote --2) (maphash (lambda (k v) (when (or (> --6 
150) (> --1 100)) (throw (quote --2) nil)) (setq a k b v) (setq c (car --5) d 
(gethash (car --5) --3) --5 (cdr --5)) (incf --6) (setq --7 (cons (list (cons 
a b) (cons c d)) --7)) (message "a: %s, b: %s, c: %s, d: %s" a b c d)) --0)) 
(nreverse --7))

If I press RET in the expanded or collapsed state, it toggles the state back. Obviously, my first reaction is to try to format the output, so I press RET! And then it will either collapse or expand, depends on whichever state it was in. If I copy and paste the whole thing, then it is treated as normal text, but is there a faster way of doing it? I.e. I would like to permanently expand it, w/o having to copy-paste.

I couldn’t find the function which toggles the state (perhaps I’m calling it incorrectly). It took me a while to realize it was possible to toggle it anyway (yeah, it displays that in a tooltip, but who uses mouse in Emacs?).

Also, I, in general, like the idea, is it possible to apply it to other languages too? Where can I read more about this feature?

  • 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-14T22:31:53+00:00Added an answer on June 14, 2026 at 10:31 pm

    Two variables control the print out of results of eval-expression. in the *scratch* buffer:

    eval-expression-print-length
    eval-expression-print-level
    

    You could set those to nil and the result would always be expanded.

    If you just want the RET to switch to the fully expanded (and not to toggle), you can use this advice to strip the text properties which enable the toggling of display state:

    (defadvice last-sexp-toggle-display (after last-sexp-toggle-display-only-long-form activate)
      "After the function is called, check to see if the long form had been displayed, and if so, remove property enabling toggling"
      (save-restriction
        (widen)
        (let ((value (get-text-property (point) 'printed-value)))
          (when value
            (let ((beg (or (previous-single-property-change (min (point-max) (1+ (point)))
                                                            'printed-value)
                           (point)))
                  (end (or (next-single-char-property-change (point) 'printed-value) (point)))
                  (standard-output (current-buffer))
                  (point (point)))
              (if (< (length (nth 1 value)) (length (nth 2 value)))
                  (remove-text-properties beg end '(printed-value))))))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I must write in my .emacs file so that the *scratch* buffer is
In regular emacs my understanding was that if you killed the scratch buffer, when
I'm building from scratch a web application that is not trivial (have some algorithms
I have a C library that wants a temporary buffer for scratch space. I'm
If I accidentally closed the scratch buffer in Emacs, how do I create a
I usually play with elisp code on my scratch buffer. I find it hard
I've written a site CMS from scratch, and now that the site is slowly
While developing a navigation based application from scratch, I added some new uisubview Controller
While compiling Linux from scratch I realize that there are compile codes that appear
The scratch message always says: ;; This buffer is for notes you don't want

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.