[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 769219b5f5 272/366: Enable section movement
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 769219b5f5 272/366: Enable section movement |
Date: |
Tue, 25 Jan 2022 18:54:47 -0500 (EST) |
branch: externals/transient
commit 769219b5f5757f1373a28e993f36b6a41c778651
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Enable section movement
This doesn't actually implement any section movement commands.
It merely makes it possible to implement such commands without
having to modify or advice transient.
See https://github.com/magit/magit/issues/4438.
This stops placing the cursor on the first suffix. Instead the
cursor is now left at the beginning of the buffer, on the first
section heading. This is beneficial for blind users who rely
on a screen reader. The old hack that moved the cursor did not
only do that initially, it actually prevented from ever moving
before the first suffix.
---
lisp/transient.el | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index cca092f984..9af641e523 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2876,7 +2876,8 @@ have a history of their own.")
(display-buffer buf transient-display-buffer-action)))
(with-selected-window transient--window
(when transient-enable-popup-navigation
- (setq focus (button-get (point) 'command)))
+ (setq focus (or (button-get (point) 'command)
+ (transient--heading-at-point))))
(erase-buffer)
(set-window-hscroll transient--window 0)
(set-window-dedicated-p transient--window t)
@@ -3448,13 +3449,23 @@ See `forward-button' for information about N."
(forward-button n t)))
(defun transient--goto-button (command)
- (if (not command)
- (forward-button 1)
+ (cond
+ ((stringp command)
+ (when (search-forward command nil t)
+ (goto-char (match-beginning 0))))
+ (command
(while (and (ignore-errors (forward-button 1))
(not (eq (button-get (button-at (point)) 'command) command))))
(unless (eq (button-get (button-at (point)) 'command) command)
(goto-char (point-min))
- (forward-button 1))))
+ (forward-button 1)))))
+
+(defun transient--heading-at-point ()
+ (and (eq (get-text-property (point) 'face) 'transient-heading)
+ (let ((beg (line-beginning-position)))
+ (buffer-substring-no-properties
+ beg (next-single-property-change
+ beg 'face nil (line-end-position))))))
;;;; Popup Isearch
- [elpa] externals/transient aaac13bb9d 193/366: transient--make-transient-map: Don't explicitly take emergency exit, (continued)
- [elpa] externals/transient aaac13bb9d 193/366: transient--make-transient-map: Don't explicitly take emergency exit, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 313eee0f1c 196/366: manual: Document more infix slots, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1b9929eca9 197/366: Add new `unsavable' infix slot, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8b22b52b83 211/366: Support defining a per-prefix fallback suffix description function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7065e1ce86 229/366: manual: Various small improvements, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 030d0fe56b 251/366: Rearrange library header, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 779b847c20 252/366: make: Update path to ox-extra, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient eb28c513a8 253/366: Release version 0.3.3, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6e741ee2bd 260/366: Stop using oref-default to get default value of object-allocated slot, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 90a0562200 265/366: transient-highlight-higher-levels: New option, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 769219b5f5 272/366: Enable section movement,
Jonas Bernoulli <=
- [elpa] externals/transient 626d105ecf 274/366: transient--read-number-N: Return empty string instead of nil, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 57942fe961 280/366: manual: No longer depend on the ox-extra package, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient badebdd1c1 288/366: Set local checkdoc-symbol-words, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7976562a3c 291/366: Sharp-quote functions, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 74cba5a418 296/366: Release version 0.3.7, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient df1ba0f144 301/366: transient-show-help: Cosmetics, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ea5ac99ffc 303/366: transient-show-help: Support per-object help functions, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f4790969fe 312/366: make: Add stats target, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 28491e1f8e 321/366: Properly deal with stealth undefined command, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 143a13938c 323/366: transient-infix-read: Always enable-recursive-minibuffers, Jonas Bernoulli, 2022/01/25