Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
9 votes
Accepted

What does hash s indicate in lisp

That is a struct of elfeed-entry (defined by elfeed). The #s here means struct. The first one is for elfeed-entry, the second is for elfeed-ref. (cl-defstruct website name shortname url shorturl) (...
Kisaragi Hiu's user avatar
7 votes
Accepted

Write `var0, var1, var2, ..., var10` in a buffer

The fastest way is to use the macro counter: C-x( starts recording a macro varF3,space inserts 0 as the initial value of the counter M-1M-0 repeat the following 10 times C-xe execute the macro
choroba's user avatar
  • 2,065
7 votes
Accepted

What is the meaning of the ellipsis at the end of some output?

... = truncated = abbreviated = ellipsis See eval-expression-print-level and eval-expression-print-length: https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html See also print-...
lawlist's user avatar
  • 19.2k
7 votes
Accepted

print unquoted output to stdout from emacsclient

It seems that emacsclient is the wrong way to do what I want. I thought I could not use emacs --batch because I wanted to get "live" info from my running emacs instance. The missing piece of the ...
Colin Fraizer's user avatar
7 votes
Accepted

Difference between (quote string) and "string"

'list and "list" are different datatypes: ELISP> (type-of 'list) symbol ELISP> (type-of "list") string Note that they even show up differently in your example -- it's the difference between ...
zck's user avatar
  • 9,102
6 votes
Accepted

Can I tell prin1-to-string to use reader-macros?

Just bind print-quoted to a non-nil value around the call to prin1(-to-string).
Stefan's user avatar
  • 26.5k
6 votes
Accepted

How to print a PDF, displayed with pdf-tools, from Emacs?

You need to set the variable pdf-misc-print-programm and possibly also pdf-misc-print-programm-args in the pdf-misc customisation group. They should be set to the system command that you will print ...
Tyler's user avatar
  • 22.3k
5 votes
Accepted

Can I print output to stderr in batch mode WITHOUT a trailing newline?

According to the manual, anything printing a message in batch mode will use stderr for this. The print/prin1/princ family will continue printing to stdout unless you pass the optional argument for ...
wasamasa's user avatar
  • 22.2k
4 votes
Accepted

Emacs lisp format doesn't print to *scratch*?

format generates a string, but it doesn't do anything with it. You probably want to pass the result of format on to something that does: (defun mt () (dotimes (x 20) (dotimes (y 20) (...
Tyler's user avatar
  • 22.3k
4 votes

Percentage sign in `print` and `message`

By running (message (format ...)), you're using the string as a format twice. print takes an object as its parameter, while message takes a format string. Use "%s" as the format and you can ...
choroba's user avatar
  • 2,065
4 votes

the Term “Hash Notation“ in the Elisp Manual

Just for the second question: The “Hash Notation” is just a kind of notation using “#”. The mark “#” is named “hash mark”, so there is nothing to do with “hash function”.
Segrece's user avatar
  • 83
3 votes

Write `var0, var1, var2, ..., var10` in a buffer

print will output to the echo area rather than putting stuff in your buffer. You're looking for insert and dotimes: (dotimes (i 10) (insert (format "var%d, " i))) (alternatively you can use keyboard ...
rpluim's user avatar
  • 5,315
3 votes

elisp - print result not found after eval-buffer

Nowhere. See the docstring (C-h f eval-buffer): (eval-buffer &optional BUFFER PRINTFLAG FILENAME UNIBYTE DO-ALLOW-PRINT) Execute the accessible portion of current buffer as Lisp code. ...
JeanPierre's user avatar
  • 7,475
3 votes
Accepted

How to print a quoted sexp using '... (reader syntax) instead of using (quote ...)?

C-h v print-quoted: print-quoted is a variable defined in C source code. Its value is nil Documentation: Non-nil means print quoted forms with reader syntax. I.e., (quote foo) ...
Drew's user avatar
  • 77.8k
3 votes

Temporarily suppressing standard-output

You were following a good line of enquiry regarding standard-output, but just didn't manage to find the right information. The value of standard-output has to be a valid value for the PRINTCHARFUN ...
phils's user avatar
  • 51.5k
3 votes
Accepted

Iterate only length times over a list

