New answers tagged

0

In literal examples, Org interprets strings like (ref:name) as labels, and use them as targets for special hyperlinks like [[(name)]] (...) You can also add a -r switch which removes the labels from the source code. See [[(jump)]]. #+begin_src emacs-lisp -r (let ((x 1)) (ref:jump) (print x)) #+end_src


2

Use TRAMP multi-hop syntax for :dir header. 4.4 Combining ssh or plink with su or sudo If the su or sudo option shall be performed on another host, it could be comnbined with a leading ssh or plink option. That means, TRAMP connects first to the other host with non-administrative credentials, and changes to administrative credentials on that host ...


0

If you are using general.el: (general-swap-key nil 'motion ;; swap evil-next-line evil-next-visual-line "k" "gk" "j" "gj")


0

Now there is a dedicated function for this (see org-time-stamp-inactive). For example: (defun my/timenow () (interactive) (let ((current-prefix-arg '(16))) (call-interactively 'org-time-stamp-inactive))) (define-key org-mode-map (kbd "<f1>") 'my/timenow) You can also skip the prompt with two universal prefix arguments: C-u C-u C-c !.


1

You can use org-table-eval-formula to do the calculation in-place of the field and then retrieve the field value which the lisp form must return with org-table-get-field. In that way you can evaluate the calc formula within your lisp form. In lisp formulae $1 delivers a string "[2020-01-01]" for the date [2020-01-01]. Therefore the somewhat awkward ...


2

Looks like a bug as wasamasa said, but until that gets fixed this works for me: (setq org-babel-js-function-wrapper "console.log(require('util').inspect(function(){\n%s\n}(), { depth: 100 }))") If you want to print deeper or otherwise modify output, change the options for require('util').inspect(...) in that string, as documented here. If you want ...


1

The function org-time-stamp from the library org.el supports the increment/decrement day feature out of the box. In an org-mode buffer, type C-c . or C-u C-c . and then just type +20 and press the enter/return key. The function org-time-stamp uses the function org-read-date -- to read the various options for org-read-date, type M-x describe-function aka C-...


0

You can try a emacs-lisp src block with raw results. For example: #+begin_src emacs-lisp :exports results :results raw (concat "[[file:./" (buffer-file-name) ".alternative]]" ) #+end_src To get rid of confirmation messages, you can use the org-confirm-babel-evaluatevariable. This is my setting: (defun my-org-confirm-babel-evaluate (lang body) (...


2

You can use vsum for the cumulative sum as shown in the following Org code. There are two options for plotting the data with gnuplot. You can either use a meta comment line #+PLOT: or a gnuplot source block. Both cases are shown in the following example. You have to type [[file:coronaMeta.png]] yourself in the case of the meta line. The source block adds ...


0

Try :match "work". IIRC, match already takes care of the "TAGS=\" stuff.


1

This complements the answer given by @Tobias, where it is explained how org-mode removes the display property. One way to get around this is to use the variable char-property-alias-alist. It is used by Emacs to make one property to behave like another property. If you add (display my-display) to this list, you can set the property my-display on text and it ...


1

You can create an overlay that hides lines with (make-overlay (line-beginning-position) (1+ (line-end-position))) and (overlay-put ol 'invisible t). The following Elisp Org formula hides the line with the element 21 in its first column. It just shows the principle and has much room for improvement. E.g., multiple evaluation of the org formula results in ...


1

Check the value of org-agenda-archive-mode. In my case it was set to true in my init.el. (setq org-agenda-archives-mode t) Setting it to nil (the default) makes it so that archived items are not included in the agenda. The docstring of the variable says: Non-nil means the agenda will include archived items. If this is the symbol ‘trees’, trees in ...


2

The text property is removed by font-lock in org-mode buffers. The list org-font-lock-extra-keywords contains the function org-fontify-meta-lines-and-blocks as a matcher of a font lock keyword for meta lines, i.e., lines starting with #+ followed by a keyword. That function calls org-fontify-meta-lines-and-blocks-1 which has the following lines for lines ...


2

The standard Orgmode way to write quotations are quotation blocks: #+begin_quote This is quoted stuff. Org /formatting/ does work here. #+end_quote In HTML export uses the <blockquote> tag for such blocks. You can define the style in org-html-head if you like.


1

I don't see a clever way to do what you want: you would have to change the org-babel-tangle function itself, or rather write your own function which would be almost the same as the org-babel-tangle function, but not quite. @Tobias's answer in the linked question locally redefines the delete-file function to ignore, so when org-babel-tangle is called, the ...


0

This is a common use-case for me as well. I have found alphapapa's org-ql doing what I needed. Please, give it a try and let me know if that helps.


3

You can sort tags alphabetically using: (setq org-tags-sort-function 'org-string-collate-lessp) Documentation: When set, tags are sorted using this function as a comparator.


1

I don't think it's already in Org. What about (defun my-org-sort-tags () "On a heading sort the tags." (interactive) (when (org-at-heading-p) (org-set-tags (sort (org-get-tags) #'string<)))) for a start? Activate with M-x my-org-sort-tags


0

For part 2), you can go directly to the export function of interest and bind it to any key you want, e.g a function key, say F8: (define-key org-mode-map [f8] (lambda () (interactive) (org-open-file (org-latex-export-to-pdf)))) Here we have to combine a couple of functions to do the export and then the open of the resulting PDF file. Note also that we have ...


1

I finally figured out (thanks to C-h k) that space is bound to some autocomplete function in that instance of the minibuffer by default. So the easy solution was to add (define-key minibuffer-local-completion-map (kbd "SPC") 'self-insert-command) to the init file to have space act as space in the tag search. @NickD: thanks for the comment, it helped me ...


1

Tramp supports Google drive out of the box. Try to open C-x C-f /gdrive:your.name@gmail.com:/path/to/file. Starting with Tramp 2.4, it supports also rclone. If you have configured Google drive in rclone as, say, my-google, try C-x C-f /rclone:my-google:/path/to/file. Tramp 2.4 will be part of the upcoming Emacs 27.1. It is available already via GNU ELPA. ...


1

To self-insert the key in the source block: (defun my-org-mode-hook () "Custom `org-mode' behaviours." (typo-mode 1) (add-hook 'typo-disable-electricity-functions 'org-in-src-block-p nil :local)) (add-hook 'org-mode-hook 'my-org-mode-hook) Documentation: *A list of functions to call before an electric key binding is used. If one of the functions ...


0

You posted already the solution for the HTML backend. So I will address only the LaTeX backend here. Pittingly, you did not describe how you want to export tex-fig links to LaTeX. I assume here you want to use \import{...} for such figures as the org LaTeX export does for pgf figures. For that case we can just re-use the .pgf branch of org-latex--inline-...


1

Try M-right and M-left instead of M-S-right and M-S-left. The commands they run are as follows: M-right: org-do-demote (deals with active region). M-left: org-do-promote (deals with active region). M-S-left: org-promote-subtree (just the subtree of the current heading - does not extend it to the active region). M-S-right: org-demote-subtree (just the ...


2

Set or customize the variable org-log-into-drawer to t.* The doc string of the variable (C-h v org-log-into-drawer RET) states: Non-nil means insert state change notes and time stamps into a drawer. When nil, state changes notes will be inserted after the headline and any scheduling and clock lines, but not inside a drawer. If you want to make this ...


1

Add this to your init file: (add-hook 'before-save-hook 'time-stamp) and this to the Org file: # Local Variables: # time-stamp-format: "%04y-%02m-%02d_%f" # time-stamp-pattern: "^#\\+export_file_name: %%$" # End: The value of #+export_file_name: should update every time the file is saved.


1

Set or customize the variable org-table-tab-jumps-over-hlines to nil: (setq org-table-tab-jumps-over-hlines nil) The doc string of the variable says: Non-nil means tab in the last column of a table with jump over a hline. If a horizontal separator line is following the current line, ‘org-table-next-field’ can either create a new row before that line,...


1

Hot diggity darn, but minutes later I discovered a crate for that. For future people landing on this question, all I had to do was run cargo install cargo-script and bam you'll be off and org-babel-ing. If you've got Cargo.el installed in your profile, you can evaluate pretty quick using Cargo-run. This may become how I write Rust going forward, if I can ...


4

Use M-x org-sparse-tree RET. First you are asked how you want to filter and one of the options is [p]roperty. If you type p you can give AUTHOR as property name and Cialdin as value. Tab-completion works for that input.


0

As a sanity check, are you sure you have a tex distribution installed correctly? Maybe you can interactively load into your docker to test it out. Here is a command which will dump the error log to a file named Org-PDF-LaTeX-Output.err: emacs --visit plot_var.org --batch --eval "(progn (ignore-errors (org-latex-export-to-pdf))(set-buffer \"*Org PDF LaTeX ...


0

The following settings in the user-config in my .spacemacs file makes everything work properly. ;; smartparens (require 'smartparens-config) (sp-local-pair 'org-mode "\\[" "\\]") (sp-local-pair 'org-mode "$" "$") (sp-local-pair 'org-mode "'" "'" :actions '(rem)) (sp-local-pair 'org-mode "=" "=" :actions '(rem)) (sp-local-pair 'org-mode "\\left(...


1

At the end my question is not very smart. I am using cdlatex to type equations and math easily in orgmode. Then the answer is in the documentation under "PAIR INSERTION of (), [], {}, and $$": Also, the keys _ and ^ will insert "_{}" and "^{}", respectively, and, if necessary, also a pair of dollar signs to switch to math mode. I didn't assume that this ...


0

The error originates from https://github.com/skeeto/emacsql/blob/master/emacsql-sqlite.el which checks whether there's a binary created from a previous compilation, then attempts to build it on your system. You haven't built one yet and don't have a toolchain set up, so it errors out early. https://github.com/skeeto/emacsql/issues/55#issuecomment-515704368 ...


1

The following Elisp code adds a function org+-kill-orphaned-edit-buffers to the special hook kill-buffer-query-functions buffer-locally in Org buffers. That function scans the Org buffer for overlays with edit-buffer property and looks whether that buffer is a live org-src-edit buffer. If that is the case it tries to kill the source edit buffer. The true/...


1

@jagrg has helpfully answered the question you probably really meant to ask, namely "how do I enter the date exactly seven months ago?" You should and did accept that answer. For completeness, to answer the question as asked, typing the following 15 individual keystrokes in order: C-c . 1 9 - 8 - 9 SPC 1 2 : 3 4 RET will insert <2019-08-09 Fri 12:34>...


2

You can do what you want with #+OPTIONS: num:nil As for the #+PROPERTY: setting, I can reproduce the problem: I thought at first that turning org-use-property-inheritance on would do the job, but I cannot get inheritance to work in this context (with a #+PROPERTY: setting). It does work in the context of a top-level headline having the property and lower-...


1

This can be done using built in tools using org-agenda-skip-function (I've used this answer on Stack Overflow in the past). If you don't mind external packages, org-super-agenda makes this easy: (add-to-list 'org-agenda-custom-commands '("w" "Work agenda" agenda "" ((org-super-agenda-groups '((:discard (:not (:tag ...


1

Found a solution buried in this video: https://vimeo.com/16533939 It uses a visual basic code that popups up a message showing the title of your event. Here's the VB code (I put it in a file named PopUp.vbs): On Error Resume Next Msgbox wscript.Arguments(0),0,"Agenda Reminder" and here's the configuration needed in your .emacs or .spacemacs file (you need ...


0

jajrg has the info you want. but just to add a small detail: C-c . prompts you to insert a active timestamp. it appears in your agenda and is surrounded by < >. C-c ! prompts you to insert an inactive timestamp. it doesn't appear in your agenda and is surrounded by [ ]. once created, you can also change the date by ensuring point is on the ...


3

To insert a timestamp four months from today, press: C-c . +4m RET and the +4m cookie shifts the date for you. Likewise, use -4m to insert four months before today (y, m, w, and d letters are all valid). Use S-arrows, <, and > for navigation. See the manual for more information.


1

I wrote this for one of my libraries. It returns a string formatted as an Org time stamp. defun my-org-time-stamp (&optional time inactive) "Return an Org time stamp. TIME is specified as (HIGH LOW USEC PSEC), as returned by `current-time' or `file-attributes'. The `org-current-time' is used unless non-nil. INACTIVE means use square brackets ...


0

To make this work with emacsclient (and with a regular session also) you can use a focus-in-hook instead of the after-init-hook in Emacs User his answer. To make the agenda show your agenda items also, you should set your agenda-file/directory before setting the hook. (setq org-agenda-files (quote ("agenda-directory")))


1

The feature that you’re looking for is only available for ordered lists. Ordered list items start with a numeral followed by either a period or a right parenthesis10, such as ‘1.’ or ‘1)’11 If you want a list to start with a different value—e.g., 20—start the text of the item with ‘[@20]’12. Those constructs can be used in any item of the list in order to ...


0

I also did what the OP has done. I also received the error message: Invalid duration format "taTesting" I also re-installed EMACS, org-agenda, etc to restore my emacs configuration Two hours of toil passed --and the problem didn't go away-- What solved the problem was: M-x dired and navigated to the folder containing my .org files M-x grep-find , ...


4

I cite from https://orgmode.org/manual/Quoting-HTML-tags.html: The HTML export back-end transforms < and > to &lt; and &gt;. To include raw HTML code in the Org file so the HTML export back-end can insert that HTML code in the output, use this inline syntax: @@html:...@@. For example: @@html:<b>@@bold text@@html:</b>@@ In ...


0

It is in contrib: it is not officially supported but it is available e.g. from the Org mode repository in the contrib/lisp subdirectory.


0

Not sure if this is still relevant in 2020, but I needed something similar and so I modified org-get-entry to allow for inheriting special properties (by passing 't to INHERIT). Leaving this here in case someone needs it (defun org-entry-get-special-with-inheritance (property &optional literal-nil) "Same as org's `org-entry-get-with-inheritance' but ...


0

What you're trying to do is not possible with org-indent-mode turned on. Maybe you can trick the mode by inserting some invisible character before inserting the space/tab: (defun org-indent-paragraph () (interactive) (forward-line 0) (if (looking-at "^¶") (while (looking-at "^¶\\|[ \t]") (delete-char 1)) (insert (propertize "¶" 'font-...


0

As mentioned in my comment, you should look at the Capturing column view section of the Org manual for additional details, but doing M-x org-insert-columns-dblock RET global RET should give you a good beginning. E.g. given this file: TODO foo foo * TODO bar :LOGBOOK: CLOCK: [2020-03-05 Thu 07:44] :END: bar if you position the cursor at the end ...


Top 50 recent answers are included