I am trying to use org-mode table formulas in Doom emacs on a Mac. I am trying to follow this guide. I have tried pretty much everything offered in that guide but so far I can only get a single cell to update with a formula, never a whole column.
I tried "=" in the cell below, C-c = and pretty much everything else in the guide I linked.
Maybe this is helping.
But I do not know an elegant solution for a single cell.
Calculate the table after entering the column formula. You can do this with C-c C-c on the TBLFM line, or with C-u C-c * anywhere on the table.
Related
I am learning artist-mode in emacs and finding it pretty interesting.
I want to create shapes and write text inside them as we can do with other software where one can draw shapes.
However, when I type some characters inside a rectangle, the shape gets distorted. The vertical line gets shifted by some characters.
Please see attached image.
Is there something I can do to fix it? Or is it a bug in artist-mode. I watched some screencasts and videos and did not remember anyone mentioning anything about this odd behavior.
I am on Mac and my emacs version is
GNU Emacs 25.1.1 (x86_64-apple-darwin16.0.0, NS appkit-1504.00 Version 10.12 (Build 16A323))
Try this before you type text into a rectangle.
C-x h (Select the whole buffer.)
M-x untabify <RET>
This will make you buffer tab free, which should solve the problem when you are typing.
Note that you should avoid using backspace for deleting text. Move your cursor and overwrite them instead.
There is a workaround I found for this cases.
select text mode
add the relevant text, RET
type term RET (here we specify the font)
RET (No ARGS for figlet, might also depend upon use-cases)
It may be a bit clumsy, but I usually do
select text mode
press Insert (Ovwrt)
add text
enter artist mode
I'm surprised not to see overwrite-mode. This replaces text at point rather than inserting it.
People have mentioned untabify to change tabs to spaces. Use whitespace-mode to see where those tabs (and spaces) are.
I'm new to Clojure and new to Emacs.
Is there an Emacs short-cut to intelligently re-indent the whole file?
if not, is there at least a way to indent selected regions left or right?
I feel like I'm back in the stone age repeatedly pressing the arrows
C-x h selects the entire buffer. C-M-\ reindents the selected region.
Ctrl-x, h (select all) followed by Tab (to indent)
cider-format-buffer command (Since cider 0.9.0)
When you capture data from a sequence like C-u C-c C-e
(cider-eval-last-sexp), the raw data output to your buffer can be
unwieldy to inspect/work with. And the normal code-indenting commands
(mentioned in answers here) don't handle it well.
For handling results from such evaluated expressions, try
cider-format-edn-region.
As a concrete example, have you ever tried reformatting your
~/.lein/profiles.clj? This is pretty hard to do and keep
consistent, until you discover cider-format-edn-region. Take
caution that it will, however, remove any comments.
Use cljfmt for many configurable ways to reformat/reindent. It has an Emacs plugin, but also can be run via lein.
With Emacs, how can I automatically create comments titles like this one:
;;###############################################################################
;; title
;;###############################################################################
The purpose is to comment code (in this case Emacs configuration file) by sectioning the code in a clear way. I don't want to do this by hand because it takes time and it's often not perfectly centered.
M-x comment-box
is the solution
I'm new to Clojure and new to Emacs.
Is there an Emacs short-cut to intelligently re-indent the whole file?
if not, is there at least a way to indent selected regions left or right?
I feel like I'm back in the stone age repeatedly pressing the arrows
C-x h selects the entire buffer. C-M-\ reindents the selected region.
Ctrl-x, h (select all) followed by Tab (to indent)
cider-format-buffer command (Since cider 0.9.0)
When you capture data from a sequence like C-u C-c C-e
(cider-eval-last-sexp), the raw data output to your buffer can be
unwieldy to inspect/work with. And the normal code-indenting commands
(mentioned in answers here) don't handle it well.
For handling results from such evaluated expressions, try
cider-format-edn-region.
As a concrete example, have you ever tried reformatting your
~/.lein/profiles.clj? This is pretty hard to do and keep
consistent, until you discover cider-format-edn-region. Take
caution that it will, however, remove any comments.
Use cljfmt for many configurable ways to reformat/reindent. It has an Emacs plugin, but also can be run via lein.
total Emacs noob here. So right now I'm working on a fairly big LaTeX project in Emacs in which there are couple of places where I need to index some words, using the makeidx package. Because I also wanted indexed words to be bold, I created my own command \ind{} which would make the argument go bold and indexed. But right now I'm dissatisifed with this command so I'd like to change every instance of \ind{whatever} in my text by \textbf{whatever}\index{whatever by default}.
The thing is I know exactly what I want :
Go through the text, look for any instance of \ind{ and replace by \textbf{ using search-and-replace
Save the argument of \ind ("whatever" in this case) in memory
Ask me the user what should the argument of \index be. By default (by striking enter), it should be the first argument, but I can also change my mind and enter something different ("whatever by default" in this case). If there's no input (only a space " " for example) stop the program.
Write down \index{, the new argument and }.
Go to next occurance in the text.
But, alas!, I know not how to achieve this, so I need someone's help. If it should take too much time to explain how to do such a thing, would you please send me some tutorial about writing my own functions?
I hope I'm being clear, and thanks for your patience!
This approach seems vaguely unorthodox to me, but it works and seems sufficient for a one-off job...
In the replacement text for replace-regexp and query-replace-regexp (C-M-%), one newer escape sequence is \,(...), where ... can be any Lisp expression. There's a Lisp function read-from-minibuffer which reads arbitrary text typed by the user, with an optional default. Therefore:
C-M-%: Start query-replace-regexp.
\\ind{\([^}]+?\)}: The pattern to search for.
\\textbf{\1}\\index{\,(read-from-minibuffer "index content? " \1)}: The replacement text. The user will be prompted for the text to put in the braces following the \index{} element, using the original text between the braces following the \ind{} element as a default.
Note that when using query-replace-regexp, you'll have to confirm each choice by typing y after each. Use M-x replace-regexp if you want to avoid this step.
Vlad give you the LaTeX answer to your problem. An Emacs solution is the key-macro: start with
C-x (
to define a new macro, then do one step of your change, say:
C-s \ind{
<left>ex
Then copy and paste the argument in the \textbf macro... You have to be careful to move in a way that will be repeatable. Once the standard modification is done, you let the cursor after the whatever by default and end the definition by
C-x )
now C-x e will call the macro you just define, letting your cursor at the correct place to change the part you want to change You can also repeat the e to call the macro several time at once.
Why not just redefine the \ind so that it can get an optional argument?
For example:
\newcommand{\ind}[2][]{%
\def\first{#1}%
\ifx\first\empty
\textbf{#2}\index{#2}%
\else
\textbf{#2}\index{#1}%
\fi
}
This way you can use \ind{whatever} or \ind[whatever-else]{whatever}.