(defun ee-addhp (string)
"Prepend `ee-hyperlink-prefix' to STRING"
(concat ee-hyperlink-prefix string))
(defun ee-pph (object &optional tick)
"Pretty-print OBJECT into a hyperlink line."
(ee-addhp (ee-pp0 object tick)))
(defun ee-link-to-string (link)
"Internal use; convert a \"raw hyperlink\" to a hyperlink line."
(concat (cond ((eq link nil) "") ((stringp link) link) (t (ee-pph link))) "\n"))
(defun ee-links-to-string (links)
"Convert a list of (raw) hyperlinks to a string.
Each element of LINKS becomes a line in the result.
See the source for details: (find-efunction 'ee-link-to-string)"
(concat (mapconcat 'ee-link-to-string links "")))
(defun find-elinks (links &rest pos-spec-list)
"Visit a temporary buffer containing LINKS converted to hyperlink lines."
(let ((ee-buffer-name (or ee-buffer-name "*Elisp hyperlinks*")))
(apply 'find-estring (ee-links-to-string links) pos-spec-list)))
(defun find-elinks-elisp (links &rest pos-spec-list)
"Visit a temporary buffer containing LINKS converted to hyperlink lines.
The buffer is put in Emacs Lisp mode."
(let ((ee-buffer-name (or ee-buffer-name "*Elisp hyperlinks*")))
(apply 'find-estring-elisp (ee-links-to-string links) pos-spec-list)))
(defalias 'find-elinks-new 'find-elinks)
(defun ee-links-for-eboundkey (key f)
"From KEY and its binding, F, produce a list of hyperlinks."
`((where-is ',f)
(describe-function ',f)
(find-efunctiondescr ',f)
(find-efunction ',f)
(find-efunctionpp ',f)
(find-efunctiond ',f)
(find-eCfunction ',f)
(find-estring (documentation ',f))
(find-estring (documentation ',f t))
""
(describe-key ,key)
(describe-key-briefly ,key)
(find-ekeydescr ,key)
(Info-goto-emacs-key-command-node ,key)
(Info-goto-emacs-command-node ',f)
(find-enode "Command Index" ,(format "* %S:" f))
(find-elnode "Index" ,(format "* %S:" f))
""
(key-description ,key)
(format-kbd-macro ,key)
(format-kbd-macro ,key t)
(key-binding ,key)
))
(defun ee-links-for-efunction (f)
"Return a list of hyperlinks for F (a function symbol)."
`((where-is ',f)
(describe-function ',f)
(find-efunctiondescr ',f)
(find-efunction ',f)
(find-efunctionpp ',f)
(find-efunctiond ',f)
(find-eCfunction ',f)
(find-estring (documentation ',f))
(find-estring (documentation ',f t))
""
,@(if (commandp f)
`((Info-goto-emacs-command-node ',f)
(find-enode "Command Index" ,(format "* %S:" f))
))
(find-elnode "Index" ,(format "* %S:" f))
))
(defun ee-links-for-evariable (var)
"Return a list of hyperlinks for VAR (a variable, as a symbol)."
`(,var
(describe-variable ',var)
(find-evardescr ',var)
(find-evariable ',var)
(find-eCvariable ',var)
(find-epp ,var)
""
(find-enode "Variable Index" ,(format "* %S:" var))
(find-elnode "Index" ,(format "* %S:" var))
))
(defun find-ekey-links (key &rest rest)
"Visit a temporary buffer containing hyperlinks related to the key sequence KEY."
(interactive "kElisp hyperlinks for key: ")
(let ((longkey (format-kbd-macro key))
(longkey+ (replace-regexp-in-string "[ \t][ \t]+" " "
(format-kbd-macro key t)))
(binding (key-binding key)))
(apply 'find-elinks
`((find-ekey-links ,key)
(eekill ,longkey)
(eek ,(format "M-h M-k %s" longkey))
(find-elongkey-links ,longkey)
(find-elongkey-links ,longkey+)
""
,@(ee-links-for-eboundkey key binding)
)
rest)))
(defun find-elongkey-links (longkey &rest rest)
"Like `find-ekey-links', but LONGKEY is a key sequence \"spelled out\".
Example: (find-elongkey-links \"M-h M-k\")
See `read-kbd-macro' and `edmacro-mode' for the format."
(interactive "sElisp hyperlinks for key (long format): ")
(let* ((key (read-kbd-macro longkey))
(binding (key-binding key)))
(apply 'find-elinks
`((find-elongkey-links ,longkey)
(find-ekey-links ,key)
""
,@(ee-links-for-eboundkey key binding)
)
rest)))
(defun find-efunction-links (f &rest rest)
"Visit a temporary buffer containing hyperlinks related to the function F."
(interactive (find-function-read))
(apply 'find-elinks
`((find-efunction-links ',f)
""
,@(ee-links-for-efunction f)
)
rest))
(defun find-evariable-links (var &rest rest)
"Visit a temporary buffer containing hyperlinks related to the variable VAR."
(interactive (find-function-read 'variable))
(apply 'find-elinks
`((find-evariable-links ',var)
""
,@(ee-links-for-evariable var)
)
rest))
(defun ee-filter (function list)
"Return a sublist of LIST with only the elements for which (FUNCTION elt) is true."
(let (newlist)
(while (consp list)
(if (funcall function (car list))
(setq newlist (cons (car list) newlist)))
(setq list (cdr list)))
(nreverse newlist)))
(defun ee-filter-out-nils (list)
"Return a list with the elements of LIST that are not nil."
(ee-filter 'identity list))
(defun ee-prefixp (prefix str)
"Return t if STR begins with PREFIX."
(and (<= (length prefix) (length str))
(equal prefix (substring str 0 (length prefix)))))
(defun code-c-d-prefixes (path)
"Return the entries (C D) in `code-c-d-list' for which D is a prefix of PATH."
(ee-filter (lambda (c-d) (ee-prefixp (car (cdr c-d)) path))
code-c-d-list))
(defun ee-remove-prefix (prefix str)
(substring str (length prefix)))
(defun ee-links-for-findxxxfile-1 (c d path)
(list (intern (format "find-%sfile" c))
(ee-remove-prefix d path)))
(defun ee-links-for-findxxxfile (path)
(mapcar (lambda (c-d) (ee-pph (ee-links-for-findxxxfile-1
(car c-d) (nth 1 c-d) path)))
(code-c-d-prefixes path)))
(defun find-file-links (fname &rest rest)
"Visit a temporary buffer containing hyperlinks related a file."
(interactive (list (or (buffer-file-name) default-directory)))
(apply 'find-elinks
`((find-file-links ,fname)
""
(find-fline ,fname)
""
,@(ee-links-for-findxxxfile (ee-expand fname)))
rest))
(defun find-einfo-links (&optional book+ &rest rest)
"Visit a temporary buffer containing hyperlinks related to an info page.
The default is to use the info page being visited in the \"*info*\" buffer."
(interactive)
(let* ((book+ (or book+ (with-current-buffer "*info*" Info-current-file)))
(book- (file-name-nondirectory book+))
(code- (file-name-nondirectory ee-info-file))
(code (if (string= book- code-) code-))
(find-xxxnode (if code (read (format "find-%snode" ee-info-code))))
(node (with-current-buffer "*info*" Info-current-node))
(booknode (format "(%s)%s" book- node)))
(apply 'find-elinks
`((find-einfo-links)
""
(info ,booknode)
(find-node ,booknode)
,@(if find-xxxnode (list `(,find-xxxnode ,node))))
rest)))
(defun ee-buffer-manpage-name (&optional bufname)
"Return the name of the manpage in the buffer BUFNAME, or nil if none.
The default for BUFNAME is the name of the current buffer.
This function does a simple string matching and converts \"*Man
foo*\" to \"foo\"."
(if (null bufname)
(setq bufname (buffer-name)))
(and bufname
(string-match "^\\*\\(Wo\\)?Man \\(.*\\)\\*$" bufname)
(match-string 2 bufname)))
(defun find-last-manpage-links (manpagename &rest rest)
"Visit a temporary buffer containing hyperlinks related to a manpage.
Use this when you are in a manpage buffer and you want links to it."
(interactive (list (ee-buffer-manpage-name)))
(apply 'find-elinks
(list (ee-pph `(find-man-links ,manpagename))
""
(ee-pph `(find-man ,manpagename)))
rest))
(defun find-manpage-links (manpagename &rest rest)
"Visit a temporary buffer containing hyperlinks related to a manpage.
Use this when point is over a manpage name and you want links to that page."
(interactive (list (ee-manpagename-ask)))
(apply 'find-elinks
(list (ee-pph `(find-man-links ,manpagename))
""
(ee-pph `(find-man ,manpagename)))
rest))
(defun ee-dfs0 (pkg ext)
"If the file /var/lib/dpkg/info/PKG.EXT exists, return a link to it."
(let ((fname (concat pkg "." ext)))
(if (file-exists-p (ee-vldifile fname))
(format "%s(find-vldifile \"%s\")" ee-hyperlink-prefix fname))))
(defun ee-links-for-debpkg (pkg)
"Return the three main links for the debian package named PKG."
(list (format "%s(find-status \"%s\")" ee-hyperlink-prefix pkg)
(format "%s(find-vldifile \"%s.list\")" ee-hyperlink-prefix pkg)
(format "%s(find-udfile \"%s/\")" ee-hyperlink-prefix pkg)))
(defun ee-links-for-debpkg-extra-vldi (pkg)
"Return a list of links for files in /var/lib/dpkg/info/ belonging to PKG."
(ee-filter-out-nils
(list (ee-dfs0 pkg "preinst") (ee-dfs0 pkg "postinst")
(ee-dfs0 pkg "prerm") (ee-dfs0 pkg "postrm")
(ee-dfs0 pkg "conffiles") (ee-dfs0 pkg "config")
(ee-dfs0 pkg "templates")
(ee-dfs0 pkg "md5sums") (ee-dfs0 pkg "shlibs"))))
(defun ee-debian-pooldir (pkg)
"Used by find-debpkg-links; \"foo\" -> \"f\", \"libfoo\" -> \"libf\"."
(if (string-match "^\\(lib\\)?." pkgname)
(match-string 0 pkgname)))
(defun find-debpkg-links (pkgname &rest rest)
"Visit a temporary buffer containing hyperlinks related to a Debian package."
(interactive (list (ee-debpkgname-ask)))
(apply 'find-elinks
`((find-debpkg-links ,pkgname)
""
(find-available ,pkgname)
""
,@(ee-links-for-debpkg pkgname)
""
,@(ee-links-for-debpkg-extra-vldi pkgname)
""
,(concat "http://packages.debian.org/" pkgname)
,(concat "http://packages.debian.org/src:" pkgname)
,(format "http://ftp.debian.org/debian/pool/main/%s/%s/"
(ee-debian-pooldir pkgname) pkgname)
,(format "http://backports.org/debian/pool/main/%s/%s/"
(ee-debian-pooldir pkgname) pkgname)
,(format "http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&data=%s&archive=no" pkgname))
rest))
(defun eemklinks-duplicate-this-line ()
"Duplicate the current line (without any changes to the kill ring)."
(interactive)
(let ((line (buffer-substring (ee-bol) (ee-eol))))
(save-excursion (beginning-of-line) (insert-before-markers line "\n"))))
(defun eemklinks-yank-pos-spec ()
"Append the top of the kill ring to a hyperlink sexp, as a Lisp string.
This command is useful for \"refining elisp hyperlinks\" by adding a
pos-spec argument to them. Here's an example; if you are using the
default `eev-mode-map' keybindings then
`M-h M-i' runs `find-einfo-links',
`M-h M-2' runs `eemklinks-duplicate-this-line', and
`M-h M-2' runs `eemklinks-yank-pos-spec'.
Suppose that you are visiting the info node below,
(find-enode \"Lisp Eval\")
and you find some interesting information in that page, close to
an occurrence of the string \"`defvar'\". You mark that string,
add it to the kill-ring with `M-w', then type `M-h M-i', go to
the line that contains
# (find-enode \"Lisp Eval\")
and then you type `M-h M-2 M-h M-y'; it becomes these two lines:
# (find-enode \"Lisp Eval\")
# (find-enode \"Lisp Eval\" \"`defvar'\")
Now you check that the second line points to where you wanted,
and you copy that hyperlink to a more permanent place."
(interactive)
(goto-char (1- (point-at-eol))) (insert " " (ee-pp0 (ee-no-properties (car kill-ring)))))
(defun ee-hyperlink-prefix ()
"A lispish interface for customizing the variable `ee-hyperlink-prefix'.
See the comments in the source code."
(interactive)
(find-elinks
`((ee-hyperlink-prefix)
(setq ee-hyperlink-prefix ,ee-hyperlink-prefix)
""
(setq ee-hyperlink-prefix "# ")
(setq ee-hyperlink-prefix ";; ")
(setq ee-hyperlink-prefix "-- ")
(setq ee-hyperlink-prefix "% ")
)))
(defun ee-sexp-value (sexp)
"Example: (ee-sexp-value '(+ 1 2))"
(list (ee-pp0 sexp) (format " -> %s" (ee-pp0 (eval sexp)))))
(defun ee-rcirc-channel-sexp (sexp)
"Internal use. Uses the value and the name of the variable `c'."
(ee-sexp-value `(with-current-buffer c ,sexp)))
(defun ee-rcirc-server-sexp (sexp)
"Internal use. Uses the value and the name of the variable `s'."
(ee-sexp-value `(with-current-buffer s ,sexp)))
(defun ee-rcirc-channel-sexps (c)
"Example: (find-elinks (ee-rcirc-channel-sexps \"#rcirc@irc.freenode.net\"))"
`(,@(ee-rcirc-channel-sexp 'rcirc-target)
,@(ee-rcirc-channel-sexp '(rcirc-buffer-process))
,@(ee-rcirc-channel-sexp 'rcirc-server-buffer)
,@(ee-rcirc-channel-sexp 'rcirc-short-buffer-name)
,@(ee-rcirc-channel-sexp 'rcirc-topic)
,@(ee-rcirc-channel-sexp '(rcirc-nick (rcirc-buffer-process)))
,@(ee-rcirc-channel-sexp
'(rcirc-channel-nicks (rcirc-buffer-process) rcirc-target))
))
(defun ee-rcirc-server-sexps (s)
"Example: (find-elinks (ee-rcirc-server-sexps \"*irc.freenode.net*\"))"
`(,@(ee-rcirc-server-sexp 'rcirc-server)
,@(ee-rcirc-server-sexp 'rcirc-buffer-alist)
))
(defun find-rcirc-channel-sexps (&optional buffer)
"Visit a temporary buffer showing data associated to an rcirc channel buffer.
How to use: if you run\n
(define-key eev-mode-map \"\M-hr\" 'find-rcirc-channel-sexps)\n
and then type `M-h r' when you're inside an rcirc channel buffer -
for example, when you're at the buffer for the channel #rcirc at
irc.freenode.node - then you will get a buffer with several
interesting sexps and their values.\n
This function is mostly a proof of concept at the moment.
We should write something like this to inspect buttons, customize
buffers, and dired buffers."
(interactive (list (buffer-name (current-buffer))))
(if (bufferp buffer) (setq buffer (buffer-name buffer)))
(let ((server-buffer (buffer-name
(with-current-buffer buffer
rcirc-server-buffer))))
(find-elinks
`((find-rcirc-channel-sexps ,buffer)
(progn (make-local-variable 'c) (setq c ,buffer))
(progn (make-local-variable 's) (setq s ,server-buffer))
""
,@(ee-rcirc-channel-sexps buffer)
""
,@(ee-rcirc-server-sexps server-buffer)
))))
(defun find-ecolor-links (&optional initialcolor)
(interactive)
(find-elinks
`((find-ecolor-links ,initialcolor)
""
(find-ecolor-links (ee-choosecolor ,(or initialcolor "gray")))
(find-ecolor-links ,(or initialcolor "gray"))
(find-ecolors)
(find-ecolors ,initialcolor)
,initialcolor
,`(insert (propertize " Sample " 'face '(:background ,initialcolor)))
(find-efunction 'find-ecolor-links)
)))
(defun find-eev-update-links (&optional dir &rest rest)
(interactive)
(let ((edir (or dir (ee-expand ee-eevdir))))
(apply 'find-elinks `(
(find-eev-update-links ,dir ,@rest)
(find-eev-update-links "~/eev-current/" ,@rest)
(find-eev-update-links ,edir ,@rest)
(find-efunction 'find-eev-update-links)
""
(ee-expand ee-eevdir)
(find-eevfile "eev.el" "$EEVDIR")
(find-eevfile "")
""
,(format "* (eepitch-shell)")
,(format "* (eepitch-kill)")
,(format "* (eepitch-shell)")
""
,(format "mkdir %s" edir)
,(format "cd %s" edir)
,(format "mv -v eev-current.tar.gz eev-current-old.tar.gz")
,(format "wget http://angg.twu.net/eev-current.tar.gz")
,(format "tar -xvzf eev-current.tar.gz")
""
,(format "(progn")
,(format " (add-to-list 'load-path %S)" edir)
,(format " (require 'eev-all)")
,(format " (eev-mode 1)")
,(format " )")
""
,(format "* (eepitch-shell)")
,(format "* (eepitch-kill)")
,(format "* (eepitch-shell)")
""
,(format "cd %s" edir)
,(format "./eev-rctool prepare")
,(format "./eev-rctool install_rc")
""
(find-eevfile "eev-rctool")
(find-eevsh "./eev-rctool help")
(find-eevsh "./eev-rctool notes")
(find-eevtmpfile "")
(find-eevtmpfile "backup/")
(find-eevtmpfile "backup/do_install.sh")
(find-eevtmpfile "backup/do_uninstall.sh")
(find-fline "~/.emacs" "Beginning of the eev block:")
) rest)))
(defun ee-delete-extract-wrap (f &optional n)
(dotimes (i (or n 1))
(let ((str (ee-no-trailing-nl
(ee-no-properties
(ee-delete-and-extract-line 1)))))
(insert (ee-links-to-string (funcall f str))))))
(defun ee-wrap-file-links (str) `((find-fline ,str)))
(defun ee-wrap-man-links (str) `((find-man ,str)))
(defun ee-wrap-sh-links (str) `((find-sh ,str)))
(defun ee-wrap-sh0-links (str) `((find-sh0 ,str)))
(defun ee-wrap-debian-links (str) (ee-links-for-debpkg str))
(defun ee-wrap-code-c-d-links (str)
`((code-c-d "_" ,str)
(find-_file "")))
(defun ee-wrap-eepitch-links (str)
`(,(format "* (eepitch-%s)" str)
,(format "* (eepitch-kill)")
,(format "* (eepitch-%s)" str)))
(defun ee-wrap-file (&optional n)
(interactive "p")
(ee-delete-extract-wrap 'ee-wrap-file-links n))
(defun ee-wrap-man (&optional n)
(interactive "p")
(ee-delete-extract-wrap 'ee-wrap-man-links n))
(defun ee-wrap-debian (&optional n)
(interactive "p")
(ee-delete-extract-wrap 'ee-wrap-debian-links n))
(defun ee-wrap-sh (&optional n)
(interactive "p")
(ee-delete-extract-wrap 'ee-wrap-sh-links n))
(defun ee-wrap-sh0 (&optional n)
(interactive "p")
(ee-delete-extract-wrap 'ee-wrap-sh0-links n))
(defun ee-wrap-code-c-d (&optional n)
(interactive "p")
(ee-delete-extract-wrap 'ee-wrap-code-c-d-links n))
(defun ee-wrap-eepitch (&optional n)
"Generate an \"* (eepitch-{xxx,kill,xxx})\" block.
For example, the three \"*\" lines below were generated by typing
first \"shell\" and then `\\[ee-wrap-eepitch]'. See `eepitch'.
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
ls\n\n
"
(interactive "p")
(ee-delete-extract-wrap 'ee-wrap-eepitch-links n))
(defun ee-template (pairs templatestr)
"Substitute all ocurrences of \"{tags}\" in TEMPLATESTR.
Examples (try them!):\n
\(ee-template
'((\"a\" \"AA\") (\"b\" \"CC\") (\"c\" \"CC\"))
\"foo{a}bar{bla}poo{b}bletch\")\n
\(ee-template
'((\"http\" \"https\") (\"a/b/\" \"foo/bar/\") (\"c\" \"index.html\"))
\"* (eepitch-shell)
mkdir -p $S/{http}/{a/b/}
cd $S/{http}/{a/b/}
wget '{http}://{a/b/}{c}'
echo '{http}://{a/b/}{c}' >> ~/.psne.log\")"
(let ((f (lambda (match)
(or (cadr (assoc (match-string 1 match) pairs))
match))))
(replace-regexp-in-string "{\\([^{}]+\\)}" f templatestr 'fixedcase)))
(defun find-find-links-links (&optional xxx &rest rest)
"Visit a temporary buffer containing a skeleton for a `find-xxx-links' function."
(interactive)
(setq xxx (or xxx "{xxx}"))
(apply 'find-elinks-elisp `(
(find-find-links-links ,xxx ,@rest)
(find-efunction 'find-find-links-links)
""
,(ee-template `(("xxx" ,xxx)) "\
\(defun find-{xxx}-links (&rest rest)
\"Visit a temporary buffer containing hyperlinks for {xxx}.\"
(interactive)
(apply 'find-elinks `(
;; Convention: the first sexp always regenerates the buffer.
(find-{xxx}-links ,@rest)
;; Body:
\"\"
,(ee-template `((\"foo\" ,\"AAA\")) \"\\
abc{foo}def
ghi{foo}jkl\")
) rest))
\(define-key eev-mode-map \"\\M-h\\M-u\" 'find-{xxx}-links)
;; Test:
;; (find-{xxx}-links)")
) rest))
(defvar ee-comment-prefix nil)
(make-variable-buffer-local 'ee-comment-prefix)
(defun ee-comment-prefix ()
(or ee-comment-prefix "# "))
(defun ee-set-comment-prefix (value)
(interactive "Xee-comment-prefix (in Lisp): ")
(set (make-variable-buffer-local 'ee-comment-prefix) value))
(defun ee-no-properties (str)
(setq str (copy-sequence str))
(set-text-properties 0 (length str) nil str)
str)
(defun ee-info-file-code (infofile)
(if (and infofile
ee-info-file
(string= (file-name-nondirectory infofile)
(file-name-nondirectory ee-info-file)))
ee-info-code))
(defun ee-string-to-posspec (str)
(if str (replace-regexp-in-string "\n" "\\\\n" (format " %S" str))
""))
(defun ee-info-file-link0 (usecode infofile infonode posstr)
(let* ((code (and usecode (ee-info-file-code infofile)))
(infofile-nondirectory (file-name-nondirectory infofile))
(parenstr (if code "" (format "(%s)" infofile-nondirectory))))
(format "(find-%snode \"%s%s\"%s)"
(or code "")
parenstr
infonode
(ee-string-to-posspec posstr))))
(defun ee-info-file-link (usecode posstr)
(format "%s%s\n"
(ee-comment-prefix)
(ee-info-file-link0
usecode
(save-excursion (set-buffer "*info*") Info-current-file)
(save-excursion (set-buffer "*info*") Info-current-node)
posstr)))
(defun ee-inn (arg)
(interactive "P")
(insert (ee-info-file-link arg nil)))
(defun ee-inns (arg)
(interactive "P")
(insert (ee-info-file-link arg (ee-no-properties (current-kill 0)))))
(defun ee-delete-and-extract-line (&optional adjust)
(delete-and-extract-region (progn (beginning-of-line) (point))
(progn (end-of-line) (+ (point) (or adjust 0)))))
(defun ee-dff (N)
"Convert the name of a debian package in the current line into three hyperlinks.
For example, if the current line contains just the string
\"bash\" and you run this function then the line becomes this:\n
# (find-status \"bash\")
# (find-vldifile \"bash.list\")
# (find-udfile \"bash/\")\n"
(interactive "p")
(dotimes (i N)
(let ((pkgname (ee-delete-and-extract-line))
(prefix ee-hyperlink-prefix))
(insert (format (concat "%s(find-status \"%s\")\n"
"%s(find-vldifile \"%s.list\")\n"
"%s(find-udfile \"%s/\")")
prefix pkgname prefix pkgname prefix pkgname))
(next-line 1))))
(defun ee-dfa (N)
(interactive "p")
(dotimes (i N)
(insert (format "%s(find-available \"%s\")"
(ee-comment-prefix) (ee-delete-and-extract-line)))
(next-line 1)))
(defun ee-ill (N)
"Convert a filename at the current line into a hyperlink, and go down.
Supports `find-man', `find-udfile', and `find-fline' hyperlinks.
This function recognizes lines containing directory names, and
handles them in the following way: if the current line contains a
directory name, say, /foo/bar, and the next line contains the
name of a file or a directory in /foo/bar, say, /foo/bar/plic,
then just delete the current line."
(interactive "p")
(dotimes (i N)
(beginning-of-line)
(if (looking-at "^\\(.*\\)\n\\1/")
(delete-region (point) (progn (forward-line 1) (point)))
(cond ((looking-at
"^[^\n]*/man./\\([^\n\t /]+\\)\\.\\([0-9A-Za-z]+\\)\\.gz$")
(replace-match (format "%s(find-man \"%s %s\")"
(ee-comment-prefix)
(match-string 2)
(match-string 1)) t t))
((looking-at "^/usr/share/doc/\\(.*\\)")
(replace-match (format "%s(find-udfile \"%s\")"
(ee-comment-prefix)
(match-string 1)) t t))
((looking-at "^\\([^\n]*\\)$")
(replace-match (format "%s(find-fline \"%s\")"
(ee-comment-prefix)
(match-string 1)) t t)))
(forward-line 1))))
' (defun ee-concat (list &optional sep)
"(OBSOLETE) Flatten LIST and concat it as a series of lines."
(setq list (ee-flatten list))
(or sep (setq sep "\n"))
(setq list (mapcar (lambda (str) (concat str sep)) list))
(apply 'concat list))
' (defun find-elinks-old (list &rest rest)
"OBSOLETE- Use find-elinks instead."
(let ((ee-buffer-name "*Elisp hyperlinks*"))
(apply 'find-estring (ee-concat list) rest)))
(provide 'eev-insert)