diff options
| author | John Wiegley | 2016-01-11 22:48:07 -0800 |
|---|---|---|
| committer | John Wiegley | 2016-01-11 22:48:07 -0800 |
| commit | 8d7128c46de2af10d50c1495a075d66b702f6d21 (patch) | |
| tree | 248825b1d310edff622e05241c9ee8f5d60d9c14 | |
| parent | 8df9e56b4ad9704747dd8af7a049da9ee6ab3a00 (diff) | |
| parent | 9ee6ecb840c57aaf87316bccc2a892265087bafe (diff) | |
| download | emacs-8d7128c46de2af10d50c1495a075d66b702f6d21.tar.gz emacs-8d7128c46de2af10d50c1495a075d66b702f6d21.zip | |
Merge from origin/emacs-25
9ee6ecb lisp/emacs-lisp/chart.el (chart-new-buffer): Move to silence byte compiler.
526d80c Port chart.el methods to cl-generic.
410bb69 Add nt/INSTALL.W64 build instructions
8f5b524 Add new input method 'programmer-dvorak'
6d11f6e Allow to invoke original M-TAB binding in 'flyspell-prog-mode'
bb83bb1 Fix EWW rendering of long RTL lines
b1a8509 fix bug#21054
ce5ad12 Clean up cairo printing code
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/chart.el | 47 | ||||
| -rw-r--r-- | lisp/leim/quail/programmer-dvorak.el | 145 | ||||
| -rw-r--r-- | lisp/net/shr.el | 5 | ||||
| -rw-r--r-- | lisp/textmodes/flyspell.el | 210 | ||||
| -rw-r--r-- | nt/INSTALL | 3 | ||||
| -rw-r--r-- | nt/INSTALL.W64 | 224 | ||||
| -rw-r--r-- | src/gtkutil.c | 41 | ||||
| -rw-r--r-- | src/xfns.c | 46 | ||||
| -rw-r--r-- | src/xterm.c | 16 |
10 files changed, 560 insertions, 179 deletions
| @@ -270,7 +270,7 @@ hiding character but the default `.' can be used by let-binding the | |||
| 270 | variable `read-hide-char'. | 270 | variable `read-hide-char'. |
| 271 | 271 | ||
| 272 | --- | 272 | --- |
| 273 | ** New input method: `tamil-dvorak'. | 273 | ** New input methods: `tamil-dvorak' and `programmer-dvorak'. |
| 274 | 274 | ||
| 275 | 275 | ||
| 276 | * Editing Changes in Emacs 25.1 | 276 | * Editing Changes in Emacs 25.1 |
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index c0a42038e94..aa7d8dd9880 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | ;; with all the bitmaps you want to use. | 60 | ;; with all the bitmaps you want to use. |
| 61 | 61 | ||
| 62 | (require 'eieio) | 62 | (require 'eieio) |
| 63 | (eval-when-compile (require 'cl-generic)) | ||
| 63 | 64 | ||
| 64 | ;;; Code: | 65 | ;;; Code: |
| 65 | (define-obsolete-variable-alias 'chart-map 'chart-mode-map "24.1") | 66 | (define-obsolete-variable-alias 'chart-map 'chart-mode-map "24.1") |
| @@ -124,14 +125,6 @@ too much in text characters anyways.") | |||
| 124 | (font-lock-mode -1) ;Isn't it off already? --Stef | 125 | (font-lock-mode -1) ;Isn't it off already? --Stef |
| 125 | ) | 126 | ) |
| 126 | 127 | ||
| 127 | (defun chart-new-buffer (obj) | ||
| 128 | "Create a new buffer NAME in which the chart OBJ is displayed. | ||
| 129 | Returns the newly created buffer." | ||
| 130 | (with-current-buffer (get-buffer-create (format "*%s*" (oref obj title))) | ||
| 131 | (chart-mode) | ||
| 132 | (setq chart-local-object obj) | ||
| 133 | (current-buffer))) | ||
| 134 | |||
| 135 | (defclass chart () | 128 | (defclass chart () |
| 136 | ((title :initarg :title | 129 | ((title :initarg :title |
| 137 | :initform "Emacs Chart") | 130 | :initform "Emacs Chart") |
| @@ -156,7 +149,15 @@ Returns the newly created buffer." | |||
| 156 | ) | 149 | ) |
| 157 | "Superclass for all charts to be displayed in an Emacs buffer.") | 150 | "Superclass for all charts to be displayed in an Emacs buffer.") |
| 158 | 151 | ||
| 159 | (defmethod initialize-instance :AFTER ((obj chart) &rest _fields) | 152 | (defun chart-new-buffer (obj) |
| 153 | "Create a new buffer NAME in which the chart OBJ is displayed. | ||
| 154 | Returns the newly created buffer." | ||
| 155 | (with-current-buffer (get-buffer-create (format "*%s*" (oref obj title))) | ||
| 156 | (chart-mode) | ||
| 157 | (setq chart-local-object obj) | ||
| 158 | (current-buffer))) | ||
| 159 | |||
| 160 | (cl-defmethod initialize-instance :after ((obj chart) &rest _fields) | ||
| 160 | "Initialize the chart OBJ being created with FIELDS. | 161 | "Initialize the chart OBJ being created with FIELDS. |
| 161 | Make sure the width/height is correct." | 162 | Make sure the width/height is correct." |
| 162 | (oset obj x-width (- (window-width) 10)) | 163 | (oset obj x-width (- (window-width) 10)) |
| @@ -201,7 +202,7 @@ Make sure the width/height is correct." | |||
| 201 | :initform vertical)) | 202 | :initform vertical)) |
| 202 | "Subclass for bar charts (vertical or horizontal).") | 203 | "Subclass for bar charts (vertical or horizontal).") |
| 203 | 204 | ||
| 204 | (defmethod chart-draw ((c chart) &optional buff) | 205 | (cl-defmethod chart-draw ((c chart) &optional buff) |
| 205 | "Start drawing a chart object C in optional BUFF. | 206 | "Start drawing a chart object C in optional BUFF. |
| 206 | Erases current contents of buffer." | 207 | Erases current contents of buffer." |
| 207 | (save-excursion | 208 | (save-excursion |
| @@ -221,19 +222,19 @@ Erases current contents of buffer." | |||
| 221 | (message "Rendering chart...done") | 222 | (message "Rendering chart...done") |
| 222 | )) | 223 | )) |
| 223 | 224 | ||
| 224 | (defmethod chart-draw-title ((c chart)) | 225 | (cl-defmethod chart-draw-title ((c chart)) |
| 225 | "Draw a title upon the chart. | 226 | "Draw a title upon the chart. |
| 226 | Argument C is the chart object." | 227 | Argument C is the chart object." |
| 227 | (chart-display-label (oref c title) 'horizontal 0 0 (window-width) | 228 | (chart-display-label (oref c title) 'horizontal 0 0 (window-width) |
| 228 | (oref c title-face))) | 229 | (oref c title-face))) |
| 229 | 230 | ||
| 230 | (defmethod chart-size-in-dir ((c chart) dir) | 231 | (cl-defmethod chart-size-in-dir ((c chart) dir) |
| 231 | "Return the physical size of chart C in direction DIR." | 232 | "Return the physical size of chart C in direction DIR." |
| 232 | (if (eq dir 'vertical) | 233 | (if (eq dir 'vertical) |
| 233 | (oref c y-width) | 234 | (oref c y-width) |
| 234 | (oref c x-width))) | 235 | (oref c x-width))) |
| 235 | 236 | ||
| 236 | (defmethod chart-draw-axis ((c chart)) | 237 | (cl-defmethod chart-draw-axis ((c chart)) |
| 237 | "Draw axis into the current buffer defined by chart C." | 238 | "Draw axis into the current buffer defined by chart C." |
| 238 | (let ((ymarg (oref c y-margin)) | 239 | (let ((ymarg (oref c y-margin)) |
| 239 | (xmarg (oref c x-margin)) | 240 | (xmarg (oref c x-margin)) |
| @@ -247,7 +248,7 @@ Argument C is the chart object." | |||
| 247 | ymarg (+ ymarg xlen))) | 248 | ymarg (+ ymarg xlen))) |
| 248 | ) | 249 | ) |
| 249 | 250 | ||
| 250 | (defmethod chart-axis-draw ((a chart-axis) &optional dir margin zone start end) | 251 | (cl-defmethod chart-axis-draw ((a chart-axis) &optional dir margin zone start end) |
| 251 | "Draw some axis for A in direction DIR with MARGIN in boundary. | 252 | "Draw some axis for A in direction DIR with MARGIN in boundary. |
| 252 | ZONE is a zone specification. | 253 | ZONE is a zone specification. |
| 253 | START and END represent the boundary." | 254 | START and END represent the boundary." |
| @@ -257,7 +258,7 @@ START and END represent the boundary." | |||
| 257 | 1 0)) | 258 | 1 0)) |
| 258 | start end (oref a name-face))) | 259 | start end (oref a name-face))) |
| 259 | 260 | ||
| 260 | (defmethod chart-translate-xpos ((c chart) x) | 261 | (cl-defmethod chart-translate-xpos ((c chart) x) |
| 261 | "Translate in chart C the coordinate X into a screen column." | 262 | "Translate in chart C the coordinate X into a screen column." |
| 262 | (let ((range (oref (oref c x-axis) bounds))) | 263 | (let ((range (oref (oref c x-axis) bounds))) |
| 263 | (+ (oref c x-margin) | 264 | (+ (oref c x-margin) |
| @@ -266,7 +267,7 @@ START and END represent the boundary." | |||
| 266 | (float (- (cdr range) (car range)))))))) | 267 | (float (- (cdr range) (car range)))))))) |
| 267 | ) | 268 | ) |
| 268 | 269 | ||
| 269 | (defmethod chart-translate-ypos ((c chart) y) | 270 | (cl-defmethod chart-translate-ypos ((c chart) y) |
| 270 | "Translate in chart C the coordinate Y into a screen row." | 271 | "Translate in chart C the coordinate Y into a screen row." |
| 271 | (let ((range (oref (oref c y-axis) bounds))) | 272 | (let ((range (oref (oref c y-axis) bounds))) |
| 272 | (+ (oref c x-margin) | 273 | (+ (oref c x-margin) |
| @@ -276,7 +277,7 @@ START and END represent the boundary." | |||
| 276 | (float (- (cdr range) (car range))))))))) | 277 | (float (- (cdr range) (car range))))))))) |
| 277 | ) | 278 | ) |
| 278 | 279 | ||
| 279 | (defmethod chart-axis-draw ((a chart-axis-range) &optional dir margin zone _start _end) | 280 | (cl-defmethod chart-axis-draw ((a chart-axis-range) &optional dir margin zone _start _end) |
| 280 | "Draw axis information based upon a range to be spread along the edge. | 281 | "Draw axis information based upon a range to be spread along the edge. |
| 281 | A is the chart to draw. DIR is the direction. | 282 | A is the chart to draw. DIR is the direction. |
| 282 | MARGIN, ZONE, START, and END specify restrictions in chart space." | 283 | MARGIN, ZONE, START, and END specify restrictions in chart space." |
| @@ -313,7 +314,7 @@ MARGIN, ZONE, START, and END specify restrictions in chart space." | |||
| 313 | (setq i (+ i j)))) | 314 | (setq i (+ i j)))) |
| 314 | ) | 315 | ) |
| 315 | 316 | ||
| 316 | (defmethod chart-translate-namezone ((c chart) n) | 317 | (cl-defmethod chart-translate-namezone ((c chart) n) |
| 317 | "Return a dot-pair representing a positional range for a name. | 318 | "Return a dot-pair representing a positional range for a name. |
| 318 | The name in chart C of the Nth name resides. | 319 | The name in chart C of the Nth name resides. |
| 319 | Automatically compensates for direction." | 320 | Automatically compensates for direction." |
| @@ -329,7 +330,7 @@ Automatically compensates for direction." | |||
| 329 | (+ m -1 (round (* lpn (+ 1.0 (float n)))))) | 330 | (+ m -1 (round (* lpn (+ 1.0 (float n)))))) |
| 330 | )) | 331 | )) |
| 331 | 332 | ||
| 332 | (defmethod chart-axis-draw ((a chart-axis-names) &optional dir margin zone _start _end) | 333 | (cl-defmethod chart-axis-draw ((a chart-axis-names) &optional dir margin zone _start _end) |
| 333 | "Draw axis information based upon A range to be spread along the edge. | 334 | "Draw axis information based upon A range to be spread along the edge. |
| 334 | Optional argument DIR is the direction of the chart. | 335 | Optional argument DIR is the direction of the chart. |
| 335 | Optional arguments MARGIN, ZONE, START and END specify boundaries of the drawing." | 336 | Optional arguments MARGIN, ZONE, START and END specify boundaries of the drawing." |
| @@ -368,7 +369,7 @@ Optional arguments MARGIN, ZONE, START and END specify boundaries of the drawing | |||
| 368 | s (cdr s)))) | 369 | s (cdr s)))) |
| 369 | ) | 370 | ) |
| 370 | 371 | ||
| 371 | (defmethod chart-draw-data ((c chart-bar)) | 372 | (cl-defmethod chart-draw-data ((c chart-bar)) |
| 372 | "Display the data available in a bar chart C." | 373 | "Display the data available in a bar chart C." |
| 373 | (let* ((data (oref c sequences)) | 374 | (let* ((data (oref c sequences)) |
| 374 | (dir (oref c direction)) | 375 | (dir (oref c direction)) |
| @@ -413,7 +414,7 @@ Optional arguments MARGIN, ZONE, START and END specify boundaries of the drawing | |||
| 413 | (setq data (cdr data)))) | 414 | (setq data (cdr data)))) |
| 414 | ) | 415 | ) |
| 415 | 416 | ||
| 416 | (defmethod chart-add-sequence ((c chart) &optional seq axis-label) | 417 | (cl-defmethod chart-add-sequence ((c chart) &optional seq axis-label) |
| 417 | "Add to chart object C the sequence object SEQ. | 418 | "Add to chart object C the sequence object SEQ. |
| 418 | If AXIS-LABEL, then the axis stored in C is updated with the bounds of SEQ, | 419 | If AXIS-LABEL, then the axis stored in C is updated with the bounds of SEQ, |
| 419 | or is created with the bounds of SEQ." | 420 | or is created with the bounds of SEQ." |
| @@ -445,7 +446,7 @@ or is created with the bounds of SEQ." | |||
| 445 | 446 | ||
| 446 | ;;; Charting optimizers | 447 | ;;; Charting optimizers |
| 447 | 448 | ||
| 448 | (defmethod chart-trim ((c chart) max) | 449 | (cl-defmethod chart-trim ((c chart) max) |
| 449 | "Trim all sequences in chart C to be at most MAX elements long." | 450 | "Trim all sequences in chart C to be at most MAX elements long." |
| 450 | (let ((s (oref c sequences))) | 451 | (let ((s (oref c sequences))) |
| 451 | (while s | 452 | (while s |
| @@ -455,7 +456,7 @@ or is created with the bounds of SEQ." | |||
| 455 | (setq s (cdr s)))) | 456 | (setq s (cdr s)))) |
| 456 | ) | 457 | ) |
| 457 | 458 | ||
| 458 | (defmethod chart-sort ((c chart) pred) | 459 | (cl-defmethod chart-sort ((c chart) pred) |
| 459 | "Sort the data in chart C using predicate PRED. | 460 | "Sort the data in chart C using predicate PRED. |
| 460 | See `chart-sort-matchlist' for more details." | 461 | See `chart-sort-matchlist' for more details." |
| 461 | (let* ((sl (oref c sequences)) | 462 | (let* ((sl (oref c sequences)) |
diff --git a/lisp/leim/quail/programmer-dvorak.el b/lisp/leim/quail/programmer-dvorak.el new file mode 100644 index 00000000000..a74fb5bc6b6 --- /dev/null +++ b/lisp/leim/quail/programmer-dvorak.el | |||
| @@ -0,0 +1,145 @@ | |||
| 1 | ;;; programmer-dvorak.el --- Quail package for the programmer Dvorak layout | ||
| 2 | |||
| 3 | ;; Copyright (C) 2015 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Joakim Jalap <joakim.jalap@fastmail.com> | ||
| 6 | |||
| 7 | ;; Keywords: input method, Dvorak | ||
| 8 | |||
| 9 | ;; This file is released under the terms of GNU Emacs. | ||
| 10 | |||
| 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 14 | ;; (at your option) any later version. | ||
| 15 | |||
| 16 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | |||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 23 | |||
| 24 | ;;; Commentary: | ||
| 25 | |||
| 26 | ;;; This file provides an input method for the programmers Dvorak keyboard | ||
| 27 | ;;; layout by Roland Kaufman (<http://www.kaufmann.no/roland/dvorak/>). | ||
| 28 | |||
| 29 | ;;; Code: | ||
| 30 | |||
| 31 | (require 'quail) | ||
| 32 | |||
| 33 | (quail-define-package | ||
| 34 | "programmer-dvorak" "English" "DVP@" t | ||
| 35 | "An English (ASCII) dvorak layout optimized for programming, with for example | ||
| 36 | brackets and parens more easily reachable." | ||
| 37 | nil t t t t nil nil nil nil nil t) | ||
| 38 | |||
| 39 | ;; &% [7 {5 }3 (1 =9 *0 )2 +4 ]6 !8 #` $~ | ||
| 40 | ;; ;: ,< .> pP yY fF gG cC rR lL /? @^ | ||
| 41 | ;; aA oO eE uU iI dD hH tT nN sS -_ \| | ||
| 42 | ;; '" qQ jJ kK xX bB mM wW vV zZ | ||
| 43 | ;; | ||
| 44 | |||
| 45 | (quail-define-rules | ||
| 46 | ("-" ?!) | ||
| 47 | ("=" ?#) | ||
| 48 | ("`" ?$) | ||
| 49 | ("q" ?\;) | ||
| 50 | ("w" ?,) | ||
| 51 | ("e" ?.) | ||
| 52 | ("r" ?p) | ||
| 53 | ("t" ?y) | ||
| 54 | ("y" ?f) | ||
| 55 | ("u" ?g) | ||
| 56 | ("i" ?c) | ||
| 57 | ("o" ?r) | ||
| 58 | ("p" ?l) | ||
| 59 | ("[" ?/) | ||
| 60 | ("]" ?@) | ||
| 61 | ("a" ?a) | ||
| 62 | ("s" ?o) | ||
| 63 | ("d" ?e) | ||
| 64 | ("f" ?u) | ||
| 65 | ("g" ?i) | ||
| 66 | ("h" ?d) | ||
| 67 | ("j" ?h) | ||
| 68 | ("k" ?t) | ||
| 69 | ("l" ?n) | ||
| 70 | (";" ?s) | ||
| 71 | ("'" ?-) | ||
| 72 | ("\\" ?\\) | ||
| 73 | ("z" ?\') | ||
| 74 | ("x" ?q) | ||
| 75 | ("c" ?j) | ||
| 76 | ("v" ?k) | ||
| 77 | ("b" ?x) | ||
| 78 | ("n" ?b) | ||
| 79 | ("m" ?m) | ||
| 80 | ("," ?w) | ||
| 81 | ("." ?v) | ||
| 82 | ("/" ?z) | ||
| 83 | |||
| 84 | ("_" ?8) | ||
| 85 | ("+" ?`) | ||
| 86 | ("~" ?~) | ||
| 87 | ("Q" ?:) | ||
| 88 | ("W" ?<) | ||
| 89 | ("E" ?>) | ||
| 90 | ("R" ?P) | ||
| 91 | ("T" ?Y) | ||
| 92 | ("Y" ?F) | ||
| 93 | ("U" ?G) | ||
| 94 | ("I" ?C) | ||
| 95 | ("O" ?R) | ||
| 96 | ("P" ?L) | ||
| 97 | ("{" ??) | ||
| 98 | ("}" ?^) | ||
| 99 | ("A" ?A) | ||
| 100 | ("S" ?O) | ||
| 101 | ("D" ?E) | ||
| 102 | ("F" ?U) | ||
| 103 | ("G" ?I) | ||
| 104 | ("H" ?D) | ||
| 105 | ("J" ?H) | ||
| 106 | ("K" ?T) | ||
| 107 | ("L" ?N) | ||
| 108 | (":" ?S) | ||
| 109 | ("\"" ?_) | ||
| 110 | ("|" ?|) | ||
| 111 | ("Z" ?\") | ||
| 112 | ("X" ?Q) | ||
| 113 | ("C" ?J) | ||
| 114 | ("V" ?K) | ||
| 115 | ("B" ?X) | ||
| 116 | ("N" ?B) | ||
| 117 | ("M" ?M) | ||
| 118 | ("<" ?W) | ||
| 119 | (">" ?V) | ||
| 120 | ("?" ?Z) | ||
| 121 | |||
| 122 | ("1" ?&) | ||
| 123 | ("2" ?\[) | ||
| 124 | ("3" ?{) | ||
| 125 | ("4" ?}) | ||
| 126 | ("5" ?\() | ||
| 127 | ("6" ?=) | ||
| 128 | ("7" ?\*) | ||
| 129 | ("8" ?\)) | ||
| 130 | ("9" ?+) | ||
| 131 | ("0" ?\]) | ||
| 132 | |||
| 133 | ("!" ?%) | ||
| 134 | ("@" ?7) | ||
| 135 | ("#" ?5) | ||
| 136 | ("$" ?3) | ||
| 137 | ("%" ?1) | ||
| 138 | ("^" ?9) | ||
| 139 | ("&" ?0) | ||
| 140 | ("*" ?2) | ||
| 141 | ("(" ?4) | ||
| 142 | (")" ?6) | ||
| 143 | ) | ||
| 144 | |||
| 145 | ;;; programmer-dvorak.el ends here | ||
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 0effa93b197..7ee382f2f22 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -259,6 +259,11 @@ DOM should be a parse tree as generated by | |||
| 259 | (* (frame-char-width) 2) | 259 | (* (frame-char-width) 2) |
| 260 | 0))))) | 260 | 0))))) |
| 261 | bidi-display-reordering) | 261 | bidi-display-reordering) |
| 262 | ;; If the window was hscrolled for some reason, shr-fill-lines | ||
| 263 | ;; below will misbehave, because it silently assumes that it | ||
| 264 | ;; starts with a non-hscrolled window (vertical-motion will move | ||
| 265 | ;; to a wrong place otherwise). | ||
| 266 | (set-window-hscroll nil 0) | ||
| 262 | (shr-descend dom) | 267 | (shr-descend dom) |
| 263 | (shr-fill-lines start (point)) | 268 | (shr-fill-lines start (point)) |
| 264 | (shr-remove-trailing-whitespace start (point)) | 269 | (shr-remove-trailing-whitespace start (point)) |
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 6c4a731629c..8d13aa1dd5b 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -399,6 +399,9 @@ like <img alt=\"Some thing.\">." | |||
| 399 | (interactive) | 399 | (interactive) |
| 400 | (setq flyspell-generic-check-word-predicate | 400 | (setq flyspell-generic-check-word-predicate |
| 401 | #'flyspell-generic-progmode-verify) | 401 | #'flyspell-generic-progmode-verify) |
| 402 | (setq-local flyspell--prev-meta-tab-binding | ||
| 403 | (or (local-key-binding "\M-\t" t) | ||
| 404 | (global-key-binding "\M-\t" t))) | ||
| 402 | (flyspell-mode 1) | 405 | (flyspell-mode 1) |
| 403 | (run-hooks 'flyspell-prog-mode-hook)) | 406 | (run-hooks 'flyspell-prog-mode-hook)) |
| 404 | 407 | ||
| @@ -1904,105 +1907,114 @@ before point that's highlighted as misspelled." | |||
| 1904 | "Correct the current word. | 1907 | "Correct the current word. |
| 1905 | This command proposes various successive corrections for the current word." | 1908 | This command proposes various successive corrections for the current word." |
| 1906 | (interactive) | 1909 | (interactive) |
| 1907 | (let ((pos (point)) | 1910 | ;; If we are not in the construct where flyspell should be active, |
| 1908 | (old-max (point-max))) | 1911 | ;; invoke the original binding of M-TAB, if that was recorded. |
| 1909 | ;; Use the correct dictionary. | 1912 | (if (and (local-variable-p 'flyspell--prev-meta-tab-binding) |
| 1910 | (flyspell-accept-buffer-local-defs) | 1913 | (commandp flyspell--prev-meta-tab-binding t) |
| 1911 | (if (and (eq flyspell-auto-correct-pos pos) | 1914 | (fboundp flyspell-generic-check-word-predicate) |
| 1912 | (consp flyspell-auto-correct-region)) | 1915 | (not (funcall flyspell-generic-check-word-predicate)) |
| 1913 | ;; We have already been using the function at the same location. | 1916 | (equal (where-is-internal 'flyspell-auto-correct-word nil t) |
| 1914 | (let* ((start (car flyspell-auto-correct-region)) | 1917 | [?\M-\t])) |
| 1915 | (len (cdr flyspell-auto-correct-region))) | 1918 | (call-interactively flyspell--prev-meta-tab-binding) |
| 1916 | (flyspell-unhighlight-at start) | 1919 | (let ((pos (point)) |
| 1917 | (delete-region start (+ start len)) | 1920 | (old-max (point-max))) |
| 1918 | (setq flyspell-auto-correct-ring (cdr flyspell-auto-correct-ring)) | 1921 | ;; Use the correct dictionary. |
| 1919 | (let* ((word (car flyspell-auto-correct-ring)) | 1922 | (flyspell-accept-buffer-local-defs) |
| 1920 | (len (length word))) | 1923 | (if (and (eq flyspell-auto-correct-pos pos) |
| 1921 | (rplacd flyspell-auto-correct-region len) | 1924 | (consp flyspell-auto-correct-region)) |
| 1922 | (goto-char start) | 1925 | ;; We have already been using the function at the same location. |
| 1923 | (if flyspell-abbrev-p | 1926 | (let* ((start (car flyspell-auto-correct-region)) |
| 1924 | (if (flyspell-already-abbrevp (flyspell-abbrev-table) | 1927 | (len (cdr flyspell-auto-correct-region))) |
| 1925 | flyspell-auto-correct-word) | 1928 | (flyspell-unhighlight-at start) |
| 1926 | (flyspell-change-abbrev (flyspell-abbrev-table) | 1929 | (delete-region start (+ start len)) |
| 1927 | flyspell-auto-correct-word | 1930 | (setq flyspell-auto-correct-ring (cdr flyspell-auto-correct-ring)) |
| 1928 | word) | 1931 | (let* ((word (car flyspell-auto-correct-ring)) |
| 1929 | (flyspell-define-abbrev flyspell-auto-correct-word word))) | 1932 | (len (length word))) |
| 1930 | (funcall flyspell-insert-function word) | 1933 | (rplacd flyspell-auto-correct-region len) |
| 1931 | (flyspell-word) | 1934 | (goto-char start) |
| 1932 | (flyspell-display-next-corrections flyspell-auto-correct-ring)) | 1935 | (if flyspell-abbrev-p |
| 1933 | (flyspell-ajust-cursor-point pos (point) old-max) | 1936 | (if (flyspell-already-abbrevp (flyspell-abbrev-table) |
| 1934 | (setq flyspell-auto-correct-pos (point))) | 1937 | flyspell-auto-correct-word) |
| 1935 | ;; Fetch the word to be checked. | 1938 | (flyspell-change-abbrev (flyspell-abbrev-table) |
| 1936 | (let ((word (flyspell-get-word))) | 1939 | flyspell-auto-correct-word |
| 1937 | (if (consp word) | 1940 | word) |
| 1938 | (let ((start (car (cdr word))) | 1941 | (flyspell-define-abbrev flyspell-auto-correct-word word))) |
| 1939 | (end (car (cdr (cdr word)))) | 1942 | (funcall flyspell-insert-function word) |
| 1940 | (word (car word)) | 1943 | (flyspell-word) |
| 1941 | poss ispell-filter) | 1944 | (flyspell-display-next-corrections flyspell-auto-correct-ring)) |
| 1942 | (setq flyspell-auto-correct-word word) | 1945 | (flyspell-ajust-cursor-point pos (point) old-max) |
| 1943 | ;; Now check spelling of word.. | 1946 | (setq flyspell-auto-correct-pos (point))) |
| 1944 | (ispell-send-string "%\n") ;Put in verbose mode. | 1947 | ;; Fetch the word to be checked. |
| 1945 | (ispell-send-string (concat "^" word "\n")) | 1948 | (let ((word (flyspell-get-word))) |
| 1946 | ;; Wait until ispell has processed word. | 1949 | (if (consp word) |
| 1947 | (while (progn | 1950 | (let ((start (car (cdr word))) |
| 1948 | (accept-process-output ispell-process) | 1951 | (end (car (cdr (cdr word)))) |
| 1949 | (not (string= "" (car ispell-filter))))) | 1952 | (word (car word)) |
| 1950 | ;; Remove leading empty element. | 1953 | poss ispell-filter) |
| 1951 | (setq ispell-filter (cdr ispell-filter)) | 1954 | (setq flyspell-auto-correct-word word) |
| 1952 | ;; Ispell process should return something after word is sent. | 1955 | ;; Now check spelling of word.. |
| 1953 | ;; Tag word as valid (i.e., skip) otherwise. | 1956 | (ispell-send-string "%\n") ;Put in verbose mode. |
| 1954 | (or ispell-filter | 1957 | (ispell-send-string (concat "^" word "\n")) |
| 1955 | (setq ispell-filter '(*))) | 1958 | ;; Wait until ispell has processed word. |
| 1956 | (if (consp ispell-filter) | 1959 | (while (progn |
| 1957 | (setq poss (ispell-parse-output (car ispell-filter)))) | 1960 | (accept-process-output ispell-process) |
| 1958 | (cond | 1961 | (not (string= "" (car ispell-filter))))) |
| 1959 | ((or (eq poss t) (stringp poss)) | 1962 | ;; Remove leading empty element. |
| 1960 | ;; Don't correct word. | 1963 | (setq ispell-filter (cdr ispell-filter)) |
| 1961 | t) | 1964 | ;; Ispell process should return something after word is sent. |
| 1962 | ((null poss) | 1965 | ;; Tag word as valid (i.e., skip) otherwise. |
| 1963 | ;; Ispell error. | 1966 | (or ispell-filter |
| 1964 | (error "Ispell: error in Ispell process")) | 1967 | (setq ispell-filter '(*))) |
| 1965 | (t | 1968 | (if (consp ispell-filter) |
| 1966 | ;; The word is incorrect, we have to propose a replacement. | 1969 | (setq poss (ispell-parse-output (car ispell-filter)))) |
| 1967 | (let ((replacements (if flyspell-sort-corrections | 1970 | (cond |
| 1968 | (sort (car (cdr (cdr poss))) 'string<) | 1971 | ((or (eq poss t) (stringp poss)) |
| 1969 | (car (cdr (cdr poss)))))) | 1972 | ;; Don't correct word. |
| 1970 | (setq flyspell-auto-correct-region nil) | 1973 | t) |
| 1971 | (if (consp replacements) | 1974 | ((null poss) |
| 1972 | (progn | 1975 | ;; Ispell error. |
| 1973 | (let ((replace (car replacements))) | 1976 | (error "Ispell: error in Ispell process")) |
| 1974 | (let ((new-word replace)) | 1977 | (t |
| 1975 | (if (not (equal new-word (car poss))) | 1978 | ;; The word is incorrect, we have to propose a replacement. |
| 1976 | (progn | 1979 | (let ((replacements (if flyspell-sort-corrections |
| 1977 | ;; the save the current replacements | 1980 | (sort (car (cdr (cdr poss))) 'string<) |
| 1978 | (setq flyspell-auto-correct-region | 1981 | (car (cdr (cdr poss)))))) |
| 1979 | (cons start (length new-word))) | 1982 | (setq flyspell-auto-correct-region nil) |
| 1980 | (let ((l replacements)) | 1983 | (if (consp replacements) |
| 1981 | (while (consp (cdr l)) | 1984 | (progn |
| 1982 | (setq l (cdr l))) | 1985 | (let ((replace (car replacements))) |
| 1983 | (rplacd l (cons (car poss) replacements))) | 1986 | (let ((new-word replace)) |
| 1984 | (setq flyspell-auto-correct-ring | 1987 | (if (not (equal new-word (car poss))) |
| 1985 | replacements) | 1988 | (progn |
| 1986 | (flyspell-unhighlight-at start) | 1989 | ;; the save the current replacements |
| 1987 | (delete-region start end) | 1990 | (setq flyspell-auto-correct-region |
| 1988 | (funcall flyspell-insert-function new-word) | 1991 | (cons start (length new-word))) |
| 1989 | (if flyspell-abbrev-p | 1992 | (let ((l replacements)) |
| 1990 | (if (flyspell-already-abbrevp | 1993 | (while (consp (cdr l)) |
| 1991 | (flyspell-abbrev-table) word) | 1994 | (setq l (cdr l))) |
| 1992 | (flyspell-change-abbrev | 1995 | (rplacd l (cons (car poss) replacements))) |
| 1993 | (flyspell-abbrev-table) | 1996 | (setq flyspell-auto-correct-ring |
| 1994 | word | 1997 | replacements) |
| 1995 | new-word) | 1998 | (flyspell-unhighlight-at start) |
| 1996 | (flyspell-define-abbrev word | 1999 | (delete-region start end) |
| 1997 | new-word))) | 2000 | (funcall flyspell-insert-function new-word) |
| 1998 | (flyspell-word) | 2001 | (if flyspell-abbrev-p |
| 1999 | (flyspell-display-next-corrections | 2002 | (if (flyspell-already-abbrevp |
| 2000 | (cons new-word flyspell-auto-correct-ring)) | 2003 | (flyspell-abbrev-table) word) |
| 2001 | (flyspell-ajust-cursor-point pos | 2004 | (flyspell-change-abbrev |
| 2002 | (point) | 2005 | (flyspell-abbrev-table) |
| 2003 | old-max)))))))))) | 2006 | word |
| 2004 | (setq flyspell-auto-correct-pos (point)) | 2007 | new-word) |
| 2005 | (ispell-pdict-save t))))))) | 2008 | (flyspell-define-abbrev word |
| 2009 | new-word))) | ||
| 2010 | (flyspell-word) | ||
| 2011 | (flyspell-display-next-corrections | ||
| 2012 | (cons new-word flyspell-auto-correct-ring)) | ||
| 2013 | (flyspell-ajust-cursor-point pos | ||
| 2014 | (point) | ||
| 2015 | old-max)))))))))) | ||
| 2016 | (setq flyspell-auto-correct-pos (point)) | ||
| 2017 | (ispell-pdict-save t)))))))) | ||
| 2006 | 2018 | ||
| 2007 | ;;*---------------------------------------------------------------------*/ | 2019 | ;;*---------------------------------------------------------------------*/ |
| 2008 | ;;* flyspell-auto-correct-previous-pos ... */ | 2020 | ;;* flyspell-auto-correct-previous-pos ... */ |
diff --git a/nt/INSTALL b/nt/INSTALL index e1d9e0633c7..1be6d99c02e 100644 --- a/nt/INSTALL +++ b/nt/INSTALL | |||
| @@ -12,6 +12,9 @@ build will run on Windows 9X and newer systems). | |||
| 12 | Do not use this recipe with Cygwin. For building on Cygwin, use the | 12 | Do not use this recipe with Cygwin. For building on Cygwin, use the |
| 13 | normal installation instructions, ../INSTALL. | 13 | normal installation instructions, ../INSTALL. |
| 14 | 14 | ||
| 15 | For building Emacs using the MinGW64/MSYS2 toolchain, see the | ||
| 16 | instructions in the file INSTALL.W64 in this directory. | ||
| 17 | |||
| 15 | * For the brave (a.k.a. "impatient"): | 18 | * For the brave (a.k.a. "impatient"): |
| 16 | 19 | ||
| 17 | For those who have a working MSYS/MinGW development environment and | 20 | For those who have a working MSYS/MinGW development environment and |
diff --git a/nt/INSTALL.W64 b/nt/INSTALL.W64 new file mode 100644 index 00000000000..95fbfe014d3 --- /dev/null +++ b/nt/INSTALL.W64 | |||
| @@ -0,0 +1,224 @@ | |||
| 1 | Building and Installing Emacs on 64-bit MS-Windows | ||
| 2 | using MSYS2 and MinGW-w64 | ||
| 3 | |||
| 4 | Copyright (c) 2015 Free Software Foundation, Inc. | ||
| 5 | See the end of the file for license conditions. | ||
| 6 | |||
| 7 | This document describes how to compile a 64-bit GNU Emacs using MSYS2 | ||
| 8 | and MinGW-w64. For instructions for building a 32-bit Emacs using | ||
| 9 | MSYS and MinGW, see the file INSTALL in this directory. | ||
| 10 | |||
| 11 | Do not use this recipe with Cygwin. For building on Cygwin, use the normal | ||
| 12 | installation instructions in ../INSTALL. | ||
| 13 | |||
| 14 | * Requirements | ||
| 15 | |||
| 16 | The total space required is 3GB: 1.8GB for MSYS2 / MinGW-w64 and 1.2GB for | ||
| 17 | Emacs with the full repository, or less if you're using a release tarball. | ||
| 18 | |||
| 19 | * Set up the MinGW-w64 / MSYS2 build environment | ||
| 20 | |||
| 21 | MinGW-w64 provides a complete runtime for projects built with GCC for 64-bit | ||
| 22 | Windows -- it's located at http://mingw-w64.org/. | ||
| 23 | |||
| 24 | MSYS2 is a Cygwin-derived software distribution for Windows which provides | ||
| 25 | build tools for MinGW-w64 -- see http://msys2.github.io/. | ||
| 26 | |||
| 27 | ** Download and install MinGW-w64 and MSYS2 | ||
| 28 | |||
| 29 | You can download the x86_64 version of MSYS2 (i.e. msys2-x86_64-<date>.exe) | ||
| 30 | from | ||
| 31 | |||
| 32 | https://sourceforge.net/projects/msys2/files/Base/x86_64 | ||
| 33 | |||
| 34 | Run this file to install MSYS2 in your preferred directory, e.g. the default | ||
| 35 | C:\msys64 -- this will install MinGW-w64 also. Note that directory names | ||
| 36 | containing spaces may cause problems. | ||
| 37 | |||
| 38 | Then you'll need to add the following directories to your Windows PATH | ||
| 39 | environment variable: | ||
| 40 | |||
| 41 | c:\msys64\usr\bin;c:\msys64\mingw64\bin | ||
| 42 | |||
| 43 | you can do this through Control Panel / System and Security / System / | ||
| 44 | Advanced system settings / Environment Variables / Edit path. | ||
| 45 | |||
| 46 | Adding these directories to your PATH tells Emacs where to find the DLLs it | ||
| 47 | needs to run, and some optional commands like grep and find. These commands | ||
| 48 | will also be available at the Windows console. | ||
| 49 | |||
| 50 | ** Download and install the necessary packages | ||
| 51 | |||
| 52 | Run msys2_shell.bat in your MSYS2 directory and you will see a BASH window | ||
| 53 | opened. | ||
| 54 | |||
| 55 | In the BASH prompt, use the following command to install the necessary | ||
| 56 | packages (you can copy and paste it into the shell with Shift + Insert): | ||
| 57 | |||
| 58 | pacman -S base-devel \ | ||
| 59 | mingw-w64-x86_64-toolchain \ | ||
| 60 | mingw-w64-x86_64-xpm-nox \ | ||
| 61 | mingw-w64-x86_64-libtiff \ | ||
| 62 | mingw-w64-x86_64-giflib \ | ||
| 63 | mingw-w64-x86_64-libpng \ | ||
| 64 | mingw-w64-x86_64-libjpeg-turbo \ | ||
| 65 | mingw-w64-x86_64-librsvg \ | ||
| 66 | mingw-w64-x86_64-libxml2 \ | ||
| 67 | mingw-w64-x86_64-gnutls | ||
| 68 | |||
| 69 | The packages include the base developer tools (autoconf, automake, grep, make, | ||
| 70 | etc.), the compiler toolchain (gcc, gdb, etc.), several image libraries, an | ||
| 71 | XML library, and the GnuTLS (transport layer security) library. Only the | ||
| 72 | first three packages are required (base-devel, toolchain, xpm-nox); the rest | ||
| 73 | are optional. | ||
| 74 | |||
| 75 | You now have a complete build environment for Emacs. | ||
| 76 | |||
| 77 | * Install Git (optional) and disable autocrlf | ||
| 78 | |||
| 79 | If you're going to be building the development version of Emacs from the Git | ||
| 80 | repository, and you don't already have Git on your system, you can install it | ||
| 81 | in your MSYS2 environment with: | ||
| 82 | |||
| 83 | pacman -S git | ||
| 84 | |||
| 85 | The autocrlf feature of Git may interfere with the configure file, so it is | ||
| 86 | best to disable this feature by running the command: | ||
| 87 | |||
| 88 | git config core.autocrlf false | ||
| 89 | |||
| 90 | * Get the Emacs source code | ||
| 91 | |||
| 92 | Now you can either get an existing release version of the Emacs source code | ||
| 93 | from the GNU ftp site, or get the more current version and history from the | ||
| 94 | Git repository. | ||
| 95 | |||
| 96 | You can always find the most recent information on these sources from the GNU | ||
| 97 | Savannah Emacs site, https://savannah.gnu.org/projects/emacs. | ||
| 98 | |||
| 99 | ** From the FTP site | ||
| 100 | |||
| 101 | The Emacs ftp site is located at http://ftp.gnu.org/gnu/emacs/ - download the | ||
| 102 | version you want to build and put the file into a location like C:\emacs\, | ||
| 103 | then uncompress it with tar. This will put the Emacs source into a folder like | ||
| 104 | C:\emacs\emacs-24.5: | ||
| 105 | |||
| 106 | cd /c/emacs | ||
| 107 | tar xJf emacs-24.5.tar.xz | ||
| 108 | |||
| 109 | ** From the Git repository | ||
| 110 | |||
| 111 | To download the Git repository, do something like the following -- this will | ||
| 112 | put the Emacs source into C:\emacs\emacs-25: | ||
| 113 | |||
| 114 | mkdir /c/emacs | ||
| 115 | cd /c/emacs | ||
| 116 | git clone git://git.sv.gnu.org/emacs.git emacs-25 | ||
| 117 | |||
| 118 | (We recommend using the command shown on Savannah Emacs project page.) | ||
| 119 | |||
| 120 | * Build Emacs | ||
| 121 | |||
| 122 | Now you're ready to build and install Emacs with autogen, configure, make, | ||
| 123 | and make install. | ||
| 124 | |||
| 125 | First we need to switch to the MinGW-w64 environment. Exit the MSYS2 BASH | ||
| 126 | console and run mingw64_shell.bat in the C:\msys64 folder, then cd back to | ||
| 127 | your Emacs source directory, e.g.: | ||
| 128 | |||
| 129 | cd /c/emacs/emacs-25 | ||
| 130 | |||
| 131 | ** Run autogen | ||
| 132 | |||
| 133 | If you are building the development sources, run autogen to generate the | ||
| 134 | configure script (note: this step is not necessary if you are using a | ||
| 135 | release source tarball, as the configure file is included): | ||
| 136 | |||
| 137 | ./autogen.sh | ||
| 138 | |||
| 139 | ** Run configure | ||
| 140 | |||
| 141 | Now you can run configure, which will build the various Makefiles -- note | ||
| 142 | that the example given here is just a simple one - for more information | ||
| 143 | on the options available please see the INSTALL file in this directory. | ||
| 144 | |||
| 145 | The '--prefix' option specifies a location for the resulting binary files, | ||
| 146 | which 'make install' will use - in this example we set it to C:\emacs\emacs-25. | ||
| 147 | If a prefix is not specified the files will be put in the standard Unix | ||
| 148 | directories located in your C:\msys64 directory, but this is not recommended. | ||
| 149 | |||
| 150 | Note also that we need to disable Imagemagick because Emacs does not yet | ||
| 151 | support it on Windows. | ||
| 152 | |||
| 153 | PKG_CONFIG_PATH=/mingw64/lib/pkgconfig \ | ||
| 154 | ./configure --prefix=/c/emacs/emacs-25 --without-imagemagick | ||
| 155 | |||
| 156 | ** Run make | ||
| 157 | |||
| 158 | This will compile Emacs and build the executables, putting them in the src | ||
| 159 | directory: | ||
| 160 | |||
| 161 | make | ||
| 162 | |||
| 163 | To speed up the process, you can try running | ||
| 164 | |||
| 165 | make -jN | ||
| 166 | |||
| 167 | where N is the number of cores in your system -- if your MSYS2 make supports | ||
| 168 | parallel execution it will run significantly faster. | ||
| 169 | |||
| 170 | ** Run make install | ||
| 171 | |||
| 172 | Now you can run "make install", which will copy the executable and | ||
| 173 | other files to the location specified in the configure step. This will | ||
| 174 | create the bin, libexec, share, and var directories: | ||
| 175 | |||
| 176 | make install | ||
| 177 | |||
| 178 | You can also say | ||
| 179 | |||
| 180 | make install prefix=/c/somewhere | ||
| 181 | |||
| 182 | to install them somewhere else. | ||
| 183 | |||
| 184 | * Test Emacs | ||
| 185 | |||
| 186 | To test it out, run | ||
| 187 | |||
| 188 | ./bin/runemacs.exe -Q | ||
| 189 | |||
| 190 | and if all went well, you will have a new 64-bit version of Emacs. | ||
| 191 | |||
| 192 | * Make a shortcut | ||
| 193 | |||
| 194 | To make a shortcut to run the new Emacs, right click on the location where you | ||
| 195 | want to put it, e.g. the Desktop, select New / Shortcut, then select | ||
| 196 | runemacs.exe in the bin folder of the new Emacs, and give it a name. | ||
| 197 | |||
| 198 | You can set any command line options by right clicking on the resulting | ||
| 199 | shortcut, select Properties, then add any options to the Target command, | ||
| 200 | e.g. --debug-init. | ||
| 201 | |||
| 202 | * Credits | ||
| 203 | |||
| 204 | Thanks to Chris Zheng for the original build outline as used by the | ||
| 205 | emacsbinw64 project, located at: | ||
| 206 | |||
| 207 | https://sourceforge.net/p/emacsbinw64/wiki/Build%20guideline%20for%20MSYS2-MinGW-w64%20system/ | ||
| 208 | |||
| 209 | * License | ||
| 210 | |||
| 211 | This file is part of GNU Emacs. | ||
| 212 | |||
| 213 | GNU Emacs is free software: you can redistribute it and/or modify | ||
| 214 | it under the terms of the GNU General Public License as published by | ||
| 215 | the Free Software Foundation, either version 3 of the License, or | ||
| 216 | (at your option) any later version. | ||
| 217 | |||
| 218 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 219 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 220 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 221 | GNU General Public License for more details. | ||
| 222 | |||
| 223 | You should have received a copy of the GNU General Public License | ||
| 224 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index 90683eba7b8..1cf8ae7c5ab 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -4084,31 +4084,11 @@ xg_page_setup_dialog (void) | |||
| 4084 | Lisp_Object | 4084 | Lisp_Object |
| 4085 | xg_get_page_setup (void) | 4085 | xg_get_page_setup (void) |
| 4086 | { | 4086 | { |
| 4087 | Lisp_Object result, orientation_symbol; | ||
| 4088 | GtkPageOrientation orientation; | 4087 | GtkPageOrientation orientation; |
| 4088 | Lisp_Object orientation_symbol; | ||
| 4089 | 4089 | ||
| 4090 | if (page_setup == NULL) | 4090 | if (page_setup == NULL) |
| 4091 | page_setup = gtk_page_setup_new (); | 4091 | page_setup = gtk_page_setup_new (); |
| 4092 | result = list4 (Fcons (Qleft_margin, | ||
| 4093 | make_float (gtk_page_setup_get_left_margin (page_setup, | ||
| 4094 | GTK_UNIT_POINTS))), | ||
| 4095 | Fcons (Qright_margin, | ||
| 4096 | make_float (gtk_page_setup_get_right_margin (page_setup, | ||
| 4097 | GTK_UNIT_POINTS))), | ||
| 4098 | Fcons (Qtop_margin, | ||
| 4099 | make_float (gtk_page_setup_get_top_margin (page_setup, | ||
| 4100 | GTK_UNIT_POINTS))), | ||
| 4101 | Fcons (Qbottom_margin, | ||
| 4102 | make_float (gtk_page_setup_get_bottom_margin (page_setup, | ||
| 4103 | GTK_UNIT_POINTS)))); | ||
| 4104 | result = Fcons (Fcons (Qheight, | ||
| 4105 | make_float (gtk_page_setup_get_page_height (page_setup, | ||
| 4106 | GTK_UNIT_POINTS))), | ||
| 4107 | result); | ||
| 4108 | result = Fcons (Fcons (Qwidth, | ||
| 4109 | make_float (gtk_page_setup_get_page_width (page_setup, | ||
| 4110 | GTK_UNIT_POINTS))), | ||
| 4111 | result); | ||
| 4112 | orientation = gtk_page_setup_get_orientation (page_setup); | 4092 | orientation = gtk_page_setup_get_orientation (page_setup); |
| 4113 | if (orientation == GTK_PAGE_ORIENTATION_PORTRAIT) | 4093 | if (orientation == GTK_PAGE_ORIENTATION_PORTRAIT) |
| 4114 | orientation_symbol = Qportrait; | 4094 | orientation_symbol = Qportrait; |
| @@ -4118,9 +4098,24 @@ xg_get_page_setup (void) | |||
| 4118 | orientation_symbol = Qreverse_portrait; | 4098 | orientation_symbol = Qreverse_portrait; |
| 4119 | else if (orientation == GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE) | 4099 | else if (orientation == GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE) |
| 4120 | orientation_symbol = Qreverse_landscape; | 4100 | orientation_symbol = Qreverse_landscape; |
| 4121 | result = Fcons (Fcons (Qorientation, orientation_symbol), result); | ||
| 4122 | 4101 | ||
| 4123 | return result; | 4102 | return listn (CONSTYPE_HEAP, 7, |
| 4103 | Fcons (Qorientation, orientation_symbol), | ||
| 4104 | #define MAKE_FLOAT_PAGE_SETUP(f) make_float (f (page_setup, GTK_UNIT_POINTS)) | ||
| 4105 | Fcons (Qwidth, | ||
| 4106 | MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_page_width)), | ||
| 4107 | Fcons (Qheight, | ||
| 4108 | MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_page_height)), | ||
| 4109 | Fcons (Qleft_margin, | ||
| 4110 | MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_left_margin)), | ||
| 4111 | Fcons (Qright_margin, | ||
| 4112 | MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_right_margin)), | ||
| 4113 | Fcons (Qtop_margin, | ||
| 4114 | MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_top_margin)), | ||
| 4115 | Fcons (Qbottom_margin, | ||
| 4116 | MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_bottom_margin)) | ||
| 4117 | #undef MAKE_FLOAT_PAGE_SETUP | ||
| 4118 | ); | ||
| 4124 | } | 4119 | } |
| 4125 | 4120 | ||
| 4126 | static void | 4121 | static void |
diff --git a/src/xfns.c b/src/xfns.c index 3f95f7b79fb..d8ba49587f1 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -6564,31 +6564,27 @@ present and mapped to the usual X keysyms. */) | |||
| 6564 | DEFUN ("x-export-frames", Fx_export_frames, Sx_export_frames, 0, 2, 0, | 6564 | DEFUN ("x-export-frames", Fx_export_frames, Sx_export_frames, 0, 2, 0, |
| 6565 | doc: /* Return image data of FRAMES in TYPE format. | 6565 | doc: /* Return image data of FRAMES in TYPE format. |
| 6566 | FRAMES should be nil (the selected frame), a frame, or a list of | 6566 | FRAMES should be nil (the selected frame), a frame, or a list of |
| 6567 | frames (each of which corresponds to one page). Optional arg TYPE | 6567 | frames (each of which corresponds to one page). Each frame should be |
| 6568 | should be either `pdf' (default), `png', `postscript', or `svg'. | 6568 | visible. Optional arg TYPE should be either `pdf' (default), `png', |
| 6569 | Supported types are determined by the compile-time configuration of | 6569 | `postscript', or `svg'. Supported types are determined by the |
| 6570 | cairo. */) | 6570 | compile-time configuration of cairo. */) |
| 6571 | (Lisp_Object frames, Lisp_Object type) | 6571 | (Lisp_Object frames, Lisp_Object type) |
| 6572 | { | 6572 | { |
| 6573 | Lisp_Object result, rest, tmp; | 6573 | Lisp_Object rest, tmp; |
| 6574 | cairo_surface_type_t surface_type; | 6574 | cairo_surface_type_t surface_type; |
| 6575 | 6575 | ||
| 6576 | if (NILP (frames)) | ||
| 6577 | frames = selected_frame; | ||
| 6578 | if (!CONSP (frames)) | 6576 | if (!CONSP (frames)) |
| 6579 | frames = list1 (frames); | 6577 | frames = list1 (frames); |
| 6580 | 6578 | ||
| 6581 | tmp = Qnil; | 6579 | tmp = Qnil; |
| 6582 | for (rest = frames; CONSP (rest); rest = XCDR (rest)) | 6580 | for (rest = frames; CONSP (rest); rest = XCDR (rest)) |
| 6583 | { | 6581 | { |
| 6584 | struct frame *f = XFRAME (XCAR (rest)); | 6582 | struct frame *f = decode_window_system_frame (XCAR (rest)); |
| 6585 | |||
| 6586 | if (! FRAME_LIVE_P (f) || ! FRAME_X_P (f) || ! FRAME_LIVE_P (f)) | ||
| 6587 | error ("Invalid frame"); | ||
| 6588 | |||
| 6589 | Lisp_Object frame; | 6583 | Lisp_Object frame; |
| 6590 | 6584 | ||
| 6591 | XSETFRAME (frame, f); | 6585 | XSETFRAME (frame, f); |
| 6586 | if (!FRAME_VISIBLE_P (f)) | ||
| 6587 | error ("Frames to be exported must be visible."); | ||
| 6592 | tmp = Fcons (frame, tmp); | 6588 | tmp = Fcons (frame, tmp); |
| 6593 | } | 6589 | } |
| 6594 | frames = Fnreverse (tmp); | 6590 | frames = Fnreverse (tmp); |
| @@ -6624,9 +6620,7 @@ cairo. */) | |||
| 6624 | #endif | 6620 | #endif |
| 6625 | error ("Unsupported export type"); | 6621 | error ("Unsupported export type"); |
| 6626 | 6622 | ||
| 6627 | result = x_cr_export_frames (frames, surface_type); | 6623 | return x_cr_export_frames (frames, surface_type); |
| 6628 | |||
| 6629 | return result; | ||
| 6630 | } | 6624 | } |
| 6631 | 6625 | ||
| 6632 | #ifdef USE_GTK | 6626 | #ifdef USE_GTK |
| @@ -6654,8 +6648,12 @@ The return value is an alist containing the following keys: | |||
| 6654 | on, in points. | 6648 | on, in points. |
| 6655 | 6649 | ||
| 6656 | The paper width can be obtained as the sum of width, left-margin, and | 6650 | The paper width can be obtained as the sum of width, left-margin, and |
| 6657 | right-margin values. Likewise, the paper height is the sum of height, | 6651 | right-margin values if the page orientation is `portrait' or |
| 6658 | top-margin, and bottom-margin values. */) | 6652 | `reverse-portrait'. Otherwise, it is the sum of width, top-margin, |
| 6653 | and bottom-margin values. Likewise, the paper height is the sum of | ||
| 6654 | height, top-margin, and bottom-margin values if the page orientation | ||
| 6655 | is `portrait' or `reverse-portrait'. Otherwise, it is the sum of | ||
| 6656 | height, left-margin, and right-margin values. */) | ||
| 6659 | (void) | 6657 | (void) |
| 6660 | { | 6658 | { |
| 6661 | Lisp_Object result; | 6659 | Lisp_Object result; |
| @@ -6675,29 +6673,29 @@ visible. */) | |||
| 6675 | (Lisp_Object frames) | 6673 | (Lisp_Object frames) |
| 6676 | { | 6674 | { |
| 6677 | Lisp_Object rest, tmp; | 6675 | Lisp_Object rest, tmp; |
| 6676 | int count; | ||
| 6678 | 6677 | ||
| 6679 | if (NILP (frames)) | ||
| 6680 | frames = selected_frame; | ||
| 6681 | if (!CONSP (frames)) | 6678 | if (!CONSP (frames)) |
| 6682 | frames = list1 (frames); | 6679 | frames = list1 (frames); |
| 6683 | 6680 | ||
| 6684 | tmp = Qnil; | 6681 | tmp = Qnil; |
| 6685 | for (rest = frames; CONSP (rest); rest = XCDR (rest)) | 6682 | for (rest = frames; CONSP (rest); rest = XCDR (rest)) |
| 6686 | { | 6683 | { |
| 6687 | struct frame *f = XFRAME (XCAR (rest)); | 6684 | struct frame *f = decode_window_system_frame (XCAR (rest)); |
| 6688 | if (! FRAME_LIVE_P (f) || ! FRAME_X_P (f) || ! FRAME_LIVE_P (f)) | ||
| 6689 | error ("Invalid frame"); | ||
| 6690 | Lisp_Object frame; | 6685 | Lisp_Object frame; |
| 6691 | 6686 | ||
| 6692 | XSETFRAME (frame, f); | 6687 | XSETFRAME (frame, f); |
| 6693 | if (!EQ (Fframe_visible_p (frame), Qt)) | 6688 | if (!FRAME_VISIBLE_P (f)) |
| 6694 | error ("Frames to be printed must be visible."); | 6689 | error ("Frames to be printed must be visible."); |
| 6695 | tmp = Fcons (frame, tmp); | 6690 | tmp = Fcons (frame, tmp); |
| 6696 | } | 6691 | } |
| 6697 | frames = Fnreverse (tmp); | 6692 | frames = Fnreverse (tmp); |
| 6698 | 6693 | ||
| 6699 | /* Make sure the current matrices are up-to-date. */ | 6694 | /* Make sure the current matrices are up-to-date. */ |
| 6700 | Fredisplay (Qt); | 6695 | count = SPECPDL_INDEX (); |
| 6696 | specbind (Qredisplay_dont_pause, Qt); | ||
| 6697 | redisplay_preserve_echo_area (32); | ||
| 6698 | unbind_to (count, Qnil); | ||
| 6701 | 6699 | ||
| 6702 | block_input (); | 6700 | block_input (); |
| 6703 | xg_print_frames_dialog (frames); | 6701 | xg_print_frames_dialog (frames); |
diff --git a/src/xterm.c b/src/xterm.c index acb6566d51d..c5c8b5f70fd 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -569,7 +569,8 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type) | |||
| 569 | Lisp_Object acc = Qnil; | 569 | Lisp_Object acc = Qnil; |
| 570 | int count = SPECPDL_INDEX (); | 570 | int count = SPECPDL_INDEX (); |
| 571 | 571 | ||
| 572 | Fredisplay (Qt); | 572 | specbind (Qredisplay_dont_pause, Qt); |
| 573 | redisplay_preserve_echo_area (31); | ||
| 573 | 574 | ||
| 574 | f = XFRAME (XCAR (frames)); | 575 | f = XFRAME (XCAR (frames)); |
| 575 | frames = XCDR (frames); | 576 | frames = XCDR (frames); |
| @@ -611,24 +612,18 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type) | |||
| 611 | cr = cairo_create (surface); | 612 | cr = cairo_create (surface); |
| 612 | cairo_surface_destroy (surface); | 613 | cairo_surface_destroy (surface); |
| 613 | record_unwind_protect (x_cr_destroy, make_save_ptr (cr)); | 614 | record_unwind_protect (x_cr_destroy, make_save_ptr (cr)); |
| 614 | unblock_input (); | ||
| 615 | 615 | ||
| 616 | while (1) | 616 | while (1) |
| 617 | { | 617 | { |
| 618 | QUIT; | ||
| 619 | |||
| 620 | block_input (); | ||
| 621 | x_free_cr_resources (f); | 618 | x_free_cr_resources (f); |
| 622 | FRAME_CR_CONTEXT (f) = cr; | 619 | FRAME_CR_CONTEXT (f) = cr; |
| 623 | x_clear_area (f, 0, 0, width, height); | 620 | x_clear_area (f, 0, 0, width, height); |
| 624 | expose_frame (f, 0, 0, width, height); | 621 | expose_frame (f, 0, 0, width, height); |
| 625 | FRAME_CR_CONTEXT (f) = NULL; | 622 | FRAME_CR_CONTEXT (f) = NULL; |
| 626 | unblock_input (); | ||
| 627 | 623 | ||
| 628 | if (NILP (frames)) | 624 | if (NILP (frames)) |
| 629 | break; | 625 | break; |
| 630 | 626 | ||
| 631 | block_input (); | ||
| 632 | cairo_surface_show_page (surface); | 627 | cairo_surface_show_page (surface); |
| 633 | f = XFRAME (XCAR (frames)); | 628 | f = XFRAME (XCAR (frames)); |
| 634 | frames = XCDR (frames); | 629 | frames = XCDR (frames); |
| @@ -636,18 +631,21 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type) | |||
| 636 | height = FRAME_PIXEL_HEIGHT (f); | 631 | height = FRAME_PIXEL_HEIGHT (f); |
| 637 | if (surface_set_size_func) | 632 | if (surface_set_size_func) |
| 638 | (*surface_set_size_func) (surface, width, height); | 633 | (*surface_set_size_func) (surface, width, height); |
| 634 | |||
| 639 | unblock_input (); | 635 | unblock_input (); |
| 636 | QUIT; | ||
| 637 | block_input (); | ||
| 640 | } | 638 | } |
| 641 | 639 | ||
| 642 | #ifdef CAIRO_HAS_PNG_FUNCTIONS | 640 | #ifdef CAIRO_HAS_PNG_FUNCTIONS |
| 643 | if (surface_type == CAIRO_SURFACE_TYPE_IMAGE) | 641 | if (surface_type == CAIRO_SURFACE_TYPE_IMAGE) |
| 644 | { | 642 | { |
| 645 | block_input (); | ||
| 646 | cairo_surface_flush (surface); | 643 | cairo_surface_flush (surface); |
| 647 | cairo_surface_write_to_png_stream (surface, x_cr_accumulate_data, &acc); | 644 | cairo_surface_write_to_png_stream (surface, x_cr_accumulate_data, &acc); |
| 648 | unblock_input (); | ||
| 649 | } | 645 | } |
| 650 | #endif | 646 | #endif |
| 647 | unblock_input (); | ||
| 648 | |||
| 651 | unbind_to (count, Qnil); | 649 | unbind_to (count, Qnil); |
| 652 | 650 | ||
| 653 | return CALLN (Fapply, intern ("concat"), Fnreverse (acc)); | 651 | return CALLN (Fapply, intern ("concat"), Fnreverse (acc)); |