Erik Sjöstrand
  • Member for 6 years, 4 months
  • Last seen more than a week ago
read clipboard into yasnippet
Accepted answer
6 votes

You can use backticks to run elisp code in snippets. Here's a full example snippet which works for me: # -*- mode: snippet; require-final-newline: nil -*- # name: yank # key: yank # -- [[${1:`(...

View answer
In exwm (Emacs X Window Manager) how can I switch to previous workspace?
Accepted answer
4 votes

I do not think there's a built-in way to do this, but you could add the code below to your init-file. (defvar exwm-workspace-previous-index nil "The previous active workspace index.") (defun exwm-...

View answer
How to show all contents of current subtree and fold all the other subtrees?
Accepted answer
4 votes

Edited in response to first comment Not quite sure if this is what you want, but here's a function that will show the current subtree (and its children) and fold all other headings to their top level:...

View answer
Compare all elements of 2 lists, not necessarily in same order
Accepted answer
3 votes

Perhaps you could use your list as a set? (cl-set-exclusive-or '(1 2 3) '(3 2 1)) => nil (cl-set-exclusive-or '(1 2 3) '(3 2 1 0)) => (0) You could put it into a function: (defun order-independent-...

View answer
Translate ae to ä on non-German keyboard
3 votes

You could have a look at key-seq or key-chord. Both lets you bind keys pressed together to a command, so if you press "ae" at the same time, you can bind it to "ä".

View answer
Accessing the character in the line below
Accepted answer
2 votes

Maybe something like this? I haven't tested it with tabs though... (defun char-below () (setq temporary-goal-column nil) (ignore-errors (save-excursion (next-line) (string (...

View answer
Binding key to save in specific directory?
2 votes

Here's my take on a command doing what you want, and also how to bind it to the desired key. (defun save-timestamped-backup () "Save a timestamped backup of current buffer to ~/Org/Backups" (...

View answer
In exwm (Emacs X Window Manager) how can I assign apps to particular workspaces?
Accepted answer
2 votes

You can use exwm-manage-finish-hook to perform functions when a window has loaded. Combine that with exwm-class-name and exwm-workspace-move-window and you could do something like this: (require '...

View answer
Hook when line number changes
1 votes

I don't think there is, but perhaps you can add one yourself? (defvar current-line-number (line-number-at-pos)) (defvar changed-line-hook nil) (defun update-line-number () (let ((new-line-number (...

View answer
Rename all files(from different folders) in one buffer?
Accepted answer
1 votes

You can use dired-maybe-insert-subdir (by default bound to i in Dired), on each folder, before using steps 2-5 in your question. See Subdirectories in Dired in the manual. I myself use dired-subtree ...

View answer
automatically include subfolder of org files?
1 votes

It seems like including other files could be what you want. It is a way to include other files in an org-file (could be other org-files or other file types), but when exporting it will all be exported ...

View answer
Storing previous cursor positions
1 votes

I was going to suggest helm-all-mark-rings in the Helm package. It has been mentioned here previously, along with some other tips. To me it otherwise sounds like you might be interested in bm, which ...

View answer
How to indent the selected line one "tab" forward or backward
1 votes

There's some commands starting with the name indent-rigidly, which indents by whitespace. The base command indent-rigidly is bound to C-x TAB by default, and lets you use the arrow keys to indent the ...

View answer
How to quickly open links in org-mode headlines
1 votes

This should work: (defun open-org-link-in-heading () "Open first link in the org-mode heading at current line. Only works when at the beginning of the line." (interactive) (when (and (looking-...

View answer
Emacs: function to make a file with date/time as filename, and a shortcut for it
1 votes

Here's a way to keep it all in the org-capture-templates list, without defining other functions. org-directory can be changed to whatever directory you want to store the files in. (add-to-list 'org-...

View answer
Create an org-journal template for daily journal entry
1 votes

Updated answer Here's a capture template that will get you started. You may want to change org-directory into the directory where you want to store the journal files. (setq org-capture-templates '(("...

View answer
How to make org-babel-load-file use umlauts (åäö) correctly?
Accepted answer
1 votes

Not sure if I should post this as an answer or not, but anyway here it goes: Adding (prefer-coding-system 'utf-8) before calling org-babel-load-file was actually the solution. The problem was that ...

View answer
ryo-modal defining keybind jump a word and insert character
0 votes

Try this: (ryo-modal-key "f" 'forward-word :then (list (lambda () (interactive) (insert " "))) :exit t)

View answer
How to use org-capture without creating ID property?
0 votes

So I think I've found a way, but its not very elegant: (defun org-remove-id-from-last-capture () "Remove ID property from last `org-capture' entry, save capture buffer." (let* ((properties (org-...

View answer
Export pretty symbols in org source blocks?
0 votes

The code below was too long to post as a comment, so I'm posting an answer even though it doesn't work. I thought it might be of some help. The problem I encountered was that prettify-symbols-alist ...

View answer