From 2b2ad5c88e1239c4746130c60461151f48f24fba Mon Sep 17 00:00:00 2001 From: notnull Date: Wed, 23 Jan 2019 15:37:00 -0800 Subject: [PATCH] updates to emacs.org --- _proto.org | 172 +++++++++++++++++------- emacs.html | 387 +++++++++++++++++++++++++++++++++++++++++++++++++++++ emacs.org | 51 ++++++- test.py | 3 + 4 files changed, 560 insertions(+), 53 deletions(-) create mode 100644 emacs.html create mode 100644 test.py diff --git a/_proto.org b/_proto.org index 78f2622..831795b 100644 --- a/_proto.org +++ b/_proto.org @@ -1,69 +1,137 @@ (open bullets with TAB) * TODOS -** TODO notnull will test emacs howto-from-scratch tutorial +** DONE notnull will test emacs howto-from-scratch tutorial +** DONE enable w3m on emacs +*** w3m (TLDR?) +https://www.emacswiki.org/emacs/emacs-w3m +^ I am interestd in using w3m so we can keep it consistent outside of emacs, but I'll start with getting w3 to work maybe[strike that]. (emacs' standard browser is called eww, RMS really has a way with naming things with awful names) + +**** how to install + +- add melpa to packages (not melpa-stable) + (require 'package) + (add-to-list 'package-archives + '("melpa" . "https://melpa.org/packages/") t) + (package-initialize) +- M-x package-refresh-contents +- M-x package-install w3m +**** random notes + + +I added the melpa repo to .emacs and that provided several more packages, but not the one listed above. + +I tried to set the customize variable to emacs w3, still got the error that there's no such file. + +sorry :) + +no worries! It's helpful to carriage return when you're done. :P + +tbh, I rly doubt all that is necessary. I always get really skeptical of instructions that requre lots of crazy commands... emacs has a strange installation procedure and I've gotten this to work before (on another computer) but I'll keep researching. + +Question is why is w3m found by emacs on the other system and what's wrong here? + +which other system? + +> I've gotten this to work before (on another computer) + +cool, keep on it! +*** option with config foo: https://www.emacswiki.org/emacs/BrowseUrl#toc4 +In order to fix it, you must run w3m as a shell command in order to capture the output. Here is how: + +In your ~/.emacs: + + (if window-system + (setq browse-url-browser-function 'browse-url-generic + browse-url-generic-program "web-browser") + (setq browse-url-browser-function 'my-browse)) + + (defun my-browse (url &rest ignore) + "Browse URL using w3m." + (interactive "sURL: ") + (shell-command (concat "w3m " url)) + (pop-to-buffer "*Shell Command Output*") + (setq truncate-lines t)) + +In your ~/bin/web-browser (a shell script): + + #! /bin/bash + + if [ -z "$1" ]; then + URL="-B" + else + URL=$1 + fi + + if [ -z "$DISPLAY" ]; then + w3m $URL + else + xterm -name web-browser -bg "#304020" -fg "navajo white" -e w3m $URL + fi + +Note that now you can define `web-browser %s &’ as an external browser in w3m, such that – in X – you can spawn more windows. + +Note also that if you want to run w3m interactively when it runs within Emacs (in the example given that happens only when calling ‘browse-url’ within Emacs on the console), then you need emacs-w3m. + +*** w3 (no, too old) +we decided not to go with w3 lol + +> error in process filter: w3-draw-tree: Symbol's value as variable is void: w3--args +> process filter: Symbol's value as variable is void: w3--args +what does that mean? +https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-01/msg00248.html +> Still, doesn't seem actively maintained, based on +> https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-01/msg00326.html + +According to the above url: +The package was last developed 8.5 years ago. +It was added to elpa.gnu.org 3 years ago, with 4 commits. +The error you are seeing comes from one of those commits ("try to fix +compiler warnings"). "M-x w3" has the same error. So I can only +assume this package has not been tested or used by anyone since it was +added to elpa.gnu.org. +So I have to wonder what the value of having it there is. + +I suggest you use M-x eww instead, and that if no-one wants to maintain +w3 it be removed from elpa.gnu.org. + +-> how to disable elpa? + +why would we? elpa is just a repository for emacs packages. melpa is another one... so we can remove w3, but what I don't understand is, according to https://www.emacswiki.org/emacs/emacs-w3m, It is best to download from ...official third-party mirror such as exist on MELPA or github (https://github.com/emacsorphanage/w3m.git). +https://git.savannah.gnu.org/cgit/w3.git/ 11y :D lol + + +this is a lisp syntax thing, it's like the variable was undefined. we could do a backtrace and run the command again and it would give al linfo but it's in lisp, dunno if you know any lisp... +yes, that sounds fun. +i know it has a lot of brackets :) +trying to remember how... take your time, i love watching other's work. + +I really hate 99% of documentation. It should not be this hard to google search and find instructions on how to enable this... + ** TODO write git workflow (see section below w/ questions) * proto The purpose of proto is to document a workflow for projex, etc. The first step is emacs / pandoc / git. - ** emacs org mode -So I want this to be a very brief overview of features etc. so people can get started using it the way we want, but it's not finished... - -the point is that org mode has a simple syntax that can be converted very easily w/ pandoc to html with no garbage. it also makes things easy to organize. - -for example, C-x C-f projex_demo.org - -projex_demo.org = wget --no-check-certificate https://irc.anarchyplanet.org/pad/p/projex, and then added some bullets in like 5 minutes ... the organization still needs work but it's relatively easy. My goal is to org-mode organize the projex pad and then copy-paste it back into the pad, cleaned up. And then also to pandoc convert it to html. - -*** Bullets - -- headers are organized with * - - M- to add new heading - - M- or M- to promote / demote heading -- TAB to expand/collapse trees - -*** TODOs -**** DONE demo emacs org mode to data -**** DONE enable line wrap as default - -**** TODO re-write projex in org mode style - - projex_demo.org is the test run of this. - - C-c C-t to cycle through todo-done - - You can add more options with -*** links - - link structure: [ [link][desc] ] (but without the spaces) - - [[file:test.org][file]] C-c C-o to open at point -*** agenda mode - - - agenda mode command has to be added - -*** exports -*** code blocks / literate programming - +[[file:emacs.org][emacs overview]] (hover over link and type C-c C-o) ** Git Workflow - - git home = serge:srv/git - - mkdir projex/repo.git && cd repo.git && git init --bare - - torsocks git clone git@w2ja5hhrcjc2wnxe.onion:projex/repo.git - - this requires that you have a pubkey added to srv/git/.ssh/authorized_keys - - see /var/www/irc.anarchyplanet.org/dox for an example of this locally - (git remote -v) - - you will clone an empty repo... make changes locally and then push - - make changes locally - - torsocks git push origin master +https://irc.anarchyplanet.org/pad/p/git <-- I wonder how to make this a link that will open a web browser in emacs? -*** branch issues with git push -I don't have permissions figured out perfectly for this. when I push as notnull@host it hangs (permission issue) but when I push as root it's fine. -also when I push as notnull@serge. +how to execute a command from emacs? -notnull is part of group git. +M-x and then type it -I need to examine permissions for /srv/git +I don't think it quite works like that... -Does /srv/git/projex/proto/ need to be owned by notnull? does the push need to happen as git user? -https://en.wikibooks.org/wiki/Git/Gitosis#Defining_Groups,_Members,_Permissions,_and_Repositories -https://wiki.archlinux.org/index.php/Gitosis#Repositories_and_permissions +we need MELPA which is a package repo for emacs, has more than elpa +I'll figure out how to get it, one sec + +why can't i type space? + +- = space in +currently trying to set this up https://www.emacswiki.org/emacs/emacs-w3m +does it work? ** random notes online collaboration and async communication: diff --git a/emacs.html b/emacs.html new file mode 100644 index 0000000..dce96cb --- /dev/null +++ b/emacs.html @@ -0,0 +1,387 @@ + + + + +emacs + + + + + + + +
+

