wasamasa
  • Member for 7 years, 4 months
  • Last seen this week
Can I use an image in my modeline lighter?
Accepted answer
11 votes

The mode line is rendered from a list of segments, each of which come with their own special rules. See Mode Line Data for the details. The symbol section contains a crucial hint to make your code ...

View answer
Run code right after compilation
Accepted answer
11 votes

Try using compilation-finish-functions: (defun my-compilation-finish-function (buffer desc) (message "Buffer %s: %s" buffer desc)) (add-hook 'compilation-finish-functions 'my-compilation-finish-...

View answer
Partial function application
Accepted answer
11 votes

The idea of transforming functions into different functions with specialized arguments has been elaborated upon in SRFI 26. There's an Emacs Lisp implementation of it in the very useful dash.el ...

View answer
ielm, bound to a certain buffer
Accepted answer
11 votes

Hit C-c C-b to select a buffer for IELM to work upon.

View answer
Switching between window layouts
11 votes

Emacs offers registers to save and apply data such as your current window configuration, this can be done with C-x r w and C-x r j. However this approach gets unwieldy since you need to remember the ...

View answer
Exporting beamer with org-mode
Accepted answer
10 votes

Beamer export is very similiar to LaTeX export in Org-Mode, all you need to do is hitting M-x org-beamer-export-to-pdf or C-c C-e l p from the Org buffer you're working on. The majority of options ...

View answer
How can I disable evil in help-mode?
Accepted answer
10 votes

The reason this fails is because help-mode is in evil-motion-state-modes by default, adding it to evil-emacs-state-modes will therefore not have the desired effect as Evil looks it up in evil-motion-...

View answer
How to invoke functions that are quoted in let?
Accepted answer
10 votes

There seems to be a fair bit of confusion how quoting works. In Lisp, symbols and lists fulfill a dual meaning, depending on whether they're quoted or not: Unquoted symbol: Evaluate the symbol (by ...

View answer
How to perform a modifying action without modifying buffer?
Accepted answer
10 votes

There is a built-in macro for this, with-silent-modifications. Its intended usecase is for making changes to text properties of a buffer as text properties are part of the text and changes to them ...

View answer
Equivalent of Sublimes text expansion
Accepted answer
10 votes

Try using dabbrev with M-/, it expands strings from the same and other buffers inline. A more powerful alternative you can customize with your own functions is hippie-expand.

View answer
Is there a general way to 'expand' a list for to be used as individual arguments to another function?
Accepted answer
10 votes

(apply #'concat '("foo" "bar" "baz"))

View answer
How can I add a new colon-command to Evil?
Accepted answer
10 votes

The official way of doing this is demonstrated in evil-maps.el. Therefore, creating a new ex command is very simple: (evil-ex-define-cmd "b[utterfly]" 'butterfly) You'll want to either use this ...

View answer
org-table alignment issues in osx
Accepted answer
10 votes

While org-mode is a very flexible tool, it has some very hardcoded limitations in its core functionality. The one you're encountering is the reliance on a monospaced font (such as Andale Mono, Monaco ...

View answer
Showing bytes as hexadecimal escapes rather than octal escapes
9 votes

edit: With Emacs 26.1 or later, it's a (setq display-raw-bytes-as-hex t) away. No, you can't. The display of unprintables above the printable ASCII range is hardcoded in xdisp.c: if (CHAR_BYTE8_P (...

View answer
How to view package Full Description (commentary section) inside Emacs
Accepted answer
9 votes

M-x finder-commentary RET <library-name> RET extracts that section and presents it in a separate buffer for reading. There is also M-x finder-by-keyword for discovering libraries this way.

View answer
How to make a video game with emacs?
9 votes

First of all, Emacs is a text editor. Teaching it other tricks is a neat pastime (I engage in it all the time), but I've learned to lower my expectations. I know of a single framework attempt (which ...

View answer
If longlines-mode is removed in new emacs, how can I soft-wrap the line around the column instead of window edge?
Accepted answer
9 votes

No. To emulate the behaviour of longlines-mode, use visual-line-mode in combination with the visual-fill-column package.

View answer
What is the file local variable mangle-whitespace?
Accepted answer
9 votes

I've grepped my ~/.emacs.d/elpa for mangle-whitespace and noticed it's used in a few packages which are all written by Roland Walker. Then I proceeded downloading the tarballs for Emacs 22.1 to Emacs ...

View answer
Find out backend used in company completion
Accepted answer
9 votes

company has a very useful feature that modifies its modeline lighter to display the backend currently in use.

View answer
Show current function in header line
9 votes

This sounds a lot like you've followed this Emacs Redux blog post which is using which-func-mode. It explains its purpose (displaying the current function point is within), demonstrates how to enable ...

View answer
Emacs Blue color too dark
8 votes

Faces in Emacs can have different values, depending on display attributes such as the number of colors supported or whether they're displayed on a light/dark background. Emacs can guess the latter ...

View answer
Parsing an Orgmode file with org-element-parse-buffer
Accepted answer
8 votes

Your code is missing one crucial thing, it's not the parsing step that applies keywords locally, it's enabling org-mode that does. Considering that you're in a temporary buffer, you'll have to do ...

View answer
How to set the region (selection) programmatically in Emacs Lisp using indices?
Accepted answer
8 votes

The region is defined as the span of text between point and mark, therefore it's sufficient to adjust both to the numbers in question. The following uses point-min and point-max for that purpose: (...

View answer
equivalent of unix "which" for exec-path?
8 votes

You can attempt locating an executable in exec-path with executable-find: (executable-find "ls") ;=> "/usr/bin/ls" (executable-find "sl") ;=> nil

View answer
How to make local function binding for closure?
Accepted answer
8 votes

Without cl-lib: ;; -*- lexical-binding: t; -*- (defun nats () (letrec ((inner (lambda (n) (cons n (lambda () (funcall inner (1+ n))))))) (funcall inner 0))) (let* ((stream (nats)) (i (...

View answer
More than one line in mode-line?
8 votes

I'm afraid this is generally not possible as newlines in mode-line-format are interpreted verbatim and appear as ^J or ^M. What could work would be replacing the mode line with an image spanning two ...

View answer
How can I turn off numbering for figures?
8 votes

I'm afraid you can't influence this in the HTML export (as opposed to the LaTeX export which allows adding arbitrary captioning code) because the behaviour is hardcoded in Org's org-html-paragraph: (...

View answer
Is using cl-lib crucial for writing good Emacs Lisp code?
8 votes

Emacs Lisp doesn't really have "Best Practices". Judging from all the code I've read so far, people instead go for what is most convenient for them. And given that Emacs Lisp and Common Lisp are ...

View answer
Distinguish C-u <key> from C-u 4 <key>
Accepted answer
8 votes

Sure. Use the raw prefix argument instead: (defun my-prefix-test (arg) (interactive "P") (cond ((consp arg) (message "Prefix argument")) ((numberp arg) (message "Numeric argument")) ((...

View answer
How to make a shell command totally silent (preventing it to split window or to open a new frame/window etc)
8 votes

Use display-buffer-alist with the display-buffer-no-window if you're on Emacs 24.4 or later. (setq display-buffer-alist '(("\\`\\*Async Shell Command\\*\\'" display-buffer-no-window))) Alternatively,...

View answer
1
2
3 4 5
13