;;; help.el --- help commands for Emacs
-;; Copyright (C) 1985-1986, 1993-1994, 1998-2015 Free Software
+;; Copyright (C) 1985-1986, 1993-1994, 1998-2016 Free Software
;; Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
(when (null (cdr yank-menu))
(setq saved-yank-menu (copy-sequence yank-menu))
(menu-bar-update-yank-menu "(any string)" nil))
- (setq key (read-key-sequence "Describe key (or click or menu item): "))
+ (while
+ (progn
+ (setq key (read-key-sequence "Describe the following key, mouse click, or menu item: "))
+ (and (vectorp key)
+ (consp (aref key 0))
+ (symbolp (car (aref key 0)))
+ (string-match "\\(mouse\\|down\\|click\\|drag\\)"
+ (symbol-name (car (aref key 0))))
+ (not (sit-for (/ double-click-time 1000.0) t)))))
;; Clear the echo area message (Bug#7014).
(message nil)
;; If KEY is a down-event, read and discard the
(when (null (cdr yank-menu))
(setq saved-yank-menu (copy-sequence yank-menu))
(menu-bar-update-yank-menu "(any string)" nil))
- (setq key (read-key-sequence "Describe key (or click or menu item): "))
+ (while
+ (progn
+ (setq key (read-key-sequence "Describe the following key, mouse click, or menu item: "))
+ (and (vectorp key)
+ (consp (aref key 0))
+ (symbolp (car (aref key 0)))
+ (string-match "\\(mouse\\|down\\|click\\|drag\\)"
+ (symbol-name (car (aref key 0))))
+ (not (sit-for (/ double-click-time 1000.0) t)))))
(list
key
(prefix-numeric-value current-prefix-arg)
;;; Automatic resizing of temporary buffers.
(defcustom temp-buffer-max-height
(lambda (buffer)
- (if (eq (selected-window) (frame-root-window))
+ (if (and (display-graphic-p) (eq (selected-window) (frame-root-window)))
(/ (x-display-pixel-height) (frame-char-height) 2)
(/ (- (frame-height) 2) 2)))
"Maximum height of a window displaying a temporary buffer.
(defcustom temp-buffer-max-width
(lambda (buffer)
- (if (eq (selected-window) (frame-root-window))
+ (if (and (display-graphic-p) (eq (selected-window) (frame-root-window)))
(/ (x-display-pixel-width) (frame-char-width) 2)
(/ (- (frame-width) 2) 2)))
"Maximum width of a window displaying a temporary buffer.
(if (string-match "\n?\n\\'" docstring)
(if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "")
"\n\n")
- (if (and (stringp arglist)
- (string-match "\\`([^ ]+\\(.*\\))\\'" arglist))
- (concat "(fn" (match-string 1 arglist) ")")
+ (if (stringp arglist)
+ (if (string-match "\\`[^ ]+\\(.*\\))\\'" arglist)
+ (concat "(fn" (match-string 1 arglist) ")")
+ (error "Unrecognized usage format"))
(help--make-usage-docstring 'fn arglist)))))
(defun help-function-arglist (def &optional preserve-names)