branch: externals/hyperbole
commit 5cc7ac8b961ef2ed2e63684f4bae28c8e07dc7b2
Author: Bob Weiner <[email protected]>
Commit: Bob Weiner <[email protected]>
Fixed small issues in error reporting and released version 7.0.1
* hversion.el: Released 7.0.1.
* hui.el (hui:buf-writable-err): Added previously unused func-name
parameter to error msg.
* hypb.el (hypb:error): Fixed issue when a literal string with % characters
in it was sent to format
and triggered an error, e.g. when a buffer or file name contains a %.
---
Changes | 9 +++++++--
hui.el | 6 +++---
hypb.el | 2 +-
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/Changes b/Changes
index 25ff4aa..394b3be 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,12 @@
2017-11-22 Bob Weiner <[email protected]>
+* hversion.el: Released 7.0.1.
+
+* hui.el (hui:buf-writable-err): Added previously unused func-name parameter
to error msg.
+
+* hypb.el (hypb:error): Fixed issue when a literal string with % characters in
it was sent to format
+ and triggered an error, e.g. when a buffer or file name contains a %.
+
* hmouse-drv.el (hkey-help-show): Limited local binding of {q} to
hkey-help-hide only
when in a help-mode (or derived) buffer.
@@ -59,8 +66,6 @@
2017-11-19 Bob Weiner <[email protected]>
-* hversion.el: Updated to 7.0.1 for release.
-
* hui-window.el (hmouse-item-to-window): Added support for
hmouse-drag-item-mode-forms sending
a sequence of (buffer position) rather than just buffer.
(hmouse-drag-item-mode-forms): Added support for dragging
items from the treemacs
diff --git a/hui.el b/hui.el
index d1e9368..d32ea3d 100644
--- a/hui.el
+++ b/hui.el
@@ -591,12 +591,12 @@ DEFAULT-ACTYPE may be a valid symbol or symbol-name."
;; Commented error out since some people want to be able to create
;; buttons within files which they have purposely marked read-only.
;; (setq err
- ;; (format "(ebut-modify): You are not allowed to modify '%s'."
+ ;; (format "(ebut-modify): Hyperbole lacks permission to write to
'%s'."
;; (file-name-nondirectory buffer-file-name))))
(if buffer-read-only
(setq err
- (format "Button buffer '%s' is read-only. Use {%s} to change it."
- (buffer-name but-buf) (hmouse-read-only-toggle-key))))
+ (format "(%s) Hyperbole button buffer '%s' cannot be edited. Use
{%s} to enable edits."
+ func-name (buffer-name but-buf)
(hmouse-read-only-toggle-key))))
(set-buffer obuf)
(if err (progn (pop-to-buffer but-buf) (hypb:error err)))))
diff --git a/hypb.el b/hypb.el
index 673bed9..0076de6 100644
--- a/hypb.el
+++ b/hypb.el
@@ -220,7 +220,7 @@ Global keymap is used unless optional KEYMAP is given."
(defun hypb:error (&rest args)
"Signals an error typically to be caught by `hyperbole'."
- (let ((msg (apply 'format args)))
+ (let ((msg (if (< (length args) 2) (car args) (apply 'format args))))
(put 'error 'error-message msg)
(error msg)))