emacs

+ +

+essential keystrokes: +(TAB to open bullets) <– do this lol +C-x 1 to return buffer to 1 window +C-g to cancel a command +C-h a to search for commands +tiling window: C-x [1..3] +C-k cut C-y paste +

+ +
+

1 emacs org mode

+
+
+

1.1 Overview

+
+

+So there are two basic things that are useful about org mode: +

+
    +
  1. bullets are collapsible which makes it really easy to organize shit and move it around +collapsible items rule! +
  2. +
  3. TODO items have a lot of functionality +
  4. +
+ +

+so, my goal is actually to take projexdemo.org and make it something that is formatted in org mode, and the reason for that is that then we can export it using pandoc with clean html (which we can add a loittle styling etc) .. . once we have a format established, we can loosely require people to add to pads in that format so that chhanges can be git pushed and incorportated into the html. You can see an example of what the raw html looks like here: https://irc.anarchyplanet.org/dox/org.html +

+
+ +
+

1.1.1 Bullets

+
+
    +
  • headings are organized with * +
      +
    • M-<enter> to add new heading +
    • +
    • M-<left> or M-<right> to promote / demote heading +
    • +
    +
  • +
  • TAB to expand/collapse trees +
  • +
+
+
+ +
+

1.1.2 TODOs

+
+

