Hacker Newsnew | past | comments | ask | show | jobs | submit | ldx77's commentslogin

> Who refers to people as "mayonnaise"??

Self-hating white liberals.


This reductionism seems like identity politics at its worst. It sounds like you're saying that anyone who identifies as white (regardless of how arbitrary this race is) must avoid using a term you find disrespectful to describe their race, and doing otherwise means that they are hating themselves?


I use org-mode all the time and do a lot of plotting with Python and matplotlib and for some reason the snippet

  #+BEGIN_SRC python :var fname="delseepy.png" :var delsee=delsee :results file
  import matplotlib.pyplot as plt
  
  x, y, z = zip(\*delsee)
  
  fig = plt.figure()
  axes = fig.add_subplot(1,1,1)
  axes.plot(y, z, marker='o')
  fig.savefig(fname)
  
  return fname
  #+END_SRC
has never worked for me. I have to remove the "return" keyword on the last line. Not sure if this is an org-mode issue or related to the Python version (the author seems to be using Python 2).


This has been my limited experience with everything related to Emacs - fragmented tutorials on how to do x that work with someone's specific setup. And when you start looking around for fixes you get solutions for "this is how I do this with Prelude", "this is built-in", "my customized Spacemacs setup..." and at that point I throw my hands in the air, admit to myself that I'm not a real man and go back to VSCode.


It is so. Emacs contains the full Emacs manual, non-fragmented, compact and complete, including the full Org mode manual, non-fragmented. It is self-documenting program. Users can learn what is built-in feature and what exists before starting to use extensions.

If you try to do too much at once, of course, you are prone to give up as you started on a too high gradient.


I think I'm a pretty adept emacs user, and I've relied at least ten times more on crappy informal documentation in blogs, StackOverflow etc. than on the real stuff.


I do that too, but out of habit from other pursuits rather than a real necessity. Recently, I've found myself going to Emacs and packages' internal help first, and I usually find what I'm looking for. Despite me spending several years not believing it, it's really good documentation for the most part.


> admit to myself that I'm not a real man

Note, many emacs users aren't men at all.


certainly not, they are gods


I know. It's a figure of speech, not a reference to the demographics of emacs users.


I have tried with both python 2.7.18 and python 3.8.6 using Emacs 27.1 and the excerpt works without issue for me; I have no configuration (emacs -Q) beyond pointing org to my virtual environment and allowing python evaluation in org-babel:

  (org-babel-do-load-languages 'org-babel-load-languages '((python . t)))
  (setq org-babel-python-command "~/mpl-venv/bin/python")
Are you perhaps on an outdated version of Emacs?

There have been a few different fixes around the "last line" return value over the years[0][1] but I can't really remember something like your example not working for me personally.

[0]: https://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg...

[1]: https://orgmode.org/list/87pnfdo88v.fsf@gmail.com/t/#u


You might have to check the value of =org-babel-python-wrapper-method=, which defines the format of the created temporary file to which the source block is exported so it can be executed properly.

After installing matplotlib using pip3 and changing =org-babel-python-command= to python3 I was able to execute this example without a problem.

The value of =org-babel-python-wrapper-method= for me is:

  def main():
  %s

  open('%s', 'w').write( str(main()) )"


I have found that over time org documents tend to become coupled somewhat to your Emacs configuration and are not generally portable. I guess this is the reason why many org example snippets on the net do not really work exactly the same.


Is each block converted into a function? Otherwise it's a syntax error.


Yes they are, for me that exact snippet is fine


There is a package which lets you interact with ipython kernels instead. You might want to check that out.

https://github.com/nnicandro/emacs-jupyter


The people in charge certainly seem to think that our lives can be put on hold indefinitely.

For me the most annoying thing is the idea that lockdown is somehow "saving" lives. People who are dying from COVID would have died from something else 2-3 years from now. These are old, sick people, whose lives are (mostly) behind them.

If I was an 80 yo and my grand-kids were put in prison to allow me to live a couple more years, I would be even more angry than I am right now.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: