X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=elopher.el;h=7e45cab27db2489b328b6702ec4959bd5be379d9;hb=12320978c9fab9ad8c46e3c92d39547c30ceef69;hp=88bb24d2dcf77507e005979a2c615f9797ece624;hpb=13586c86f64fcae309d4afc8b4b14b7e7e009f69;p=elpher.git diff --git a/elopher.el b/elopher.el index 88bb24d..7e45cab 100644 --- a/elopher.el +++ b/elopher.el @@ -166,18 +166,6 @@ content and cursor position fields of the node." "Set the cursor position cache of NODE to POS." (setcar (nthcdr 4 node) pos)) -(defun elopher-save-pos () - "Save the current position of point to the current node." - (when elopher-current-node - (elopher-set-node-pos elopher-current-node (point)))) - -(defun elopher-restore-pos () - "Restore the position of point to that cached in the current node." - (let ((pos (elopher-node-pos elopher-current-node))) - (if pos - (goto-char pos) - (goto-char (point-min))))) - ;; Node graph traversal (defvar elopher-current-node) @@ -202,6 +190,18 @@ content and cursor position fields of the node." (elopher-set-node-content elopher-current-node nil) (elopher-visit-node elopher-current-node)) +(defun elopher-save-pos () + "Save the current position of point to the current node." + (when elopher-current-node + (elopher-set-node-pos elopher-current-node (point)))) + +(defun elopher-restore-pos () + "Restore the position of point to that cached in the current node." + (let ((pos (elopher-node-pos elopher-current-node))) + (if pos + (goto-char pos) + (goto-char (point-min))))) + ;;; Buffer preparation ;; @@ -433,7 +433,8 @@ The result is stored as a string in the variable elopher-selector-string." (lambda (proc event) (unless (string-prefix-p "deleted" event) (let ((image (create-image - (string-as-unibyte elopher-selector-string) + (encode-coding-string elopher-selector-string + 'no-conversion) nil t))) (elopher-with-clean-buffer (insert-image image)) @@ -634,6 +635,7 @@ The result is stored as a string in the variable elopher-selector-string." ;;; Main start procedure ;; +;;;###autoload (defun elopher () "Start elopher with default landing page." (interactive)