+TODOs are actually probably not that relevant for projex because it's more for internal use … maybe. +

+
+
  1. DONE demo emacs org mode to data
  2. +
  3. DONE enable line wrap as default
  4. +
  5. TODO re-write projex in org mode style
    +
      +
    • projexdemo.org is the test run of this. +
    • +
    • C-c C-t to cycle through todo-done +
    • +
    • You can add more options by adding #+TODO: TODO ONHOLD | DONE to the top of the page (requires restart) +
    • +
    +
    +
+
+
+

1.1.3 links

+
+
    +
  • link structure: [ [link][desc] ] (but without the spaces) +
  • +
  • file C-c C-o to open at point +this creates a split buffer. C-x o to switch between split buffers, C-x 1 to return the buffer to a single one. +
  • +
+
+
+ +
+

1.1.4 code syntax highlighting and evaluation

+
+

+emacs provides support for lots of lanauges and you can start an interpreter and run code with C-c C-c (evaluate buffer) +

+ +

+You can also do code blocks and tangle / weave for literate programming. +

+ +

+My friend always used indent region and it was impressingly fast +

+
+
+
+ + +
+

1.2 random notes

+
+
+

1.2.1 useful things overview

+
+

+So there are two basic things that are useful about org mode: +

+
    +
  1. bullets are collapsible which makes it really easy to organize shit and move it around +collapsible items rule! +
  2. +
  3. TODO items have a lot of functionality +
  4. +
+ +

+The goal is to take projexdemo.org (another file in this directory) and format it into org mode. The reason is that then we can export it using pandoc with clean html (which we can add a loittle styling etc) .. . once we have a format established, we can loosely require people to add to pads in that format so that chhanges can be git pushed and incorportated into the html. You can see an example of what the raw html looks like here: https://irc.anarchyplanet.org/dox/org.html +

+ +

+(I think it's a good strategy to hit enter like this when we're done typing :) ) +

+
+
+ +
+

1.2.2 Switching between emacs 'buffers' (where different documents are open in the same emacs instance)

+
+
    +
  • to open projexdemo.org: C-x C-f and then start typing proj and then TAB (for autocomplete) +
  • + +
  • use C-x <left> and use C-x <right> to switch between buffers. +
  • +
+
+
+ +
+

1.2.3 making bullets

+
+

+So, I guess my first question is about how I make the bullets? +

