Open masatake opened 2 years ago
I think citre-peek
can already do this.
citre-peek-backward-in-chain-after-jump
to automatically do this after every jump.What you described is likely to be an extension for xref (so it's not in the scope of Citre).
I've create a little helper for you ;)
(require 'citre-common-tag)
(require 'citre-ui-peek)
(defun peek-back-after-xref ()
(let* ((marker (caar (xref--get-history)))
(buf (marker-buffer marker))
tag)
(with-current-buffer buf
(save-excursion
(goto-char marker)
(setq tag (citre-make-tag-of-current-location
(if-let ((sym (symbol-at-point)))
(symbol-name sym) ".")))))
(citre-peek-show (list tag))))
(add-hook 'xref-after-jump-hook #'peek-back-after-xref)
Thank you. It works. This is a great hint for me.
citre-peek-file-content-height
can be smaller.Maybe these are my homework.
The rearview helps a code reader associate arguments seen in a function call and parameters in the function definition.
For now all these aspects are controlled by global variables, or hard coded. So although the appearance you want is actually easy to implement, it's harder to adopt it in the current codebase.
It's not clear to me how this fits into the citre-peek
tool for now. Maybe one possible approach is to:
I think i've seen a somewhat similar work in a package called peek.
The peek window is for forward-reading. I wonder how useful if we can use it for backward-reading.
you are at an interesting function, "memmove":![origin](https://user-images.githubusercontent.com/77077/143306895-36c085dc-c06b-4080-b5ef-942deb12bb73.png)
you will do M-. to go to the definition:![jumpto](https://user-images.githubusercontent.com/77077/143306998-56b9bf04-ac29-40c3-89fb-66df364c46ad.png)
you may wonder how the function is called. e.g. association between the arguments in the caller context and the parameter in the callee context.
turn on the rearview mirror:![rearview](https://user-images.githubusercontent.com/77077/143307666-cfc07927-dfea-4129-85d5-8d1144b3fadb.png)
You don't have to break the reading-context with M-,. Just an idea.