I love info, and wish more developer docs where available on Info. Saves me from opening up a PDF - navigating an info-based reference manual is more ergonomic in comparison
A long time ago, the Python documentation was available as texinfo, it was very nice to use. But the Python devs switched to ReST, which I read was kind of a pain to convert to textinfo, and so it is no more. :(
It's also worth knowing that `G` in Emacs Info viewer is bound to `Info-goto-node-web`, which opens the current page in a web browser. (This only works for Emacs manuals, though.)
It remains a mystery to me that so few python developers know or use the "help" functionality that can be similar to this. Similarly, the apropos command listed is incredibly nice. Shame that similar functionality seems to have dropped off in most other environments.
pydoc has saved me many times! And doesn't require me dropping down into a shell too. help() is still invaluable, especially in debug shells when tab completion isn't helping me as much as I'de hoped.
Do you mean the `help()` function in the REPL? I agree that it's very useful, but I don't see it used well within text editors (e.g. neovim hover on pyright doesn't show the full help text).
I'd also like to add that in ipython and jupyter, you can do `symbol?` and `symbol??` to get help and detailed help, respectively.
I did indeed mean the help function. Is akin to the documentation command of lisp, if I recall. Though, I confess I never learned the keybindings to use it in a python file. (And I am sadly annoyed that the bindings I know in lisp open things up in a browser.)
I had a note in my init.el I'd thrown in at some stage which said: make a little convenience function that wraps the result of 'c' (or 'w', which I use) in Info into a runnable form.
This may seem like a lot of work but at least for me this is all muscle memory, so I happen to type them without even realising what I am typing.
It is sort of like playing the piano. When you play your favourite song on the piano, you don’t think of the keys you are pressing. It is all muscle memory. You just let your brain and fingers do the work and your conscious being can simply enjoy the music. It’s like that with Emacs too!
Also, since this is Emacs we are talking about, of course we have a simpler alternative that involves only a couple of keystrokes: C-0 c. This is discussed in the next section of the post.
That looks daunting, but it's not just a big string of key sequences you have to memorize. Half of them are moving the cursor around, and the sequences follow from what you're doing. It'd be a bit like critiquing the equivalent vscode '" " <left arrow> C-v C-a <shift> C-e ...'
To be fair that's a series of individual commands, rather than being one huge command. Also you can quite easily make all of that one key binding if you do this enough.
The only reason Emacs people actually write it out is because it's so easy and natural.
I saw it and said: ooh, what's that, looks intense? And then I actually looked at the first couple and went ooooh, type in double quotes, jump back and paste (C-a then C-y), select the whole thing (C-a C-SPC C-e), etc etc till the end. Except without really "saying anything" in my head, cos it's just muscle memory, you do it all the time, it's like walking.
this is like being upset about a long shell command using a lot of pipes -- it's ugly but it's comprehensible because when you build it, you do it interactively, in parts, and then if you're ever going to use it again you save it as a function
This is interesting. Just yesterday I asked myself how I can embed links to info nodes in a markdown file. I realized it's easiest to just put the expression in my file like so:
Then I asked myself how I can run it without going to the last parenthesis and then hitting C-x C-e, so I wrote a function:
;;;; eval expression at point in text / markdown
(defun ugt-eval-expression-at-point ()
"Evaluate the expression at the current point."
(interactive)
(save-excursion
(while (ignore-errors (backward-up-list) t)) ; Move to the beginning of the outermost sexp
(let ((end (point)))
(forward-sexp) ; Move to the end of this sexp
(eval-region end (point)))))
(global-set-key (kbd "C-s-e") 'ugt-eval-outermost-sexp-at-point)
So now I can be in between the parentheses and hit C-s-e (Control-Command-e), and it will be evaluated.
I even embed search expressions in my documents:
(ugt-search "French Revolution")
So be able to just click those expressions, I created another function:
I know this is well intentioned but we don't allow bots (nor generated comments generally) on Hacker News. HN is for curious conversation between humans.