How to convert arguments list to string of each on new line in Emacs Lisp?
I want to get list to :var into
emacs-lisp code block in Emacs Org-mode and to output just each of list item on new line. In
ruby it looks as simple as
#+BEGIN_SRC ruby [1,2,3,4]*"\n" #+END_SRC
But cannot realise how to do it in Emacs lisp code block.
Something like this?
#+BEGIN_SRC emacs-lisp (mapconcat #'number-to-string '(1 2 3 4) "\n") #+END_SRC #+RESULTS: : 1 : 2 : 3 : 4
See also questions close to this topic
emacs org-agenda - missing all the daily details for tasks
For emacs25 (emacs 25.2.2 on ubuntu 17.10), I am not able to get org-agenda-list working. org-timeline shows me details on a daily basis, but org-agenda-list just lists the names of the days and there are no details listed.
I have the following .emacs (simplified down to one line to track down why org-agenda is not working - I know emacs reasonably well, but I am a first time user of org-mode)
(global-set-key "\C-ca" 'org-agenda)
and with an empty .emacs.d directory, when I run org-agenda-list for the following example:
* Tasks ** DONE [#A] do this y'day SCHEDULED: <2018-03-22 Thu> ** TODO [#A] do this tomorrow SCHEDULED: <2018-03-24 Sat> ** TODO [#A] this task is not scheduled ** TODO [#B] scheduled for today, priority B SCHEDULED: <2018-03-23 Fri> ** IN PROGRESS [#A] scheduled today and deadline in 2 days DEADLINE: <2018-03-25 Sun> SCHEDULED: <2018-03-23 Fri> ** TODO [#A] deadline in 2 days and not scheduled DEADLINE: <2018-03-25 Sun> ** TODO [#A] scheduled for monday SCHEDULED: <2018-03-29 Thu> ** TODO [#C] do this today if I get time SCHEDULED: <2018-03-23 Fri> ** TODO [#B] neither is this one ** TODO [#C] or this one ** TODO [#A] deadline in 10 days and not scheduled DEADLINE: <2018-03-31 Sat>
I only see the week entries and it is missing all the details for the daily tasks
Week-agenda (W12): Monday 19 March 2018 W12 Tuesday 20 March 2018 Wednesday 21 March 2018 Thursday 22 March 2018 Friday 23 March 2018 Saturday 24 March 2018 Sunday 25 March 2018
Where as org-timeline shows me the details for the daily tasks
Thursday 22 March 2018 Scheduled: DONE [#A] do this y'day ------------------------------------------------------------------------------- Friday 23 March 2018 Scheduled: IN PROGRESS [#A] scheduled today and deadline in 2 days Scheduled: TODO [#B] scheduled for today, priority B Scheduled: TODO [#C] do this today if I get time Saturday 24 March 2018 Scheduled: TODO [#A] do this tomorrow Sunday 25 March 2018 Deadline: IN PROGRESS [#A] scheduled today and deadline in 2 days Deadline: TODO [#A] deadline in 2 days and not scheduled [... 4 empty days omitted] Thursday 29 March 2018 Scheduled: TODO [#A] scheduled for monday Friday 30 March 2018 Saturday 31 March 2018 Deadline: TODO [#A] deadline in 10 days and not scheduled
Q: How do I get org-agenda-list to work properly for me ?
Moreover after I installed
M-x package-install org-edna
based on some online advice, I also lost the org-timeline command, which I recovered via brute-force application of "apt remove emacs" and "apt install emacs".
Q: Can anyone explain to me why I had lost the org-timeline command ?
How to install packages (like auto-complete) for Emacs 23.1.1 with no internet?
My work computer has Emacs 23.1.1 and using git to clone repos is not allowed. I tried to install
package.elmanually and add elpa and melpa sources, but I got the error "Failed to download 'melpa' archive".
Basically, I want to install some popular packages like powerline, smartparens, evil and auto-complete and I tried manually, however, for each of them, I encountered some errors, all having something to do with missing some function definitions.
So, I would like to ask that without the ability to upgrade Emacs, is there any way that I can install those packages I mentioned above manually? Or do those packages have a version that could be compatible with Emacs 23.1.1?
How can i prevent this error message "company-quickhelp is not available in this emacs version or frame"
First a short story. A year ago i search a app for my android tablet with which i can a little bit coding. I found the great termux-app and came to emacs. I use this starter-kit purcell emacs.d. With this starter-kit i can do some customations in a separate file. Here are my relevant customations:
(require-package 'tern) (require-package 'company-tern) (autoload 'tern-mode "tern.el" nil t) (add-hook 'js2-mode-hook (lambda () (tern-mode) (company-mode))) ;; there are more customations (eval-after-load 'company '(add-to-list 'company-backends '(company-tern company-auctex)))
uname -a Linux twist 4.13.0-37-generic #42~16.04.1-Ubuntu SMP Wed Mar 7 16:03:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
emacs --version GNU Emacs 25.1.1 Copyright (C) 2016 Free Software Foundation, Inc. GNU Emacs comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of GNU Emacs under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING.
On my laptop i started emacs with the parm -nw
When i'm in js-mode and autocompletion with company appears, a new window with the Backtrace buffer opens with the message company-quickhelp is not available in this emacs version or frame
and the curser switch to this window. How can i prevent this behavior?
I like the behavior from my tablet - no new window and no error message and quickhelp appears in the minibuffer.
I don't want use the gui-version of emacs, because i often use my 'laptop-emacs' over ssh.
Unable to enter diary entry org-agenda-diary-entry: Wrong type argument: commandp, insert-diary-entry
I am using emacs 25.3.2 and org-mode 8.2.10. For some reason whenever I try to add a new diary entry in the org-Agenda I get this error message
org-agenda-diary-entry: Wrong type argument: commandp, insert-diary-entryInvalid face reference: nil
I have tried all types: day weekly, monthly and none worked. If I try to add the entry from emacs calendar it works fine (I end up in the diary file).
Relevant entries from my .emacs file are
;; Calendar/diary controls ;; This code has to be at the beggining to ensure an european date-style format (add-hook 'calendar-load-hook (lambda () (calendar-set-date-style 'european))) (set-default 'truncate-lines t) (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) (add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files)
(setq org-agenda-include-diary t) ; agenda stuff (setq org-agenda-files (list "~/org/NOTES.org")) ; agenda stuff
I have searched online, and the best answer I found was how to describe the functions commandp and org-agenda-diary-entry, but I couldn't find anyone with the same type of issue and I cannot understand what the problem is. Thank you in advance for any help.
There is a line in the middle of image
When I inserted a image in eamcs org-mode, I got a white line in the middle of the image. What I can do to solve the problem.
internal link searching via org-open-at-point not working for me
[[search for me]]
doesn't end up finding the text 'search for me' in the same org file (internal link), instead, it always says 'no match' and asks if I'd like to create a new headline. If the text 'search for me' is instead enclosed in double brackets, e.g.,
<<search for me>>
then the link above works. It shouldn't need double brackets to work. Perhaps I have something configured to interfere with the normal behavior? Not sure how to debug this. Any ideas what is happening? Does it work for you?
using babel org mode on emacs as a python data analysis environment
I've started using
emacs25.3.1. for my initialization file and for organizing. I am using
jupyter notebookand wanted to know if it is possible to use
org-babelin the same way.
einnotebook I use for data analysis using the
matplotlibpython libraries, It works very well but seeing examples to similar work done with
gnuploton babel in
org-modeI wonder if it can work for
Here is a link to babel's short documentation, the introduction to literate programming with a few snippets of code in different languages.
I use Python version 3.5.4
anacondawhich conveniently installs all the libraries and with anaconda-mode on
emacsI have access to all functionalities, yet in babel:
#+BEGIN_SRC python :results output import numpy arr = np.arange(10).reshape(2, 5) a #+END_SRC
This code in the org file doesn't really see the anaconda installation since it uses the emacs python-mode, I think, and therefore doesn't import numpy...
I like the idea of literate programming, it might be less useful than a notebook with code cells and markdown cells but considering the customizable nature of
org-mode, it can be very interesting to work in that enviornment.
EDIT starting here
I found this implementation in a previous question the answer by @bowen.li has useful code for changing the interperter to ipython and therefore have access to the missing libraries. I am still looking for ways to implement more functionality, like inline plotting with matplotlib.
org-mode babel sh script + escaped(?) ~ char for home directory?
I have this small sh script under org-mode babel:
#+NAME: testHomeDir #+BEGIN_SRC sh :var directory="./" set -e cd $directory ls | head -5 #+END_SRC
set -eis there to stop the script as soon as an error occurs.
The script works well with full path:
#+RESULTS: :RESULTS: current issues.pdf AnnotatedPDF Bitbucket compareScript.wls Data :END:
However when used with
~(my home directory) it does not work anymore:
I get the
sh: 4: cd: can't cd to ~/Temp
Please also note that
#+CALL: testHomeDir("\~/Temp") #+CALL: testHomeDir("\\~/Temp")
do not work too.
I guess that the
~character is escaped somewhere (in Emacs? in sh?)...
My question is: how to fix that?
How to auto-suppress `#+RESULTS` for empty output?
In the following org-mode source snippet, no result is generated:
#+BEGIN_SRC ipython :session import numpy as np #+END_SRC
However, upon execution
#+RESULTS:is added to the document. How can I configure org-mode / babel to only insert results when there is something to display?
I know I can disable output using
:results silent, but I'd prefer not to have to specify a different flag depending on whether a result is generated or not.