Konstantin Morenko
  • Member for 5 years, 6 months
  • Last seen this week
Python src block sets tabs
Accepted answer
1 votes

From documentation: ‘org-src-preserve-indentation’ Default is ‘nil’. Source code is indented. This indentation applies during export or tangling, and depending on the context, may ...

View answer
Exclude different subtrees from export when using different back-ends
0 votes

The one way I've found is to create settings file for each case: html.org #+EXCLUDE_TAGS: odt #+INCLUDE: main.org odt.org #+EXCLUDE_TAGS: html #+INCLUDE: main.org And then export each file with ...

View answer
Mark repeated tasks done for good!
Accepted answer
5 votes

According to orgmode manual (8.3.2 Repeated tasks): To mark a task with a repeater as DONE, use C-- 1 C-c C-t (i.e., org-todo with a numeric prefix argument of -1.) You could use C-u - 1 instead ...

View answer
Fold preface/ preamble of an org file
Accepted answer
2 votes

I use in my files special heading, for example Settings and hide all the in-buffer settings there. It works very well even in the beginning and in the end of the file. If you use Global Cycling (S-...

View answer
Ignoring subtrees with a certain tag
Accepted answer
3 votes

You could comment the subtree with C-c ; (org-toggle-comment). If the subtree marked COMMENT, it will not be tangled. I use it into my init files (with org-babel-load-file) to temporary exclude some ...

View answer
A read list in Org
1 votes

You could use org-after-todo-state-change-hook, which Hook which is run after the state of a TODO item was changed. The new state (a string with a TODO keyword, or nil) is available in the Lisp ...

View answer
where does org-mode get the \author field for latex output
Accepted answer
2 votes

Each export back-end has AUTHOR keyword, associated with global variable user-full-name. If it's empty, the \author will not be exported. You could redefine it into the file (buffer) with #+AUTHOR: ...

View answer
Org LaTeX export: set default options for documentclass
Accepted answer
0 votes

Into the documentation "Org Mode/Exporting/LaTeX export/LaTeX header and sectioning structure": By default, the LaTeX output uses the class article. You can change this globally by setting ...

View answer
How can I access the :file src header argument inside the src block
1 votes

You could wrap the output with next code and create file and link after block #+name: attr_wrap #+begin_src sh :session :var file=/tmp/py87133eo.png echo "$data" > /tmp/$file ln -s /tmp/$file /...

View answer
Can't change the line-highlight color
Accepted answer
2 votes

When you put your code before load-theme, loading theme could change value of this variable. Put your code after load-theme in your init.el.

View answer
How can I see which version of a package I'm using?
3 votes

You could use M-x list-packages to view list of available and installed packages with versions. And you could mark packages for update with U, then use x to eXecute the updating. And M-x package-...

View answer
How to copy text from a buffer to an ansi-term
1 votes

From the doc for term-mode: The terminal emulator uses Term mode, which has two input modes. In line mode, Term basically acts like Shell mode. In char mode, each character is sent directly to the ...

View answer
Run a command with C-c C-c for a specific major mode
Accepted answer
1 votes

Running shell command could be done with (shell-command COMMAND). Then we need to make string for executing command. We'll concatenate it from sections with (concat ...). We have 5 sections of the ...

View answer
Binding modified key in evil mode
Accepted answer
2 votes

In (define-key KEYMAP KEY DEF) the KEY is internal representation of keys, where prefix keys must be \C- or \M-. A way to convert keys into internal representation is to use (kbd KEYS) function, ...

View answer
How to make emacs automatically kill buffer after invoking delete-file command?
2 votes

You could use this function instead of delete-file (defun delete-file-kill-buffer (filename) "Delete the file buffer is visiting and kill the buffer." (interactive "fFile name: ") (progn (...

View answer
How can make emacs immediately compile a file I load?
Accepted answer
2 votes

You could add hook into init.el (add-hook 'find-file-hook (lambda () (when (string= major-mode "c-mode") (recompile)))) for c-mode to recompile it automatically ...

View answer
How to quickly create a new directory without using dired-mode?
Accepted answer
8 votes

You could use M-x make-directory DIRNAME RET. The default path is the path to the current buffer folder. You could bind it to key (like C-x C-f) with (global-set-key (kbd "C-c d") 'make-directory). ...

View answer
Org mode: Adding a properties drawer to a capture template?
Accepted answer
6 votes

You could use this function and the hook in init.el (defun add-property-with-date-captured () "Add DATE_CAPTURED property to the current item." (interactive) (org-set-property "DATE_CAPTURED" (...

View answer
How can I set directory local variable in relative to .dir-locals.el file location?
-2 votes

You could define variable with (defvar directory-of-current-dir-locals-file "/home/user/code/project").

View answer
Move the cursor backwards to the end of the 1st word on it's between 2 words
2 votes

You could move cursor to the beginning of the first word with M-b (backward-word) and then move forward with M-f (forward-word), which place cursor after the end of the first word. For example (* ...

View answer
M-x query-replace but replace all in a file
2 votes

You could use this function for replacing strings (defun replace-in-buffer () "Replace text in whole buffer. Change OLD string to NEW string" (interactive) (save-excursion (replace-string (...

View answer
how to disable automatic dos mode?
Accepted answer
6 votes

From the https://www.emacswiki.org/emacs/EndOfLineTips You can reopen the file with the correct line ending with a command like M-x revert-buffer-with-coding-system utf-8-dos. If your file is not ...

View answer
Hook to insert content into a particular file when visited
Accepted answer
2 votes

You could use this version of your function (defun insert-foo-bar () (when (string= (find-file-nondirectory buffer-file-name) "foo") (insert-file-contents "~/bar"))) (add-hook 'find-file-hook '...

View answer
Disable C-Tab in magit mode
Accepted answer
4 votes

According to Remove key binding in magit-status-mode use in init.el (with-eval-after-load 'magit-mode (define-key magit-mode-map (kbd "<C-Tab>") nil)) The (with-eval-after-load FILE &opt ...

View answer
Convert lines into list in web-mode
1 votes

Lets start with conversion one line with this function (defun wrap-line (before after) "Convert line at the point adding BEFORE and AFTER." (save-excursion (progn (goto-char (line-...

View answer
Is there a key-binding to move the cursor to the last character in the buffer
Accepted answer
5 votes

C-end (and M-> and another in default) runs command end-of-buffer (into simple.el), which moves cursor to the end of the buffer. With numeric argument, for example, C-u 4 C-end, moves point to 4/...

View answer
Difference between C-x m and M-x mail
0 votes

C-x m calls compose-mail but not mail. According to documentation compose-mail: Start composing a mail message to send. This uses the user's chosen mail composition package as selected with ...

View answer
How to create a file from a template if it does not exist or open existing copy?
Accepted answer
4 votes

You could use this version of the function: (defun journal-entry () (interactive) (let* ((daily-name (format-time-string "%Y-%m-%d)")) (journal-path "~/Dropbox (Personal)/journal/") (...

View answer
Create a presentation from Org mode
Accepted answer
1 votes

load-path is the list of directories, not files. If you want to add this file, use in ~/.emacs.d/init.el (load-file "~/org-html5presentation.el") (require 'ox-html5presentation) Better way is to ...

View answer
How to reuse last input in command with a prompt?
Accepted answer
2 votes

You could use read-string and give they default value def-say-word and save in later. (setq def-say-word "default value") (defun say-word (word) (interactive (list (read-string (format "Say ...

View answer