mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 10:31:37 -08:00
(artist-mouse-choose-operation): Call tmm-prompt' instead of x-popup-menu'
if we cannot popup menus. (artist-compute-up-event-key): New function. (artist-mouse-choose-operation, artist-down-mouse-1): Call it.
This commit is contained in:
parent
241c4680c9
commit
14bd267de0
2 changed files with 34 additions and 8 deletions
|
|
@ -1,3 +1,11 @@
|
||||||
|
2009-11-13 Tomas Abrahamsson <tab@lysator.liu.se>
|
||||||
|
|
||||||
|
* textmodes/artist.el (artist-mouse-choose-operation): Call
|
||||||
|
`tmm-prompt' instead of `x-popup-menu' if we cannot popup
|
||||||
|
menus. Bug noticed by Eli Zaretskii <eliz@gnu.org>.
|
||||||
|
(artist-compute-up-event-key): New function.
|
||||||
|
(artist-mouse-choose-operation, artist-down-mouse-1): Call it.
|
||||||
|
|
||||||
2009-11-13 Kenichi Handa <handa@m17n.org>
|
2009-11-13 Kenichi Handa <handa@m17n.org>
|
||||||
|
|
||||||
* language/japan-util.el: Make sure that the value of jisx0208
|
* language/japan-util.el: Make sure that the value of jisx0208
|
||||||
|
|
|
||||||
|
|
@ -4750,6 +4750,15 @@ If optional argument STATE is positive, turn borders on."
|
||||||
"Function that does nothing."
|
"Function that does nothing."
|
||||||
(interactive))
|
(interactive))
|
||||||
|
|
||||||
|
(defun artist-compute-up-event-key (ev)
|
||||||
|
"Compute the corresponding up key sequence for event EV."
|
||||||
|
(let* ((basic (event-basic-type ev))
|
||||||
|
(unshifted basic)
|
||||||
|
(shifted (make-symbol (concat "S-" (symbol-name basic)))))
|
||||||
|
(if (artist-event-is-shifted ev)
|
||||||
|
(make-vector 1 shifted)
|
||||||
|
(make-vector 1 unshifted))))
|
||||||
|
|
||||||
(defun artist-down-mouse-1 (ev)
|
(defun artist-down-mouse-1 (ev)
|
||||||
"Perform drawing action for event EV."
|
"Perform drawing action for event EV."
|
||||||
(interactive "@e")
|
(interactive "@e")
|
||||||
|
|
@ -4761,15 +4770,10 @@ If optional argument STATE is positive, turn borders on."
|
||||||
(orig-draw-region-min-y artist-draw-region-min-y)
|
(orig-draw-region-min-y artist-draw-region-min-y)
|
||||||
(orig-draw-region-max-y artist-draw-region-max-y)
|
(orig-draw-region-max-y artist-draw-region-max-y)
|
||||||
(orig-pointer-shape (if (eq window-system 'x) x-pointer-shape nil))
|
(orig-pointer-shape (if (eq window-system 'x) x-pointer-shape nil))
|
||||||
(echo-keystrokes 10000) ; a lot of seconds
|
(echoq-keystrokes 10000) ; a lot of seconds
|
||||||
;; Remember original binding for the button-up event to this
|
;; Remember original binding for the button-up event to this
|
||||||
;; button-down event.
|
;; button-down event.
|
||||||
(key (let* ((basic (event-basic-type ev))
|
(key (artist-compute-up-event-key ev))
|
||||||
(unshifted basic)
|
|
||||||
(shifted (make-symbol (concat "S-" (symbol-name basic)))))
|
|
||||||
(if (artist-event-is-shifted ev)
|
|
||||||
(make-vector 1 shifted)
|
|
||||||
(make-vector 1 unshifted))))
|
|
||||||
(orig-button-up-binding (lookup-key (current-global-map) key)))
|
(orig-button-up-binding (lookup-key (current-global-map) key)))
|
||||||
|
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
|
|
@ -4835,7 +4839,21 @@ If optional argument STATE is positive, turn borders on."
|
||||||
(progn
|
(progn
|
||||||
(select-window (posn-window (event-start last-input-event)))
|
(select-window (posn-window (event-start last-input-event)))
|
||||||
(list last-input-event
|
(list last-input-event
|
||||||
(x-popup-menu last-nonmenu-event artist-popup-menu-table))))
|
(if (display-popup-menus-p)
|
||||||
|
(x-popup-menu last-nonmenu-event artist-popup-menu-table)
|
||||||
|
'no-popup-menus))))
|
||||||
|
|
||||||
|
(if (eq op 'no-popup-menus)
|
||||||
|
;; No popup menus. Call `tmm-prompt' instead, but with the
|
||||||
|
;; up-mouse-button, if any, temporarily disabled, otherwise
|
||||||
|
;; it'll interfere.
|
||||||
|
(let* ((key (artist-compute-up-event-key ev))
|
||||||
|
(orig-button-up-binding (lookup-key (current-global-map) key)))
|
||||||
|
(unwind-protect
|
||||||
|
(define-key (current-global-map) key 'artist-do-nothing)
|
||||||
|
(setq op (tmm-prompt artist-popup-menu-table))
|
||||||
|
(if orig-button-up-binding
|
||||||
|
(define-key (current-global-map) key orig-button-up-binding)))))
|
||||||
|
|
||||||
(let ((draw-fn (artist-go-get-draw-fn-from-symbol (car op)))
|
(let ((draw-fn (artist-go-get-draw-fn-from-symbol (car op)))
|
||||||
(set-fn (artist-fc-get-fn-from-symbol (car op))))
|
(set-fn (artist-fc-get-fn-from-symbol (car op))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue