alphapapa / alphapapa/ement.el
[Feature]: jump to prev/next image
- Vorherrschende Sprache
- Emacs Lisp
- Sterne
- 604
- Forks
- 54
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
An idea I had while looking for an image in a room:
``` emacs-lisp
(defun +ement--find-image (backp)
"Move point to image.
If BACKP is non-nil, search backward."
(or
(funcall (if backp #'text-property-search-backward
#'text-property-search-forward)
'display 'image
(lambda (val here) (eq val (car-safe here)))
'not-current)
(user-error "No more images")))
(defun +ement-next-image (n)
"Move point to Nth next image."
(interactive "p")
(unless ement-room (user-error "Not in ement room"))
(dotimes (_ (abs n)) (+ement--find-image (when (< n 0) 'previous))))
(defun +ement-prev-image (n)
"Move point to Nth previous image."
(interactive "p")
(unless ement-room (user-error "Not in ement room"))
(dotimes (_ (abs n)) (+ement--find-image (when (> n 0) 'previous))))
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.