[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bluetooth fd39a17 50/57: cleans up movement to beginnin
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bluetooth fd39a17 50/57: cleans up movement to beginning/end of list |
Date: |
Thu, 7 Nov 2019 23:28:58 -0500 (EST) |
branch: externals/bluetooth
commit fd39a176d0846936915ffda0a95ce5edda476b87
Author: Raffael Stocker <address@hidden>
Commit: Raffael Stocker <address@hidden>
cleans up movement to beginning/end of list
---
Readme.org | 6 +++---
bluetooth.el | 30 +++++++++++++++++++++++++-----
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/Readme.org b/Readme.org
index 90a7342..7a39713 100644
--- a/Readme.org
+++ b/Readme.org
@@ -46,9 +46,9 @@
| s | toggle the power supply of the adapter
|
| n | next line
|
| p | previous line
|
- | < | go to the beginning of the buffer
|
- | > | go to the end of the buffer
|
- | g | revert the buffer; this queries the bus for accessible
devices |
+ | < | go to the beginning of the list
|
+ | > | go to the end of the list
|
+ | g | revert the buffer; this queries the bus for accessible
devices |
| S | sort list by column at point
|
| h or ? | describe the mode
|
| q | bury the buffer
|
diff --git a/bluetooth.el b/bluetooth.el
index 86a0b7c..11204ef 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -180,6 +180,8 @@ This is usually `:system' if bluetoothd runs as a system
service, or
(define-key map [?x] #'bluetooth-toggle-pairable)
(define-key map [?i] #'bluetooth-show-device-info)
(define-key map [?k] #'bluetooth-remove-device)
+ (define-key map [?<] #'bluetooth-beginning-of-list)
+ (define-key map [?>] #'bluetooth-end-of-list)
map)
"The Bluetooth mode keymap.")
@@ -213,9 +215,10 @@ This is usually `:system' if bluetoothd runs as a system
service, or
For documentation, see URL `https://gitlab.com/rstocker/emacs-bluetooth'."
(setq tabulated-list-format bluetooth--list-format
tabulated-list-entries #'bluetooth--list-entries
- tabulated-list-padding 1)
- (bluetooth--make-commands)
- (tabulated-list-init-header))
+ tabulated-list-padding 1
+ tabulated-list-sort-key (cons "Alias" nil))
+ (make-local-variable 'mode-line-misc-info)
+ (cl-pushnew bluetooth--mode-info mode-line-misc-info))
;;; This function returns a list of bluetooth adapters and devices
;;; in the form
@@ -397,6 +400,23 @@ This function only uses the first adapter reported by
Bluez."
"Clean up when mode buffer is killed."
(bluetooth--unregister-agent))
+(defun bluetooth-end-of-list ()
+ "Move cursor to the last list element."
+ (interactive)
+ (let ((column (current-column)))
+ (goto-char (point-max))
+ (forward-line -1)
+ (goto-char (+ (point)
+ (- column (current-column))))))
+
+(defun bluetooth-beginning-of-list ()
+ "Move cursor to the first list element."
+ (interactive)
+ (let ((column (current-column)))
+ (goto-char (point-min))
+ (goto-char (+ (point)
+ (- column (current-column))))))
+
;;; This command is the main entry point. It is meant to be called by
;;; the user.
;;;
@@ -420,11 +440,11 @@ For documentation, see URL
`https://gitlab.com/rstocker/emacs-bluetooth'."
(unless (eq major-mode 'bluetooth-mode)
(erase-buffer)
(bluetooth-mode)
+ (bluetooth--make-commands)
(bluetooth--register-agent)
(add-hook 'kill-buffer-hook #'bluetooth--cleanup nil t)
- (make-local-variable 'mode-line-misc-info)
- (cl-pushnew bluetooth--mode-info mode-line-misc-info)
(setq imenu-create-index-function #'bluetooth--create-imenu-index)
+ (tabulated-list-init-header)
(tabulated-list-print t)
(hl-line-mode))))
- [elpa] externals/bluetooth 1ec2997 22/57: uses the correct bus (:system) for the callback methods, (continued)
- [elpa] externals/bluetooth 1ec2997 22/57: uses the correct bus (:system) for the callback methods, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 83344c8 20/57: cleans up display code, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth fe926e9 28/57: puts functions before the long uuid defconsts for readability, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth c473128 40/57: adds repository URL to mode (entry) command docstring, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth eb1d4ea 25/57: adds UUID and service/device class parsing and display, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth f9bfd26 39/57: fixes a grammatical mistake in Readme.org, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 565cfec 38/57: adds more elaborate usage information, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 7714f6b 45/57: updates Readme, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 1f3b244 47/57: makes checkdoc and package-lint happy, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 9d79f61 46/57: puts the key bindings in their own defvar (as is usual), Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth fd39a17 50/57: cleans up movement to beginning/end of list,
Stefan Monnier <=
- [elpa] externals/bluetooth 5387639 52/57: adds path loss to device info, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth ea7ccf7 53/57: fixes mode line update, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 21e6a14 34/57: adds hl-line-mode activation, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth cb5a39c 29/57: adds SDO UUIDs and simplifies the UUID handling functions, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 44e81ed 42/57: rearranges UUID data and functions, concentrates interface names, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 72f061d 48/57: updates commentary and cleans up whitespace, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 2ce2322 49/57: improves device info printing, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth e002888 27/57: updates Readme.org, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 15d1f53 37/57: adds a pointer to the source of assigned numbers data, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth d749581 41/57: removes unused `bluetooth--own-intf', Stefan Monnier, 2019/11/07