Welcome to SE Emacs. The nil you are seeing is not an extra iteration: it is simply the return value of the dolist or dotimes function.
Fran Burstall's user avatar
3 votes

command print no results with (interactive "r")

You're confusing the echoing of the return value by M-: with the action of M-x. M-: expressly evaluates a sexp and prints the resulting value. M-x invokes a command. Your command does not, itself, ...
Drew's user avatar
  • 77.8k
3 votes

How to print bash results properly?

Add :results output like that: #+begin_src sh :results output tree -d -L 3 /usr/share/emacs/28.2/lisp #+end_src This overrides the default :results table setting and wraps the results (assuming they ...
crocefisso's user avatar
  • 1,351
2 votes

Under Cygwin, how do we get a list of available printers?

Well it turns out that the long-complicated-names-with-goobers listed in the "Devices and Printers" "Control Panel" / "Windows Settings" really are the printer names... ick. (setq printer-name "...
cira's user avatar
  • 41
2 votes

Get a better printed representation of a hash-table

Note: this solution is just for pretty visualization of a complex hash-table and can't really be read back Another option would be to use the yaml.el package (https://melpa.org/#/yaml) which provides ...
Zac Romero's user avatar
2 votes

Get a better printed representation of a hash-table

EDIT An even easier/more straightforward alternative to my original answer is to just use maphash: (let (plist) (maphash (lambda (k v) (push k plist) (push v plist)) ...
dalanicolai's user avatar
  • 7,845
2 votes
Accepted

How to do 'Hello World' in Emacs-LISP on Eshell and display evaluation in shell area itself, instead of echo area or *message* Buffer?

Put (just) this in "hello.el": (prin1 "Hello, world!") Then from the eshell prompt: ~/temp $ eshell-source-file "hello.el" Hello, world! ~/temp $ I may be misunderstanding your general intent but ...
bikenaga's user avatar
2 votes

How to do 'Hello World' in Emacs-LISP on Eshell and display evaluation in shell area itself, instead of echo area or *message* Buffer?

A couple of options: eshell can be configured to route specific commands (and subcommands) to the regular terminal. See the documentation for visual commands. Whether or not this is worth the trouble,...
ben rudgers's user avatar
2 votes
Accepted

org mode inline image from elisp code block

Change (print (format "[[./%s]]" pngname)) to (princ (format "[[./%s]]" pngname))
John Kitchin's user avatar
  • 11.9k
2 votes

Emacs lisp format doesn't print to *scratch*?

I'd probably use a different approach, using mapconcat to apply the function and concatenate the results: (let ((range (number-sequence 1 20))) (mapconcat (lambda (y) (mapconcat (...
choroba's user avatar
  • 2,065
2 votes
Accepted

Duplicate output from princ / pp?

Evaluating(princ 1) with C-x C-e (eval-last-sexp) displays the following in the echo area 11 (#o1 #x1 ?\C-a) because (princ 1) prints 1 and returns the integer 1. And (pp 1) is the same as (princ "1"...
xuchunyang's user avatar
  • 14.6k
2 votes

Write `var0, var1, var2, ..., var10` in a buffer

I'd use a macro just as @choroba did (with F3 in place of C-x ( and F4 instead of C-x e, for brevity and to be able to easily specifying a non-zero starting number, as @DoMiNeLa10 mentioned), but if ...
Omar's user avatar
  • 4,832
2 votes
Accepted

Working with printed macro expansions

The question is really more about printing Lisp sexps (including results of evaluation) than it is about macro expansion, per se. It's just that macro expansion typically results in a large Lisp sexp ...
Drew's user avatar
  • 77.8k
2 votes
Accepted

Why in elisp function only the first print is displayed

By default, print prints to the echo area where you are likely to see the last thing printed only. However, the output also goes to the *Messages*buffer (do C-h e to get there fast) where you will ...
Fran Burstall's user avatar
2 votes

the Term “Hash Notation“ in the Elisp Manual

It seems that the GNU Emacs Lisp Reference Manual has actually cleared up this misunderstanding. See Chapter 8 Hash Tables: Hash notation, the initial ‘#’ character used in the printed ...
shynur's user avatar
  • 5,318

Only top scored, non community-wiki answers of a minimum length are eligible