# All Questions

16,876 questions
Filter by
Sorted by
Tagged with
7 views

### Get Occur to display paragraph position instead of line number before matching text

I have a simple code that displays the outline path of hierarchical headings in an org file. (defun org-show-position-in-text () ;; display outline path of hierarchical headings (interactive) (...
36 views

### How to access the directory of the init.el file from elisp?

Is there a function/variable to access the directory the init file is in? This could be: ~/.config/emacs/ or ~/.emacs.d/, for e.g.
30 views

### “call-process” hangs and does not launch the program

I’m dipping my toes into reading news with Gnus. I’d like to continue using the same editor as before for composing posts, so I put these forms in my gnus.el: (setq message-tab-body-function 'edit-in-...
50 views

### Set value of a variable to region text

I would like to write a script where I can select some text as the region, extract the selected region as a string, modify it, and pass it to another program. I am playing around with ielm and see ...
20 views

### How can I get SMIE to not treat keywords as parentheses?

I'm writing an SMIE-based mode for a language that has type definitions that look like this: type Foo = { foo : Int, bar : String } One problem I'm running into is that type and = are treated as ...
40 views

### org-mode export to LaTeX: Wrapping a section in an environment

What's a good way to wrap every section in org-mode inside a LaTeX environment when exporting from org to LaTeX? For example, say, I want to wrap each section in a minipage so that the width is ...
21 views

### Unable to run nov-mode on Windows

disclaimer: I'm still relatively new to Emacs. When I open an Epub on MS Windows, Emacs opens it using Zip-Archive mode and displays its content (which is normal afaik). However, when I start nov-...
29 views

### Can one toggle inline image show 'at point' in org-mode?

I know there's org-toggle-inline-images function, is there something like org-toggle-inline-image-at-point?
25 views

### Multiple initial buffers in different windows

I have Emacs set up to open an initial org mode buffer on startup by (setq initial-buffer-choice "~/Directory/Subdirectory/inital_buffer1.org") Ideally on start up, I would like to open 2 buffers in ...
18 views

### sh-mode: Correctly indent and highlight inside bash's subshell substitution \$()?

I noticed that bash will correctly apply syntax highlighting inside the subshell substitution in VALUE="Hello \$(echo World)." But when creating a more complicated value, e.g. VALUE="Hello \$( ...
13 views

### Elpy can't autocomplete the module in .pth file

I'm trying to use Elpy to write my project. I already put my project in a virtual environment and let Elpy workon that. Since I have several modules saved in another directory, so I use .pth file in ...
41 views

### alphabetic keyboard macro “counter”?

I very much {like, use} the kmacro-*-counter family of commands. However I sometimes find myself needing to generate alphabetic sequences (e.g., A, B, C, ...) instead of integer sequences (e.g., 1, 2, ...
56 views

### profiler not showing some function calls?

I open a buffer and start a profiling session with profiler-start, selecting cpu. Then, repeatedly invoke evil-scroll-up and -down with C-u and C-d, perhaps 10 times each. The profiler-report output, ...
71 views

### evil star & visualstar without moving the cursor

Is it possible to do something similar to these vim commands with emacs-evil? They basically do the same thing as * and visualstar of vim (and evil) but they do not move the cursor to the next match. ...
27 views

I often use org-links in headings, e.g.: *** Heading [[foo]] **** Subheading [[bar]] And I use different font-sizes for different levels. Now, I would like the face of the link to be of the same ...
41 views

### keyboard macro for opening a file

How can I create a keyboard macro where a file myfile is opened by executing M-x openmyfile. The main part should look like (fset 'openmyfile [?\C-x ?\C-f <dir of myfile> return]) but I don'...
23 views

### Add code block line in emacs

In visual studio, there is a very convenient line with + and - to show the code which blocks it belongs to. I was wondering if there was the same function in emacs. ,
22 views

### Show all links from files in org-agenda-files pointing to the header at point

My question is fairly basic and I'm struck that it hasn't been asked before on emacs.SE as far as I can see: How can I see all links pointing to a header at point? This should also include links ...
35 views

### Avoid scheduling tasks in vacation in orgmode

I recently started using orgmode and I wonder if there is any way to avoid scheduling (or deadlineing) tasks during my week of vacation. I already found a way to highlight regional holidays (followed ...
34 views

### yasnippet not working on org

I created such a snippet \$ cat snippets/diary_template # -*- mode: snippet -*- # name: diary template # key: dt # condition: t # -- **** Personal_Notes **** Personal_Tasks **** Project_Notes **...
27 views

### Display “DONE” tasks of a specific day

After setting (setq org-log-done t) which adds timestamp to done tasks. ** DONE a testing task :emacs: CLOSED: [2019-08-29 Thu 09:37] The problem is that the finished task is not displayed in agenda ...
8 views

### In which variable are past sparse tree queries saved

I'm executing sparse tree queries programmatically, and I'd like to save the search queries in the same history variable that org-mode uses by default. I'm guessing I can/should do this with add-to-...
15 views

### Generate random file name for org-mode src block [duplicate]

How can I create a custom org source block which saves files to temp? Basically, I want to press C-c C-, p and get something like #+begin_src plantuml :file c:/Users/MEEEEEEE~1/AppData/Local/Temp/...
37 views

### Programmatic way of calculating end of week/month/year

I'm trying to build functions that help me execute frequent sparse tree queries, using org-match-sparse-tree nil "<some_query>" in my code. Some of these queries need to contain constraints ...
16 views

### Non-hex digit used for Unicode escape error when setting org-latex-classes

When I try to set org-latex-classes with the following code: (setq org-latex-classes '(("article" " \\documentclass[12pt,a4paper]{article} \usepackage{xeCJK} %\usepackage[heading]{...
41 views

Upon getting a task done from org mode * TODO A task Invoke C-c C-t, change it's state to DONE a task How could add a active timestamp to the finished task?
16 views

### Emacs can not open links, system default browser is google chrome

Question: Emacs can not open Google Chrome after hitting a link. What did I do: 1. open Emacs(GUI) from the terminal: \emacs -q 2. open packages buffer: M-x list-packages 3. click a package name ...
50 views

### Why can't I resize my windows to be the same width?

When I split windows using SPC-w / then my windows are created with different widths. I want them to split in half. I can't resize it by dragging it nor by using the shortcuts. I downloaded emacs ...
9 views

### Memoize with cache on filesystem persisted between sessions

The memoize package provides a memoize wrapper that installs a memoized function over the original functions. (memoize 'expensive-function) will replace expensive-function in place with a memoized ...
21 views

### Excorporate using different date style/format

I am currently configuring excorporate as described in this post and stumbled upon a small issue. Basically, I use my calendar in a european style format, where dates are written as 20 Feb 2019 ...
32 views

### spacemacs and org-log-done

In org-mode for emacs I used to get a prompt while closing a recurring task. This gave the ability to leave a note. Trying to configure this with org-log-done hasn't worked out. Anyone an idea how ...
14 views

### Native Org Citation Style

CSL style-sheets can be easily customized to render, for example, Chinese citations like these: 徐復觀〈陰陽五行及其有關文獻的研究〉，收入《中國人性論史》，頁555-563。陳鼓應，《易傳與道家思想》（台北：臺灣商務印書館，1994年）。 from the bibtex entries ...
18 views

### helm-ag , use word at point as input conditionally

I'd like to create two keybindings for helm-do-ag-project-root or helm-project-ag where one would have (setq helm-ag-insert-at-point nil) and one would have (setq helm-ag-insert-at-point 'symbol) So ...
10 views

### Get Compiler Flags for the Current File

This is something I've been mulling on for a while: Given that you are using e.g., lsp-mode for your C/C++ project and consequently have a compile_commands.json that contains the compilation flags ...
12 views

### Org-mode define face for pandoc citation syntax

I would like to set a new face in org-mode for pandoc citation syntax which looks like this: [@bibtexkey{555-563}] Custom face: (defface pandoc-citation-face '((t :foreground "yellow")) "Face ...
23 views

### How to use a hyphenated user-name with postgres in sql-interactive-mode?

I have the following configuration in emacs init files to set a variable (user) to the current Unix login user: (setq sql-postgres-login-params `((user :default ,user-login-name) (...
18 views

How can I see a list of internal links in an org-mode document? I would like a quick way to link within my document without needing to retype/remember all my internal links. The documentation states,...
30 views

### <M-S-return> (org-mode) failing on Windows install

I've just installed Emacs 26.2 on a Windows 7 machine. This is a clean install, with no previous version of Emacs installed. Editing an Org file, I want to insert a new TODO item using "M-S-return". ...
45 views

### Can I turn org-mode on for a part of a buffer in another mode?

I have a python code file with a large multiline string comment that I'm using as a sort of checklist for tests that I'm implementing. Is it possible to have just that portion of the buffer be in org ...
12 views

### How to navigate inside helm buffer

How to navigate inside helm (helm-mini in this case) vertically with arrow keys? I mean, I wanna go to Recentf "submenu" (like on picture), but pressing down arrow keep iterating over Buffers. I found ...
11 views

### verbatim html export of org headers

How would you export org headers verbatim to HTML? My org file looks like this: #+TITLE: my-org-file.org An example of org-style headers: #+begin_example * Title1 ** Subtitle1a ** Subtitle1b * ...
9 views

### how to preserve org timestamp with duration on export

I have a timestamp like this in my .org file, which is a valid timestamp (i.e. generates agenda views when clicked): <2019-05-20 Mon 09:00-11:30> Note the duration (09:00-11:30) rather than a ...
18 views

### Evil commands reset margin

I'm using evil-mode and olivetti-mode, which adjusts the margins so that the text is centered in the window. My screen usually looks like this: Voluptatem tempore unde eveniet cumque ...
20 views

### How to check whether an optional param was input?

I have a command with an optional argument whose value is a number. I need: If no input argument then use default value (1000) else use input arg. (random t) (defun insert-random-number-at-point(&...
27 views

### (goto-char (region-end)) doesn't set the point to the end of the region

I have written a small elisp script which should put oneline or multiline comments based on the current buffer's major mode. The source file is here: https://github.com/amirteymuri/Com/blob/master/...
30 views

### How insert random number?

Suppose I has text: test hello The cursor is after word test. I need to insert random number? Also I need to set range of random (e.g. from 0 to 1000) The result maybe like this: test100 hello
19 views

### Org mode needs to be reloaded before I can use my settings

I configured my org-mode through use-package :init and it works fine, except in one case. If I restart emacs and reopen a buffered .org file, my settings won't be applied until I do org-mode-restart, ...
31 views

I have a simple alist in elisp like this: (defvar *oneliners* '((js . "//") (python . "#") )) I am a bit surprised that searching for the python key gives me nil. I am calling it from ...