+
+ +
  1. like this
    1. this is a sub-level
      +

      +Ok I'll give that a shot +

      + +

      +So to "attach" the bullet to the text under it, do I just add asterisks to the text? +

      + +

      +like this: +

      +
      +
    +
  2. + +
  3. Bullet
    +

    +This is the text under it! +

    + +

    +Damn that's east's easy :) +

    + +

    +yeah! and, you can do it with all kinds of list items, and it's also especially useful when you have long passages of text that you can just hide by pressing TAB. +

    + +

    +Perfect :) So, I might try to just "bullet" this conversation. +So I think what I did there makes sense in terms of how I organized that? +

    + +

    +YEAH! One more thing: +

    + +

    +to make new bullets you can do ALT-enter (ALT is known as M , so M-<enter>) +

    +
    +
  4. + +
  5. bullet1
  6. + +
  7. bullet 3
  8. + +
  9. bullet 2
  10. + +
  11. bullet 4
    +

    +and then, to change the order, you can use M-<up> and M-<down> … to promote you can use M-<left> and M-<right> (but this gets more complicated when you have sub-trees, so we'll worry about that layter beucause that's what I'm having problems with re; my keybindings) +

    + +

    +Note for noobs: You have to have the cursor under the bullet tomove your text, not the text itself. +

    +
    +
+
+
+
+
+
+

Created: 2019-01-23 Wed 14:51

+

Emacs 24.5.1 (Org mode 8.2.10)

+

Validate

+
+ + diff --git a/emacs.org b/emacs.org index 6b55b93..b7247b4 100644 --- a/emacs.org +++ b/emacs.org @@ -1,5 +1,11 @@ +essential keystrokes: (TAB to open bullets) <-- do this lol +C-x 1 to return buffer to 1 window C-g to cancel a command +C-h a to search for commands +tiling window: C-x [1..3] +C-k cut C-y paste + * emacs org mode ** Overview @@ -29,7 +35,50 @@ TODOs are actually probably not that relevant for projex because it's more for i - [[file:test.org][file]] C-c C-o to open at point this creates a split buffer. C-x o to switch between split buffers, C-x 1 to return the buffer to a single one. - +*** code syntax highlighting and evaluation + +emacs provides support for lots of lanauges and you can start an interpreter and run code with C-c C-c (evaluate buffer) + +You can also do code blocks and tangle / weave for literate programming. + +My friend always used indent region and it was impressingly fast + +*** IRC +how can i restart and save session? (keep buffers) + +there's M-x revert-buffer or +you can turn auto-revert-mode on so it will reload every time the file changes. +I've never used the second... rarely the first, I always just close :P +so i don't need to save it? it members? +no, you would have to save it. I always just do C-x C-c (closes all buffers) and save them all. I blieve if you try to revert-buffer it will prompt you to save. Do i do this after restarting or before? +C-c C-s saves all buffers, C-c C-c exits. + +M-x package-install circe +M-x circe +Can i set a socks proxy? +I am not sure... I don't understand all that v. well. + +last year i read an article/list post how outdated emacs' networking is and RMS agreed. i think the thread went viral .. + +could be! https://stackoverflow.com/questions/19699294/make-emacs-access-to-https-over-socks-proxy + +I was just gonna paste this :P + +how do i get into config mode? + +do you mean the customize emacs thing? + +to set socks-noproxy or socks-server. the config file .. + +the config file is at ~/.emacs +you can also change ~/.emacs.d/init.el + +Thanks, i changed my mind and prefer to keep my sanity! + +re: tor: we should use it for w3m tho, yah? + +sure, always. :) does emacs mind if we take aways some sycalls from it? + ** random notes *** useful things overview So there are two basic things that are useful about org mode: diff --git a/test.py b/test.py new file mode 100644 index 0000000..e7a9d7b --- /dev/null +++ b/test.py @@ -0,0 +1,3 @@ +arr = [0,1,2] +for x in arr: + print (x) #what are you dooing?