Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [format]

The tag has no usage guidance.

1
vote
1answer
34 views

european-calendar-style not working

I have the following in my init.el file: (setq org-agenda-span 36) (setq org-agenda-start-on-weekday 1) (setq european-calendar-style t) However, diary blocks are still interpreted as month first, ...
0
votes
0answers
112 views

clang-format malfunctioning(?) Or am I not fully understanding how clang-format works?

I installed the clang-format package from melpa. I then added the following lines to my init file: (require 'clang-format) I then created a test directory, cpp-proj with one file, main.cpp. main....
2
votes
1answer
37 views

Why does (format “%x” some-large-number) produces incorrect results?

I wanted the hexadecimal string for a large integer such as below: (format "%x" 2738188573457603759) This returns 2600000000f95c00 which is incorrect, it should be 2600000000f95caf. The value of ...
1
vote
3answers
69 views

How can I convert a list of integers to a string?

Let's say I have a list of integers, representing year, month, day for a date: (2017 8 21) and I want to format the list in one function call, as in (format "%04d-%02d-%02d" 2017 8 21) Is there an ...
1
vote
2answers
172 views

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

I've got this function (defun mt () (dotimes (x 20) (dotimes (y 20) (format "%3d " (* (1+ x) (1+ y)))) (format "\n"))) in my *scratch*. a Ctr-= prints back mt. But then ...
1
vote
1answer
470 views

Percentage “%” in format string

(format "Hard-coded value is 100\% and the variable is %s" "50\\%") Returns Debugger entered--Lisp error: (error "Invalid format operation %a") format("Hard-coded value is 100% and the variable is ...
-1
votes
1answer
977 views

Auto format messy code

I am currently learning C++ and I am in the process of configuring Emacs as my C++ IDE. I am reading a PDF guide and copying code into my Emacs buffer. However upon pasting the code the formatting is ...
1
vote
0answers
105 views

Better display of local time in message-insert-formatted-citation-line?

The default behavior in emacs-25 for the following code is for message citation lines to display the time in UTC, even if (current-time-zone) returns a local time zone such as (-18000 "EST"), and even ...
2
votes
1answer
60 views

How to escape % in emacs

I'm trying to add a search engine in emacs-w3m and use duckduckgo to search emacswiki (eval-after-load "w3m-search" '(progn (setq w3m-search-engine-alist (append '( ...
1
vote
1answer
218 views

How to format (print) output of the shell-command function

I have this (defun insert-dateutc () (interactive) (shell-command "printf %s $(date +\"%Y-%m-%dT%H:%M:%S\")" t)) which I want to use in this (defun foo1 () (format "this is the date-time %s" (...
1
vote
2answers
2k views

customize the clang format

I know I can create a .clang-format file, and use this per project, but what I'd really like is a way to set the default clang-format style to one of the available formats, so I can experiment with ...