(with-current-buffer standard-output
(goto-char (point-min))
(while (progn (move-to-column 50) (not (eobp)))
- (search-forward " " nil t)
- (insert "\n")))
+ (when (search-forward " " nil t)
+ (delete-char -1))
+ (insert "\n")))
(print-help-return-message)))
\f
(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): "))
+ ;; If KEY is a down-event, read and discard the
+ ;; corresponding up-event.
+ (if (and (vectorp key)
+ (eventp (elt key 0))
+ (memq 'down (event-modifiers (elt key 0))))
+ (read-event))
(list
key
- (prefix-numeric-value current-prefix-arg)
- ;; If KEY is a down-event, read the corresponding up-event
- ;; and use it as the third argument.
- (if (and (consp key) (symbolp (car key))
- (memq 'down (cdr (get (car key) 'event-symbol-elements))))
- (read-event))))
+ (if current-prefix-arg (prefix-numeric-value current-prefix-arg))
+ 1))
;; Put yank-menu back as it was, if we changed it.
(when saved-yank-menu
(setq yank-menu (copy-sequence saved-yank-menu))
(prefix-numeric-value current-prefix-arg)
;; If KEY is a down-event, read the corresponding up-event
;; and use it as the third argument.
- (if (and (consp key) (symbolp (car key))
- (memq 'down (cdr (get (car key) 'event-symbol-elements))))
+ (if (and (vectorp key)
+ (eventp (elt key 0))
+ (memq 'down (event-modifiers (elt key 0))))
(read-event))))
;; Put yank-menu back as it was, if we changed it.
(when saved-yank-menu
(princ "\n which is ")
(describe-function-1 defn)
(when up-event
- (let ((ev (aref up-event 0))
- (descr (key-description up-event))
+ (let ((type (event-basic-type up-event))
(hdr "\n\n-------------- up event ---------------\n\n")
- defn
+ defn sequence
mouse-1-tricky mouse-1-remapped)
- (when (and (consp ev)
- (eq (car ev) 'mouse-1)
+ (setq sequence (vector up-event))
+ (when (and (eq type 'mouse-1)
(windowp window)
mouse-1-click-follows-link
(not (eq mouse-1-click-follows-link 'double))
- (with-current-buffer (window-buffer window)
- (mouse-on-link-p (posn-point (event-start ev)))))
- (setq mouse-1-tricky (integerp mouse-1-click-follows-link)
- mouse-1-remapped (or (not mouse-1-tricky)
- (> mouse-1-click-follows-link 0)))
- (if mouse-1-remapped
- (setcar ev 'mouse-2)))
- (setq defn (or (string-key-binding up-event) (key-binding up-event)))
+ (setq mouse-1-remapped
+ (with-current-buffer (window-buffer window)
+ (mouse-on-link-p (posn-point
+ (event-start up-event))))))
+ (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link)
+ (> mouse-1-click-follows-link 0)))
+ (cond ((stringp mouse-1-remapped)
+ (setq sequence mouse-1-remapped))
+ ((vectorp mouse-1-remapped)
+ (setcar up-event (elt mouse-1-remapped 0)))
+ (t (setcar up-event 'mouse-2))))
+ (setq defn (or (string-key-binding sequence)
+ (key-binding sequence)))
(unless (or (null defn) (integerp defn) (equal defn 'undefined))
(princ (if mouse-1-tricky
"\n\n----------------- up-event (short click) ----------------\n\n"
hdr))
(setq hdr nil)
- (princ descr)
+ (princ (symbol-name type))
(if (windowp window)
(princ " at that spot"))
(if mouse-1-remapped
(princ "\n which is ")
(describe-function-1 defn))
(when mouse-1-tricky
- (setcar ev
- (if (> mouse-1-click-follows-link 0) 'mouse-1 'mouse-2))
- (setq defn (or (string-key-binding up-event) (key-binding up-event)))
- (unless (or (null defn) (integerp defn) (equal defn 'undefined))
+ (setcar up-event 'mouse-1)
+ (setq defn (or (string-key-binding (vector up-event))
+ (key-binding (vector up-event))))
+ (unless (or (null defn) (integerp defn) (eq defn 'undefined))
(princ (or hdr
"\n\n----------------- up-event (long click) ----------------\n\n"))
- (princ "Pressing ")
- (princ descr)
+ (princ "Pressing mouse-1")
(if (windowp window)
(princ " at that spot"))
(princ (format " for longer than %d milli-seconds\n"
- (abs mouse-1-click-follows-link)))
- (if (not mouse-1-remapped)
- (princ " remaps it to <mouse-2> which" ))
+ mouse-1-click-follows-link))
(princ " runs the command ")
(prin1 defn)
(princ "\n which is ")
(describe-function-1 defn)))))
(print-help-return-message)))))))
-
\f
(defun describe-mode (&optional buffer)
"Display documentation of current major mode and minor modes.
;; Document the major mode.
(let ((mode mode-name))
(with-current-buffer standard-output
- (insert mode)
- (add-text-properties (- (point) (length mode)) (point) '(face bold))))
+ (let ((start (point)))
+ (insert (format-mode-line mode))
+ (add-text-properties start (point) '(face bold)))))
(princ " mode:\n")
(princ (documentation major-mode)))
(print-help-return-message))))
;;; Automatic resizing of temporary buffers.
(defcustom temp-buffer-max-height (lambda (buffer) (/ (- (frame-height) 2) 2))
- "*Maximum height of a window displaying a temporary buffer.
+ "Maximum height of a window displaying a temporary buffer.
This is the maximum height (in text lines) which `resize-temp-buffer-window'
will give to a window displaying a temporary buffer.
It can also be a function which will be called with the object corresponding
(funcall temp-buffer-max-height (current-buffer))
temp-buffer-max-height))))
-;; Provide this for the sake of define-minor-mode which generates
-;; defcustoms which require 'help'.
+\f
(provide 'help)
;; arch-tag: cf427352-27e9-49b7-9a6f-741ebab02423