diff options
| author | Lars Magne Ingebrigtsen | 2015-01-28 14:21:33 +1100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2015-01-28 14:21:33 +1100 |
| commit | 7f4f16b3ae6fdb59d83cfc01017668f2a564309f (patch) | |
| tree | 60e4a7f23f949afaed3bc2fddd0a528aef297861 | |
| parent | 1a369fc7f1ccec6954344ec1ee0211a4d24c312d (diff) | |
| parent | be2d23e58721b7acc68c0ea654a38e5109df2aa2 (diff) | |
| download | emacs-7f4f16b3ae6fdb59d83cfc01017668f2a564309f.tar.gz emacs-7f4f16b3ae6fdb59d83cfc01017668f2a564309f.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
43 files changed, 986 insertions, 543 deletions
| @@ -1,3 +1,17 @@ | |||
| 1 | 2015-01-27 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Port autogen.sh hook creation to private templates | ||
| 4 | * autogen.sh: Do not assume that the hook samples exist. | ||
| 5 | This ports to developers who override templatedir in their Git | ||
| 6 | configuration. The downside is that patch applications won't be | ||
| 7 | checked, but that's better than autogen.sh failing. | ||
| 8 | Problem reported by Sam Steingold in: | ||
| 9 | http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00898.html | ||
| 10 | |||
| 11 | 2015-01-26 Paul Eggert <eggert@cs.ucla.edu> | ||
| 12 | |||
| 13 | * INSTALL.REPO: Mention minimum Git version. | ||
| 14 | |||
| 1 | 2015-01-25 Paul Eggert <eggert@cs.ucla.edu> | 15 | 2015-01-25 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 16 | ||
| 3 | Use gnustep-config if available | 17 | Use gnustep-config if available |
diff --git a/INSTALL.REPO b/INSTALL.REPO index df997fbd285..3431ee480bf 100644 --- a/INSTALL.REPO +++ b/INSTALL.REPO | |||
| @@ -12,6 +12,8 @@ autoconf - at least the version specified near the start of | |||
| 12 | configure.ac (in the AC_PREREQ command). | 12 | configure.ac (in the AC_PREREQ command). |
| 13 | automake - at least the version specified near the start of | 13 | automake - at least the version specified near the start of |
| 14 | configure.ac (in the AM_INIT_AUTOMAKE command). | 14 | configure.ac (in the AM_INIT_AUTOMAKE command). |
| 15 | git - at least Git 1.7.1. If your repository was created by an older | ||
| 16 | Git version, you may need to reclone it. | ||
| 15 | makeinfo - not strictly necessary, but highly recommended, so that | 17 | makeinfo - not strictly necessary, but highly recommended, so that |
| 16 | you can build the manuals. | 18 | you can build the manuals. |
| 17 | 19 | ||
diff --git a/autogen.sh b/autogen.sh index c3ae1d766df..bc9c5a008e0 100755 --- a/autogen.sh +++ b/autogen.sh | |||
| @@ -226,6 +226,7 @@ if test -d .git/hooks; then | |||
| 226 | tailored_hooks="$tailored_hooks $hook" | 226 | tailored_hooks="$tailored_hooks $hook" |
| 227 | done | 227 | done |
| 228 | for hook in applypatch-msg pre-applypatch; do | 228 | for hook in applypatch-msg pre-applypatch; do |
| 229 | test ! -r .git/hooks/$hook.sample || | ||
| 229 | cmp .git/hooks/$hook.sample .git/hooks/$hook >/dev/null 2>&1 || | 230 | cmp .git/hooks/$hook.sample .git/hooks/$hook >/dev/null 2>&1 || |
| 230 | sample_hooks="$sample_hooks $hook" | 231 | sample_hooks="$sample_hooks $hook" |
| 231 | done | 232 | done |
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index a90c58725f8..b7853a7f118 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2015-01-27 Ivan Shmakov <ivan@siamics.net> | ||
| 2 | |||
| 3 | * files.texi (File Archives): Document "I" for tar-new-entry. | ||
| 4 | (Bug#19274) | ||
| 5 | |||
| 1 | 2014-12-31 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2014-12-31 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | Less 'make' chatter for Emacs doc | 8 | Less 'make' chatter for Emacs doc |
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 196c6bb0092..b12b28f9c17 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1689,6 +1689,13 @@ likewise. @kbd{v} extracts a file into a buffer in View mode | |||
| 1689 | another window, so you could edit the file and operate on the archive | 1689 | another window, so you could edit the file and operate on the archive |
| 1690 | simultaneously. | 1690 | simultaneously. |
| 1691 | 1691 | ||
| 1692 | The @kbd{I} key adds a new (regular) file to the archive. The file | ||
| 1693 | is initially empty, but can readily be edited using the commands | ||
| 1694 | above. The command inserts the new file before the current one, so | ||
| 1695 | that using it on the topmost line of the Tar buffer makes the new file | ||
| 1696 | the first one in the archive, and using it at the end of the buffer | ||
| 1697 | makes it the last one. | ||
| 1698 | |||
| 1692 | @kbd{d} marks a file for deletion when you later use @kbd{x}, and | 1699 | @kbd{d} marks a file for deletion when you later use @kbd{x}, and |
| 1693 | @kbd{u} unmarks a file, as in Dired. @kbd{C} copies a file from the | 1700 | @kbd{u} unmarks a file, as in Dired. @kbd{C} copies a file from the |
| 1694 | archive to disk and @kbd{R} renames a file within the archive. | 1701 | archive to disk and @kbd{R} renames a file within the archive. |
diff --git a/etc/ChangeLog b/etc/ChangeLog index 71ecf7fad39..0677e441b83 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2015-01-27 Ivan Shmakov <ivan@siamics.net> | ||
| 2 | |||
| 3 | * NEWS: Mention the new tar-new-entry command. (Bug#19274) | ||
| 4 | |||
| 5 | 2015-01-27 Thomas Fitzsimmons <fitzsim@fitzsim.org> | ||
| 6 | |||
| 7 | * NEWS: Document EUDC improvements. | ||
| 8 | |||
| 1 | 2015-01-26 Lars Ingebrigtsen <larsi@gnus.org> | 9 | 2015-01-26 Lars Ingebrigtsen <larsi@gnus.org> |
| 2 | 10 | ||
| 3 | * publicsuffix.txt: Install an updated version of the file from | 11 | * publicsuffix.txt: Install an updated version of the file from |
| @@ -495,6 +495,42 @@ As a result of the above, these commands are now obsolete: | |||
| 495 | `find-tag-other-window', `find-tag-other-frame', `find-tag-regexp', | 495 | `find-tag-other-window', `find-tag-other-frame', `find-tag-regexp', |
| 496 | `tags-apropos' and `tags-loop-continue'. | 496 | `tags-apropos' and `tags-loop-continue'. |
| 497 | 497 | ||
| 498 | ** EUDC | ||
| 499 | EUDC's LDAP backend has been improved. | ||
| 500 | |||
| 501 | *** EUDC supports LDAP-over-SSL URLs (ldaps://). | ||
| 502 | |||
| 503 | *** EUDC passes LDAP passwords through a pipe to the ldapsearch | ||
| 504 | subprocess instead of on the command line. | ||
| 505 | |||
| 506 | *** EUDC handles LDAP wildcards automatically so the user shouldn't | ||
| 507 | need to configure this manually anymore. | ||
| 508 | |||
| 509 | *** The LDAP configuration section of EUDC's manual has been | ||
| 510 | rewritten. | ||
| 511 | |||
| 512 | There have also been customization changes. | ||
| 513 | |||
| 514 | *** New custom variable `eudc-server-hotlist' to allow specifying | ||
| 515 | multiple EUDC servers in init file. | ||
| 516 | |||
| 517 | *** Custom variable `eudc-inline-query-format' defaults to completing | ||
| 518 | on email and firstname instead of surname. | ||
| 519 | |||
| 520 | *** Custom variable `eudc-expansion-overwrites-query' defaults to nil | ||
| 521 | to avoid interfering with the kill ring. | ||
| 522 | |||
| 523 | *** Custom variable `eudc-inline-expansion-format' defaults to | ||
| 524 | "Firstname Surname <mail-address>". | ||
| 525 | |||
| 526 | *** New custom variable `ldap-ldapsearch-password-prompt-regexp' to | ||
| 527 | allow overriding the regular expression that recognizes the ldapsearch | ||
| 528 | command line's password prompt. | ||
| 529 | |||
| 530 | +++ | ||
| 531 | ** tar-mode: new `tar-new-entry' command, allowing for new members to | ||
| 532 | be added to the archive. | ||
| 533 | |||
| 498 | ** Obsolete packages | 534 | ** Obsolete packages |
| 499 | 535 | ||
| 500 | --- | 536 | --- |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d17dff23a2f..b95424543f8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,87 @@ | |||
| 1 | 2015-01-27 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * emacs-lisp/cl.el (cl--function-convert): | ||
| 4 | Merge cache that cl--labels-convert adds (bug#19699). | ||
| 5 | |||
| 6 | 2015-01-27 Ivan Shmakov <ivan@siamics.net> | ||
| 7 | |||
| 8 | * tar-mode.el: Allow for adding new archive members. (Bug#19274) | ||
| 9 | (tar-new-regular-file-header, tar--pad-to, tar--put-at) | ||
| 10 | (tar-header-serialize): New functions. | ||
| 11 | (tar-current-position): Split from tar-current-descriptor. | ||
| 12 | (tar-current-descriptor): Use it. | ||
| 13 | (tar-new-entry): New command. | ||
| 14 | (tar-mode-map): Bind it. | ||
| 15 | |||
| 16 | 2015-01-27 Sam Steingold <sds@gnu.org> | ||
| 17 | |||
| 18 | * progmodes/python.el (python-check-custom-command): Buffer local | ||
| 19 | because it usually includes the buffer name. | ||
| 20 | (python-check-command): Set to epylint when pyflakes is not available. | ||
| 21 | |||
| 22 | 2015-01-27 Thomas Fitzsimmons <fitzsim@fitzsim.org> | ||
| 23 | |||
| 24 | * net/eudcb-bbdb.el, net/eudcb-ldap.el, net/eudcb-mab.el, | ||
| 25 | net/eudc-bob.el, net/eudcb-ph.el, net/eudc.el, net/eudc-export.el, | ||
| 26 | net/eudc-hotlist.el, net/eudc-vars.el: New maintainer. | ||
| 27 | |||
| 28 | 2015-01-27 Artur Malabarba <bruce.connor.am@gmail.com> | ||
| 29 | |||
| 30 | * isearch.el (isearch-process-search-char): Add docstring. | ||
| 31 | |||
| 32 | 2015-01-27 Oleh Krehel <ohwoeowho@gmail.com> | ||
| 33 | |||
| 34 | * emacs-lisp/derived.el (define-derived-mode): Declare indent 3. | ||
| 35 | |||
| 36 | 2015-01-27 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 37 | |||
| 38 | * emacs-lisp/cl.el (cl--function-convert): Run cl--labels-convert | ||
| 39 | for the case cl-flet or cl-labels form is wrapped with lexical-let | ||
| 40 | (bug#19613). | ||
| 41 | |||
| 42 | 2015-01-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 43 | |||
| 44 | * emacs-lisp/cl-generic.el (cl--generic-method): New struct. | ||
| 45 | (cl--generic): The method-table is now a (list-of cl--generic-method). | ||
| 46 | (cl--generic-member-method): New function. | ||
| 47 | (cl-generic-define-method): Use it. | ||
| 48 | (cl--generic-build-combined-method, cl--generic-cache-miss): | ||
| 49 | Adapt to new method-table. | ||
| 50 | (cl--generic-no-next-method-function): Add `method' argument. | ||
| 51 | (cl-generic-call-method): Adapt to new method representation. | ||
| 52 | (cl--generic-cnm-sample, cl--generic-nnm-sample): Adjust. | ||
| 53 | (cl-find-method, cl-method-qualifiers): New functions. | ||
| 54 | (cl--generic-method-info): Adapt to new method representation. | ||
| 55 | Return a string for the qualifiers. | ||
| 56 | (cl--generic-describe): | ||
| 57 | * emacs-lisp/eieio-opt.el (eieio-help-class): Adjust accordingly. | ||
| 58 | (eieio-all-generic-functions, eieio-method-documentation): | ||
| 59 | Adjust to new method representation. | ||
| 60 | |||
| 61 | * emacs-lisp/eieio-compat.el (eieio--defmethod): Use cl-find-method. | ||
| 62 | |||
| 63 | 2015-01-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 64 | |||
| 65 | * emacs-lisp/cl-generic.el: Add a method-combination hook. | ||
| 66 | (cl-generic-method-combination-function): New var. | ||
| 67 | (cl--generic-lambda): Remove `with-cnm' arg. | ||
| 68 | (cl-defmethod): Change accordingly. | ||
| 69 | (cl-generic-define-method): Don't check qualifiers validity. | ||
| 70 | Preserve all qualifiers in `method-table'. | ||
| 71 | (cl-generic-call-method): New function. | ||
| 72 | (cl--generic-nest): Remove (morph into cl-generic-call-method). | ||
| 73 | (cl--generic-build-combined-method): Adjust to new format of method-table | ||
| 74 | and use cl-generic-method-combination-function. | ||
| 75 | (cl--generic-standard-method-combination): New function, extracted from | ||
| 76 | cl--generic-build-combined-method. | ||
| 77 | (cl--generic-cnm-sample): Adjust to new format of method-table. | ||
| 78 | |||
| 79 | * emacs-lisp/eieio-compat.el (eieio--defmethod): Use () qualifiers | ||
| 80 | instead of :primary. | ||
| 81 | |||
| 82 | * emacs-lisp/eieio-datadebug.el (eieio-debug-methodinvoke): | ||
| 83 | Remove obsolete function. | ||
| 84 | |||
| 1 | 2015-01-26 Lars Ingebrigtsen <larsi@gnus.org> | 85 | 2015-01-26 Lars Ingebrigtsen <larsi@gnus.org> |
| 2 | 86 | ||
| 3 | * net/shr.el (shr-make-table-1): Fix colspan typo. | 87 | * net/shr.el (shr-make-table-1): Fix colspan typo. |
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 02a43514019..1bb70963a57 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el | |||
| @@ -30,11 +30,9 @@ | |||
| 30 | ;; CLOS's define-method-combination is IMO overly complicated, and it suffers | 30 | ;; CLOS's define-method-combination is IMO overly complicated, and it suffers |
| 31 | ;; from a significant problem: the method-combination code returns a sexp | 31 | ;; from a significant problem: the method-combination code returns a sexp |
| 32 | ;; that needs to be `eval'uated or compiled. IOW it requires run-time | 32 | ;; that needs to be `eval'uated or compiled. IOW it requires run-time |
| 33 | ;; code generation. | 33 | ;; code generation. Given how rarely method-combinations are used, |
| 34 | ;; - Method and generic function objects: CLOS defines methods as objects | 34 | ;; I just provided a cl-generic-method-combination-function, which |
| 35 | ;; (same for generic functions), whereas we don't offer such an abstraction. | 35 | ;; people can use if they are really desperate for such functionality. |
| 36 | ;; - `no-next-method' should receive the "calling method" object, but since we | ||
| 37 | ;; don't have such a thing, we pass nil instead. | ||
| 38 | ;; - In defgeneric we don't support the options: | 36 | ;; - In defgeneric we don't support the options: |
| 39 | ;; declare, :method-combination, :generic-function-class, :method-class, | 37 | ;; declare, :method-combination, :generic-function-class, :method-class, |
| 40 | ;; :method. | 38 | ;; :method. |
| @@ -48,6 +46,8 @@ | |||
| 48 | ;; eieio-core adds dispatch on: | 46 | ;; eieio-core adds dispatch on: |
| 49 | ;; - class of eieio objects | 47 | ;; - class of eieio objects |
| 50 | ;; - actual class argument, using the syntax (subclass <class>). | 48 | ;; - actual class argument, using the syntax (subclass <class>). |
| 49 | ;; - cl-generic-method-combination-function (i.s.o define-method-combination). | ||
| 50 | ;; - cl-generic-call-method (which replaces make-method and call-method). | ||
| 51 | 51 | ||
| 52 | ;; Efficiency considerations: overall, I've made an effort to make this fairly | 52 | ;; Efficiency considerations: overall, I've made an effort to make this fairly |
| 53 | ;; efficient for the expected case (e.g. no constant redefinition of methods). | 53 | ;; efficient for the expected case (e.g. no constant redefinition of methods). |
| @@ -101,6 +101,18 @@ that for all other (PRIORITY . TAGCODE) where PRIORITY ≤ N, then | |||
| 101 | "Function to get the list of types that a given \"tag\" matches. | 101 | "Function to get the list of types that a given \"tag\" matches. |
| 102 | They should be sorted from most specific to least specific.") | 102 | They should be sorted from most specific to least specific.") |
| 103 | 103 | ||
| 104 | (cl-defstruct (cl--generic-method | ||
| 105 | (:constructor nil) | ||
| 106 | (:constructor cl--generic-method-make | ||
| 107 | (specializers qualifiers uses-cnm function)) | ||
| 108 | (:predicate nil)) | ||
| 109 | (specializers nil :read-only t :type list) | ||
| 110 | (qualifiers nil :read-only t :type (list-of atom)) | ||
| 111 | ;; USES-CNM is a boolean indicating if FUNCTION expects an extra argument | ||
| 112 | ;; holding the next-method. | ||
| 113 | (uses-cnm nil :read-only t :type boolean) | ||
| 114 | (function nil :read-only t :type function)) | ||
| 115 | |||
| 104 | (cl-defstruct (cl--generic | 116 | (cl-defstruct (cl--generic |
| 105 | (:constructor nil) | 117 | (:constructor nil) |
| 106 | (:constructor cl--generic-make | 118 | (:constructor cl--generic-make |
| @@ -114,12 +126,7 @@ They should be sorted from most specific to least specific.") | |||
| 114 | ;; decide in which order to sort them. | 126 | ;; decide in which order to sort them. |
| 115 | ;; The most important dispatch is last in the list (and the least is first). | 127 | ;; The most important dispatch is last in the list (and the least is first). |
| 116 | (dispatches nil :type (list-of (cons natnum (list-of tagcode)))) | 128 | (dispatches nil :type (list-of (cons natnum (list-of tagcode)))) |
| 117 | ;; `method-table' is a list of | 129 | (method-table nil :type (list-of cl--generic-method))) |
| 118 | ;; ((SPECIALIZERS . QUALIFIER) USES-CNM . FUNCTION), where | ||
| 119 | ;; USES-CNM is a boolean indicating if FUNCTION calls `cl-call-next-method' | ||
| 120 | ;; (and hence expects an extra argument holding the next-method). | ||
| 121 | (method-table nil :type (list-of (cons (cons (list-of type) keyword) | ||
| 122 | (cons boolean function))))) | ||
| 123 | 130 | ||
| 124 | (defmacro cl--generic (name) | 131 | (defmacro cl--generic (name) |
| 125 | `(get ,name 'cl--generic)) | 132 | `(get ,name 'cl--generic)) |
| @@ -232,7 +239,7 @@ This macro can only be used within the lexical scope of a cl-generic method." | |||
| 232 | (and (memq sexp vars) (not (memq sexp res)) (push sexp res)) | 239 | (and (memq sexp vars) (not (memq sexp res)) (push sexp res)) |
| 233 | res)) | 240 | res)) |
| 234 | 241 | ||
| 235 | (defun cl--generic-lambda (args body with-cnm) | 242 | (defun cl--generic-lambda (args body) |
| 236 | "Make the lambda expression for a method with ARGS and BODY." | 243 | "Make the lambda expression for a method with ARGS and BODY." |
| 237 | (let ((plain-args ()) | 244 | (let ((plain-args ()) |
| 238 | (specializers nil) | 245 | (specializers nil) |
| @@ -255,36 +262,34 @@ This macro can only be used within the lexical scope of a cl-generic method." | |||
| 255 | . ,(lambda () specializers)) | 262 | . ,(lambda () specializers)) |
| 256 | macroexpand-all-environment))) | 263 | macroexpand-all-environment))) |
| 257 | (require 'cl-lib) ;Needed to expand `cl-flet' and `cl-function'. | 264 | (require 'cl-lib) ;Needed to expand `cl-flet' and `cl-function'. |
| 258 | (if (not with-cnm) | 265 | ;; First macroexpand away the cl-function stuff (e.g. &key and |
| 259 | (cons nil (macroexpand-all fun macroenv)) | 266 | ;; destructuring args, `declare' and whatnot). |
| 260 | ;; First macroexpand away the cl-function stuff (e.g. &key and | 267 | (pcase (macroexpand fun macroenv) |
| 261 | ;; destructuring args, `declare' and whatnot). | 268 | (`#'(lambda ,args . ,body) |
| 262 | (pcase (macroexpand fun macroenv) | 269 | (let* ((doc-string (and doc-string (stringp (car body)) (cdr body) |
| 263 | (`#'(lambda ,args . ,body) | 270 | (pop body))) |
| 264 | (let* ((doc-string (and doc-string (stringp (car body)) (cdr body) | 271 | (cnm (make-symbol "cl--cnm")) |
| 265 | (pop body))) | 272 | (nmp (make-symbol "cl--nmp")) |
| 266 | (cnm (make-symbol "cl--cnm")) | 273 | (nbody (macroexpand-all |
| 267 | (nmp (make-symbol "cl--nmp")) | 274 | `(cl-flet ((cl-call-next-method ,cnm) |
| 268 | (nbody (macroexpand-all | 275 | (cl-next-method-p ,nmp)) |
| 269 | `(cl-flet ((cl-call-next-method ,cnm) | 276 | ,@body) |
| 270 | (cl-next-method-p ,nmp)) | 277 | macroenv)) |
| 271 | ,@body) | 278 | ;; FIXME: Rather than `grep' after the fact, the |
| 272 | macroenv)) | 279 | ;; macroexpansion should directly set some flag when cnm |
| 273 | ;; FIXME: Rather than `grep' after the fact, the | 280 | ;; is used. |
| 274 | ;; macroexpansion should directly set some flag when cnm | 281 | ;; FIXME: Also, optimize the case where call-next-method is |
| 275 | ;; is used. | 282 | ;; only called with explicit arguments. |
| 276 | ;; FIXME: Also, optimize the case where call-next-method is | 283 | (uses-cnm (cl--generic-fgrep (list cnm nmp) nbody))) |
| 277 | ;; only called with explicit arguments. | 284 | (cons (not (not uses-cnm)) |
| 278 | (uses-cnm (cl--generic-fgrep (list cnm nmp) nbody))) | 285 | `#'(lambda (,@(if uses-cnm (list cnm)) ,@args) |
| 279 | (cons (not (not uses-cnm)) | 286 | ,@(if doc-string (list doc-string)) |
| 280 | `#'(lambda (,@(if uses-cnm (list cnm)) ,@args) | 287 | ,(if (not (memq nmp uses-cnm)) |
| 281 | ,@(if doc-string (list doc-string)) | 288 | nbody |
| 282 | ,(if (not (memq nmp uses-cnm)) | 289 | `(let ((,nmp (lambda () |
| 283 | nbody | 290 | (cl--generic-isnot-nnm-p ,cnm)))) |
| 284 | `(let ((,nmp (lambda () | 291 | ,nbody)))))) |
| 285 | (cl--generic-isnot-nnm-p ,cnm)))) | 292 | (f (error "Unexpected macroexpansion result: %S" f))))))) |
| 286 | ,nbody)))))) | ||
| 287 | (f (error "Unexpected macroexpansion result: %S" f)))))))) | ||
| 288 | 293 | ||
| 289 | 294 | ||
| 290 | ;;;###autoload | 295 | ;;;###autoload |
| @@ -324,8 +329,7 @@ which case this method will be invoked when the argument is `eql' to VAL. | |||
| 324 | (while (not (listp args)) | 329 | (while (not (listp args)) |
| 325 | (push args qualifiers) | 330 | (push args qualifiers) |
| 326 | (setq args (pop body))) | 331 | (setq args (pop body))) |
| 327 | (pcase-let* ((with-cnm (not (memq (car qualifiers) '(:before :after)))) | 332 | (pcase-let* ((`(,uses-cnm . ,fun) (cl--generic-lambda args body))) |
| 328 | (`(,uses-cnm . ,fun) (cl--generic-lambda args body with-cnm))) | ||
| 329 | `(progn | 333 | `(progn |
| 330 | ,(when setfizer | 334 | ,(when setfizer |
| 331 | (setq name (car setfizer)) | 335 | (setq name (car setfizer)) |
| @@ -345,19 +349,25 @@ which case this method will be invoked when the argument is `eql' to VAL. | |||
| 345 | (cl-generic-define-method ',name ',qualifiers ',args | 349 | (cl-generic-define-method ',name ',qualifiers ',args |
| 346 | ,uses-cnm ,fun))))) | 350 | ,uses-cnm ,fun))))) |
| 347 | 351 | ||
| 352 | (defun cl--generic-member-method (specializers qualifiers methods) | ||
| 353 | (while | ||
| 354 | (and methods | ||
| 355 | (let ((m (car methods))) | ||
| 356 | (not (and (equal (cl--generic-method-specializers m) specializers) | ||
| 357 | (equal (cl--generic-method-qualifiers m) qualifiers))))) | ||
| 358 | (setq methods (cdr methods)) | ||
| 359 | methods)) | ||
| 360 | |||
| 348 | ;;;###autoload | 361 | ;;;###autoload |
| 349 | (defun cl-generic-define-method (name qualifiers args uses-cnm function) | 362 | (defun cl-generic-define-method (name qualifiers args uses-cnm function) |
| 350 | (when (> (length qualifiers) 1) | ||
| 351 | (error "We only support a single qualifier per method: %S" qualifiers)) | ||
| 352 | (unless (memq (car qualifiers) '(nil :primary :around :after :before)) | ||
| 353 | (error "Unsupported qualifier in: %S" qualifiers)) | ||
| 354 | (let* ((generic (cl-generic-ensure-function name)) | 363 | (let* ((generic (cl-generic-ensure-function name)) |
| 355 | (mandatory (cl--generic-mandatory-args args)) | 364 | (mandatory (cl--generic-mandatory-args args)) |
| 356 | (specializers | 365 | (specializers |
| 357 | (mapcar (lambda (arg) (if (consp arg) (cadr arg) t)) mandatory)) | 366 | (mapcar (lambda (arg) (if (consp arg) (cadr arg) t)) mandatory)) |
| 358 | (key (cons specializers (or (car qualifiers) ':primary))) | 367 | (method (cl--generic-method-make |
| 368 | specializers qualifiers uses-cnm function)) | ||
| 359 | (mt (cl--generic-method-table generic)) | 369 | (mt (cl--generic-method-table generic)) |
| 360 | (me (assoc key mt)) | 370 | (me (cl--generic-member-method specializers qualifiers mt)) |
| 361 | (dispatches (cl--generic-dispatches generic)) | 371 | (dispatches (cl--generic-dispatches generic)) |
| 362 | (i 0)) | 372 | (i 0)) |
| 363 | (dolist (specializer specializers) | 373 | (dolist (specializer specializers) |
| @@ -372,9 +382,8 @@ which case this method will be invoked when the argument is `eql' to VAL. | |||
| 372 | (nreverse (sort (cons tagcode (cdr x)) | 382 | (nreverse (sort (cons tagcode (cdr x)) |
| 373 | #'car-less-than-car)))) | 383 | #'car-less-than-car)))) |
| 374 | (setq i (1+ i)))) | 384 | (setq i (1+ i)))) |
| 375 | (if me (setcdr me (cons uses-cnm function)) | 385 | (if me (setcar me method) |
| 376 | (setf (cl--generic-method-table generic) | 386 | (setf (cl--generic-method-table generic) (cons method mt))) |
| 377 | (cons `(,key ,uses-cnm . ,function) mt))) | ||
| 378 | (cl-pushnew `(cl-defmethod . (,(cl--generic-name generic) . ,specializers)) | 387 | (cl-pushnew `(cl-defmethod . (,(cl--generic-name generic) . ,specializers)) |
| 379 | current-load-list :test #'equal) | 388 | current-load-list :test #'equal) |
| 380 | (let ((gfun (cl--generic-make-function generic)) | 389 | (let ((gfun (cl--generic-make-function generic)) |
| @@ -438,22 +447,19 @@ which case this method will be invoked when the argument is `eql' to VAL. | |||
| 438 | (cdr dispatch) (car dispatch)))) | 447 | (cdr dispatch) (car dispatch)))) |
| 439 | (funcall dispatcher generic dispatches))))) | 448 | (funcall dispatcher generic dispatches))))) |
| 440 | 449 | ||
| 441 | (defun cl--generic-nest (fun methods) | 450 | (defvar cl-generic-method-combination-function |
| 442 | (pcase-dolist (`(,uses-cnm . ,method) methods) | 451 | #'cl--generic-standard-method-combination |
| 443 | (setq fun | 452 | "Function to build the effective method. |
| 444 | (if (not uses-cnm) method | 453 | Called with 2 arguments: NAME and METHOD-ALIST. |
| 445 | (let ((next fun)) | 454 | It should return an effective method, i.e. a function that expects the same |
| 446 | (lambda (&rest args) | 455 | arguments as the methods, and calls those methods in some appropriate order. |
| 447 | (apply method | 456 | NAME is the name (a symbol) of the corresponding generic function. |
| 448 | ;; FIXME: This sucks: passing just `next' would | 457 | METHOD-ALIST is a list of elements (QUALIFIERS . METHODS) where |
| 449 | ;; be a lot more efficient than the lambda+apply | 458 | QUALIFIERS is a list of qualifiers, and METHODS is a list of the selected |
| 450 | ;; quasi-η, but we need this to implement the | 459 | methods for that qualifier list. |
| 451 | ;; "if call-next-method is called with no | 460 | The METHODS lists are sorted from most generic first to most specific last. |
| 452 | ;; arguments, then use the previous arguments". | 461 | The function can use `cl-generic-call-method' to create functions that call those |
| 453 | (lambda (&rest cnm-args) | 462 | methods.") |
| 454 | (apply next (or cnm-args args))) | ||
| 455 | args)))))) | ||
| 456 | fun) | ||
| 457 | 463 | ||
| 458 | (defvar cl--generic-combined-method-memoization | 464 | (defvar cl--generic-combined-method-memoization |
| 459 | (make-hash-table :test #'equal :weakness 'value) | 465 | (make-hash-table :test #'equal :weakness 'value) |
| @@ -462,54 +468,82 @@ This is particularly useful when many different tags select the same set | |||
| 462 | of methods, since this table then allows us to share a single combined-method | 468 | of methods, since this table then allows us to share a single combined-method |
| 463 | for all those different tags in the method-cache.") | 469 | for all those different tags in the method-cache.") |
| 464 | 470 | ||
| 465 | (defun cl--generic-no-next-method-function (generic) | ||
| 466 | (lambda (&rest args) | ||
| 467 | ;; FIXME: CLOS passes as second arg the "calling method". | ||
| 468 | ;; We don't currently have "method objects" like CLOS | ||
| 469 | ;; does so we can't really do it the CLOS way. | ||
| 470 | ;; The closest would be to pass the lambda corresponding | ||
| 471 | ;; to the method, or maybe the ((SPECIALIZERS | ||
| 472 | ;; . QUALIFIER) USE-CNM . FUNCTION) entry from the method | ||
| 473 | ;; table, but the caller wouldn't be able to do much with | ||
| 474 | ;; it anyway. So we pass nil for now. | ||
| 475 | (apply #'cl-no-next-method generic nil args))) | ||
| 476 | |||
| 477 | (defun cl--generic-build-combined-method (generic-name methods) | 471 | (defun cl--generic-build-combined-method (generic-name methods) |
| 478 | (let ((mets-by-qual ())) | 472 | (cl--generic-with-memoization |
| 479 | (dolist (qm methods) | 473 | (gethash (cons generic-name methods) |
| 480 | (push (cdr qm) (alist-get (cdar qm) mets-by-qual))) | 474 | cl--generic-combined-method-memoization) |
| 481 | (cl--generic-with-memoization | 475 | (let ((mets-by-qual ())) |
| 482 | (gethash (cons generic-name mets-by-qual) | 476 | (dolist (method methods) |
| 483 | cl--generic-combined-method-memoization) | 477 | (let* ((qualifiers (cl--generic-method-qualifiers method)) |
| 484 | (cond | 478 | (x (assoc qualifiers mets-by-qual))) |
| 485 | ((null mets-by-qual) | 479 | ;; FIXME: sadly, alist-get only uses `assq' and we need `assoc'. |
| 486 | (lambda (&rest args) | 480 | ;;(push (cdr qm) (alist-get qualifiers mets-by-qual))) |
| 487 | (apply #'cl-no-applicable-method generic-name args))) | 481 | (if x |
| 488 | ((null (alist-get :primary mets-by-qual)) | 482 | (push method (cdr x)) |
| 489 | (lambda (&rest args) | 483 | (push (list qualifiers method) mets-by-qual)))) |
| 490 | (apply #'cl-no-primary-method generic-name args))) | 484 | (funcall cl-generic-method-combination-function |
| 491 | (t | 485 | generic-name mets-by-qual)))) |
| 492 | (let* ((fun (cl--generic-no-next-method-function generic-name)) | 486 | |
| 493 | ;; We use `cdr' to drop the `uses-cnm' annotations. | 487 | (defun cl--generic-no-next-method-function (generic method) |
| 494 | (before | 488 | (lambda (&rest args) |
| 495 | (mapcar #'cdr (reverse (alist-get :before mets-by-qual)))) | 489 | (apply #'cl-no-next-method generic method args))) |
| 496 | (after (mapcar #'cdr (alist-get :after mets-by-qual)))) | 490 | |
| 497 | (setq fun (cl--generic-nest fun (alist-get :primary mets-by-qual))) | 491 | (defun cl-generic-call-method (generic-name method &optional fun) |
| 498 | (when (or after before) | 492 | "Return a function that calls METHOD. |
| 499 | (let ((next fun)) | 493 | FUN is the function that should be called when METHOD calls |
| 500 | (setq fun (lambda (&rest args) | 494 | `call-next-method'." |
| 501 | (dolist (bf before) | 495 | (if (not (cl--generic-method-uses-cnm method)) |
| 502 | (apply bf args)) | 496 | (cl--generic-method-function method) |
| 503 | (prog1 | 497 | (let ((met-fun (cl--generic-method-function method)) |
| 504 | (apply next args) | 498 | (next (or fun (cl--generic-no-next-method-function |
| 505 | (dolist (af after) | 499 | generic-name method)))) |
| 506 | (apply af args))))))) | 500 | (lambda (&rest args) |
| 507 | (cl--generic-nest fun (alist-get :around mets-by-qual)))))))) | 501 | (apply met-fun |
| 508 | 502 | ;; FIXME: This sucks: passing just `next' would | |
| 509 | (defconst cl--generic-nnm-sample (cl--generic-no-next-method-function 'dummy)) | 503 | ;; be a lot more efficient than the lambda+apply |
| 504 | ;; quasi-η, but we need this to implement the | ||
| 505 | ;; "if call-next-method is called with no | ||
| 506 | ;; arguments, then use the previous arguments". | ||
| 507 | (lambda (&rest cnm-args) | ||
| 508 | (apply next (or cnm-args args))) | ||
| 509 | args))))) | ||
| 510 | |||
| 511 | (defun cl--generic-standard-method-combination (generic-name mets-by-qual) | ||
| 512 | (dolist (x mets-by-qual) | ||
| 513 | (unless (member (car x) '(() (:after) (:before) (:around))) | ||
| 514 | (error "Unsupported qualifiers in function %S: %S" generic-name (car x)))) | ||
| 515 | (cond | ||
| 516 | ((null mets-by-qual) | ||
| 517 | (lambda (&rest args) | ||
| 518 | (apply #'cl-no-applicable-method generic-name args))) | ||
| 519 | ((null (alist-get nil mets-by-qual)) | ||
| 520 | (lambda (&rest args) | ||
| 521 | (apply #'cl-no-primary-method generic-name args))) | ||
| 522 | (t | ||
| 523 | (let* ((fun nil) | ||
| 524 | (ab-call (lambda (m) (cl-generic-call-method generic-name m))) | ||
| 525 | (before | ||
| 526 | (mapcar ab-call (reverse (cdr (assoc '(:before) mets-by-qual))))) | ||
| 527 | (after (mapcar ab-call (cdr (assoc '(:after) mets-by-qual))))) | ||
| 528 | (dolist (method (cdr (assoc nil mets-by-qual))) | ||
| 529 | (setq fun (cl-generic-call-method generic-name method fun))) | ||
| 530 | (when (or after before) | ||
| 531 | (let ((next fun)) | ||
| 532 | (setq fun (lambda (&rest args) | ||
| 533 | (dolist (bf before) | ||
| 534 | (apply bf args)) | ||
| 535 | (prog1 | ||
| 536 | (apply next args) | ||
| 537 | (dolist (af after) | ||
| 538 | (apply af args))))))) | ||
| 539 | (dolist (method (cdr (assoc '(:around) mets-by-qual))) | ||
| 540 | (setq fun (cl-generic-call-method generic-name method fun))) | ||
| 541 | fun)))) | ||
| 542 | |||
| 543 | (defconst cl--generic-nnm-sample (cl--generic-no-next-method-function t t)) | ||
| 510 | (defconst cl--generic-cnm-sample | 544 | (defconst cl--generic-cnm-sample |
| 511 | (funcall (cl--generic-build-combined-method | 545 | (funcall (cl--generic-build-combined-method |
| 512 | nil `(((specializer . :primary) t . ,#'identity))))) | 546 | nil (list (cl--generic-method-make () () t #'identity))))) |
| 513 | 547 | ||
| 514 | (defun cl--generic-isnot-nnm-p (cnm) | 548 | (defun cl--generic-isnot-nnm-p (cnm) |
| 515 | "Return non-nil if CNM is the function that calls `cl-no-next-method'." | 549 | "Return non-nil if CNM is the function that calls `cl-no-next-method'." |
| @@ -540,11 +574,13 @@ for all those different tags in the method-cache.") | |||
| 540 | (defun cl--generic-cache-miss (generic dispatch-arg dispatches-left tags) | 574 | (defun cl--generic-cache-miss (generic dispatch-arg dispatches-left tags) |
| 541 | (let ((types (apply #'append (mapcar cl-generic-tag-types-function tags))) | 575 | (let ((types (apply #'append (mapcar cl-generic-tag-types-function tags))) |
| 542 | (methods '())) | 576 | (methods '())) |
| 543 | (dolist (method-desc (cl--generic-method-table generic)) | 577 | (dolist (method (cl--generic-method-table generic)) |
| 544 | (let* ((specializer (or (nth dispatch-arg (caar method-desc)) t)) | 578 | (let* ((specializer (or (nth dispatch-arg |
| 579 | (cl--generic-method-specializers method)) | ||
| 580 | t)) | ||
| 545 | (m (member specializer types))) | 581 | (m (member specializer types))) |
| 546 | (when m | 582 | (when m |
| 547 | (push (cons (length m) method-desc) methods)))) | 583 | (push (cons (length m) method) methods)))) |
| 548 | ;; Sort the methods, most specific first. | 584 | ;; Sort the methods, most specific first. |
| 549 | ;; It would be tempting to sort them once and for all in the method-table | 585 | ;; It would be tempting to sort them once and for all in the method-table |
| 550 | ;; rather than here, but the order might depend on the actual argument | 586 | ;; rather than here, but the order might depend on the actual argument |
| @@ -587,6 +623,14 @@ Can only be used from within the lexical body of a primary or around method." | |||
| 587 | (declare (obsolete "make sure there's always a next method, or catch `cl-no-next-method' instead" "25.1")) | 623 | (declare (obsolete "make sure there's always a next method, or catch `cl-no-next-method' instead" "25.1")) |
| 588 | (error "cl-next-method-p only allowed inside primary and around methods")) | 624 | (error "cl-next-method-p only allowed inside primary and around methods")) |
| 589 | 625 | ||
| 626 | ;;;###autoload | ||
| 627 | (defun cl-find-method (generic qualifiers specializers) | ||
| 628 | (car (cl--generic-member-method | ||
| 629 | specializers qualifiers | ||
| 630 | (cl--generic-method-table (cl--generic generic))))) | ||
| 631 | |||
| 632 | (defalias 'cl-method-qualifiers 'cl--generic-method-qualifiers) | ||
| 633 | |||
| 590 | ;;; Add support for describe-function | 634 | ;;; Add support for describe-function |
| 591 | 635 | ||
| 592 | (defun cl--generic-search-method (met-name) | 636 | (defun cl--generic-search-method (met-name) |
| @@ -611,22 +655,30 @@ Can only be used from within the lexical body of a primary or around method." | |||
| 611 | `(cl-defmethod . ,#'cl--generic-search-method))) | 655 | `(cl-defmethod . ,#'cl--generic-search-method))) |
| 612 | 656 | ||
| 613 | (defun cl--generic-method-info (method) | 657 | (defun cl--generic-method-info (method) |
| 614 | (pcase-let ((`((,specializers . ,qualifier) ,uses-cnm . ,function) method)) | 658 | (let* ((specializers (cl--generic-method-specializers method)) |
| 615 | (let* ((args (help-function-arglist function 'names)) | 659 | (qualifiers (cl--generic-method-qualifiers method)) |
| 616 | (docstring (documentation function)) | 660 | (uses-cnm (cl--generic-method-uses-cnm method)) |
| 617 | (doconly (if docstring | 661 | (function (cl--generic-method-function method)) |
| 618 | (let ((split (help-split-fundoc docstring nil))) | 662 | (args (help-function-arglist function 'names)) |
| 619 | (if split (cdr split) docstring)))) | 663 | (docstring (documentation function)) |
| 620 | (combined-args ())) | 664 | (qual-string |
| 621 | (if uses-cnm (setq args (cdr args))) | 665 | (if (null qualifiers) "" |
| 622 | (dolist (specializer specializers) | 666 | (cl-assert (consp qualifiers)) |
| 623 | (let ((arg (if (eq '&rest (car args)) | 667 | (let ((s (prin1-to-string qualifiers))) |
| 624 | (intern (format "arg%d" (length combined-args))) | 668 | (concat (substring s 1 -1) " ")))) |
| 625 | (pop args)))) | 669 | (doconly (if docstring |
| 626 | (push (if (eq specializer t) arg (list arg specializer)) | 670 | (let ((split (help-split-fundoc docstring nil))) |
| 627 | combined-args))) | 671 | (if split (cdr split) docstring)))) |
| 628 | (setq combined-args (append (nreverse combined-args) args)) | 672 | (combined-args ())) |
| 629 | (list qualifier combined-args doconly)))) | 673 | (if uses-cnm (setq args (cdr args))) |
| 674 | (dolist (specializer specializers) | ||
| 675 | (let ((arg (if (eq '&rest (car args)) | ||
| 676 | (intern (format "arg%d" (length combined-args))) | ||
| 677 | (pop args)))) | ||
| 678 | (push (if (eq specializer t) arg (list arg specializer)) | ||
| 679 | combined-args))) | ||
| 680 | (setq combined-args (append (nreverse combined-args) args)) | ||
| 681 | (list qual-string combined-args doconly))) | ||
| 630 | 682 | ||
| 631 | (add-hook 'help-fns-describe-function-functions #'cl--generic-describe) | 683 | (add-hook 'help-fns-describe-function-functions #'cl--generic-describe) |
| 632 | (defun cl--generic-describe (function) | 684 | (defun cl--generic-describe (function) |
| @@ -640,8 +692,9 @@ Can only be used from within the lexical body of a primary or around method." | |||
| 640 | (dolist (method (cl--generic-method-table generic)) | 692 | (dolist (method (cl--generic-method-table generic)) |
| 641 | (let* ((info (cl--generic-method-info method))) | 693 | (let* ((info (cl--generic-method-info method))) |
| 642 | ;; FIXME: Add hyperlinks for the types as well. | 694 | ;; FIXME: Add hyperlinks for the types as well. |
| 643 | (insert (format "%S %S" (nth 0 info) (nth 1 info))) | 695 | (insert (format "%s%S" (nth 0 info) (nth 1 info))) |
| 644 | (let* ((met-name (cons function (caar method))) | 696 | (let* ((met-name (cons function |
| 697 | (cl--generic-method-specializers method))) | ||
| 645 | (file (find-lisp-object-file-name met-name 'cl-defmethod))) | 698 | (file (find-lisp-object-file-name met-name 'cl-defmethod))) |
| 646 | (when file | 699 | (when file |
| 647 | (insert " in `") | 700 | (insert " in `") |
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index da3eab73fc4..1b204631fb8 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el | |||
| @@ -342,6 +342,8 @@ The two cases that are handled are: | |||
| 342 | - renaming of F when it's a function defined via `cl-labels' or `labels'." | 342 | - renaming of F when it's a function defined via `cl-labels' or `labels'." |
| 343 | (require 'cl-macs) | 343 | (require 'cl-macs) |
| 344 | (declare-function cl--expr-contains-any "cl-macs" (x y)) | 344 | (declare-function cl--expr-contains-any "cl-macs" (x y)) |
| 345 | (declare-function cl--labels-convert "cl-macs" (f)) | ||
| 346 | (defvar cl--labels-convert-cache) | ||
| 345 | (cond | 347 | (cond |
| 346 | ;; ¡¡Big Ugly Hack!! We can't use a compiler-macro because those are checked | 348 | ;; ¡¡Big Ugly Hack!! We can't use a compiler-macro because those are checked |
| 347 | ;; *after* handling `function', but we want to stop macroexpansion from | 349 | ;; *after* handling `function', but we want to stop macroexpansion from |
| @@ -374,13 +376,10 @@ The two cases that are handled are: | |||
| 374 | (setq cl--function-convert-cache (cons newf res)) | 376 | (setq cl--function-convert-cache (cons newf res)) |
| 375 | res)))) | 377 | res)))) |
| 376 | (t | 378 | (t |
| 377 | (let ((found (assq f macroexpand-all-environment))) | 379 | (setq cl--labels-convert-cache cl--function-convert-cache) |
| 378 | (if (and found (ignore-errors | 380 | (prog1 |
| 379 | (eq (cadr (cl-caddr found)) 'cl-labels-args))) | 381 | (cl--labels-convert f) |
| 380 | (cadr (cl-caddr (cl-cadddr found))) | 382 | (setq cl--function-convert-cache cl--labels-convert-cache))))) |
| 381 | (let ((res `(function ,f))) | ||
| 382 | (setq cl--function-convert-cache (cons f res)) | ||
| 383 | res)))))) | ||
| 384 | 383 | ||
| 385 | (defmacro lexical-let (bindings &rest body) | 384 | (defmacro lexical-let (bindings &rest body) |
| 386 | "Like `let', but lexically scoped. | 385 | "Like `let', but lexically scoped. |
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index a250ea60d21..52da4c99eaf 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el | |||
| @@ -162,7 +162,8 @@ The new mode runs the hook constructed by the function | |||
| 162 | See Info node `(elisp)Derived Modes' for more details." | 162 | See Info node `(elisp)Derived Modes' for more details." |
| 163 | (declare (debug (&define name symbolp sexp [&optional stringp] | 163 | (declare (debug (&define name symbolp sexp [&optional stringp] |
| 164 | [&rest keywordp sexp] def-body)) | 164 | [&rest keywordp sexp] def-body)) |
| 165 | (doc-string 4)) | 165 | (doc-string 4) |
| 166 | (indent 3)) | ||
| 166 | 167 | ||
| 167 | (when (and docstring (not (stringp docstring))) | 168 | (when (and docstring (not (stringp docstring))) |
| 168 | ;; Some trickiness, since what appears to be the docstring may really be | 169 | ;; Some trickiness, since what appears to be the docstring may really be |
diff --git a/lisp/emacs-lisp/eieio-compat.el b/lisp/emacs-lisp/eieio-compat.el index c2dabf7f446..fcca99d79d5 100644 --- a/lisp/emacs-lisp/eieio-compat.el +++ b/lisp/emacs-lisp/eieio-compat.el | |||
| @@ -181,7 +181,8 @@ Summary: | |||
| 181 | (lambda (generic arg &rest args) (apply code arg generic args))) | 181 | (lambda (generic arg &rest args) (apply code arg generic args))) |
| 182 | (_ code)))) | 182 | (_ code)))) |
| 183 | (cl-generic-define-method | 183 | (cl-generic-define-method |
| 184 | method (if kind (list kind)) specializers uses-cnm | 184 | method (unless (memq kind '(nil :primary)) (list kind)) |
| 185 | specializers uses-cnm | ||
| 185 | (if uses-cnm | 186 | (if uses-cnm |
| 186 | (let* ((docstring (documentation code 'raw)) | 187 | (let* ((docstring (documentation code 'raw)) |
| 187 | (args (help-function-arglist code 'preserve-names)) | 188 | (args (help-function-arglist code 'preserve-names)) |
| @@ -201,11 +202,11 @@ Summary: | |||
| 201 | ;; applicable but only of the before/after kind. So if we add a :before | 202 | ;; applicable but only of the before/after kind. So if we add a :before |
| 202 | ;; or :after, make sure there's a matching dummy primary. | 203 | ;; or :after, make sure there's a matching dummy primary. |
| 203 | (when (and (memq kind '(:before :after)) | 204 | (when (and (memq kind '(:before :after)) |
| 204 | (not (assoc (cons (mapcar (lambda (arg) | 205 | ;; FIXME: Use `cl-find-method'? |
| 205 | (if (consp arg) (nth 1 arg) t)) | 206 | (not (cl-find-method method () |
| 206 | specializers) | 207 | (mapcar (lambda (arg) |
| 207 | :primary) | 208 | (if (consp arg) (nth 1 arg) t)) |
| 208 | (cl--generic-method-table (cl--generic method))))) | 209 | specializers)))) |
| 209 | (cl-generic-define-method method () specializers t | 210 | (cl-generic-define-method method () specializers t |
| 210 | (lambda (cnm &rest args) | 211 | (lambda (cnm &rest args) |
| 211 | (if (cl--generic-isnot-nnm-p cnm) | 212 | (if (cl--generic-isnot-nnm-p cnm) |
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 261138bfbf8..7492f0522ab 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el | |||
| @@ -1258,7 +1258,7 @@ method invocation orders of the involved classes." | |||
| 1258 | (eieio--class-precedence-list tag)))) | 1258 | (eieio--class-precedence-list tag)))) |
| 1259 | 1259 | ||
| 1260 | 1260 | ||
| 1261 | ;;;### (autoloads nil "eieio-compat" "eieio-compat.el" "57805f02023795a01567781e70aaf9f9") | 1261 | ;;;### (autoloads nil "eieio-compat" "eieio-compat.el" "b568ffb3c90ed5d0ae673f0051d608ee") |
| 1262 | ;;; Generated autoloads from eieio-compat.el | 1262 | ;;; Generated autoloads from eieio-compat.el |
| 1263 | 1263 | ||
| 1264 | (autoload 'eieio--defalias "eieio-compat" "\ | 1264 | (autoload 'eieio--defalias "eieio-compat" "\ |
diff --git a/lisp/emacs-lisp/eieio-datadebug.el b/lisp/emacs-lisp/eieio-datadebug.el index 6534bd0fecf..119f7cce038 100644 --- a/lisp/emacs-lisp/eieio-datadebug.el +++ b/lisp/emacs-lisp/eieio-datadebug.el | |||
| @@ -129,22 +129,6 @@ PREBUTTONTEXT is some text between PREFIX and the object button." | |||
| 129 | (data-debug-new-buffer (format "*%s DDEBUG*" (eieio-object-name obj))) | 129 | (data-debug-new-buffer (format "*%s DDEBUG*" (eieio-object-name obj))) |
| 130 | (data-debug-insert-object-slots obj "]")) | 130 | (data-debug-insert-object-slots obj "]")) |
| 131 | 131 | ||
| 132 | ;;; DEBUG FUNCTIONS | ||
| 133 | ;; | ||
| 134 | (defun eieio-debug-methodinvoke (method class) | ||
| 135 | "Show the method invocation order for METHOD with CLASS object." | ||
| 136 | (interactive "aMethod: \nXClass Expression: ") | ||
| 137 | (let* ((eieio-pre-method-execution-functions | ||
| 138 | (lambda (l) (throw 'moose l) )) | ||
| 139 | (data | ||
| 140 | (catch 'moose (eieio--generic-call | ||
| 141 | method (list class)))) | ||
| 142 | (_buf (data-debug-new-buffer "*Method Invocation*")) | ||
| 143 | (data2 (mapcar (lambda (sym) | ||
| 144 | (symbol-function (car sym))) | ||
| 145 | data))) | ||
| 146 | (data-debug-insert-thing data2 ">" ""))) | ||
| 147 | |||
| 148 | (provide 'eieio-datadebug) | 132 | (provide 'eieio-datadebug) |
| 149 | 133 | ||
| 150 | ;;; eieio-datadebug.el ends here | 134 | ;;; eieio-datadebug.el ends here |
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el index a131b02ee16..8d40edf5624 100644 --- a/lisp/emacs-lisp/eieio-opt.el +++ b/lisp/emacs-lisp/eieio-opt.el | |||
| @@ -129,9 +129,9 @@ If CLASS is actually an object, then also display current values of that object. | |||
| 129 | (insert "`") | 129 | (insert "`") |
| 130 | (help-insert-xref-button (symbol-name generic) 'help-function generic) | 130 | (help-insert-xref-button (symbol-name generic) 'help-function generic) |
| 131 | (insert "'") | 131 | (insert "'") |
| 132 | (pcase-dolist (`(,qualifier ,args ,doc) | 132 | (pcase-dolist (`(,qualifiers ,args ,doc) |
| 133 | (eieio-method-documentation generic class)) | 133 | (eieio-method-documentation generic class)) |
| 134 | (insert (format " %S %S\n" qualifier args) | 134 | (insert (format " %s%S\n" qualifiers args) |
| 135 | (or doc ""))) | 135 | (or doc ""))) |
| 136 | (insert "\n\n"))))) | 136 | (insert "\n\n"))))) |
| 137 | 137 | ||
| @@ -325,10 +325,9 @@ methods for CLASS." | |||
| 325 | (and generic | 325 | (and generic |
| 326 | (catch 'found | 326 | (catch 'found |
| 327 | (if (null class) (throw 'found t)) | 327 | (if (null class) (throw 'found t)) |
| 328 | (pcase-dolist (`((,specializers . ,_qualifier) . ,_) | 328 | (dolist (method (cl--generic-method-table generic)) |
| 329 | (cl--generic-method-table generic)) | ||
| 330 | (if (eieio--specializers-apply-to-class-p | 329 | (if (eieio--specializers-apply-to-class-p |
| 331 | specializers class) | 330 | (cl--generic-method-specializers method) class) |
| 332 | (throw 'found t)))) | 331 | (throw 'found t)))) |
| 333 | (push symbol l))))) | 332 | (push symbol l))))) |
| 334 | l)) | 333 | l)) |
| @@ -336,15 +335,14 @@ methods for CLASS." | |||
| 336 | (defun eieio-method-documentation (generic class) | 335 | (defun eieio-method-documentation (generic class) |
| 337 | "Return info for all methods of GENERIC applicable to CLASS. | 336 | "Return info for all methods of GENERIC applicable to CLASS. |
| 338 | The value returned is a list of elements of the form | 337 | The value returned is a list of elements of the form |
| 339 | \(QUALIFIER ARGS DOC)." | 338 | \(QUALIFIERS ARGS DOC)." |
| 340 | (let ((generic (cl--generic generic)) | 339 | (let ((generic (cl--generic generic)) |
| 341 | (docs ())) | 340 | (docs ())) |
| 342 | (when generic | 341 | (when generic |
| 343 | (dolist (method (cl--generic-method-table generic)) | 342 | (dolist (method (cl--generic-method-table generic)) |
| 344 | (pcase-let ((`((,specializers . ,_qualifier) . ,_) method)) | 343 | (when (eieio--specializers-apply-to-class-p |
| 345 | (when (eieio--specializers-apply-to-class-p | 344 | (cl--generic-method-specializers method) class) |
| 346 | specializers class) | 345 | (push (cl--generic-method-info method) docs)))) |
| 347 | (push (cl--generic-method-info method) docs))))) | ||
| 348 | docs)) | 346 | docs)) |
| 349 | 347 | ||
| 350 | ;;; METHOD STATS | 348 | ;;; METHOD STATS |
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 3dba8e0e7bf..91469b4b96c 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el | |||
| @@ -942,7 +942,7 @@ Optional argument GROUP is the sub-group of slots to display. | |||
| 942 | 942 | ||
| 943 | ;;;*** | 943 | ;;;*** |
| 944 | 944 | ||
| 945 | ;;;### (autoloads nil "eieio-opt" "eieio-opt.el" "d7b8682e15aebad7dbe6384dc5ed655f") | 945 | ;;;### (autoloads nil "eieio-opt" "eieio-opt.el" "b849f8bf1312d5ef57e53d02173e4b5a") |
| 946 | ;;; Generated autoloads from eieio-opt.el | 946 | ;;; Generated autoloads from eieio-opt.el |
| 947 | 947 | ||
| 948 | (autoload 'eieio-browse "eieio-opt" "\ | 948 | (autoload 'eieio-browse "eieio-opt" "\ |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 7ef526b4253..7bf4a6e01d6 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,23 @@ | |||
| 1 | 2015-01-27 Lars Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * nnir.el (nnir-imap-expr-to-imap): Check for literal+ capability in | ||
| 4 | IMAP. | ||
| 5 | |||
| 6 | 2015-01-27 Eric Abrahamsen <eric@ericabrahamsen.net> | ||
| 7 | |||
| 8 | * nnir.el (nnir-run-imap): Enable non-ASCII IMAP searches. | ||
| 9 | |||
| 10 | * nnmairix.el ("nnmairix"): Declare nnmairix as virtual. | ||
| 11 | |||
| 12 | * gnus-bcklg.el (gnus-backlog-enter-article): No virtual groups should | ||
| 13 | be added to the backlog. | ||
| 14 | |||
| 15 | 2015-01-26 Trevor Murphy <trevor.m.murphy@gmail.com> | ||
| 16 | |||
| 17 | * nnimap.el (nnimap-header-parameters): Refactor and request | ||
| 18 | X-GM-LABELS if it's been announced. | ||
| 19 | (nnimap-transform-headers): Gather and output GM-LABELS. | ||
| 20 | |||
| 1 | 2015-01-26 Peder O. Klingenberg <peder@klingenberg.no> | 21 | 2015-01-26 Peder O. Klingenberg <peder@klingenberg.no> |
| 2 | 22 | ||
| 3 | * mm-decode.el (mm-display-part): Make non-string methods work. | 23 | * mm-decode.el (mm-display-part): Make non-string methods work. |
diff --git a/lisp/gnus/gnus-bcklg.el b/lisp/gnus/gnus-bcklg.el index b26f367a79b..e0c457a8829 100644 --- a/lisp/gnus/gnus-bcklg.el +++ b/lisp/gnus/gnus-bcklg.el | |||
| @@ -61,7 +61,7 @@ | |||
| 61 | 61 | ||
| 62 | (defun gnus-backlog-enter-article (group number buffer) | 62 | (defun gnus-backlog-enter-article (group number buffer) |
| 63 | (when (and (numberp number) | 63 | (when (and (numberp number) |
| 64 | (not (string-match "^nnvirtual" group))) | 64 | (not (gnus-virtual-group-p group))) |
| 65 | (gnus-backlog-setup) | 65 | (gnus-backlog-setup) |
| 66 | (let ((ident (intern (concat group ":" (int-to-string number)) | 66 | (let ((ident (intern (concat group ":" (int-to-string number)) |
| 67 | gnus-backlog-hashtb)) | 67 | gnus-backlog-hashtb)) |
| @@ -126,7 +126,7 @@ | |||
| 126 | 126 | ||
| 127 | (defun gnus-backlog-request-article (group number &optional buffer) | 127 | (defun gnus-backlog-request-article (group number &optional buffer) |
| 128 | (when (and (numberp number) | 128 | (when (and (numberp number) |
| 129 | (not (string-match "^nnvirtual" group))) | 129 | (not (gnus-virtual-group-p group))) |
| 130 | (gnus-backlog-setup) | 130 | (gnus-backlog-setup) |
| 131 | (let ((ident (intern (concat group ":" (int-to-string number)) | 131 | (let ((ident (intern (concat group ":" (int-to-string number)) |
| 132 | gnus-backlog-hashtb)) | 132 | gnus-backlog-hashtb)) |
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index ced55619881..8e81abcf9c0 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -166,14 +166,21 @@ textual parts.") | |||
| 166 | (nnimap-find-process-buffer nntp-server-buffer)) | 166 | (nnimap-find-process-buffer nntp-server-buffer)) |
| 167 | 167 | ||
| 168 | (defun nnimap-header-parameters () | 168 | (defun nnimap-header-parameters () |
| 169 | (format "(UID RFC822.SIZE BODYSTRUCTURE %s)" | 169 | (let (params) |
| 170 | (format | 170 | (push "UID" params) |
| 171 | (push "RFC822.SIZE" params) | ||
| 172 | (when (nnimap-capability "X-GM-EXT-1") | ||
| 173 | (push "X-GM-LABELS" params)) | ||
| 174 | (push "BODYSTRUCTURE" params) | ||
| 175 | (push (format | ||
| 171 | (if (nnimap-ver4-p) | 176 | (if (nnimap-ver4-p) |
| 172 | "BODY.PEEK[HEADER.FIELDS %s]" | 177 | "BODY.PEEK[HEADER.FIELDS %s]" |
| 173 | "RFC822.HEADER.LINES %s") | 178 | "RFC822.HEADER.LINES %s") |
| 174 | (append '(Subject From Date Message-Id | 179 | (append '(Subject From Date Message-Id |
| 175 | References In-Reply-To Xref) | 180 | References In-Reply-To Xref) |
| 176 | nnmail-extra-headers)))) | 181 | nnmail-extra-headers)) |
| 182 | params) | ||
| 183 | (format "%s" (nreverse params)))) | ||
| 177 | 184 | ||
| 178 | (deffoo nnimap-retrieve-headers (articles &optional group server fetch-old) | 185 | (deffoo nnimap-retrieve-headers (articles &optional group server fetch-old) |
| 179 | (when group | 186 | (when group |
| @@ -197,7 +204,7 @@ textual parts.") | |||
| 197 | 204 | ||
| 198 | (defun nnimap-transform-headers () | 205 | (defun nnimap-transform-headers () |
| 199 | (goto-char (point-min)) | 206 | (goto-char (point-min)) |
| 200 | (let (article lines size string) | 207 | (let (article lines size string labels) |
| 201 | (block nil | 208 | (block nil |
| 202 | (while (not (eobp)) | 209 | (while (not (eobp)) |
| 203 | (while (not (looking-at "\\* [0-9]+ FETCH")) | 210 | (while (not (looking-at "\\* [0-9]+ FETCH")) |
| @@ -232,6 +239,9 @@ textual parts.") | |||
| 232 | t) | 239 | t) |
| 233 | (match-string 1))) | 240 | (match-string 1))) |
| 234 | (beginning-of-line) | 241 | (beginning-of-line) |
| 242 | (when (search-forward "X-GM-LABELS" (line-end-position) t) | ||
| 243 | (setq labels (ignore-errors (read (current-buffer))))) | ||
| 244 | (beginning-of-line) | ||
| 235 | (when (search-forward "BODYSTRUCTURE" (line-end-position) t) | 245 | (when (search-forward "BODYSTRUCTURE" (line-end-position) t) |
| 236 | (let ((structure (ignore-errors | 246 | (let ((structure (ignore-errors |
| 237 | (read (current-buffer))))) | 247 | (read (current-buffer))))) |
| @@ -251,6 +261,8 @@ textual parts.") | |||
| 251 | (insert (format "Chars: %s\n" size))) | 261 | (insert (format "Chars: %s\n" size))) |
| 252 | (when lines | 262 | (when lines |
| 253 | (insert (format "Lines: %s\n" lines))) | 263 | (insert (format "Lines: %s\n" lines))) |
| 264 | (when labels | ||
| 265 | (insert (format "X-GM-LABELS: %s\n" labels))) | ||
| 254 | ;; Most servers have a blank line after the headers, but | 266 | ;; Most servers have a blank line after the headers, but |
| 255 | ;; Davmail doesn't. | 267 | ;; Davmail doesn't. |
| 256 | (unless (re-search-forward "^\r$\\|^)\r?$" nil t) | 268 | (unless (re-search-forward "^\r$\\|^)\r?$" nil t) |
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 08ca7c7e06b..6d111e89e80 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el | |||
| @@ -284,6 +284,8 @@ is `(valuefunc member)'." | |||
| 284 | (eval-when-compile | 284 | (eval-when-compile |
| 285 | (autoload 'nnimap-buffer "nnimap") | 285 | (autoload 'nnimap-buffer "nnimap") |
| 286 | (autoload 'nnimap-command "nnimap") | 286 | (autoload 'nnimap-command "nnimap") |
| 287 | (autoload 'nnimap-capability "nnimap") | ||
| 288 | (autoload 'nnimap-wait-for-line "nnimap") | ||
| 287 | (autoload 'nnimap-change-group "nnimap") | 289 | (autoload 'nnimap-change-group "nnimap") |
| 288 | (autoload 'nnimap-make-thread-query "nnimap") | 290 | (autoload 'nnimap-make-thread-query "nnimap") |
| 289 | (autoload 'gnus-registry-action "gnus-registry") | 291 | (autoload 'gnus-registry-action "gnus-registry") |
| @@ -968,33 +970,52 @@ details on the language and supported extensions." | |||
| 968 | (catch 'found | 970 | (catch 'found |
| 969 | (mapcar | 971 | (mapcar |
| 970 | #'(lambda (group) | 972 | #'(lambda (group) |
| 971 | (let (artlist) | 973 | (let (artlist) |
| 972 | (condition-case () | 974 | (condition-case () |
| 973 | (when (nnimap-change-group | 975 | (when (nnimap-change-group |
| 974 | (gnus-group-short-name group) server) | 976 | (gnus-group-short-name group) server) |
| 975 | (with-current-buffer (nnimap-buffer) | 977 | (with-current-buffer (nnimap-buffer) |
| 976 | (message "Searching %s..." group) | 978 | (message "Searching %s..." group) |
| 977 | (let ((arts 0) | 979 | (let* ((arts 0) |
| 978 | (result (nnimap-command "UID SEARCH %s" | 980 | (literal+ (nnimap-capability "LITERAL+")) |
| 979 | (if (string= criteria "") | 981 | (search (split-string |
| 980 | qstring | 982 | (if (string= criteria "") |
| 981 | (nnir-imap-make-query | 983 | qstring |
| 982 | criteria qstring))))) | 984 | (nnir-imap-make-query |
| 983 | (mapc | 985 | criteria qstring)) |
| 984 | (lambda (artnum) | 986 | "\n")) |
| 985 | (let ((artn (string-to-number artnum))) | 987 | (coding (upcase |
| 986 | (when (> artn 0) | 988 | (replace-regexp-in-string |
| 987 | (push (vector group artn 100) | 989 | "-\\(unix\\|dos\\|mac\\)" "" |
| 988 | artlist) | 990 | (symbol-name |
| 989 | (when (assq 'shortcut query) | 991 | (cdr default-process-coding-system))))) |
| 990 | (throw 'found (list artlist))) | 992 | call result) |
| 991 | (setq arts (1+ arts))))) | 993 | (setq call (nnimap-send-command |
| 992 | (and (car result) | 994 | "UID SEARCH CHARSET %s %s" coding (pop search))) |
| 993 | (cdr (assoc "SEARCH" (cdr result))))) | 995 | (while search ; Non-ascii search terms |
| 994 | (message "Searching %s... %d matches" group arts))) | 996 | (unless literal+ |
| 995 | (message "Searching %s...done" group)) | 997 | (nnimap-wait-for-line "^\\+\\(.*\\)\n")) |
| 996 | (quit nil)) | 998 | (process-send-string (get-buffer-process (current-buffer)) (pop search)) |
| 997 | (nreverse artlist))) | 999 | (process-send-string (get-buffer-process (current-buffer)) |
| 1000 | (if (nnimap-newlinep nnimap-object) | ||
| 1001 | "\n" | ||
| 1002 | "\r\n"))) | ||
| 1003 | (setq result (nnimap-get-response call)) | ||
| 1004 | (mapc | ||
| 1005 | (lambda (artnum) | ||
| 1006 | (let ((artn (string-to-number artnum))) | ||
| 1007 | (when (> artn 0) | ||
| 1008 | (push (vector group artn 100) | ||
| 1009 | artlist) | ||
| 1010 | (when (assq 'shortcut query) | ||
| 1011 | (throw 'found (list artlist))) | ||
| 1012 | (setq arts (1+ arts))))) | ||
| 1013 | (and (car result) | ||
| 1014 | (cdr (assoc "SEARCH" (cdr result))))) | ||
| 1015 | (message "Searching %s... %d matches" group arts))) | ||
| 1016 | (message "Searching %s...done" group)) | ||
| 1017 | (quit nil)) | ||
| 1018 | (nreverse artlist))) | ||
| 998 | groups)))))) | 1019 | groups)))))) |
| 999 | 1020 | ||
| 1000 | (defun nnir-imap-make-query (criteria qstring) | 1021 | (defun nnir-imap-make-query (criteria qstring) |
| @@ -1048,25 +1069,30 @@ In future the following will be added to the language: | |||
| 1048 | (defun nnir-imap-expr-to-imap (criteria expr) | 1069 | (defun nnir-imap-expr-to-imap (criteria expr) |
| 1049 | "Convert EXPR into an IMAP search expression on CRITERIA" | 1070 | "Convert EXPR into an IMAP search expression on CRITERIA" |
| 1050 | ;; What sort of expression is this, eh? | 1071 | ;; What sort of expression is this, eh? |
| 1051 | (cond | 1072 | (let ((literal+ (nnimap-capability "LITERAL+"))) |
| 1052 | ;; Simple string term | 1073 | (cond |
| 1053 | ((stringp expr) | 1074 | ;; Simple string term |
| 1054 | (format "%s %S" criteria expr)) | 1075 | ((stringp expr) |
| 1055 | ;; Trivial term: and | 1076 | (format "%s %S" criteria expr)) |
| 1056 | ((eq expr 'and) nil) | 1077 | ;; Trivial term: and |
| 1057 | ;; Composite term: or expression | 1078 | ((eq expr 'and) nil) |
| 1058 | ((eq (car-safe expr) 'or) | 1079 | ;; Composite term: or expression |
| 1059 | (format "OR %s %s" | 1080 | ((eq (car-safe expr) 'or) |
| 1060 | (nnir-imap-expr-to-imap criteria (second expr)) | 1081 | (format "OR %s %s" |
| 1061 | (nnir-imap-expr-to-imap criteria (third expr)))) | 1082 | (nnir-imap-expr-to-imap criteria (second expr)) |
| 1062 | ;; Composite term: just the fax, mam | 1083 | (nnir-imap-expr-to-imap criteria (third expr)))) |
| 1063 | ((eq (car-safe expr) 'not) | 1084 | ;; Composite term: just the fax, mam |
| 1064 | (format "NOT (%s)" (nnir-imap-query-to-imap criteria (rest expr)))) | 1085 | ((eq (car-safe expr) 'not) |
| 1065 | ;; Composite term: just expand it all. | 1086 | (format "NOT (%s)" (nnir-imap-query-to-imap criteria (rest expr)))) |
| 1066 | ((and (not (null expr)) (listp expr)) | 1087 | ;; Composite term: non-ascii search term |
| 1067 | (format "(%s)" (nnir-imap-query-to-imap criteria expr))) | 1088 | ((numberp (car-safe expr)) |
| 1068 | ;; Complex value, give up for now. | 1089 | (format "%s {%d%s}\n%s" criteria (car expr) |
| 1069 | (t (error "Unhandled input: %S" expr)))) | 1090 | (if literal+ "+" "") (second expr))) |
| 1091 | ;; Composite term: just expand it all. | ||
| 1092 | ((and (not (null expr)) (listp expr)) | ||
| 1093 | (format "(%s)" (nnir-imap-query-to-imap criteria expr))) | ||
| 1094 | ;; Complex value, give up for now. | ||
| 1095 | (t (error "Unhandled input: %S" expr))))) | ||
| 1070 | 1096 | ||
| 1071 | 1097 | ||
| 1072 | (defun nnir-imap-parse-query (string) | 1098 | (defun nnir-imap-parse-query (string) |
| @@ -1108,6 +1134,11 @@ that the search language can then understand and use." | |||
| 1108 | ((eq term 'and) 'and) | 1134 | ((eq term 'and) 'and) |
| 1109 | ;; negated term | 1135 | ;; negated term |
| 1110 | ((eq term 'not) (list 'not (nnir-imap-next-expr))) | 1136 | ((eq term 'not) (list 'not (nnir-imap-next-expr))) |
| 1137 | ;; non-ascii search string | ||
| 1138 | ((and (stringp term) | ||
| 1139 | (not (= (string-bytes term) | ||
| 1140 | (length term)))) | ||
| 1141 | (list (string-bytes term) term)) | ||
| 1111 | ;; generic term | 1142 | ;; generic term |
| 1112 | (t term)))) | 1143 | (t term)))) |
| 1113 | 1144 | ||
diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el index 5a01ce8c25c..96b40e5b845 100644 --- a/lisp/gnus/nnmairix.el +++ b/lisp/gnus/nnmairix.el | |||
| @@ -417,7 +417,7 @@ Other back ends might or might not work.") | |||
| 417 | 417 | ||
| 418 | (nnoo-define-basics nnmairix) | 418 | (nnoo-define-basics nnmairix) |
| 419 | 419 | ||
| 420 | (gnus-declare-backend "nnmairix" 'mail 'address) | 420 | (gnus-declare-backend "nnmairix" 'mail 'address 'virtual) |
| 421 | 421 | ||
| 422 | (deffoo nnmairix-open-server (server &optional definitions) | 422 | (deffoo nnmairix-open-server (server &optional definitions) |
| 423 | ;; just set server variables | 423 | ;; just set server variables |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 191ec8270eb..99ca73f9f54 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -2349,6 +2349,8 @@ With argument, add COUNT copies of the character." | |||
| 2349 | (isearch-process-search-char char count)))) | 2349 | (isearch-process-search-char char count)))) |
| 2350 | 2350 | ||
| 2351 | (defun isearch-process-search-char (char &optional count) | 2351 | (defun isearch-process-search-char (char &optional count) |
| 2352 | "Add CHAR to the search string, COUNT times. | ||
| 2353 | Search is updated accordingly." | ||
| 2352 | ;; * and ? are special in regexps when not preceded by \. | 2354 | ;; * and ? are special in regexps when not preceded by \. |
| 2353 | ;; } and | are special in regexps when preceded by \. | 2355 | ;; } and | are special in regexps when preceded by \. |
| 2354 | ;; Nothing special for + because it matches at least once. | 2356 | ;; Nothing special for + because it matches at least once. |
diff --git a/lisp/net/eudc-bob.el b/lisp/net/eudc-bob.el index 622ea72d021..f01f671de9e 100644 --- a/lisp/net/eudc-bob.el +++ b/lisp/net/eudc-bob.el | |||
| @@ -3,7 +3,8 @@ | |||
| 3 | ;; Copyright (C) 1999-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1999-2015 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> | 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> |
| 6 | ;; Maintainer: Pavel JanÃk <Pavel@Janik.cz> | 6 | ;; Pavel JanÃk <Pavel@Janik.cz> |
| 7 | ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org> | ||
| 7 | ;; Keywords: comm | 8 | ;; Keywords: comm |
| 8 | ;; Package: eudc | 9 | ;; Package: eudc |
| 9 | 10 | ||
diff --git a/lisp/net/eudc-export.el b/lisp/net/eudc-export.el index bbdb294da7f..0e54d841d57 100644 --- a/lisp/net/eudc-export.el +++ b/lisp/net/eudc-export.el | |||
| @@ -3,7 +3,8 @@ | |||
| 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> | 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> |
| 6 | ;; Maintainer: Pavel JanÃk <Pavel@Janik.cz> | 6 | ;; Pavel JanÃk <Pavel@Janik.cz> |
| 7 | ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org> | ||
| 7 | ;; Keywords: comm | 8 | ;; Keywords: comm |
| 8 | ;; Package: eudc | 9 | ;; Package: eudc |
| 9 | 10 | ||
diff --git a/lisp/net/eudc-hotlist.el b/lisp/net/eudc-hotlist.el index b3c9a6db0d5..7416ad090eb 100644 --- a/lisp/net/eudc-hotlist.el +++ b/lisp/net/eudc-hotlist.el | |||
| @@ -3,7 +3,8 @@ | |||
| 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> | 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> |
| 6 | ;; Maintainer: Pavel JanÃk <Pavel@Janik.cz> | 6 | ;; Pavel JanÃk <Pavel@Janik.cz> |
| 7 | ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org> | ||
| 7 | ;; Keywords: comm | 8 | ;; Keywords: comm |
| 8 | ;; Package: eudc | 9 | ;; Package: eudc |
| 9 | 10 | ||
diff --git a/lisp/net/eudc-vars.el b/lisp/net/eudc-vars.el index 29ddf613376..36a583daa4d 100644 --- a/lisp/net/eudc-vars.el +++ b/lisp/net/eudc-vars.el | |||
| @@ -3,7 +3,8 @@ | |||
| 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> | 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> |
| 6 | ;; Maintainer: Pavel JanÃk <Pavel@Janik.cz> | 6 | ;; Pavel JanÃk <Pavel@Janik.cz> |
| 7 | ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org> | ||
| 7 | ;; Keywords: comm | 8 | ;; Keywords: comm |
| 8 | ;; Package: eudc | 9 | ;; Package: eudc |
| 9 | 10 | ||
diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el index 4dd80972e3f..cf5d13fce88 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el | |||
| @@ -3,7 +3,8 @@ | |||
| 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> | 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> |
| 6 | ;; Maintainer: Pavel JanÃk <Pavel@Janik.cz> | 6 | ;; Pavel JanÃk <Pavel@Janik.cz> |
| 7 | ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org> | ||
| 7 | ;; Keywords: comm | 8 | ;; Keywords: comm |
| 8 | 9 | ||
| 9 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/net/eudcb-bbdb.el b/lisp/net/eudcb-bbdb.el index 0400e5b5bb4..5be2bec0c5d 100644 --- a/lisp/net/eudcb-bbdb.el +++ b/lisp/net/eudcb-bbdb.el | |||
| @@ -3,7 +3,8 @@ | |||
| 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> | 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> |
| 6 | ;; Maintainer: Pavel JanÃk <Pavel@Janik.cz> | 6 | ;; Pavel JanÃk <Pavel@Janik.cz> |
| 7 | ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org> | ||
| 7 | ;; Keywords: comm | 8 | ;; Keywords: comm |
| 8 | ;; Package: eudc | 9 | ;; Package: eudc |
| 9 | 10 | ||
diff --git a/lisp/net/eudcb-ldap.el b/lisp/net/eudcb-ldap.el index 92972c5f99e..1d426a7b7b0 100644 --- a/lisp/net/eudcb-ldap.el +++ b/lisp/net/eudcb-ldap.el | |||
| @@ -3,7 +3,8 @@ | |||
| 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> | 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> |
| 6 | ;; Maintainer: Pavel JanÃk <Pavel@Janik.cz> | 6 | ;; Pavel JanÃk <Pavel@Janik.cz> |
| 7 | ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org> | ||
| 7 | ;; Keywords: comm | 8 | ;; Keywords: comm |
| 8 | ;; Package: eudc | 9 | ;; Package: eudc |
| 9 | 10 | ||
diff --git a/lisp/net/eudcb-mab.el b/lisp/net/eudcb-mab.el index 81d8f24ecb2..a11cd95b05d 100644 --- a/lisp/net/eudcb-mab.el +++ b/lisp/net/eudcb-mab.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 2003-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2003-2015 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Maintainer: emacs-devel@gnu.org | 6 | ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org> |
| 7 | ;; Keywords: comm | 7 | ;; Keywords: comm |
| 8 | ;; Package: eudc | 8 | ;; Package: eudc |
| 9 | 9 | ||
diff --git a/lisp/net/eudcb-ph.el b/lisp/net/eudcb-ph.el index fc6aad671c0..1897e0b08bc 100644 --- a/lisp/net/eudcb-ph.el +++ b/lisp/net/eudcb-ph.el | |||
| @@ -3,7 +3,8 @@ | |||
| 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998-2015 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> | 5 | ;; Author: Oscar Figueiredo <oscar@cpe.fr> |
| 6 | ;; Maintainer: Pavel JanÃk <Pavel@Janik.cz> | 6 | ;; Pavel JanÃk <Pavel@Janik.cz> |
| 7 | ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org> | ||
| 7 | ;; Keywords: comm | 8 | ;; Keywords: comm |
| 8 | ;; Package: eudc | 9 | ;; Package: eudc |
| 9 | 10 | ||
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d298f96bc81..13ff439bef2 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -3816,7 +3816,9 @@ The skeleton will be bound to python-skeleton-NAME." | |||
| 3816 | ;;; Code check | 3816 | ;;; Code check |
| 3817 | 3817 | ||
| 3818 | (defcustom python-check-command | 3818 | (defcustom python-check-command |
| 3819 | "pyflakes" | 3819 | (or (executable-find "pyflakes") |
| 3820 | (executable-find "epylint") | ||
| 3821 | "install pyflakes, pylint or something else") | ||
| 3820 | "Command used to check a Python file." | 3822 | "Command used to check a Python file." |
| 3821 | :type 'string | 3823 | :type 'string |
| 3822 | :group 'python) | 3824 | :group 'python) |
| @@ -3827,7 +3829,7 @@ The skeleton will be bound to python-skeleton-NAME." | |||
| 3827 | :type 'string | 3829 | :type 'string |
| 3828 | :group 'python) | 3830 | :group 'python) |
| 3829 | 3831 | ||
| 3830 | (defvar python-check-custom-command nil | 3832 | (defvar-local python-check-custom-command nil |
| 3831 | "Internal use.") | 3833 | "Internal use.") |
| 3832 | 3834 | ||
| 3833 | (defun python-check (command) | 3835 | (defun python-check (command) |
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index 1ee54515bea..6c7f7553f82 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el | |||
| @@ -50,9 +50,6 @@ | |||
| 50 | ;; | 50 | ;; |
| 51 | ;; o chmod should understand "a+x,og-w". | 51 | ;; o chmod should understand "a+x,og-w". |
| 52 | ;; | 52 | ;; |
| 53 | ;; o It's not possible to add a NEW file to a tar archive; not that | ||
| 54 | ;; important, but still... | ||
| 55 | ;; | ||
| 56 | ;; o The code is less efficient that it could be - in a lot of places, I | 53 | ;; o The code is less efficient that it could be - in a lot of places, I |
| 57 | ;; pull a 512-character string out of the buffer and parse it, when I could | 54 | ;; pull a 512-character string out of the buffer and parse it, when I could |
| 58 | ;; be parsing it in place, not garbaging a string. Should redo that. | 55 | ;; be parsing it in place, not garbaging a string. Should redo that. |
| @@ -369,6 +366,80 @@ write-date, checksum, link-type, and link-name." | |||
| 369 | string) | 366 | string) |
| 370 | (tar-parse-octal-integer string)) | 367 | (tar-parse-octal-integer string)) |
| 371 | 368 | ||
| 369 | (defun tar-new-regular-file-header (filename &optional size time) | ||
| 370 | "Return a Tar header for a regular file. | ||
| 371 | The header will lack a proper checksum; use `tar-header-block-checksum' | ||
| 372 | to compute one, or request `tar-header-serialize' to do that. | ||
| 373 | |||
| 374 | Other tar-mode facilities may also require the data-start header | ||
| 375 | field to be set to a valid value. | ||
| 376 | |||
| 377 | If SIZE is not given or nil, it defaults to 0. | ||
| 378 | If TIME is not given or nil, assume now." | ||
| 379 | (make-tar-header | ||
| 380 | nil | ||
| 381 | filename | ||
| 382 | #o644 0 0 (or size 0) | ||
| 383 | (or time (current-time)) | ||
| 384 | nil ; checksum | ||
| 385 | nil nil | ||
| 386 | nil nil nil nil nil)) | ||
| 387 | |||
| 388 | (defun tar--pad-to (pos) | ||
| 389 | (make-string (+ pos (- (point)) (point-min)) 0)) | ||
| 390 | |||
| 391 | (defun tar--put-at (pos val &optional fmt mask) | ||
| 392 | (when val | ||
| 393 | (insert (tar--pad-to pos) | ||
| 394 | (if fmt | ||
| 395 | (format fmt (if mask (logand mask val) val)) | ||
| 396 | val)))) | ||
| 397 | |||
| 398 | (defun tar-header-serialize (header &optional update-checksum) | ||
| 399 | "Return the serialization of a Tar HEADER as a string. | ||
| 400 | This function calls `tar-header-block-check-checksum' to ensure the | ||
| 401 | checksum is correct. | ||
| 402 | |||
| 403 | If UPDATE-CHECKSUM is non-nil, update HEADER with the newly-computed | ||
| 404 | checksum before doing the check." | ||
| 405 | (with-temp-buffer | ||
| 406 | (set-buffer-multibyte nil) | ||
| 407 | (let ((encoded-name | ||
| 408 | (encode-coding-string (tar-header-name header) | ||
| 409 | tar-file-name-coding-system))) | ||
| 410 | (unless (< (length encoded-name) 99) | ||
| 411 | ;; FIXME: Implement it. | ||
| 412 | (error "Long file name support is not implemented")) | ||
| 413 | (insert encoded-name)) | ||
| 414 | (tar--put-at tar-mode-offset (tar-header-mode header) "%6o\0 " #o777777) | ||
| 415 | (tar--put-at tar-uid-offset (tar-header-uid header) "%6o\0 " #o777777) | ||
| 416 | (tar--put-at tar-gid-offset (tar-header-gid header) "%6o\0 " #o777777) | ||
| 417 | (tar--put-at tar-size-offset (tar-header-size header) "%11o ") | ||
| 418 | (insert (tar--pad-to tar-time-offset) | ||
| 419 | (tar-octal-time (tar-header-date header)) | ||
| 420 | " ") | ||
| 421 | ;; Omit tar-header-checksum (tar-chk-offset) for now. | ||
| 422 | (tar--put-at tar-linkp-offset (tar-header-link-type header)) | ||
| 423 | (tar--put-at tar-link-offset (tar-header-link-name header)) | ||
| 424 | (when (tar-header-magic header) | ||
| 425 | (tar--put-at tar-magic-offset (tar-header-magic header)) | ||
| 426 | (tar--put-at tar-uname-offset (tar-header-uname header)) | ||
| 427 | (tar--put-at tar-gname-offset (tar-header-gname header)) | ||
| 428 | (tar--put-at tar-dmaj-offset (tar-header-dmaj header) "%7o\0" #o7777777) | ||
| 429 | (tar--put-at tar-dmin-offset (tar-header-dmin header) "%7o\0" #o7777777)) | ||
| 430 | (tar--put-at 512 "") | ||
| 431 | (let ((ck (tar-header-block-checksum (buffer-string)))) | ||
| 432 | (goto-char (+ (point-min) tar-chk-offset)) | ||
| 433 | (delete-char 8) | ||
| 434 | (insert (format "%6o\0 " ck)) | ||
| 435 | (when update-checksum | ||
| 436 | (setf (tar-header-checksum header) ck)) | ||
| 437 | (tar-header-block-check-checksum (buffer-string) | ||
| 438 | (tar-header-checksum header) | ||
| 439 | (tar-header-name header))) | ||
| 440 | ;; . | ||
| 441 | (buffer-string))) | ||
| 442 | |||
| 372 | 443 | ||
| 373 | (defun tar-header-block-checksum (string) | 444 | (defun tar-header-block-checksum (string) |
| 374 | "Compute and return a tar-acceptable checksum for this block." | 445 | "Compute and return a tar-acceptable checksum for this block." |
| @@ -547,6 +618,7 @@ MODE should be an integer which is a file mode value." | |||
| 547 | (define-key map "p" 'tar-previous-line) | 618 | (define-key map "p" 'tar-previous-line) |
| 548 | (define-key map "\^P" 'tar-previous-line) | 619 | (define-key map "\^P" 'tar-previous-line) |
| 549 | (define-key map [up] 'tar-previous-line) | 620 | (define-key map [up] 'tar-previous-line) |
| 621 | (define-key map "I" 'tar-new-entry) | ||
| 550 | (define-key map "R" 'tar-rename-entry) | 622 | (define-key map "R" 'tar-rename-entry) |
| 551 | (define-key map "u" 'tar-unflag) | 623 | (define-key map "u" 'tar-unflag) |
| 552 | (define-key map "v" 'tar-view) | 624 | (define-key map "v" 'tar-view) |
| @@ -731,10 +803,14 @@ tar-file's buffer." | |||
| 731 | (interactive "p") | 803 | (interactive "p") |
| 732 | (tar-next-line (- arg))) | 804 | (tar-next-line (- arg))) |
| 733 | 805 | ||
| 806 | (defun tar-current-position () | ||
| 807 | "Return the `tar-parse-info' index for the current line." | ||
| 808 | (count-lines (point-min) (line-beginning-position))) | ||
| 809 | |||
| 734 | (defun tar-current-descriptor (&optional noerror) | 810 | (defun tar-current-descriptor (&optional noerror) |
| 735 | "Return the tar-descriptor of the current line, or signals an error." | 811 | "Return the tar-descriptor of the current line, or signals an error." |
| 736 | ;; I wish lines had plists, like in ZMACS... | 812 | ;; I wish lines had plists, like in ZMACS... |
| 737 | (or (nth (count-lines (point-min) (line-beginning-position)) | 813 | (or (nth (tar-current-position) |
| 738 | tar-parse-info) | 814 | tar-parse-info) |
| 739 | (if noerror | 815 | (if noerror |
| 740 | nil | 816 | nil |
| @@ -948,6 +1024,37 @@ the current tar-entry." | |||
| 948 | (write-region start end to-file nil nil nil t))) | 1024 | (write-region start end to-file nil nil nil t))) |
| 949 | (message "Copied tar entry %s to %s" name to-file))) | 1025 | (message "Copied tar entry %s to %s" name to-file))) |
| 950 | 1026 | ||
| 1027 | (defun tar-new-entry (filename &optional index) | ||
| 1028 | "Insert a new empty regular file before point." | ||
| 1029 | (interactive "*sFile name: ") | ||
| 1030 | (let* ((buffer (current-buffer)) | ||
| 1031 | (index (or index (tar-current-position))) | ||
| 1032 | (d-list (and (not (zerop index)) | ||
| 1033 | (nthcdr (+ -1 index) tar-parse-info))) | ||
| 1034 | (pos (if d-list | ||
| 1035 | (tar-header-data-end (car d-list)) | ||
| 1036 | (point-min))) | ||
| 1037 | (new-descriptor | ||
| 1038 | (tar-new-regular-file-header filename))) | ||
| 1039 | ;; Update the data buffer; fill the missing descriptor fields. | ||
| 1040 | (with-current-buffer tar-data-buffer | ||
| 1041 | (goto-char pos) | ||
| 1042 | (insert (tar-header-serialize new-descriptor t)) | ||
| 1043 | (setf (tar-header-data-start new-descriptor) | ||
| 1044 | (copy-marker (point) nil))) | ||
| 1045 | ;; Update tar-parse-info. | ||
| 1046 | (if d-list | ||
| 1047 | (setcdr d-list (cons new-descriptor (cdr d-list))) | ||
| 1048 | (setq tar-parse-info (cons new-descriptor tar-parse-info))) | ||
| 1049 | ;; Update the listing buffer. | ||
| 1050 | (save-excursion | ||
| 1051 | (goto-char (point-min)) | ||
| 1052 | (forward-line index) | ||
| 1053 | (let ((inhibit-read-only t)) | ||
| 1054 | (insert (tar-header-block-summarize new-descriptor) ?\n))) | ||
| 1055 | ;; . | ||
| 1056 | index)) | ||
| 1057 | |||
| 951 | (defun tar-flag-deleted (p &optional unflag) | 1058 | (defun tar-flag-deleted (p &optional unflag) |
| 952 | "In Tar mode, mark this sub-file to be deleted from the tar file. | 1059 | "In Tar mode, mark this sub-file to be deleted from the tar file. |
| 953 | With a prefix argument, mark that many files." | 1060 | With a prefix argument, mark that many files." |
diff --git a/src/ChangeLog b/src/ChangeLog index 4fc0de7c815..8e5166e22be 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,56 @@ | |||
| 1 | 2015-01-27 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Use bool for boolean in xfaces.c | ||
| 4 | * dispextern.h: Adjust to signature changes. | ||
| 5 | * font.c (font_at, font_range): | ||
| 6 | * fontset.c (Finternal_char_font): | ||
| 7 | * fringe.c (draw_fringe_bitmap_1): | ||
| 8 | * xdisp.c (handle_face_prop, face_before_or_after_it_pos) | ||
| 9 | (get_next_display_element, highlight_trailing_whitespace) | ||
| 10 | (display_string, calc_line_height_property) | ||
| 11 | (note_mode_line_or_margin_highlight, note_mouse_highlight): | ||
| 12 | * xfaces.c (tty_suppress_bold_inverse_default_colors_p) | ||
| 13 | (menu_face_changed_default, recompute_basic_faces) | ||
| 14 | (Fbitmap_spec_p, parse_rgb_list, tty_lookup_color) | ||
| 15 | (tty_defined_color, defined_color, face_color_gray_p) | ||
| 16 | (face_color_supported_p, load_color2, load_face_colors) | ||
| 17 | (Fx_list_fonts, LFACEP, push_named_merge_point) | ||
| 18 | (resolve_face_name, lface_from_face_name_no_resolve) | ||
| 19 | (lface_from_face_name, get_lface_attributes_no_remap) | ||
| 20 | (get_lface_attributes, lface_fully_specified_p) | ||
| 21 | (set_lface_from_font, merge_face_vectors, merge_named_face) | ||
| 22 | (merge_face_ref, Finternal_make_lisp_face) | ||
| 23 | (Finternal_lisp_face_p, Finternal_copy_lisp_face) | ||
| 24 | (Finternal_set_lisp_face_attribute) | ||
| 25 | (update_face_from_frame_parameter, set_font_frame_param) | ||
| 26 | (face_boolean_x_resource_value) | ||
| 27 | (Finternal_set_lisp_face_attribute_from_resource) | ||
| 28 | (x_update_menu_appearance, Finternal_get_lisp_face_attribute) | ||
| 29 | (Finternal_merge_in_global_face, Fface_font, face_attr_equal_p) | ||
| 30 | (lface_equal_p, Finternal_lisp_face_equal_p) | ||
| 31 | (Finternal_lisp_face_empty_p, lface_same_font_attributes_p) | ||
| 32 | (Fcolor_distance, lookup_named_face, lookup_basic_face) | ||
| 33 | (lookup_derived_face, Fface_attributes_as_vector) | ||
| 34 | (x_supports_face_attributes_p, tty_supports_face_attributes_p) | ||
| 35 | (Fdisplay_supports_face_attributes_p, realize_basic_faces) | ||
| 36 | (realize_default_face, realize_named_face) | ||
| 37 | (realize_non_ascii_face, realize_x_face, map_tty_color) | ||
| 38 | (realize_tty_face, compute_char_face, face_at_buffer_position) | ||
| 39 | (face_for_overlay_string, face_at_string_position): | ||
| 40 | Use bool for boolean. | ||
| 41 | * xfaces.c (set_lface_from_font): | ||
| 42 | Return void, since callers never use the result. | ||
| 43 | |||
| 44 | 2015-01-26 Andreas Schwab <schwab@linux-m68k.org> | ||
| 45 | |||
| 46 | * image.c (lookup_pixel_color): Reorder conditions that are | ||
| 47 | written backwards. | ||
| 48 | (x_to_xcolors): Likewise. | ||
| 49 | (x_detect_edges): Likewise. | ||
| 50 | (png_load_body): Likewise. | ||
| 51 | (gif_close): Likewise. | ||
| 52 | (gif_load): Likewise. | ||
| 53 | |||
| 1 | 2015-01-25 Eli Zaretskii <eliz@gnu.org> | 54 | 2015-01-25 Eli Zaretskii <eliz@gnu.org> |
| 2 | 55 | ||
| 3 | Use bool for boolean in w32term.c | 56 | Use bool for boolean in w32term.c |
diff --git a/src/dispextern.h b/src/dispextern.h index e9e6f709079..31e7262d6ec 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -3380,23 +3380,20 @@ char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object, | |||
| 3380 | #ifdef HAVE_WINDOW_SYSTEM | 3380 | #ifdef HAVE_WINDOW_SYSTEM |
| 3381 | void prepare_face_for_display (struct frame *, struct face *); | 3381 | void prepare_face_for_display (struct frame *, struct face *); |
| 3382 | #endif | 3382 | #endif |
| 3383 | int lookup_named_face (struct frame *, Lisp_Object, int); | 3383 | int lookup_named_face (struct frame *, Lisp_Object, bool); |
| 3384 | int lookup_basic_face (struct frame *, int); | 3384 | int lookup_basic_face (struct frame *, int); |
| 3385 | int smaller_face (struct frame *, int, int); | 3385 | int smaller_face (struct frame *, int, int); |
| 3386 | int face_with_height (struct frame *, int, int); | 3386 | int face_with_height (struct frame *, int, int); |
| 3387 | int lookup_derived_face (struct frame *, Lisp_Object, int, int); | 3387 | int lookup_derived_face (struct frame *, Lisp_Object, int, bool); |
| 3388 | void init_frame_faces (struct frame *); | 3388 | void init_frame_faces (struct frame *); |
| 3389 | void free_frame_faces (struct frame *); | 3389 | void free_frame_faces (struct frame *); |
| 3390 | void recompute_basic_faces (struct frame *); | 3390 | void recompute_basic_faces (struct frame *); |
| 3391 | int face_at_buffer_position (struct window *w, ptrdiff_t pos, | 3391 | int face_at_buffer_position (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t, |
| 3392 | ptrdiff_t *endptr, ptrdiff_t limit, | 3392 | bool, int); |
| 3393 | int mouse, int base_face_id); | 3393 | int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t, |
| 3394 | int face_for_overlay_string (struct window *w, ptrdiff_t pos, | 3394 | bool, Lisp_Object); |
| 3395 | ptrdiff_t *endptr, ptrdiff_t limit, | 3395 | int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, ptrdiff_t, |
| 3396 | int mouse, Lisp_Object overlay); | 3396 | ptrdiff_t *, enum face_id, bool); |
| 3397 | int face_at_string_position (struct window *w, Lisp_Object string, | ||
| 3398 | ptrdiff_t pos, ptrdiff_t bufpos, | ||
| 3399 | ptrdiff_t *endptr, enum face_id, int mouse); | ||
| 3400 | int merge_faces (struct frame *, Lisp_Object, int, int); | 3397 | int merge_faces (struct frame *, Lisp_Object, int, int); |
| 3401 | int compute_char_face (struct frame *, int, Lisp_Object); | 3398 | int compute_char_face (struct frame *, int, Lisp_Object); |
| 3402 | void free_all_realized_faces (Lisp_Object); | 3399 | void free_all_realized_faces (Lisp_Object); |
diff --git a/src/font.c b/src/font.c index d1a008e794d..9ea43cdfc85 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -3707,10 +3707,10 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w, | |||
| 3707 | 3707 | ||
| 3708 | if (STRINGP (string)) | 3708 | if (STRINGP (string)) |
| 3709 | face_id = face_at_string_position (w, string, pos, 0, &endptr, | 3709 | face_id = face_at_string_position (w, string, pos, 0, &endptr, |
| 3710 | DEFAULT_FACE_ID, 0); | 3710 | DEFAULT_FACE_ID, false); |
| 3711 | else | 3711 | else |
| 3712 | face_id = face_at_buffer_position (w, pos, &endptr, | 3712 | face_id = face_at_buffer_position (w, pos, &endptr, |
| 3713 | pos + 100, 0, -1); | 3713 | pos + 100, false, -1); |
| 3714 | face = FACE_FROM_ID (f, face_id); | 3714 | face = FACE_FROM_ID (f, face_id); |
| 3715 | } | 3715 | } |
| 3716 | if (multibyte) | 3716 | if (multibyte) |
| @@ -3754,7 +3754,7 @@ font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit, | |||
| 3754 | int face_id; | 3754 | int face_id; |
| 3755 | 3755 | ||
| 3756 | face_id = face_at_buffer_position (w, pos, &ignore, | 3756 | face_id = face_at_buffer_position (w, pos, &ignore, |
| 3757 | *limit, 0, -1); | 3757 | *limit, false, -1); |
| 3758 | face = FACE_FROM_ID (XFRAME (w->frame), face_id); | 3758 | face = FACE_FROM_ID (XFRAME (w->frame), face_id); |
| 3759 | } | 3759 | } |
| 3760 | } | 3760 | } |
diff --git a/src/fontset.c b/src/fontset.c index 357526bacfe..c0303fa5a34 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -1828,7 +1828,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, | |||
| 1828 | w = XWINDOW (window); | 1828 | w = XWINDOW (window); |
| 1829 | f = XFRAME (w->frame); | 1829 | f = XFRAME (w->frame); |
| 1830 | face_id = face_at_buffer_position (w, pos, &dummy, | 1830 | face_id = face_at_buffer_position (w, pos, &dummy, |
| 1831 | pos + 100, 0, -1); | 1831 | pos + 100, false, -1); |
| 1832 | } | 1832 | } |
| 1833 | if (! CHAR_VALID_P (c)) | 1833 | if (! CHAR_VALID_P (c)) |
| 1834 | return Qnil; | 1834 | return Qnil; |
diff --git a/src/fringe.c b/src/fringe.c index 464379d0cd0..5e5ec60a48f 100644 --- a/src/fringe.c +++ b/src/fringe.c | |||
| @@ -587,7 +587,7 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o | |||
| 587 | if (face_id == DEFAULT_FACE_ID) | 587 | if (face_id == DEFAULT_FACE_ID) |
| 588 | { | 588 | { |
| 589 | Lisp_Object face = fringe_faces[which]; | 589 | Lisp_Object face = fringe_faces[which]; |
| 590 | face_id = NILP (face) ? lookup_named_face (f, Qfringe, 0) | 590 | face_id = NILP (face) ? lookup_named_face (f, Qfringe, false) |
| 591 | : lookup_derived_face (f, face, FRINGE_FACE_ID, 0); | 591 | : lookup_derived_face (f, face, FRINGE_FACE_ID, 0); |
| 592 | if (face_id < 0) | 592 | if (face_id < 0) |
| 593 | face_id = FRINGE_FACE_ID; | 593 | face_id = FRINGE_FACE_ID; |
diff --git a/src/image.c b/src/image.c index 9c09c5596b9..df299bbd164 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -4423,7 +4423,7 @@ lookup_pixel_color (struct frame *f, unsigned long pixel) | |||
| 4423 | Colormap cmap; | 4423 | Colormap cmap; |
| 4424 | bool rc; | 4424 | bool rc; |
| 4425 | 4425 | ||
| 4426 | if (ct_colors_allocated_max <= ct_colors_allocated) | 4426 | if (ct_colors_allocated >= ct_colors_allocated_max) |
| 4427 | return FRAME_FOREGROUND_PIXEL (f); | 4427 | return FRAME_FOREGROUND_PIXEL (f); |
| 4428 | 4428 | ||
| 4429 | #ifdef HAVE_X_WINDOWS | 4429 | #ifdef HAVE_X_WINDOWS |
| @@ -4554,7 +4554,7 @@ x_to_xcolors (struct frame *f, struct image *img, bool rgb_p) | |||
| 4554 | HGDIOBJ prev; | 4554 | HGDIOBJ prev; |
| 4555 | #endif /* HAVE_NTGUI */ | 4555 | #endif /* HAVE_NTGUI */ |
| 4556 | 4556 | ||
| 4557 | if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *colors / img->width < img->height) | 4557 | if (img->height > min (PTRDIFF_MAX, SIZE_MAX) / sizeof *colors / img->width) |
| 4558 | memory_full (SIZE_MAX); | 4558 | memory_full (SIZE_MAX); |
| 4559 | colors = xmalloc (sizeof *colors * img->width * img->height); | 4559 | colors = xmalloc (sizeof *colors * img->width * img->height); |
| 4560 | 4560 | ||
| @@ -4695,7 +4695,7 @@ x_detect_edges (struct frame *f, struct image *img, int *matrix, int color_adjus | |||
| 4695 | 4695 | ||
| 4696 | #define COLOR(A, X, Y) ((A) + (Y) * img->width + (X)) | 4696 | #define COLOR(A, X, Y) ((A) + (Y) * img->width + (X)) |
| 4697 | 4697 | ||
| 4698 | if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *new / img->width < img->height) | 4698 | if (img->height > min (PTRDIFF_MAX, SIZE_MAX) / sizeof *new / img->width) |
| 4699 | memory_full (SIZE_MAX); | 4699 | memory_full (SIZE_MAX); |
| 4700 | new = xmalloc (sizeof *new * img->width * img->height); | 4700 | new = xmalloc (sizeof *new * img->width * img->height); |
| 4701 | 4701 | ||
| @@ -5917,8 +5917,8 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) | |||
| 5917 | row_bytes = png_get_rowbytes (png_ptr, info_ptr); | 5917 | row_bytes = png_get_rowbytes (png_ptr, info_ptr); |
| 5918 | 5918 | ||
| 5919 | /* Allocate memory for the image. */ | 5919 | /* Allocate memory for the image. */ |
| 5920 | if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *rows < height | 5920 | if (height > min (PTRDIFF_MAX, SIZE_MAX) / sizeof *rows |
| 5921 | || min (PTRDIFF_MAX, SIZE_MAX) / sizeof *pixels / height < row_bytes) | 5921 | || row_bytes > min (PTRDIFF_MAX, SIZE_MAX) / sizeof *pixels / height) |
| 5922 | memory_full (SIZE_MAX); | 5922 | memory_full (SIZE_MAX); |
| 5923 | c->pixels = pixels = xmalloc (sizeof *pixels * row_bytes * height); | 5923 | c->pixels = pixels = xmalloc (sizeof *pixels * row_bytes * height); |
| 5924 | c->rows = rows = xmalloc (height * sizeof *rows); | 5924 | c->rows = rows = xmalloc (height * sizeof *rows); |
| @@ -7235,7 +7235,7 @@ gif_image_p (Lisp_Object object) | |||
| 7235 | # ifdef WINDOWSNT | 7235 | # ifdef WINDOWSNT |
| 7236 | 7236 | ||
| 7237 | /* GIF library details. */ | 7237 | /* GIF library details. */ |
| 7238 | # if 5 < GIFLIB_MAJOR + (1 <= GIFLIB_MINOR) | 7238 | # if GIFLIB_MAJOR + (GIFLIB_MINOR >= 1) > 5 |
| 7239 | DEF_DLL_FN (int, DGifCloseFile, (GifFileType *, int *)); | 7239 | DEF_DLL_FN (int, DGifCloseFile, (GifFileType *, int *)); |
| 7240 | # else | 7240 | # else |
| 7241 | DEF_DLL_FN (int, DGifCloseFile, (GifFileType *)); | 7241 | DEF_DLL_FN (int, DGifCloseFile, (GifFileType *)); |
| @@ -7316,7 +7316,7 @@ gif_close (GifFileType *gif, int *err) | |||
| 7316 | { | 7316 | { |
| 7317 | int retval; | 7317 | int retval; |
| 7318 | 7318 | ||
| 7319 | #if 5 < GIFLIB_MAJOR + (1 <= GIFLIB_MINOR) | 7319 | #if GIFLIB_MAJOR + (GIFLIB_MINOR >= 1) > 5 |
| 7320 | retval = DGifCloseFile (gif, err); | 7320 | retval = DGifCloseFile (gif, err); |
| 7321 | #else | 7321 | #else |
| 7322 | retval = DGifCloseFile (gif); | 7322 | retval = DGifCloseFile (gif); |
| @@ -7471,7 +7471,7 @@ gif_load (struct frame *f, struct image *img) | |||
| 7471 | int subimg_height = subimage->ImageDesc.Height; | 7471 | int subimg_height = subimage->ImageDesc.Height; |
| 7472 | int subimg_top = subimage->ImageDesc.Top; | 7472 | int subimg_top = subimage->ImageDesc.Top; |
| 7473 | int subimg_left = subimage->ImageDesc.Left; | 7473 | int subimg_left = subimage->ImageDesc.Left; |
| 7474 | if (! (0 <= subimg_width && 0 <= subimg_height | 7474 | if (! (subimg_width >= 0 && subimg_height >= 0 |
| 7475 | && 0 <= subimg_top && subimg_top <= height - subimg_height | 7475 | && 0 <= subimg_top && subimg_top <= height - subimg_height |
| 7476 | && 0 <= subimg_left && subimg_left <= width - subimg_width)) | 7476 | && 0 <= subimg_left && subimg_left <= width - subimg_width)) |
| 7477 | { | 7477 | { |
diff --git a/src/xdisp.c b/src/xdisp.c index d974687a431..71871ec5885 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3877,7 +3877,7 @@ handle_face_prop (struct it *it) | |||
| 3877 | &next_stop, | 3877 | &next_stop, |
| 3878 | (IT_CHARPOS (*it) | 3878 | (IT_CHARPOS (*it) |
| 3879 | + TEXT_PROP_DISTANCE_LIMIT), | 3879 | + TEXT_PROP_DISTANCE_LIMIT), |
| 3880 | 0, it->base_face_id); | 3880 | false, it->base_face_id); |
| 3881 | 3881 | ||
| 3882 | /* Is this a start of a run of characters with box face? | 3882 | /* Is this a start of a run of characters with box face? |
| 3883 | Caveat: this can be called for a freshly initialized | 3883 | Caveat: this can be called for a freshly initialized |
| @@ -3953,7 +3953,7 @@ handle_face_prop (struct it *it) | |||
| 3953 | &next_stop, | 3953 | &next_stop, |
| 3954 | (IT_CHARPOS (*it) | 3954 | (IT_CHARPOS (*it) |
| 3955 | + TEXT_PROP_DISTANCE_LIMIT), | 3955 | + TEXT_PROP_DISTANCE_LIMIT), |
| 3956 | 0, | 3956 | false, |
| 3957 | from_overlay); | 3957 | from_overlay); |
| 3958 | } | 3958 | } |
| 3959 | else | 3959 | else |
| @@ -3988,7 +3988,7 @@ handle_face_prop (struct it *it) | |||
| 3988 | IT_STRING_CHARPOS (*it), | 3988 | IT_STRING_CHARPOS (*it), |
| 3989 | bufpos, | 3989 | bufpos, |
| 3990 | &next_stop, | 3990 | &next_stop, |
| 3991 | base_face_id, 0); | 3991 | base_face_id, false); |
| 3992 | 3992 | ||
| 3993 | /* Is this a start of a run of characters with box? Caveat: | 3993 | /* Is this a start of a run of characters with box? Caveat: |
| 3994 | this can be called for a freshly allocated iterator; face_id | 3994 | this can be called for a freshly allocated iterator; face_id |
| @@ -4130,7 +4130,7 @@ face_before_or_after_it_pos (struct it *it, int before_p) | |||
| 4130 | charpos, | 4130 | charpos, |
| 4131 | bufpos, | 4131 | bufpos, |
| 4132 | &next_check_charpos, | 4132 | &next_check_charpos, |
| 4133 | base_face_id, 0); | 4133 | base_face_id, false); |
| 4134 | 4134 | ||
| 4135 | /* Correct the face for charsets different from ASCII. Do it | 4135 | /* Correct the face for charsets different from ASCII. Do it |
| 4136 | for the multibyte case only. The face returned above is | 4136 | for the multibyte case only. The face returned above is |
| @@ -4219,7 +4219,7 @@ face_before_or_after_it_pos (struct it *it, int before_p) | |||
| 4219 | face_id = face_at_buffer_position (it->w, | 4219 | face_id = face_at_buffer_position (it->w, |
| 4220 | CHARPOS (pos), | 4220 | CHARPOS (pos), |
| 4221 | &next_check_charpos, | 4221 | &next_check_charpos, |
| 4222 | limit, 0, -1); | 4222 | limit, false, -1); |
| 4223 | 4223 | ||
| 4224 | /* Correct the face for charsets different from ASCII. Do it | 4224 | /* Correct the face for charsets different from ASCII. Do it |
| 4225 | for the multibyte case only. The face returned above is | 4225 | for the multibyte case only. The face returned above is |
| @@ -7165,7 +7165,7 @@ get_next_display_element (struct it *it) | |||
| 7165 | { | 7165 | { |
| 7166 | next_face_id = face_at_buffer_position | 7166 | next_face_id = face_at_buffer_position |
| 7167 | (it->w, CHARPOS (pos), &ignore, | 7167 | (it->w, CHARPOS (pos), &ignore, |
| 7168 | CHARPOS (pos) + TEXT_PROP_DISTANCE_LIMIT, 0, -1); | 7168 | CHARPOS (pos) + TEXT_PROP_DISTANCE_LIMIT, false, -1); |
| 7169 | it->end_of_box_run_p | 7169 | it->end_of_box_run_p |
| 7170 | = (FACE_FROM_ID (it->f, next_face_id)->box | 7170 | = (FACE_FROM_ID (it->f, next_face_id)->box |
| 7171 | == FACE_NO_BOX); | 7171 | == FACE_NO_BOX); |
| @@ -19551,7 +19551,7 @@ highlight_trailing_whitespace (struct frame *f, struct glyph_row *row) | |||
| 19551 | && glyph->u.ch == ' ')) | 19551 | && glyph->u.ch == ' ')) |
| 19552 | && trailing_whitespace_p (glyph->charpos)) | 19552 | && trailing_whitespace_p (glyph->charpos)) |
| 19553 | { | 19553 | { |
| 19554 | int face_id = lookup_named_face (f, Qtrailing_whitespace, 0); | 19554 | int face_id = lookup_named_face (f, Qtrailing_whitespace, false); |
| 19555 | if (face_id < 0) | 19555 | if (face_id < 0) |
| 19556 | return; | 19556 | return; |
| 19557 | 19557 | ||
| @@ -23561,7 +23561,7 @@ display_string (const char *string, Lisp_Object lisp_string, Lisp_Object face_st | |||
| 23561 | 23561 | ||
| 23562 | it->face_id | 23562 | it->face_id |
| 23563 | = face_at_string_position (it->w, face_string, face_string_pos, | 23563 | = face_at_string_position (it->w, face_string, face_string_pos, |
| 23564 | 0, &endptr, it->base_face_id, 0); | 23564 | 0, &endptr, it->base_face_id, false); |
| 23565 | face = FACE_FROM_ID (it->f, it->face_id); | 23565 | face = FACE_FROM_ID (it->f, it->face_id); |
| 23566 | it->face_box_p = face->box != FACE_NO_BOX; | 23566 | it->face_box_p = face->box != FACE_NO_BOX; |
| 23567 | } | 23567 | } |
| @@ -26067,7 +26067,7 @@ calc_line_height_property (struct it *it, Lisp_Object val, struct font *font, | |||
| 26067 | int face_id; | 26067 | int face_id; |
| 26068 | struct face *face; | 26068 | struct face *face; |
| 26069 | 26069 | ||
| 26070 | face_id = lookup_named_face (it->f, face_name, 0); | 26070 | face_id = lookup_named_face (it->f, face_name, false); |
| 26071 | if (face_id < 0) | 26071 | if (face_id < 0) |
| 26072 | return make_number (-1); | 26072 | return make_number (-1); |
| 26073 | 26073 | ||
| @@ -29283,7 +29283,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, | |||
| 29283 | charpos, | 29283 | charpos, |
| 29284 | 0, &ignore, | 29284 | 0, &ignore, |
| 29285 | glyph->face_id, | 29285 | glyph->face_id, |
| 29286 | 1); | 29286 | true); |
| 29287 | show_mouse_face (hlinfo, DRAW_MOUSE_FACE); | 29287 | show_mouse_face (hlinfo, DRAW_MOUSE_FACE); |
| 29288 | 29288 | ||
| 29289 | if (NILP (pointer)) | 29289 | if (NILP (pointer)) |
| @@ -29611,7 +29611,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 29611 | hlinfo->mouse_face_window = window; | 29611 | hlinfo->mouse_face_window = window; |
| 29612 | hlinfo->mouse_face_face_id | 29612 | hlinfo->mouse_face_face_id |
| 29613 | = face_at_string_position (w, object, pos, 0, &ignore, | 29613 | = face_at_string_position (w, object, pos, 0, &ignore, |
| 29614 | glyph->face_id, 1); | 29614 | glyph->face_id, true); |
| 29615 | show_mouse_face (hlinfo, DRAW_MOUSE_FACE); | 29615 | show_mouse_face (hlinfo, DRAW_MOUSE_FACE); |
| 29616 | cursor = No_Cursor; | 29616 | cursor = No_Cursor; |
| 29617 | } | 29617 | } |
diff --git a/src/xfaces.c b/src/xfaces.c index 31048aece5d..7c9f62683fd 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -265,11 +265,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 265 | 265 | ||
| 266 | #include <c-ctype.h> | 266 | #include <c-ctype.h> |
| 267 | 267 | ||
| 268 | /* Non-zero if face attribute ATTR is unspecified. */ | 268 | /* True if face attribute ATTR is unspecified. */ |
| 269 | 269 | ||
| 270 | #define UNSPECIFIEDP(ATTR) EQ ((ATTR), Qunspecified) | 270 | #define UNSPECIFIEDP(ATTR) EQ ((ATTR), Qunspecified) |
| 271 | 271 | ||
| 272 | /* Non-zero if face attribute ATTR is `ignore-defface'. */ | 272 | /* True if face attribute ATTR is `ignore-defface'. */ |
| 273 | 273 | ||
| 274 | #define IGNORE_DEFFACE_P(ATTR) EQ ((ATTR), QCignore_defface) | 274 | #define IGNORE_DEFFACE_P(ATTR) EQ ((ATTR), QCignore_defface) |
| 275 | 275 | ||
| @@ -318,12 +318,12 @@ static int clear_font_table_count; | |||
| 318 | 318 | ||
| 319 | int face_change_count; | 319 | int face_change_count; |
| 320 | 320 | ||
| 321 | /* Non-zero means don't display bold text if a face's foreground | 321 | /* True means don't display bold text if a face's foreground |
| 322 | and background colors are the inverse of the default colors of the | 322 | and background colors are the inverse of the default colors of the |
| 323 | display. This is a kluge to suppress `bold black' foreground text | 323 | display. This is a kluge to suppress `bold black' foreground text |
| 324 | which is hard to read on an LCD monitor. */ | 324 | which is hard to read on an LCD monitor. */ |
| 325 | 325 | ||
| 326 | static int tty_suppress_bold_inverse_default_colors_p; | 326 | static bool tty_suppress_bold_inverse_default_colors_p; |
| 327 | 327 | ||
| 328 | /* A list of the form `((x . y))' used to avoid consing in | 328 | /* A list of the form `((x . y))' used to avoid consing in |
| 329 | Finternal_set_lisp_face_attribute. */ | 329 | Finternal_set_lisp_face_attribute. */ |
| @@ -338,10 +338,10 @@ static int npixmaps_allocated; | |||
| 338 | static int ngcs; | 338 | static int ngcs; |
| 339 | #endif | 339 | #endif |
| 340 | 340 | ||
| 341 | /* Non-zero means the definition of the `menu' face for new frames has | 341 | /* True means the definition of the `menu' face for new frames has |
| 342 | been changed. */ | 342 | been changed. */ |
| 343 | 343 | ||
| 344 | static int menu_face_changed_default; | 344 | static bool menu_face_changed_default; |
| 345 | 345 | ||
| 346 | struct named_merge_point; | 346 | struct named_merge_point; |
| 347 | 347 | ||
| @@ -354,8 +354,8 @@ static bool realize_default_face (struct frame *); | |||
| 354 | static void realize_named_face (struct frame *, Lisp_Object, int); | 354 | static void realize_named_face (struct frame *, Lisp_Object, int); |
| 355 | static struct face_cache *make_face_cache (struct frame *); | 355 | static struct face_cache *make_face_cache (struct frame *); |
| 356 | static void free_face_cache (struct face_cache *); | 356 | static void free_face_cache (struct face_cache *); |
| 357 | static int merge_face_ref (struct frame *, Lisp_Object, Lisp_Object *, | 357 | static bool merge_face_ref (struct frame *, Lisp_Object, Lisp_Object *, |
| 358 | int, struct named_merge_point *); | 358 | bool, struct named_merge_point *); |
| 359 | static int color_distance (XColor *x, XColor *y); | 359 | static int color_distance (XColor *x, XColor *y); |
| 360 | 360 | ||
| 361 | #ifdef HAVE_WINDOW_SYSTEM | 361 | #ifdef HAVE_WINDOW_SYSTEM |
| @@ -638,14 +638,14 @@ recompute_basic_faces (struct frame *f) | |||
| 638 | { | 638 | { |
| 639 | if (FRAME_FACE_CACHE (f)) | 639 | if (FRAME_FACE_CACHE (f)) |
| 640 | { | 640 | { |
| 641 | clear_face_cache (0); | 641 | clear_face_cache (false); |
| 642 | if (!realize_basic_faces (f)) | 642 | if (!realize_basic_faces (f)) |
| 643 | emacs_abort (); | 643 | emacs_abort (); |
| 644 | } | 644 | } |
| 645 | } | 645 | } |
| 646 | 646 | ||
| 647 | 647 | ||
| 648 | /* Clear the face caches of all frames. CLEAR_FONTS_P non-zero means | 648 | /* Clear the face caches of all frames. CLEAR_FONTS_P means |
| 649 | try to free unused fonts, too. */ | 649 | try to free unused fonts, too. */ |
| 650 | 650 | ||
| 651 | void | 651 | void |
| @@ -715,11 +715,11 @@ the pixmap. Bits are stored row by row, each row occupies | |||
| 715 | \(WIDTH + 7)/8 bytes. */) | 715 | \(WIDTH + 7)/8 bytes. */) |
| 716 | (Lisp_Object object) | 716 | (Lisp_Object object) |
| 717 | { | 717 | { |
| 718 | bool pixmap_p = 0; | 718 | bool pixmap_p = false; |
| 719 | 719 | ||
| 720 | if (STRINGP (object)) | 720 | if (STRINGP (object)) |
| 721 | /* If OBJECT is a string, it's a file name. */ | 721 | /* If OBJECT is a string, it's a file name. */ |
| 722 | pixmap_p = 1; | 722 | pixmap_p = true; |
| 723 | else if (CONSP (object)) | 723 | else if (CONSP (object)) |
| 724 | { | 724 | { |
| 725 | /* Otherwise OBJECT must be (WIDTH HEIGHT DATA), WIDTH and | 725 | /* Otherwise OBJECT must be (WIDTH HEIGHT DATA), WIDTH and |
| @@ -749,7 +749,7 @@ the pixmap. Bits are stored row by row, each row occupies | |||
| 749 | int bytes_per_row = ((XINT (width) + BITS_PER_CHAR - 1) | 749 | int bytes_per_row = ((XINT (width) + BITS_PER_CHAR - 1) |
| 750 | / BITS_PER_CHAR); | 750 | / BITS_PER_CHAR); |
| 751 | if (XINT (height) <= SBYTES (data) / bytes_per_row) | 751 | if (XINT (height) <= SBYTES (data) / bytes_per_row) |
| 752 | pixmap_p = 1; | 752 | pixmap_p = true; |
| 753 | } | 753 | } |
| 754 | } | 754 | } |
| 755 | 755 | ||
| @@ -820,9 +820,9 @@ load_pixmap (struct frame *f, Lisp_Object name) | |||
| 820 | 820 | ||
| 821 | /* Parse RGB_LIST, and fill in the RGB fields of COLOR. | 821 | /* Parse RGB_LIST, and fill in the RGB fields of COLOR. |
| 822 | RGB_LIST should contain (at least) 3 lisp integers. | 822 | RGB_LIST should contain (at least) 3 lisp integers. |
| 823 | Return 0 if there's a problem with RGB_LIST, otherwise return 1. */ | 823 | Return true iff RGB_LIST is OK. */ |
| 824 | 824 | ||
| 825 | static int | 825 | static bool |
| 826 | parse_rgb_list (Lisp_Object rgb_list, XColor *color) | 826 | parse_rgb_list (Lisp_Object rgb_list, XColor *color) |
| 827 | { | 827 | { |
| 828 | #define PARSE_RGB_LIST_FIELD(field) \ | 828 | #define PARSE_RGB_LIST_FIELD(field) \ |
| @@ -832,13 +832,13 @@ parse_rgb_list (Lisp_Object rgb_list, XColor *color) | |||
| 832 | rgb_list = XCDR (rgb_list); \ | 832 | rgb_list = XCDR (rgb_list); \ |
| 833 | } \ | 833 | } \ |
| 834 | else \ | 834 | else \ |
| 835 | return 0; | 835 | return false; |
| 836 | 836 | ||
| 837 | PARSE_RGB_LIST_FIELD (red); | 837 | PARSE_RGB_LIST_FIELD (red); |
| 838 | PARSE_RGB_LIST_FIELD (green); | 838 | PARSE_RGB_LIST_FIELD (green); |
| 839 | PARSE_RGB_LIST_FIELD (blue); | 839 | PARSE_RGB_LIST_FIELD (blue); |
| 840 | 840 | ||
| 841 | return 1; | 841 | return true; |
| 842 | } | 842 | } |
| 843 | 843 | ||
| 844 | 844 | ||
| @@ -854,7 +854,7 @@ tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color, | |||
| 854 | Lisp_Object frame, color_desc; | 854 | Lisp_Object frame, color_desc; |
| 855 | 855 | ||
| 856 | if (!STRINGP (color) || NILP (Ffboundp (Qtty_color_desc))) | 856 | if (!STRINGP (color) || NILP (Ffboundp (Qtty_color_desc))) |
| 857 | return 0; | 857 | return false; |
| 858 | 858 | ||
| 859 | XSETFRAME (frame, f); | 859 | XSETFRAME (frame, f); |
| 860 | 860 | ||
| @@ -864,13 +864,13 @@ tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color, | |||
| 864 | Lisp_Object rgb; | 864 | Lisp_Object rgb; |
| 865 | 865 | ||
| 866 | if (! INTEGERP (XCAR (XCDR (color_desc)))) | 866 | if (! INTEGERP (XCAR (XCDR (color_desc)))) |
| 867 | return 0; | 867 | return false; |
| 868 | 868 | ||
| 869 | tty_color->pixel = XINT (XCAR (XCDR (color_desc))); | 869 | tty_color->pixel = XINT (XCAR (XCDR (color_desc))); |
| 870 | 870 | ||
| 871 | rgb = XCDR (XCDR (color_desc)); | 871 | rgb = XCDR (XCDR (color_desc)); |
| 872 | if (! parse_rgb_list (rgb, tty_color)) | 872 | if (! parse_rgb_list (rgb, tty_color)) |
| 873 | return 0; | 873 | return false; |
| 874 | 874 | ||
| 875 | /* Should we fill in STD_COLOR too? */ | 875 | /* Should we fill in STD_COLOR too? */ |
| 876 | if (std_color) | 876 | if (std_color) |
| @@ -889,21 +889,21 @@ tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color, | |||
| 889 | /* Look up STD_COLOR separately. */ | 889 | /* Look up STD_COLOR separately. */ |
| 890 | rgb = call1 (Qtty_color_standard_values, color); | 890 | rgb = call1 (Qtty_color_standard_values, color); |
| 891 | if (! parse_rgb_list (rgb, std_color)) | 891 | if (! parse_rgb_list (rgb, std_color)) |
| 892 | return 0; | 892 | return false; |
| 893 | } | 893 | } |
| 894 | } | 894 | } |
| 895 | 895 | ||
| 896 | return 1; | 896 | return true; |
| 897 | } | 897 | } |
| 898 | else if (NILP (Fsymbol_value (intern ("tty-defined-color-alist")))) | 898 | else if (NILP (Fsymbol_value (intern ("tty-defined-color-alist")))) |
| 899 | /* We were called early during startup, and the colors are not | 899 | /* We were called early during startup, and the colors are not |
| 900 | yet set up in tty-defined-color-alist. Don't return a failure | 900 | yet set up in tty-defined-color-alist. Don't return a failure |
| 901 | indication, since this produces the annoying "Unable to | 901 | indication, since this produces the annoying "Unable to |
| 902 | load color" messages in the *Messages* buffer. */ | 902 | load color" messages in the *Messages* buffer. */ |
| 903 | return 1; | 903 | return true; |
| 904 | else | 904 | else |
| 905 | /* tty-color-desc seems to have returned a bad value. */ | 905 | /* tty-color-desc seems to have returned a bad value. */ |
| 906 | return 0; | 906 | return false; |
| 907 | } | 907 | } |
| 908 | 908 | ||
| 909 | /* A version of defined_color for non-X frames. */ | 909 | /* A version of defined_color for non-X frames. */ |
| @@ -912,7 +912,7 @@ static bool | |||
| 912 | tty_defined_color (struct frame *f, const char *color_name, | 912 | tty_defined_color (struct frame *f, const char *color_name, |
| 913 | XColor *color_def, bool alloc) | 913 | XColor *color_def, bool alloc) |
| 914 | { | 914 | { |
| 915 | bool status = 1; | 915 | bool status = true; |
| 916 | 916 | ||
| 917 | /* Defaults. */ | 917 | /* Defaults. */ |
| 918 | color_def->pixel = FACE_TTY_DEFAULT_COLOR; | 918 | color_def->pixel = FACE_TTY_DEFAULT_COLOR; |
| @@ -932,7 +932,7 @@ tty_defined_color (struct frame *f, const char *color_name, | |||
| 932 | } | 932 | } |
| 933 | 933 | ||
| 934 | if (color_def->pixel != FACE_TTY_DEFAULT_COLOR) | 934 | if (color_def->pixel != FACE_TTY_DEFAULT_COLOR) |
| 935 | status = 1; | 935 | status = true; |
| 936 | 936 | ||
| 937 | return status; | 937 | return status; |
| 938 | } | 938 | } |
| @@ -960,7 +960,7 @@ defined_color (struct frame *f, const char *color_name, XColor *color_def, | |||
| 960 | #endif | 960 | #endif |
| 961 | #ifdef HAVE_NS | 961 | #ifdef HAVE_NS |
| 962 | else if (FRAME_NS_P (f)) | 962 | else if (FRAME_NS_P (f)) |
| 963 | return ns_defined_color (f, color_name, color_def, alloc, 1); | 963 | return ns_defined_color (f, color_name, color_def, alloc, true); |
| 964 | #endif | 964 | #endif |
| 965 | else | 965 | else |
| 966 | emacs_abort (); | 966 | emacs_abort (); |
| @@ -1000,18 +1000,18 @@ tty_color_name (struct frame *f, int idx) | |||
| 1000 | } | 1000 | } |
| 1001 | 1001 | ||
| 1002 | 1002 | ||
| 1003 | /* Return non-zero if COLOR_NAME is a shade of gray (or white or | 1003 | /* Return true if COLOR_NAME is a shade of gray (or white or |
| 1004 | black) on frame F. | 1004 | black) on frame F. |
| 1005 | 1005 | ||
| 1006 | The criterion implemented here is not a terribly sophisticated one. */ | 1006 | The criterion implemented here is not a terribly sophisticated one. */ |
| 1007 | 1007 | ||
| 1008 | static int | 1008 | static bool |
| 1009 | face_color_gray_p (struct frame *f, const char *color_name) | 1009 | face_color_gray_p (struct frame *f, const char *color_name) |
| 1010 | { | 1010 | { |
| 1011 | XColor color; | 1011 | XColor color; |
| 1012 | int gray_p; | 1012 | bool gray_p; |
| 1013 | 1013 | ||
| 1014 | if (defined_color (f, color_name, &color, 0)) | 1014 | if (defined_color (f, color_name, &color, false)) |
| 1015 | gray_p = (/* Any color sufficiently close to black counts as gray. */ | 1015 | gray_p = (/* Any color sufficiently close to black counts as gray. */ |
| 1016 | (color.red < 5000 && color.green < 5000 && color.blue < 5000) | 1016 | (color.red < 5000 && color.green < 5000 && color.blue < 5000) |
| 1017 | || | 1017 | || |
| @@ -1022,19 +1022,18 @@ face_color_gray_p (struct frame *f, const char *color_name) | |||
| 1022 | && (eabs (color.blue - color.red) | 1022 | && (eabs (color.blue - color.red) |
| 1023 | < max (color.blue, color.red) / 20))); | 1023 | < max (color.blue, color.red) / 20))); |
| 1024 | else | 1024 | else |
| 1025 | gray_p = 0; | 1025 | gray_p = false; |
| 1026 | 1026 | ||
| 1027 | return gray_p; | 1027 | return gray_p; |
| 1028 | } | 1028 | } |
| 1029 | 1029 | ||
| 1030 | 1030 | ||
| 1031 | /* Return non-zero if color COLOR_NAME can be displayed on frame F. | 1031 | /* Return true if color COLOR_NAME can be displayed on frame F. |
| 1032 | BACKGROUND_P non-zero means the color will be used as background | 1032 | BACKGROUND_P means the color will be used as background color. */ |
| 1033 | color. */ | ||
| 1034 | 1033 | ||
| 1035 | static int | 1034 | static bool |
| 1036 | face_color_supported_p (struct frame *f, const char *color_name, | 1035 | face_color_supported_p (struct frame *f, const char *color_name, |
| 1037 | int background_p) | 1036 | bool background_p) |
| 1038 | { | 1037 | { |
| 1039 | Lisp_Object frame; | 1038 | Lisp_Object frame; |
| 1040 | XColor not_used; | 1039 | XColor not_used; |
| @@ -1052,7 +1051,7 @@ face_color_supported_p (struct frame *f, const char *color_name, | |||
| 1052 | && face_color_gray_p (f, color_name))) | 1051 | && face_color_gray_p (f, color_name))) |
| 1053 | : | 1052 | : |
| 1054 | #endif | 1053 | #endif |
| 1055 | tty_defined_color (f, color_name, ¬_used, 0); | 1054 | tty_defined_color (f, color_name, ¬_used, false); |
| 1056 | } | 1055 | } |
| 1057 | 1056 | ||
| 1058 | 1057 | ||
| @@ -1098,39 +1097,39 @@ load_color2 (struct frame *f, struct face *face, Lisp_Object name, | |||
| 1098 | 1097 | ||
| 1099 | /* if the color map is full, defined_color will return a best match | 1098 | /* if the color map is full, defined_color will return a best match |
| 1100 | to the values in an existing cell. */ | 1099 | to the values in an existing cell. */ |
| 1101 | if (!defined_color (f, SSDATA (name), color, 1)) | 1100 | if (!defined_color (f, SSDATA (name), color, true)) |
| 1102 | { | 1101 | { |
| 1103 | add_to_log ("Unable to load color \"%s\"", name, Qnil); | 1102 | add_to_log ("Unable to load color \"%s\"", name, Qnil); |
| 1104 | 1103 | ||
| 1105 | switch (target_index) | 1104 | switch (target_index) |
| 1106 | { | 1105 | { |
| 1107 | case LFACE_FOREGROUND_INDEX: | 1106 | case LFACE_FOREGROUND_INDEX: |
| 1108 | face->foreground_defaulted_p = 1; | 1107 | face->foreground_defaulted_p = true; |
| 1109 | color->pixel = FRAME_FOREGROUND_PIXEL (f); | 1108 | color->pixel = FRAME_FOREGROUND_PIXEL (f); |
| 1110 | break; | 1109 | break; |
| 1111 | 1110 | ||
| 1112 | case LFACE_BACKGROUND_INDEX: | 1111 | case LFACE_BACKGROUND_INDEX: |
| 1113 | face->background_defaulted_p = 1; | 1112 | face->background_defaulted_p = true; |
| 1114 | color->pixel = FRAME_BACKGROUND_PIXEL (f); | 1113 | color->pixel = FRAME_BACKGROUND_PIXEL (f); |
| 1115 | break; | 1114 | break; |
| 1116 | 1115 | ||
| 1117 | case LFACE_UNDERLINE_INDEX: | 1116 | case LFACE_UNDERLINE_INDEX: |
| 1118 | face->underline_defaulted_p = 1; | 1117 | face->underline_defaulted_p = true; |
| 1119 | color->pixel = FRAME_FOREGROUND_PIXEL (f); | 1118 | color->pixel = FRAME_FOREGROUND_PIXEL (f); |
| 1120 | break; | 1119 | break; |
| 1121 | 1120 | ||
| 1122 | case LFACE_OVERLINE_INDEX: | 1121 | case LFACE_OVERLINE_INDEX: |
| 1123 | face->overline_color_defaulted_p = 1; | 1122 | face->overline_color_defaulted_p = true; |
| 1124 | color->pixel = FRAME_FOREGROUND_PIXEL (f); | 1123 | color->pixel = FRAME_FOREGROUND_PIXEL (f); |
| 1125 | break; | 1124 | break; |
| 1126 | 1125 | ||
| 1127 | case LFACE_STRIKE_THROUGH_INDEX: | 1126 | case LFACE_STRIKE_THROUGH_INDEX: |
| 1128 | face->strike_through_color_defaulted_p = 1; | 1127 | face->strike_through_color_defaulted_p = true; |
| 1129 | color->pixel = FRAME_FOREGROUND_PIXEL (f); | 1128 | color->pixel = FRAME_FOREGROUND_PIXEL (f); |
| 1130 | break; | 1129 | break; |
| 1131 | 1130 | ||
| 1132 | case LFACE_BOX_INDEX: | 1131 | case LFACE_BOX_INDEX: |
| 1133 | face->box_color_defaulted_p = 1; | 1132 | face->box_color_defaulted_p = true; |
| 1134 | color->pixel = FRAME_FOREGROUND_PIXEL (f); | 1133 | color->pixel = FRAME_FOREGROUND_PIXEL (f); |
| 1135 | break; | 1134 | break; |
| 1136 | 1135 | ||
| @@ -1196,7 +1195,7 @@ load_face_colors (struct frame *f, struct face *face, | |||
| 1196 | face_color_supported_p is smart enough to know that grays are | 1195 | face_color_supported_p is smart enough to know that grays are |
| 1197 | "supported" as background because we are supposed to use stipple | 1196 | "supported" as background because we are supposed to use stipple |
| 1198 | for them. */ | 1197 | for them. */ |
| 1199 | if (!face_color_supported_p (f, SSDATA (bg), 0) | 1198 | if (!face_color_supported_p (f, SSDATA (bg), false) |
| 1200 | && !NILP (Fbitmap_spec_p (Vface_default_stipple))) | 1199 | && !NILP (Fbitmap_spec_p (Vface_default_stipple))) |
| 1201 | { | 1200 | { |
| 1202 | x_destroy_bitmap (f, face->stipple); | 1201 | x_destroy_bitmap (f, face->stipple); |
| @@ -1561,7 +1560,7 @@ the WIDTH times as wide as FACE on FRAME. */) | |||
| 1561 | { | 1560 | { |
| 1562 | /* This is of limited utility since it works with character | 1561 | /* This is of limited utility since it works with character |
| 1563 | widths. Keep it for compatibility. --gerd. */ | 1562 | widths. Keep it for compatibility. --gerd. */ |
| 1564 | int face_id = lookup_named_face (f, face, 0); | 1563 | int face_id = lookup_named_face (f, face, false); |
| 1565 | struct face *width_face = (face_id < 0 | 1564 | struct face *width_face = (face_id < 0 |
| 1566 | ? NULL | 1565 | ? NULL |
| 1567 | : FACE_FROM_ID (f, face_id)); | 1566 | : FACE_FROM_ID (f, face_id)); |
| @@ -1643,7 +1642,7 @@ the WIDTH times as wide as FACE on FRAME. */) | |||
| 1643 | #define LFACE_DISTANT_FOREGROUND(LFACE) \ | 1642 | #define LFACE_DISTANT_FOREGROUND(LFACE) \ |
| 1644 | AREF ((LFACE), LFACE_DISTANT_FOREGROUND_INDEX) | 1643 | AREF ((LFACE), LFACE_DISTANT_FOREGROUND_INDEX) |
| 1645 | 1644 | ||
| 1646 | /* Non-zero if LFACE is a Lisp face. A Lisp face is a vector of size | 1645 | /* True if LFACE is a Lisp face. A Lisp face is a vector of size |
| 1647 | LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */ | 1646 | LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */ |
| 1648 | 1647 | ||
| 1649 | #define LFACEP(LFACE) \ | 1648 | #define LFACEP(LFACE) \ |
| @@ -1773,12 +1772,12 @@ struct named_merge_point | |||
| 1773 | }; | 1772 | }; |
| 1774 | 1773 | ||
| 1775 | 1774 | ||
| 1776 | /* If a face merging cycle is detected for FACE_NAME, return 0, | 1775 | /* If a face merging cycle is detected for FACE_NAME, return false, |
| 1777 | otherwise add NEW_NAMED_MERGE_POINT, which is initialized using | 1776 | otherwise add NEW_NAMED_MERGE_POINT, which is initialized using |
| 1778 | FACE_NAME and NAMED_MERGE_POINT_KIND, as the head of the linked list | 1777 | FACE_NAME and NAMED_MERGE_POINT_KIND, as the head of the linked list |
| 1779 | pointed to by NAMED_MERGE_POINTS, and return 1. */ | 1778 | pointed to by NAMED_MERGE_POINTS, and return true. */ |
| 1780 | 1779 | ||
| 1781 | static int | 1780 | static bool |
| 1782 | push_named_merge_point (struct named_merge_point *new_named_merge_point, | 1781 | push_named_merge_point (struct named_merge_point *new_named_merge_point, |
| 1783 | Lisp_Object face_name, | 1782 | Lisp_Object face_name, |
| 1784 | enum named_merge_point_kind named_merge_point_kind, | 1783 | enum named_merge_point_kind named_merge_point_kind, |
| @@ -1791,7 +1790,7 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point, | |||
| 1791 | { | 1790 | { |
| 1792 | if (prev->named_merge_point_kind == named_merge_point_kind) | 1791 | if (prev->named_merge_point_kind == named_merge_point_kind) |
| 1793 | /* A cycle, so fail. */ | 1792 | /* A cycle, so fail. */ |
| 1794 | return 0; | 1793 | return false; |
| 1795 | else if (prev->named_merge_point_kind == NAMED_MERGE_POINT_REMAP) | 1794 | else if (prev->named_merge_point_kind == NAMED_MERGE_POINT_REMAP) |
| 1796 | /* A remap `hides ' any previous normal merge points | 1795 | /* A remap `hides ' any previous normal merge points |
| 1797 | (because the remap means that it's actually different face), | 1796 | (because the remap means that it's actually different face), |
| @@ -1806,7 +1805,7 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point, | |||
| 1806 | 1805 | ||
| 1807 | *named_merge_points = new_named_merge_point; | 1806 | *named_merge_points = new_named_merge_point; |
| 1808 | 1807 | ||
| 1809 | return 1; | 1808 | return true; |
| 1810 | } | 1809 | } |
| 1811 | 1810 | ||
| 1812 | 1811 | ||
| @@ -1817,7 +1816,7 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point, | |||
| 1817 | Return default face in case of errors. */ | 1816 | Return default face in case of errors. */ |
| 1818 | 1817 | ||
| 1819 | static Lisp_Object | 1818 | static Lisp_Object |
| 1820 | resolve_face_name (Lisp_Object face_name, int signal_p) | 1819 | resolve_face_name (Lisp_Object face_name, bool signal_p) |
| 1821 | { | 1820 | { |
| 1822 | Lisp_Object orig_face; | 1821 | Lisp_Object orig_face; |
| 1823 | Lisp_Object tortoise, hare; | 1822 | Lisp_Object tortoise, hare; |
| @@ -1831,7 +1830,7 @@ resolve_face_name (Lisp_Object face_name, int signal_p) | |||
| 1831 | orig_face = face_name; | 1830 | orig_face = face_name; |
| 1832 | tortoise = hare = face_name; | 1831 | tortoise = hare = face_name; |
| 1833 | 1832 | ||
| 1834 | while (1) | 1833 | while (true) |
| 1835 | { | 1834 | { |
| 1836 | face_name = hare; | 1835 | face_name = hare; |
| 1837 | hare = Fget (hare, Qface_alias); | 1836 | hare = Fget (hare, Qface_alias); |
| @@ -1859,12 +1858,12 @@ resolve_face_name (Lisp_Object face_name, int signal_p) | |||
| 1859 | /* Return the face definition of FACE_NAME on frame F. F null means | 1858 | /* Return the face definition of FACE_NAME on frame F. F null means |
| 1860 | return the definition for new frames. FACE_NAME may be a string or | 1859 | return the definition for new frames. FACE_NAME may be a string or |
| 1861 | a symbol (apparently Emacs 20.2 allowed strings as face names in | 1860 | a symbol (apparently Emacs 20.2 allowed strings as face names in |
| 1862 | face text properties; Ediff uses that). If SIGNAL_P is non-zero, | 1861 | face text properties; Ediff uses that). |
| 1863 | signal an error if FACE_NAME is not a valid face name. If SIGNAL_P | 1862 | If SIGNAL_P, signal an error if FACE_NAME is not a valid face name. |
| 1864 | is zero, value is nil if FACE_NAME is not a valid face name. */ | 1863 | Otherwise, value is nil if FACE_NAME is not a valid face name. */ |
| 1865 | static Lisp_Object | 1864 | static Lisp_Object |
| 1866 | lface_from_face_name_no_resolve (struct frame *f, Lisp_Object face_name, | 1865 | lface_from_face_name_no_resolve (struct frame *f, Lisp_Object face_name, |
| 1867 | int signal_p) | 1866 | bool signal_p) |
| 1868 | { | 1867 | { |
| 1869 | Lisp_Object lface; | 1868 | Lisp_Object lface; |
| 1870 | 1869 | ||
| @@ -1887,12 +1886,11 @@ lface_from_face_name_no_resolve (struct frame *f, Lisp_Object face_name, | |||
| 1887 | return the definition for new frames. FACE_NAME may be a string or | 1886 | return the definition for new frames. FACE_NAME may be a string or |
| 1888 | a symbol (apparently Emacs 20.2 allowed strings as face names in | 1887 | a symbol (apparently Emacs 20.2 allowed strings as face names in |
| 1889 | face text properties; Ediff uses that). If FACE_NAME is an alias | 1888 | face text properties; Ediff uses that). If FACE_NAME is an alias |
| 1890 | for another face, return that face's definition. If SIGNAL_P is | 1889 | for another face, return that face's definition. |
| 1891 | non-zero, signal an error if FACE_NAME is not a valid face name. | 1890 | If SIGNAL_P, signal an error if FACE_NAME is not a valid face name. |
| 1892 | If SIGNAL_P is zero, value is nil if FACE_NAME is not a valid face | 1891 | Otherwise, value is nil if FACE_NAME is not a valid face name. */ |
| 1893 | name. */ | ||
| 1894 | static Lisp_Object | 1892 | static Lisp_Object |
| 1895 | lface_from_face_name (struct frame *f, Lisp_Object face_name, int signal_p) | 1893 | lface_from_face_name (struct frame *f, Lisp_Object face_name, bool signal_p) |
| 1896 | { | 1894 | { |
| 1897 | face_name = resolve_face_name (face_name, signal_p); | 1895 | face_name = resolve_face_name (face_name, signal_p); |
| 1898 | return lface_from_face_name_no_resolve (f, face_name, signal_p); | 1896 | return lface_from_face_name_no_resolve (f, face_name, signal_p); |
| @@ -1901,14 +1899,14 @@ lface_from_face_name (struct frame *f, Lisp_Object face_name, int signal_p) | |||
| 1901 | 1899 | ||
| 1902 | /* Get face attributes of face FACE_NAME from frame-local faces on | 1900 | /* Get face attributes of face FACE_NAME from frame-local faces on |
| 1903 | frame F. Store the resulting attributes in ATTRS which must point | 1901 | frame F. Store the resulting attributes in ATTRS which must point |
| 1904 | to a vector of Lisp_Objects of size LFACE_VECTOR_SIZE. If SIGNAL_P | 1902 | to a vector of Lisp_Objects of size LFACE_VECTOR_SIZE. |
| 1905 | is non-zero, signal an error if FACE_NAME does not name a face. | 1903 | If SIGNAL_P, signal an error if FACE_NAME does not name a face. |
| 1906 | Otherwise, value is zero if FACE_NAME is not a face. */ | 1904 | Otherwise, return true iff FACE_NAME is a face. */ |
| 1907 | 1905 | ||
| 1908 | static int | 1906 | static bool |
| 1909 | get_lface_attributes_no_remap (struct frame *f, Lisp_Object face_name, | 1907 | get_lface_attributes_no_remap (struct frame *f, Lisp_Object face_name, |
| 1910 | Lisp_Object attrs[LFACE_VECTOR_SIZE], | 1908 | Lisp_Object attrs[LFACE_VECTOR_SIZE], |
| 1911 | int signal_p) | 1909 | bool signal_p) |
| 1912 | { | 1910 | { |
| 1913 | Lisp_Object lface; | 1911 | Lisp_Object lface; |
| 1914 | 1912 | ||
| @@ -1924,13 +1922,13 @@ get_lface_attributes_no_remap (struct frame *f, Lisp_Object face_name, | |||
| 1924 | /* Get face attributes of face FACE_NAME from frame-local faces on frame | 1922 | /* Get face attributes of face FACE_NAME from frame-local faces on frame |
| 1925 | F. Store the resulting attributes in ATTRS which must point to a | 1923 | F. Store the resulting attributes in ATTRS which must point to a |
| 1926 | vector of Lisp_Objects of size LFACE_VECTOR_SIZE. If FACE_NAME is an | 1924 | vector of Lisp_Objects of size LFACE_VECTOR_SIZE. If FACE_NAME is an |
| 1927 | alias for another face, use that face's definition. If SIGNAL_P is | 1925 | alias for another face, use that face's definition. |
| 1928 | non-zero, signal an error if FACE_NAME does not name a face. | 1926 | If SIGNAL_P, signal an error if FACE_NAME does not name a face. |
| 1929 | Otherwise, value is zero if FACE_NAME is not a face. */ | 1927 | Otherwise, return true iff FACE_NAME is a face. */ |
| 1930 | 1928 | ||
| 1931 | static int | 1929 | static bool |
| 1932 | get_lface_attributes (struct frame *f, Lisp_Object face_name, | 1930 | get_lface_attributes (struct frame *f, Lisp_Object face_name, |
| 1933 | Lisp_Object attrs[LFACE_VECTOR_SIZE], int signal_p, | 1931 | Lisp_Object attrs[LFACE_VECTOR_SIZE], bool signal_p, |
| 1934 | struct named_merge_point *named_merge_points) | 1932 | struct named_merge_point *named_merge_points) |
| 1935 | { | 1933 | { |
| 1936 | Lisp_Object face_remapping; | 1934 | Lisp_Object face_remapping; |
| @@ -1963,10 +1961,10 @@ get_lface_attributes (struct frame *f, Lisp_Object face_name, | |||
| 1963 | } | 1961 | } |
| 1964 | 1962 | ||
| 1965 | 1963 | ||
| 1966 | /* Non-zero if all attributes in face attribute vector ATTRS are | 1964 | /* True iff all attributes in face attribute vector ATTRS are |
| 1967 | specified, i.e. are non-nil. */ | 1965 | specified, i.e. are non-nil. */ |
| 1968 | 1966 | ||
| 1969 | static int | 1967 | static bool |
| 1970 | lface_fully_specified_p (Lisp_Object attrs[LFACE_VECTOR_SIZE]) | 1968 | lface_fully_specified_p (Lisp_Object attrs[LFACE_VECTOR_SIZE]) |
| 1971 | { | 1969 | { |
| 1972 | int i; | 1970 | int i; |
| @@ -1983,13 +1981,13 @@ lface_fully_specified_p (Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 1983 | #ifdef HAVE_WINDOW_SYSTEM | 1981 | #ifdef HAVE_WINDOW_SYSTEM |
| 1984 | 1982 | ||
| 1985 | /* Set font-related attributes of Lisp face LFACE from FONT-OBJECT. | 1983 | /* Set font-related attributes of Lisp face LFACE from FONT-OBJECT. |
| 1986 | If FORCE_P is zero, set only unspecified attributes of LFACE. The | 1984 | If FORCE_P, set only unspecified attributes of LFACE. The |
| 1987 | exception is `font' attribute. It is set to FONT_OBJECT regardless | 1985 | exception is `font' attribute. It is set to FONT_OBJECT regardless |
| 1988 | of FORCE_P. */ | 1986 | of FORCE_P. */ |
| 1989 | 1987 | ||
| 1990 | static int | 1988 | static void |
| 1991 | set_lface_from_font (struct frame *f, Lisp_Object lface, | 1989 | set_lface_from_font (struct frame *f, Lisp_Object lface, |
| 1992 | Lisp_Object font_object, int force_p) | 1990 | Lisp_Object font_object, bool force_p) |
| 1993 | { | 1991 | { |
| 1994 | Lisp_Object val; | 1992 | Lisp_Object val; |
| 1995 | struct font *font = XFONT_OBJECT (font_object); | 1993 | struct font *font = XFONT_OBJECT (font_object); |
| @@ -2037,7 +2035,6 @@ set_lface_from_font (struct frame *f, Lisp_Object lface, | |||
| 2037 | } | 2035 | } |
| 2038 | 2036 | ||
| 2039 | ASET (lface, LFACE_FONT_INDEX, font_object); | 2037 | ASET (lface, LFACE_FONT_INDEX, font_object); |
| 2040 | return 1; | ||
| 2041 | } | 2038 | } |
| 2042 | 2039 | ||
| 2043 | #endif /* HAVE_WINDOW_SYSTEM */ | 2040 | #endif /* HAVE_WINDOW_SYSTEM */ |
| @@ -2108,7 +2105,7 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to, | |||
| 2108 | other code uses `unspecified' as a generic value for face attributes. */ | 2105 | other code uses `unspecified' as a generic value for face attributes. */ |
| 2109 | if (!UNSPECIFIEDP (from[LFACE_INHERIT_INDEX]) | 2106 | if (!UNSPECIFIEDP (from[LFACE_INHERIT_INDEX]) |
| 2110 | && !NILP (from[LFACE_INHERIT_INDEX])) | 2107 | && !NILP (from[LFACE_INHERIT_INDEX])) |
| 2111 | merge_face_ref (f, from[LFACE_INHERIT_INDEX], to, 0, named_merge_points); | 2108 | merge_face_ref (f, from[LFACE_INHERIT_INDEX], to, false, named_merge_points); |
| 2112 | 2109 | ||
| 2113 | if (FONT_SPEC_P (from[LFACE_FONT_INDEX])) | 2110 | if (FONT_SPEC_P (from[LFACE_FONT_INDEX])) |
| 2114 | { | 2111 | { |
| @@ -2166,11 +2163,11 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to, | |||
| 2166 | } | 2163 | } |
| 2167 | 2164 | ||
| 2168 | /* Merge the named face FACE_NAME on frame F, into the vector of face | 2165 | /* Merge the named face FACE_NAME on frame F, into the vector of face |
| 2169 | attributes TO. NAMED_MERGE_POINTS is used to detect loops in face | 2166 | attributes TO. Use NAMED_MERGE_POINTS to detect loops in face |
| 2170 | inheritance. Returns true if FACE_NAME is a valid face name and | 2167 | inheritance. Return true if FACE_NAME is a valid face name and |
| 2171 | merging succeeded. */ | 2168 | merging succeeded. */ |
| 2172 | 2169 | ||
| 2173 | static int | 2170 | static bool |
| 2174 | merge_named_face (struct frame *f, Lisp_Object face_name, Lisp_Object *to, | 2171 | merge_named_face (struct frame *f, Lisp_Object face_name, Lisp_Object *to, |
| 2175 | struct named_merge_point *named_merge_points) | 2172 | struct named_merge_point *named_merge_points) |
| 2176 | { | 2173 | { |
| @@ -2182,7 +2179,8 @@ merge_named_face (struct frame *f, Lisp_Object face_name, Lisp_Object *to, | |||
| 2182 | { | 2179 | { |
| 2183 | struct gcpro gcpro1; | 2180 | struct gcpro gcpro1; |
| 2184 | Lisp_Object from[LFACE_VECTOR_SIZE]; | 2181 | Lisp_Object from[LFACE_VECTOR_SIZE]; |
| 2185 | int ok = get_lface_attributes (f, face_name, from, 0, named_merge_points); | 2182 | bool ok = get_lface_attributes (f, face_name, from, false, |
| 2183 | named_merge_points); | ||
| 2186 | 2184 | ||
| 2187 | if (ok) | 2185 | if (ok) |
| 2188 | { | 2186 | { |
| @@ -2194,15 +2192,15 @@ merge_named_face (struct frame *f, Lisp_Object face_name, Lisp_Object *to, | |||
| 2194 | return ok; | 2192 | return ok; |
| 2195 | } | 2193 | } |
| 2196 | else | 2194 | else |
| 2197 | return 0; | 2195 | return false; |
| 2198 | } | 2196 | } |
| 2199 | 2197 | ||
| 2200 | 2198 | ||
| 2201 | /* Merge face attributes from the lisp `face reference' FACE_REF on | 2199 | /* Merge face attributes from the lisp `face reference' FACE_REF on |
| 2202 | frame F into the face attribute vector TO. If ERR_MSGS is non-zero, | 2200 | frame F into the face attribute vector TO. If ERR_MSGS, |
| 2203 | problems with FACE_REF cause an error message to be shown. Return | 2201 | problems with FACE_REF cause an error message to be shown. Return |
| 2204 | non-zero if no errors occurred (regardless of the value of ERR_MSGS). | 2202 | true if no errors occurred (regardless of the value of ERR_MSGS). |
| 2205 | NAMED_MERGE_POINTS is used to detect loops in face inheritance or | 2203 | Use NAMED_MERGE_POINTS to detect loops in face inheritance or |
| 2206 | list structure; it may be 0 for most callers. | 2204 | list structure; it may be 0 for most callers. |
| 2207 | 2205 | ||
| 2208 | FACE_REF may be a single face specification or a list of such | 2206 | FACE_REF may be a single face specification or a list of such |
| @@ -2221,11 +2219,11 @@ merge_named_face (struct frame *f, Lisp_Object face_name, Lisp_Object *to, | |||
| 2221 | Face specifications earlier in lists take precedence over later | 2219 | Face specifications earlier in lists take precedence over later |
| 2222 | specifications. */ | 2220 | specifications. */ |
| 2223 | 2221 | ||
| 2224 | static int | 2222 | static bool |
| 2225 | merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | 2223 | merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, |
| 2226 | int err_msgs, struct named_merge_point *named_merge_points) | 2224 | bool err_msgs, struct named_merge_point *named_merge_points) |
| 2227 | { | 2225 | { |
| 2228 | int ok = 1; /* Succeed without an error? */ | 2226 | bool ok = true; /* Succeed without an error? */ |
| 2229 | 2227 | ||
| 2230 | if (CONSP (face_ref)) | 2228 | if (CONSP (face_ref)) |
| 2231 | { | 2229 | { |
| @@ -2250,7 +2248,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2250 | { | 2248 | { |
| 2251 | if (err_msgs) | 2249 | if (err_msgs) |
| 2252 | add_to_log ("Invalid face color", color_name, Qnil); | 2250 | add_to_log ("Invalid face color", color_name, Qnil); |
| 2253 | ok = 0; | 2251 | ok = false; |
| 2254 | } | 2252 | } |
| 2255 | } | 2253 | } |
| 2256 | else if (SYMBOLP (first) | 2254 | else if (SYMBOLP (first) |
| @@ -2261,7 +2259,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2261 | { | 2259 | { |
| 2262 | Lisp_Object keyword = XCAR (face_ref); | 2260 | Lisp_Object keyword = XCAR (face_ref); |
| 2263 | Lisp_Object value = XCAR (XCDR (face_ref)); | 2261 | Lisp_Object value = XCAR (XCDR (face_ref)); |
| 2264 | int err = 0; | 2262 | bool err = false; |
| 2265 | 2263 | ||
| 2266 | /* Specifying `unspecified' is a no-op. */ | 2264 | /* Specifying `unspecified' is a no-op. */ |
| 2267 | if (EQ (value, Qunspecified)) | 2265 | if (EQ (value, Qunspecified)) |
| @@ -2274,7 +2272,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2274 | font_clear_prop (to, FONT_FAMILY_INDEX); | 2272 | font_clear_prop (to, FONT_FAMILY_INDEX); |
| 2275 | } | 2273 | } |
| 2276 | else | 2274 | else |
| 2277 | err = 1; | 2275 | err = true; |
| 2278 | } | 2276 | } |
| 2279 | else if (EQ (keyword, QCfoundry)) | 2277 | else if (EQ (keyword, QCfoundry)) |
| 2280 | { | 2278 | { |
| @@ -2284,7 +2282,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2284 | font_clear_prop (to, FONT_FOUNDRY_INDEX); | 2282 | font_clear_prop (to, FONT_FOUNDRY_INDEX); |
| 2285 | } | 2283 | } |
| 2286 | else | 2284 | else |
| 2287 | err = 1; | 2285 | err = true; |
| 2288 | } | 2286 | } |
| 2289 | else if (EQ (keyword, QCheight)) | 2287 | else if (EQ (keyword, QCheight)) |
| 2290 | { | 2288 | { |
| @@ -2297,7 +2295,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2297 | font_clear_prop (to, FONT_SIZE_INDEX); | 2295 | font_clear_prop (to, FONT_SIZE_INDEX); |
| 2298 | } | 2296 | } |
| 2299 | else | 2297 | else |
| 2300 | err = 1; | 2298 | err = true; |
| 2301 | } | 2299 | } |
| 2302 | else if (EQ (keyword, QCweight)) | 2300 | else if (EQ (keyword, QCweight)) |
| 2303 | { | 2301 | { |
| @@ -2307,7 +2305,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2307 | font_clear_prop (to, FONT_WEIGHT_INDEX); | 2305 | font_clear_prop (to, FONT_WEIGHT_INDEX); |
| 2308 | } | 2306 | } |
| 2309 | else | 2307 | else |
| 2310 | err = 1; | 2308 | err = true; |
| 2311 | } | 2309 | } |
| 2312 | else if (EQ (keyword, QCslant)) | 2310 | else if (EQ (keyword, QCslant)) |
| 2313 | { | 2311 | { |
| @@ -2317,7 +2315,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2317 | font_clear_prop (to, FONT_SLANT_INDEX); | 2315 | font_clear_prop (to, FONT_SLANT_INDEX); |
| 2318 | } | 2316 | } |
| 2319 | else | 2317 | else |
| 2320 | err = 1; | 2318 | err = true; |
| 2321 | } | 2319 | } |
| 2322 | else if (EQ (keyword, QCunderline)) | 2320 | else if (EQ (keyword, QCunderline)) |
| 2323 | { | 2321 | { |
| @@ -2327,7 +2325,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2327 | || CONSP (value)) | 2325 | || CONSP (value)) |
| 2328 | to[LFACE_UNDERLINE_INDEX] = value; | 2326 | to[LFACE_UNDERLINE_INDEX] = value; |
| 2329 | else | 2327 | else |
| 2330 | err = 1; | 2328 | err = true; |
| 2331 | } | 2329 | } |
| 2332 | else if (EQ (keyword, QCoverline)) | 2330 | else if (EQ (keyword, QCoverline)) |
| 2333 | { | 2331 | { |
| @@ -2336,7 +2334,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2336 | || STRINGP (value)) | 2334 | || STRINGP (value)) |
| 2337 | to[LFACE_OVERLINE_INDEX] = value; | 2335 | to[LFACE_OVERLINE_INDEX] = value; |
| 2338 | else | 2336 | else |
| 2339 | err = 1; | 2337 | err = true; |
| 2340 | } | 2338 | } |
| 2341 | else if (EQ (keyword, QCstrike_through)) | 2339 | else if (EQ (keyword, QCstrike_through)) |
| 2342 | { | 2340 | { |
| @@ -2345,7 +2343,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2345 | || STRINGP (value)) | 2343 | || STRINGP (value)) |
| 2346 | to[LFACE_STRIKE_THROUGH_INDEX] = value; | 2344 | to[LFACE_STRIKE_THROUGH_INDEX] = value; |
| 2347 | else | 2345 | else |
| 2348 | err = 1; | 2346 | err = true; |
| 2349 | } | 2347 | } |
| 2350 | else if (EQ (keyword, QCbox)) | 2348 | else if (EQ (keyword, QCbox)) |
| 2351 | { | 2349 | { |
| @@ -2357,7 +2355,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2357 | || NILP (value)) | 2355 | || NILP (value)) |
| 2358 | to[LFACE_BOX_INDEX] = value; | 2356 | to[LFACE_BOX_INDEX] = value; |
| 2359 | else | 2357 | else |
| 2360 | err = 1; | 2358 | err = true; |
| 2361 | } | 2359 | } |
| 2362 | else if (EQ (keyword, QCinverse_video) | 2360 | else if (EQ (keyword, QCinverse_video) |
| 2363 | || EQ (keyword, QCreverse_video)) | 2361 | || EQ (keyword, QCreverse_video)) |
| @@ -2365,28 +2363,28 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2365 | if (EQ (value, Qt) || NILP (value)) | 2363 | if (EQ (value, Qt) || NILP (value)) |
| 2366 | to[LFACE_INVERSE_INDEX] = value; | 2364 | to[LFACE_INVERSE_INDEX] = value; |
| 2367 | else | 2365 | else |
| 2368 | err = 1; | 2366 | err = true; |
| 2369 | } | 2367 | } |
| 2370 | else if (EQ (keyword, QCforeground)) | 2368 | else if (EQ (keyword, QCforeground)) |
| 2371 | { | 2369 | { |
| 2372 | if (STRINGP (value)) | 2370 | if (STRINGP (value)) |
| 2373 | to[LFACE_FOREGROUND_INDEX] = value; | 2371 | to[LFACE_FOREGROUND_INDEX] = value; |
| 2374 | else | 2372 | else |
| 2375 | err = 1; | 2373 | err = true; |
| 2376 | } | 2374 | } |
| 2377 | else if (EQ (keyword, QCdistant_foreground)) | 2375 | else if (EQ (keyword, QCdistant_foreground)) |
| 2378 | { | 2376 | { |
| 2379 | if (STRINGP (value)) | 2377 | if (STRINGP (value)) |
| 2380 | to[LFACE_DISTANT_FOREGROUND_INDEX] = value; | 2378 | to[LFACE_DISTANT_FOREGROUND_INDEX] = value; |
| 2381 | else | 2379 | else |
| 2382 | err = 1; | 2380 | err = true; |
| 2383 | } | 2381 | } |
| 2384 | else if (EQ (keyword, QCbackground)) | 2382 | else if (EQ (keyword, QCbackground)) |
| 2385 | { | 2383 | { |
| 2386 | if (STRINGP (value)) | 2384 | if (STRINGP (value)) |
| 2387 | to[LFACE_BACKGROUND_INDEX] = value; | 2385 | to[LFACE_BACKGROUND_INDEX] = value; |
| 2388 | else | 2386 | else |
| 2389 | err = 1; | 2387 | err = true; |
| 2390 | } | 2388 | } |
| 2391 | else if (EQ (keyword, QCstipple)) | 2389 | else if (EQ (keyword, QCstipple)) |
| 2392 | { | 2390 | { |
| @@ -2395,7 +2393,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2395 | if (!NILP (pixmap_p)) | 2393 | if (!NILP (pixmap_p)) |
| 2396 | to[LFACE_STIPPLE_INDEX] = value; | 2394 | to[LFACE_STIPPLE_INDEX] = value; |
| 2397 | else | 2395 | else |
| 2398 | err = 1; | 2396 | err = true; |
| 2399 | #endif /* HAVE_WINDOW_SYSTEM */ | 2397 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 2400 | } | 2398 | } |
| 2401 | else if (EQ (keyword, QCwidth)) | 2399 | else if (EQ (keyword, QCwidth)) |
| @@ -2406,14 +2404,14 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2406 | font_clear_prop (to, FONT_WIDTH_INDEX); | 2404 | font_clear_prop (to, FONT_WIDTH_INDEX); |
| 2407 | } | 2405 | } |
| 2408 | else | 2406 | else |
| 2409 | err = 1; | 2407 | err = true; |
| 2410 | } | 2408 | } |
| 2411 | else if (EQ (keyword, QCfont)) | 2409 | else if (EQ (keyword, QCfont)) |
| 2412 | { | 2410 | { |
| 2413 | if (FONTP (value)) | 2411 | if (FONTP (value)) |
| 2414 | to[LFACE_FONT_INDEX] = value; | 2412 | to[LFACE_FONT_INDEX] = value; |
| 2415 | else | 2413 | else |
| 2416 | err = 1; | 2414 | err = true; |
| 2417 | } | 2415 | } |
| 2418 | else if (EQ (keyword, QCinherit)) | 2416 | else if (EQ (keyword, QCinherit)) |
| 2419 | { | 2417 | { |
| @@ -2421,15 +2419,15 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2421 | normal face reference. */ | 2419 | normal face reference. */ |
| 2422 | if (! merge_face_ref (f, value, to, | 2420 | if (! merge_face_ref (f, value, to, |
| 2423 | err_msgs, named_merge_points)) | 2421 | err_msgs, named_merge_points)) |
| 2424 | err = 1; | 2422 | err = true; |
| 2425 | } | 2423 | } |
| 2426 | else | 2424 | else |
| 2427 | err = 1; | 2425 | err = true; |
| 2428 | 2426 | ||
| 2429 | if (err) | 2427 | if (err) |
| 2430 | { | 2428 | { |
| 2431 | add_to_log ("Invalid face attribute %S %S", keyword, value); | 2429 | add_to_log ("Invalid face attribute %S %S", keyword, value); |
| 2432 | ok = 0; | 2430 | ok = false; |
| 2433 | } | 2431 | } |
| 2434 | 2432 | ||
| 2435 | face_ref = XCDR (XCDR (face_ref)); | 2433 | face_ref = XCDR (XCDR (face_ref)); |
| @@ -2446,7 +2444,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, | |||
| 2446 | ok = merge_face_ref (f, next, to, err_msgs, named_merge_points); | 2444 | ok = merge_face_ref (f, next, to, err_msgs, named_merge_points); |
| 2447 | 2445 | ||
| 2448 | if (! merge_face_ref (f, first, to, err_msgs, named_merge_points)) | 2446 | if (! merge_face_ref (f, first, to, err_msgs, named_merge_points)) |
| 2449 | ok = 0; | 2447 | ok = false; |
| 2450 | } | 2448 | } |
| 2451 | } | 2449 | } |
| 2452 | else | 2450 | else |
| @@ -2475,13 +2473,13 @@ Value is a vector of face attributes. */) | |||
| 2475 | int i; | 2473 | int i; |
| 2476 | 2474 | ||
| 2477 | CHECK_SYMBOL (face); | 2475 | CHECK_SYMBOL (face); |
| 2478 | global_lface = lface_from_face_name (NULL, face, 0); | 2476 | global_lface = lface_from_face_name (NULL, face, false); |
| 2479 | 2477 | ||
| 2480 | if (!NILP (frame)) | 2478 | if (!NILP (frame)) |
| 2481 | { | 2479 | { |
| 2482 | CHECK_LIVE_FRAME (frame); | 2480 | CHECK_LIVE_FRAME (frame); |
| 2483 | f = XFRAME (frame); | 2481 | f = XFRAME (frame); |
| 2484 | lface = lface_from_face_name (f, face, 0); | 2482 | lface = lface_from_face_name (f, face, false); |
| 2485 | } | 2483 | } |
| 2486 | else | 2484 | else |
| 2487 | f = NULL, lface = Qnil; | 2485 | f = NULL, lface = Qnil; |
| @@ -2557,15 +2555,15 @@ Otherwise check for the existence of a global face. */) | |||
| 2557 | { | 2555 | { |
| 2558 | Lisp_Object lface; | 2556 | Lisp_Object lface; |
| 2559 | 2557 | ||
| 2560 | face = resolve_face_name (face, 1); | 2558 | face = resolve_face_name (face, true); |
| 2561 | 2559 | ||
| 2562 | if (!NILP (frame)) | 2560 | if (!NILP (frame)) |
| 2563 | { | 2561 | { |
| 2564 | CHECK_LIVE_FRAME (frame); | 2562 | CHECK_LIVE_FRAME (frame); |
| 2565 | lface = lface_from_face_name (XFRAME (frame), face, 0); | 2563 | lface = lface_from_face_name (XFRAME (frame), face, false); |
| 2566 | } | 2564 | } |
| 2567 | else | 2565 | else |
| 2568 | lface = lface_from_face_name (NULL, face, 0); | 2566 | lface = lface_from_face_name (NULL, face, false); |
| 2569 | 2567 | ||
| 2570 | return lface; | 2568 | return lface; |
| 2571 | } | 2569 | } |
| @@ -2592,7 +2590,7 @@ The value is TO. */) | |||
| 2592 | { | 2590 | { |
| 2593 | /* Copy global definition of FROM. We don't make copies of | 2591 | /* Copy global definition of FROM. We don't make copies of |
| 2594 | strings etc. because 20.2 didn't do it either. */ | 2592 | strings etc. because 20.2 didn't do it either. */ |
| 2595 | lface = lface_from_face_name (NULL, from, 1); | 2593 | lface = lface_from_face_name (NULL, from, true); |
| 2596 | copy = Finternal_make_lisp_face (to, Qnil); | 2594 | copy = Finternal_make_lisp_face (to, Qnil); |
| 2597 | } | 2595 | } |
| 2598 | else | 2596 | else |
| @@ -2602,7 +2600,7 @@ The value is TO. */) | |||
| 2602 | new_frame = frame; | 2600 | new_frame = frame; |
| 2603 | CHECK_LIVE_FRAME (frame); | 2601 | CHECK_LIVE_FRAME (frame); |
| 2604 | CHECK_LIVE_FRAME (new_frame); | 2602 | CHECK_LIVE_FRAME (new_frame); |
| 2605 | lface = lface_from_face_name (XFRAME (frame), from, 1); | 2603 | lface = lface_from_face_name (XFRAME (frame), from, true); |
| 2606 | copy = Finternal_make_lisp_face (to, new_frame); | 2604 | copy = Finternal_make_lisp_face (to, new_frame); |
| 2607 | } | 2605 | } |
| 2608 | 2606 | ||
| @@ -2642,7 +2640,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 2642 | CHECK_SYMBOL (face); | 2640 | CHECK_SYMBOL (face); |
| 2643 | CHECK_SYMBOL (attr); | 2641 | CHECK_SYMBOL (attr); |
| 2644 | 2642 | ||
| 2645 | face = resolve_face_name (face, 1); | 2643 | face = resolve_face_name (face, true); |
| 2646 | 2644 | ||
| 2647 | /* If FRAME is 0, change face on all frames, and change the | 2645 | /* If FRAME is 0, change face on all frames, and change the |
| 2648 | default for new frames. */ | 2646 | default for new frames. */ |
| @@ -2658,7 +2656,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 2658 | /* Set lface to the Lisp attribute vector of FACE. */ | 2656 | /* Set lface to the Lisp attribute vector of FACE. */ |
| 2659 | if (EQ (frame, Qt)) | 2657 | if (EQ (frame, Qt)) |
| 2660 | { | 2658 | { |
| 2661 | lface = lface_from_face_name (NULL, face, 1); | 2659 | lface = lface_from_face_name (NULL, face, true); |
| 2662 | 2660 | ||
| 2663 | /* When updating face-new-frame-defaults, we put :ignore-defface | 2661 | /* When updating face-new-frame-defaults, we put :ignore-defface |
| 2664 | where the caller wants `unspecified'. This forces the frame | 2662 | where the caller wants `unspecified'. This forces the frame |
| @@ -2675,7 +2673,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 2675 | frame = selected_frame; | 2673 | frame = selected_frame; |
| 2676 | 2674 | ||
| 2677 | CHECK_LIVE_FRAME (frame); | 2675 | CHECK_LIVE_FRAME (frame); |
| 2678 | lface = lface_from_face_name (XFRAME (frame), face, 0); | 2676 | lface = lface_from_face_name (XFRAME (frame), face, false); |
| 2679 | 2677 | ||
| 2680 | /* If a frame-local face doesn't exist yet, create one. */ | 2678 | /* If a frame-local face doesn't exist yet, create one. */ |
| 2681 | if (NILP (lface)) | 2679 | if (NILP (lface)) |
| @@ -2760,14 +2758,14 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 2760 | } | 2758 | } |
| 2761 | else if (EQ (attr, QCunderline)) | 2759 | else if (EQ (attr, QCunderline)) |
| 2762 | { | 2760 | { |
| 2763 | bool valid_p = 0; | 2761 | bool valid_p = false; |
| 2764 | 2762 | ||
| 2765 | if (UNSPECIFIEDP (value) || IGNORE_DEFFACE_P (value)) | 2763 | if (UNSPECIFIEDP (value) || IGNORE_DEFFACE_P (value)) |
| 2766 | valid_p = 1; | 2764 | valid_p = true; |
| 2767 | else if (NILP (value) || EQ (value, Qt)) | 2765 | else if (NILP (value) || EQ (value, Qt)) |
| 2768 | valid_p = 1; | 2766 | valid_p = true; |
| 2769 | else if (STRINGP (value) && SCHARS (value) > 0) | 2767 | else if (STRINGP (value) && SCHARS (value) > 0) |
| 2770 | valid_p = 1; | 2768 | valid_p = true; |
| 2771 | else if (CONSP (value)) | 2769 | else if (CONSP (value)) |
| 2772 | { | 2770 | { |
| 2773 | Lisp_Object key, val, list; | 2771 | Lisp_Object key, val, list; |
| @@ -2779,7 +2777,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 2779 | Non-nil symbols other than t are not documented as being valid. | 2777 | Non-nil symbols other than t are not documented as being valid. |
| 2780 | Eg compare with inverse-video, which explicitly rejects them. | 2778 | Eg compare with inverse-video, which explicitly rejects them. |
| 2781 | */ | 2779 | */ |
| 2782 | valid_p = 1; | 2780 | valid_p = true; |
| 2783 | 2781 | ||
| 2784 | while (!NILP (CAR_SAFE(list))) | 2782 | while (!NILP (CAR_SAFE(list))) |
| 2785 | { | 2783 | { |
| @@ -2790,7 +2788,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 2790 | 2788 | ||
| 2791 | if (NILP (key) || NILP (val)) | 2789 | if (NILP (key) || NILP (val)) |
| 2792 | { | 2790 | { |
| 2793 | valid_p = 0; | 2791 | valid_p = false; |
| 2794 | break; | 2792 | break; |
| 2795 | } | 2793 | } |
| 2796 | 2794 | ||
| @@ -2798,14 +2796,14 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 2798 | && !(EQ (val, Qforeground_color) | 2796 | && !(EQ (val, Qforeground_color) |
| 2799 | || (STRINGP (val) && SCHARS (val) > 0))) | 2797 | || (STRINGP (val) && SCHARS (val) > 0))) |
| 2800 | { | 2798 | { |
| 2801 | valid_p = 0; | 2799 | valid_p = false; |
| 2802 | break; | 2800 | break; |
| 2803 | } | 2801 | } |
| 2804 | 2802 | ||
| 2805 | else if (EQ (key, QCstyle) | 2803 | else if (EQ (key, QCstyle) |
| 2806 | && !(EQ (val, Qline) || EQ (val, Qwave))) | 2804 | && !(EQ (val, Qline) || EQ (val, Qwave))) |
| 2807 | { | 2805 | { |
| 2808 | valid_p = 0; | 2806 | valid_p = false; |
| 2809 | break; | 2807 | break; |
| 2810 | } | 2808 | } |
| 2811 | } | 2809 | } |
| @@ -2855,9 +2853,9 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 2855 | value = make_number (1); | 2853 | value = make_number (1); |
| 2856 | 2854 | ||
| 2857 | if (UNSPECIFIEDP (value) || IGNORE_DEFFACE_P (value)) | 2855 | if (UNSPECIFIEDP (value) || IGNORE_DEFFACE_P (value)) |
| 2858 | valid_p = 1; | 2856 | valid_p = true; |
| 2859 | else if (NILP (value)) | 2857 | else if (NILP (value)) |
| 2860 | valid_p = 1; | 2858 | valid_p = true; |
| 2861 | else if (INTEGERP (value)) | 2859 | else if (INTEGERP (value)) |
| 2862 | valid_p = XINT (value) != 0; | 2860 | valid_p = XINT (value) != 0; |
| 2863 | else if (STRINGP (value)) | 2861 | else if (STRINGP (value)) |
| @@ -2900,7 +2898,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 2900 | valid_p = NILP (tem); | 2898 | valid_p = NILP (tem); |
| 2901 | } | 2899 | } |
| 2902 | else | 2900 | else |
| 2903 | valid_p = 0; | 2901 | valid_p = false; |
| 2904 | 2902 | ||
| 2905 | if (!valid_p) | 2903 | if (!valid_p) |
| 2906 | signal_error ("Invalid face box", value); | 2904 | signal_error ("Invalid face box", value); |
| @@ -3042,7 +3040,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 3042 | signal_error ("Font not available", value); | 3040 | signal_error ("Font not available", value); |
| 3043 | value = font_object; | 3041 | value = font_object; |
| 3044 | } | 3042 | } |
| 3045 | set_lface_from_font (f, lface, value, 1); | 3043 | set_lface_from_font (f, lface, value, true); |
| 3046 | } | 3044 | } |
| 3047 | } | 3045 | } |
| 3048 | else | 3046 | else |
| @@ -3187,10 +3185,10 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 3187 | struct frame *f = XFRAME (frame); | 3185 | struct frame *f = XFRAME (frame); |
| 3188 | if (FRAME_FACE_CACHE (f) == NULL) | 3186 | if (FRAME_FACE_CACHE (f) == NULL) |
| 3189 | FRAME_FACE_CACHE (f) = make_face_cache (f); | 3187 | FRAME_FACE_CACHE (f) = make_face_cache (f); |
| 3190 | FRAME_FACE_CACHE (f)->menu_face_changed_p = 1; | 3188 | FRAME_FACE_CACHE (f)->menu_face_changed_p = true; |
| 3191 | } | 3189 | } |
| 3192 | else | 3190 | else |
| 3193 | menu_face_changed_default = 1; | 3191 | menu_face_changed_default = true; |
| 3194 | } | 3192 | } |
| 3195 | 3193 | ||
| 3196 | if (!NILP (param)) | 3194 | if (!NILP (param)) |
| @@ -3235,7 +3233,7 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param, | |||
| 3235 | if (EQ (param, Qforeground_color)) | 3233 | if (EQ (param, Qforeground_color)) |
| 3236 | { | 3234 | { |
| 3237 | face = Qdefault; | 3235 | face = Qdefault; |
| 3238 | lface = lface_from_face_name (f, face, 1); | 3236 | lface = lface_from_face_name (f, face, true); |
| 3239 | ASET (lface, LFACE_FOREGROUND_INDEX, | 3237 | ASET (lface, LFACE_FOREGROUND_INDEX, |
| 3240 | (STRINGP (new_value) ? new_value : Qunspecified)); | 3238 | (STRINGP (new_value) ? new_value : Qunspecified)); |
| 3241 | realize_basic_faces (f); | 3239 | realize_basic_faces (f); |
| @@ -3251,7 +3249,7 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param, | |||
| 3251 | call1 (Qframe_set_background_mode, frame); | 3249 | call1 (Qframe_set_background_mode, frame); |
| 3252 | 3250 | ||
| 3253 | face = Qdefault; | 3251 | face = Qdefault; |
| 3254 | lface = lface_from_face_name (f, face, 1); | 3252 | lface = lface_from_face_name (f, face, true); |
| 3255 | ASET (lface, LFACE_BACKGROUND_INDEX, | 3253 | ASET (lface, LFACE_BACKGROUND_INDEX, |
| 3256 | (STRINGP (new_value) ? new_value : Qunspecified)); | 3254 | (STRINGP (new_value) ? new_value : Qunspecified)); |
| 3257 | realize_basic_faces (f); | 3255 | realize_basic_faces (f); |
| @@ -3260,21 +3258,21 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param, | |||
| 3260 | else if (EQ (param, Qborder_color)) | 3258 | else if (EQ (param, Qborder_color)) |
| 3261 | { | 3259 | { |
| 3262 | face = Qborder; | 3260 | face = Qborder; |
| 3263 | lface = lface_from_face_name (f, face, 1); | 3261 | lface = lface_from_face_name (f, face, true); |
| 3264 | ASET (lface, LFACE_BACKGROUND_INDEX, | 3262 | ASET (lface, LFACE_BACKGROUND_INDEX, |
| 3265 | (STRINGP (new_value) ? new_value : Qunspecified)); | 3263 | (STRINGP (new_value) ? new_value : Qunspecified)); |
| 3266 | } | 3264 | } |
| 3267 | else if (EQ (param, Qcursor_color)) | 3265 | else if (EQ (param, Qcursor_color)) |
| 3268 | { | 3266 | { |
| 3269 | face = Qcursor; | 3267 | face = Qcursor; |
| 3270 | lface = lface_from_face_name (f, face, 1); | 3268 | lface = lface_from_face_name (f, face, true); |
| 3271 | ASET (lface, LFACE_BACKGROUND_INDEX, | 3269 | ASET (lface, LFACE_BACKGROUND_INDEX, |
| 3272 | (STRINGP (new_value) ? new_value : Qunspecified)); | 3270 | (STRINGP (new_value) ? new_value : Qunspecified)); |
| 3273 | } | 3271 | } |
| 3274 | else if (EQ (param, Qmouse_color)) | 3272 | else if (EQ (param, Qmouse_color)) |
| 3275 | { | 3273 | { |
| 3276 | face = Qmouse; | 3274 | face = Qmouse; |
| 3277 | lface = lface_from_face_name (f, face, 1); | 3275 | lface = lface_from_face_name (f, face, true); |
| 3278 | ASET (lface, LFACE_BACKGROUND_INDEX, | 3276 | ASET (lface, LFACE_BACKGROUND_INDEX, |
| 3279 | (STRINGP (new_value) ? new_value : Qunspecified)); | 3277 | (STRINGP (new_value) ? new_value : Qunspecified)); |
| 3280 | } | 3278 | } |
| @@ -3318,7 +3316,7 @@ set_font_frame_param (Lisp_Object frame, Lisp_Object lface) | |||
| 3318 | return; | 3316 | return; |
| 3319 | ASET (lface, LFACE_FONT_INDEX, font); | 3317 | ASET (lface, LFACE_FONT_INDEX, font); |
| 3320 | } | 3318 | } |
| 3321 | f->default_face_done_p = 0; | 3319 | f->default_face_done_p = false; |
| 3322 | AUTO_FRAME_ARG (arg, Qfont, font); | 3320 | AUTO_FRAME_ARG (arg, Qfont, font); |
| 3323 | Fmodify_frame_parameters (frame, arg); | 3321 | Fmodify_frame_parameters (frame, arg); |
| 3324 | } | 3322 | } |
| @@ -3348,11 +3346,11 @@ ordinary `x-get-resource' doesn't take a frame argument. */) | |||
| 3348 | 3346 | ||
| 3349 | /* Return resource string VALUE as a boolean value, i.e. nil, or t. | 3347 | /* Return resource string VALUE as a boolean value, i.e. nil, or t. |
| 3350 | If VALUE is "on" or "true", return t. If VALUE is "off" or | 3348 | If VALUE is "on" or "true", return t. If VALUE is "off" or |
| 3351 | "false", return nil. Otherwise, if SIGNAL_P is non-zero, signal an | 3349 | "false", return nil. Otherwise, if SIGNAL_P, signal an |
| 3352 | error; if SIGNAL_P is zero, return 0. */ | 3350 | error; if !SIGNAL_P, return 0. */ |
| 3353 | 3351 | ||
| 3354 | static Lisp_Object | 3352 | static Lisp_Object |
| 3355 | face_boolean_x_resource_value (Lisp_Object value, int signal_p) | 3353 | face_boolean_x_resource_value (Lisp_Object value, bool signal_p) |
| 3356 | { | 3354 | { |
| 3357 | Lisp_Object result = make_number (0); | 3355 | Lisp_Object result = make_number (0); |
| 3358 | 3356 | ||
| @@ -3392,11 +3390,11 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource", | |||
| 3392 | signal_error ("Invalid face height from X resource", value); | 3390 | signal_error ("Invalid face height from X resource", value); |
| 3393 | } | 3391 | } |
| 3394 | else if (EQ (attr, QCbold) || EQ (attr, QCitalic)) | 3392 | else if (EQ (attr, QCbold) || EQ (attr, QCitalic)) |
| 3395 | value = face_boolean_x_resource_value (value, 1); | 3393 | value = face_boolean_x_resource_value (value, true); |
| 3396 | else if (EQ (attr, QCweight) || EQ (attr, QCslant) || EQ (attr, QCwidth)) | 3394 | else if (EQ (attr, QCweight) || EQ (attr, QCslant) || EQ (attr, QCwidth)) |
| 3397 | value = intern (SSDATA (value)); | 3395 | value = intern (SSDATA (value)); |
| 3398 | else if (EQ (attr, QCreverse_video) || EQ (attr, QCinverse_video)) | 3396 | else if (EQ (attr, QCreverse_video) || EQ (attr, QCinverse_video)) |
| 3399 | value = face_boolean_x_resource_value (value, 1); | 3397 | value = face_boolean_x_resource_value (value, true); |
| 3400 | else if (EQ (attr, QCunderline) | 3398 | else if (EQ (attr, QCunderline) |
| 3401 | || EQ (attr, QCoverline) | 3399 | || EQ (attr, QCoverline) |
| 3402 | || EQ (attr, QCstrike_through)) | 3400 | || EQ (attr, QCstrike_through)) |
| @@ -3405,7 +3403,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource", | |||
| 3405 | 3403 | ||
| 3406 | /* If the result of face_boolean_x_resource_value is t or nil, | 3404 | /* If the result of face_boolean_x_resource_value is t or nil, |
| 3407 | VALUE does NOT specify a color. */ | 3405 | VALUE does NOT specify a color. */ |
| 3408 | boolean_value = face_boolean_x_resource_value (value, 0); | 3406 | boolean_value = face_boolean_x_resource_value (value, false); |
| 3409 | if (SYMBOLP (boolean_value)) | 3407 | if (SYMBOLP (boolean_value)) |
| 3410 | value = boolean_value; | 3408 | value = boolean_value; |
| 3411 | } | 3409 | } |
| @@ -3439,10 +3437,10 @@ x_update_menu_appearance (struct frame *f) | |||
| 3439 | char line[512]; | 3437 | char line[512]; |
| 3440 | char *buf = line; | 3438 | char *buf = line; |
| 3441 | ptrdiff_t bufsize = sizeof line; | 3439 | ptrdiff_t bufsize = sizeof line; |
| 3442 | Lisp_Object lface = lface_from_face_name (f, Qmenu, 1); | 3440 | Lisp_Object lface = lface_from_face_name (f, Qmenu, true); |
| 3443 | struct face *face = FACE_FROM_ID (f, MENU_FACE_ID); | 3441 | struct face *face = FACE_FROM_ID (f, MENU_FACE_ID); |
| 3444 | const char *myname = SSDATA (Vx_resource_name); | 3442 | const char *myname = SSDATA (Vx_resource_name); |
| 3445 | bool changed_p = 0; | 3443 | bool changed_p = false; |
| 3446 | #ifdef USE_MOTIF | 3444 | #ifdef USE_MOTIF |
| 3447 | const char *popup_path = "popup_menu"; | 3445 | const char *popup_path = "popup_menu"; |
| 3448 | #else | 3446 | #else |
| @@ -3458,7 +3456,7 @@ x_update_menu_appearance (struct frame *f) | |||
| 3458 | exprintf (&buf, &bufsize, line, -1, "%s.pane.menubar*foreground: %s", | 3456 | exprintf (&buf, &bufsize, line, -1, "%s.pane.menubar*foreground: %s", |
| 3459 | myname, SDATA (LFACE_FOREGROUND (lface))); | 3457 | myname, SDATA (LFACE_FOREGROUND (lface))); |
| 3460 | XrmPutLineResource (&rdb, line); | 3458 | XrmPutLineResource (&rdb, line); |
| 3461 | changed_p = 1; | 3459 | changed_p = true; |
| 3462 | } | 3460 | } |
| 3463 | 3461 | ||
| 3464 | if (STRINGP (LFACE_BACKGROUND (lface))) | 3462 | if (STRINGP (LFACE_BACKGROUND (lface))) |
| @@ -3471,7 +3469,7 @@ x_update_menu_appearance (struct frame *f) | |||
| 3471 | exprintf (&buf, &bufsize, line, -1, "%s.pane.menubar*background: %s", | 3469 | exprintf (&buf, &bufsize, line, -1, "%s.pane.menubar*background: %s", |
| 3472 | myname, SDATA (LFACE_BACKGROUND (lface))); | 3470 | myname, SDATA (LFACE_BACKGROUND (lface))); |
| 3473 | XrmPutLineResource (&rdb, line); | 3471 | XrmPutLineResource (&rdb, line); |
| 3474 | changed_p = 1; | 3472 | changed_p = true; |
| 3475 | } | 3473 | } |
| 3476 | 3474 | ||
| 3477 | if (face->font | 3475 | if (face->font |
| @@ -3514,7 +3512,7 @@ x_update_menu_appearance (struct frame *f) | |||
| 3514 | exprintf (&buf, &bufsize, line, -1, "%s.%s*font%s: %s", | 3512 | exprintf (&buf, &bufsize, line, -1, "%s.%s*font%s: %s", |
| 3515 | myname, popup_path, suffix, fontsetname); | 3513 | myname, popup_path, suffix, fontsetname); |
| 3516 | XrmPutLineResource (&rdb, line); | 3514 | XrmPutLineResource (&rdb, line); |
| 3517 | changed_p = 1; | 3515 | changed_p = true; |
| 3518 | if (fontsetname != SSDATA (xlfd)) | 3516 | if (fontsetname != SSDATA (xlfd)) |
| 3519 | xfree (fontsetname); | 3517 | xfree (fontsetname); |
| 3520 | } | 3518 | } |
| @@ -3581,7 +3579,7 @@ frames). If FRAME is omitted or nil, use the selected frame. */) | |||
| 3581 | (Lisp_Object symbol, Lisp_Object keyword, Lisp_Object frame) | 3579 | (Lisp_Object symbol, Lisp_Object keyword, Lisp_Object frame) |
| 3582 | { | 3580 | { |
| 3583 | struct frame *f = EQ (frame, Qt) ? NULL : decode_live_frame (frame); | 3581 | struct frame *f = EQ (frame, Qt) ? NULL : decode_live_frame (frame); |
| 3584 | Lisp_Object lface = lface_from_face_name (f, symbol, 1), value = Qnil; | 3582 | Lisp_Object lface = lface_from_face_name (f, symbol, true), value = Qnil; |
| 3585 | 3583 | ||
| 3586 | CHECK_SYMBOL (symbol); | 3584 | CHECK_SYMBOL (symbol); |
| 3587 | CHECK_SYMBOL (keyword); | 3585 | CHECK_SYMBOL (keyword); |
| @@ -3664,8 +3662,8 @@ Default face attributes override any local face attributes. */) | |||
| 3664 | struct frame *f = XFRAME (frame); | 3662 | struct frame *f = XFRAME (frame); |
| 3665 | 3663 | ||
| 3666 | CHECK_LIVE_FRAME (frame); | 3664 | CHECK_LIVE_FRAME (frame); |
| 3667 | global_lface = lface_from_face_name (NULL, face, 1); | 3665 | global_lface = lface_from_face_name (NULL, face, true); |
| 3668 | local_lface = lface_from_face_name (f, face, 0); | 3666 | local_lface = lface_from_face_name (f, face, false); |
| 3669 | if (NILP (local_lface)) | 3667 | if (NILP (local_lface)) |
| 3670 | local_lface = Finternal_make_lisp_face (face, frame); | 3668 | local_lface = Finternal_make_lisp_face (face, frame); |
| 3671 | 3669 | ||
| @@ -3754,7 +3752,7 @@ return the font name used for CHARACTER. */) | |||
| 3754 | if (EQ (frame, Qt)) | 3752 | if (EQ (frame, Qt)) |
| 3755 | { | 3753 | { |
| 3756 | Lisp_Object result = Qnil; | 3754 | Lisp_Object result = Qnil; |
| 3757 | Lisp_Object lface = lface_from_face_name (NULL, face, 1); | 3755 | Lisp_Object lface = lface_from_face_name (NULL, face, true); |
| 3758 | 3756 | ||
| 3759 | if (!UNSPECIFIEDP (LFACE_WEIGHT (lface)) | 3757 | if (!UNSPECIFIEDP (LFACE_WEIGHT (lface)) |
| 3760 | && !EQ (LFACE_WEIGHT (lface), Qnormal)) | 3758 | && !EQ (LFACE_WEIGHT (lface), Qnormal)) |
| @@ -3769,7 +3767,7 @@ return the font name used for CHARACTER. */) | |||
| 3769 | else | 3767 | else |
| 3770 | { | 3768 | { |
| 3771 | struct frame *f = decode_live_frame (frame); | 3769 | struct frame *f = decode_live_frame (frame); |
| 3772 | int face_id = lookup_named_face (f, face, 1); | 3770 | int face_id = lookup_named_face (f, face, true); |
| 3773 | struct face *fface = FACE_FROM_ID (f, face_id); | 3771 | struct face *fface = FACE_FROM_ID (f, face_id); |
| 3774 | 3772 | ||
| 3775 | if (! fface) | 3773 | if (! fface) |
| @@ -3794,7 +3792,7 @@ return the font name used for CHARACTER. */) | |||
| 3794 | } | 3792 | } |
| 3795 | 3793 | ||
| 3796 | 3794 | ||
| 3797 | /* Compare face-attribute values v1 and v2 for equality. Value is non-zero if | 3795 | /* Compare face-attribute values v1 and v2 for equality. Value is true if |
| 3798 | all attributes are `equal'. Tries to be fast because this function | 3796 | all attributes are `equal'. Tries to be fast because this function |
| 3799 | is called quite often. */ | 3797 | is called quite often. */ |
| 3800 | 3798 | ||
| @@ -3804,22 +3802,22 @@ face_attr_equal_p (Lisp_Object v1, Lisp_Object v2) | |||
| 3804 | /* Type can differ, e.g. when one attribute is unspecified, i.e. nil, | 3802 | /* Type can differ, e.g. when one attribute is unspecified, i.e. nil, |
| 3805 | and the other is specified. */ | 3803 | and the other is specified. */ |
| 3806 | if (XTYPE (v1) != XTYPE (v2)) | 3804 | if (XTYPE (v1) != XTYPE (v2)) |
| 3807 | return 0; | 3805 | return false; |
| 3808 | 3806 | ||
| 3809 | if (EQ (v1, v2)) | 3807 | if (EQ (v1, v2)) |
| 3810 | return 1; | 3808 | return true; |
| 3811 | 3809 | ||
| 3812 | switch (XTYPE (v1)) | 3810 | switch (XTYPE (v1)) |
| 3813 | { | 3811 | { |
| 3814 | case Lisp_String: | 3812 | case Lisp_String: |
| 3815 | if (SBYTES (v1) != SBYTES (v2)) | 3813 | if (SBYTES (v1) != SBYTES (v2)) |
| 3816 | return 0; | 3814 | return false; |
| 3817 | 3815 | ||
| 3818 | return memcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0; | 3816 | return memcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0; |
| 3819 | 3817 | ||
| 3820 | case_Lisp_Int: | 3818 | case_Lisp_Int: |
| 3821 | case Lisp_Symbol: | 3819 | case Lisp_Symbol: |
| 3822 | return 0; | 3820 | return false; |
| 3823 | 3821 | ||
| 3824 | default: | 3822 | default: |
| 3825 | return !NILP (Fequal (v1, v2)); | 3823 | return !NILP (Fequal (v1, v2)); |
| @@ -3827,7 +3825,7 @@ face_attr_equal_p (Lisp_Object v1, Lisp_Object v2) | |||
| 3827 | } | 3825 | } |
| 3828 | 3826 | ||
| 3829 | 3827 | ||
| 3830 | /* Compare face vectors V1 and V2 for equality. Value is non-zero if | 3828 | /* Compare face vectors V1 and V2 for equality. Value is true if |
| 3831 | all attributes are `equal'. Tries to be fast because this function | 3829 | all attributes are `equal'. Tries to be fast because this function |
| 3832 | is called quite often. */ | 3830 | is called quite often. */ |
| 3833 | 3831 | ||
| @@ -3835,7 +3833,7 @@ static bool | |||
| 3835 | lface_equal_p (Lisp_Object *v1, Lisp_Object *v2) | 3833 | lface_equal_p (Lisp_Object *v1, Lisp_Object *v2) |
| 3836 | { | 3834 | { |
| 3837 | int i; | 3835 | int i; |
| 3838 | bool equal_p = 1; | 3836 | bool equal_p = true; |
| 3839 | 3837 | ||
| 3840 | for (i = 1; i < LFACE_VECTOR_SIZE && equal_p; ++i) | 3838 | for (i = 1; i < LFACE_VECTOR_SIZE && equal_p; ++i) |
| 3841 | equal_p = face_attr_equal_p (v1[i], v2[i]); | 3839 | equal_p = face_attr_equal_p (v1[i], v2[i]); |
| @@ -3852,7 +3850,7 @@ If FRAME is t, report on the defaults for FACE1 and FACE2 (for new frames). | |||
| 3852 | If FRAME is omitted or nil, use the selected frame. */) | 3850 | If FRAME is omitted or nil, use the selected frame. */) |
| 3853 | (Lisp_Object face1, Lisp_Object face2, Lisp_Object frame) | 3851 | (Lisp_Object face1, Lisp_Object face2, Lisp_Object frame) |
| 3854 | { | 3852 | { |
| 3855 | int equal_p; | 3853 | bool equal_p; |
| 3856 | struct frame *f; | 3854 | struct frame *f; |
| 3857 | Lisp_Object lface1, lface2; | 3855 | Lisp_Object lface1, lface2; |
| 3858 | 3856 | ||
| @@ -3862,8 +3860,8 @@ If FRAME is omitted or nil, use the selected frame. */) | |||
| 3862 | Emacs. That frame is not an X frame. */ | 3860 | Emacs. That frame is not an X frame. */ |
| 3863 | f = EQ (frame, Qt) ? NULL : decode_live_frame (frame); | 3861 | f = EQ (frame, Qt) ? NULL : decode_live_frame (frame); |
| 3864 | 3862 | ||
| 3865 | lface1 = lface_from_face_name (f, face1, 1); | 3863 | lface1 = lface_from_face_name (f, face1, true); |
| 3866 | lface2 = lface_from_face_name (f, face2, 1); | 3864 | lface2 = lface_from_face_name (f, face2, true); |
| 3867 | equal_p = lface_equal_p (XVECTOR (lface1)->contents, | 3865 | equal_p = lface_equal_p (XVECTOR (lface1)->contents, |
| 3868 | XVECTOR (lface2)->contents); | 3866 | XVECTOR (lface2)->contents); |
| 3869 | return equal_p ? Qt : Qnil; | 3867 | return equal_p ? Qt : Qnil; |
| @@ -3879,7 +3877,7 @@ If FRAME is omitted or nil, use the selected frame. */) | |||
| 3879 | (Lisp_Object face, Lisp_Object frame) | 3877 | (Lisp_Object face, Lisp_Object frame) |
| 3880 | { | 3878 | { |
| 3881 | struct frame *f = EQ (frame, Qt) ? NULL : decode_live_frame (frame); | 3879 | struct frame *f = EQ (frame, Qt) ? NULL : decode_live_frame (frame); |
| 3882 | Lisp_Object lface = lface_from_face_name (f, face, 1); | 3880 | Lisp_Object lface = lface_from_face_name (f, face, true); |
| 3883 | int i; | 3881 | int i; |
| 3884 | 3882 | ||
| 3885 | for (i = 1; i < LFACE_VECTOR_SIZE; ++i) | 3883 | for (i = 1; i < LFACE_VECTOR_SIZE; ++i) |
| @@ -3932,12 +3930,12 @@ lface_hash (Lisp_Object *v) | |||
| 3932 | 3930 | ||
| 3933 | #ifdef HAVE_WINDOW_SYSTEM | 3931 | #ifdef HAVE_WINDOW_SYSTEM |
| 3934 | 3932 | ||
| 3935 | /* Return non-zero if LFACE1 and LFACE2 specify the same font (without | 3933 | /* Return true if LFACE1 and LFACE2 specify the same font (without |
| 3936 | considering charsets/registries). They do if they specify the same | 3934 | considering charsets/registries). They do if they specify the same |
| 3937 | family, point size, weight, width, slant, and font. Both | 3935 | family, point size, weight, width, slant, and font. Both |
| 3938 | LFACE1 and LFACE2 must be fully-specified. */ | 3936 | LFACE1 and LFACE2 must be fully-specified. */ |
| 3939 | 3937 | ||
| 3940 | static int | 3938 | static bool |
| 3941 | lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2) | 3939 | lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2) |
| 3942 | { | 3940 | { |
| 3943 | eassert (lface_fully_specified_p (lface1) | 3941 | eassert (lface_fully_specified_p (lface1) |
| @@ -4094,10 +4092,12 @@ If FRAME is unspecified or nil, the current frame is used. */) | |||
| 4094 | XColor cdef1, cdef2; | 4092 | XColor cdef1, cdef2; |
| 4095 | 4093 | ||
| 4096 | if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1)) | 4094 | if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1)) |
| 4097 | && !(STRINGP (color1) && defined_color (f, SSDATA (color1), &cdef1, 0))) | 4095 | && !(STRINGP (color1) |
| 4096 | && defined_color (f, SSDATA (color1), &cdef1, false))) | ||
| 4098 | signal_error ("Invalid color", color1); | 4097 | signal_error ("Invalid color", color1); |
| 4099 | if (!(CONSP (color2) && parse_rgb_list (color2, &cdef2)) | 4098 | if (!(CONSP (color2) && parse_rgb_list (color2, &cdef2)) |
| 4100 | && !(STRINGP (color2) && defined_color (f, SSDATA (color2), &cdef2, 0))) | 4099 | && !(STRINGP (color2) |
| 4100 | && defined_color (f, SSDATA (color2), &cdef2, false))) | ||
| 4101 | signal_error ("Invalid color", color2); | 4101 | signal_error ("Invalid color", color2); |
| 4102 | 4102 | ||
| 4103 | return make_number (color_distance (&cdef1, &cdef2)); | 4103 | return make_number (color_distance (&cdef1, &cdef2)); |
| @@ -4413,7 +4413,7 @@ face_for_font (struct frame *f, Lisp_Object font_object, struct face *base_face) | |||
| 4413 | face isn't realized and cannot be realized. */ | 4413 | face isn't realized and cannot be realized. */ |
| 4414 | 4414 | ||
| 4415 | int | 4415 | int |
| 4416 | lookup_named_face (struct frame *f, Lisp_Object symbol, int signal_p) | 4416 | lookup_named_face (struct frame *f, Lisp_Object symbol, bool signal_p) |
| 4417 | { | 4417 | { |
| 4418 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 4418 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| 4419 | Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE]; | 4419 | Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE]; |
| @@ -4480,7 +4480,7 @@ lookup_basic_face (struct frame *f, int face_id) | |||
| 4480 | 4480 | ||
| 4481 | /* If there is a remapping entry, lookup the face using NAME, which will | 4481 | /* If there is a remapping entry, lookup the face using NAME, which will |
| 4482 | handle the remapping too. */ | 4482 | handle the remapping too. */ |
| 4483 | remapped_face_id = lookup_named_face (f, name, 0); | 4483 | remapped_face_id = lookup_named_face (f, name, false); |
| 4484 | if (remapped_face_id < 0) | 4484 | if (remapped_face_id < 0) |
| 4485 | return face_id; /* Give up. */ | 4485 | return face_id; /* Give up. */ |
| 4486 | 4486 | ||
| @@ -4582,7 +4582,7 @@ face_with_height (struct frame *f, int face_id, int height) | |||
| 4582 | 4582 | ||
| 4583 | int | 4583 | int |
| 4584 | lookup_derived_face (struct frame *f, Lisp_Object symbol, int face_id, | 4584 | lookup_derived_face (struct frame *f, Lisp_Object symbol, int face_id, |
| 4585 | int signal_p) | 4585 | bool signal_p) |
| 4586 | { | 4586 | { |
| 4587 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 4587 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| 4588 | Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE]; | 4588 | Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE]; |
| @@ -4608,7 +4608,7 @@ DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector, | |||
| 4608 | lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), | 4608 | lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), |
| 4609 | Qunspecified); | 4609 | Qunspecified); |
| 4610 | merge_face_ref (XFRAME (selected_frame), plist, XVECTOR (lface)->contents, | 4610 | merge_face_ref (XFRAME (selected_frame), plist, XVECTOR (lface)->contents, |
| 4611 | 1, 0); | 4611 | true, 0); |
| 4612 | return lface; | 4612 | return lface; |
| 4613 | } | 4613 | } |
| 4614 | 4614 | ||
| @@ -4673,7 +4673,7 @@ x_supports_face_attributes_p (struct frame *f, | |||
| 4673 | || (!UNSPECIFIEDP (attrs[LFACE_BOX_INDEX]) | 4673 | || (!UNSPECIFIEDP (attrs[LFACE_BOX_INDEX]) |
| 4674 | && face_attr_equal_p (attrs[LFACE_BOX_INDEX], | 4674 | && face_attr_equal_p (attrs[LFACE_BOX_INDEX], |
| 4675 | def_attrs[LFACE_BOX_INDEX]))) | 4675 | def_attrs[LFACE_BOX_INDEX]))) |
| 4676 | return 0; | 4676 | return false; |
| 4677 | 4677 | ||
| 4678 | /* Check font-related attributes, as those are the most commonly | 4678 | /* Check font-related attributes, as those are the most commonly |
| 4679 | "unsupported" on a window-system (because of missing fonts). */ | 4679 | "unsupported" on a window-system (because of missing fonts). */ |
| @@ -4703,7 +4703,7 @@ x_supports_face_attributes_p (struct frame *f, | |||
| 4703 | supported. */ | 4703 | supported. */ |
| 4704 | if (face->font == def_face->font | 4704 | if (face->font == def_face->font |
| 4705 | || ! face->font) | 4705 | || ! face->font) |
| 4706 | return 0; | 4706 | return false; |
| 4707 | for (i = FONT_TYPE_INDEX; i <= FONT_SIZE_INDEX; i++) | 4707 | for (i = FONT_TYPE_INDEX; i <= FONT_SIZE_INDEX; i++) |
| 4708 | if (! EQ (face->font->props[i], def_face->font->props[i])) | 4708 | if (! EQ (face->font->props[i], def_face->font->props[i])) |
| 4709 | { | 4709 | { |
| @@ -4711,18 +4711,18 @@ x_supports_face_attributes_p (struct frame *f, | |||
| 4711 | 4711 | ||
| 4712 | if (i < FONT_FOUNDRY_INDEX || i > FONT_REGISTRY_INDEX | 4712 | if (i < FONT_FOUNDRY_INDEX || i > FONT_REGISTRY_INDEX |
| 4713 | || face->font->driver->case_sensitive) | 4713 | || face->font->driver->case_sensitive) |
| 4714 | return 1; | 4714 | return true; |
| 4715 | s1 = SYMBOL_NAME (face->font->props[i]); | 4715 | s1 = SYMBOL_NAME (face->font->props[i]); |
| 4716 | s2 = SYMBOL_NAME (def_face->font->props[i]); | 4716 | s2 = SYMBOL_NAME (def_face->font->props[i]); |
| 4717 | if (! EQ (Fcompare_strings (s1, make_number (0), Qnil, | 4717 | if (! EQ (Fcompare_strings (s1, make_number (0), Qnil, |
| 4718 | s2, make_number (0), Qnil, Qt), Qt)) | 4718 | s2, make_number (0), Qnil, Qt), Qt)) |
| 4719 | return 1; | 4719 | return true; |
| 4720 | } | 4720 | } |
| 4721 | return 0; | 4721 | return false; |
| 4722 | } | 4722 | } |
| 4723 | 4723 | ||
| 4724 | /* Everything checks out, this face is supported. */ | 4724 | /* Everything checks out, this face is supported. */ |
| 4725 | return 1; | 4725 | return true; |
| 4726 | } | 4726 | } |
| 4727 | 4727 | ||
| 4728 | #endif /* HAVE_WINDOW_SYSTEM */ | 4728 | #endif /* HAVE_WINDOW_SYSTEM */ |
| @@ -4771,7 +4771,7 @@ tty_supports_face_attributes_p (struct frame *f, | |||
| 4771 | || !UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX]) | 4771 | || !UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX]) |
| 4772 | || !UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX]) | 4772 | || !UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX]) |
| 4773 | || !UNSPECIFIEDP (attrs[LFACE_BOX_INDEX])) | 4773 | || !UNSPECIFIEDP (attrs[LFACE_BOX_INDEX])) |
| 4774 | return 0; | 4774 | return false; |
| 4775 | 4775 | ||
| 4776 | /* Test for terminal `capabilities' (non-color character attributes). */ | 4776 | /* Test for terminal `capabilities' (non-color character attributes). */ |
| 4777 | 4777 | ||
| @@ -4785,17 +4785,17 @@ tty_supports_face_attributes_p (struct frame *f, | |||
| 4785 | if (weight > 100) | 4785 | if (weight > 100) |
| 4786 | { | 4786 | { |
| 4787 | if (def_weight > 100) | 4787 | if (def_weight > 100) |
| 4788 | return 0; /* same as default */ | 4788 | return false; /* same as default */ |
| 4789 | test_caps = TTY_CAP_BOLD; | 4789 | test_caps = TTY_CAP_BOLD; |
| 4790 | } | 4790 | } |
| 4791 | else if (weight < 100) | 4791 | else if (weight < 100) |
| 4792 | { | 4792 | { |
| 4793 | if (def_weight < 100) | 4793 | if (def_weight < 100) |
| 4794 | return 0; /* same as default */ | 4794 | return false; /* same as default */ |
| 4795 | test_caps = TTY_CAP_DIM; | 4795 | test_caps = TTY_CAP_DIM; |
| 4796 | } | 4796 | } |
| 4797 | else if (def_weight == 100) | 4797 | else if (def_weight == 100) |
| 4798 | return 0; /* same as default */ | 4798 | return false; /* same as default */ |
| 4799 | } | 4799 | } |
| 4800 | 4800 | ||
| 4801 | /* font slant */ | 4801 | /* font slant */ |
| @@ -4805,7 +4805,7 @@ tty_supports_face_attributes_p (struct frame *f, | |||
| 4805 | { | 4805 | { |
| 4806 | int def_slant = FONT_SLANT_NAME_NUMERIC (def_attrs[LFACE_SLANT_INDEX]); | 4806 | int def_slant = FONT_SLANT_NAME_NUMERIC (def_attrs[LFACE_SLANT_INDEX]); |
| 4807 | if (slant == 100 || slant == def_slant) | 4807 | if (slant == 100 || slant == def_slant) |
| 4808 | return 0; /* same as default */ | 4808 | return false; /* same as default */ |
| 4809 | else | 4809 | else |
| 4810 | test_caps |= TTY_CAP_ITALIC; | 4810 | test_caps |= TTY_CAP_ITALIC; |
| 4811 | } | 4811 | } |
| @@ -4815,11 +4815,11 @@ tty_supports_face_attributes_p (struct frame *f, | |||
| 4815 | if (!UNSPECIFIEDP (val)) | 4815 | if (!UNSPECIFIEDP (val)) |
| 4816 | { | 4816 | { |
| 4817 | if (STRINGP (val)) | 4817 | if (STRINGP (val)) |
| 4818 | return 0; /* ttys can't use colored underlines */ | 4818 | return false; /* ttys can't use colored underlines */ |
| 4819 | else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) | 4819 | else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) |
| 4820 | return 0; /* ttys can't use wave underlines */ | 4820 | return false; /* ttys can't use wave underlines */ |
| 4821 | else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) | 4821 | else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) |
| 4822 | return 0; /* same as default */ | 4822 | return false; /* same as default */ |
| 4823 | else | 4823 | else |
| 4824 | test_caps |= TTY_CAP_UNDERLINE; | 4824 | test_caps |= TTY_CAP_UNDERLINE; |
| 4825 | } | 4825 | } |
| @@ -4829,7 +4829,7 @@ tty_supports_face_attributes_p (struct frame *f, | |||
| 4829 | if (!UNSPECIFIEDP (val)) | 4829 | if (!UNSPECIFIEDP (val)) |
| 4830 | { | 4830 | { |
| 4831 | if (face_attr_equal_p (val, def_attrs[LFACE_INVERSE_INDEX])) | 4831 | if (face_attr_equal_p (val, def_attrs[LFACE_INVERSE_INDEX])) |
| 4832 | return 0; /* same as default */ | 4832 | return false; /* same as default */ |
| 4833 | else | 4833 | else |
| 4834 | test_caps |= TTY_CAP_INVERSE; | 4834 | test_caps |= TTY_CAP_INVERSE; |
| 4835 | } | 4835 | } |
| @@ -4844,12 +4844,12 @@ tty_supports_face_attributes_p (struct frame *f, | |||
| 4844 | Lisp_Object def_fg = def_attrs[LFACE_FOREGROUND_INDEX]; | 4844 | Lisp_Object def_fg = def_attrs[LFACE_FOREGROUND_INDEX]; |
| 4845 | 4845 | ||
| 4846 | if (face_attr_equal_p (fg, def_fg)) | 4846 | if (face_attr_equal_p (fg, def_fg)) |
| 4847 | return 0; /* same as default */ | 4847 | return false; /* same as default */ |
| 4848 | else if (! tty_lookup_color (f, fg, &fg_tty_color, &fg_std_color)) | 4848 | else if (! tty_lookup_color (f, fg, &fg_tty_color, &fg_std_color)) |
| 4849 | return 0; /* not a valid color */ | 4849 | return false; /* not a valid color */ |
| 4850 | else if (color_distance (&fg_tty_color, &fg_std_color) | 4850 | else if (color_distance (&fg_tty_color, &fg_std_color) |
| 4851 | > TTY_SAME_COLOR_THRESHOLD) | 4851 | > TTY_SAME_COLOR_THRESHOLD) |
| 4852 | return 0; /* displayed color is too different */ | 4852 | return false; /* displayed color is too different */ |
| 4853 | else | 4853 | else |
| 4854 | /* Make sure the color is really different than the default. */ | 4854 | /* Make sure the color is really different than the default. */ |
| 4855 | { | 4855 | { |
| @@ -4857,7 +4857,7 @@ tty_supports_face_attributes_p (struct frame *f, | |||
| 4857 | if (tty_lookup_color (f, def_fg, &def_fg_color, 0) | 4857 | if (tty_lookup_color (f, def_fg, &def_fg_color, 0) |
| 4858 | && (color_distance (&fg_tty_color, &def_fg_color) | 4858 | && (color_distance (&fg_tty_color, &def_fg_color) |
| 4859 | <= TTY_SAME_COLOR_THRESHOLD)) | 4859 | <= TTY_SAME_COLOR_THRESHOLD)) |
| 4860 | return 0; | 4860 | return false; |
| 4861 | } | 4861 | } |
| 4862 | } | 4862 | } |
| 4863 | 4863 | ||
| @@ -4868,12 +4868,12 @@ tty_supports_face_attributes_p (struct frame *f, | |||
| 4868 | Lisp_Object def_bg = def_attrs[LFACE_BACKGROUND_INDEX]; | 4868 | Lisp_Object def_bg = def_attrs[LFACE_BACKGROUND_INDEX]; |
| 4869 | 4869 | ||
| 4870 | if (face_attr_equal_p (bg, def_bg)) | 4870 | if (face_attr_equal_p (bg, def_bg)) |
| 4871 | return 0; /* same as default */ | 4871 | return false; /* same as default */ |
| 4872 | else if (! tty_lookup_color (f, bg, &bg_tty_color, &bg_std_color)) | 4872 | else if (! tty_lookup_color (f, bg, &bg_tty_color, &bg_std_color)) |
| 4873 | return 0; /* not a valid color */ | 4873 | return false; /* not a valid color */ |
| 4874 | else if (color_distance (&bg_tty_color, &bg_std_color) | 4874 | else if (color_distance (&bg_tty_color, &bg_std_color) |
| 4875 | > TTY_SAME_COLOR_THRESHOLD) | 4875 | > TTY_SAME_COLOR_THRESHOLD) |
| 4876 | return 0; /* displayed color is too different */ | 4876 | return false; /* displayed color is too different */ |
| 4877 | else | 4877 | else |
| 4878 | /* Make sure the color is really different than the default. */ | 4878 | /* Make sure the color is really different than the default. */ |
| 4879 | { | 4879 | { |
| @@ -4881,7 +4881,7 @@ tty_supports_face_attributes_p (struct frame *f, | |||
| 4881 | if (tty_lookup_color (f, def_bg, &def_bg_color, 0) | 4881 | if (tty_lookup_color (f, def_bg, &def_bg_color, 0) |
| 4882 | && (color_distance (&bg_tty_color, &def_bg_color) | 4882 | && (color_distance (&bg_tty_color, &def_bg_color) |
| 4883 | <= TTY_SAME_COLOR_THRESHOLD)) | 4883 | <= TTY_SAME_COLOR_THRESHOLD)) |
| 4884 | return 0; | 4884 | return false; |
| 4885 | } | 4885 | } |
| 4886 | } | 4886 | } |
| 4887 | 4887 | ||
| @@ -4896,7 +4896,7 @@ tty_supports_face_attributes_p (struct frame *f, | |||
| 4896 | - color_distance (&fg_tty_color, &bg_tty_color)); | 4896 | - color_distance (&fg_tty_color, &bg_tty_color)); |
| 4897 | if (delta_delta > TTY_SAME_COLOR_THRESHOLD | 4897 | if (delta_delta > TTY_SAME_COLOR_THRESHOLD |
| 4898 | || delta_delta < -TTY_SAME_COLOR_THRESHOLD) | 4898 | || delta_delta < -TTY_SAME_COLOR_THRESHOLD) |
| 4899 | return 0; | 4899 | return false; |
| 4900 | } | 4900 | } |
| 4901 | 4901 | ||
| 4902 | 4902 | ||
| @@ -4927,7 +4927,7 @@ satisfied by the tty display code's automatic substitution of a `dim' | |||
| 4927 | face for italic. */) | 4927 | face for italic. */) |
| 4928 | (Lisp_Object attributes, Lisp_Object display) | 4928 | (Lisp_Object attributes, Lisp_Object display) |
| 4929 | { | 4929 | { |
| 4930 | bool supports = 0; | 4930 | bool supports = false; |
| 4931 | int i; | 4931 | int i; |
| 4932 | Lisp_Object frame; | 4932 | Lisp_Object frame; |
| 4933 | struct frame *f; | 4933 | struct frame *f; |
| @@ -4962,7 +4962,7 @@ face for italic. */) | |||
| 4962 | 4962 | ||
| 4963 | for (i = 0; i < LFACE_VECTOR_SIZE; i++) | 4963 | for (i = 0; i < LFACE_VECTOR_SIZE; i++) |
| 4964 | attrs[i] = Qunspecified; | 4964 | attrs[i] = Qunspecified; |
| 4965 | merge_face_ref (f, attributes, attrs, 1, 0); | 4965 | merge_face_ref (f, attributes, attrs, true, 0); |
| 4966 | 4966 | ||
| 4967 | def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); | 4967 | def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); |
| 4968 | if (def_face == NULL) | 4968 | if (def_face == NULL) |
| @@ -5140,7 +5140,7 @@ face_fontset (Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5140 | static bool | 5140 | static bool |
| 5141 | realize_basic_faces (struct frame *f) | 5141 | realize_basic_faces (struct frame *f) |
| 5142 | { | 5142 | { |
| 5143 | bool success_p = 0; | 5143 | bool success_p = false; |
| 5144 | ptrdiff_t count = SPECPDL_INDEX (); | 5144 | ptrdiff_t count = SPECPDL_INDEX (); |
| 5145 | 5145 | ||
| 5146 | /* Block input here so that we won't be surprised by an X expose | 5146 | /* Block input here so that we won't be surprised by an X expose |
| @@ -5170,14 +5170,14 @@ realize_basic_faces (struct frame *f) | |||
| 5170 | /* Reflect changes in the `menu' face in menu bars. */ | 5170 | /* Reflect changes in the `menu' face in menu bars. */ |
| 5171 | if (FRAME_FACE_CACHE (f)->menu_face_changed_p) | 5171 | if (FRAME_FACE_CACHE (f)->menu_face_changed_p) |
| 5172 | { | 5172 | { |
| 5173 | FRAME_FACE_CACHE (f)->menu_face_changed_p = 0; | 5173 | FRAME_FACE_CACHE (f)->menu_face_changed_p = false; |
| 5174 | #ifdef USE_X_TOOLKIT | 5174 | #ifdef USE_X_TOOLKIT |
| 5175 | if (FRAME_WINDOW_P (f)) | 5175 | if (FRAME_WINDOW_P (f)) |
| 5176 | x_update_menu_appearance (f); | 5176 | x_update_menu_appearance (f); |
| 5177 | #endif | 5177 | #endif |
| 5178 | } | 5178 | } |
| 5179 | 5179 | ||
| 5180 | success_p = 1; | 5180 | success_p = true; |
| 5181 | } | 5181 | } |
| 5182 | 5182 | ||
| 5183 | unbind_to (count, Qnil); | 5183 | unbind_to (count, Qnil); |
| @@ -5199,7 +5199,7 @@ realize_default_face (struct frame *f) | |||
| 5199 | struct face *face; | 5199 | struct face *face; |
| 5200 | 5200 | ||
| 5201 | /* If the `default' face is not yet known, create it. */ | 5201 | /* If the `default' face is not yet known, create it. */ |
| 5202 | lface = lface_from_face_name (f, Qdefault, 0); | 5202 | lface = lface_from_face_name (f, Qdefault, false); |
| 5203 | if (NILP (lface)) | 5203 | if (NILP (lface)) |
| 5204 | { | 5204 | { |
| 5205 | Lisp_Object frame; | 5205 | Lisp_Object frame; |
| @@ -5215,7 +5215,7 @@ realize_default_face (struct frame *f) | |||
| 5215 | XSETFONT (font_object, FRAME_FONT (f)); | 5215 | XSETFONT (font_object, FRAME_FONT (f)); |
| 5216 | set_lface_from_font (f, lface, font_object, f->default_face_done_p); | 5216 | set_lface_from_font (f, lface, font_object, f->default_face_done_p); |
| 5217 | ASET (lface, LFACE_FONTSET_INDEX, fontset_name (FRAME_FONTSET (f))); | 5217 | ASET (lface, LFACE_FONTSET_INDEX, fontset_name (FRAME_FONTSET (f))); |
| 5218 | f->default_face_done_p = 1; | 5218 | f->default_face_done_p = true; |
| 5219 | } | 5219 | } |
| 5220 | #endif /* HAVE_WINDOW_SYSTEM */ | 5220 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 5221 | 5221 | ||
| @@ -5257,7 +5257,7 @@ realize_default_face (struct frame *f) | |||
| 5257 | if (CONSP (color) && STRINGP (XCDR (color))) | 5257 | if (CONSP (color) && STRINGP (XCDR (color))) |
| 5258 | ASET (lface, LFACE_FOREGROUND_INDEX, XCDR (color)); | 5258 | ASET (lface, LFACE_FOREGROUND_INDEX, XCDR (color)); |
| 5259 | else if (FRAME_WINDOW_P (f)) | 5259 | else if (FRAME_WINDOW_P (f)) |
| 5260 | return 0; | 5260 | return false; |
| 5261 | else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) | 5261 | else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) |
| 5262 | ASET (lface, LFACE_FOREGROUND_INDEX, build_string (unspecified_fg)); | 5262 | ASET (lface, LFACE_FOREGROUND_INDEX, build_string (unspecified_fg)); |
| 5263 | else | 5263 | else |
| @@ -5272,7 +5272,7 @@ realize_default_face (struct frame *f) | |||
| 5272 | if (CONSP (color) && STRINGP (XCDR (color))) | 5272 | if (CONSP (color) && STRINGP (XCDR (color))) |
| 5273 | ASET (lface, LFACE_BACKGROUND_INDEX, XCDR (color)); | 5273 | ASET (lface, LFACE_BACKGROUND_INDEX, XCDR (color)); |
| 5274 | else if (FRAME_WINDOW_P (f)) | 5274 | else if (FRAME_WINDOW_P (f)) |
| 5275 | return 0; | 5275 | return false; |
| 5276 | else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) | 5276 | else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) |
| 5277 | ASET (lface, LFACE_BACKGROUND_INDEX, build_string (unspecified_bg)); | 5277 | ASET (lface, LFACE_BACKGROUND_INDEX, build_string (unspecified_bg)); |
| 5278 | else | 5278 | else |
| @@ -5295,7 +5295,7 @@ realize_default_face (struct frame *f) | |||
| 5295 | /* This can happen when making a frame on a display that does | 5295 | /* This can happen when making a frame on a display that does |
| 5296 | not support the default font. */ | 5296 | not support the default font. */ |
| 5297 | if (!face->font) | 5297 | if (!face->font) |
| 5298 | return 0; | 5298 | return false; |
| 5299 | 5299 | ||
| 5300 | /* Otherwise, the font specified for the frame was not | 5300 | /* Otherwise, the font specified for the frame was not |
| 5301 | acceptable as a font for the default face (perhaps because | 5301 | acceptable as a font for the default face (perhaps because |
| @@ -5305,7 +5305,7 @@ realize_default_face (struct frame *f) | |||
| 5305 | } | 5305 | } |
| 5306 | #endif /* HAVE_X_WINDOWS */ | 5306 | #endif /* HAVE_X_WINDOWS */ |
| 5307 | #endif /* HAVE_WINDOW_SYSTEM */ | 5307 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 5308 | return 1; | 5308 | return true; |
| 5309 | } | 5309 | } |
| 5310 | 5310 | ||
| 5311 | 5311 | ||
| @@ -5317,12 +5317,12 @@ static void | |||
| 5317 | realize_named_face (struct frame *f, Lisp_Object symbol, int id) | 5317 | realize_named_face (struct frame *f, Lisp_Object symbol, int id) |
| 5318 | { | 5318 | { |
| 5319 | struct face_cache *c = FRAME_FACE_CACHE (f); | 5319 | struct face_cache *c = FRAME_FACE_CACHE (f); |
| 5320 | Lisp_Object lface = lface_from_face_name (f, symbol, 0); | 5320 | Lisp_Object lface = lface_from_face_name (f, symbol, false); |
| 5321 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 5321 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| 5322 | Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE]; | 5322 | Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE]; |
| 5323 | 5323 | ||
| 5324 | /* The default face must exist and be fully specified. */ | 5324 | /* The default face must exist and be fully specified. */ |
| 5325 | get_lface_attributes_no_remap (f, Qdefault, attrs, 1); | 5325 | get_lface_attributes_no_remap (f, Qdefault, attrs, true); |
| 5326 | check_lface_attrs (attrs); | 5326 | check_lface_attrs (attrs); |
| 5327 | eassert (lface_fully_specified_p (attrs)); | 5327 | eassert (lface_fully_specified_p (attrs)); |
| 5328 | 5328 | ||
| @@ -5335,7 +5335,7 @@ realize_named_face (struct frame *f, Lisp_Object symbol, int id) | |||
| 5335 | } | 5335 | } |
| 5336 | 5336 | ||
| 5337 | /* Merge SYMBOL's face with the default face. */ | 5337 | /* Merge SYMBOL's face with the default face. */ |
| 5338 | get_lface_attributes_no_remap (f, symbol, symbol_attrs, 1); | 5338 | get_lface_attributes_no_remap (f, symbol, symbol_attrs, true); |
| 5339 | merge_face_vectors (f, symbol_attrs, attrs, 0); | 5339 | merge_face_vectors (f, symbol_attrs, attrs, 0); |
| 5340 | 5340 | ||
| 5341 | /* Realize the face. */ | 5341 | /* Realize the face. */ |
| @@ -5407,7 +5407,7 @@ realize_non_ascii_face (struct frame *f, Lisp_Object font_object, | |||
| 5407 | && FONT_WEIGHT_NUMERIC (font_object) <= 100); | 5407 | && FONT_WEIGHT_NUMERIC (font_object) <= 100); |
| 5408 | 5408 | ||
| 5409 | /* Don't try to free the colors copied bitwise from BASE_FACE. */ | 5409 | /* Don't try to free the colors copied bitwise from BASE_FACE. */ |
| 5410 | face->colors_copied_bitwise_p = 1; | 5410 | face->colors_copied_bitwise_p = true; |
| 5411 | face->font = NILP (font_object) ? NULL : XFONT_OBJECT (font_object); | 5411 | face->font = NILP (font_object) ? NULL : XFONT_OBJECT (font_object); |
| 5412 | face->gc = 0; | 5412 | face->gc = 0; |
| 5413 | 5413 | ||
| @@ -5491,7 +5491,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5491 | if (face->font | 5491 | if (face->font |
| 5492 | && FONT_WEIGHT_NAME_NUMERIC (attrs[LFACE_WEIGHT_INDEX]) > 100 | 5492 | && FONT_WEIGHT_NAME_NUMERIC (attrs[LFACE_WEIGHT_INDEX]) > 100 |
| 5493 | && FONT_WEIGHT_NUMERIC (attrs[LFACE_FONT_INDEX]) <= 100) | 5493 | && FONT_WEIGHT_NUMERIC (attrs[LFACE_FONT_INDEX]) <= 100) |
| 5494 | face->overstrike = 1; | 5494 | face->overstrike = true; |
| 5495 | 5495 | ||
| 5496 | /* Load colors, and set remaining attributes. */ | 5496 | /* Load colors, and set remaining attributes. */ |
| 5497 | 5497 | ||
| @@ -5516,7 +5516,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5516 | face->box = FACE_SIMPLE_BOX; | 5516 | face->box = FACE_SIMPLE_BOX; |
| 5517 | face->box_line_width = XINT (box); | 5517 | face->box_line_width = XINT (box); |
| 5518 | face->box_color = face->foreground; | 5518 | face->box_color = face->foreground; |
| 5519 | face->box_color_defaulted_p = 1; | 5519 | face->box_color_defaulted_p = true; |
| 5520 | } | 5520 | } |
| 5521 | else if (CONSP (box)) | 5521 | else if (CONSP (box)) |
| 5522 | { | 5522 | { |
| @@ -5524,7 +5524,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5524 | being one of `raised' or `sunken'. */ | 5524 | being one of `raised' or `sunken'. */ |
| 5525 | face->box = FACE_SIMPLE_BOX; | 5525 | face->box = FACE_SIMPLE_BOX; |
| 5526 | face->box_color = face->foreground; | 5526 | face->box_color = face->foreground; |
| 5527 | face->box_color_defaulted_p = 1; | 5527 | face->box_color_defaulted_p = true; |
| 5528 | face->box_line_width = 1; | 5528 | face->box_line_width = 1; |
| 5529 | 5529 | ||
| 5530 | while (CONSP (box)) | 5530 | while (CONSP (box)) |
| @@ -5550,7 +5550,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5550 | { | 5550 | { |
| 5551 | face->box_color = load_color (f, face, value, | 5551 | face->box_color = load_color (f, face, value, |
| 5552 | LFACE_BOX_INDEX); | 5552 | LFACE_BOX_INDEX); |
| 5553 | face->use_box_color_for_shadows_p = 1; | 5553 | face->use_box_color_for_shadows_p = true; |
| 5554 | } | 5554 | } |
| 5555 | } | 5555 | } |
| 5556 | else if (EQ (keyword, QCstyle)) | 5556 | else if (EQ (keyword, QCstyle)) |
| @@ -5569,34 +5569,34 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5569 | if (EQ (underline, Qt)) | 5569 | if (EQ (underline, Qt)) |
| 5570 | { | 5570 | { |
| 5571 | /* Use default color (same as foreground color). */ | 5571 | /* Use default color (same as foreground color). */ |
| 5572 | face->underline_p = 1; | 5572 | face->underline_p = true; |
| 5573 | face->underline_type = FACE_UNDER_LINE; | 5573 | face->underline_type = FACE_UNDER_LINE; |
| 5574 | face->underline_defaulted_p = 1; | 5574 | face->underline_defaulted_p = true; |
| 5575 | face->underline_color = 0; | 5575 | face->underline_color = 0; |
| 5576 | } | 5576 | } |
| 5577 | else if (STRINGP (underline)) | 5577 | else if (STRINGP (underline)) |
| 5578 | { | 5578 | { |
| 5579 | /* Use specified color. */ | 5579 | /* Use specified color. */ |
| 5580 | face->underline_p = 1; | 5580 | face->underline_p = true; |
| 5581 | face->underline_type = FACE_UNDER_LINE; | 5581 | face->underline_type = FACE_UNDER_LINE; |
| 5582 | face->underline_defaulted_p = 0; | 5582 | face->underline_defaulted_p = false; |
| 5583 | face->underline_color | 5583 | face->underline_color |
| 5584 | = load_color (f, face, underline, | 5584 | = load_color (f, face, underline, |
| 5585 | LFACE_UNDERLINE_INDEX); | 5585 | LFACE_UNDERLINE_INDEX); |
| 5586 | } | 5586 | } |
| 5587 | else if (NILP (underline)) | 5587 | else if (NILP (underline)) |
| 5588 | { | 5588 | { |
| 5589 | face->underline_p = 0; | 5589 | face->underline_p = false; |
| 5590 | face->underline_defaulted_p = 0; | 5590 | face->underline_defaulted_p = false; |
| 5591 | face->underline_color = 0; | 5591 | face->underline_color = 0; |
| 5592 | } | 5592 | } |
| 5593 | else if (CONSP (underline)) | 5593 | else if (CONSP (underline)) |
| 5594 | { | 5594 | { |
| 5595 | /* `(:color COLOR :style STYLE)'. | 5595 | /* `(:color COLOR :style STYLE)'. |
| 5596 | STYLE being one of `line' or `wave'. */ | 5596 | STYLE being one of `line' or `wave'. */ |
| 5597 | face->underline_p = 1; | 5597 | face->underline_p = true; |
| 5598 | face->underline_color = 0; | 5598 | face->underline_color = 0; |
| 5599 | face->underline_defaulted_p = 1; | 5599 | face->underline_defaulted_p = true; |
| 5600 | face->underline_type = FACE_UNDER_LINE; | 5600 | face->underline_type = FACE_UNDER_LINE; |
| 5601 | 5601 | ||
| 5602 | /* FIXME? This is also not robust about checking the precise form. | 5602 | /* FIXME? This is also not robust about checking the precise form. |
| @@ -5617,12 +5617,12 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5617 | { | 5617 | { |
| 5618 | if (EQ (value, Qforeground_color)) | 5618 | if (EQ (value, Qforeground_color)) |
| 5619 | { | 5619 | { |
| 5620 | face->underline_defaulted_p = 1; | 5620 | face->underline_defaulted_p = true; |
| 5621 | face->underline_color = 0; | 5621 | face->underline_color = 0; |
| 5622 | } | 5622 | } |
| 5623 | else if (STRINGP (value)) | 5623 | else if (STRINGP (value)) |
| 5624 | { | 5624 | { |
| 5625 | face->underline_defaulted_p = 0; | 5625 | face->underline_defaulted_p = false; |
| 5626 | face->underline_color = load_color (f, face, value, | 5626 | face->underline_color = load_color (f, face, value, |
| 5627 | LFACE_UNDERLINE_INDEX); | 5627 | LFACE_UNDERLINE_INDEX); |
| 5628 | } | 5628 | } |
| @@ -5643,13 +5643,13 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5643 | face->overline_color | 5643 | face->overline_color |
| 5644 | = load_color (f, face, attrs[LFACE_OVERLINE_INDEX], | 5644 | = load_color (f, face, attrs[LFACE_OVERLINE_INDEX], |
| 5645 | LFACE_OVERLINE_INDEX); | 5645 | LFACE_OVERLINE_INDEX); |
| 5646 | face->overline_p = 1; | 5646 | face->overline_p = true; |
| 5647 | } | 5647 | } |
| 5648 | else if (EQ (overline, Qt)) | 5648 | else if (EQ (overline, Qt)) |
| 5649 | { | 5649 | { |
| 5650 | face->overline_color = face->foreground; | 5650 | face->overline_color = face->foreground; |
| 5651 | face->overline_color_defaulted_p = 1; | 5651 | face->overline_color_defaulted_p = true; |
| 5652 | face->overline_p = 1; | 5652 | face->overline_p = true; |
| 5653 | } | 5653 | } |
| 5654 | 5654 | ||
| 5655 | strike_through = attrs[LFACE_STRIKE_THROUGH_INDEX]; | 5655 | strike_through = attrs[LFACE_STRIKE_THROUGH_INDEX]; |
| @@ -5658,13 +5658,13 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5658 | face->strike_through_color | 5658 | face->strike_through_color |
| 5659 | = load_color (f, face, attrs[LFACE_STRIKE_THROUGH_INDEX], | 5659 | = load_color (f, face, attrs[LFACE_STRIKE_THROUGH_INDEX], |
| 5660 | LFACE_STRIKE_THROUGH_INDEX); | 5660 | LFACE_STRIKE_THROUGH_INDEX); |
| 5661 | face->strike_through_p = 1; | 5661 | face->strike_through_p = true; |
| 5662 | } | 5662 | } |
| 5663 | else if (EQ (strike_through, Qt)) | 5663 | else if (EQ (strike_through, Qt)) |
| 5664 | { | 5664 | { |
| 5665 | face->strike_through_color = face->foreground; | 5665 | face->strike_through_color = face->foreground; |
| 5666 | face->strike_through_color_defaulted_p = 1; | 5666 | face->strike_through_color_defaulted_p = true; |
| 5667 | face->strike_through_p = 1; | 5667 | face->strike_through_p = true; |
| 5668 | } | 5668 | } |
| 5669 | 5669 | ||
| 5670 | stipple = attrs[LFACE_STIPPLE_INDEX]; | 5670 | stipple = attrs[LFACE_STIPPLE_INDEX]; |
| @@ -5678,15 +5678,15 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5678 | 5678 | ||
| 5679 | /* Map a specified color of face FACE on frame F to a tty color index. | 5679 | /* Map a specified color of face FACE on frame F to a tty color index. |
| 5680 | IDX is either LFACE_FOREGROUND_INDEX or LFACE_BACKGROUND_INDEX, and | 5680 | IDX is either LFACE_FOREGROUND_INDEX or LFACE_BACKGROUND_INDEX, and |
| 5681 | specifies which color to map. Set *DEFAULTED to 1 if mapping to the | 5681 | specifies which color to map. Set *DEFAULTED to true if mapping to the |
| 5682 | default foreground/background colors. */ | 5682 | default foreground/background colors. */ |
| 5683 | 5683 | ||
| 5684 | static void | 5684 | static void |
| 5685 | map_tty_color (struct frame *f, struct face *face, | 5685 | map_tty_color (struct frame *f, struct face *face, |
| 5686 | enum lface_attribute_index idx, int *defaulted) | 5686 | enum lface_attribute_index idx, bool *defaulted) |
| 5687 | { | 5687 | { |
| 5688 | Lisp_Object frame, color, def; | 5688 | Lisp_Object frame, color, def; |
| 5689 | int foreground_p = idx == LFACE_FOREGROUND_INDEX; | 5689 | bool foreground_p = idx == LFACE_FOREGROUND_INDEX; |
| 5690 | unsigned long default_pixel = | 5690 | unsigned long default_pixel = |
| 5691 | foreground_p ? FACE_TTY_DEFAULT_FG_COLOR : FACE_TTY_DEFAULT_BG_COLOR; | 5691 | foreground_p ? FACE_TTY_DEFAULT_FG_COLOR : FACE_TTY_DEFAULT_BG_COLOR; |
| 5692 | unsigned long pixel = default_pixel; | 5692 | unsigned long pixel = default_pixel; |
| @@ -5728,7 +5728,7 @@ map_tty_color (struct frame *f, struct face *face, | |||
| 5728 | else | 5728 | else |
| 5729 | pixel = FRAME_BACKGROUND_PIXEL (f); | 5729 | pixel = FRAME_BACKGROUND_PIXEL (f); |
| 5730 | face->lface[idx] = tty_color_name (f, pixel); | 5730 | face->lface[idx] = tty_color_name (f, pixel); |
| 5731 | *defaulted = 1; | 5731 | *defaulted = true; |
| 5732 | } | 5732 | } |
| 5733 | else if (pixel == default_other_pixel) | 5733 | else if (pixel == default_other_pixel) |
| 5734 | { | 5734 | { |
| @@ -5737,7 +5737,7 @@ map_tty_color (struct frame *f, struct face *face, | |||
| 5737 | else | 5737 | else |
| 5738 | pixel = FRAME_FOREGROUND_PIXEL (f); | 5738 | pixel = FRAME_FOREGROUND_PIXEL (f); |
| 5739 | face->lface[idx] = tty_color_name (f, pixel); | 5739 | face->lface[idx] = tty_color_name (f, pixel); |
| 5740 | *defaulted = 1; | 5740 | *defaulted = true; |
| 5741 | } | 5741 | } |
| 5742 | } | 5742 | } |
| 5743 | #endif /* MSDOS */ | 5743 | #endif /* MSDOS */ |
| @@ -5760,7 +5760,7 @@ realize_tty_face (struct face_cache *cache, | |||
| 5760 | { | 5760 | { |
| 5761 | struct face *face; | 5761 | struct face *face; |
| 5762 | int weight, slant; | 5762 | int weight, slant; |
| 5763 | int face_colors_defaulted = 0; | 5763 | bool face_colors_defaulted = false; |
| 5764 | struct frame *f = cache->f; | 5764 | struct frame *f = cache->f; |
| 5765 | 5765 | ||
| 5766 | /* Frame must be a termcap frame. */ | 5766 | /* Frame must be a termcap frame. */ |
| @@ -5768,7 +5768,7 @@ realize_tty_face (struct face_cache *cache, | |||
| 5768 | 5768 | ||
| 5769 | /* Allocate a new realized face. */ | 5769 | /* Allocate a new realized face. */ |
| 5770 | face = make_realized_face (attrs); | 5770 | face = make_realized_face (attrs); |
| 5771 | #if 0 | 5771 | #if false |
| 5772 | face->font_name = FRAME_MSDOS_P (cache->f) ? "ms-dos" : "tty"; | 5772 | face->font_name = FRAME_MSDOS_P (cache->f) ? "ms-dos" : "tty"; |
| 5773 | #endif | 5773 | #endif |
| 5774 | 5774 | ||
| @@ -5776,13 +5776,13 @@ realize_tty_face (struct face_cache *cache, | |||
| 5776 | weight = FONT_WEIGHT_NAME_NUMERIC (attrs[LFACE_WEIGHT_INDEX]); | 5776 | weight = FONT_WEIGHT_NAME_NUMERIC (attrs[LFACE_WEIGHT_INDEX]); |
| 5777 | slant = FONT_SLANT_NAME_NUMERIC (attrs[LFACE_SLANT_INDEX]); | 5777 | slant = FONT_SLANT_NAME_NUMERIC (attrs[LFACE_SLANT_INDEX]); |
| 5778 | if (weight > 100) | 5778 | if (weight > 100) |
| 5779 | face->tty_bold_p = 1; | 5779 | face->tty_bold_p = true; |
| 5780 | if (slant != 100) | 5780 | if (slant != 100) |
| 5781 | face->tty_italic_p = 1; | 5781 | face->tty_italic_p = true; |
| 5782 | if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) | 5782 | if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) |
| 5783 | face->tty_underline_p = 1; | 5783 | face->tty_underline_p = true; |
| 5784 | if (!NILP (attrs[LFACE_INVERSE_INDEX])) | 5784 | if (!NILP (attrs[LFACE_INVERSE_INDEX])) |
| 5785 | face->tty_reverse_p = 1; | 5785 | face->tty_reverse_p = true; |
| 5786 | 5786 | ||
| 5787 | /* Map color names to color indices. */ | 5787 | /* Map color names to color indices. */ |
| 5788 | map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); | 5788 | map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); |
| @@ -5802,7 +5802,7 @@ realize_tty_face (struct face_cache *cache, | |||
| 5802 | && face->tty_bold_p | 5802 | && face->tty_bold_p |
| 5803 | && face->background == FACE_TTY_DEFAULT_FG_COLOR | 5803 | && face->background == FACE_TTY_DEFAULT_FG_COLOR |
| 5804 | && face->foreground == FACE_TTY_DEFAULT_BG_COLOR) | 5804 | && face->foreground == FACE_TTY_DEFAULT_BG_COLOR) |
| 5805 | face->tty_bold_p = 0; | 5805 | face->tty_bold_p = false; |
| 5806 | 5806 | ||
| 5807 | return face; | 5807 | return face; |
| 5808 | } | 5808 | } |
| @@ -5851,7 +5851,7 @@ compute_char_face (struct frame *f, int ch, Lisp_Object prop) | |||
| 5851 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 5851 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| 5852 | struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); | 5852 | struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); |
| 5853 | memcpy (attrs, default_face->lface, sizeof attrs); | 5853 | memcpy (attrs, default_face->lface, sizeof attrs); |
| 5854 | merge_face_ref (f, prop, attrs, 1, 0); | 5854 | merge_face_ref (f, prop, attrs, true, 0); |
| 5855 | face_id = lookup_face (f, attrs); | 5855 | face_id = lookup_face (f, attrs); |
| 5856 | } | 5856 | } |
| 5857 | 5857 | ||
| @@ -5869,7 +5869,7 @@ compute_char_face (struct frame *f, int ch, Lisp_Object prop) | |||
| 5869 | LIMIT is a position not to scan beyond. That is to limit the time | 5869 | LIMIT is a position not to scan beyond. That is to limit the time |
| 5870 | this function can take. | 5870 | this function can take. |
| 5871 | 5871 | ||
| 5872 | If MOUSE is non-zero, use the character's mouse-face, not its face. | 5872 | If MOUSE, use the character's mouse-face, not its face. |
| 5873 | 5873 | ||
| 5874 | BASE_FACE_ID, if non-negative, specifies a base face id to use | 5874 | BASE_FACE_ID, if non-negative, specifies a base face id to use |
| 5875 | instead of DEFAULT_FACE_ID. | 5875 | instead of DEFAULT_FACE_ID. |
| @@ -5879,7 +5879,7 @@ compute_char_face (struct frame *f, int ch, Lisp_Object prop) | |||
| 5879 | int | 5879 | int |
| 5880 | face_at_buffer_position (struct window *w, ptrdiff_t pos, | 5880 | face_at_buffer_position (struct window *w, ptrdiff_t pos, |
| 5881 | ptrdiff_t *endptr, ptrdiff_t limit, | 5881 | ptrdiff_t *endptr, ptrdiff_t limit, |
| 5882 | int mouse, int base_face_id) | 5882 | bool mouse, int base_face_id) |
| 5883 | { | 5883 | { |
| 5884 | struct frame *f = XFRAME (w->frame); | 5884 | struct frame *f = XFRAME (w->frame); |
| 5885 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 5885 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| @@ -5912,7 +5912,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 5912 | { | 5912 | { |
| 5913 | ptrdiff_t next_overlay; | 5913 | ptrdiff_t next_overlay; |
| 5914 | 5914 | ||
| 5915 | GET_OVERLAYS_AT (pos, overlay_vec, noverlays, &next_overlay, 0); | 5915 | GET_OVERLAYS_AT (pos, overlay_vec, noverlays, &next_overlay, false); |
| 5916 | if (next_overlay < endpos) | 5916 | if (next_overlay < endpos) |
| 5917 | endpos = next_overlay; | 5917 | endpos = next_overlay; |
| 5918 | } | 5918 | } |
| @@ -5945,7 +5945,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 5945 | 5945 | ||
| 5946 | /* Merge in attributes specified via text properties. */ | 5946 | /* Merge in attributes specified via text properties. */ |
| 5947 | if (!NILP (prop)) | 5947 | if (!NILP (prop)) |
| 5948 | merge_face_ref (f, prop, attrs, 1, 0); | 5948 | merge_face_ref (f, prop, attrs, true, 0); |
| 5949 | 5949 | ||
| 5950 | /* Now merge the overlay data. */ | 5950 | /* Now merge the overlay data. */ |
| 5951 | noverlays = sort_overlays (overlay_vec, noverlays, w); | 5951 | noverlays = sort_overlays (overlay_vec, noverlays, w); |
| @@ -5956,7 +5956,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 5956 | 5956 | ||
| 5957 | prop = Foverlay_get (overlay_vec[i], propname); | 5957 | prop = Foverlay_get (overlay_vec[i], propname); |
| 5958 | if (!NILP (prop)) | 5958 | if (!NILP (prop)) |
| 5959 | merge_face_ref (f, prop, attrs, 1, 0); | 5959 | merge_face_ref (f, prop, attrs, true, 0); |
| 5960 | 5960 | ||
| 5961 | oend = OVERLAY_END (overlay_vec[i]); | 5961 | oend = OVERLAY_END (overlay_vec[i]); |
| 5962 | oendpos = OVERLAY_POSITION (oend); | 5962 | oendpos = OVERLAY_POSITION (oend); |
| @@ -5982,7 +5982,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 5982 | int | 5982 | int |
| 5983 | face_for_overlay_string (struct window *w, ptrdiff_t pos, | 5983 | face_for_overlay_string (struct window *w, ptrdiff_t pos, |
| 5984 | ptrdiff_t *endptr, ptrdiff_t limit, | 5984 | ptrdiff_t *endptr, ptrdiff_t limit, |
| 5985 | int mouse, Lisp_Object overlay) | 5985 | bool mouse, Lisp_Object overlay) |
| 5986 | { | 5986 | { |
| 5987 | struct frame *f = XFRAME (w->frame); | 5987 | struct frame *f = XFRAME (w->frame); |
| 5988 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 5988 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| @@ -6021,7 +6021,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos, | |||
| 6021 | 6021 | ||
| 6022 | /* Merge in attributes specified via text properties. */ | 6022 | /* Merge in attributes specified via text properties. */ |
| 6023 | if (!NILP (prop)) | 6023 | if (!NILP (prop)) |
| 6024 | merge_face_ref (f, prop, attrs, 1, 0); | 6024 | merge_face_ref (f, prop, attrs, true, 0); |
| 6025 | 6025 | ||
| 6026 | *endptr = endpos; | 6026 | *endptr = endpos; |
| 6027 | 6027 | ||
| @@ -6043,7 +6043,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos, | |||
| 6043 | BASE_FACE_ID is the id of a face to merge with. For strings coming | 6043 | BASE_FACE_ID is the id of a face to merge with. For strings coming |
| 6044 | from overlays or the `display' property it is the face at BUFPOS. | 6044 | from overlays or the `display' property it is the face at BUFPOS. |
| 6045 | 6045 | ||
| 6046 | If MOUSE_P is non-zero, use the character's mouse-face, not its face. | 6046 | If MOUSE_P, use the character's mouse-face, not its face. |
| 6047 | 6047 | ||
| 6048 | Set *ENDPTR to the next position where to check for faces in | 6048 | Set *ENDPTR to the next position where to check for faces in |
| 6049 | STRING; -1 if the face is constant from POS to the end of the | 6049 | STRING; -1 if the face is constant from POS to the end of the |
| @@ -6056,7 +6056,7 @@ int | |||
| 6056 | face_at_string_position (struct window *w, Lisp_Object string, | 6056 | face_at_string_position (struct window *w, Lisp_Object string, |
| 6057 | ptrdiff_t pos, ptrdiff_t bufpos, | 6057 | ptrdiff_t pos, ptrdiff_t bufpos, |
| 6058 | ptrdiff_t *endptr, enum face_id base_face_id, | 6058 | ptrdiff_t *endptr, enum face_id base_face_id, |
| 6059 | int mouse_p) | 6059 | bool mouse_p) |
| 6060 | { | 6060 | { |
| 6061 | Lisp_Object prop, position, end, limit; | 6061 | Lisp_Object prop, position, end, limit; |
| 6062 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 6062 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| @@ -6101,7 +6101,7 @@ face_at_string_position (struct window *w, Lisp_Object string, | |||
| 6101 | 6101 | ||
| 6102 | /* Merge in attributes specified via text properties. */ | 6102 | /* Merge in attributes specified via text properties. */ |
| 6103 | if (!NILP (prop)) | 6103 | if (!NILP (prop)) |
| 6104 | merge_face_ref (f, prop, attrs, 1, 0); | 6104 | merge_face_ref (f, prop, attrs, true, 0); |
| 6105 | 6105 | ||
| 6106 | /* Look up a realized face with the given face attributes, | 6106 | /* Look up a realized face with the given face attributes, |
| 6107 | or realize a new one for ASCII characters. */ | 6107 | or realize a new one for ASCII characters. */ |
diff --git a/test/ChangeLog b/test/ChangeLog index d8cd36790f2..61ab8b6595a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2015-01-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * automated/cl-generic-tests.el: Try and make sure cl-lib is not | ||
| 4 | required at run-time. | ||
| 5 | |||
| 6 | 2015-01-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 7 | |||
| 8 | * automated/cl-generic-tests.el (cl-generic-test-11-next-method-p): | ||
| 9 | New test. | ||
| 10 | |||
| 1 | 2015-01-25 Paul Eggert <eggert@cs.ucla.edu> | 11 | 2015-01-25 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 12 | ||
| 3 | * indent/shell.sh (bar): Use '[ $# -eq 0 ]', not '[ $# == 0 ]'. | 13 | * indent/shell.sh (bar): Use '[ $# -eq 0 ]', not '[ $# == 0 ]'. |
diff --git a/test/automated/cl-generic-tests.el b/test/automated/cl-generic-tests.el index bc9a1ece423..5194802fa00 100644 --- a/test/automated/cl-generic-tests.el +++ b/test/automated/cl-generic-tests.el | |||
| @@ -23,8 +23,8 @@ | |||
| 23 | 23 | ||
| 24 | ;;; Code: | 24 | ;;; Code: |
| 25 | 25 | ||
| 26 | (require 'ert) | 26 | (eval-when-compile (require 'ert)) ;Don't indirectly require cl-lib at run-time. |
| 27 | (require 'cl-lib) | 27 | (require 'cl-generic) |
| 28 | 28 | ||
| 29 | (cl-defgeneric cl--generic-1 (x y)) | 29 | (cl-defgeneric cl--generic-1 (x y)) |
| 30 | (cl-defgeneric (setf cl--generic-1) (v y z) "My generic doc.") | 30 | (cl-defgeneric (setf cl--generic-1) (v y z) "My generic doc.") |
| @@ -171,5 +171,13 @@ | |||
| 171 | (should (equal (cl--generic-1 'a 'b) '(a b))) | 171 | (should (equal (cl--generic-1 'a 'b) '(a b))) |
| 172 | (should (equal (cl--generic-1 1 2) '("integer" 2 1)))) | 172 | (should (equal (cl--generic-1 1 2) '("integer" 2 1)))) |
| 173 | 173 | ||
| 174 | (ert-deftest cl-generic-test-11-next-method-p () | ||
| 175 | (cl-defgeneric cl--generic-1 (x y)) | ||
| 176 | (cl-defmethod cl--generic-1 ((x t) y) | ||
| 177 | (list x y (cl-next-method-p))) | ||
| 178 | (cl-defmethod cl--generic-1 ((_x (eql 4)) _y) | ||
| 179 | (cl-list* "quatre" (cl-next-method-p) (cl-call-next-method))) | ||
| 180 | (should (equal (cl--generic-1 4 5) '("quatre" t 4 5 nil)))) | ||
| 181 | |||
| 174 | (provide 'cl-generic-tests) | 182 | (provide 'cl-generic-tests) |
| 175 | ;;; cl-generic-tests.el ends here | 183 | ;;; cl-generic-tests.el ends here |