M-x grep-find in dired. Advance through matches with C-x `
1] Remembrance engine revisited:
ra-index -v ~/experiment/RA-indexes/svn ~/svn_test/trunk
;; in .emacs:
(load "remem.el")
(setq remem-prog-dir "/usr/bin")
(setq remem-database-dir "~/experiment/RA-indexes")
(setq remem-scopes-list '(("svn" 6 5 500) ("experiment" 6 5 500)))
;;(setq remem-terminal-mode t)
(setq remem-load-original-suggestion nil)
C-c r t - toggle
C-c r [number] see numbered suggestion
C-c r
2] Transparent version control using SVNAutoversioning and davfs// simple recipe:
In httpd.conf: <Location /repos> DAV svn SVNPath /root/svnrepo SVNAutoversioning on </Location> Making sure that we link: ln -s ../mods-available/dav_fs.load . and other dav stuff into mods-enabled // restart apache and test access in browser 127.0.0.1/repos/ Some play with repo permissions and finally: mount.davfs -o uid=xxxxx,gid=users,rw,no_netdev http://127.0.0.1/repos/ /dav
mockup:
1] Following:
http://sachachua.com/wp/2007/12/28/emacs-getting-things-done-with-org-basic/
with a few changes:
(defun remember-to-org ()
"Remember to Org."
(interactive)
(let ((remember-annotation-functions
(cons 'org-remember-annotation
remember-annotation-functions)))
(add-hook 'remember-mode-hook 'org-remember-apply-template)
(remember)
(set (make-variable-buffer-local
'remember-handler-functions)
'(org-remember-handler))))
(defun remember-to-planner ()
"Remember to Planner."
(interactive)
(let ((remember-annotation-functions
(append planner-annotation-functions
remember-annotation-functions)))
(remember)
(remove-hook 'remember-mode-hook 'org-remember-apply-template)
(set (make-variable-buffer-local
'remember-handler-functions)
'(remember-planner-append))))
(global-set-key (kbd "C-c r o") 'remember-to-org)
(global-set-key (kbd "C-c r p") 'remember-to-planner)
2] Also use of templates following:
http://orgmode.org/manual/Remember-templates.html
as:
(setq org-remember-templates
'(("Todo" ?t "* TODO %?\n %i\n %a" "~/experiment/TODO.org")
("private" ?p "* %U %?\n\n %i\n %a" "~/svn_test/trunk/notes.org")
("publish" ?u "* %T %?\n\n %i\n %a" "~/svn_test/trunk/orgpub/test.org")))
orgpub is our publishing site as defined by org-publish-project-alist.
3] Using C-u C-c C-c in remember buffer prompts for filename to save note under
1) diagramming (of nodes). text within node boxes. node as (any media) link (text/image/video -> further node). abstraction of file system
using resource pools
2) live/shared/locked editing of node buffers (linked node buffers so each node also links to other node diagram (eg. open/create AS
node)
3) cloning/forking of deep node structures
4) version control of node structures
5) translation of nodes to html, dot(graphviz) usw.
6) live Emacs Lisp code and shell code within nodes
7) PD patch as mapping of ideas also
TODO starting:
0) research into comp systems: http://dto.mamalala.org/blog/
1) simple diagramming using artist-mode
2) identify useful characteristics in org-mode
3) how to work with org-mode - as abstraction?
4) node management
5) version control
6) networked editing
7) putting it all together
In dired:
*t to mark all files A to search for expression and M-, to cycle through found files (fixed after eev-compose.el was also using this binding)
Using: graphviz-dot-mode.el
http://www.graphviz.org/Misc/graphviz-dot-mode.el
(load "graphviz-dot-mode")
M-x graphviz-dot-mode
C-c c to compile the graph
C-c p to preview
Examples in: /usr/share/doc/graphviz/examples/graphs
Working towards forest/chicken/island/vacuum protocol browser in Emacs (quasi mind-mapping):
artist.el in GNU Emacs
With functions such as:
(artist-draw-line 10 10 10 50)
(artist-draw-ellipse 50 50 20 20)
... circles, rectangles, figlet text.
related:
http://cedet.sourceforge.net/cogre.shtml
COGRE is pronounced similarly to cougar. It is a base library for editing and manipulating connected graphs. Additional tools will be available using COGRE for managing diagrams for UML flavors, such as a class hierarchy diagrams.
The short term goal of COGRE is just to be able to create and manipulate a few boxes linked together with lines in an Emacs buffer.
[ unrelated but also note use of doc-view for PDF viewing, and graphviz-dot-mode.el for diagramming ]
(defun org-toc-test ()
(interactive)
(let ((pos (point)))
(goto-char pos)
(outline-next-heading)
;; (org-cycle)
(progn (org-overview)
(if org-toc-show-subtree-mode
(org-show-subtree)
(org-show-entry))
(org-show-context)
(recenter org-toc-recenter))))
see: nicepresentation.html
Towards a diagram mode - next to specify a la org-mode how to place boxed text at various levels, embedding of boxes and lines between connected text regions - some potential re-organisation of box/headings. Overprint also for titling of boxes
Further - following:
http://groups.google.de/group/comp.lang.lisp/browse_thread/thread/0b30b8c1ef384d1e
see -- other side of 1010:
http://1010.co.uk/blame_parse.el
Post-use of psvn.el:
http://www.xsteve.at/prg/emacs/psvn.el
(in Emacs CVS/23 already)
and M-x svn-status-blame
Once we have created repository and checked out local files (issue svn-status from checked out directory/file)
Using both planner-mode and org-mode:
http://1010.co.uk/org-mode.html
http://sachachua.com/notebook/wiki/2007.10.05.php#anchor-3
http://1010.co.uk/annotate110907.el
So that new page annotations are placed under same major heading.
Still need some way of organising multiple annotations (how to possibly parse line number).
http://orgmode.org/faq.html#sec-32
for event software:
additionally:
1] tags/categories/properties/all cycling:
below at:
http://1010.co.uk/emacs.html#43
Visibility cycling:
C-c C-a - show all
Shift-TAB - rotate
cycle links:
C-c C-x C-n
2] remember shell and elisp links as:
shell:ls blah A shell command
elisp:(find-file-other-frame "Elisp.org") An elisp form to evaluate
3] linkd
4] to publish notes - replace planner... more integration
xx] RSS with org-publish
http://dto.freeshell.org/notebook/:.html
setup publishing system
integrate with remember
css and layout.
how new items are inserted from remember (under certain headings on certain pages)
xxx] http://orgmode.org/org.html#Complex-example
To be used in gneve buffer at timecode point to store media/timecode link with C-c l
later recalled in org-mode buffer with C-c C-l
Traditional W.S Burrough's cutup technique for GNU Emacs:
http://www.netfort.gr.jp/~dancer/software/apt-mode.html.en
1] Marking up for example ** emacs workshop (headline) with C-c . - insert date
2] Add file to agenda list with C-c [
3] Use C-c a followed by options to interrogate timeline/tags usw.
4] Working with tags/categories/properties:
a) Sparse trees:
C-c a f with:
(setq org-agenda-custom-commands
'(("f" occur-tree "emacs")))
b) links with emacs searches for text on C-c C-o
c) C-c C-c add TAG to a headline:
Tags make use of the hierarchical structure of outline trees. If a heading has a certain tag, all subheadings will inherit the tag as well. For example, in the list
d) Search TAGs:
[from org-mode manual]
6.3 Tag searches
Once a tags system has been set up, it can be used to collect related
information into special lists.
C-c \
C-c / T
Create a sparse tree with all headlines matching a tags search. With a C-u prefix argument, ignore headlines that are not a TODO line.
C-c a m
Create a global list of tag matches from all agenda files. See Matching tags and properties.
C-c a M
Create a global list of tag matches from all agenda files, but check only TODO items and force checking subitems (see variable org-tags-match-list-sublevels).
e) Properties - properties and values:
M-x org-insert-property-drawer
C-c / p
Create a sparse tree based on the value of a property. This first prompts for the name of a property, and then for a value. A sparse tree is created with all entries that define this property with the given value. If you enclose the value into curly braces, it is interpreted as a regular expression and matched against the property values.
f) During a search, properties will be inherited from parent entries
only if you configure the variable org-use-property-inheritance.
g) Add hyperlink types to org-mode for media:
such as:
video:filename#position
h) Dynamic blocks
5] How we could transition to org-mode for wiki:
Questions:
1) remember can be integrated
Also we have templates for remember
2) publishing/markup (eg. fontlock for code)
QUOTE: - see other native export options
3) different projects/project pages - in remember we specify a directory
see also org-publish.
4) RSS feed?
with C-c C-e h : event.html
1] Add the following to .stumpwmrc to start Swank:
(asdf:oos 'asdf:load-op 'swank) (swank:create-server :dont-close t)
2] Call slime-connect with defaults from GNU Emacs
3] Ignore protocol complaint
4] Test in slime-repl:
(mapc 'stumpwm:toggle-mode-line stumpwm:*screen-list*)
which should toggle the mode-bar in Stumpwm
for life coding:
1] Trinity of: frames/process/knowledge base
2] Infrastructure -
a) literal Emacs window management:
winring.el: http://barry.warsaw.us/elisp/winring.el
tapestry.el
layoutrestore: http://www.emacswiki.org/cgi-bin/wiki/layoutrestore.el
b) media management. Our own gneve.el, shell access
also:
http://delysid.org/emacs/rme.el
http://delysid.org/emacs/jack.el
c) comes under the heading of resources
d) resources display
using table of contents for org-mode:
http://www.cognition.ens.fr/~guerry/u/org-toc.el
and toggle with f character after: M-x org-toc-show
e) version control automated
see also ediff modes and:
http://www.emacswiki.org/cgi-bin/emacs-en/
f) towards some kind of time/diagram mode spidering out
3] Relation//display and processes
fork jonni
4] Emacs CL/Common Lisp guide to note: http://dto.freeshell.org/e/cl-guide.el
1] C-u prefixing eval last s-exp: C-x C-e prints output into this buffer
from:
which is also worth noting for future GNU Emacs workshop
C-u C-x C-f for file (usual w3m browsing for URLs)
also x-dict.el from:
http://xsteve.at/prg/emacs/index.html
For German<->English dictionary and word lookup at point
[ uses . as keybinding in x-dict-mode - but some read-only issues]
1] M-x list-faces-display to show fonts
2] (put-text-property (point-min) (point) 'face 'goby-face:0:3:0) // for example
for a chosen font and:
(set-face-attribute face nil :foreground color))
for colour.
http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html
C-l to re-display them
As minor mode with org-mode we use ‹foo.png› syntax for images which can be embedded under headings and so on.
http://www.shellarchive.co.uk/Emacs.html#sec9
[Note: after running Emacs as server using (server-start) ]
In search of shell functionality, Emacs integration, application launching:
1] zsh - recursive globbing, autocorrecting, decent completion.
But must be set up with:
#!/bin/zsh # completion autoload -U compinit compinit # correction setopt correctall # prompt autoload -U promptinit promptinit prompt adam2 setopt hist_ignore_all_dups HISTFILE=~/.zshhistory HISTSIZE=1024 SAVEHIST=1024 setopt GLOB setopt EXTENDED_HISTORY setopt INC_APPEND_HISTORY setopt SHARE_HISTORY setopt HIST_IGNORE_DUPS setopt HIST_FIND_NO_DUPS setopt HIST_IGNORE_SPACE setopt HIST_VERIFY setopt NO_HIST_BEEP setopt NO_BEEP setopt NO_HUPsee also:
http://grml.org/zsh/zsh-lovers.html
http://rayninfo.co.uk/tips/zshtips.html
http://www.gentoo.org/doc/en/zsh.xml
2] xwem (WM in Emacs Lisp) - relies on XEmacs!
Ratpoison as a possibility: http://www.nongnu.org/ratpoison/
or plain X with X-enabled GNU Emacs and w3m making use of both windows and frames [in short windows a splittable]:
frames:
C-x 5 2 - buffer as new frame
C-x 5 o shift frames
C-x 5 0 kill frame
and various b, f, d options which follow window use:
C-x 4 b - buffer in new window
d as dired in new window, m as mail, r filename as read only
see also:
http://www.chemie.fu-berlin.de/chemnet/use/info/emacs/emacs_21.html
3] eshell and dired/image-dired/ange-ftp - /newlife@ftp.1010.co.uk:/ /tramp.
dired - d mark, x delete all
ange-ftp-copy-file
Eshell: http://johnwiegley.com/eshell.html
Needs a good degree of customisation:
http://www.emacswiki.org/cgi-bin/wiki/
5] launch xterm with app - to wrap in Emacs Lisp/eshell:
(start-process "my-process" nil "/usr/bin/xterm" "-e" command)
using GNU Emacs 22/image-dired/linkd/org-mode usw.
Note:
To enter Image-Dired, mark the image files you want to look at in the Dired buffer, using m as usual. Then type C-t d (image-dired-display-thumbs). This creates and switches to a buffer containing image-dired, corresponding to the marked files.
code also from goby and/or eev (see emacs - where this should also go!)
In Groups buffer to read in a previously archived GNUS mail directory use:
G d - Make a directory group. You will be prompted for a directory name (gnus-group-make-directory-group).
by way of:
http://www.chemie.fu-berlin.de/chemnet/use/info/gnus/gnus_4.html
I put back cursor in view mode so can evaluate Emacs Lisp within the presentation:
http://1010.co.uk/makeart2.gby
(process to start: evaluate (autoload 'goby "goby" nil t), M-x goby, then switch to original frame and load this file)
C-;v - view
testing:
C-c;@ : Create HTML files with screen dumps
which doesn't seem to work so well
for generic usage see:
http://www.mew.org/~kazu/proj/goby/usage.html.en
(find-eimage0 "~/Wiki/images/zuse1.png")
which, when evaluated with M-e or C-x C-e displays image in place of text:
(defun eeimage-data (fname)
(with-temp-buffer
(set-buffer-multibyte nil)
(insert-file-contents-literally fname)
(buffer-string)))
(defun eeimage-set (s e fname)
(add-text-properties s e
`(display (image :type ,(image-type-from-file-header fname)
:data ,(eeimage-data fname)))))
(defun find-eimage0 (fname &optional nlines nchars &rest ignored)
"Display the image given by FNAME in place of the text between point and bol.
This function is meant to be used with \\[eek-eval-sexp-eol], so
by default it will change the appearance of the entire current
line. If NLINES is non-nil then work on that number of lines
instead - e.g., 5 means change this line and the four previous
ones. A non-nil value of NCHARS means to use bol+NCHARS instead
of bol."
(eeimage-set (point)
(+ (or nchars 0) (point-at-bol (- 2 (or nlines 1))))
(ee-expand fname)))
btw. Emacs fontlock is broken somehow with text falling out of boy - not used here but...
//to note further eev and remote execution/editing
M - mark
C - copy
R - rename/move
+ - create directory
see also: http://www.chemie.fu-berlin.de/chemnet/use/info/emacs/emacs_31.html
and:
http://tutor.hsz-t.ch/tutorials/emacs-intro/node17.html
http://www.gmdsoft.de/mitsch/kbase/kbase/emacs-howto.txt
! - direed do shell eg rm -rf
directed to this by way of aymeric of http://goto10.org:
howm: Write fragmentarily and read collectively:
A (capital A) - search/grep within files in dired's list of directories
s - toggle ordering - alphabetical/by date
see also as reference:
http://www.cs.auckland.ac.nz/references/gnu/emacs/emacs_32.html
Changes to use princ and wrapper to send un-evaluated text
Also last eval was just one sexp...
The dangers of evaluating system commands!
(defun prm-sendregionastext() ;; works as long as we don't have any inverted commas (interactive) (save-excursion (save-restriction (narrow-to-region (region-beginning) (region-end)) (process-send-string "prm_client" (format "(princ \"%s\" (current-buffer))" (buffer-string)))))) (defun prm-serve (proc string) (let ((prm-process proc)) (setq temp_buffer (get-buffer-create "temp_buffer__")) (princ string temp_buffer) (switch-to-buffer the_buffer) (eval-buffer temp_buffer) (set-buffer temp_buffer) (erase-buffer))) but for text we need to escape inverted commas/reparse buffer before evaluation
start server, start client, send regions or buffer as code for remote evaluation
;;client and server ;; server functions - receive incoming requests. eval code (defvar prm-process nil) (defvar prmclient-process nil) (defvar the_buffer nil) (defvar host nil) (defvar port nil) (defun prmserv-start (&optional port) (interactive (list (read-string "Serve requests on port: " "8080"))) (if (null port) (setq port 8080) (if (stringp port) (setq port (string-to-number port)))) (if prm-process (delete-process prm-process)) (setq the_buffer (generate-new-buffer "prm")) (setq prm-process (make-network-process :name "prm" :buffer the_buffer :host 'local :service port :server t :noquery t :filter 'prm-serve))) (defun prm-stop () (interactive) (when prm-process (message "prmisc.el server on port %d has stopped" (cadr (process-contact prm-process))) (delete-process prm-process) (setq prm-process nil))) (defun prm-serve (proc string) (let ((prm-process proc)) (switch-to-buffer-other-window the_buffer) (print (eval (read string)) the_buffer))) ;; client functions - initiate connection, send buffer, send region, send last sexp ;; how collab editing could work ?? (defun prmclient-start (&optional port host) (interactive (list (read-string "Send requests on port: " "8080"))) (if (null port) (setq port 8080) (if (stringp port) (setq port (string-to-number port))) (if prmclient-process (delete-process prmclient-process)) (setq prmclient-process (make-network-process :name "prm_client" :host host :service port)))) (defun prm-sendbufferascode() (interactive) ;; (switch-to-buffer the_buffer) (process-send-string "prm_client" (buffer-string))) (defun prm-sendregionascode() (interactive) (save-excursion (save-restriction (narrow-to-region (region-beginning) (region-end)) (process-send-string "prm_client" (buffer-string))))) ;;(prmclient-start 8080 "127.0.0.1") ;;(prmserv-start 8080) ;;(prm-stop) ;;(prm-sendregionascode)
http://xahlee.org/elisp/Network-Processes.html
Referencing httpd.el in earlier iteration we don't have:
(fboundp 'open-network-stream-server) ;; M-x e gives nilland with ref to later code (emerge htppd, require...):
(featurep 'make-network-process)as in:
(defun httpd-start (&optional port) (interactive (list (read-string "Serve Web requests on port: " "8080"))) (if (null port) (setq port 8080) (if (stringp port) (setq port (string-to-number port)))) (if httpd-process (delete-process httpd-process)) (setq httpd-process (if (fboundp 'make-network-process) (make-network-process :name "httpd" :buffer (generate-new-buffer "httpd") :host 'local :service port :server t :noquery t :filter 'httpd-serve) (and (fboundp 'open-network-stream-server) (open-network-stream-server "httpd" (generate-new-buffer "httpd") port nil 'httpd-serve))))which is not in our 21.4 version... see:
http://xahlee.org/elisp/Antinews.html changelog for those downgrading to 21.4 from 22.0:
Networking has also been simplified: make-network-process and its various associated function have all been replaced with a single easy-to-use function, open-network-stream, which can't use UDP, can't act as a server, and can't set up non-blocking connections. Also, deleting a network process with delete-process won't call the sentinel.
... upgrade or use shell helper a la netcat...
[also for workshop]
1] Bookmarks:
C-x r m - mark
C-x r b - retrieve
C-x r l - list
C-x e - annotate
[bookmarks also present planner note automatically]
2] Frames:
C-x 5 2 - make-frame of buffer
C-x 5 b - switch to buffer in frame
C-x 5 o - shift to next frame
C-x 5 0 - delete frame
[misc: C-x s - save some buffer M-x man - man page]
3] M-x calendar:
g d - goto day
i d - insert diary entry at day
s - show all diary entries
d - show entry for date
4] Dired [access when open directory using C-x C-f]:
d - mark for deletion/D - delete
x - delete marked
u - remove flag
C - copy
R - rename
g - update display
= - diff
<>^ - navigation
i - insert expanded directory into dired buffer
+ - create directory
working with groups of files:
mark files with m, work on groups of files using say Z to compress
M-del - unmark
t - toggles marks
%m - use regular expression to mark files
5] Version control and ediff:
Transparent version control using C-x v v - next logical version control file (create RCS, check in/out usw.)
C-x v u - revert buffer
C-x v ~ - retrieve a given revision
C-x v l - display history
M-x ediff-revision
next-up: w3m in X-enabled Emacs session:
see:
(find-node "(emacs-w3m)Inline Images")
(for eev-enable GNU Emacs -also points towards use of w3m so that using eev we can readily execute sample code from Web pages)
Networking in Emacs Lisp (by way of netcat or socat, a glance at the Distel code-base and also server.el --- Lisp code for GNU Emacs running as server process and some more server/networked code examples below )
VM (Virtual Machines) (kind of) in Emacs Lisp (not the VM mail reader!):
http://delysid.org/emacs/bf.el
; This implements a BrainFuck interpreter and a compiler written in ;; Emacs-Lisp. To demonstrate that the implementation is really ;working, ;; a weird test-case is included. A BrainFuck interpreter ;; written in BrainFuck compiled to emacs-lisp executing brainfuck code.
also for reference:
http://emacs.wordpress.com/2007/01/17/eval-and-replace-anywhere/
GNU Emacs quick reference: http://safari5.bvdep.com/1565921526/gnu2-APP-H
ERC GNU Emacs IRC client: http://www.emacswiki.org/cgi-bin/wiki?action=browse;oldid=EmacsIRCClient;id=ERC
and:
http://www.emacswiki.org/cgi-bin/wiki/ ...
(require 'erc)
M-x erc-select
/JOIN #my_channel
1] Installation: untar in its own directory. ./eev-rctool prepare and ./eev-rctool install_rc
2] Brief use:
functions:
find-node, find-fline, find-efile, find-enode (for Emacs Lisp), find-eevfile
(find-node "(emacs)Lisp Eval" "C-x C-e")
is equivalent to:
(find-enode "Lisp Eval" "C-x C-e") which both search info node for that string
M-e to execute Emacs Lisp in middle of line
M-k kill newly opened buffer
M-x ee to write standard marked code to be executed by the shell using the ee command
M-h M-f as also of interest to generate hyperlinks about an Emacs Lisp function
C-q C-o created the red star delimiter character which can be used to mark blocks of text/code (hash star) for later execution using F3 in block
From 15. Communication channels of: http://angg.twu.net/eev-current/article/eev.txt.html
The way that we saw to send commands to a shell is in two steps: first we use M-x eev in Emacs to send a block of commands, and then we run ee at the shell to make it receive these commands. But there is also a way to create shells that listen not only to the keyboard for their input, but also to certain communication channels; by making Emacs send commands through these communication channels we can skip the step of going to the shell and typing ee' - the commands are received immediately.
and:
Eev binds F9 to a command that operates on the current line and then moves down to the next line; if the current line starts with star then what comes after the star is considered as Lisp code and executed immediately, and the current line doesn't start with star then its contents are sent through the default communication channel, or though a dummy communication channel if no default was set.
http://angg.twu.net/eev-current/eev-insert.el
"executable notes"
http://angg.twu.net/eev-current/README
(defvar proclist nil) (defconst number-regexp "-?\\([0-9]+\\.?\\|\\.\\)[0-9]*\\(e[0-9]+\\)?" "Regular expression for recognizing numbers.") (defun lsof () ;; perform lsof and grep for FIFO. start of line - process number. store in list if it is unique (let ((buffer (get-buffer-create "**leakprocess1**"))) (setq proclist nil) (set-buffer buffer) (erase-buffer) (switch-to-buffer "**leakprocess1**") (call-process "lsof" nil t nil "-nFpt") (goto-char (point-min)) (while (< (point) (point-max)) ;; (beginning-of-line) (forward-word 1) (re-search-forward "FIFO" nil t) (setq oldpoint (point)) (re-search-backward "p" nil t) (forward-char 1) (setq proclist (cons (matcher) proclist)) (goto-char oldpoint) ;; (next-line 1) ))) (lsof) (defun leaker() ;; select drip FIFO from list. access FD in proc filesystem (setq string (nth (random (length proclist)) proclist)) (switch-to-buffer "**pool**") ;;read list of file descriptors (setq filename (choose-fd string)) (if (file-regular-p filename) (setq result filename) ;;drip read x characters and write to buffer (insert-file-contents result nil 0 500))) ;; change to randoms for length (let ((buffer (get-buffer-create "**pool**")))) (while 1 (leaker));; update FIFO list and do this at random intervals ;;(insert (format "%s" proclist)) ;;(print proclist) (defun matcher () (let (string) (if (looking-at number-regexp) (goto-char (match-end 0))) (setq string (buffer-substring (match-beginning 0) (point))) (string-to-int string))) ;; should just be string?? (defun choose-fd (stringy) ;; choose from /proc/stringy/fd/n using random (setq attempt (concat "/proc/" (number-to-string stringy) "/fd/")) (if (file-readable-p attempt) (setq number (random (length (directory-files attempt)))) (setq number 0)) (concat "/proc/" (number-to-string stringy) "/fd/" (number-to-string number)))
for, say Python shell:
bound to M-p and next to M-n
in python-mode: (emerge python-mode)
also using:
M-x py-execute-buffer
and:
M-x python-shell
(in xxxxx/pickled_feet Python workshop with Julian Oliver)
also in Python help(type) where type is a variable on a certain type
Some progress in navigating video file and marking in and out points in buffer:
1) Navigate with C-q and C-w (back and forwards), C-k frame by frame (should change bindings), C-l toggles pause.
2) Mark start point with C-e. End points with C-r
3) Insert these into GNEVE buffer with H
;;; make a mode - keys and so on (defvar gneve-mode-map nil "local keymap for gneve") ;;(setq gneve-mode-map nil) (if gneve-mode-map nil (setq gneve-mode-map (make-sparse-keymap)) (define-key gneve-mode-map "\C-k" 'next-frame) (define-key gneve-mode-map "\C-l" 'pause) (define-key gneve-mode-map "\C-q" 'one-sec-back) (define-key gneve-mode-map "\C-w" 'one-sec-forward) (define-key gneve-mode-map "\C-e" 'mark-start) (define-key gneve-mode-map "\C-r" 'mark-end) (define-key gneve-mode-map "H" 'write-marks)) (defun gneve-mode() "EDL and mplayer based GNU Emacs video editing mode" (interactive) (start-process "my-process" "boo" "/root/MPlayer-1.0rc1/mplayer" "-edlout" "/root/test.edl" "-slave" "-quiet" "/root/possession.avi") (pop-to-buffer "*GNEVE*" nil) (kill-all-local-variables) (setq major-mode 'gneve-mode) (setq mode-name "gneve") (use-local-map gneve-mode-map)) (defun next-frame () (interactive) (process-send-string "my-process" "frame_step\n")) (defun pause () (interactive) (process-send-string "my-process" "pause\n")) (defun write-marks () ;; copy/write both last-in and last-out to end of gneve buffer (interactive) (switch-to-buffer "*GNEVE*") (goto-char (point-max)) (insert (format "%s %s" lastin lastout))) (defun one-sec-back () (interactive) (process-send-string "my-process" "seek -0.5\n")) (defun one-sec-forward () (interactive) (process-send-string "my-process" "seek 0.1\n")) (defun mark-start () ;; copies latest mark to boo. copy and paste only to variable - new function write to buffer (interactive) (progn ;; goto end of buffer search back to equals and copy to last-in (switch-to-buffer-other-window "boo") (process-send-string "my-process" "pausing get_time_pos\n") (sleep-for 0.1) (goto-char (point-max)) (backward-char) (backward-char) (setq end (point)) (search-backward "=") ;; one char forward (forward-char) (setq start (point)) (copy-region-as-kill start end) (setq lastin (car kill-ring)) (switch-to-buffer-other-window "*GNEVE*"))) (defun mark-end () ;; copies latest mark to boo. copy and paste only to variable - new function write to buffer (interactive) (progn ;; goto end of buffer search back to equals and copy to last-in (switch-to-buffer-other-window "boo") (process-send-string "my-process" "pausing get_time_pos\n") (sleep-for 0.1) (goto-char (point-max)) (backward-char) (backward-char) (setq end (point)) (search-backward "=") ;; one char forward (forward-char) (setq start (point)) (copy-region-as-kill start end) (setq lastout (car kill-ring)) (switch-to-buffer-other-window "*GNEVE*")))
Also to be used as subtitle editor.
notes:
Creating an Asynchronous Process
Function: start-process name buffer-or-name program &rest args
This function creates a new asynchronous subprocess and starts the program program running in it. It returns a process object that stands for the new subprocess in Lisp. The argument name specifies the name for the process object; if a process with this name already exists, then name is modified (by adding <1>', etc.) to be unique. The buffer buffer-or-name is the buffer to associate with the process.
buffer-or-name is of interest to try and receive timing information from mplayer slave:
references:
http://www.chemie.fu-berlin.de/chemnet/use/info/elisp/elisp_34.html
http://www.mplayerhq.hu/DOCS/tech/slave.txt
rough idea to edit video in Emacs Lisp:
http://www.gnu.org/software/emms/
;; emms-player-mplayer.el --- mplayer support for EMMS (defun emms-player-mplayer-seek (sec) "Depends on mplayer's -slave mode." (process-send-string emms-player-simple-process-name (format "pausing seek %d\n" sec)))
http://www.neilvandyke.org/quack/
1] download and (require 'quack) in .emacs
http://www.neilvandyke.org/quack/quack.el
2] default fontlock for ;;; comments (three semicolons) is blue text-invisible bars. change this with:
(setq quack-fontify-threesemi-p nil)
3] Key bindings:
;; The key bindings that Quack adds to scheme-mode' include: ;; ;; C-c C-q m View a manual in your Web browser. ;; C-c C-q k View the manual documentation for a keyword ;; (currently only works for PLT manuals). ;; C-c C-q s View an SRFI. (Scheme Requests for Implementation) ;; C-c C-q r Run an inferior Scheme process. ;; C-c C-q f Find a file using context of point for default. ;; C-c C-q l Toggle lambda' syntax of define'-like form. ;; C-c C-q t Tidy the formatting of the buffer.
Following Pascal Bourguignon's advice (http://www.informatimago.com/linux/emacs-on-user-mode-linux.html).
A few points:
(global-set-key "^\" 'keyboard-quit) ;; strangely, C-g does not work.
from /emacs/.emacs
emacs: Terminal type linux is not defined.
mkdir -p /emacs/usr/share/terminfo cp -R /usr/share/terminfo/* /emacs/usr/share/terminfo/
1] sans TCP:
see: httpd.el -- a web server in Emacs Lisp
at: http://www.chez.com/emarsden/downloads/
notes:
:: Since Emacs does not (yet!) provide server sockets, you ;; need a helper program to bind to the socket and forward requests. ;; There are two ways of doing this: use a service like inetd to ;; launch a fresh emacs instance for each incoming request, or use a ;; program which forwards requests via gnuserv. The second method ;; obviously provides better performance.
eg:
;; 8080 stream tcp nowait.10000 nobody /usr/bin/emacs emacs -batch \ ;; -l /path/to/httpd.el -f httpd-serve
or use httpd-serve Python script... (from where?)
or see:
muse-http.el file that can turn Emacs into a webserver, much like the emacs-wiki-httpd.el module, except that it doesn't need an external Python script.
muse-http handles requests by way of httpd.el later version:
http://sacha.free.net.ph/notebook/emacs/muse/httpd.el
with lines:
(defun httpd-start (&optional port) (interactive (list (read-input "Serve Web requests on port: " "8080"))) (if (null port) (setq port 8080) (if (stringp port) (setq port (string-to-int port)))) (if httpd-process (delete-process httpd-process)) (setq httpd-process (open-network-stream-server "httpd" (generate-new-buffer "httpd") port nil 'httpd-serve)) (if (eq (process-status httpd-process) 'listen) (message "httpd.el is listening on port %d" port)))see also:
http://www.emacswiki.org/cgi-bin/wiki/rcirc.el
2] In GNU Emacs reference manual:
Emacs Lisp programs can open TCP network connections to other processes on the same machine or other machines. A network connection is handled by Lisp much like a subprocess, and is represented by a process object. However, the process you are communicating with is not a child of the Emacs process, so you can't kill it or send it signals. All you can do is send and receive data. delete-process closes the connection, but does not kill the process at the other end; that process must decide what to do about closure of the connection.
3] Gnuclient and gnuserv:
Gnuserv: It allows arbitrary Emacs Lisp commands to be sent to an Emacs process running either on the local machine or on another machine on the network.
http://linuxgazette.net/issue29/marsden.html
(Gnuserv is bundled with XEmacs by default but can be used with GNU Emacs.
see:
http://meltin.net/hacks/emacs/gnuserv/README
)
4] ebby - shared Emacs buffers for collaborative editing (no link)
(on this thread:
http://technomancy.us/blog/post/45 and:
http://bc.tech.coop/blog/060509.html)
and thus:
5] Distel: http://bc.tech.coop/blog/060111.html
but w3m bookmarking - using a and v keys for add and recall (very basic)
is not integrated with usual Emacs bookmarks which now work with planner after we load planner-bookmark.el
from tech_notes ::
C-x r m - make
C-x r b - retrieve
C-x r l - list bookmarks
annotate from this list using e - edit annotation
also bookmark-insert - insert full text of bookmark
and their integration with planner:
C-x r m after all done opens up a remember buffer with bookmark URL
( I to view image)
but integrates by way of URL as below
TODO:
1) shift from firefox to w3m (how to export bookmarks?) and learn new
functionalities
2) make more use of local bookmarking and planner as notation system
(so untie from site updating)
is M-x remember from w3m buffer (whatever we are browsing) to fill in link automatically as below:
but need to research further on Emacs bookmarks, w3m and planner integration - some stuff below already on tech_notes page
[copied from research but should cover soon...
with reference to Distel but we don't really want to dig into Erlang...
looking at http://fresh.homeunix.net/~luke/shbuf/ which allows for shared Emacs buffers on top of Distel....
client.server application with serveur written in Erlang
also Termite on Gambit Scheme
or even simpler is Paul Graham continuation-led code in lisproc.lisp to be investigated [attempt for panel module to wrap up with querying, speech and OSC/PD macro]
GNU Emacs as central spider-like application within web of a projected pluggable promiscuOS
though still most of pluggable stuff for example SC/Supercollider Packet Forth Pure Data and GNU Emacs related material is there
also gnus is there.
C-x ( : start recording C-x ) : end recording C-x e : playback M-f forward word. C-f forward character M-b back. C-b back
also just for record on:
c) emacs and frames:
C-x52 - make new frame from current buffer C-x5o - move between frames C-x5b - move to new buffer and frame C-x5f - file in frame C-x50 - delete frame
some interesting slime stuff to note. also generic Emacs
M-/ expands text at point by way of dabbrev-expand
1) Emacs workout:
a) searching history in shell/minibuffer
M-r regexp : search back M-s regexp : search forwards
M-p and M-n just back and forwards in history
b) for some reason with this GNU Emacs 21.3.50-2 errors when try wiki-remote-get from wiki-remote.el
some problem with w3 so removed require for w3 (is now just w3m) and works fine
c) BBDB removal of records:
in BBDB buffer got record and:
M-x bbdb-delete-current-record
d) help:
C-h doesn't do help - does backspace
but we have:
(global-set-key "\C-h" 'delete-backward-char)
(global-set-key "\C-xh" 'help)
which solves al problems with C-x h as help
with following options:
k - keystroke describe
f - what does function do
v - variable
m - mode
b - current bindings
w - where is the key binding for this command
a - apropos
e) dired:
C-x d dired mode or simply open a directory with C-x C-f
f) Emacs Lisp: write sample function to cutn'paste Remembrance agent suggestions into the current buffer
g) bookmarks and annotation:
C-x r m - make
C-x r b - retrieve
C-x r l - list bookmarks
annotate from this list using e - edit annotation
also bookmark-insert - insert full text of bookmark
and their integration with planner:
C-x r m after all done opens up a remember buffer with bookmark URL
but can't seem to get to grips with annotations and planner:
seems like when do M-x remember from bookmark buffer the annotation is also inserted
C-f C-b character forward/back
M-f M-b word forward/back
C-p C-n lines
C-v M-v page
here is .emacs
(tool-bar-mode nil) (menu-bar-mode nil) (scroll-bar-mode nil) ;;emacswiki html (add-to-list 'load-path "/root/sacha-stable/planner") (add-to-list 'load-path "/root/sacha-stable/remember") (add-to-list 'load-path "/root/sacha-stable/emacs-wiki") (setq emacs-wiki-style-sheet "<style type=\"text/css\"> a.nonexistent { font-weight: bold; background-color: white; color: #FF2222; } a.nonexistent:visited { background-color: white; color: #FF2222; } body { background: pink; color: black; margin-left: 5%; margin-right: 5%; margin-top: 3% } em { font-style: italic; } strong { font-weight: bold } ul { list-style-type: disc } dl.contents { margin-top: 0 } dt.contents { margin-bottom: 0 } p.verse { white-space: pre; margin-left: 5% } pre { white-space: pre; margin-left: 5% } pre.fontlock { white-space: pre; margin-left: 5%; border-color: black; border-width: 1px; border-style: solid; background: rgb(255,228,196); margin: 1em; padding: 1em; text-align: left; } span.default { background: rgb(255,228,196); color: rgb(47,79,79); font-style: normal; font-weight: 500; font-stretch: semi-condensed; font-family: misc-fixed; font-size: 9pt; text-decoration: none; } span.default a { background: rgb(255,228,196); color: rgb(47,79,79); font-style: normal; font-weight: 500; font-stretch: semi-condensed; font-family: misc-fixed; font-size: 9pt; text-decoration: underline; } span.builtin { color: rgb(186,85,211) } span.builtin a { color: rgb(186,85,211) } span.type { color: rgb(0,139,139) } span.type a { color: rgb(0,139,139) } span.keyword { color: rgb(205,0,0) } span.keyword a { color: rgb(205,0,0) } span.comment { color: rgb(79,148,205) } span.comment a { color: rgb(79,148,205) } span.constant { background: rgb(255,218,185); color: rgb(205,133,0) } span.constant a { background: rgb(255,218,185); color: rgb(205,133,0) } span.warning { color: rgb(255,0,0) } span.warning a { color: rgb(255,0,0) } span.function-name { color: rgb(0,0,205) } span.function-name a { color: rgb(0,0,205) } span.variable-name { color: rgb(145,44,238) } span.variable-name a { color: rgb(145,44,238) } span.string { background: rgb(255,218,185); color: rgb(34,139,34) } span.string a { background: rgb(255,218,185); color: rgb(34,139,34) } </style>") ;;; Load everything ... (require 'emacs-wiki) (require 'htmlfontify) (require 'cl) (add-to-list 'emacs-wiki-markup-tags '("fontlock" t t t sd-emacs-wiki-fontlock-tag)) (defun sd-htmlfontify-insert-region (buffer begin end) "Insert into BUFFER the htmlified text between BEGIN and END." (save-excursion (let* ((hfy-optimisations (cons 'skip-refontification hfy-optimisations)) (input-text (buffer-substring begin end)) (temp-file (make-temp-file "html-input")) output-buffer) (with-temp-buffer (insert input-text) (setq buffer-file-name temp-file) (save-excursion (setq output-buffer (htmlfontify-buffer nil nil))) (set-buffer-modified-p nil)) (unwind-protect (let (b e yanked-output) (set-buffer output-buffer) (goto-char (point-min)) (search-forward "<pre>\n") (setq b (line-beginning-position)) (goto-char (point-max)) (search-backward "</pre>") (forward-line -1) (setq e (line-beginning-position)) (setq yanked-output (buffer-substring-no-properties b e)) (set-buffer buffer) (insert yanked-output)) (set-buffer output-buffer) (set-buffer-modified-p nil) (delete-file temp-file) (kill-buffer output-buffer))))) (defun sd-emacs-wiki-fontlock-tag (beg end attrs highlight-p) (if highlight-p (goto-char end) (let ((end-marker (set-marker (make-marker) (1+ end))))) (save-restriction (narrow-to-region beg end) (let* ((mode (cdr (assoc "mode" attrs))) (start (progn (forward-line) (point))) (stop (progn (goto-char end) (beginning-of-line) (point))) (text (buffer-substring-no-properties start stop)) (buffer (current-buffer))) (delete-region beg end) (with-temp-buffer (insert text) (when (and mode (and (stringp mode) (functionp (intern mode)))) (funcall (intern mode)) (font-lock-fontify-buffer)) (sd-htmlfontify-insert-region buffer (point-min) (point-max))) (goto-char (point-min)) (insert "<pre class=\"fontlock\">\n") (goto-char (point-max)) (insert "</pre>\n") (add-text-properties (point-min) (point-max) '(rear-nonsticky (read-only) read-only t)))) (goto-char end))) (require 'emacs-wiki-mathml) (global-set-key [a] esc-map) (global-set-key "\C-h" 'delete-backward-char) (global-set-key "\C-xh" 'help) (normal-erase-is-backspace-mode 1) (setq inferior-lisp-program "sbcl") ;;(load "/root/acl70_trial/eli/fi-site-init") (require 'w3m-load) ;; Load planner (require 'planner) (require 'planner-diary) (require 'remember-planner) (setq remember-handler-functions '(remember-planner-append)) (setq remember-annotation-functions planner-annotation-functions) (global-set-key "\C-xp" 'planner-goto-plan-page) (global-set-key "\C-xa" 'upload-all) (load "remem.el") (setq remem-prog-dir "/usr/bin") (setq remem-database-dir "~/RA-indexes") (setq remem-scopes-list '(("newlife" 6 5 500) ("root" 6 5 500))) (setq remem-load-original-suggestion nil) (add-to-list 'load-path "/home/newlife/SuperCollider3/linux/scel/el") (require 'sclang) (add-to-list 'load-path "/root/slime-1.0") (require 'slime); (add-hook 'lisp-mode-hook (lambda () (slime-mode t))) (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t))) (setq common-lisp-hyperspec-root "file:///root/HyperSpec/") (add-to-list 'load-path "/root/") (load "misc/wiki-remote.el") (defun insert-current-time() "Insert current time" (interactive "*") (insert (current-time-string))) (defun remove-line-breaks () (interactive) (let ((fill-column 9999)) (fill-individual-paragraphs (point-min) (point-max)))) (defun upload-all () (interactive) (emacs-wiki-publish) (shell-command "/usr/bin/sitecopy -u site")) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(browse-url-browser-function (quote w3m)) '(global-font-lock-mode t nil (font-lock)) '(planner-day-page-template "") '(planner-default-section (quote)) '(planner-diary-string "* ----**") '(planner-plan-page-template "") '(planner-sections (quote ((tasks . "") (notes . "__"))))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) ;;(add-hook 'c-mode-hook ;; (lambda () ;; (c-set-style "linux"))) (diary) (defvar hyperb:dir "/root/hyperbole/") (load (expand-file-name "hversion" hyperb:dir)) (load (expand-file-name "hyperbole" hyperb:dir)) ;;To fully load Hyperbole upon startup, add the additional line: (require 'hsite) (require 'bbdb) (bbdb-initialize) (setq emacs-wiki-projects (("default" . ((emacs-wiki-directories . ("~/Wiki")))) ("work" . ((fill-column . 65) (emacs-wiki-directories . ("~/testwiki/")))))) ;; for append-remem stuff remem-append i think (add-to-list 'load-path "~/elisp") (load "snuff.el")remembrance agent ::
commands:
C-c r t (Control-c r t): Toggle Remem Toggle the remembrance agent on and off. You can also do this by
evaluating the function (remem-toggle).
C-c r v (Control-c r v): View Updates the suggestion list by running queries in all scopes now.
Bypasses the timer.
C-c r # (Control-c r number): Show Suggestion Bring up the full text of a suggested document. If you set remem-load-original-suggestion to t (the default), then the full file is loaded. Otherwise a copy is displayed. If your files are big and contain lots of documents (e.g. large mail archives), or if you don't
want the buffers lying around then you might want to set this to nil.
C-c r f (Control-c r f): Field Search Perform a search on a particular field (Body, Location, Date, Subject, or
Person).
C-c r q (Control-c r q): Query Bring up a query buffer to do a manual search. This allows you to fill in several fields. When the data is entered, hit C-c r v to view the
results.
C-c r d (Control-c r d): Database change Prompt for a new database, from the indexes in remem-database-dir. If more than one scope is active, it will prompt for which scope to replace as well. Remem will restart with the new database(s) at the original
size.