rpluim
  • Member for 3 years, 6 months
  • Last seen this week
After I updated Emacs 25.1 to 26.1 org-mode does not work any more
18 votes

Emacs 26.1 comes with a much more recent version of org-mode than 25.1. ob-sh was renamed to ob-shell in org-mode 8.2, so you'll need to adjust whichever configuration in .emacs refers to ob-sh, as ...

View answer
Regex for the last line of a string
Accepted answer
8 votes

$ matches at the end of a line, not the end of a string. If you want to match at the end of a string you need to use the \' operator: (string-match "\n.*\\'" "\n \n \n ") => 4 ...

View answer
How to apply arithmetic operators to query-replace-regex
Accepted answer
8 votes

\2 in your replacement is a string, and it needs to be a number in order to perform the division. You could convert it to a number using string-to-number, but there's in-built shorthand for treating ...

View answer
Showing returned values in the same buffer
Accepted answer
7 votes

The emacs way is to ask emacs: C-h k C-x C-e C-x C-e runs the command eval-last-sexp (found in global-map), which is an interactive compiled Lisp function in `elisp-mode.el'. It is bound to C-x C-e. ...

View answer
Automatically scroll *compilation* window, beside source-buffer window
7 votes

This behaviour can be controlled by compilation-scroll-output. compilation-scroll-output is a variable defined in `compile.el'. Its value is `first-error' Original value was nil Documentation: Non-...

View answer
How to display absolute line numbers of a full, widened buffer when narrowing to just part of it?
Accepted answer
6 votes

Specifically for the built-in line-number support in Emacs 26.1: display-line-numbers-widen is a variable defined in `xdisp.c'. Its value is nil Automatically becomes buffer-local when set. ...

View answer
How can I ask emacs to show me (visually) invisible characters like CR LF?
Accepted answer
6 votes

Check out M-xwhitespace-mode and M-xcustomize-group RETwhitespace By default it is set up to visually emphasise spaces, tabs, and line endings, but you can tune it to eg leave spaces alone.

View answer
Combining diacritics not combining visually
Accepted answer
6 votes

For emacs to be able to combine successive characters, you need to be using a font that has support for both of the characters. As per the comments, in your case that was 'DejaVu Sans Mono'.

View answer
What is the fastest way to move simple text to table in org mode?
6 votes

org-mode has org-table-create-or-convert-from-region, bound to C-c |. Just select the region you want to convert beforehand. You can use C-c - at the end of the first line to insert the dashes. Org ...

View answer
Ligatures with the JetBrains Mono font
5 votes

You want to do this with composition rules, not with prettify-symbols. Try this instead: (defconst jetbrains-ligature-mode--ligatures '("-->" "//" "/**" "/*&...

View answer
How to specify prefix argument in key binding
Accepted answer
5 votes

C-u invokes the function universal-argument, and you want to ensure that eval-last-sexp is called as if you invoked it interactively, which is done with call-interactively. You can simulate universal-...

View answer
How to skip some buffers when use prev-buffer/next-buffer?
5 votes

You can control which buffers next-buffer will consider with the buffer-predicate frame parameter. An example which filters out all buffers that match "helm": (defun my-buffer-predicate (buffer) (...

View answer
Using a predefined Regex on a yank
Accepted answer
5 votes

Some of your parens were in the wrong place. I think you were expecting endp to be updated when you do the replace-match, but it has a fixed value, so I changed it to use copy-marker instead, which ...

View answer
Is there a way to revert only certain lines from a diff hunk?
Accepted answer
5 votes

Magit can do this by limiting the revert action to the region. With the built-in diff-mode you can get the same kind of effect by splitting the hunk into portions using diff-split-hunk which is bound ...

View answer
Every letter in emacs is now separated by a space
Accepted answer
4 votes

It's an issue with how Xft calculates the width of characters, which is triggered by Inconsolata. See Inconsolata for full details.

View answer
Recomposing a decomposed character
Accepted answer
4 votes

I don't think Emacs has a mapping from the decomposed form back to the original character. You can look it up using ucs-names though: (defun lookup-composed (decomp) (let (composed) (maphash (...

View answer
Treat symbolic-link as separate files while visiting
Accepted answer
4 votes

From File Aliases: Normally, if you visit a file which Emacs is already visiting under a different name, Emacs displays a message in the echo area and uses the existing buffer visiting ...

View answer
How search text which is on two lines?
Accepted answer
4 votes

You have to use a literal C-j to match the newline, which you can etnter by prefixing it with C-q, i.e. M-x occur RET text-to-find.*C-qC-j.*result (occur also takes a prefix argument that tells it ...

View answer
Is there a natural language date parser in Elisp/Emacs?
Accepted answer
4 votes

org-read-date can handle a certain amount of fuzziness, e.g. '22 sept 0:34’ ⇒ 2006-09-22 0:34 ‘w4’ ⇒ ISO week for of the current year 2006 ‘2012 w4 fri’ ⇒ Friday of ISO week 4 in 2012 ‘2012-w04-...

View answer
Why can I not run (text-scale-increase 2) in emacs 26.1 running in terminal?
Accepted answer
4 votes

In the terminal, the font you're using is determined solely by your terminal emulator, not by Emacs. Emacs only has control over the fonts when running in gui mode.

View answer
Access document title, author, date with elisp
Accepted answer
4 votes

Org is not great at exposing interfaces for this kind of thing, but reading through the source leads me to: (plist-get (org-export-get-environment) :title)

View answer
How to delete all list elements matching a regexp?
4 votes

There are many ways to do this, here's one: (setq mylist (cl-remove-if (lambda (k) (string-match "^a" k)) mylist)

View answer
What is the difference between switch-to-next-buffer and next-buffer?
4 votes

next-buffer is a wrapper around switch-to-next-buffer. Since switch-to-next-buffer takes a WINDOW argument (and doesn't have a default key binding), it's more suitable for programmatic use, whereas ...

View answer
How filter text in shell interactively ("on fly")?
4 votes

If you don't have a grep available, you can use comint-preoutput-filter-functions to do the filtering for you. You need to arrange for that variable to have the right value in shell-mode, which can be ...

View answer
How to select last pasted text
Accepted answer
4 votes

When emacs pastes ("yanks") text, it puts a mark at the start of the text, so selecting it can be done using exchange-point-and-mark, bound to C-xC-x by default.

View answer
Move a file to a directory in the filesystem with emacs lisp
4 votes

That function can actually move files to directories, but its documentation was not in accord with its features. If the destination ends in a /, then the file is moved. e.g. (rename-file "foo" "bar/")...

View answer
Customizing the line separating windows
4 votes

What you want to change is called the right-divider. By default you'll just see a vertical line. Whether the right divider is shown or not is controlled by a frame-parameter called window-divider, ...

View answer
How can I disable ***all*** VC/git awareness?
Accepted answer
3 votes

vc is the package that handles version control for Emacs. You can disable it by customizing vc-handled-backends to nil: vc-handled-backends is a variable defined in `vc-hooks.el'. Its value is (Git) ...

View answer
How to prevent the mode line color from changing after the buffer is switched?
Accepted answer
3 votes

The appearance of the mode-line is governed by two faces: mode-line and mode-line-inactive. The former has a style of raised, and the foreground/background colours are different. Just M-x customize-...

View answer
Why has my .custom file changed between `(quote` syntax and the `'` syntax and how to convert between the two?
Accepted answer
3 votes

It's a change in emacs-27, from etc/NEWS: ** 'print-quoted' now defaults to t, so if you want to see '(quote x)' instead of 'x you will have to bind it to nil where applicable. So binding print-...

View answer