diff options
author | Po Lu <luangruo@yahoo.com> | 2023-06-26 09:11:48 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2023-06-26 09:11:48 +0800 |
commit | c3fadfd10f353dcc8bdb0f4958a3e9fb7c4589bb (patch) | |
tree | f7a0189178eb4553ad131fc6db147c69f01f3785 /lisp/calc | |
parent | 259bec95de1f2786c0e642ba5b9efb4a750bc432 (diff) | |
download | emacs-c3fadfd10f353dcc8bdb0f4958a3e9fb7c4589bb.tar.gz |
Update Android port
* lisp/calc/calc.el (calc-mode, calc): Make sure the on-screen
keyboard is not hidden when a Calc buffer is created or a Calc
Trail window is being created for the first time.
* lisp/touch-screen.el (touch-screen-window-selection-changed):
Take touch-screen-display-keyboard in to account.
* src/sfnt.c (sfnt_decompose_compound_glyph)
(sfnt_interpret_compound_glyph_1): Reset `defer_offsets' before
processing each component.
(sfnt_lerp_half): Avoid undefined shift of negative value.
(sfnt_compute_tuple_scale): Pacify compiler warning.
Diffstat (limited to 'lisp/calc')
-rw-r--r-- | lisp/calc/calc.el | 96 |
1 files changed, 52 insertions, 44 deletions
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index a1545edba19..c0e68ceab0c 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1357,7 +1357,10 @@ Notations: 3.14e6 3.14 * 10^6 (calc-set-mode-line) (calc-check-defines) (if calc-buffer-list (setq calc-stack (copy-sequence calc-stack))) - (add-to-list 'calc-buffer-list (current-buffer) t)) + (add-to-list 'calc-buffer-list (current-buffer) t) + ;; While Calc buffers are read only, the on screen keyboard should + ;; be displayed in order to accept user input. + (setq-local touch-screen-display-keyboard t)) (defvar calc-check-defines 'calc-check-defines) ; Suitable for run-hooks. (defun calc-check-defines () @@ -1451,49 +1454,54 @@ See `window-dedicated-p' for what that means." (calc-grab-region (region-beginning) (region-end) nil) (when (= (prefix-numeric-value arg) -2) (calc-keypad)))) - (when (get-buffer-window "*Calc Keypad*") - (calc-keypad) - (set-buffer (window-buffer))) - (if (derived-mode-p 'calc-mode) - (calc-quit) - (calc-create-buffer) - (setq calc-was-keypad-mode nil) - (if (or (eq full-display t) - (and (null full-display) calc-full-mode)) - (switch-to-buffer (current-buffer) t) - (if (get-buffer-window (current-buffer)) - (select-window (get-buffer-window (current-buffer))) - (if calc-window-hook - (run-hooks 'calc-window-hook) - (let ((w (get-largest-window))) - (if (and pop-up-windows - (> (window-height w) - (+ window-min-height calc-window-height 2))) - (progn - (setq w (split-window w - (- (window-height w) - calc-window-height 2) - nil)) - (set-window-buffer w (current-buffer)) - (select-window w)) - (pop-to-buffer (current-buffer))))))) - (with-current-buffer (calc-trail-buffer) - (and calc-display-trail - (calc-trail-display 1 t))) - (message (substitute-command-keys - (concat "Welcome to the GNU Emacs Calculator! \\<calc-mode-map>" - "Press \\[calc-help] or \\[calc-help-prefix] for help, \\[calc-quit] to quit"))) - (run-hooks 'calc-start-hook) - (and (windowp full-display) - (window-point full-display) - (select-window full-display)) - (and calc-make-windows-dedicated - (set-window-dedicated-p nil t)) - (calc-check-defines) - (when (and calc-said-hello interactive) - (sit-for 2) - (message "")) - (setq calc-said-hello t)))) + ;; If the selected window changes here, Emacs may think that the + ;; selected window is read only, and no on screen keyboard should + ;; be displayed. Make sure that any active on screen keyboard is + ;; not hidden by accident. + (let ((touch-screen-display-buffer t)) + (when (get-buffer-window "*Calc Keypad*") + (calc-keypad) + (set-buffer (window-buffer))) + (if (derived-mode-p 'calc-mode) + (calc-quit) + (calc-create-buffer) + (setq calc-was-keypad-mode nil) + (if (or (eq full-display t) + (and (null full-display) calc-full-mode)) + (switch-to-buffer (current-buffer) t) + (if (get-buffer-window (current-buffer)) + (select-window (get-buffer-window (current-buffer))) + (if calc-window-hook + (run-hooks 'calc-window-hook) + (let ((w (get-largest-window))) + (if (and pop-up-windows + (> (window-height w) + (+ window-min-height calc-window-height 2))) + (progn + (setq w (split-window w + (- (window-height w) + calc-window-height 2) + nil)) + (set-window-buffer w (current-buffer)) + (select-window w)) + (pop-to-buffer (current-buffer))))))) + (with-current-buffer (calc-trail-buffer) + (and calc-display-trail + (calc-trail-display 1 t))) + (message (substitute-command-keys + (concat "Welcome to the GNU Emacs Calculator! \\<calc-mode-map>" + "Press \\[calc-help] or \\[calc-help-prefix] for help, \\[calc-quit] to quit"))) + (run-hooks 'calc-start-hook) + (and (windowp full-display) + (window-point full-display) + (select-window full-display)) + (and calc-make-windows-dedicated + (set-window-dedicated-p nil t)) + (calc-check-defines) + (when (and calc-said-hello interactive) + (sit-for 2) + (message "")) + (setq calc-said-hello t))))) ;;;###autoload (defun full-calc (&optional interactive) |