New answers tagged

0

If preferred, you can set you PATH correctly without an additional package using: ;; Use the PYTHONPATH defined in whatever shell config: zshrc or bashrc or wherever (setenv "PYTHONPATH" (shell-command-to-string "$SHELL --login -c 'echo -n $PYTHONPATH'"))


0

So the problem was specific to GUI emacs, the PATH variable was not the same as what I have in my .zshrc (the PATH is correct when you open emacs via the shell, the PATH can be checked by M-x getenv) So I used this neat package which loads the correct PATH even I open the GUI emacs now.


0

It sounds like there might be a few things going on here, but the first thing that comes to mind is if your Emacs knows what path to find your executables here, namely python3? It may not be added to your PATH explicitly. Are you using a package like https://github.com/purcell/exec-path-from-shell or setting this manually in your Emacs config? Two other ...


0

why is there this discrepancy? Is there a difference between org mode source C-c C-c and C-x C-e? As Tobias's answer mentioned, C-x C-e and Org Mode's C-c C-c are two different commands, so it's not a surprise if their results are different. For example, C-x C-e after 42 prints 42 (#o52, #x2a, ?*), as you can see, C-x C-e decides to print 42 not only in ...


0

Let us have a look at org-no-properties which is used for removing the properties from the result string: (defsubst org-no-properties (s &optional restricted) "Remove all text properties from string S. When RESTRICTED is non-nil, only remove the properties listed in `org-rm-props'." (if restricted (remove-text-properties 0 (length s) org-rm-props s) ...


3

C-c C-c has the key-binding org-ctrl-c-ctrl-c which runs org-babel-exec-src-block if point is inside a source block. C-x C-e runs eval-last-sexp which has nothing to do with Orgmode. org-babel-execute-src-block uses org-babel-insert-result for inserting the result into the Org buffer. There, org-no-properties removes the text properties from the result ...


2

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


4

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 ...


3

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

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 ...


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

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 ...


1

I think you uncovered a bug or something fell through the cracks when ob-shell.el was built. Please submit bug report to org-mode repo. Below is a temporary workaround Execute the missing org-babel-bash-initiate-session function definition below: (defun org-babel-bash-initiate-session (&optional session _params) "Initiate a session named SESSION ...


Top 50 recent answers are included