The Lambda Lab
/
projects
/
elpher.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
155ce87
)
Functional again.
author
Tim Vaughan
<tgvaughan@gmail.com>
Sun, 21 Apr 2019 07:27:48 +0000
(09:27 +0200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Sun, 21 Apr 2019 07:27:48 +0000
(09:27 +0200)
elopher.el
patch
|
blob
|
history
diff --git
a/elopher.el
b/elopher.el
index
40e4ef1
..
812ebb4
100644
(file)
--- a/
elopher.el
+++ b/
elopher.el
@@
-28,6
+28,7
@@
"i - RET/mouse-1: open directory entry\tfake\tfake\t1"
"i - u: return to parent directory entry\tfake\tfake\t1"
"i - g: go to a particular site\tfake\tfake\t1"
"i - RET/mouse-1: open directory entry\tfake\tfake\t1"
"i - u: return to parent directory entry\tfake\tfake\t1"
"i - g: go to a particular site\tfake\tfake\t1"
+ "i - r: reload current page\tfake\tfake\t1"
"i\tfake\tfake\t1"
"iPlaces to start exploring Gopherspace:\tfake\tfake\t1"
"1Floodgap Systems Gopher Server\t\tgopher.floodgap.com\t70"
"i\tfake\tfake\t1"
"iPlaces to start exploring Gopherspace:\tfake\tfake\t1"
"1Floodgap Systems Gopher Server\t\tgopher.floodgap.com\t70"
@@
-95,6
+96,8
@@
(defun elopher-set-node-content (node content)
(setcar (cdddr node) content))
(defun elopher-set-node-content (node content)
(setcar (cdddr node) content))
+;; Node graph traversal
+
(defvar elopher-start-node (elopher-make-node nil nil #'elopher-get-index-node))
(defvar elopher-current-node)
(defvar elopher-start-node (elopher-make-node nil nil #'elopher-get-index-node))
(defvar elopher-current-node)
@@
-202,37
+205,47
@@
(let ((content (elopher-node-content elopher-current-node))
(address (elopher-node-address elopher-current-node)))
(if content
(let ((content (elopher-node-content elopher-current-node))
(address (elopher-node-address elopher-current-node)))
(if content
- (insert content)
+ (let ((inhibit-read-only t))
+ (save-excursion
+ (insert content)))
(if address
(elopher-get-selector address
(lambda (proc event)
(let ((inhibit-read-only t))
(erase-buffer)
(if address
(elopher-get-selector address
(lambda (proc event)
(let ((inhibit-read-only t))
(erase-buffer)
- (elopher-insert-index elopher-selector-string))
+ (save-excursion
+ (elopher-insert-index elopher-selector-string)))
(elopher-set-node-content elopher-current-node
(buffer-string))))
(progn
(let ((inhibit-read-only t))
(erase-buffer)
(elopher-set-node-content elopher-current-node
(buffer-string))))
(progn
(let ((inhibit-read-only t))
(erase-buffer)
- (elopher-insert-index elopher-start-page))
+ (save-excursion
+ (elopher-insert-index elopher-start-page)))
(elopher-set-node-content elopher-current-node
(buffer-string)))))))
;; Text retrieval
(elopher-set-node-content elopher-current-node
(buffer-string)))))))
;; Text retrieval
+(defun elopher-strip-CRs (string)
+ (replace-regexp-in-string "\r" "" string))
+
(defun elopher-get-text-node ()
(let ((content (elopher-node-content elopher-current-node))
(address (elopher-node-address elopher-current-node)))
(if content
(let ((inhibit-read-only t))
(defun elopher-get-text-node ()
(let ((content (elopher-node-content elopher-current-node))
(address (elopher-node-address elopher-current-node)))
(if content
(let ((inhibit-read-only t))
- (insert content))
+ (save-excursion
+ (insert content)))
(elopher-get-selector address
(lambda (proc event)
(let ((inhibit-read-only t))
(erase-buffer)
(elopher-get-selector address
(lambda (proc event)
(let ((inhibit-read-only t))
(erase-buffer)
- (insert elopher-selector-string))
+ (save-excursion
+ (insert
+ (elopher-strip-CRs elopher-selector-string))))
(elopher-set-node-content elopher-current-node
(elopher-set-node-content elopher-current-node
-
elopher-selector-string
))))))
+
(buffer-string)
))))))
;;; Navigation methods
;;
;;; Navigation methods
;;