branch: externals/poke
commit 5b01b70471649cd2e3cf0910dd6e84fe043f0755
Author: Jose E. Marchesi <[email protected]>
Commit: Jose E. Marchesi <[email protected]>
poke.el: few additions
2022-03-12 Jose E. Marchesi <[email protected]>
* emacs/poke.el (poke-set-omode): New function.
(poke-set-pretty-print): Likewise.
(poke-vu-next-line): Improve.
(poke-vu-mode): Add a header line with a ruler.
---
poke.el | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/poke.el b/poke.el
index eb6584c0cd..370979e615 100644
--- a/poke.el
+++ b/poke.el
@@ -393,7 +393,16 @@ Commands:
(defun poke-vu-next-line ()
(interactive)
- (next-line))
+ (if (save-excursion
+ (end-of-line)
+ (forward-char)
+ (eobp))
+ (progn
+ (setq-local start-byte-offset (+ start-byte-offset #x10))
+ (poke-vu-refresh)
+ (end-of-buffer)
+ (previous-line))
+ (next-line)))
(defun poke-vu-page-down ()
(interactive)
@@ -434,6 +443,8 @@ Commands:
(define-key poke-vu-mode-map "\C-cg" 'poke-vu-goto-byte)
(setq-local font-lock-defaults '(poke-vu-font-lock))
(setq-local start-byte-offset 0)
+ (setq-local header-line-format
+ "76543210 0011 2233 4455 6677 8899 aabb ccdd eeff
0123456789ABCDEF")
(setq mode-name "poke-vu")
(setq major-mode 'poke-vu-mode)
(read-only-mode t))
@@ -542,6 +553,19 @@ Commands:
(interactive "fPickle to load: ")
(poke-code-send (concat "load \"" filename "\";")))
+(defun poke-set-omode ()
+ (interactive)
+ (let* ((omode (completing-read "Output mode: " '("VM_OMODE_PLAIN"
"VM_OMODE_TREE") nil t)))
+ (poke-code-send (concat "vm_set_omode (" omode ");"))))
+
+(defun poke-set-pretty-print ()
+ (interactive)
+ (let* ((pprint (completing-read "Pretty-print: " '("yes" "no") nil t)))
+ (poke-code-send (concat "vm_set_opprint ("
+ (if (equal pprint "yes")
+ (number-to-string 1)
+ (number-to-string 0)) ");"))))
+
(defun poke ()
(interactive)
(when (not (process-live-p poke-poked-process))