Mercurial > hg > xemacs-beta
changeset 5128:7be849cb8828 ben-lisp-object
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sun, 07 Mar 2010 02:09:59 -0600 |
parents | a9c41067dd88 (current diff) 4129013a3954 (diff) |
children | ebd8cab8629f |
files | lisp/ChangeLog man/ChangeLog man/custom.texi man/internals/internals.texi src/ChangeLog src/bytecode.c src/console-gtk-impl.h src/console-impl.h src/console-stream.c src/console-x-impl.h src/data.c src/elhash.c src/emacs.c src/eval.c src/faces.c src/faces.h src/file-coding.c src/fns.c src/frame-gtk.c src/frame-impl.h src/frame-x.c src/frame.c src/frame.h src/keymap.c src/lisp.h src/lrecord.h src/objects-impl.h src/objects.c src/objects.h src/toolbar.c src/toolbar.h src/window.c |
diffstat | 91 files changed, 2786 insertions(+), 1964 deletions(-) [+] |
line wrap: on
line diff
--- a/lib-src/ChangeLog Fri Mar 05 04:08:17 2010 -0600 +++ b/lib-src/ChangeLog Sun Mar 07 02:09:59 2010 -0600 @@ -1,3 +1,20 @@ +2010-03-02 Ben Wing <ben@xemacs.org> + + * digest-doc.c: + * make-path.c: + `emacs' isn't defined, but HAVE_CONFIG_H is, so use it to get + config.h. + + * getopt.h: + Conditionalize on HAVE_CONFIG_H to get real prototypes. + +2010-02-25 Ben Wing <ben@xemacs.org> + + * make-docfile.c: + * make-docfile.c (write_c_args): + Convert newlines to spaces so that argument lists are always on one + line, because that's what function-documentation-1 expects. + 2010-02-11 Vin Shelton <acs@xemacs.org> * winclient.c: Bump connection retries to 20 because some people
--- a/lib-src/digest-doc.c Fri Mar 05 04:08:17 2010 -0600 +++ b/lib-src/digest-doc.c Sun Mar 07 02:09:59 2010 -0600 @@ -5,7 +5,7 @@ See also sorted-doc.c, which produces similar output but in texinfo format and sorted by function/variable name. */ -#ifdef emacs +#ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h>
--- a/lib-src/getopt.h Fri Mar 05 04:08:17 2010 -0600 +++ b/lib-src/getopt.h Sun Mar 07 02:09:59 2010 -0600 @@ -98,7 +98,7 @@ #define required_argument 1 #define optional_argument 2 -#if defined (__GNU_LIBRARY__) || defined (__cplusplus) || defined (CYGWIN) +#if defined (__GNU_LIBRARY__) || defined (__cplusplus) || defined (HAVE_CONFIG_H) /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */
--- a/lib-src/make-docfile.c Fri Mar 05 04:08:17 2010 -0600 +++ b/lib-src/make-docfile.c Sun Mar 07 02:09:59 2010 -0600 @@ -3,7 +3,7 @@ Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1998, 1999 J. Kean Johnston. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2010 Ben Wing. This file is part of XEmacs. @@ -651,11 +651,11 @@ } /* Print the C argument list as it would appear in lisp: - print underscores as hyphens, and print commas and newlines + print underscores as hyphens, and print commas, tabs and newlines as spaces. Collapse adjacent spaces into one. */ if (c == '_') c = '-'; - else if (c == ',' /* || c == '\n' */) + else if (c == ',' || c == '\n' || c == '\t') c = ' '; /* XEmacs change: handle \n below for readability */ @@ -682,18 +682,28 @@ in_ident = 0; just_spaced = 0; } - /* XEmacs change: if the character is carriage return or linefeed, - escape it for the compiler */ +#if 0 + /* [[ XEmacs change: if the character is carriage return or linefeed, + escape it for the compiler ]] I doubt the clause with '\r' ever + worked right, and outputting newlines now screws up the regexp + in function-documentation-1, so don't do this; instead, we treat + newlines like spaces. --ben */ else if (c == '\n') { putc('\\', out); putc('\n', out); + c = ' '; } else if (c == '\r') { putc('\\', out); putc('\r', out); } +#else + else if (c == '\r') /* Just eat it, since we expect a newline to + follow */ + ; +#endif /* (not) 0 */ else if (c != ' ' || !just_spaced) { if (c >= 'a' && c <= 'z')
--- a/lib-src/make-path.c Fri Mar 05 04:08:17 2010 -0600 +++ b/lib-src/make-path.c Sun Mar 07 02:09:59 2010 -0600 @@ -26,7 +26,7 @@ command on some of the purer BSD systems (like Mt. Xinu) don't have that option. */ -#ifdef emacs +#ifdef HAVE_CONFIG_H #include <config.h> #endif
--- a/lisp/ChangeLog Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/ChangeLog Sun Mar 07 02:09:59 2010 -0600 @@ -1,3 +1,106 @@ +2010-03-05 Aidan Kehoe <kehoea@parhasard.net> + + * cl-macs.el (delete-duplicates): + Correct the logic of this compiler macro when :from-end is nil, + avoiding a hang in query-coding-tests.el. Thanks for the reports, + Vin and Mats! + +2010-03-04 Aidan Kehoe <kehoea@parhasard.net> + + * make-docfile.el (process-args): + Use #'subseq here, not #'substring, fixing the native Windows + build. Thank you for the error report, Vin! + +2010-03-03 Aidan Kehoe <kehoea@parhasard.net> + + Move byte code #o117 to #'subseq, not #'substring. + Make #'substring available as an alias for #'subseq in Lisp. + * bytecomp.el (79, subseq, substring): + * bytecomp.el (byte-compile-subseq): New. + * update-elc.el (update-elc-chop-extension): Use #'subseq, not + #'substring, the latter is not yet available. + * subr.el (substring): New alias, to #'subseq. + +2010-03-02 Aidan Kehoe <kehoea@parhasard.net> + + * cl-macs.el (delete-dups): New compiler macro for this function, + expanding to inline byte codes. + (delete-duplicates): Handle the :from-end argument correctly in + this compiler macro. + +2010-03-01 Aidan Kehoe <kehoea@parhasard.net> + + * cl-seq.el (cl-parsing-keywords): + * cl-macs.el (cl-do-arglist): + Use the new invalid-keyword-argument error here. + +2010-02-26 Aidan Kehoe <kehoea@parhasard.net> + + Back out Ben's revision c673987f5f3d. + * coding.el: + Add a compiler macro for #'make-coding-system on non-Mule builds + too, to fix the problem he addressed with that changeset. + * mule/make-coding-system.el (fixed-width-private-use-start): + Don't call (decode-char ... 'ucs) here, it can make bootstrapping + harder. + +2010-02-26 Ben Wing <ben@xemacs.org> + + * autoload.el (autoload-featurep-protect-autoloads): + Always insert a coding-system cookie, either raw-text-unix or + escape-quoted. As before, insert an error statement when an + escape-quoted auto-autoload is loaded in a non-Mule XEmacs. + + This fixes problems when the default coding system is UTF-8, + as in Cygwin. Under some circumstances, the file can get + written out as raw text and read in as UTF-8, where invididual + high-bytes are usually invalid UTF-8 sequences and lead to + error octets in the buffer; when written out again, these + force escape-quoted. Result: auto-autoloads.el for the + source-tree lisp/ directory would end up as escape-quoted. + +2010-02-25 Didier Verna <didier@xemacs.org> + + The background-placement face property. + * cl-macs.el (face-background-placement): New defsetf. + * cus-face.el (custom-face-attributes): + * faces.el (face-interactive): + * faces.el (set-face-property): + * faces.el (face-equal): + * faces.el (init-other-random-faces): Update. + * faces.el (face-background-placement): + * faces.el (set-face-background-placement): + * faces.el (face-background-placement-instance): + * faces.el (face-background-placement-instance-p): + * frame.el (set-frame-background-placement): + * frame.el (frame-background-placement): + * frame.el (frame-background-placement-instance): + * objects.el (make-face-background-placement-specifier): New. + +2010-02-25 Ben Wing <ben@xemacs.org> + + * autoload.el (make-autoload): + Call cl-function-arglist with one arg. + + * cl-macs.el (cl-function-arglist): + * cl-macs.el (cl-transform-lambda): + Make cl-function-arglist take only one arg, the arglist; no + function name passed. Also make sure to print () instead of nil + when empty arglist, or function-documentation-1 won't recognize + the arguments: line. + * help.el (function-arglist): If empty arg, don't display extra + space after function name. + +2010-02-24 Aidan Kehoe <kehoea@parhasard.net> + + * cl-extra.el (constantly): + Normally return a compiled function from #'constantly if we are + handed a single argument. Shouldn't actually matter, the overhead + for returning a single constant in a lambda form vs. in a compiled + function is minuscule, but using compiled functions as much as + possible is good style in XEmacs, our interpreter is not stellar + (nor indeed should it need to be). + 2010-02-23 Ben Wing <ben@xemacs.org> * help.el: fux typo in comment. (oops) @@ -43,29 +146,6 @@ 2010-02-22 Ben Wing <ben@xemacs.org> - * mule/make-coding-system.el: - * mule/make-coding-system.el (fixed-width-generate-helper): - * mule/make-coding-system.el (fixed-width-private-use-start): Removed. - * mule/make-coding-system.el (fixed-width-create-decode-encode-tables): - * coding.el: - * coding.el (decode-char): New. - * coding.el (featurep): - * coding.el (encode-char): New. - * dumped-lisp.el (preloaded-file-list): - Dump make-coding-system. Aidan's hack to avoid dumping this file - never really worked right -- with some configurations (not clear - exactly which ones) `make-coding-system.el' gets dumped anyway due to - calls to `make-coding-system' in unicode.el, with the result that - the documentation of functions in make-coding-system.el gets lost. - - Also needed to remove defvar fixed-width-private-use-start and - incorporate it inline, due to bootstrapping issues -- the call to - decode-char introduced a cross-dependency between unicode.el and - make-coding-system.el. - - -2010-02-22 Ben Wing <ben@xemacs.org> - * cl-seq.el: * cl-seq.el (stable-union): New. * cl-seq.el (stable-intersection): New.
--- a/lisp/autoload.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/autoload.el Sun Mar 07 02:09:59 2010 -0600 @@ -286,11 +286,10 @@ (body (nthcdr (get car 'doc-string-elt) form)) (doc (if (stringp (car body)) (pop body)))) (if (memq car '(defmacro defmacro* defun defun*)) - (let ((arglist (nth 2 form)) - (placeholder (eval-when-compile (gensym)))) + (let ((arglist (nth 2 form))) (setq doc (concat (or doc "") "\n\narguments: " - (cl-function-arglist placeholder arglist t) + (cl-function-arglist arglist) "\n")))) ;; `define-generic-mode' quotes the name, so take care of that (list 'autoload (if (listp name) name (list 'quote name)) file doc @@ -1089,11 +1088,13 @@ ;; recognized only one of the two magic-cookie styles (the -*- kind) ;; in find-file, but both of them in load. We go ahead and put both ;; in, just to be safe. + (insert (format " -*- coding: %s -*-\n" buffer-file-coding-system)) (when (eq buffer-file-coding-system 'escape-quoted) - (insert " -*- coding: escape-quoted; -*- -\(or (featurep 'mule) (error \"Loading this file requires Mule support\")) -;;;###coding system: escape-quoted")) - (insert "\n(if (featurep '" sym ")") + (insert "(or (featurep 'mule) ") + (insert "(error \"Loading this file requires Mule support\"))\n")) + (insert (format ";;;###coding system: %s\n" + buffer-file-coding-system)) + (insert "(if (featurep '" sym ")") (insert " (error \"Feature " sym " already loaded\"))\n") (goto-char (point-max)) (save-excursion
--- a/lisp/bytecomp.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/bytecomp.el Sun Mar 07 02:09:59 2010 -0600 @@ -609,7 +609,7 @@ (byte-defop 76 -1 byte-set) (byte-defop 77 -1 byte-fset) ; this was commented out (byte-defop 78 -1 byte-get) -(byte-defop 79 -2 byte-substring) +(byte-defop 79 -2 byte-subseq) (byte-defop 80 -1 byte-concat2) (byte-defop 81 -2 byte-concat3) (byte-defop 82 -3 byte-concat4) @@ -3111,7 +3111,8 @@ (byte-defop-compiler aref 2) (byte-defop-compiler get 2+1) (byte-defop-compiler nth 2) -(byte-defop-compiler substring 2-3) +(byte-defop-compiler subseq byte-compile-subseq) +(byte-defop-compiler (substring byte-subseq) 2-3) (byte-defop-compiler (move-marker byte-set-marker) 2-3) (byte-defop-compiler set-marker 2-3) (byte-defop-compiler match-beginning 1) @@ -3524,6 +3525,12 @@ the syntax (function (lambda (...) ...)) instead.")))) (byte-compile-two-args form)) +(defun byte-compile-subseq (form) + (byte-compile-two-or-three-args form) + ;; Check that XEmacs supports the substring-subseq equivalence. + (pushnew '(eq 'subseq (symbol-function 'substring)) + byte-compile-checks-on-load :test #'equal)) + (defmacro byte-compile-funarg-n (&rest n) `#'(lambda (form) ,@(loop
--- a/lisp/cl-extra.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/cl-extra.el Sun Mar 07 02:09:59 2010 -0600 @@ -612,9 +612,7 @@ ((memq (car plst) indicator-list) (return (values (car plst) (cadr plst) plst)))))) -;; See our compiler macro in cl-macs.el, we will only pass back the -;; actual lambda list in interpreted code or if we've been funcalled -;; (from #'apply or #'mapcar or whatever). +;; See also the compiler macro in cl-macs.el. (defun constantly (value &rest more-values) "Construct a function always returning VALUE, and possibly MORE-VALUES. @@ -622,7 +620,24 @@ Members of MORE-VALUES, if provided, will be passed as multiple values; see `multiple-value-bind' and `multiple-value-setq'." - `(lambda (&rest ignore) (values-list ',(cons value more-values)))) + (symbol-macrolet + ((arglist '(&rest ignore))) + (if (or more-values (eval-when-compile (not (cl-compiling-file)))) + `(lambda ,arglist (values-list ',(cons value more-values))) + (make-byte-code + arglist + (eval-when-compile + (let ((compiled (byte-compile-sexp #'(lambda (&rest ignore) + (declare (ignore ignore)) + 'placeholder)))) + (assert (and + (equal [placeholder] + (compiled-function-constants compiled)) + (= 1 (compiled-function-stack-depth compiled))) + t + "Our assumptions about compiled code appear not to hold.") + (compiled-function-instructions compiled))) + (vector value) 1)))) ;;; Hash tables.
--- a/lisp/cl-macs.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/cl-macs.el Sun Mar 07 02:09:59 2010 -0600 @@ -297,27 +297,22 @@ (mapcar 'cl-upcase-arg arg))) (t arg))) ; Maybe we are in initializer -;; npak@ispras.ru +;; npak@ispras.ru, modified by ben@666.com ;;;###autoload -(defun cl-function-arglist (name arglist &optional omit-name) +(defun cl-function-arglist (arglist) "Returns string with printed representation of arguments list. Supports Common Lisp lambda lists." - ;; #### I would just change this so that OMIT-NAME is always true and - ;; eliminate the argument, but this function is autoloaded, which means - ;; someone might be using it somewhere. (if (not (or (listp arglist) (symbolp arglist))) "Not available" (check-argument-type #'true-list-p arglist) (let ((print-gensym nil)) (condition-case nil - (prin1-to-string - (let ((args (cond ((null arglist) nil) - ((listp arglist) (cl-upcase-arg arglist)) - ((symbolp arglist) - (cl-upcase-arg (list '&rest arglist))) - (t (wrong-type-argument 'listp arglist))))) - (if omit-name args - (cons (if (eq name 'cl-none) 'lambda name) args)))) + (let ((args (cond ((null arglist) nil) + ((listp arglist) (cl-upcase-arg arglist)) + ((symbolp arglist) + (cl-upcase-arg (list '&rest arglist))) + (t (wrong-type-argument 'listp arglist))))) + (if args (prin1-to-string args) "()")) (t "Not available"))))) (defun cl-transform-lambda (form bind-block) @@ -325,7 +320,7 @@ (bind-defs nil) (bind-enquote nil) (bind-inits nil) (bind-lets nil) (bind-forms nil) (header nil) (simple-args nil) - (complex-arglist (cl-function-arglist bind-block args t)) + (complex-arglist (cl-function-arglist args)) (doc "")) (while (or (stringp (car body)) (eq (car-safe (car body)) 'interactive)) (push (pop body) header)) @@ -352,7 +347,7 @@ ;; Add CL lambda list to documentation, if the CL lambda list differs ;; from the non-CL lambda list. npak@ispras.ru (unless (equal complex-arglist - (cl-function-arglist bind-block simple-args t)) + (cl-function-arglist simple-args)) (and (stringp (car header)) (setq doc (pop header))) ;; Stick the arguments onto the end of the doc string in a way that ;; will be recognized specially by `function-arglist'. @@ -499,8 +494,7 @@ (list t (list 'error - (format "Keyword argument %%s not one of %s" - keys) + ''invalid-keyword-argument (list 'car var))))))) (push (list 'let (list (list var restarg)) check) bind-forms))) (while (and (eq (car args) '&aux) (pop args)) @@ -2164,6 +2158,8 @@ (defsetf face-background (f &optional s) (x) (list 'set-face-background f x s)) (defsetf face-background-pixmap (f &optional s) (x) (list 'set-face-background-pixmap f x s)) +(defsetf face-background-placement (f &optional s) (x) + (list 'set-face-background-placement f x s)) (defsetf face-font (f &optional s) (x) (list 'set-face-font f x s)) (defsetf face-foreground (f &optional s) (x) (list 'set-face-foreground f x s)) (defsetf face-underline-p (f &optional s) (x) @@ -3296,50 +3292,113 @@ (list 'let (list (list temp val)) (subst temp val res))))) form)) -;; XEmacs; inline delete-duplicates if it's called with a literal -;; #'equal or #'eq and no other keywords, we want the speed in -;; font-lock.el. +(define-compiler-macro delete-dups (list) + `(delete-duplicates (the list ,list) :test #'equal :from-end t)) + +;; XEmacs; inline delete-duplicates if it's called with one of the +;; common compile-time constant tests and an optional :from-end +;; argument, we want the speed in font-lock.el. (define-compiler-macro delete-duplicates (&whole form cl-seq &rest cl-keys) (let ((listp-check - (if (memq (car-safe cl-seq) - ;; No need to check for a list at runtime with these. We - ;; could expand the list, but these are all the functions - ;; in the relevant context at the moment. - '(nreverse append nconc mapcan mapcar)) - t - '(listp begin)))) - (cond ((and (= 4 (length form)) - (eq :test (third form)) - (or (equal '(quote eq) (fourth form)) - (equal '(function eq) (fourth form)))) + (cond + ((memq (car-safe cl-seq) + ;; No need to check for a list at runtime with these. We + ;; could expand the list, but these are all the functions + ;; in the relevant context at the moment. + '(nreverse append nconc mapcan mapcar string-to-list)) + t) + ((and (listp cl-seq) (eq (first cl-seq) 'the) + (eq (second cl-seq) 'list)) + ;; Allow users to force this, if they really want to. + t) + (t + '(listp begin))))) + (cond ((loop + for relevant-key-values + in '((:test 'eq) + (:test #'eq) + (:test 'eq :from-end nil) + (:test #'eq :from-end nil)) + ;; One of the above corresponds exactly to CL-KEYS: + thereis (not (set-difference cl-keys relevant-key-values + :test #'equal))) + `(let* ((begin ,cl-seq) + cl-seq) + (if ,listp-check + (progn + (while (memq (car begin) (cdr begin)) + (setq begin (cdr begin))) + (setq cl-seq begin) + (while (cddr cl-seq) + (if (memq (cadr cl-seq) (cddr cl-seq)) + (setcdr (cdr cl-seq) (cddr cl-seq))) + (setq cl-seq (cdr cl-seq))) + begin) + ;; Call cl-delete-duplicates explicitly, to avoid the form + ;; getting compiler-macroexpanded again: + (cl-delete-duplicates begin ',cl-keys nil)))) + ((loop + for relevant-key-values + in '((:test 'eq :from-end t) + (:test #'eq :from-end t)) + ;; One of the above corresponds exactly to CL-KEYS: + thereis (not (set-difference cl-keys relevant-key-values + :test #'equal))) + `(let* ((begin ,cl-seq) + (cl-seq begin)) + (if ,listp-check + (progn + (while cl-seq + (setq cl-seq (setcdr cl-seq + (delq (car cl-seq) (cdr cl-seq))))) + begin) + ;; Call cl-delete-duplicates explicitly, to avoid the form + ;; getting compiler-macroexpanded again: + (cl-delete-duplicates begin ',cl-keys nil)))) + + ((loop + for relevant-key-values + in '((:test 'equal) + (:test #'equal) + (:test 'equal :from-end nil) + (:test #'equal :from-end nil)) + ;; One of the above corresponds exactly to CL-KEYS: + thereis (not (set-difference cl-keys relevant-key-values + :test #'equal))) + `(let* ((begin ,cl-seq) + cl-seq) + (if ,listp-check + (progn + (while (member (car begin) (cdr begin)) + (setq begin (cdr begin))) + (setq cl-seq begin) + (while (cddr cl-seq) + (if (member (cadr cl-seq) (cddr cl-seq)) + (setcdr (cdr cl-seq) (cddr cl-seq))) + (setq cl-seq (cdr cl-seq))) + begin) + ;; Call cl-delete-duplicates explicitly, to avoid the form + ;; getting compiler-macroexpanded again: + (cl-delete-duplicates begin ',cl-keys nil)))) + ((loop + for relevant-key-values + in '((:test 'equal :from-end t) + (:test #'equal :from-end t)) + ;; One of the above corresponds exactly to CL-KEYS: + thereis (not (set-difference cl-keys relevant-key-values + :test #'equal))) `(let* ((begin ,cl-seq) (cl-seq begin)) (if ,listp-check (progn (while cl-seq - (setq cl-seq (setcdr cl-seq (delq (car cl-seq) - (cdr cl-seq))))) - begin) + (setq cl-seq + (setcdr cl-seq (delete (car cl-seq) (cdr cl-seq))))) + begin) ;; Call cl-delete-duplicates explicitly, to avoid the form ;; getting compiler-macroexpanded again: (cl-delete-duplicates begin ',cl-keys nil)))) - ((and (= 4 (length form)) - (eq :test (third form)) - (or (equal '(quote equal) (fourth form)) - (equal '(function equal) (fourth form)))) - `(let* ((begin ,cl-seq) - (cl-seq begin)) - (if ,listp-check - (progn - (while cl-seq - (setq cl-seq (setcdr cl-seq (delete (car cl-seq) - (cdr cl-seq))))) - begin) - ;; Call cl-delete-duplicates explicitly, to avoid the form - ;; getting compiler-macroexpanded again: - (cl-delete-duplicates begin ',cl-keys nil)))) - (t - form)))) + (t form)))) ;; XEmacs; it's perfectly reasonable, and often much clearer to those ;; reading the code, to call regexp-quote on a constant string, which is
--- a/lisp/cl-seq.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/cl-seq.el Sun Mar 07 02:09:59 2010 -0600 @@ -107,7 +107,7 @@ other-keys)))) '(car (cdr (memq (quote :allow-other-keys) cl-keys))) - '(error "Bad keyword argument %s" + '(error 'invalid-keyword-argument (car cl-keys-temp))) '(setq cl-keys-temp (cdr (cdr cl-keys-temp))))))) body))))
--- a/lisp/coding.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/coding.el Sun Mar 07 02:09:59 2010 -0600 @@ -5,7 +5,7 @@ ;; Copyright (C) 1995 Amdahl Corporation. ;; Copyright (C) 1995 Sun Microsystems. ;; Copyright (C) 1997 MORIOKA Tomohiko -;; Copyright (C) 2000, 2001, 2002, 2010 Ben Wing. +;; Copyright (C) 2000, 2001, 2002 Ben Wing. ;; This file is part of XEmacs. @@ -464,27 +464,42 @@ (and (query-coding-string char coding-system) (encode-coding-string char coding-system))) -(defun decode-char (quote-ucs code &optional restriction) - "FSF compatibility--return Mule character with Unicode codepoint CODE. -The second argument must be 'ucs, the third argument is ignored. " - ;; We're prepared to accept invalid Unicode in unicode-to-char, but not in - ;; this function, which is the API that should actually be used, since - ;; it's available in GNU and in Mule-UCS. - (check-argument-range code #x0 #x10FFFF) - (assert (eq quote-ucs 'ucs) t - "Sorry, decode-char doesn't yet support anything but the UCS. ") - (unicode-to-char code)) +(if (featurep 'mule) + (progn + ;; Under Mule, we do much of the complicated coding system creation in + ;; Lisp and especially at compile time. We need some function + ;; definition for this function to be created in this file, but we can + ;; leave assigning the docstring to the autoload cookie + ;; handling later. Thankfully; that docstring is big. + (autoload 'make-coding-system "mule/make-coding-system") -(defun encode-char (char quote-ucs &optional restriction) - "FSF compatibility--return the Unicode code point of CHAR. -The second argument must be 'ucs, the third argument is ignored. " - (assert (eq quote-ucs 'ucs) t - "Sorry, encode-char doesn't yet support anything but the UCS. ") - (char-to-unicode char)) + ;; (During byte-compile before dumping, make-coding-system may already + ;; have been loaded, make sure not to overwrite the correct compiler + ;; macro:) + (when (eq 'autoload (car (symbol-function 'make-coding-system))) + ;; Make sure to pick up the correct compiler macro when compiling + ;; files: + (define-compiler-macro make-coding-system (&whole form name type + &optional description props) + (load (second (symbol-function 'make-coding-system))) + (funcall (get 'make-coding-system 'cl-compiler-macro) + form name type description props)))) -(unless (featurep 'mule) ;; Mule's not available; (fset 'make-coding-system (symbol-function 'make-coding-system-internal)) + (define-compiler-macro make-coding-system (&whole form name type + &optional description props) + (cond + ;; We shouldn't normally see these forms under non-Mule; they're all in + ;; the mule/ subdirectory. + ((equal '(quote fixed-width) type) + form) + ((byte-compile-constp type) + `(funcall (or (and (fboundp 'make-coding-system-internal) + 'make-coding-system-internal) 'make-coding-system) + ,@(cdr form))) + (t form))) + (define-coding-system-alias 'escape-quoted 'binary) ;; These are so that gnus and friends work when not mule:
--- a/lisp/cus-face.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/cus-face.el Sun Mar 07 02:09:59 2010 -0600 @@ -1,6 +1,7 @@ ;;; cus-face.el -- Support for Custom faces. ;; ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. +;; Copyright (C) 2010 Didier Verna ;; ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> ;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org> @@ -83,7 +84,12 @@ :help-echo "\ Name of background pixmap file.") set-face-background-pixmap custom-face-background-pixmap) - (:dim (toggle :format "%[Dim%]: %v\n" + (:background-placement (choice :tag "Background placement" :value relative + (const :tag "Relative" :value relative) + (const :tag "Absolute" :value absolute)) + set-face-background-placement + face-background-placement) + (:dim (toggle :format "%[Dim%]: %v\n" :help-echo "Control whether the text should be dimmed.") set-face-dim-p face-dim-p) (:bold (toggle :format "%[Bold%]: %v\n"
--- a/lisp/dumped-lisp.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/dumped-lisp.el Sun Mar 07 02:09:59 2010 -0600 @@ -160,7 +160,6 @@ "code-process" ;; Provide basic commands to set coding systems to user "code-cmds" - (when (featurep 'mule) "mule/make-coding-system") "unicode" ;;;;;;;;;;;;;;;;;; MULE support (when (featurep 'mule)
--- a/lisp/faces.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/faces.el Sun Mar 07 02:09:59 2010 -0600 @@ -3,6 +3,7 @@ ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Board of Trustees, University of Illinois ;; Copyright (C) 1995, 1996, 2002, 2005 Ben Wing +;; Copyright (C) 2010 Didier Verna ;; Author: Ben Wing <ben@xemacs.org> ;; Keywords: faces, internal, dumped @@ -87,6 +88,8 @@ (color-instance-name default)) ((image-instance-p default) (image-instance-file-name default)) + ((face-background-placement-instance-p default) + (symbol-name default)) (t default)))))) (list face (if (equal value "") nil value)))) @@ -333,6 +336,11 @@ Only used by faces on X and MS Windows devices. For valid instantiators, see `make-image-specifier'. + background-placement The placement of the face's background pixmap. + Only used by faces on X devices. + For valid instantiators, + see `make-face-background-placement-specifier'. + underline Underline all text covered by this face. For valid instantiators, see `make-face-boolean-specifier'. @@ -716,6 +724,45 @@ (list face (if (equal file "") nil file)))) (set-face-property face 'background-pixmap file)) +(defun face-background-placement (face &optional domain default no-fallback) + "Return FACE's background placement in DOMAIN. +See `face-property-instance' for the semantics of the DOMAIN argument." + (face-property face 'background-placement domain default no-fallback)) + +(defun set-face-background-placement (face placement &optional locale tag-set + how-to-add) + "Change the background-placement property of FACE to PLACEMENT. +PLACEMENT is normally a background-placement instantiator; see +`make-face-background-placement-specifier'. +See `set-face-property' for the semantics of the LOCALE, TAG-SET, and +HOW-TO-ADD arguments." + (interactive (face-interactive "background placement")) + ;; When called non-interactively (for example via custom), PLACEMENT is + ;; expected to be a symbol. -- dvl + (unless (symbolp placement) + (setq placement (intern placement))) + (set-face-property face 'background-placement placement locale tag-set + how-to-add)) + +(defun face-background-placement-instance (face &optional domain default + no-fallback) + "Return FACE's background-placement instance in DOMAIN. +Return value will be a background-placement instance object. + +FACE may be either a face object or a symbol representing a face. + +Normally DOMAIN will be a window or nil (meaning the selected window), +and an instance object describing the background placement in that particular +window and buffer will be returned. + +See `face-property-instance' for more information." + (face-property-instance face 'background-placement domain default + no-fallback)) + +(defun face-background-placement-instance-p (object) + "Return t if OBJECT is a face-background-placement instance." + (or (eq object 'absolute) (eq object 'relative))) + (defun face-display-table (face &optional locale tag-set exact-p) "Return the display table spec of FACE in LOCALE, or nil if unspecified.. @@ -871,7 +918,7 @@ (let ((device (dfw-device domain)) (common-props '(foreground background font display-table underline dim inherit)) - (win-props '(background-pixmap strikethru)) + (win-props '(background-pixmap background-placement strikethru)) (tty-props '(highlight blinking reverse))) ;; First check the properties which are used in common between the @@ -1943,7 +1990,8 @@ ;; element faces. So take the modeline face information from its ;; fallbacks, themselves ultimately set up in faces.c: (loop - for face-property in '(foreground background background-pixmap) + for face-property in '(foreground background + background-pixmap background-placement) do (when (and (setq face-property (face-property 'modeline face-property)) (null (specifier-instance face-property device nil t)) (specifier-instance face-property device))
--- a/lisp/frame.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/frame.el Sun Mar 07 02:09:59 2010 -0600 @@ -3,6 +3,7 @@ ;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003 ;; Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996 Ben Wing. +;; Copyright (C) 2010 Didier Verna ;; Maintainer: XEmacs Development Team ;; Keywords: internal, dumped @@ -1015,6 +1016,28 @@ "Set property PROP of FRAME to VAL. See `set-frame-properties'." (set-frame-properties frame (list prop val))) +(defun set-frame-background-placement (placement) + "Set the background placement of the selected frame to PLACEMENT. +When called interactively, prompt for the placement to use." + (interactive (list (intern (completing-read "Placement: " + '(("absolute" absolute) + ("relative" relative)) + nil t)))) + (set-face-background-placement 'default placement (selected-frame))) + +(defun frame-background-placement () + "Retrieve the selected frame's background placement." + (interactive) + (face-background-placement 'default (selected-frame))) + +(defun frame-background-placement-instance () + "Retrieve the selected frame's background placement instance." + (interactive) + (face-background-placement-instance 'default (selected-frame))) + +;; #### FIXME: misnomers ! The functions below should be called +;; set-frame-<blabla> -- dvl. + ;; XEmacs change: this function differs significantly from Emacs. (defun set-background-color (color-name) "Set the background color of the selected frame to COLOR-NAME.
--- a/lisp/help.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/help.el Sun Mar 07 02:09:59 2010 -0600 @@ -1209,7 +1209,9 @@ t)) ((stringp arglist) - (format "(%s %s)" function arglist))))) + (if (> (length arglist) 0) + (format "(%s %s)" function arglist) + (format "(%s)" function)))))) ;; If STRIP-ARGLIST is true, return a cons (DOC . ARGS) of the documentation ;; with any embedded arglist stripped out, and the arglist that was stripped
--- a/lisp/make-docfile.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/make-docfile.el Sun Mar 07 02:09:59 2010 -0600 @@ -92,7 +92,7 @@ ;; no generate-new-buffer so use its implementation. (let ((buf (get-buffer-create (generate-new-buffer-name "foo")))) (set-buffer buf) - (insert-file-contents-internal (substring arg 1)) + (insert-file-contents-internal (subseq arg 1)) ;; now majorly grind up the response file. ;; backslashes get doubled, quotes around strings, ;; get rid of pesky CR's and NL's, and put parens around @@ -123,8 +123,7 @@ (concat (file-name-nondirectory ;; no match-string so use its implementation. - (substring arg (match-beginning 1) - (match-end 1))) + (subseq arg (match-beginning 1) (match-end 1))) ".c") source-src))) (if (and (null docfile-out-of-date)
--- a/lisp/mule/make-coding-system.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/mule/make-coding-system.el Sun Mar 07 02:09:59 2010 -0600 @@ -2,7 +2,6 @@ ;;; much of the implementation of the fixed-width coding system type. ;; Copyright (C) 2009 Free Software Foundation -;; Copyright (C) 2010 Ben Wing. ;; Author: Aidan Kehoe @@ -27,6 +26,13 @@ ;;; Code: +(defvar fixed-width-private-use-start ?\uE000 + "Start of a 256 code private use area for fixed-width coding systems. + +This is used to ensure that distinct octets on disk for a given coding +system map to distinct XEmacs characters, preventing spurious changes when +a file is read, not changed, and then written. ") + (defun fixed-width-generate-helper (decode-table encode-table encode-failure-octet) "Helper func, `fixed-width-generate-encode-program-and-skip-chars-strings', @@ -317,7 +323,7 @@ (check-argument-type #'listp unicode-map) (let ((decode-table (make-vector 256 nil)) (encode-table (make-hash-table :size 256 :rehash-threshold 0.999)) - (private-use-start #xE000) + (private-use-start (encode-char fixed-width-private-use-start 'ucs)) (invalid-sequence-code-point-start (eval-when-compile (char-to-unicode
--- a/lisp/objects.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/objects.el Sun Mar 07 02:09:59 2010 -0600 @@ -2,6 +2,7 @@ ;; Copyright (C) 1994, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Ben Wing +;; Copyright (C) 2010 Didier Verna ;; Author: Chuck Thompson <cthomp@xemacs.org> ;; Author: Ben Wing <ben@xemacs.org> @@ -194,4 +195,18 @@ if non-nil, means to invert the sense of the inherited property." (make-specifier-and-init 'face-boolean spec-list)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; face-background-placement specifiers + +(defun make-face-background-placement-specifier (spec-list) + "Return a new `face-background-placement' specifier object. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for a detailed description of +how specifiers work. + +Valid instantiators for face-background-placement specifiers are: +-- absolute or relative (symbols), +-- a vector of one element: a face to inherit from." + (make-specifier-and-init 'face-background-placement spec-list)) + ;;; objects.el ends here.
--- a/lisp/subr.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/subr.el Sun Mar 07 02:09:59 2010 -0600 @@ -220,6 +220,9 @@ (define-function 'send-string-to-terminal 'external-debugging-output) (define-function 'special-form-p 'special-operator-p) +;; XEmacs; this is in Lisp, its bytecode now taken by subseq. +(define-function 'substring 'subseq) + ;; XEmacs: (defun local-variable-if-set-p (sym buffer) "Return t if SYM would be local to BUFFER after it is set.
--- a/lisp/update-elc.el Fri Mar 05 04:08:17 2010 -0600 +++ b/lisp/update-elc.el Sun Mar 07 02:09:59 2010 -0600 @@ -137,7 +137,7 @@ (defun update-elc-chop-extension (file) (if (string-match "\\.elc?$" file) - (substring file 0 (match-beginning 0)) + (subseq file 0 (match-beginning 0)) file)) ;; we used to call packages-list-autoloads here, but it's false generality.
--- a/man/ChangeLog Fri Mar 05 04:08:17 2010 -0600 +++ b/man/ChangeLog Sun Mar 07 02:09:59 2010 -0600 @@ -8,6 +8,90 @@ Rewrite section on allocation of Lisp objects to reflect the new reality. Remove references to nonexistent XSETINT and XSETCHAR. +2010-03-04 Ben Wing <ben@xemacs.org> + + * internals/internals.texi (Top): + * internals/internals.texi (list-to-texinfo): Removed. + * internals/internals.texi (convert-list-to-texinfo): New. + * internals/internals.texi (table-to-texinfo): Removed. + * internals/internals.texi (convert-table-to-texinfo): New. + Update Lisp functions at top to newest versions. + + * internals/internals.texi (A History of Emacs): + * internals/internals.texi (Through Version 18): + * internals/internals.texi (Lucid Emacs): + * internals/internals.texi (XEmacs): + * internals/internals.texi (The XEmacs Split): + * internals/internals.texi (Modules for Other Aspects of the Lisp Interpreter and Object System): + * internals/internals.texi (Introduction to Writing C Code): + * internals/internals.texi (Writing Good Comments): + * internals/internals.texi (Writing Macros): + * internals/internals.texi (Major Textual Changes): + * internals/internals.texi (Great Integral Type Renaming): + * internals/internals.texi (How to Regression-Test): + * internals/internals.texi (Creating a Branch): + * internals/internals.texi (Dynamic Arrays): + * internals/internals.texi (Allocation by Blocks): + * internals/internals.texi (mark_object): + * internals/internals.texi (gc_sweep): + * internals/internals.texi (Byte-Char Position Conversion): + * internals/internals.texi (Searching and Matching): + * internals/internals.texi (Introduction to Multilingual Issues #3): + * internals/internals.texi (Byte Types): + * internals/internals.texi (Different Ways of Seeing Internal Text): + * internals/internals.texi (Buffer Positions): + * internals/internals.texi (Basic internal-format APIs): + * internals/internals.texi (The DFC API): + * internals/internals.texi (General Guidelines for Writing Mule-Aware Code): + * internals/internals.texi (Mule-izing Code): + * internals/internals.texi (Locales): + * internals/internals.texi (More about code pages): + * internals/internals.texi (More about locales): + * internals/internals.texi (Unicode support under Windows): + * internals/internals.texi (The Frame): + * internals/internals.texi (The Non-Client Area): + * internals/internals.texi (The Client Area): + * internals/internals.texi (The Paned Area): + * internals/internals.texi (Text Areas): + * internals/internals.texi (The Displayable Area): + * internals/internals.texi (Event Queues): + * internals/internals.texi (Event Stream Callback Routines): + * internals/internals.texi (Focus Handling): + * internals/internals.texi (Future Work -- Autodetection): + Replace " with ``, '' (not complete, maybe about halfway through). + +2010-03-03 Ben Wing <ben@xemacs.org> + + * internals/internals.texi (Intro to Window and Frame Geometry): + * internals/internals.texi (The Paned Area): + * internals/internals.texi (The Displayable Area): + Update to make note of e.g. the fact that the bottom gutter is + actually above the minibuffer. + +2010-03-02 Jerry James <james@xemacs.org> + + * custom.texi: Delete, redundant with xemacs/custom.texi and + lispref/customize.texi. + * Makefile: Remove all rules relating to custom.texi. + +2010-03-03 Aidan Kehoe <kehoea@parhasard.net> + + * lispref/tips.texi (Comment Tips): + * lispref/text.texi (Text Properties): + * lispref/strings.texi (Creating Strings): + * lispref/processes.texi (Input to Processes): + * lispref/functions.texi (Argument List): + * lispref/extents.texi (Duplicable Extents): + Move examples that used substring to using subseq; in + strings.texi, do not change the examples, but document that in + this XEmacs, it is an alias for subseq, and that there may be some + incompatibilities if you depend on that. + +2010-02-25 Didier Verna <didier@xemacs.org> + + The background-placement face property. + * xemacs/custom.texi (Faces): Document it. + 2010-02-20 Ben Wing <ben@xemacs.org> * internals/internals.texi (Intro to Window and Frame Geometry):
--- a/man/Makefile Fri Mar 05 04:08:17 2010 -0600 +++ b/man/Makefile Sun Mar 07 02:09:59 2010 -0600 @@ -46,7 +46,6 @@ info_files = \ $(INFODIR)/beta.info \ $(INFODIR)/cl.info \ - $(INFODIR)/custom.info \ $(INFODIR)/emodules.info \ $(INFODIR)/external-widget.info \ $(INFODIR)/info.info \ @@ -63,7 +62,6 @@ html_files = \ $(HTMLDIR)/beta.html \ $(HTMLDIR)/cl.html \ - $(HTMLDIR)/custom.html \ $(HTMLDIR)/emodules.html \ $(HTMLDIR)/external-widget.html \ $(HTMLDIR)/info.html \ @@ -80,7 +78,6 @@ dvi_files = \ beta.dvi \ cl.dvi \ - custom.dvi \ emodules.dvi \ external-widget.dvi \ info.dvi \ @@ -97,7 +94,6 @@ pdf_files = \ beta.pdf \ cl.pdf \ - custom.pdf \ emodules.pdf \ external-widget.pdf \ info.pdf \ @@ -245,9 +241,6 @@ $(INFODIR)/cl.info : cl.texi $(MAKEINFO) -o $(INFODIR)/cl.info cl.texi -$(INFODIR)/custom.info : custom.texi - $(MAKEINFO) -o $(INFODIR)/custom.info custom.texi - $(INFODIR)/emodules.info : emodules.texi $(MAKEINFO) -o $(INFODIR)/emodules.info emodules.texi @@ -353,9 +346,6 @@ $(HTMLDIR)/cl.html : cl.texi $(TEXI2HTML_SPLIT) cl.texi -$(HTMLDIR)/custom.html : custom.texi - $(TEXI2HTML_SPLIT) custom.texi - $(HTMLDIR)/emodules.html : emodules.texi $(TEXI2HTML_SPLIT) emodules.texi
--- a/man/custom.texi Fri Mar 05 04:08:17 2010 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,438 +0,0 @@ -\input texinfo.tex - -@c %**start of header -@setfilename ../info/custom.info -@settitle The Customization Library -@iftex -@afourpaper -@headings double -@end iftex -@c %**end of header - -@ifinfo -@dircategory XEmacs Editor -@direntry -* Customizations: (custom). Customization Library. -@end direntry -@end ifinfo - -@node Top, Declaring Groups, (dir), (dir) -@comment node-name, next, previous, up -@top The Customization Library - -This manual describes how to declare customization groups, variables, -and faces. It doesn't contain any examples, but please look at the file -@file{cus-edit.el} which contains many declarations you can learn from. - -@menu -* Declaring Groups:: -* Declaring Variables:: -* Declaring Faces:: -* Usage for Package Authors:: -* Utilities:: -* The Init File:: -* Wishlist:: -@end menu - -All the customization declarations can be changes by keyword arguments. -Groups, variables, and faces all share these common keywords: - -@table @code -@item :group -@var{value} should be a customization group. -Add @var{symbol} to that group. -@item :link -@var{value} should be a widget type. -Add @var{value} to the external links for this customization option. -Useful widget types include @code{custom-manual}, @code{info-link}, and -@code{url-link}. -@item :load -Add @var{value} to the files that should be loaded before displaying -this customization option. The value should be either a string, which -should be a string which will be loaded with @code{load-library} unless -present in @code{load-history}, or a symbol which will be loaded with -@code{require}. -@item :tag -@var{Value} should be a short string used for identifying the option in -customization menus and buffers. By default the tag will be -automatically created from the options name. -@end table - -@node Declaring Groups, Declaring Variables, Top, Top -@comment node-name, next, previous, up -@section Declaring Groups - -Use @code{defgroup} to declare new customization groups. - -@defun defgroup symbol members doc [keyword value]... -Declare @var{symbol} as a customization group containing @var{members}. -@var{symbol} does not need to be quoted. - -@var{doc} is the group documentation. - -@var{members} should be an alist of the form ((@var{name} -@var{widget})...) where @var{name} is a symbol and @var{widget} is a -widget for editing that symbol. Useful widgets are -@code{custom-variable} for editing variables, @code{custom-face} for -editing faces, and @code{custom-group} for editing groups.@refill - -Internally, custom uses the symbol property @code{custom-group} to keep -track of the group members, and @code{group-documentation} for the -documentation string. - -The following additional @var{keyword}'s are defined: - -@table @code -@item :prefix -@var{value} should be a string. If the string is a prefix for the name -of a member of the group, that prefix will be ignored when creating a -tag for that member. -@end table -@end defun - -@node Declaring Variables, Declaring Faces, Declaring Groups, Top -@comment node-name, next, previous, up -@section Declaring Variables - -Use @code{defcustom} to declare user editable variables. - -@defun defcustom symbol value doc [keyword value]... -Declare @var{symbol} as a customizable variable that defaults to @var{value}. -Neither @var{symbol} nor @var{value} needs to be quoted. -If @var{symbol} is not already bound, initialize it to @var{value}. - -@var{doc} is the variable documentation. - -The following additional @var{keyword}'s are defined: - -@table @code -@item :type -@var{value} should be a widget type. - -@item :options -@var{value} should be a list of possible members of the specified type. -For hooks, this is a list of function names. - -@item :initialize -@var{value} should be a function used to initialize the variable. It -takes two arguments, the symbol and value given in the @code{defcustom} call. -Some predefined functions are: - -@table @code -@item custom-initialize-set -Use the @code{:set} method to initialize the variable. Do not -initialize it if already bound. This is the default @code{:initialize} -method. - -@item custom-initialize-default -Always use @code{set-default} to initialize the variable, even if a -@code{:set} method has been specified. - -@item custom-initialize-reset -If the variable is already bound, reset it by calling the @code{:set} -method with the value returned by the @code{:get} method. - -@item custom-initialize-changed -Like @code{custom-initialize-reset}, but use @code{set-default} to -initialize the variable if it is not bound and has not been set -already. -@end table - -@item :set -@var{value} should be a function to set the value of the symbol. It -takes two arguments, the symbol to set and the value to give it. The -default is @code{set-default}. - -@item :get -@var{value} should be a function to extract the value of symbol. The -function takes one argument, a symbol, and should return the current -value for that symbol. The default is @code{default-value}. - -@item :require -@var{value} should be a feature symbol. Each feature will be required -when the `defcustom' is evaluated, or when Emacs is started if the user -has saved this option. - -@end table - -@xref{Sexp Types,,,widget,The Widget Library}, for information about -widgets to use together with the @code{:type} keyword. -@end defun - -Internally, custom uses the symbol property @code{custom-type} to keep -track of the variables type, @code{standard-value} for the program -specified default value, @code{saved-value} for a value saved by the -user, and @code{variable-documentation} for the documentation string. - -Use @code{custom-add-option} to specify that a specific function is -useful as a member of a hook. - -@defun custom-add-option symbol option -To the variable @var{symbol} add @var{option}. - -If @var{symbol} is a hook variable, @var{option} should be a hook -member. For other types of variables, the effect is undefined." -@end defun - -@node Declaring Faces, Usage for Package Authors, Declaring Variables, Top -@comment node-name, next, previous, up -@section Declaring Faces - -Faces are declared with @code{defface}. - -@defun defface face spec doc [keyword value]... - -Declare @var{face} as a customizable face that defaults to @var{spec}. -@var{face} does not need to be quoted. - -If @var{face} has been set with `custom-set-face', set the face attributes -as specified by that function, otherwise set the face attributes -according to @var{spec}. - -@var{doc} is the face documentation. - -@var{spec} should be an alist of the form @samp{((@var{display} @var{atts})...)}. - -@var{atts} is a list of face attributes and their values. The possible -attributes are defined in the variable `custom-face-attributes'. - -The @var{atts} of the first entry in @var{spec} where the @var{display} -matches the frame should take effect in that frame. @var{display} can -either be the symbol `t', which will match all frames, or an alist of -the form @samp{((@var{req} @var{item}...)...)}@refill - -For the @var{display} to match a FRAME, the @var{req} property of the -frame must match one of the @var{item}. The following @var{req} are -defined:@refill - -@table @code -@item type -(the value of (window-system))@* -Should be one of @code{x} or @code{tty}. - -@item class -(the frame's color support)@* -Should be one of @code{color}, @code{grayscale}, or @code{mono}. - -@item background -(what color is used for the background text)@* -Should be one of @code{light} or @code{dark}. -@end table - -Internally, custom uses the symbol property @code{face-defface-spec} for -the program specified default face properties, @code{saved-face} for -properties saved by the user, and @code{face-documentation} for the -documentation string.@refill - -@end defun - -@node Usage for Package Authors, Utilities, Declaring Faces, Top -@comment node-name, next, previous, up -@section Usage for Package Authors - -The recommended usage for the author of a typical emacs lisp package is -to create one group identifying the package, and make all user options -and faces members of that group. If the package has more than around 20 -such options, they should be divided into a number of subgroups, with -each subgroup being member of the top level group. - -The top level group for the package should itself be member of one or -more of the standard customization groups. There exists a group for -each @emph{finder} keyword. Press @kbd{C-h p} to see a list of finder -keywords, and add you group to each of them, using the @code{:group} -keyword. - -@node Utilities, The Init File, Usage for Package Authors, Top -@comment node-name, next, previous, up -@section Utilities - -These utilities can come in handy when adding customization support. - -@deffn Widget custom-manual -Widget type for specifying the info manual entry for a customization -option. It takes one argument, an info address. -@end deffn - -@defun custom-add-to-group group member widget -To existing @var{group} add a new @var{member} of type @var{widget}, -If there already is an entry for that member, overwrite it. -@end defun - -@defun custom-add-link symbol widget -To the custom option @var{symbol} add the link @var{widget}. -@end defun - -@defun custom-add-load symbol load -To the custom option @var{symbol} add the dependency @var{load}. -@var{load} should be either a library file name, or a feature name. -@end defun - -@defun customize-menu-create symbol &optional name -Create menu for customization group @var{symbol}. -If optional @var{name} is given, use that as the name of the menu. -Otherwise the menu will be named `Customize'. -The menu is in a format applicable to @code{easy-menu-define}. -@end defun - -@node The Init File, Wishlist, Utilities, Top -@comment node-name, next, previous, up -@section The Init File - -Customizations are saved to the file specified by @code{custom-file}, as -calls to @code{custom-set-variables} and @code{custom-set-faces}. - -When you save customizations, the current implementation removes the -calls to @code{custom-set-variables} and @code{custom-set-faces}, and -replaces them with code generated on the basis of the current -customization state in Emacs. - -By default @code{custom-file} is your @file{.emacs} file (for GNU Emacs -and older XEmacs) and is @file{custom.el} in the same directory as -@file{init.el} (in XEmacs 21.4 and later). If you use another file, you -must explicitly load it yourself. - -As of XEmacs 21.4.7, when @code{custom-file} is present, it is loaded -@emph{after} @file{init.el}. This is likely to change in the future, -because (1) actions in @file{init.el} often would like to depend on -customizations for consistent appearance and (2) Custom is quite brutal -about enforcing its idea of the correct values at initialization. - -@node Wishlist, , The Init File, Top -@comment node-name, next, previous, up -@section Wishlist - -@itemize @bullet -@item -Better support for keyboard operations in the customize buffer. - -@item -Integrate with @file{w3} so you can get customization buffers with much -better formatting. I'm thinking about adding a <custom>name</custom> -tag. The latest w3 have some support for this, so come up with a -convincing example. - -@item -Add an `examples' section, with explained examples of custom type -definitions. - -@item -Support selectable color themes. I.e., change many faces by setting one -variable. - -@item -Support undo using lmi's @file{gnus-undo.el}. - - -@item -Make it possible to append to `choice', `radio', and `set' options. - -@item -Ask whether set or modified variables should be saved in -@code{kill-buffer-hook}. - -Ditto for @code{kill-emacs-query-functions}. - -@item -Command to check if there are any customization options that -does not belong to an existing group. - -@item -Optionally disable the point-cursor and instead highlight the selected -item in XEmacs. This is like the *Completions* buffer in XEmacs. -Suggested by Jens Lautenbacher -@samp{<jens@@lemming0.lem.uni-karlsruhe.de>}.@refill - -@item -Explain why it is necessary that all choices have different default -values. - -@item -Add some direct support for meta variables, i.e. make it possible to -specify that this variable should be reset when that variable is -changed. - -@item -Add tutorial. - -@item -Describe the @code{:type} syntax in this manual. - -@item -Find a place is this manual for the following text: - -@strong{Radio vs. Buttons} - -Use a radio if you can't find a good way to describe the item in the -choice menu text. I.e. it is better to use a radio if you expect the -user would otherwise manually select each item from the choice menu in -turn to see what it expands too. - -Avoid radios if some of the items expands to complex structures. - -I mostly use radios when most of the items are of type -@code{function-item} or @code{variable-item}. - -@item -Update customize buffers when @code{custom-set-variable} or -@code{custom-save-customized} is called. - -@item -Better handling of saved but uninitialized items. - -@item -Detect when faces have been changed outside customize. - -@item -Enable mouse help in Emacs by default. - -@item -Add an easy way to display the standard settings when an item is modified. - -@item -See if it is feasible to scan files for customization information -instead of loading them, - -@item -Add hint message when user push a non-pushable tag. - -Suggest that the user unhide if hidden, and edit the value directly -otherwise. - -@item -Use checkboxes and radio buttons in the state menus. - -@item -Add option to hide @samp{[hide]} for short options. Default, on. - -@item -Add option to hide @samp{[state]} for options with their standard -settings. - -@item -There should be a way to specify site defaults for user options. - -@item -There should be more buffer styles. The default `nested style, the old -`outline' style, a `numeric' style with numbers instead of stars, an -`empty' style with just the group name, and `compact' with only one line -per item. - -@item -Newline and tab should be displayed as @samp{^J} and @samp{^I} in the -@code{regexp} and @code{file} widgets. I think this can be done in -XEmacs by adding a display table to the face. - -@item -Use glyphs to draw the @code{customize-browse} tree. - -Add echo and balloon help. You should be able to read the documentation -simply by moving the mouse pointer above the name. - -Add parent links. - -Add colors. - -@end itemize - -@contents -@bye
--- a/man/internals/internals.texi Fri Mar 05 04:08:17 2010 -0600 +++ b/man/internals/internals.texi Sun Mar 07 02:09:59 2010 -0600 @@ -161,13 +161,13 @@ Note: to define these routines, put point after the end of the definition and type C-x C-e. -(defun list-to-texinfo (b e) +(defun convert-list-to-texinfo (b e) "Convert the selected region from an ASCII list to a Texinfo list." (interactive "r") (save-restriction (narrow-to-region b e) (goto-char (point-min)) - (let ((dash-type "^ *-+ +") + (let ((dash-type "^ *\\(-+\\|o\\) +") ;; allow single-letter numbering or roman numerals (letter-type "^ *[[(]?\\([a-zA-Z]\\|[IVXivx]+\\)[]).] +") (num-type "^ *[[(]?[0-9]+[]).] +") @@ -239,7 +239,7 @@ (forward-char min)) (kill-rectangle b (point)))))) -(defun table-to-texinfo (b e) +(defun convert-table-to-texinfo (b e) "Convert the selected region from an ASCII table to a Texinfo table. Assumes entries are separated by a blank line, and the first sexp in each entry is the table heading." @@ -283,20 +283,24 @@ in text: @code{} surrounded by ` and ' or followed by a (); @strong{} surrounded by *'s; @file{} something that looks like a file name." (interactive) - (if (and (not no-narrow) (region-active-p)) - (save-restriction - (narrow-to-region (region-beginning) (region-end)) - (convert-text-to-texinfo t)) - (let ((p (point)) - (case-replace nil)) - (query-replace-regexp "`\\([^']+\\)'\\([^']\\)" "@code{\\1}\\2" nil) - (goto-char p) - (query-replace-regexp "\\(\\Sw\\)\\*\\(\\(?:\\s_\\|\\sw\\)+\\)\\*\\([^A-Za-z.}]\\)" "\\1@strong{\\2}\\3" nil) - (goto-char p) - (query-replace-regexp "\\(\\(\\s_\\|\\sw\\)+()\\)\\([^}]\\)" "@code{\\1}\\3" nil) - (goto-char p) - (query-replace-regexp "\\(\\(\\s_\\|\\sw\\)+\\.[A-Za-z]+\\)\\([^A-Za-z.}]\\)" "@file{\\1}\\3" nil) - ))) + (save-excursion + (if (and (not no-narrow) (region-active-p)) + (save-restriction + (narrow-to-region (region-beginning) (region-end)) + (goto-char (region-beginning)) + (zmacs-deactivate-region) + (convert-text-to-texinfo t)) + (let ((p (point)) + (case-replace nil)) + (message "Point is %d" (point)) + (query-replace-regexp "`\\([^']+\\)'\\([^']\\)" "@code{\\1}\\2" nil) + (goto-char p) + (query-replace-regexp "\\(\\Sw\\)\\*\\(\\(?:\\s_\\|\\sw\\)+\\)\\*\\([^A-Za-z.}]\\)" "\\1@strong{\\2}\\3" nil) + (goto-char p) + (query-replace-regexp "\\(\\(\\s_\\|\\sw\\)+()\\)\\([^}]\\)" "@code{\\1}\\3" nil) + (goto-char p) + (query-replace-regexp "\\(\\(\\s_\\|\\sw\\)+\\.[A-Za-z]+\\)\\([^A-Za-z.}]\\)" "@file{\\1}\\3" nil) + )))) 4. Adding new sections: ----------------------- @@ -1238,7 +1242,7 @@ derived from GNU Emacs, a program written by Richard Stallman of the Free Software Foundation. GNU Emacs dates back to 1985 and was modelled after Unipress Emacs, an editor written by James Gosling in -1981 and based on a series of other "Emacs"-like editors, including +1981 and based on a series of other ``Emacs''-like editors, including EINE (EINE Is Not EMACS), c. 1976, by Dan Weinreb, which run on the MIT Lisp Machine and was the first Emacs written in Lisp; ZWEI (ZWEI Was EINE Initially), c. 1978, by Dan Weinreb and Mike McMahon; Multics @@ -1248,7 +1252,7 @@ later, TI Explorer (1983-1989). These in turn were inspired by the first Emacs, a package called EMACS, written in 1976 by Richard Stallman, Guy Steele, and Dave Moon. This was a merger of TECMAC and -TMACS, a pair of "TECO-macro realtime editors" written by Guy Steele, +TMACS, a pair of ``TECO-macro realtime editors'' written by Guy Steele, Dave Moon, Richard Greenblatt, Charles Frankston, et al., and added a dynamic loader and Meta-key cmds. It ran under ITS (the Incompatible Timesharing System) on a DEC PDP 10 and under TWENEX on a Tops-20 and @@ -1286,7 +1290,7 @@ the basis for the early versions of GNU Emacs and also for Gosling's Unipress Emacs, a commercial product. Because of bad blood between the two over the issue of commercialism, RMS pretty much disowned this -collaboration, referring to it as "Gosling Emacs". +collaboration, referring to it as ``Gosling Emacs''. At this point we pick up with a time line of events. (A broader timeline is available at @uref{http://www.jwz.org/doc/emacs-timeline.html, @@ -1577,9 +1581,9 @@ @item Version 19.9 released January 12, 1994. (Scrollbars, Athena.) @item -Version 19.10 released May 27, 1994. (Uses `configure'; code merged +Version 19.10 released May 27, 1994. (Uses @code{configure}; code merged from GNU Emacs 19.23 beta and further merging with Epoch 4.0) Known as -"Lucid Emacs" when shipped by Lucid, and as "XEmacs" when shipped by +``Lucid Emacs'' when shipped by Lucid, and as ``XEmacs'' when shipped by Sun; but Lucid went out of business a few days later and it's unclear very many copies of 19.10 were released by Lucid. (Last release by Jamie Zawinski.) @@ -1889,7 +1893,7 @@ Lucid scrollbar widget, 3-d modeline, stay-up Lucid menus, resizable minibuffer, echo area is a true buffer, MD5 hashing support, expanded menubar, redone menu specification format (including menu filters), -rewritten extents, renamed "screen" to "frame", misc-user events, +rewritten extents, renamed ``screen'' to ``frame'', misc-user events, rewritten face code, rewritten mouse code, warnings system, CL backquote syntax, critical C-g, code merging with GNU Emacs 19.28. New packages Hyperbole, OOBR, hm--html-menus, viper, lazy-lock, @@ -1937,9 +1941,9 @@ version 21.0.60 released December 10, 1998. (The version naming scheme was changed at this point: [a] the second version number is odd for stable versions, even for beta versions; [b] a third version number is added, -replacing the "beta xxx" ending for beta versions and allowing for +replacing the ``beta xxx'' ending for beta versions and allowing for periodic maintenance releases for stable versions. Therefore, 21.0 was -never "officially" released; similarly for 21.2, etc.) +never ``officially'' released; similarly for 21.2, etc.) @item version 21.0.61 released January 4, 1999. @item @@ -1955,7 +1959,7 @@ @item version 21.1.2 released May 14, 1999. (This is the followup to 21.0.67. The second version number was bumped to indicate the beginning of the -"stable" series.) +``stable'' series.) @item version 21.1.3 released June 26, 1999. @item @@ -2045,91 +2049,91 @@ @item version 21.2.40 released January 8, 2001. @item -version 21.2.41 "Polyhymnia" released January 17, 2001. -@item -version 21.2.42 "Poseidon" released January 20, 2001. -@item -version 21.2.43 "Terspichore" released January 26, 2001. -@item -version 21.2.44 "Thalia" released February 8, 2001. -@item -version 21.2.45 "Thelxepeia" released February 23, 2001. -@item -version 21.2.46 "Urania" released March 21, 2001. -@item -version 21.2.47 "Zephir" released April 14, 2001. -@item -XEmacs 21.4.0 "Solid Vapor" released April 16, 2001. -@item -XEmacs 21.4.1 "Copyleft" released April 19, 2001. -@item -XEmacs 21.4.2 "Developer-Friendly Unix APIs" released May 10, 2001. -@item -XEmacs 21.4.3 "Academic Rigor" released May 17, 2001. -@item -XEmacs 21.4.4 "Artificial Intelligence" released July 28, 2001. -@item -XEmacs 21.4.5 "Civil Service" released October 23, 2001. -@item -XEmacs 21.4.6 "Common Lisp" released December 17, 2001. -@item -XEmacs 21.4.7 "Economic Science" released May 4, 2002. -@item -XEmacs 21.4.8 "Honest Recruiter" released May 9, 2002. -@item -XEmacs 21.4.9 "Informed Management" released August 23, 2002. -@item -XEmacs 21.4.10 "Military Intelligence" released November 2, 2002. -@item -XEmacs 21.4.11 "Native Windows TTY Support" released January 3, 2003. -@item -XEmacs 21.4.12 "Portable Code" released January 15, 2003. -@item -XEmacs 21.4.13 "Rational FORTRAN" released May 25, 2003. -@item -XEmacs 21.4.14 "Reasonable Discussion" released September 3, 2003. -@item -XEmacs 21.4.15 "Security Through Obscurity" released February 2, 2004. -@item -XEmacs 21.4.16 "Successful IPO" released December 5, 2004. -@item -version 21.5.0 "alfalfa" released April 18, 2001. -@item -version 21.5.1 "anise" released May 9, 2001. -@item -version 21.5.2 "artichoke" released July 28, 2001. -@item -version 21.5.3 "asparagus" released September 7, 2001. -@item -version 21.5.4 "bamboo" released January 8, 2002. -@item -version 21.5.5 "beets" released March 5, 2002. -@item -version 21.5.6 "bok choi" released April 5, 2002. -@item -version 21.5.7 "broccoflower" released July 2, 2002. -@item -version 21.5.8 "broccoli" released July 27, 2002. -@item -version 21.5.9 "brussels sprouts" released August 30, 2002. -@item -version 21.5.10 "burdock" released January 4, 2003. -@item -version 21.5.11 "cabbage" released February 16, 2003. -@item -version 21.5.12 "carrot" released April 24, 2003. -@item -version 21.5.13 "cauliflower" released May 10, 2003. -@item -version 21.5.14 "cassava" released June 1, 2003. -@item -version 21.5.15 "celery" released September 3, 2003. -@item -version 21.5.16 "celeriac" released September 26, 2003. -@item -version 21.5.17 "chayote" released March 22, 2004. -@item -version 21.5.18 "chestnut" released October 22, 2004. +version 21.2.41 ``Polyhymnia'' released January 17, 2001. +@item +version 21.2.42 ``Poseidon'' released January 20, 2001. +@item +version 21.2.43 ``Terspichore'' released January 26, 2001. +@item +version 21.2.44 ``Thalia'' released February 8, 2001. +@item +version 21.2.45 ``Thelxepeia'' released February 23, 2001. +@item +version 21.2.46 ``Urania'' released March 21, 2001. +@item +version 21.2.47 ``Zephir'' released April 14, 2001. +@item +XEmacs 21.4.0 ``Solid Vapor'' released April 16, 2001. +@item +XEmacs 21.4.1 ``Copyleft'' released April 19, 2001. +@item +XEmacs 21.4.2 ``Developer-Friendly Unix APIs'' released May 10, 2001. +@item +XEmacs 21.4.3 ``Academic Rigor'' released May 17, 2001. +@item +XEmacs 21.4.4 ``Artificial Intelligence'' released July 28, 2001. +@item +XEmacs 21.4.5 ``Civil Service'' released October 23, 2001. +@item +XEmacs 21.4.6 ``Common Lisp'' released December 17, 2001. +@item +XEmacs 21.4.7 ``Economic Science'' released May 4, 2002. +@item +XEmacs 21.4.8 ``Honest Recruiter'' released May 9, 2002. +@item +XEmacs 21.4.9 ``Informed Management'' released August 23, 2002. +@item +XEmacs 21.4.10 ``Military Intelligence'' released November 2, 2002. +@item +XEmacs 21.4.11 ``Native Windows TTY Support'' released January 3, 2003. +@item +XEmacs 21.4.12 ``Portable Code'' released January 15, 2003. +@item +XEmacs 21.4.13 ``Rational FORTRAN'' released May 25, 2003. +@item +XEmacs 21.4.14 ``Reasonable Discussion'' released September 3, 2003. +@item +XEmacs 21.4.15 ``Security Through Obscurity'' released February 2, 2004. +@item +XEmacs 21.4.16 ``Successful IPO'' released December 5, 2004. +@item +version 21.5.0 ``alfalfa'' released April 18, 2001. +@item +version 21.5.1 ``anise'' released May 9, 2001. +@item +version 21.5.2 ``artichoke'' released July 28, 2001. +@item +version 21.5.3 ``asparagus'' released September 7, 2001. +@item +version 21.5.4 ``bamboo'' released January 8, 2002. +@item +version 21.5.5 ``beets'' released March 5, 2002. +@item +version 21.5.6 ``bok choi'' released April 5, 2002. +@item +version 21.5.7 ``broccoflower'' released July 2, 2002. +@item +version 21.5.8 ``broccoli'' released July 27, 2002. +@item +version 21.5.9 ``brussels sprouts'' released August 30, 2002. +@item +version 21.5.10 ``burdock'' released January 4, 2003. +@item +version 21.5.11 ``cabbage'' released February 16, 2003. +@item +version 21.5.12 ``carrot'' released April 24, 2003. +@item +version 21.5.13 ``cauliflower'' released May 10, 2003. +@item +version 21.5.14 ``cassava'' released June 1, 2003. +@item +version 21.5.15 ``celery'' released September 3, 2003. +@item +version 21.5.16 ``celeriac'' released September 26, 2003. +@item +version 21.5.17 ``chayote'' released March 22, 2004. +@item +version 21.5.18 ``chestnut'' released October 22, 2004. @end itemize @node The XEmacs Split, XEmacs from the Outside, A History of Emacs, Top @@ -2153,7 +2157,7 @@ hundreds of messages long and all of them coming from the XEmacs side. All have failed because they have eventually come to the same conclusion, which is that RMS has no real interest in cooperation at all. If you work with -him, you have to do it his way -- "my way or the highway". Specifically: +him, you have to do it his way -- ``my way or the highway''. Specifically: @enumerate @item @@ -4048,8 +4052,8 @@ @end display Then, the problem is that now we can't say that a sequence of -word-constituents makes up a word. For instance, both Hiragana "A" -and Kanji "KAN" are word-constituents but the sequence of these two +word-constituents makes up a word. For instance, both Hiragana ``A'' +and Kanji ``KAN'' are word-constituents but the sequence of these two letters can't be a single word. So, we introduced Sextword for Japanese letters. @@ -5008,7 +5012,7 @@ struct foobar; -go into the "types" section of lisp.h. +go into the ``types'' section of @file{lisp.h}. @end itemize @node Writing New Modules, Working with Lisp Objects, Introduction to Writing C Code, Rules When Writing New C Code @@ -5666,7 +5670,7 @@ sure to update any comments to be correct -- or, at the very least, flag them as incorrect. -To indicate a "todo" or other problem, use four pound signs -- +To indicate a ``todo'' or other problem, use four pound signs -- i.e. @samp{####}. @node Adding Global Lisp Variables, Writing Macros, Writing Good Comments, Rules When Writing New C Code @@ -5851,7 +5855,7 @@ Anything that's an lvalue can be evaluated more than once. @item Macros where anything else can be evaluated more than once should -have the word "unsafe" in their name (exceptions may be made for +have the word ``unsafe'' in their name (exceptions may be made for large sets of macros that evaluate arguments of certain types more than once, e.g. struct buffer * arguments, when clearly indicated in the macro documentation). These macros are generally meant to be @@ -5883,7 +5887,7 @@ reference. @item Capitalize macros that evaluate @strong{any} argument more than once regardless -of whether that's "allowed" (e.g. buffer arguments). +of whether that's ``allowed'' (e.g. buffer arguments). @item Capitalize macros that directly access a field in a Lisp_Object or its equivalent underlying structure. In such cases, access through the @@ -5938,8 +5942,8 @@ will just lead to headaches. But it's important to keep the code clean and understandable, and consistent naming goes a long way towards this. -An example of the right way to do this was the so-called "great integral -type renaming". +An example of the right way to do this was the so-called ``great integral +type renaming''. @menu * Great Integral Type Renaming:: @@ -5966,13 +5970,13 @@ people disagree vociferously with this, but their arguments are mostly theoretical, and are vastly outweighed by the practical headaches of mixing signed and unsigned values, and more importantly by the far -increased likelihood of inadvertent bugs: Because of the broken "viral" +increased likelihood of inadvertent bugs: Because of the broken ``viral'' nature of unsigned quantities in C (operations involving mixed signed/unsigned are done unsigned, when exactly the opposite is nearly always wanted), even a single error in declaring a quantity unsigned that should be signed, or even the even more subtle error of comparing signed and unsigned values and forgetting the necessary cast, can be -catastrophic, as comparisons will yield wrong results. -Wsign-compare +catastrophic, as comparisons will yield wrong results. @samp{-Wsign-compare} is turned on specifically to catch this, but this tends to result in a great number of warnings when mixing signed and unsigned, and the casts are annoying. More has been written on this elsewhere. @@ -5991,17 +5995,17 @@ all be avoided. @item -"count" == a zero-based measurement of some quantity. Includes sizes, +``count'' == a zero-based measurement of some quantity. Includes sizes, offsets, and indexes. @item -"bpos" == a one-based measurement of a position in a buffer. "Charbpos" -and "Bytebpos" count text in the buffer, rather than bytes in memory; +``bpos'' == a one-based measurement of a position in a buffer. ``Charbpos'' +and ``Bytebpos'' count text in the buffer, rather than bytes in memory; thus Bytebpos does not directly correspond to the memory representation. -Use "Membpos" for this. - -@item -"Char" refers to internal-format characters, not to the C type "char", +Use ``Membpos'' for this. + +@item +``Char'' refers to internal-format characters, not to the C type ``char'', which is really a byte. @end itemize @@ -6096,7 +6100,7 @@ /* The have been some arguments over the what the type should be that specifies a count of bytes in a data block to be written out or read in, using @code{Lstream_read()}, @code{Lstream_write()}, and related functions. - Originally it was long, which worked fine; Martin "corrected" these to + Originally it was long, which worked fine; Martin ``corrected'' these to size_t and ssize_t on the grounds that this is theoretically cleaner and is in keeping with the C standards. Unfortunately, this practice is horribly error-prone due to design flaws in the way that mixed @@ -6471,7 +6475,7 @@ @deffn Macro Known-Bug-Expect-Failure body Arrange for failing tests in @var{body} to generate messages prefixed -with "KNOWN BUG:" instead of "FAIL:". @var{body} is a @code{progn}-like +with ``KNOWN BUG:'' instead of ``FAIL:''. @var{body} is a @code{progn}-like body, and may contain several tests. @end deffn @@ -6652,7 +6656,7 @@ adds and deletes on the main line, which you do not want at all. Therefore, you must undo all adds and deletes. To find out what is added and deleted, use something like @code{cvs -n update >&! -cvs.out}, which does a "dry run". (You did make a backup copy first, +cvs.out}, which does a ``dry run''. (You did make a backup copy first, right? What if you forgot the @samp{-n}, for example, and wasn't prepared for the sudden onslaught of merging action?) Take a look at the output file @file{cvs.out} and check very carefully for newly @@ -6684,7 +6688,7 @@ Note that this doesn't actually do anything to your local workspace! It basically just creates another tag in the repository, identical to -the branch point tag but internally marked as a "branch tag" rather +the branch point tag but internally marked as a ``branch tag'' rather than a regular tag. @item @@ -7018,13 +7022,13 @@ mechanism. -A "dynamic array" is a contiguous array of fixed-size elements where there +A ``dynamic array'' is a contiguous array of fixed-size elements where there is no upper limit (except available memory) on the number of elements in the array. Because the elements are maintained contiguously, space is used efficiently (no per-element pointers necessary) and random access to a particular element is in constant time. At any one point, the block of memory that holds the array has an upper limit; if this limit is exceeded, the -memory is realloc()ed into a new array that is twice as big. Assuming that +memory is @code{realloc()}ed into a new array that is twice as big. Assuming that the time to grow the array is on the order of the new size of the array block, this scheme has a provably constant amortized time (i.e. average time over all additions). @@ -7132,10 +7136,10 @@ addition. -A "block-type object" is used to efficiently allocate and free blocks +A ``block-type object'' is used to efficiently allocate and free blocks of a particular size. Freed blocks are remembered in a free list and are reused as necessary to allocate new blocks, so as to avoid as -much as possible making calls to malloc() and free(). +much as possible making calls to @code{malloc()} and @code{free()}. This is a container object. Declare a block-type object of a specific type as follows: @@ -8277,7 +8281,7 @@ Now, the actual marking is feasible. We do so by once using the macro @code{MARK_RECORD_HEADER} to mark the object itself (actually the special flag in the lrecord header), and calling its special marker -"method" @code{marker} if available. The marker method marks every +``method'' @code{marker} if available. The marker method marks every other object that is in reach from our current object. Note, that these marker methods should not call @code{mark_object} recursively, but instead should return the next object from where further marking has to @@ -8332,7 +8336,7 @@ @code{sweep_symbols}, @code{sweep_extents}, @code{sweep_markers} and @code{sweep_extents}. They are the fixed-size types cons, floats, compiled-functions, symbol, marker, extent, and event stored in -so-called "frob blocks", and therefore we can basically do the same on +so-called ``frob blocks'', and therefore we can basically do the same on every type objects, using the same macros, especially defined only to handle everything with respect to fixed-size blocks. The only fixed-size type that is not handled here are the fixed-size portion of strings, @@ -10057,7 +10061,7 @@ BEGV, and ZV, and in addition to this we cache 16 positions where the conversion is known. We only look in the cache or update it when we need to move the known region more than a certain amount (currently 50 -chars), and then we throw away a "random" value and replace it with the +chars), and then we throw away a ``random'' value and replace it with the newly calculated value. Finally, we maintain an extra flag that tracks whether the buffer is @@ -10093,7 +10097,7 @@ original value. Dividing by 3, alas, cannot be implemented in any simple shift/subtract method, as far as I know; so we just do a table lookup. For simplicity, we use a table of size 128K, which indexes the -"divide-by-3" values for the first 64K non-negative numbers. (Note that +``divide-by-3'' values for the first 64K non-negative numbers. (Note that we can increase the size up to 384K, i.e. indexing the first 192K non-negative numbers, while still using shorts in the array.) This also means that the size of the known region can be at most 64K for @@ -10123,7 +10127,7 @@ @item the last value we computed @item -a set of positions that are "far away" from previously computed positions +a set of positions that are ``far away'' from previously computed positions (5000 chars currently; #### perhaps should be smaller) @end itemize @@ -10149,7 +10153,7 @@ @code{charcount_to_bytecount_down()}. (The latter two I added for this purpose.) These scan 4 or 8 bytes at a time through purely single-byte characters. -If the amount we had to scan was more than our "far away" distance (5000 +If the amount we had to scan was more than our ``far away'' distance (5000 characters, see above), then cache the new position. #### Things to do: @@ -10159,7 +10163,7 @@ Look at the most recent GNU Emacs to see whether anything has changed. @item Think about whether it makes sense to try to implement some sort of -known region or list of "known regions", like we had before. This would +known region or list of ``known regions'', like we had before. This would be a region of entirely single-byte characters that we can check very quickly. (Previously I used a range of same-width characters of any size; but this adds extra complexity and slows down the scanning, and is @@ -10377,7 +10381,7 @@ @enumerate @item -An explicit "failure stack" has been substituted for recursion. +An explicit ``failure stack'' has been substituted for recursion. @item The @code{match_1_operator}, @code{next_p}, and @code{next_b} functions @@ -10390,7 +10394,7 @@ @item Some cases are combined into short preparation for individual cases, and -a "fall-through" into combined code for several cases. +a ``fall-through'' into combined code for several cases. @item The @code{pattern} type is not an explicit @samp{struct}. Instead, the @@ -10409,7 +10413,7 @@ @end example @end enumerate -But if you keep your eye on the "switch in a loop" structure, you +But if you keep your eye on the ``switch in a loop'' structure, you should be able to understand the parts you need. @node Multilingual Support, Consoles; Devices; Frames; Windows, Text, Top @@ -10871,7 +10875,7 @@ its code point. For more complicated charsets, however, things are not so obvious. Unicode version 2, for example, is a large charset with thousands of characters, each indexed by a 16-bit number, often -represented in hex, e.g. 0x05D0 for the Hebrew letter "aleph". One +represented in hex, e.g. 0x05D0 for the Hebrew letter ``aleph''. One obvious encoding uses two bytes per character (actually two encodings, depending on which of the two possible byte orderings is chosen). This encoding is convenient for internal processing of Unicode text; however, @@ -10892,10 +10896,10 @@ There are 256 characters, and each character is represented using the numbers 0 through 255, which fit into a single byte. With a few exceptions (such as case-changing operations or syntax classes like -'whitespace'), "text" is simply an array of indices into a font. You +@code{whitespace}), ``text'' is simply an array of indices into a font. You can get different languages simply by choosing fonts with different 8-bit character sets (ISO-8859-1, -2, special-symbol fonts, etc.), and -everything will "just work" as long as anyone else receiving your text +everything will ``just work'' as long as anyone else receiving your text uses a compatible font. In the multi-lingual world, however, it is much more complicated. There @@ -10945,8 +10949,8 @@ assumptions can reliably be made about the format of this text. You cannot assume, for example, that the end of text is terminated by a null byte. (For example, if the text is Unicode, it will have many null bytes -in it.) You cannot find the next "slash" character by searching through -the bytes until you find a byte that looks like a "slash" character, +in it.) You cannot find the next ``slash'' character by searching through +the bytes until you find a byte that looks like a ``slash'' character, because it might actually be the second byte of a Kanji character. Furthermore, all text in the internal representation must be converted, even if it is known to be completely ASCII, because the external @@ -10976,7 +10980,7 @@ system aliases, which in essence gives a single coding system two different names. It is effectively used in XEmacs to provide a layer of abstraction on top of the actual coding systems. For example, the coding -system alias "file-name" points to whichever coding system is currently +system alias ``file-name'' points to whichever coding system is currently used for encoding and decoding file names as passed to or retrieved from system calls. In general, the actual encoding will differ from system to system, and also on the particular locale that the user is in. The use @@ -11487,8 +11491,8 @@ S = signed @end example -(Formerly I had a comment saying that type (e) "should be replaced with -void *". However, there are in fact many places where an unsigned char +(Formerly I had a comment saying that type (e) ``should be replaced with +void *''. However, there are in fact many places where an unsigned char * might be used -- e.g. for ease in pointer computation, since void * doesn't allow this, and for compatibility with external APIs.) @@ -11509,8 +11513,8 @@ @cindex different ways of seeing internal text There are various ways of representing internal text. The two primary -ways are as an "array" of individual characters; the other is as a -"stream" of bytes. In the ASCII world, where there are only 255 +ways are as an ``array'' of individual characters; the other is as a +``stream'' of bytes. In the ASCII world, where there are only 255 characters at most, things are easy because each character fits into a byte. In general, however, this is not true -- see the above discussion of characters vs. encodings. @@ -11518,12 +11522,12 @@ In some cases, it's also important to distinguish between a stream representation as a series of bytes and as a series of textual units. This is particularly important wrt Unicode. The UTF-16 representation -(sometimes referred to, rather sloppily, as simply the "Unicode" format) +(sometimes referred to, rather sloppily, as simply the ``Unicode'' format) represents text as a series of 16-bit units. Mostly, each unit corresponds to a single character, but not necessarily, as characters -outside of the range 0-65535 (the BMP or "Basic Multilingual Plane" of +outside of the range 0-65535 (the BMP or ``Basic Multilingual Plane'' of Unicode) require two 16-bit units, through the mechanism of -"surrogates". When a series of 16-bit units is serialized into a byte +``surrogates''. When a series of 16-bit units is serialized into a byte stream, there are at least two possible representations, little-endian and big-endian, and which one is used may depend on the native format of 16-bit integers in the CPU of the machine that XEmacs is running @@ -11540,10 +11544,10 @@ @item UTF-32 has 4-byte (32-bit) units. @item -XEmacs-internal encoding (the old "Mule" encoding) has 1-byte (8-bit) +XEmacs-internal encoding (the old ``Mule'' encoding) has 1-byte (8-bit) units. @item -UTF-7 technically has 7-bit units that are within the "mail-safe" range +UTF-7 technically has 7-bit units that are within the ``mail-safe'' range (ASCII 32 - 126 plus a few control characters), but normally is encoded in an 8-bit stream. (UTF-7 is also a modal encoding, since it has a normal mode where printable ASCII characters represent themselves and a @@ -11608,7 +11612,7 @@ The data in a buffer or string is logically made up of Ibyte objects, where a Ibyte takes up the same amount of space as a char. (It is declared differently, though, to catch invalid usages.) Strings stored -using Ibytes are said to be in "internal format". The important +using Ibytes are said to be in ``internal format''. The important characteristics of internal format are @itemize @minus @@ -11661,11 +11665,11 @@ 8-bit representation of ASCII/ISO-8859-1. @item Extbyte -Strings that go in or out of Emacs are in "external format", typedef'ed +Strings that go in or out of Emacs are in ``external format'', typedef'ed as an array of char or a char *. There is more than one external format (JIS, EUC, etc.) but they all have similar properties. They are modal encodings, which is to say that the meaning of particular bytes is not -fixed but depends on what "mode" the string is currently in (e.g. bytes +fixed but depends on what ``mode'' the string is currently in (e.g. bytes in the range 0 - 0x7f might be interpreted as ASCII, or as Hiragana, or as 2-byte Kanji, depending on the current mode). The mode starts out in ASCII/ISO-8859-1 and is switched using escape sequences -- for example, @@ -11695,7 +11699,7 @@ of these are one-based: the beginning of the buffer is position or index 1, and 0 is not a valid position. -As a "buffer position" (typedef Charbpos): +As a ``buffer position'' (typedef Charbpos): This is an index specifying an offset in characters from the beginning of the buffer. Note that buffer positions are @@ -11704,7 +11708,7 @@ characters between those positions. Buffer positions are the only kind of position externally visible to the user. -As a "byte index" (typedef Bytebpos): +As a ``byte index'' (typedef Bytebpos): This is an index over the bytes used to represent the characters in the buffer. If there is no Mule support, this is identical @@ -11714,7 +11718,7 @@ byte index may be greater than the corresponding buffer position. -As a "memory index" (typedef Membpos): +As a ``memory index'' (typedef Membpos): This is the byte index adjusted for the gap. For positions before the gap, this is identical to the byte index. For @@ -11723,7 +11727,7 @@ position; the memory index at the beginning of the gap should always be used, except in code that deals with manipulating the gap, where both indices may be seen. The address of the - character "at" (i.e. following) a particular position can be + character ``at'' (i.e. following) a particular position can be obtained from the formula buffer_start_address + memory_index(position) - 1 @@ -11832,7 +11836,7 @@ Some terminology: -"itext" appearing in the macros means "internal-format text" -- type +itext" appearing in the macros means "internal-format text" -- type @code{Ibyte *}. Operations on such pointers themselves, rather than on the text being pointed to, have "itext" instead of "itext" in the macro name. "ichar" in the macro names means an Ichar -- the representation @@ -12041,7 +12045,7 @@ @end itemize Turned out that all of the above had bugs, all caused by GCC (hence the -comments about "those GCC wankers" and "ream gcc up the ass"). As for +comments about ``those GCC wankers'' and ``ream gcc up the ass''). As for (a), some versions of GCC (especially on Intel platforms), which had buggy implementations of @code{alloca()} that couldn't handle being called inside of a function call -- they just decremented the stack right in the @@ -13024,7 +13028,7 @@ @item Extbyte, UExtbyte Pointer to text in some external format, which can be defined as all formats other than the internal one. The data representing a string -in "external" format (binary or any external encoding) is logically a +in ``external'' format (binary or any external encoding) is logically a set of Extbytes. Extbyte is guaranteed to be just a char, so for example strlen (Extbyte *) is OK. Extbyte is only a documentation device for referring to external text. @@ -13168,7 +13172,7 @@ @subsection Mule-izing Code A lot of code is written without Mule in mind, and needs to be made -Mule-correct or "Mule-ized". There is really no substitute for +Mule-correct or ``Mule-ized''. There is really no substitute for line-by-line analysis when doing this, but the following checklist can help: @@ -13386,23 +13390,23 @@ @end enumerate @node Locales, More about code pages, Microsoft Documentation, Microsoft Windows-Related Multilingual Issues -@subsection Locales, code pages, and other concepts of "language" -@cindex locales, code pages, and other concepts of "language" +@subsection Locales, code pages, and other concepts of ``language'' +@cindex locales, code pages, and other concepts of ``language'' First, make sure you clearly understand the difference between the C runtime library (CRT) and the Win32 API! See win32.c. There are various different ways of representing the vague concept -of "language", and it can be very confusing. So: - -@itemize @bullet -@item -The CRT library has the concept of "locale", which is a +of ``language'', and it can be very confusing. So: + +@itemize @bullet +@item +The CRT library has the concept of ``locale'', which is a combination of language and country, and which controls the way currency and dates are displayed, the encoding of data, etc. @item -XEmacs has the concept of "language environment", more or less +XEmacs has the concept of ``language environment'', more or less like a locale; although currently in most cases it just refers to the language, and no sub-language distinctions are made. (Exceptions are with Chinese, which has different language @@ -13414,23 +13418,23 @@ @enumerate @item -There are "languages" and "sublanguages", which correspond to +There are ``languages'' and ``sublanguages'', which correspond to the languages and countries of the C library -- e.g. LANG_ENGLISH and SUBLANG_ENGLISH_US. These are identified by 8-bit integers, -called the "primary language identifier" and "sublanguage -identifier", respectively. These are combined into a 16-bit -integer or "language identifier" by MAKELANGID(). - -@item -The language identifier in turn is combined with a "sort -identifier" (and optionally a "sort version") to yield a 32-bit -integer called a "locale identifier" (type LCID), which identifies +called the ``primary language identifier'' and ``sublanguage +identifier'', respectively. These are combined into a 16-bit +integer or ``language identifier'' by @code{MAKELANGID()}. + +@item +The language identifier in turn is combined with a ``sort +identifier'' (and optionally a ``sort version'') to yield a 32-bit +integer called a ``locale identifier'' (type LCID), which identifies locales -- the primary means of distinguishing language/regional settings and similar to C library locales. @item -A "code page" combines the XEmacs concepts of "charset" and "coding -system". It logically encompasses +A ``code page'' combines the XEmacs concepts of ``charset'' and ``coding +system''. It logically encompasses @itemize @minus @item @@ -13443,12 +13447,12 @@ a way of encoding a series of characters into a string of bytes @end itemize -Note that the first two properties correspond to an XEmacs "charset" -and the latter an XEmacs "coding system". +Note that the first two properties correspond to an XEmacs ``charset'' +and the latter an XEmacs ``coding system''. Traditional encodings are either simple one-byte encodings, or combination one-byte/two-byte encodings (aka MBCS encodings, where MBCS -stands for "Multibyte Character Set") with the following properties: +stands for ``Multibyte Character Set'') with the following properties: @itemize @minus @item @@ -13458,7 +13462,7 @@ @item the lower 128 bytes are compatible with ASCII @item -in the higher bytes, the value of the first byte ("lead byte") +in the higher bytes, the value of the first byte (``lead byte'') determines whether a second byte follows @item the values used for second bytes may overlap those used for first @@ -13480,22 +13484,22 @@ native code page under Windows), OEM (a DOS encoding, still used in the FAT file system), Mac (an encoding used on the Macintosh) and EBCDIC (a non-ASCII-compatible encoding used on IBM mainframes, originally based -on the BCD or "binary-coded decimal" encoding of numbers). All code +on the BCD or ``binary-coded decimal'' encoding of numbers). All code pages associated with a locale follow (as far as I know) the properties listed above for traditional code pages. More than one locale can share a code page -- e.g. all the Western European languages, including English, do. @item -Windows also has an "input locale identifier" (aka "keyboard -layout id") or HKL, which is a 32-bit integer composed of the -16-bit language identifier and a 16-bit "device identifier", which +Windows also has an ``input locale identifier'' (aka ``keyboard +layout id'') or HKL, which is a 32-bit integer composed of the +16-bit language identifier and a 16-bit ``device identifier'', which originally specified a particular keyboard layout (e.g. the locale -"US English" can have the QWERTY layout, the Dvorak layout, etc.), +``US English'' can have the QWERTY layout, the Dvorak layout, etc.), but has been expanded to include speech-to-text converters and other non-keyboard ways of inputting text. Note that both the HKL and LCID share the language identifier in the lower 16 bits, and in -both cases a 0 in the upper 16 bits means "default" (sort order or +both cases a 0 in the upper 16 bits means ``default'' (sort order or device), providing a way to convert between HKL's, LCID's, and language identifiers (i.e. language/sublanguage pairs). The default keyboard layout for a language is (as far as I can @@ -13513,7 +13517,7 @@ @subsection More about code pages @cindex more about code pages -Here is what MSDN says about code pages (article "Code Pages"): +Here is what MSDN says about code pages (article ``Code Pages''): @quotation A code page is a character set, which can include numbers, @@ -13555,10 +13559,10 @@ which C programs have traditionally executed. The code page for the "C" locale (code page) corresponds to the ASCII character set. For example, in the "C" locale, islower returns true for the -values 0x61 ?0x7A only. In another locale, islower may return true +values 0x61 to 0x7A only. In another locale, islower may return true for these as well as other values, as defined by that locale. -Under "Locale-Dependent Routines" we notice the following setlocale +Under ``Locale-Dependent Routines'' we notice the following setlocale dependencies: atof, atoi, atol (LC_NUMERIC) @@ -13591,8 +13595,8 @@ _wtoi/_wtol (LC_NUMERIC) @end quotation -NOTE: The above documentation doesn't clearly explain the "locale code -page" and "multibyte code page". These are two different values, +NOTE: The above documentation doesn't clearly explain the ``locale code +page'' and ``multibyte code page''. These are two different values, maintained respectively in the CRT global variables __lc_codepage and __mbcodepage. Calling e.g. setlocale (LC_ALL, "JAPANESE") sets @strong{ONLY} __lc_codepage to 932 (the code page for Japanese), and leaves @@ -13602,12 +13606,12 @@ @itemize @bullet @item -from "Interpretation of Multibyte-Character Sequences" it appears that -all "multibyte-character routines" use the multibyte code page except for -mblen(), _mbstrlen(), mbstowcs(), mbtowc(), wcstombs(), and wctomb(). - -@item -from "_setmbcp": "The multibyte code page also affects +from ``Interpretation of Multibyte-Character Sequences'' it appears that +all ``multibyte-character routines'' use the multibyte code page except for +@code{mblen()}, @code{_mbstrlen()}, @code{mbstowcs()}, @code{mbtowc()}, @code{wcstombs()}, and @code{wctomb()}. + +@item +from ``_setmbcp'': ``The multibyte code page also affects multibyte-character processing by the following run-time library routines: _exec functions _mktemp _stat _fullpath _spawn functions _tempnam _makepath _splitpath tmpnam. In addition, all run-time library @@ -13615,7 +13619,7 @@ as parameters (such as the _exec and _spawn families) process these strings according to the multibyte code page. Hence these routines are also affected by a call to _setmbcp that changes the multibyte code -page." +page.'' @end itemize Summary: from looking at the CRT source (which comes with VC++) and @@ -13623,15 +13627,15 @@ @itemize @bullet @item -the "locale code page" is used by all of the routines listed above -under "Locale-Dependent Routines" (EXCEPT _mbccpy() and _mbclen()), +the ``locale code page'' is used by all of the routines listed above +under ``Locale-Dependent Routines'' (EXCEPT @code{_mbccpy()} and @code{_mbclen()}), as well as any other place that converts between multibyte and Unicode strings, e.g. the startup code. @item -the "multibyte code page" is used in all of the *mb*() routines -except mblen(), _mbstrlen(), mbstowcs(), mbtowc(), wcstombs(), -and wctomb(); also _exec*(), _spawn*(), _mktemp(), _stat(), _fullpath(), -_tempnam(), _makepath(), _splitpath(), tmpnam(), and similar functions +the ``multibyte code page'' is used in all of the @code{mb*()} routines +except @code{mblen()}, @code{_mbstrlen()}, @code{mbstowcs()}, @code{mbtowc()}, @code{wcstombs()}, +and @code{wctomb()}; also @code{_exec*()}, @code{_spawn*()}, @code{_mktemp()}, @code{_stat()}, @code{_fullpath()}, +@code{_tempnam()}, @code{_makepath()}, @code{_splitpath()}, @code{tmpnam()}, and similar functions without the leading underscore. @end itemize @@ -13644,16 +13648,16 @@ @itemize @bullet @item -The system-default locale is the locale defined under "Language -settings for the system" in the "Regional Options" control panel. This +The system-default locale is the locale defined under ``Language +settings for the system'' in the ``Regional Options'' control panel. This is NOT user-specific, and changing it requires a reboot (at least under Windows 2000). The ANSI code page of the system-default locale is -returned by GetACP(), and you can specify this code page in calls +returned by @code{GetACP()}, and you can specify this code page in calls e.g. to MultiByteToWideChar with the constant CP_ACP. @item -The user-default locale is the locale defined under "Settings for the -current user" in the "Regional Options" control panel. +The user-default locale is the locale defined under ``Settings for the +current user'' in the ``Regional Options'' control panel. @item There is a thread-local locale set by SetThreadLocale. #### What is this @@ -13661,11 +13665,11 @@ @end itemize The Win32 API has a bunch of multibyte functions -- all of those that -end with ...A(), and on which we spend so much effort in +end with ...@code{A()}, and on which we spend so much effort in intl-encap-win32.c. These appear to ALWAYS use the ANSI code page of -the system-default locale (GetACP(), CP_ACP). Note that this applies +the system-default locale (@code{GetACP()}, CP_ACP). Note that this applies also, for example, to the encoding of filenames in all file-handling -routines, including the CRT ones such as open(), because they pass their +routines, including the CRT ones such as @code{open()}, because they pass their args unchanged to the Win32 API. @node Unicode support under Windows, The golden rules of writing Unicode-safe code, More about locales, Microsoft Windows-Related Multilingual Issues @@ -13683,20 +13687,20 @@ Under Windows there are two different versions of all library routines that accept or return text, those that handle Unicode text and those handling -"multibyte" text, i.e. variable-width ASCII-compatible text in some +``multibyte'' text, i.e. variable-width ASCII-compatible text in some national format such as EUC or Shift-JIS. Because Windows 95 basically doesn't support Unicode but Windows NT does, and Microsoft doesn't provide any way of writing a single binary that will work on both systems and still use Unicode when it's available (although see below, Microsoft Layer for Unicode), we need to provide a way of run-time conditionalizing so you -could have one binary for both systems. "Unicode-splitting" refers to +could have one binary for both systems. ``Unicode-splitting'' refers to writing code that will handle this properly. This means using Qmswindows_tstr as the external conversion format, calling the appropriate qxe...() Unicode-split version of library functions, and doing other things -in certain cases, e.g. when a qxe() function is not present. +in certain cases, e.g. when a @code{qxe()} function is not present. Unicode support also requires that the various Windows APIs be -"Unicode-encapsulated", so that they automatically call the ANSI or +``Unicode-encapsulated'', so that they automatically call the ANSI or Unicode version of the API call appropriately and handle the size differences in structures. What this means is: @@ -13704,7 +13708,7 @@ @item first, note that Windows already provides a sort of encapsulation of all APIs that deal with text. All such APIs are underlyingly -provided in two versions, with an A or W suffix (ANSI or "wide" +provided in two versions, with an A or W suffix (ANSI or ``wide'' i.e. Unicode), and the compile-time constant UNICODE controls which is selected by the unsuffixed API. Same thing happens with structures, and also with types, where the generic types have names beginning with T -- @@ -13723,7 +13727,7 @@ @item what we do is provide an encapsulation of each standard Windows API call that is split into A and W versions. current theory is to avoid all -preprocessor games; so we name the function with a prefix -- "qxe" +preprocessor games; so we name the function with a prefix -- ``qxe'' currently -- and require callers to use the prefixed name. Callers need to explicitly use the W version of all structures, and convert text themselves using Qmswindows_tstr. the qxe encapsulated version will @@ -13783,8 +13787,8 @@ think twice before doing this. According to Microsoft documentation, only the following functions are -provided under Windows 9x to support Unicode (see MSDN page "Windows -95/98/Me General Limitations"): +provided under Windows 9x to support Unicode (see MSDN page ``Windows +95/98/Me General Limitations''): EnumResourceLanguagesW EnumResourceNamesW @@ -13805,8 +13809,8 @@ TextOutW WideCharToMultiByte -also maybe GetTextExtentExPoint? (KB Q125671 "Unicode Functions Supported -by Windows 95") +also maybe GetTextExtentExPoint? (KB Q125671 ``Unicode Functions Supported +by Windows 95'') Q210341 says this in addition: @@ -13831,7 +13835,7 @@ The Unicode standard offers application developers an opportunity to work with text without the limitations of character set based systems. For more information on the Unicode standard see the -"References" section of this article. Windows NT is a fully Unicode +References" section of this article. Windows NT is a fully Unicode capable operating system so it may be desirable to write software that supports Unicode on Windows 95. @@ -13914,12 +13918,12 @@ wmain() is completely supported, and appropriate Unicode-formatted argv and envp will always be passed. @item -Likewise, wWinMain() is completely supported. (NOTE: The docs are not at +Likewise, @code{wWinMain()} is completely supported. (NOTE: The docs are not at all clear on how these various entry points interact, and implies that -a windows-subsystem program "must" use WinMain(), while a console- -subsystem program "must" use main(), and a program compiled with UNICODE -(which we don't, see above) "must" use the w*() versions, while a program -not compiled this way "must" use the plain versions. In fact it appears +a windows-subsystem program ``must'' use @code{WinMain()}, while a console- +subsystem program ``must'' use @code{main()}, and a program compiled with UNICODE +(which we don't, see above) ``must'' use the @code{w*()} versions, while a program +not compiled this way ``must'' use the plain versions. In fact it appears that the CRT provides four different compiler entry points, namely w?(main|WinMain)CRTStartup, and we simply choose the one we like using the appropriate link flag. @@ -17941,69 +17945,72 @@ | ###################################################################### | | # toolbar # | | #--------------------------------------------------------------------# | -| # | gutter | # | -| # |--------------------------------------------------------------| # | -| # | | internal border width | | # | -| # | | ******************************************************** | | # | -|w# | | * |s|v* |s* | | #w| -|i# | | * |c|e* |c* | | #i| -|n# | | * |r|r* |r* | | #n| -|d# | | * |o|t* |o* | | #d| -|o# | | * text area |l|.* text area |l* | | #o| -|w# | |i* |l| * |l*i| | #w| -|-# | |n* |b|d* |b*n| | #-| -|m# | |t* |a|i* |a*t| | #m| -|a# | |.* |r|v* |r*.| | #a| -|n# t| | *-------------------------+-|i*----------------------+-* | |t #n| -|a# o|g|b* scrollbar | |d* scrollbar | *b|g|o #a| -|g# o|u|o*-------------------------+-|e*----------------------+-*o|u|o #g| -|e# l|t|r* modeline |r* modeline *r|t|l #e| -|r# b|t|d********************************************************d|t|b #r| -| # a|e|e* =..texttexttex....= |s|v* |s*e|e|a # | -|d# r|r|r*o m=..texttexttextt..=o m|c|e* |c*r|r|r #d| -|e# | | *u a=.exttexttextte...=u a|r|r* |r* | | #e| -|c# | |w*t r=....texttexttex..=t r|o|t* |o*w| | #c| -|o# | |i*s g= etc. =s g|l|.* text area |l*i| | #o| -|r# | |d*i i= =i i|l| * |l*d| | #r| -|a# | |t*d n= =d n|b|d* |b*t| | #a| -|t# | |h*e = inner text area =e |a|i* |a*h| | #t| +| # | internal border | # | +| # | +----------------------------------------------------------+ | # | +| # | | gutter | | # | +| # | |-********************************************************-| | # | +|w# | | *@| scrollbar |v* |s* | | #w| +|i# | | *-+-------------------------|e* |c* | | #i| +|n# | | *s| |r* |r* | | #n| +|d# | | *c| |t* |o* | | #d| +|o# | | *r| |.* text area |l* | | #o| +|w# |i| *o| | * |l* |i| #w| +|-# |n| *l| text area |d* |b* |n| #-| +|m# |t| *l| |i* |a* |t| #m| +|a# |e| *b| |v* |r* |e| #a| +|n# t|r| *a| |i*----------------------+-* |r|t #n| +|a# o|n|g*r| |d* scrollbar |@*g|n|o #a| +|g# o|a|u*-+-------------------------|e*----------------------+-*u|a|o #g| +|e# l|l|t* modeline |r* modeline *t|l|l #e| +|r# b| |t********************************************************t| |b #r| +| # a|b|e* =..texttexttex....= |s|v* |s*e|b|a # | +|d# r|o|r*o m=..texttexttextt..=o m|c|e* |c*r|o|r #d| +|e# |r| *u a=.exttexttextte...=u a|r|r* |r* |r| #e| +|c# |d| *t r=....texttexttex..=t r|o|t* |o* |d| #c| +|o# |e| *s g= etc. =s g|l|.* text area |l* |e| #o| +|r# |r| *i i= =i i|l| * |l* |r| #r| +|a# | | *d n= =d n|b|d* |b* | | #a| +|t# | | *e = inner text area =e |a|i* |a* | | #t| |i# | | * = = |r|v* |r* | | #i| |o# | | *---===================---+-|i*----------------------+-* | | #o| -|n# | | * scrollbar | |d* scrollbar | * | | #n| +|n# | | * scrollbar |@|d* scrollbar |@* | | #n| | # | | *-------------------------+-|e*----------------------+-* | | # | | # | | * modeline |r* modeline * | | # | -| # | | ******************************************************** | | # | -| # | | * minibuffer * | | # | -| # | | ******************************************************** | | # | -| # | | internal border width | | # | -| # |--------------------------------------------------------------| # | -| # | gutter | # | +| # | |-********************************************************-| | # | +| # | | gutter | | # | +| # | |-********************************************************-| | # | +| # | |@* minibuffer *@| | # | +| # | +-********************************************************-+ | # | +| # | internal border | # | | #--------------------------------------------------------------------# | | # toolbar # | | ###################################################################### | | window manager decoration | +------------------------------------------------------------------------+ - # = boundary of client area; * = window boundaries, boundary of paned area - = = boundary of inner text area; . = inside margin area -@end example - -Note in particular what happens at the corners, where a "corner box" +# = boundary of client area; * = window boundaries, boundary of paned area += = boundary of inner text area; . = inside margin area; @ = dead boxes +@end example + +Note in particular what happens at the corners, where a ``corner box'' occurs. Top and bottom toolbars take precedence over left and right toolbars, extending out horizontally into the corner boxes. Gutters work the same way. The corner box where the scrollbars meet, however, -is assigned to neither scrollbar, and is known as the "dead box"; it is -an area that must be cleared specially. +is assigned to neither scrollbar, and is known as the ``dead box''; it is +an area that must be cleared specially. There are similar dead boxes at +the bottom-right and bottom-left corners where the minibuffer and +left/right gutters meet, but there is currently a bug in that these dead +boxes are not explicitly cleared and may contain junk. @node The Frame, The Non-Client Area, Intro to Window and Frame Geometry, Window and Frame Geometry @section The Frame -The "top-level window area" is the entire area of a top-level window (or -"frame"). The "client area" (a term from MS Windows) is the area of a +The ``top-level window area'' is the entire area of a top-level window (or +``frame''). The ``client area'' (a term from MS Windows) is the area of a top-level window that XEmacs draws into and manages with redisplay. This includes the toolbar, scrollbars, gutters, dividers, text area, modeline and minibuffer. It does not include the menubar, title or -outer borders. The "non-client area" is the area of a top-level window +outer borders. The ``non-client area'' is the area of a top-level window outside of the client area and includes the menubar, title and outer borders. Internally, all frame coordinates are relative to the client area. @@ -18020,7 +18027,7 @@ borders. These are controlled by the window manager, a separate process that controls the desktop, the location of icons, etc. When a process tries to create a window, the window manager intercepts this action and -"reparents" the window, placing another window around it which contains +``reparents'' the window, placing another window around it which contains the window decorations, including the title bar, outer borders used for resizing, etc. The window manager also implements any actions involving the decorations, such as the ability to resize a window by dragging its @@ -18030,12 +18037,12 @@ move or resize them. @item -Inside of the window-manager decorations is the "shell", which is +Inside of the window-manager decorations is the ``shell'', which is managed by the toolkit and widget libraries your program is linked with. The code in @file{*-x.c} uses the Xt toolkit and various possible widget -libraries built on top of Xt, such as Motif, Athena, the "Lucid" +libraries built on top of Xt, such as Motif, Athena, the ``Lucid'' widgets, etc. Another possibility is GTK (@file{*-gtk.c}), which implements -both the toolkit and widgets. Under Xt, the "shell" window is an +both the toolkit and widgets. Under Xt, the ``shell'' window is an EmacsShell widget, containing an EmacsManager widget of the same size, which in turn contains a menubar widget and an EmacsFrame widget, inside of which is the client area. (The division into EmacsShell and @@ -18051,10 +18058,10 @@ There is no division such as under X. Part of the window-system API (@file{USER.DLL}) of Win32 includes functions to control the menubars, title, etc. and implements the move and resize behavior. There @strong{is} an -equivalent of the window manager, called the "shell", but it manages +equivalent of the window manager, called the ``shell'', but it manages only the desktop, not the windows themselves. The normal shell under Windows is @file{EXPLORER.EXE}; if you kill this, you will lose the bar -containing the "Start" menu and tray and such, but the windows +containing the ``Start'' menu and tray and such, but the windows themselves will not be affected or lose their decorations. @@ -18063,14 +18070,14 @@ Inside of the client area is the toolbars, the gutters (where the buffer tabs are displayed), the minibuffer, the internal border width, and one -or more non-overlapping "windows" (this is old Emacs terminology, from +or more non-overlapping ``windows'' (this is old Emacs terminology, from before the time when frames existed at all; the standard terminology for -this would be "pane"). Each window can contain a modeline, horizontal +this would be ``pane''). Each window can contain a modeline, horizontal and/or vertical scrollbars, and (for non-rightmost windows) a vertical divider, surrounding a text area. The dimensions of the toolbars and gutters are determined by the formula -(THICKNESS + 2 * BORDER-THICKNESS), where "thickness" is a cover term +(THICKNESS + 2 * BORDER-THICKNESS), where ``thickness'' is a cover term for height or width, as appropriate. The height and width come from @code{default-toolbar-height} and @code{default-toolbar-width} and the specific versions of these (@code{top-toolbar-height}, @code{left-toolbar-width}, etc.). @@ -18095,13 +18102,19 @@ @node The Paned Area, Text Areas, The Client Area, Window and Frame Geometry @section The Paned Area -The area occupied by the "windows" is called the paned area. Note that -this includes the minibuffer, which is just another window but is -special-cased in XEmacs. Each window can include a horizontal and/or -vertical scrollbar, a modeline and a vertical divider to its right, as -well as the text area. Only non-rightmost windows can include a -vertical divider. (The minibuffer normally does not include either -modeline or scrollbars.) +The area occupied by the ``windows'' is called the paned area. +Unfortunately, because of the presence of the gutter @strong{between} the +minibuffer and other windows, the bottom of the paned area is not +well-defined -- does it include the minibuffer (in which case it also +includes the bottom gutter, but none others) or does it not include +the minibuffer? (In which case not all windows are included.) It would +be cleaner to put the bottom gutter @strong{below} the minibuffer instead of +above it. + +Each window can include a horizontal and/or vertical scrollbar, a +modeline and a vertical divider to its right, as well as the text area. +Only non-rightmost windows can include a vertical divider. (The +minibuffer normally does not include either modeline or scrollbars.) Note that, because the toolbars and gutters are controlled by specifiers, and specifiers can have window-specific and buffer-specific @@ -18124,7 +18137,7 @@ In addition, it is possible to set margins in the text area using the specifiers @code{left-margin-width} and @code{right-margin-width}. When this is -done, only the "inner text area" (the area inside of the margins) will +done, only the ``inner text area'' (the area inside of the margins) will be used for normal display of text; the margins will be used for glyphs with a layout policy of @code{outside-margin} (as set on an extent containing the glyph by @code{set-extent-begin-glyph-layout} or @@ -18135,7 +18148,7 @@ etc.), using the left and right margins, respectively. Technically, the margins outside of the inner text area are known as the -"outside margins". The "inside margins" are in the inner text area and +``outside margins''. The ``inside margins'' are in the inner text area and constitute the whitespace between the outside margins and the first or last non-whitespace character in a line; their width can vary from line to line. Glyphs will be placed in the inside margin if their layout @@ -18150,31 +18163,36 @@ @node The Displayable Area, Which Functions Use Which?, Text Areas, Window and Frame Geometry @section The Displayable Area -The "displayable area" is not so much an actual area as a convenient +The ``displayable area'' is not so much an actual area as a convenient fiction. It is the area used to convert between pixel and character dimensions for frames. The character dimensions for a frame (e.g. as returned by @code{frame-width} and @code{frame-height} and set by @code{set-frame-width} and @code{set-frame-height}) are determined from the displayable area by dividing by the pixel size of the default font as -instantiated in the frame. (For proportional fonts, the "average" width +instantiated in the frame. (For proportional fonts, the ``average'' width is used. Under Windows, this is a built-in property of the fonts. Under X, this is based on the width of the lowercase 'n', or if this is zero then the width of the default character. [We prefer 'n' to the specified default character because many X fonts have a default character with a zero or otherwise non-representative width.]) -The displayable area is essentially the "theoretical" paned area of the -frame excluding the rightmost and bottom-most scrollbars. In this -context, "theoretical" means that all calculations on based on -frame-level values for toolbar, gutter and scrollbar thicknesses. -Because these thicknesses are controlled by specifiers, and specifiers -can have window-specific and buffer-specific values, these calculations -may or may not reflect the actual size of the paned area or of the -scrollbars when any particular window is selected. Note also that the -"displayable area" may not even be contiguous! In particular, if the -frame-level value of the horizontal scrollbar height is non-zero, then -the displayable area includes the paned area above and below the bottom -horizontal scrollbar but not the scrollbar itself. +The displayable area is essentially the ``theoretical'' gutter area of the +frame, excluding the rightmost and bottom-most scrollbars. That is, it +starts from the client (or ``total'') area and then excludes the +``theoretical'' toolbars and bottom-most/rightmost scrollbars, and the +internal border width. In this context, ``theoretical'' means that all +calculations on based on frame-level values for toolbar and scrollbar +thicknesses. Because these thicknesses are controlled by specifiers, +and specifiers can have window-specific and buffer-specific values, +these calculations may or may not reflect the actual size of the paned +area or of the scrollbars when any particular window is selected. Note +also that the ``displayable area'' may not even be contiguous! In +particular, the gutters are included, but the bottom-most and rightmost +scrollbars are excluded even though they are inside of the gutters. +Furthermore, if the frame-level value of the horizontal scrollbar height +is non-zero, then the displayable area includes the paned area above and +below the bottom horizontal scrollbar (i.e. the modeline and minibuffer) +but not the scrollbar itself. As a further twist, the character-dimension calculations are adjusted so that the truncation and continuation glyphs (see @code{truncation-glyph} and @@ -18187,7 +18205,7 @@ subtraction of the scrollbars, but not the minibuffer or bottom-most modeline, is to maintain compatibility with TTY's.) -Despite all these concerns and kludges, however, the "displayable area" +Despite all these concerns and kludges, however, the ``displayable area'' concept works well in practice and mostly ensures that by default the frame will actually fit 79 characters + continuation/truncation glyph. @@ -19836,7 +19854,7 @@ @cindex queues, event There are two event queues here -- the command event queue (#### which -should be called "deferred event queue" and is in my glyph ws) and the +should be called ``deferred event queue'' and is in my glyph ws) and the dispatch event queue. (MS Windows actually has an extra dispatch queue for non-user events and uses the generic one only for user events. This is because user and non-user events in Windows come through the same @@ -19941,7 +19959,7 @@ XEmacs calls this with an event structure which contains window-system dependent information that XEmacs doesn't need to know about, but which must happen in order. If the @code{next_event_cb} never returns an -event of type "magic", this will never be used. +event of type ``magic'', this will never be used. @item format_magic_event_cb Called with a magic event; print a representation of the innards of the @@ -19973,7 +19991,7 @@ These callbacks tell the underlying implementation to add or remove a file descriptor from the list of fds which are polled for inferior-process input. When input becomes available on the given -process connection, an event of type "process" should be generated. +process connection, an event of type ``process'' should be generated. @item select_console_cb @item unselect_console_cb @@ -20101,7 +20119,7 @@ Ben's capsule lecture on focus: In GNU Emacs @code{select-frame} never changes the window-manager frame -focus. All it does is change the "selected frame". This is similar to +focus. All it does is change the ``selected frame''. This is similar to what happens when we call @code{select-device} or @code{select-console}. Whenever an event comes in (including a keyboard event), its frame is selected; therefore, evaluating @code{select-frame} in @samp{*scratch*} @@ -20136,8 +20154,8 @@ minibuffer. GNU Emacs solves this with the crockish @code{redirect-frame-focus}, -which says "for keyboard events received from FRAME, act like they're -coming from FOCUS-FRAME". I think what this means is that, when a +which says ``for keyboard events received from FRAME, act like they're +coming from FOCUS-FRAME''. I think what this means is that, when a keyboard event comes in and the event manager is about to select the event's frame, if that frame has its focus redirected, the redirected-to frame is selected instead. That way, if you're in a minibufferless @@ -20151,8 +20169,8 @@ @code{select-frame} (but not if @code{handle-switch-frame} is called), and saves and restores the frame focus in window configurations, etc. etc. All of this logic is heavily @code{#if 0}'d, with lots of -comments saying "No, this approach doesn't seem to work, so I'm trying -this ... is it reasonable? Well, I'm not sure ..." that are a red flag +comments saying ``No, this approach doesn't seem to work, so I'm trying +this ... is it reasonable? Well, I'm not sure ...'' that are a red flag indicating crockishness. Because of our way of doing things, we can avoid all this crock. @@ -24935,22 +24953,22 @@ likelihood and a list of additional properties indicating certain features detected in the data. The extra properties returned are defined entirely by the particular coding system type and are used -only in the algorithm described below under "user control." However, +only in the algorithm described below under ``user control.'' However, the levels of likelihood have a standard meaning as follows: -Level 4 means "near certainty" and typically indicates that a +Level 4 means ``near certainty'' and typically indicates that a signature has been detected, usually at the beginning of the data, indicating that the data is encoded in this particular coding system type. An example of this would be the byte order mark at the beginning of UCS2 encoded data or the GZIP mark at the beginning of GZIP data. -Level 3 means "highly likely" and indicates that tell-tale signs have +Level 3 means ``highly likely'' and indicates that tell-tale signs have been discovered in the data that are characteristic of this particular coding system type. Examples of this might be ISO 2022 escape sequences or the current Unicode end of line markers at regular intervals. -Level 2 means "strongly statistically likely" indicating that +Level 2 means ``strongly statistically likely'' indicating that statistical analysis concludes that there's a high chance that this data is encoded according to this particular type. For example, this might mean that for UCS2 data, there is a high proportion of null bytes @@ -24959,7 +24977,7 @@ this might indicate that there were no illegal Shift-JIS sequences and a fairly high occurrence of common Shift-JIS characters. -Level 1 means "weak statistical likelihood" meaning that there is some +Level 1 means ``weak statistical likelihood'' meaning that there is some indication that the data is encoded in this coding system type. In fact, there is a reasonable chance that it may be some other type as well. This means, for example, that no illegal sequences were @@ -24967,17 +24985,17 @@ not in other coding system types. For Shift-JIS data, this might mean that some bytes in the range 128 to 159 were encountered in the data. -Level 0 means "neutral" which is to say that there's either not enough +Level 0 means ``neutral'' which is to say that there's either not enough data to make any decision or that the data could well be interpreted as this type (meaning no illegal sequences), but there is little or no indication of anything particular to this particular type. -Level -1 means "weakly unlikely" meaning that some data was +Level -1 means ``weakly unlikely'' meaning that some data was encountered that could conceivably be part of the coding system type but is probably not. For example, successively long line-lengths or very rarely-encountered sequences. -Level -2 means "strongly unlikely" meaning that typically a number +Level -2 means ``strongly unlikely'' meaning that typically a number of illegal sequences were encountered. The algorithm to determine when to stop and indicate that the data has @@ -24996,8 +25014,8 @@ subtypes). It is perfectly legal and quite common in fact, to list the same subtype more than once in the priority list with successively lower requirements. Other facts that can be listed in the priority -list for a subtype are "reject", meaning that the data should never be -detected as this subtype, or "ask", meaning that if the data is +list for a subtype are ``reject'', meaning that the data should never be +detected as this subtype, or ``ask'', meaning that if the data is detected to be this subtype, the user will be asked whether they actually mean this. This latter property could be used, for example, towards the bottom of the priority list. @@ -25014,7 +25032,7 @@ a status box somewhere. If no positive match is found according to the priority list, or if -the matches that are found have the "ask" property on them, then the +the matches that are found have the ``ask'' property on them, then the user will be presented with a list of choices of possible encodings and asked to choose one. This list is typically sorted first by level of likelihood, and then within this, by the order in which the @@ -25031,10 +25049,10 @@ which may either indicate definitely malformed data but from which it's possible to recover, or simply data that appears rather questionable. If any of these status values are reported during -decoding, the user will be informed of this and asked "are you sure?" -As part of the "are you sure" dialog box or question, the user can +decoding, the user will be informed of this and asked ``are you sure?'' +As part of the ``are you sure'' dialog box or question, the user can display the results of the decoding to make sure it's correct. If the -user says "no, they're not sure," then the same list of choices as +user says ``no, they're not sure,'' then the same list of choices as previously mentioned will be presented. @subheading RFC: Autodetection @@ -25254,7 +25272,7 @@ @item Hopefully a system general enough to handle (2)--(4) will handle these, too, but we should watch out for gotchas like -Unicode "plane 14" tags which (I think _both_ Ben and Olivier +Unicode ``plane 14'' tags which (I think _both_ Ben and Olivier will agree) have no place in the internal representation, and thus must be treated as out-of-band control sequences. I don't know if all such gotchas will be as easy to dispose of. @@ -25295,7 +25313,7 @@ like Hrvoje should have an easily available option to to this default (or an optimized approximation which t actually read the whole file into a buffer) or simply -y everything as binary (with the "font" for binary files +y everything as binary (with the ``font'' for binary files a user option). @item @@ -25404,7 +25422,7 @@ Stephen, thank you very much for writing this up. I think it is a good start, and definitely moving in the direction I would like to see things going: more -proposals, less arguing. (aka "more light, less heat") However, I have some +proposals, less arguing. (aka ``more light, less heat'') However, I have some suggestions for cleaning this up: You should try to make it more layered. For example, you might have one
--- a/man/lispref/extents.texi Fri Mar 05 04:08:17 2010 -0600 +++ b/man/lispref/extents.texi Sun Mar 07 02:09:59 2010 -0600 @@ -850,8 +850,8 @@ copied into the resulting string. @item -When @code{substring} is called on a string, the relevant extents -are copied into the resulting string. +When @code{subseq} (or its alias, @code{substring}) is called on a +string, the relevant extents are copied into the resulting string. @item When a duplicable extent is detached by @code{detach-extent} or string
--- a/man/lispref/functions.texi Fri Mar 05 04:08:17 2010 -0600 +++ b/man/lispref/functions.texi Sun Mar 07 02:09:59 2010 -0600 @@ -290,10 +290,10 @@ arguments, you get a @code{wrong-number-of-arguments} error. It is often convenient to write a function that allows certain -arguments to be omitted. For example, the function @code{substring} -accepts three arguments---a string, the start index and the end +arguments to be omitted. For example, the function @code{subseq} +accepts three arguments---a sequence, the start index and the end index---but the third argument defaults to the @var{length} of the -string if you omit it. It is also convenient for certain functions to +sequence if you omit it. It is also convenient for certain functions to accept an indefinite number of arguments, as the functions @code{list} and @code{+} do. @@ -331,8 +331,8 @@ function to distinguish between an explicit argument of @code{nil} and an omitted argument. However, the body of the function is free to consider @code{nil} an abbreviation for some other meaningful value. -This is what @code{substring} does; @code{nil} as the third argument to -@code{substring} means to use the length of the string supplied. +This is what @code{subseq} does; @code{nil} as the third argument to +@code{subseq} means to use the length of the sequence supplied. @cindex CL note---default optional arg @quotation
--- a/man/lispref/processes.texi Fri Mar 05 04:08:17 2010 -0600 +++ b/man/lispref/processes.texi Sun Mar 07 02:09:59 2010 -0600 @@ -650,7 +650,7 @@ used. If it is @code{nil}, the current buffer's process is used. Optional arguments @var{start} and @var{end} specify part of @var{string}; -see @code{substring}. +see @code{subseq}. The function returns @code{nil}.
--- a/man/lispref/strings.texi Fri Mar 05 04:08:17 2010 -0600 +++ b/man/lispref/strings.texi Sun Mar 07 02:09:59 2010 -0600 @@ -165,6 +165,10 @@ index @var{start} up to (but excluding) the character at the index @var{end}. The first character is at index zero. +In this implementation, @code{substring} is an alias for @code{subseq}, +so @var{string} can be any sequence. In GNU Emacs, @var{string} can be +a string or a vector, and in older XEmacs it can only be a string. + @example @group (substring "abcdefg" 0 3)
--- a/man/lispref/text.texi Fri Mar 05 04:08:17 2010 -0600 +++ b/man/lispref/text.texi Sun Mar 07 02:09:59 2010 -0600 @@ -2118,7 +2118,7 @@ Copying text between strings and buffers preserves the properties along with the characters; this includes such diverse functions as -@code{substring}, @code{insert}, and @code{buffer-substring}. +@code{subseq}, @code{insert}, and @code{buffer-substring}. @menu * Examining Properties:: Looking at the properties of one character.
--- a/man/lispref/tips.texi Fri Mar 05 04:08:17 2010 -0600 +++ b/man/lispref/tips.texi Sun Mar 07 02:09:59 2010 -0600 @@ -466,7 +466,7 @@ @smallexample @group (setq base-version-list ; there was a base - (assoc (substring fn 0 start-vn) ; version to which + (assoc (subseq fn 0 start-vn) ; version to which file-version-assoc-list)) ; this looks like ; a subversion @end group
--- a/man/xemacs/custom.texi Fri Mar 05 04:08:17 2010 -0600 +++ b/man/xemacs/custom.texi Sun Mar 07 02:09:59 2010 -0600 @@ -2080,6 +2080,8 @@ Change the background pixmap of the given @var{face}. @item M-x set-face-background-pixmap-file A simpler version but with filename completion. +@item M-x set-face-background-placement +Change the placement of the background pixmap of the given @var{face}. @item M-x set-face-font Change the font of the given @var{face}. @item M-x set-face-foreground @@ -2161,6 +2163,18 @@ as much control on the pixmap instantiator, but provides filename completion. +@findex set-face-background-placement +You can set the placement of the background pixmap of the specified +@var{face} with the function @code{set-face-background-placement}. The +placement argument can be either @code{absolute} or @code{relative} (the +default). A @code{relative} placement means that the pixmap is attached +to the frame and moves with it. An @code{absolute} placement means that +the pixmap is rather attached to the frame's root window, so that when +you move the frame on the screen, it will appear to ``slide'' on the +pixmap. This placement mode can be used to achieve pseudo-translucency +for a frame, for example by setting the default face's background pixmap +to the root window's one. + @findex set-face-font You can set the font of the specified @var{face} with the function @code{set-face-font}. The @var{font} argument should be a string, the
--- a/nt/ChangeLog Fri Mar 05 04:08:17 2010 -0600 +++ b/nt/ChangeLog Sun Mar 07 02:09:59 2010 -0600 @@ -1,3 +1,7 @@ +2010-03-02 Jerry James <james@xemacs.org> + + * xemacs.mak (INFO_FILES): Removed custom.info. + 2010-02-18 Vin Shelton <acs@xemacs.org> * xemacs.mak (INFO_FILES): Removed term.info.
--- a/nt/xemacs.mak Fri Mar 05 04:08:17 2010 -0600 +++ b/nt/xemacs.mak Sun Mar 07 02:09:59 2010 -0600 @@ -1488,7 +1488,6 @@ INFO_FILES= \ $(INFODIR)\beta.info \ $(INFODIR)\cl.info \ - $(INFODIR)\custom.info \ $(INFODIR)\emodules.info \ $(INFODIR)\external-widget.info \ $(INFODIR)\info.info \
--- a/src/ChangeLog Fri Mar 05 04:08:17 2010 -0600 +++ b/src/ChangeLog Sun Mar 07 02:09:59 2010 -0600 @@ -637,6 +637,363 @@ * window.c (make_dummy_parent): Create a simpler interface (ALLOC_LCRECORD) for allocating +2010-03-05 Ben Wing <ben@xemacs.org> + + * mule-coding.c: + * mule-coding.c (iso2022_encode): + Horrible bug: `escape-quoted' was failing to escape-quote special + characters in the 0x80 - 0x9F range. Who knows what breakage ensued? + SAME BUG IN XEMACS 21.4; MUST BE FIXED THERE TOO. + +2010-03-03 Ben Wing <ben@xemacs.org> + + * lrecord.h: Fix outdated comment. + +2010-03-03 Ben Wing <ben@xemacs.org> + + * emacs.c: + * emacs.c (assert_equal_failed): + * lisp.h: + * lisp.h (assert_equal): + New fun assert_equal, asserting that two values == each other, and + printing out both values upon failure. + + * frame-gtk.c (gtk_initialize_frame_size): + * frame-impl.h: + * frame-impl.h (FRAME_TOP_INTERNAL_BORDER_START): + * frame-impl.h (FRAME_BOTTOM_INTERNAL_BORDER_START): + * frame-impl.h (FRAME_LEFT_INTERNAL_BORDER_START): + * frame-impl.h (FRAME_PANED_TOP_EDGE): + * frame-impl.h (FRAME_NONPANED_SIZE): + * frame-x.c (x_initialize_frame_size): + * frame.c: + * gutter.c (get_gutter_coords): + * gutter.c (calculate_gutter_size): + * gutter.h: + * gutter.h (WINDOW_REAL_TOP_GUTTER_BOUNDS): + * gutter.h (FRAME_TOP_GUTTER_BOUNDS): + * input-method-xlib.c: + * input-method-xlib.c (XIM_SetGeometry): + * redisplay-output.c (clear_left_border): + * redisplay-output.c (clear_right_border): + * redisplay-output.c (redisplay_output_pixmap): + * redisplay-output.c (redisplay_clear_region): + * redisplay-output.c (redisplay_clear_top_of_window): + * redisplay-output.c (redisplay_clear_to_window_end): + * redisplay-xlike-inc.c (XLIKE_clear_frame): + * redisplay.c: + * redisplay.c (UPDATE_CACHE_RETURN): + * redisplay.c (pixel_to_glyph_translation): + * toolbar.c (update_frame_toolbars_geometry): + * window.c (Fwindow_pixel_edges): + Get rid of some redundant macros. Consistently use the + FRAME_TOP_*_START, FRAME_RIGHT_*_END, etc. format. Rename + FRAME_*_BORDER_* to FRAME_*_INTERNAL_BORDER_*. Comment out + FRAME_BOTTOM_* for gutters and the paned area due to the + uncertainty over where the paned area actually begins. (Eventually + we should probably move the gutters outside the minibuffer so that + the paned area is contiguous.) Use FRAME_PANED_* more often in the + code to make things clearer. + + Update the diagram to show that the bottom gutter is inside the + minibuffer (!) and that there are "junk boxes" when you have left + and/or right gutters (dead boxes that are mistakenly left uncleared, + unlike the corresponding scrollbar dead boxes). Update the text + appropriately to cover the bottom gutter position, etc. + + Rewrite gutter-geometry code to use the FRAME_*_GUTTER_* in place of + equivalent expressions referencing other frame elements, to make the + code more portable in case we move around the gutter location. + + Cleanup FRAME_*_GUTTER_BOUNDS() in gutter.h. + + Add some #### GEOM! comments where I think code is incorrect -- + typically, it wasn't fixed up properly when the gutter was added. + + Some cosmetic changes. + +2010-03-02 Ben Wing <ben@xemacs.org> + + * lisp.h: + * text.h: + Move inclusion point of text.h earlier in lisp.h -- just before + the definition of characters, which needs some of the stuff in + text.h. With text.h later, some basic character properties had to + be defined in lisp.h -- put them back into text.h where they belong. + Move some text in lisp.h at the point of text.h inclusion into + text.h -- it serves as a mini-introduction. + +2010-03-02 Ben Wing <ben@xemacs.org> + + * Makefile.in.in: + * Makefile.in.in (objs): + glyphs-shared.o, glyphs-eimage.o only needed when HAVE_WINDOW_SYSTEM. + glyphs-widget.o should be too, but we need a bit of work ifdeffing + out the subwindow stuff from redisplay.c et al. + + * bytecode.c (init_opcode_table_multi_op): + Change var name to avoid shadowing with `basename'. + + * emacs.c (main_1): + Don't call init/etc. routines for glyphs-shared, glyphs-eimage unless + HAVE_WINDOW_SYSTEM is defined. + + * linuxplay.c: + * linuxplay.c (sighandler): + * vdb-posix.c (vdb_fault_handler): + Use const for variables holding string constants to avoid C++ + warnings. + +2010-03-02 Jerry James <james@xemacs.org> + + * lread.c (read_atom): Signal a read error upon encountering a + ratio constant with a zero denominator. + +2010-03-03 Aidan Kehoe <kehoea@parhasard.net> + + * fns.c (Fsubstring): Removed. + * search.c (Freplace_match): + * minibuf.c (Ftry_completion): + * lisp.h: + * keymap.c (ensure_meta_prefix_char_keymapp): + * dired.c (user_name_completion, file_name_completion): + * console-x.c (x_canonicalize_console_connection): + * bytecode.c (Bsubseq): + * bytecode-ops.h (subseq): + Move #'substring to Lisp, as an alias for #'subseq; change all + C Fsubstring() calls to Fsubseq(), change the Bsubstring bytecode + to Bsubseq. + + Motivation; not accepting vectors in #'substring is incompatible + with GNU, and Common Lisp prefers #'subseq, it has no #'substring. + +2010-03-02 Aidan Kehoe <kehoea@parhasard.net> + + * eval.c (print_multiple_value): + Say #<INTERNAL OBJECT (XEmacs bug?) ...> when printing these, for + consistency with the rest of the print code. + +2010-03-01 Aidan Kehoe <kehoea@parhasard.net> + + * lisp.h (PARSE_KEYWORDS): New macro, for parsing keyword + arguments from C subrs. + * elhash.c (Fmake_hash_table): Use it. + * general-slots.h (Q_allow_other_keys): Add this symbol. + * eval.c (non_nil_allow_other_keys_p): + (invalid_keyword_argument): + New functions, called from the keyword argument parsing code. + * data.c (init_errors_once_early): + Add the new invalid-keyword-argument error here. + +2010-02-26 Aidan Kehoe <kehoea@parhasard.net> + + * file-coding.c (Fmake_coding_system_internal): + Be somewhat clearer in this docstring, especially for the sake of + people running non-Mule builds who will see this docstring when + they do F1 f make-coding-system RET. + +2010-02-25 Didier Verna <didier@xemacs.org> + + The background-placement face property. + * console-x-impl.h (struct x_frame): Add new slots x and y. + * console-x-impl.h (FRAME_X_X, FRAME_X_Y): New slot accessors. + * console-gtk-impl.h: Fake something similar for potential port. + * frame-x.c (x_get_frame_text_position): New function. + * frame-x.c (x_init_frame_3): Use it. + * event-Xt.c (emacs_Xt_handle_magic_event): Eat spurious + ConfigureNotify events, get the frame position and mark frame + faces changed. + * objects-impl.h: The face_background_placement_specifier + structure and its accessors. + * objects.c: New symbols Qabsolute and Qrelative. + * objects.c (face_background_placement_create): + * objects.c (face_background_placement_mark): + * objects.c (face_background_placement_instantiate): + * objects.c (face_background_placement_validate): + * objects.c (face_background_placement_after_change): + * objects.c (set_face_background_placement_attached_to): New. + * objects.h (set_face_background_palcement_attached_to): Declare + the one above. + * objects.c (syms_of_objects): + * objects.c (specifier_type_create_objects): + * objects.c (reinit_specifier_type_create_objects): + * objects.c (reinit_vars_of_objects): Update for the modifications + above. + * console-xlike-inc.h (XLIKE_GC_TS_X_ORIGIN, XLIKE_GC_TS_X_ORIGIN): + New X11/Gtk compatibility macros. + * redisplay-xlike-inc.c (XLIKE_get_gc): Add a background placement + argument and handle it. + * gtk-glue.c (face_to_gc): + * redisplay-xlike-inc.c (XLIKE_output_string): + * redisplay-xlike-inc.c (XLIKE_output_pixmap): + * redisplay-xlike-inc.c (XLIKE_output_blank): + * redisplay-xlike-inc.c (XLIKE_output_horizontal_line): + * redisplay-xlike-inc.c (XLIKE_output_eol_cursor): Update + accordingly. + * console-impl.h (struct console_methods): Add a background + placement (Lisp_Object) argument to the clear_region method. + * console-stream.c (stream_clear_region): + * redisplay-tty.c (tty_clear_region): + * redisplay-msw.c (mswindows_clear_region): + * redisplay-xlike-inc.c (XLIKE_clear_region): Update accordingly. + * redisplay-output.c (redisplay_clear_region): Handle the + background placement property and update the call to the + clear_region method. + * faces.h (struct Lisp_Face): + * faces.h (struct face_cachel): Add a background placement slot. + * faces.h (WINDOW_FACE_CACHEL_BACKGROUND_PLACEMENT): New accessor. + * faces.c (mark_face): + * faces.c (face_equal): + * faces.c (face_getprop): + * faces.c (face_putprop): + * faces.c (face_remprop): + * faces.c (face_plist): + * faces.c (reset_face): + * faces.c (mark_face_cachels): + * faces.c (update_face_cachel_data): + * faces.c (merge_face_cachel_data): + * faces.c (reset_face_cachel): + * faces.c (Fmake_face): + * faces.c (Fcopy_face): Handle the background placement property. + * faces.c (syms_of_faces): + * faces.c (vars_of_faces): + * faces.c (complex_vars_of_faces): Update accordingly. + +2010-02-25 Ben Wing <ben@xemacs.org> + + * frame-impl.h: + Create some new macros for more clearly getting the size/edges + of various rectangles surrounding the paned area. + * frame.c (change_frame_size_1): + Use the new macros. Clean up change_frame_size_1 and make sure + the internal border width gets taken into account -- that was what + was causing the clipped bottom and right. + +2010-02-25 Ben Wing <ben@xemacs.org> + + * EmacsFrame.c (EmacsFrameSetValues): + * frame-impl.h: + * frame-impl.h (struct frame): + * frame-impl.h (FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT): + * frame-impl.h (FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH): + * frame-impl.h (FRAME_REAL_TOP_TOOLBAR_HEIGHT): + * frame-impl.h (FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH): + * frame-impl.h (FRAME_REAL_TOP_TOOLBAR_VISIBLE): + * frame-impl.h (FRAME_REAL_TOP_TOOLBAR_BOUNDS): + * frame.h: + * frame.h (enum edge_pos): + * gutter.c: + * gutter.c (get_gutter_coords): + * gutter.c (display_boxes_in_gutter_p): + * gutter.c (construct_window_gutter_spec): + * gutter.c (calculate_gutter_size_from_display_lines): + * gutter.c (calculate_gutter_size): + * gutter.c (output_gutter): + * gutter.c (clear_gutter): + * gutter.c (mark_gutters): + * gutter.c (gutter_extent_signal_changed_region_maybe): + * gutter.c (update_gutter_geometry): + * gutter.c (update_frame_gutter_geometry): + * gutter.c (update_frame_gutters): + * gutter.c (reset_gutter_display_lines): + * gutter.c (redraw_exposed_gutter): + * gutter.c (redraw_exposed_gutters): + * gutter.c (free_frame_gutters): + * gutter.c (decode_gutter_position): + * gutter.c (Fset_default_gutter_position): + * gutter.c (Fgutter_pixel_width): + * gutter.c (Fgutter_pixel_height): + * gutter.c (recompute_overlaying_specifier): + * gutter.c (gutter_specs_changed_1): + * gutter.c (gutter_specs_changed): + * gutter.c (top_gutter_specs_changed): + * gutter.c (bottom_gutter_specs_changed): + * gutter.c (left_gutter_specs_changed): + * gutter.c (right_gutter_specs_changed): + * gutter.c (gutter_geometry_changed_in_window): + * gutter.c (init_frame_gutters): + * gutter.c (specifier_vars_of_gutter): + * gutter.h: + * gutter.h (WINDOW_REAL_TOP_GUTTER_BOUNDS): + * gutter.h (FRAME_TOP_GUTTER_BOUNDS): + * lisp.h (enum edge_style): + * native-gtk-toolbar.c: + * native-gtk-toolbar.c (gtk_output_toolbar): + * native-gtk-toolbar.c (gtk_clear_toolbar): + * native-gtk-toolbar.c (gtk_output_frame_toolbars): + * native-gtk-toolbar.c (gtk_initialize_frame_toolbars): + * toolbar-msw.c: + * toolbar-msw.c (TOOLBAR_HANDLE): + * toolbar-msw.c (allocate_toolbar_item_id): + * toolbar-msw.c (mswindows_clear_toolbar): + * toolbar-msw.c (mswindows_output_toolbar): + * toolbar-msw.c (mswindows_move_toolbar): + * toolbar-msw.c (mswindows_redraw_exposed_toolbars): + * toolbar-msw.c (mswindows_initialize_frame_toolbars): + * toolbar-msw.c (mswindows_output_frame_toolbars): + * toolbar-msw.c (mswindows_clear_frame_toolbars): + * toolbar-msw.c (DELETE_TOOLBAR): + * toolbar-msw.c (mswindows_free_frame_toolbars): + * toolbar-msw.c (mswindows_get_toolbar_button_text): + * toolbar-xlike.c: + * toolbar-xlike.c (__prepare_button_area): + * toolbar-xlike.c (XLIKE_OUTPUT_BUTTONS_LOOP): + * toolbar-xlike.c (xlike_output_toolbar): + * toolbar-xlike.c (xlike_clear_toolbar): + * toolbar-xlike.c (xlike_output_frame_toolbars): + * toolbar-xlike.c (xlike_clear_frame_toolbars): + * toolbar-xlike.c (xlike_redraw_exposed_toolbar): + * toolbar-xlike.c (xlike_redraw_exposed_toolbars): + * toolbar-xlike.c (xlike_redraw_frame_toolbars): + * toolbar.c: + * toolbar.c (decode_toolbar_position): + * toolbar.c (Fset_default_toolbar_position): + * toolbar.c (mark_frame_toolbar_buttons_dirty): + * toolbar.c (compute_frame_toolbar_buttons): + * toolbar.c (set_frame_toolbar): + * toolbar.c (compute_frame_toolbars_data): + * toolbar.c (update_frame_toolbars_geometry): + * toolbar.c (init_frame_toolbars): + * toolbar.c (get_toolbar_coords): + * toolbar.c (CHECK_TOOLBAR): + * toolbar.c (toolbar_buttons_at_pixpos): + * toolbar.c (CTB_ERROR): + * toolbar.c (recompute_overlaying_specifier): + * toolbar.c (specifier_vars_of_toolbar): + * toolbar.h: + * toolbar.h (SET_TOOLBAR_WAS_VISIBLE_FLAG): + Create new enum edge_pos with TOP_EDGE, BOTTOM_EDGE, LEFT_EDGE, + RIGHT_EDGE; subsume TOP_BORDER, TOP_GUTTER, enum toolbar_pos, + enum gutter_pos, etc. + + Create EDGE_POS_LOOP, subsuming GUTTER_POS_LOOP. + + Create NUM_EDGES, use in many places instead of hardcoded '4'. + + Instead of top_toolbar_was_visible, bottom_toolbar_was_visible, + etc. make an array toolbar_was_visible[NUM_EDGES]. This increases + the frame size by 15 bytes or so (could be 3 if we use Boolbytes) + but hardly seems w to matter -- frames are heavy weight objects + anyway. Same with top_gutter_was_visible, etc. + + Remove duplicated SET_TOOLBAR_WAS_VISIBLE_FLAG and put defn in + one place (toolbar.h). + +2010-02-24 Didier Verna <didier@xemacs.org> + + Modify XLIKE_get_gc's prototype. + * redisplay-xlike-inc.c (XLIKE_get_gc): Take a frame instead of a + device as first argument. + * redisplay-xlike-inc.c (XLIKE_output_string): Update caller. + * redisplay-xlike-inc.c (XLIKE_output_pixmap): Ditto. + * redisplay-xlike-inc.c (XLIKE_output_blank): Ditto. + * redisplay-xlike-inc.c (XLIKE_output_horizontal_line): Ditto. + * redisplay-xlike-inc.c (XLIKE_clear_region): Ditto. + * redisplay-xlike-inc.c (XLIKE_output_eol_cursor): Ditto. + * console-gtk.h (gtk_get_gc): Take a frame instead of a device as + first argument. + * gtk-glue.c (face_to_gc): Update caller. + 2010-02-24 Didier Verna <didier@xemacs.org> * glyphs.c: Clarify comment about potential_pixmap_file_instantiator.
--- a/src/EmacsFrame.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/EmacsFrame.c Sun Mar 07 02:09:59 2010 -0600 @@ -411,49 +411,49 @@ if (cur->emacs_frame.top_toolbar_height != new_->emacs_frame.top_toolbar_height) Fadd_spec_to_specifier - (Vtoolbar_size[TOP_TOOLBAR], + (Vtoolbar_size[TOP_EDGE], make_int (new_->emacs_frame.top_toolbar_height), wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.bottom_toolbar_height != new_->emacs_frame.bottom_toolbar_height) Fadd_spec_to_specifier - (Vtoolbar_size[BOTTOM_TOOLBAR], + (Vtoolbar_size[BOTTOM_EDGE], make_int (new_->emacs_frame.bottom_toolbar_height), wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.left_toolbar_width != new_->emacs_frame.left_toolbar_width) Fadd_spec_to_specifier - (Vtoolbar_size[LEFT_TOOLBAR], + (Vtoolbar_size[LEFT_EDGE], make_int (new_->emacs_frame.left_toolbar_width), wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.right_toolbar_width != new_->emacs_frame.right_toolbar_width) Fadd_spec_to_specifier - (Vtoolbar_size[RIGHT_TOOLBAR], + (Vtoolbar_size[RIGHT_EDGE], make_int (new_->emacs_frame.right_toolbar_width), wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.top_toolbar_border_width != new_->emacs_frame.top_toolbar_border_width) Fadd_spec_to_specifier - (Vtoolbar_border_width[TOP_TOOLBAR], + (Vtoolbar_border_width[TOP_EDGE], make_int (new_->emacs_frame.top_toolbar_border_width), wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.bottom_toolbar_border_width != new_->emacs_frame.bottom_toolbar_border_width) Fadd_spec_to_specifier - (Vtoolbar_border_width[BOTTOM_TOOLBAR], + (Vtoolbar_border_width[BOTTOM_EDGE], make_int (new_->emacs_frame.bottom_toolbar_border_width), wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.left_toolbar_border_width != new_->emacs_frame.left_toolbar_border_width) Fadd_spec_to_specifier - (Vtoolbar_border_width[LEFT_TOOLBAR], + (Vtoolbar_border_width[LEFT_EDGE], make_int (new_->emacs_frame.left_toolbar_border_width), wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.right_toolbar_border_width != new_->emacs_frame.right_toolbar_border_width) Fadd_spec_to_specifier - (Vtoolbar_border_width[RIGHT_TOOLBAR], + (Vtoolbar_border_width[RIGHT_EDGE], make_int (new_->emacs_frame.right_toolbar_border_width), wrap_frame (f), Qnil, Qnil); #endif /* HAVE_TOOLBARS */
--- a/src/Makefile.in.in Fri Mar 05 04:08:17 2010 -0600 +++ b/src/Makefile.in.in Sun Mar 07 02:09:59 2010 -0600 @@ -183,6 +183,10 @@ event_unixoid_objs=event-unixoid.o #endif +#ifdef HAVE_WINDOW_SYSTEM +glyphs_objs=glyphs-eimage.o glyphs-shared.o +#endif + #ifdef HAVE_GPM gpm_objs=gpmevent.o #endif @@ -281,8 +285,8 @@ event-stream.o $(event_unixoid_objs) $(extra_objs) extents.o\ faces.o file-coding.o fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o \ font-lock.o frame.o\ - gc.o general.o glyphs.o glyphs-eimage.o glyphs-shared.o\ - glyphs-widget.o $(gpm_objs) $(gtk_objs) $(gtk_gui_objs) $(gui_objs) \ + gc.o general.o glyphs.o $(glyphs_objs) glyphs-widget.o \ + $(gpm_objs) $(gtk_objs) $(gtk_gui_objs) $(gui_objs) \ gutter.o\ hash.o imgproc.o indent.o insdel.o intl.o\ keymap.o $(RTC_patch_objs) line-number.o $(ldap_objs) lread.o lstream.o\
--- a/src/bytecode-ops.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/bytecode-ops.h Sun Mar 07 02:09:59 2010 -0600 @@ -57,7 +57,7 @@ OPCODE (set, 0114) OPCODE (fset, 0115) OPCODE (get, 0116) - OPCODE (substring, 0117) + OPCODE (subseq, 0117) OPCODE (concat2, 0120) OPCODE (concat3, 0121) OPCODE (concat4, 0122)
--- a/src/bytecode.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/bytecode.c Sun Mar 07 02:09:59 2010 -0600 @@ -1571,11 +1571,11 @@ break; } - case Bsubstring: + case Bsubseq: { Lisp_Object arg2 = POP; Lisp_Object arg1 = POP; - TOP_LVALUE = Fsubstring (TOP, arg1, arg2); + TOP_LVALUE = Fsubseq (TOP, arg1, arg2); break; } @@ -2820,14 +2820,14 @@ static void init_opcode_table_multi_op (Opcode op) { - const Ascbyte *basename = opcode_name_table[op]; + const Ascbyte *base = opcode_name_table[op]; Ascbyte temp[300]; int i; for (i = 1; i < 7; i++) { assert (!opcode_name_table[op + i]); - sprintf (temp, "%s+%d", basename, i); + sprintf (temp, "%s+%d", base, i); opcode_name_table[op + i] = xstrdup (temp); } }
--- a/src/console-gtk-impl.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/console-gtk-impl.h Sun Mar 07 02:09:59 2010 -0600 @@ -159,6 +159,11 @@ /* The widget of the edit portion of this frame; this is a GtkDrawingArea, and the window of this widget is what the redisplay code draws on. */ GtkWidget *edit_widget; + /* #### WARNING: this does not currently work. -- dvl + Position of the edit widget above, for absolute background placement. + + int x, y; + */ /* Lists the widgets above the text area, in the proper order. */ GtkWidget *top_widgets[MAX_CONCURRENT_TOP_WIDGETS]; @@ -213,6 +218,10 @@ #define FRAME_GTK_DATA(f) FRAME_TYPE_DATA (f, gtk) +/* #### WARNING: this does not currently work. -- dvl + #define FRAME_GTK_X(f) (FRAME_GTK_DATA (f)->x) + #define FRAME_GTK_Y(f) (FRAME_GTK_DATA (f)->y) +*/ #define FRAME_GTK_SHELL_WIDGET(f) (FRAME_GTK_DATA (f)->widget) #define FRAME_GTK_CONTAINER_WIDGET(f) (FRAME_GTK_DATA (f)->container) #define FRAME_GTK_MENUBAR_WIDGET(f) (FRAME_GTK_DATA (f)->menubar_widget)
--- a/src/console-gtk.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/console-gtk.h Sun Mar 07 02:09:59 2010 -0600 @@ -64,7 +64,8 @@ int start_pixpos, int width, face_index findex, int cursor, int cursor_start, int cursor_width, int cursor_height); -GdkGC *gtk_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg, +GdkGC *gtk_get_gc (struct frame *f, + Lisp_Object font, Lisp_Object fg, Lisp_Object bg, Lisp_Object bg_pmap, Lisp_Object lwidth); int gtk_initialize_frame_menubar (struct frame *f);
--- a/src/console-impl.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/console-impl.h Sun Mar 07 02:09:59 2010 -0600 @@ -153,9 +153,10 @@ int (*eol_cursor_width_method) (void); void (*output_vertical_divider_method) (struct window *, int); void (*clear_to_window_end_method) (struct window *, int, int); - void (*clear_region_method) (Lisp_Object, struct device*, struct frame*, face_index, - int, int, int, int, - Lisp_Object, Lisp_Object, Lisp_Object); + void (*clear_region_method) (Lisp_Object, struct device*, struct frame*, + face_index, int, int, int, int, + Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object); void (*clear_frame_method) (struct frame *); void (*window_output_begin_method) (struct window *); void (*frame_output_begin_method) (struct frame *);
--- a/src/console-stream.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/console-stream.c Sun Mar 07 02:09:59 2010 -0600 @@ -280,7 +280,8 @@ int UNUSED (x), int UNUSED (y), int UNUSED (width), int UNUSED (height), Lisp_Object UNUSED (fcolor), Lisp_Object UNUSED (bcolor), - Lisp_Object UNUSED (background_pixmap)) + Lisp_Object UNUSED (background_pixmap), + Lisp_Object UNUSED (background_placement)) { ABORT (); }
--- a/src/console-x-impl.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/console-x-impl.h Sun Mar 07 02:09:59 2010 -0600 @@ -2,6 +2,7 @@ Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1996, 2002, 2003 Ben Wing. + Copyright (C) 2010 Didier Verna This file is part of XEmacs. @@ -265,6 +266,8 @@ /* The widget of the edit portion of this frame; this is an EmacsFrame, and the window of this widget is what the redisplay code draws on. */ Widget edit_widget; + /* Position of the edit widget above, for absolute background placement. */ + int x, y; /* Lists the widgets above the text area, in the proper order. Used by the EmacsManager. */ @@ -360,6 +363,8 @@ #endif /* NEW_GC */ #define FRAME_X_DATA(f) FRAME_TYPE_DATA (f, x) +#define FRAME_X_X(f) (FRAME_X_DATA (f)->x) +#define FRAME_X_Y(f) (FRAME_X_DATA (f)->y) #define FRAME_X_SHELL_WIDGET(f) (FRAME_X_DATA (f)->widget) #define FRAME_X_CONTAINER_WIDGET(f) (FRAME_X_DATA (f)->container) #define FRAME_X_MENUBAR_WIDGET(f) (FRAME_X_DATA (f)->menubar_widget) @@ -407,6 +412,8 @@ extern struct console_type *x_console_type; +void x_get_frame_text_position (struct frame *); + #endif /* HAVE_X_WINDOWS */ #endif /* INCLUDED_console_x_impl_h_ */
--- a/src/console-x.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/console-x.c Sun Mar 07 02:09:59 2010 -0600 @@ -240,7 +240,7 @@ split_up_display_spec (connection, &hostname_length, &display_length, &screen_length); - hostname = Fsubstring (connection, Qzero, make_int (hostname_length)); + hostname = Fsubseq (connection, Qzero, make_int (hostname_length)); hostname = canonicalize_host_name (hostname); connection = concat2 (hostname, make_string (XSTRING_DATA (connection)
--- a/src/console-xlike-inc.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/console-xlike-inc.h Sun Mar 07 02:09:59 2010 -0600 @@ -169,6 +169,8 @@ #define XLIKE_GC_LINE_WIDTH GCLineWidth #define XLIKE_GC_STIPPLE GCStipple #define XLIKE_GC_TILE GCTile +#define XLIKE_GC_TS_X_ORIGIN GCTileStipXOrigin +#define XLIKE_GC_TS_Y_ORIGIN GCTileStipYOrigin #define XLIKE_GX_COPY GXcopy #define XLIKE_GX_XOR GXxor @@ -258,6 +260,8 @@ #define XLIKE_GC_LINE_WIDTH GDK_GC_LINE_WIDTH #define XLIKE_GC_STIPPLE GDK_GC_STIPPLE #define XLIKE_GC_TILE GDK_GC_TILE +#define XLIKE_GC_TS_X_ORIGIN GDK_GC_TS_X_ORIGIN +#define XLIKE_GC_TS_Y_ORIGIN GDK_GC_TS_Y_ORIGIN #define XLIKE_GX_COPY GDK_COPY #define XLIKE_GX_XOR GDK_XOR
--- a/src/data.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/data.c Sun Mar 07 02:09:59 2010 -0600 @@ -41,7 +41,8 @@ Lisp_Object Qcircular_list, Qcircular_property_list; Lisp_Object Qinvalid_argument, Qinvalid_constant, Qwrong_type_argument; Lisp_Object Qargs_out_of_range; -Lisp_Object Qwrong_number_of_arguments, Qinvalid_function, Qno_catch; +Lisp_Object Qwrong_number_of_arguments, Qinvalid_function; +Lisp_Object Qinvalid_keyword_argument, Qno_catch; Lisp_Object Qinternal_error, Qinvalid_state, Qstack_overflow, Qout_of_memory; Lisp_Object Qvoid_variable, Qcyclic_variable_indirection; Lisp_Object Qvoid_function, Qcyclic_function_indirection; @@ -3463,6 +3464,7 @@ DEFERROR_STANDARD (Qwrong_number_of_arguments, Qinvalid_argument); DEFERROR_STANDARD (Qinvalid_function, Qinvalid_argument); DEFERROR_STANDARD (Qinvalid_constant, Qinvalid_argument); + DEFERROR_STANDARD (Qinvalid_keyword_argument, Qinvalid_argument); DEFERROR (Qno_catch, "No catch for tag", Qinvalid_argument); DEFERROR_STANDARD (Qinvalid_state, Qerror);
--- a/src/dired.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/dired.c Sun Mar 07 02:09:59 2010 -0600 @@ -508,7 +508,7 @@ return bestmatch; if (matchcount == 1 && bestmatchsize == file_name_length) return Qt; - return Fsubstring (bestmatch, Qzero, make_int (bestmatchsize)); + return Fsubseq (bestmatch, Qzero, make_int (bestmatchsize)); } @@ -772,7 +772,7 @@ return bestmatch; if (matchcount == 1 && bestmatchsize == user_name_length) return Qt; - return Fsubstring (bestmatch, Qzero, make_int (bestmatchsize)); + return Fsubseq (bestmatch, Qzero, make_int (bestmatchsize)); }
--- a/src/elhash.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/elhash.c Sun Mar 07 02:09:59 2010 -0600 @@ -84,7 +84,7 @@ #include "opaque.h" Lisp_Object Qhash_tablep; -static Lisp_Object Qhashtable, Qhash_table; +static Lisp_Object Qhashtable, Qhash_table, Qmake_hash_table; static Lisp_Object Qweakness, Qvalue, Qkey_or_value, Qkey_and_value; static Lisp_Object Vall_weak_hash_tables; static Lisp_Object Qrehash_size, Qrehash_threshold; @@ -989,29 +989,27 @@ */ (int nargs, Lisp_Object *args)) { - int i = 0; - Lisp_Object test = Qnil; - Lisp_Object size = Qnil; - Lisp_Object rehash_size = Qnil; - Lisp_Object rehash_threshold = Qnil; - Lisp_Object weakness = Qnil; - - while (i + 1 < nargs) - { - Lisp_Object keyword = args[i++]; - Lisp_Object value = args[i++]; +#ifdef NO_NEED_TO_HANDLE_21_4_CODE + PARSE_KEYWORDS (Qmake_hash_table, nargs, args, 0, 5, + (test, size, rehash_size, rehash_threshold, weakness), + NULL, weakness = Qunbound), 0); +#else + PARSE_KEYWORDS (Qmake_hash_table, nargs, args, 0, 6, + (test, size, rehash_size, rehash_threshold, weakness, + type), (type = Qunbound, weakness = Qunbound), 0); - if (EQ (keyword, Q_test)) test = value; - else if (EQ (keyword, Q_size)) size = value; - else if (EQ (keyword, Q_rehash_size)) rehash_size = value; - else if (EQ (keyword, Q_rehash_threshold)) rehash_threshold = value; - else if (EQ (keyword, Q_weakness)) weakness = value; - else if (EQ (keyword, Q_type))/*obsolete*/ weakness = value; - else invalid_constant ("Invalid hash table property keyword", keyword); + if (EQ (weakness, Qunbound)) + { + if (EQ (weakness, Qunbound) && !EQ (type, Qunbound)) + { + weakness = type; + } + else + { + weakness = Qnil; + } } - - if (i < nargs) - sferror ("Hash table property requires a value", args[i]); +#endif #define VALIDATE_VAR(var) \ if (!NILP (var)) hash_table_##var##_validate (Q##var, var, ERROR_ME); @@ -1834,6 +1832,7 @@ DEFSYMBOL_MULTIWORD_PREDICATE (Qhash_tablep); DEFSYMBOL (Qhash_table); DEFSYMBOL (Qhashtable); + DEFSYMBOL (Qmake_hash_table); DEFSYMBOL (Qweakness); DEFSYMBOL (Qvalue); DEFSYMBOL (Qkey_or_value);
--- a/src/emacs.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/emacs.c Sun Mar 07 02:09:59 2010 -0600 @@ -1538,8 +1538,10 @@ syms_of_frame (); syms_of_general (); syms_of_glyphs (); +#ifdef HAVE_WINDOW_SYSTEM syms_of_glyphs_eimage (); syms_of_glyphs_shared (); +#endif syms_of_glyphs_widget (); syms_of_gui (); syms_of_gutter (); @@ -1873,7 +1875,9 @@ called before the any calls to the other macros. */ image_instantiator_format_create (); +#ifdef HAVE_WINDOW_SYSTEM image_instantiator_format_create_glyphs_eimage (); +#endif image_instantiator_format_create_glyphs_widget (); #ifdef HAVE_TTY image_instantiator_format_create_glyphs_tty (); @@ -2104,7 +2108,9 @@ vars_of_frame (); vars_of_gc (); vars_of_glyphs (); +#ifdef HAVE_WINDOW_SYSTEM vars_of_glyphs_eimage (); +#endif vars_of_glyphs_widget (); vars_of_gui (); vars_of_gutter (); @@ -4055,6 +4061,20 @@ in_assert_failed--; } +/* This is called when an assert() fails or when ABORT() is called -- both + of those are defined in the preprocessor to an expansion involving + assert_failed(). */ +void +assert_equal_failed (const Ascbyte *file, int line, EMACS_INT x, EMACS_INT y, + const Ascbyte *exprx, const Ascbyte *expry) +{ + Ascbyte bigstr[1000]; /* #### Could overflow, but avoids any need to do any + allocation, even alloca(), hence safer */ + sprintf (bigstr, "%s (%ld) should == %s (%ld) but doesn't", + exprx, x, expry, y); + assert_failed (file, line, bigstr); +} + /* -------------------------------------- */ /* low-memory notification */ /* -------------------------------------- */
--- a/src/eval.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/eval.c Sun Mar 07 02:09:59 2010 -0600 @@ -418,6 +418,29 @@ static Lisp_Object maybe_get_trapping_problems_backtrace (void); + +/* When parsing keyword arguments; is some element of NARGS + :allow-other-keys, and is that element followed by a non-nil Lisp + object? */ + +Boolint +non_nil_allow_other_keys_p (Elemcount offset, int nargs, Lisp_Object *args) +{ + Lisp_Object key, value; + while (offset + 1 < nargs) + { + key = args[offset++]; + value = args[offset++]; + if (EQ (key, Q_allow_other_keys)) + { + /* The ANSI Common Lisp standard says the first value for a given + keyword overrides. */ + return !NILP (value); + } + } + return 0; +} + /************************************************************************/ /* The subr object type */ /************************************************************************/ @@ -3049,6 +3072,12 @@ } DOESNT_RETURN +invalid_keyword_argument (Lisp_Object function, Lisp_Object keyword) +{ + signal_error_1 (Qinvalid_keyword_argument, list2 (function, keyword)); +} + +DOESNT_RETURN invalid_constant (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qinvalid_constant, reason, frob); @@ -4579,10 +4608,9 @@ printing_unreadable_object ("multiple values"); } - if (0 == count) - { - write_msg_string (printcharfun, "#<zero-length multiple value>"); - } + write_fmt_string (printcharfun, + "#<INTERNAL OBJECT (XEmacs bug?) %d multiple values," + " data (", count); for (index = 0; index < count;) { @@ -4603,9 +4631,11 @@ if (count > 1 && index < count) { - write_ascstring (printcharfun, " ;\n"); + write_ascstring (printcharfun, " "); } } + + write_fmt_string (printcharfun, ") 0x%lx>", (unsigned long) XPNTR (obj)); } static Lisp_Object
--- a/src/event-Xt.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/event-Xt.c Sun Mar 07 02:09:59 2010 -0600 @@ -2,6 +2,7 @@ Copyright (C) 1991-5, 1997 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. Copyright (C) 1996, 2001, 2002, 2003, 2010 Ben Wing. + Copyright (C) 2010 Didier Verna This file is part of XEmacs. @@ -1898,6 +1899,25 @@ break; case ConfigureNotify: + { + XEvent xev; + + /* Let's eat all events of that type to avoid useless + reconfigurations. */ + while (XCheckTypedWindowEvent + (DEVICE_X_DISPLAY (XDEVICE (FRAME_DEVICE (f))), + XtWindow (FRAME_X_TEXT_WIDGET (f)), + ConfigureNotify, + &xev) + == True); + } + /* #### NOTE: in fact, the frame faces didn't really change, but if some + #### of them have their background-placement property set to + #### absolute, we need a redraw. This is semantically equivalent to + #### changing the background pixmap. -- dvl */ + x_get_frame_text_position (f); + MARK_FRAME_FACES_CHANGED (f); + #ifdef HAVE_XIM XIM_SetGeometry (f); #endif
--- a/src/faces.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/faces.c Sun Mar 07 02:09:59 2010 -0600 @@ -3,6 +3,7 @@ Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995, 1996, 2001, 2002, 2005, 2010 Ben Wing. Copyright (C) 1995 Sun Microsystems, Inc. + Copyright (C) 2010 Didier Verna This file is part of XEmacs. @@ -42,7 +43,7 @@ Lisp_Object Qfacep; Lisp_Object Qforeground, Qbackground, Qdisplay_table; -Lisp_Object Qbackground_pixmap, Qunderline, Qdim; +Lisp_Object Qbackground_pixmap, Qbackground_placement, Qunderline, Qdim; Lisp_Object Qblinking, Qstrikethru; Lisp_Object Qinit_face_from_resources; @@ -111,6 +112,7 @@ mark_object (face->font); mark_object (face->display_table); mark_object (face->background_pixmap); + mark_object (face->background_placement); mark_object (face->underline); mark_object (face->strikethru); mark_object (face->highlight); @@ -162,6 +164,9 @@ internal_equal (f1->font, f2->font, depth) && internal_equal (f1->display_table, f2->display_table, depth) && internal_equal (f1->background_pixmap, f2->background_pixmap, depth) && + internal_equal (f1->background_placement, + f2->background_placement, + depth) && internal_equal (f1->underline, f2->underline, depth) && internal_equal (f1->strikethru, f2->strikethru, depth) && internal_equal (f1->highlight, f2->highlight, depth) && @@ -192,18 +197,19 @@ Lisp_Face *f = XFACE (obj); return - (EQ (prop, Qforeground) ? f->foreground : - EQ (prop, Qbackground) ? f->background : - EQ (prop, Qfont) ? f->font : - EQ (prop, Qdisplay_table) ? f->display_table : - EQ (prop, Qbackground_pixmap) ? f->background_pixmap : - EQ (prop, Qunderline) ? f->underline : - EQ (prop, Qstrikethru) ? f->strikethru : - EQ (prop, Qhighlight) ? f->highlight : - EQ (prop, Qdim) ? f->dim : - EQ (prop, Qblinking) ? f->blinking : - EQ (prop, Qreverse) ? f->reverse : - EQ (prop, Qdoc_string) ? f->doc_string : + (EQ (prop, Qforeground) ? f->foreground : + EQ (prop, Qbackground) ? f->background : + EQ (prop, Qfont) ? f->font : + EQ (prop, Qdisplay_table) ? f->display_table : + EQ (prop, Qbackground_pixmap) ? f->background_pixmap : + EQ (prop, Qbackground_placement) ? f->background_placement : + EQ (prop, Qunderline) ? f->underline : + EQ (prop, Qstrikethru) ? f->strikethru : + EQ (prop, Qhighlight) ? f->highlight : + EQ (prop, Qdim) ? f->dim : + EQ (prop, Qblinking) ? f->blinking : + EQ (prop, Qreverse) ? f->reverse : + EQ (prop, Qdoc_string) ? f->doc_string : external_plist_get (&f->plist, prop, 0, ERROR_ME)); } @@ -212,16 +218,17 @@ { Lisp_Face *f = XFACE (obj); - if (EQ (prop, Qforeground) || - EQ (prop, Qbackground) || - EQ (prop, Qfont) || - EQ (prop, Qdisplay_table) || - EQ (prop, Qbackground_pixmap) || - EQ (prop, Qunderline) || - EQ (prop, Qstrikethru) || - EQ (prop, Qhighlight) || - EQ (prop, Qdim) || - EQ (prop, Qblinking) || + if (EQ (prop, Qforeground) || + EQ (prop, Qbackground) || + EQ (prop, Qfont) || + EQ (prop, Qdisplay_table) || + EQ (prop, Qbackground_pixmap) || + EQ (prop, Qbackground_placement) || + EQ (prop, Qunderline) || + EQ (prop, Qstrikethru) || + EQ (prop, Qhighlight) || + EQ (prop, Qdim) || + EQ (prop, Qblinking) || EQ (prop, Qreverse)) return 0; @@ -242,16 +249,17 @@ { Lisp_Face *f = XFACE (obj); - if (EQ (prop, Qforeground) || - EQ (prop, Qbackground) || - EQ (prop, Qfont) || - EQ (prop, Qdisplay_table) || - EQ (prop, Qbackground_pixmap) || - EQ (prop, Qunderline) || - EQ (prop, Qstrikethru) || - EQ (prop, Qhighlight) || - EQ (prop, Qdim) || - EQ (prop, Qblinking) || + if (EQ (prop, Qforeground) || + EQ (prop, Qbackground) || + EQ (prop, Qfont) || + EQ (prop, Qdisplay_table) || + EQ (prop, Qbackground_pixmap) || + EQ (prop, Qbackground_placement) || + EQ (prop, Qunderline) || + EQ (prop, Qstrikethru) || + EQ (prop, Qhighlight) || + EQ (prop, Qdim) || + EQ (prop, Qblinking) || EQ (prop, Qreverse)) return -1; @@ -270,17 +278,18 @@ Lisp_Face *face = XFACE (obj); Lisp_Object result = face->plist; - result = cons3 (Qreverse, face->reverse, result); - result = cons3 (Qblinking, face->blinking, result); - result = cons3 (Qdim, face->dim, result); - result = cons3 (Qhighlight, face->highlight, result); - result = cons3 (Qstrikethru, face->strikethru, result); - result = cons3 (Qunderline, face->underline, result); - result = cons3 (Qbackground_pixmap, face->background_pixmap, result); - result = cons3 (Qdisplay_table, face->display_table, result); - result = cons3 (Qfont, face->font, result); - result = cons3 (Qbackground, face->background, result); - result = cons3 (Qforeground, face->foreground, result); + result = cons3 (Qreverse, face->reverse, result); + result = cons3 (Qblinking, face->blinking, result); + result = cons3 (Qdim, face->dim, result); + result = cons3 (Qhighlight, face->highlight, result); + result = cons3 (Qstrikethru, face->strikethru, result); + result = cons3 (Qunderline, face->underline, result); + result = cons3 (Qbackground_placement, face->background_placement, result); + result = cons3 (Qbackground_pixmap, face->background_pixmap, result); + result = cons3 (Qdisplay_table, face->display_table, result); + result = cons3 (Qfont, face->font, result); + result = cons3 (Qbackground, face->background, result); + result = cons3 (Qforeground, face->foreground, result); return result; } @@ -293,6 +302,7 @@ { XD_LISP_OBJECT, offsetof (Lisp_Face, font) }, { XD_LISP_OBJECT, offsetof (Lisp_Face, display_table) }, { XD_LISP_OBJECT, offsetof (Lisp_Face, background_pixmap) }, + { XD_LISP_OBJECT, offsetof (Lisp_Face, background_placement) }, { XD_LISP_OBJECT, offsetof (Lisp_Face, underline) }, { XD_LISP_OBJECT, offsetof (Lisp_Face, strikethru) }, { XD_LISP_OBJECT, offsetof (Lisp_Face, highlight) }, @@ -386,6 +396,7 @@ f->font = Qnil; f->display_table = Qnil; f->background_pixmap = Qnil; + f->background_placement = Qnil; f->underline = Qnil; f->strikethru = Qnil; f->highlight = Qnil; @@ -846,6 +857,8 @@ set_font_attached_to (f->font, face, Qfont); f->background_pixmap = Fmake_specifier (Qimage); set_image_attached_to (f->background_pixmap, face, Qbackground_pixmap); + f->background_placement = Fmake_specifier (Qface_background_placement); + set_face_background_placement_attached_to (f->background_placement, face); f->display_table = Fmake_specifier (Qdisplay_table); f->underline = Fmake_specifier (Qface_boolean); set_face_boolean_attached_to (f->underline, face, Qunderline); @@ -874,6 +887,9 @@ set_specifier_fallback (f->background_pixmap, Fget (Vdefault_face, Qbackground_pixmap, Qunbound)); + set_specifier_fallback (f->background_placement, + Fget (Vdefault_face, Qbackground_placement, + Qunbound)); set_specifier_fallback (f->display_table, Fget (Vdefault_face, Qdisplay_table, Qunbound)); set_specifier_fallback (f->underline, @@ -1068,6 +1084,7 @@ mark_object (cachel->background); mark_object (cachel->display_table); mark_object (cachel->background_pixmap); + mark_object (cachel->background_placement); } } @@ -1424,6 +1441,9 @@ FROB (background_pixmap); MAYBE_UNFROB_BACKGROUND_PIXMAP; } + + FROB (background_placement); + #undef FROB #undef MAYBE_UNFROB_BACKGROUND_PIXMAP @@ -1487,6 +1507,7 @@ FROB (background); FROB (display_table); FROB (background_pixmap); + FROB (background_placement); FROB (underline); FROB (strikethru); FROB (highlight); @@ -1537,6 +1558,7 @@ } cachel->display_table = Qunbound; cachel->background_pixmap = Qunbound; + cachel->background_placement = Qunbound; FACE_CACHEL_FONT_SPECIFIED (cachel)->size = sizeof(cachel->font_specified); FACE_CACHEL_FONT_UPDATED (cachel)->size = sizeof(cachel->font_updated); } @@ -1902,8 +1924,8 @@ /* If the locale could affect the frame value, then call update_EmacsFrames just in case. */ if (default_face && - (EQ (property, Qforeground) || - EQ (property, Qbackground) || + (EQ (property, Qforeground) || + EQ (property, Qbackground) || EQ (property, Qfont))) update_EmacsFrames (locale, property); @@ -1997,6 +2019,7 @@ COPY_PROPERTY (font); COPY_PROPERTY (display_table); COPY_PROPERTY (background_pixmap); + COPY_PROPERTY (background_placement); COPY_PROPERTY (underline); COPY_PROPERTY (strikethru); COPY_PROPERTY (highlight); @@ -2127,6 +2150,7 @@ /* Qfont defined in general.c */ DEFSYMBOL (Qdisplay_table); DEFSYMBOL (Qbackground_pixmap); + DEFSYMBOL (Qbackground_placement); DEFSYMBOL (Qunderline); DEFSYMBOL (Qstrikethru); /* Qhighlight, Qreverse defined in general.c */ @@ -2200,6 +2224,7 @@ syms[n++] = Qfont; syms[n++] = Qdisplay_table; syms[n++] = Qbackground_pixmap; + syms[n++] = Qbackground_placement; syms[n++] = Qunderline; syms[n++] = Qstrikethru; syms[n++] = Qhighlight; @@ -2518,6 +2543,9 @@ set_specifier_fallback (Fget (Vmodeline_face, Qbackground_pixmap, Qnil), Fget (Vgui_element_face, Qbackground_pixmap, Qunbound)); + set_specifier_fallback (Fget (Vmodeline_face, Qbackground_placement, Qnil), + Fget (Vgui_element_face, Qbackground_placement, + Qunbound)); /* toolbar is another gui element */ Vtoolbar_face = Fmake_face (Qtoolbar, @@ -2530,6 +2558,9 @@ set_specifier_fallback (Fget (Vtoolbar_face, Qbackground_pixmap, Qnil), Fget (Vgui_element_face, Qbackground_pixmap, Qunbound)); + set_specifier_fallback (Fget (Vtoolbar_face, Qbackground_placement, Qnil), + Fget (Vgui_element_face, Qbackground_placement, + Qunbound)); /* vertical divider is another gui element */ Vvertical_divider_face = Fmake_face (Qvertical_divider, @@ -2544,6 +2575,10 @@ Qunbound), Fget (Vgui_element_face, Qbackground_pixmap, Qunbound)); + set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground_placement, + Qnil), + Fget (Vgui_element_face, Qbackground_placement, + Qunbound)); /* widget is another gui element */ Vwidget_face = Fmake_face (Qwidget,
--- a/src/faces.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/faces.h Sun Mar 07 02:09:59 2010 -0600 @@ -1,6 +1,7 @@ /* Face data structures. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995, 2002, 2010 Ben Wing + Copyright (C) 2010 Didier Verna This file is part of XEmacs. @@ -47,6 +48,7 @@ Lisp_Object display_table; Lisp_Object background_pixmap; + Lisp_Object background_placement; Lisp_Object underline; Lisp_Object strikethru; @@ -172,6 +174,7 @@ Lisp_Object display_table; Lisp_Object background_pixmap; + Lisp_Object background_placement; unsigned int underline :1; unsigned int strikethru :1; @@ -188,6 +191,7 @@ unsigned int background_specified :1; unsigned int display_table_specified :1; unsigned int background_pixmap_specified :1; + unsigned int background_placement_specified :1; unsigned int strikethru_specified :1; unsigned int underline_specified :1; @@ -340,6 +344,8 @@ (WINDOW_FACE_CACHEL (window, index)->display_table) #define WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP(window, index) \ (WINDOW_FACE_CACHEL (window, index)->background_pixmap) +#define WINDOW_FACE_CACHEL_BACKGROUND_PLACEMENT(window, index) \ + (WINDOW_FACE_CACHEL (window, index)->background_placement) #define WINDOW_FACE_CACHEL_DIRTY(window, index) \ (WINDOW_FACE_CACHEL (window, index)->dirty) #define WINDOW_FACE_CACHEL_UNDERLINE_P(window, index) \ @@ -396,6 +402,11 @@ FACE_PROPERTY_INSTANCE (face, Qdisplay_table, domain, 0, Qzero) #define FACE_BACKGROUND_PIXMAP(face, domain) \ FACE_PROPERTY_INSTANCE (face, Qbackground_pixmap, domain, 0, Qzero) + +extern Lisp_Object Qbackground_placement; +#define FACE_BACKGROUND_PLACEMENT(face, domain) \ + FACE_PROPERTY_INSTANCE (face, Qbackground_placement, domain, 0, Qzero) + #define FACE_UNDERLINE_P(face, domain) \ (!NILP (FACE_PROPERTY_INSTANCE (face, Qunderline, domain, 0, Qzero))) #define FACE_STRIKETHRU_P(face, domain) \
--- a/src/file-coding.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/file-coding.c Sun Mar 07 02:09:59 2010 -0600 @@ -1402,13 +1402,15 @@ } DEFUN ("make-coding-system-internal", Fmake_coding_system_internal, 2, 4, 0, /* -See `make-coding-system'. This does much of the work of that function. - +Create a new coding system object, and register NAME as its name. + +With Mule support, this does much of the work of `make-coding-system'. Without Mule support, it does all the work of that function, and an alias -exists, mapping `make-coding-system' to -`make-coding-system-internal'. You'll need a non-Mule XEmacs to read the -complete docstring. Or you can just read it in make-coding-system.el; -something like the following should work: +exists, mapping `make-coding-system' to `make-coding-system-internal'. + +You'll need a Mule XEmacs to read the complete docstring. Or you can +just read it in make-coding-system.el; something like the following +should work: \\[find-function-other-window] find-file RET \\[find-file] mule/make-coding-system.el RET
--- a/src/fns.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/fns.c Sun Mar 07 02:09:59 2010 -0600 @@ -946,30 +946,6 @@ return arg; } -DEFUN ("substring", Fsubstring, 2, 3, 0, /* -Return the substring of STRING starting at START and ending before END. -END may be nil or omitted; then the substring runs to the end of STRING. -If START or END is negative, it counts from the end. -Relevant parts of the string-extent-data are copied to the new string. -*/ - (string, start, end)) -{ - Charcount ccstart, ccend; - Bytecount bstart, blen; - Lisp_Object val; - - CHECK_STRING (string); - CHECK_INT (start); - get_string_range_char (string, start, end, &ccstart, &ccend, - GB_HISTORICAL_STRING_BEHAVIOR); - bstart = string_index_char_to_byte (string, ccstart); - blen = string_offset_char_to_byte_len (string, bstart, ccend - ccstart); - val = make_string (XSTRING_DATA (string) + bstart, blen); - /* Copy any applicable extent information into the new string. */ - copy_string_extents (val, string, 0, bstart, blen); - return val; -} - DEFUN ("subseq", Fsubseq, 2, 3, 0, /* Return the subsequence of SEQUENCE starting at START and ending before END. END may be omitted; then the subsequence runs to the end of SEQUENCE. @@ -982,11 +958,25 @@ { EMACS_INT len, s, e; + if (STRINGP (sequence)) + { + Charcount ccstart, ccend; + Bytecount bstart, blen; + Lisp_Object val; + + CHECK_INT (start); + get_string_range_char (sequence, start, end, &ccstart, &ccend, + GB_HISTORICAL_STRING_BEHAVIOR); + bstart = string_index_char_to_byte (sequence, ccstart); + blen = string_offset_char_to_byte_len (sequence, bstart, ccend - ccstart); + val = make_string (XSTRING_DATA (sequence) + bstart, blen); + /* Copy any applicable extent information into the new string. */ + copy_string_extents (val, sequence, 0, bstart, blen); + return val; + } + CHECK_SEQUENCE (sequence); - if (STRINGP (sequence)) - return Fsubstring (sequence, start, end); - len = XINT (Flength (sequence)); CHECK_INT (start); @@ -4795,7 +4785,6 @@ DEFSUBR (Fcopy_sequence); DEFSUBR (Fcopy_alist); DEFSUBR (Fcopy_tree); - DEFSUBR (Fsubstring); DEFSUBR (Fsubseq); DEFSUBR (Fnthcdr); DEFSUBR (Fnth);
--- a/src/frame-gtk.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/frame-gtk.c Sun Mar 07 02:09:59 2010 -0600 @@ -633,13 +633,13 @@ { struct window *win = XWINDOW (f->root_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); - WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f); + WINDOW_LEFT (win) = FRAME_PANED_LEFT_EDGE (f); + WINDOW_TOP (win) = FRAME_PANED_TOP_EDGE (f); if (!NILP (f->minibuffer_window)) { win = XWINDOW (f->minibuffer_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); + WINDOW_LEFT (win) = FRAME_PANED_LEFT_EDGE (f); } }
--- a/src/frame-impl.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/frame-impl.h Sun Mar 07 02:09:59 2010 -0600 @@ -100,17 +100,23 @@ /* Size of toolbars as seen by redisplay. This is used to determine whether to re-layout windows by a call to change_frame_size early in redisplay_frame. */ - int current_toolbar_size[4]; + int current_toolbar_size[NUM_EDGES]; #endif /* Size of gutters as seen by redisplay. This is used to determine whether to re-layout windows by a call to change_frame_size early in redisplay_frame. */ - int current_gutter_bounds[4]; + int current_gutter_bounds[NUM_EDGES]; + + /* Toolbar visibility */ + int toolbar_was_visible[NUM_EDGES]; + + /* gutter visibility */ + int gutter_was_visible[NUM_EDGES]; /* Dynamic arrays of display lines for gutters */ - display_line_dynarr *current_display_lines[4]; - display_line_dynarr *desired_display_lines[4]; + display_line_dynarr *current_display_lines[NUM_EDGES]; + display_line_dynarr *desired_display_lines[NUM_EDGES]; /* A structure of auxiliary data specific to the device type. For example, struct x_frame is for X window frames; defined in @@ -160,16 +166,6 @@ /* True if frame's root window can't be split. */ unsigned int no_split :1; - unsigned int top_toolbar_was_visible :1; - unsigned int bottom_toolbar_was_visible :1; - unsigned int left_toolbar_was_visible :1; - unsigned int right_toolbar_was_visible :1; - /* gutter visibility */ - unsigned int top_gutter_was_visible :1; - unsigned int bottom_gutter_was_visible :1; - unsigned int left_gutter_was_visible :1; - unsigned int right_gutter_was_visible :1; - /* redisplay flags */ unsigned int buffers_changed :1; unsigned int clip_changed :1; @@ -581,13 +577,13 @@ : 0) #define FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT(f) \ - FRAME_THEORETICAL_TOOLBAR_SIZE (f, TOP_TOOLBAR) + FRAME_THEORETICAL_TOOLBAR_SIZE (f, TOP_EDGE) #define FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT(f) \ - FRAME_THEORETICAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR) + FRAME_THEORETICAL_TOOLBAR_SIZE (f, BOTTOM_EDGE) #define FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR) + FRAME_THEORETICAL_TOOLBAR_SIZE (f, LEFT_EDGE) #define FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR) + FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_EDGE) #define FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \ (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \ @@ -595,13 +591,13 @@ : 0) #define FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR) + FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, TOP_EDGE) #define FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR) + FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_EDGE) #define FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR) + FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, LEFT_EDGE) #define FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR) + FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_EDGE) /* This returns the window-local value rather than the frame-local value; that tells you about what's actually visible rather than what should @@ -670,65 +666,122 @@ 2 * FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, pos)) #define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \ - FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR) + FRAME_REAL_TOOLBAR_SIZE (f, TOP_EDGE) #define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \ - FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR) + FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_EDGE) #define FRAME_REAL_LEFT_TOOLBAR_WIDTH(f) \ - FRAME_REAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR) + FRAME_REAL_TOOLBAR_SIZE (f, LEFT_EDGE) #define FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) \ - FRAME_REAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR) + FRAME_REAL_TOOLBAR_SIZE (f, RIGHT_EDGE) #define FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR) + FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, TOP_EDGE) #define FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR) + FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_EDGE) #define FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR) + FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, LEFT_EDGE) #define FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR) + FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_EDGE) #define FRAME_REAL_TOP_TOOLBAR_VISIBLE(f) \ - FRAME_REAL_TOOLBAR_VISIBLE (f, TOP_TOOLBAR) + FRAME_REAL_TOOLBAR_VISIBLE (f, TOP_EDGE) #define FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE(f) \ - FRAME_REAL_TOOLBAR_VISIBLE (f, BOTTOM_TOOLBAR) + FRAME_REAL_TOOLBAR_VISIBLE (f, BOTTOM_EDGE) #define FRAME_REAL_LEFT_TOOLBAR_VISIBLE(f) \ - FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_TOOLBAR) + FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_EDGE) #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \ - FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR) + FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_EDGE) #define FRAME_REAL_TOP_TOOLBAR_BOUNDS(f) \ - FRAME_REAL_TOOLBAR_BOUNDS (f, TOP_TOOLBAR) + FRAME_REAL_TOOLBAR_BOUNDS (f, TOP_EDGE) #define FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS(f) \ - FRAME_REAL_TOOLBAR_BOUNDS (f, BOTTOM_TOOLBAR) + FRAME_REAL_TOOLBAR_BOUNDS (f, BOTTOM_EDGE) #define FRAME_REAL_LEFT_TOOLBAR_BOUNDS(f) \ - FRAME_REAL_TOOLBAR_BOUNDS (f, LEFT_TOOLBAR) + FRAME_REAL_TOOLBAR_BOUNDS (f, LEFT_EDGE) #define FRAME_REAL_RIGHT_TOOLBAR_BOUNDS(f) \ - FRAME_REAL_TOOLBAR_BOUNDS (f, RIGHT_TOOLBAR) + FRAME_REAL_TOOLBAR_BOUNDS (f, RIGHT_EDGE) /************************************************************************/ /* frame dimensions defined using toolbars and gutters */ /************************************************************************/ -/* #### These should be using the gutter sizes, but aren't yet */ +/* Bounds of the area framed by the toolbars is the client area -- + (0, 0) - (FRAME_PIXWIDTH, FRAME_PIXHEIGHT). */ -#define FRAME_TOP_BORDER_START(f) \ +/* Bounds of the area framed by the internal border width -- inside of the + toolbars, outside of everything else. */ + +#define FRAME_TOP_INTERNAL_BORDER_START(f) \ FRAME_REAL_TOP_TOOLBAR_BOUNDS (f) -#define FRAME_TOP_BORDER_END(f) \ - (FRAME_TOP_BORDER_START (f) + FRAME_INTERNAL_BORDER_HEIGHT (f)) +#define FRAME_TOP_INTERNAL_BORDER_END(f) \ + (FRAME_TOP_INTERNAL_BORDER_START (f) + FRAME_INTERNAL_BORDER_HEIGHT (f)) -#define FRAME_BOTTOM_BORDER_START(f) \ - (FRAME_BOTTOM_BORDER_END (f) - FRAME_INTERNAL_BORDER_HEIGHT (f)) -#define FRAME_BOTTOM_BORDER_END(f) \ +#define FRAME_BOTTOM_INTERNAL_BORDER_START(f) \ + (FRAME_BOTTOM_INTERNAL_BORDER_END (f) - FRAME_INTERNAL_BORDER_HEIGHT (f)) +#define FRAME_BOTTOM_INTERNAL_BORDER_END(f) \ (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f)) -#define FRAME_LEFT_BORDER_START(f) \ +#define FRAME_LEFT_INTERNAL_BORDER_START(f) \ FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f) -#define FRAME_LEFT_BORDER_END(f) \ - (FRAME_LEFT_BORDER_START (f) + FRAME_INTERNAL_BORDER_WIDTH (f)) +#define FRAME_LEFT_INTERNAL_BORDER_END(f) \ + (FRAME_LEFT_INTERNAL_BORDER_START (f) + FRAME_INTERNAL_BORDER_WIDTH (f)) -#define FRAME_RIGHT_BORDER_START(f) \ - (FRAME_RIGHT_BORDER_END (f) - FRAME_INTERNAL_BORDER_WIDTH (f)) -#define FRAME_RIGHT_BORDER_END(f) \ +#define FRAME_RIGHT_INTERNAL_BORDER_START(f) \ + (FRAME_RIGHT_INTERNAL_BORDER_END (f) - FRAME_INTERNAL_BORDER_WIDTH (f)) +#define FRAME_RIGHT_INTERNAL_BORDER_END(f) \ (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f)) +/* Bounds of the area framed by the gutter -- inside of the + toolbars and internal border width. */ + +#define FRAME_TOP_GUTTER_START(f) \ + FRAME_TOP_INTERNAL_BORDER_END (f) +#define FRAME_TOP_GUTTER_END(f) \ + (FRAME_TOP_GUTTER_START (f) + FRAME_TOP_GUTTER_BOUNDS (f)) + +#ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER +#define FRAME_BOTTOM_GUTTER_START(f) \ + (FRAME_BOTTOM_GUTTER_END (f) - FRAME_BOTTOM_GUTTER_BOUNDS (f)) +#define FRAME_BOTTOM_GUTTER_END(f) \ + FRAME_BOTTOM_INTERNAL_BORDER_START (f) +#endif /* BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER */ + +#define FRAME_LEFT_GUTTER_START(f) \ + FRAME_LEFT_INTERNAL_BORDER_END (f) +#define FRAME_LEFT_GUTTER_END(f) \ + (FRAME_LEFT_GUTTER_START (f) + FRAME_LEFT_GUTTER_BOUNDS (f)) + +#define FRAME_RIGHT_GUTTER_START(f) \ + (FRAME_RIGHT_GUTTER_END (f) - FRAME_RIGHT_GUTTER_BOUNDS (f)) +#define FRAME_RIGHT_GUTTER_END(f) \ + FRAME_RIGHT_INTERNAL_BORDER_START (f) + +/* These are the bounds of the paned area -- inside of the toolbars, + gutters, and internal border width. The paned area is the same as the + area occupied by windows, including the minibuffer. See long comment in + frame.c. */ + +#define FRAME_PANED_TOP_EDGE(f) FRAME_TOP_GUTTER_END (f) +#ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER +#define FRAME_PANED_BOTTOM_EDGE(f) FRAME_BOTTOM_GUTTER_START (f) +#endif /* BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER */ +#define FRAME_PANED_LEFT_EDGE(f) FRAME_LEFT_GUTTER_END (f) +#define FRAME_PANED_RIGHT_EDGE(f) FRAME_RIGHT_GUTTER_START (f) + +/* Thickness of non-paned area at edge of frame; + + FRAME_PANED_TOP_EDGE (f) == FRAME_NONPANED_SIZE (f, TOP_EDGE) + FRAME_PANED_LEFT_EDGE (f) == FRAME_NONPANED_SIZE (f, LEFT_EDGE) + FRAME_PANED_BOTTOM_EDGE (f) == + FRAME_PIXHEIGHT (f) - FRAME_NONPANED_SIZE (f, BOTTOM_EDGE) + FRAME_PANED_RIGHT_EDGE (f) == + FRAME_PIXWIDTH (f) - FRAME_NONPANED_SIZE (f, RIGHT_EDGE) + +*/ +#define FRAME_NONPANED_SIZE(f, pos) \ + (FRAME_REAL_TOOLBAR_BOUNDS (f, pos) + FRAME_INTERNAL_BORDER_SIZE (f, pos) + \ + FRAME_GUTTER_BOUNDS (f, pos)) + + + #endif /* INCLUDED_frame_impl_h_ */
--- a/src/frame-x.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/frame-x.c Sun Mar 07 02:09:59 2010 -0600 @@ -1,6 +1,7 @@ /* Functions for the X window system. Copyright (C) 1989, 1992-5, 1997 Free Software Foundation, Inc. Copyright (C) 1995, 1996, 2001, 2002, 2004, 2010 Ben Wing. + Copyright (C) 2010 Didier Verna This file is part of XEmacs. @@ -535,6 +536,23 @@ *y = xwa.y; } +void x_get_frame_text_position (struct frame *f) +{ + Display *dpy = DEVICE_X_DISPLAY (XDEVICE (FRAME_DEVICE (f))); + Window window = XtWindow (FRAME_X_TEXT_WIDGET (f)); + Window root, child; + int x, y; + unsigned int width, height, border_width; + unsigned int depth; + + XGetGeometry (dpy, window, &root, &x, &y, &width, &height, &border_width, + &depth); + XTranslateCoordinates (dpy, window, root, 0, 0, &x, &y, &child); + + FRAME_X_X (f) = x; + FRAME_X_Y (f) = y; +} + #if 0 static void x_smash_bastardly_shell_position (Widget shell) @@ -1432,16 +1450,13 @@ { struct window *win = XWINDOW (f->root_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) - + FRAME_LEFT_GUTTER_BOUNDS (f); - WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f) - + FRAME_TOP_GUTTER_BOUNDS (f); + WINDOW_LEFT (win) = FRAME_PANED_LEFT_EDGE (f); + WINDOW_TOP (win) = FRAME_PANED_TOP_EDGE (f); if (!NILP (f->minibuffer_window)) { win = XWINDOW (f->minibuffer_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) - + FRAME_LEFT_GUTTER_BOUNDS (f); + WINDOW_LEFT (win) = FRAME_PANED_LEFT_EDGE (f); } } @@ -2117,9 +2132,13 @@ static void x_init_frame_3 (struct frame *f) { - /* Pop up the frame. */ - + /* #### NOTE: This whole business of splitting frame initialization into + #### different functions is somewhat messy. The latest one seems a good + #### place to initialize the edit widget's position because we're sure + #### that the frame is now relalized. -- dvl */ + x_popup_frame (f); + x_get_frame_text_position (f); } static void
--- a/src/frame.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/frame.c Sun Mar 07 02:09:59 2010 -0600 @@ -35,43 +35,43 @@ | ###################################################################### | | # toolbar # | | #--------------------------------------------------------------------# | -| # | gutter | # | -| # |--------------------------------------------------------------| # | -| # | | internal border width | | # | -| # | | ******************************************************** | | # | -|w# | | * |s|v* |s* | | #w| -|i# | | * |c|e* |c* | | #i| -|n# | | * |r|r* |r* | | #n| -|d# | | * |o|t* |o* | | #d| -|o# | | * text area |l|.* text area |l* | | #o| -|w# | |i* |l| * |l*i| | #w| -|-# | |n* |b|d* |b*n| | #-| -|m# | |t* |a|i* |a*t| | #m| -|a# | |.* |r|v* |r*.| | #a| -|n# t| | *-------------------------+-|i*----------------------+-* | |t #n| -|a# o|g|b* scrollbar | |d* scrollbar | *b|g|o #a| -|g# o|u|o*-------------------------+-|e*----------------------+-*o|u|o #g| -|e# l|t|r* modeline |r* modeline *r|t|l #e| -|r# b|t|d********************************************************d|t|b #r| -| # a|e|e* =..texttexttex....= |s|v* |s*e|e|a # | -|d# r|r|r*o m=..texttexttextt..=o m|c|e* |c*r|r|r #d| -|e# | | *u a=.exttexttextte...=u a|r|r* |r* | | #e| -|c# | |w*t r=....texttexttex..=t r|o|t* |o*w| | #c| -|o# | |i*s g= etc. =s g|l|.* text area |l*i| | #o| -|r# | |d*i i= =i i|l| * |l*d| | #r| -|a# | |t*d n= =d n|b|d* |b*t| | #a| -|t# | |h*e = inner text area =e |a|i* |a*h| | #t| +| # | internal border | # | +| # | +----------------------------------------------------------+ | # | +| # | | gutter | | # | +| # | |-********************************************************-| | # | +|w# | | *@| scrollbar |v* |s* | | #w| +|i# | | *-+-------------------------|e* |c* | | #i| +|n# | | *s| |r* |r* | | #n| +|d# | | *c| |t* |o* | | #d| +|o# | | *r| |.* text area |l* | | #o| +|w# |i| *o| | * |l* |i| #w| +|-# |n| *l| text area |d* |b* |n| #-| +|m# |t| *l| |i* |a* |t| #m| +|a# |e| *b| |v* |r* |e| #a| +|n# t|r| *a| |i*----------------------+-* |r|t #n| +|a# o|n|g*r| |d* scrollbar |@*g|n|o #a| +|g# o|a|u*-+-------------------------|e*----------------------+-*u|a|o #g| +|e# l|l|t* modeline |r* modeline *t|l|l #e| +|r# b| |t********************************************************t| |b #r| +| # a|b|e* =..texttexttex....= |s|v* |s*e|b|a # | +|d# r|o|r*o m=..texttexttextt..=o m|c|e* |c*r|o|r #d| +|e# |r| *u a=.exttexttextte...=u a|r|r* |r* |r| #e| +|c# |d| *t r=....texttexttex..=t r|o|t* |o* |d| #c| +|o# |e| *s g= etc. =s g|l|.* text area |l* |e| #o| +|r# |r| *i i= =i i|l| * |l* |r| #r| +|a# | | *d n= =d n|b|d* |b* | | #a| +|t# | | *e = inner text area =e |a|i* |a* | | #t| |i# | | * = = |r|v* |r* | | #i| |o# | | *---===================---+-|i*----------------------+-* | | #o| -|n# | | * scrollbar | |d* scrollbar | * | | #n| +|n# | | * scrollbar |@|d* scrollbar |@* | | #n| | # | | *-------------------------+-|e*----------------------+-* | | # | | # | | * modeline |r* modeline * | | # | -| # | | ******************************************************** | | # | -| # | | * minibuffer * | | # | -| # | | ******************************************************** | | # | -| # | | internal border width | | # | -| # |--------------------------------------------------------------| # | -| # | gutter | # | +| # | |-********************************************************-| | # | +| # | | gutter | | # | +| # | |-********************************************************-| | # | +| # | |@* minibuffer *@| | # | +| # | +-********************************************************-+ | # | +| # | internal border | # | | #--------------------------------------------------------------------# | | # toolbar # | | ###################################################################### | @@ -79,14 +79,17 @@ +------------------------------------------------------------------------+ # = boundary of client area; * = window boundaries, boundary of paned area - = = boundary of inner text area; . = inside margin area + = = boundary of inner text area; . = inside margin area; @ = dead boxes Note in particular what happens at the corners, where a "corner box" occurs. Top and bottom toolbars take precedence over left and right toolbars, extending out horizontally into the corner boxes. Gutters work the same way. The corner box where the scrollbars meet, however, is assigned to neither scrollbar, and is known as the "dead box"; it is - an area that must be cleared specially. + an area that must be cleared specially. There are similar dead boxes at + the bottom-right and bottom-left corners where the minibuffer and + left/right gutters meet, but there is currently a bug in that these dead + boxes are not explicitly cleared and may contain junk. THE FRAME --------- @@ -184,13 +187,18 @@ THE PANED AREA -------------- - The area occupied by the "windows" is called the paned area. Note that - this includes the minibuffer, which is just another window but is - special-cased in XEmacs. Each window can include a horizontal and/or - vertical scrollbar, a modeline and a vertical divider to its right, as - well as the text area. Only non-rightmost windows can include a - vertical divider. (The minibuffer normally does not include either - modeline or scrollbars.) + The area occupied by the "windows" is called the paned area. Unfortunately, + because of the presence of the gutter *between* the minibuffer and other + windows, the bottom of the paned area is not well-defined -- does it + include the minibuffer (in which case it also includes the bottom gutter, + but none others) or does it not include the minibuffer? (In which case + not all windows are included.) #### GEOM! It would be cleaner to put the + bottom gutter *below* the minibuffer instead of above it. + + Each window can include a horizontal and/or vertical scrollbar, a + modeline and a vertical divider to its right, as well as the text area. + Only non-rightmost windows can include a vertical divider. (The + minibuffer normally does not include either modeline or scrollbars.) Note that, because the toolbars and gutters are controlled by specifiers, and specifiers can have window-specific and buffer-specific @@ -252,18 +260,23 @@ specified default character because many X fonts have a default character with a zero or otherwise non-representative width.]) - The displayable area is essentially the "theoretical" paned area of the - frame excluding the rightmost and bottom-most scrollbars. In this - context, "theoretical" means that all calculations on based on - frame-level values for toolbar, gutter and scrollbar thicknesses. - Because these thicknesses are controlled by specifiers, and specifiers - can have window-specific and buffer-specific values, these calculations - may or may not reflect the actual size of the paned area or of the - scrollbars when any particular window is selected. Note also that the - "displayable area" may not even be contiguous! In particular, if the - frame-level value of the horizontal scrollbar height is non-zero, then - the displayable area includes the paned area above and below the bottom - horizontal scrollbar but not the scrollbar itself. + The displayable area is essentially the "theoretical" gutter area of the + frame, excluding the rightmost and bottom-most scrollbars. That is, it + starts from the client (or "total") area and then excludes the + "theoretical" toolbars and bottom-most/rightmost scrollbars, and the + internal border width. In this context, "theoretical" means that all + calculations on based on frame-level values for toolbar and scrollbar + thicknesses. Because these thicknesses are controlled by specifiers, + and specifiers can have window-specific and buffer-specific values, + these calculations may or may not reflect the actual size of the paned + area or of the scrollbars when any particular window is selected. Note + also that the "displayable area" may not even be contiguous! In + particular, the gutters are included, but the bottom-most and rightmost + scrollbars are excluded even though they are inside of the gutters. + Furthermore, if the frame-level value of the horizontal scrollbar height + is non-zero, then the displayable area includes the paned area above and + below the bottom horizontal scrollbar (i.e. the modeline and minibuffer) + but not the scrollbar itself. As a further twist, the character-dimension calculations are adjusted so that the truncation and continuation glyphs (see `truncation-glyph' and @@ -3590,22 +3603,13 @@ /* We need to remove the boundaries of the paned area (see top of file) from the total-area pixel size, which is what we have now. - - #### We should also be subtracting the internal borders. */ + */ new_pixheight -= - (FRAME_REAL_TOP_TOOLBAR_BOUNDS (f) - + FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f) - + FRAME_TOP_GUTTER_BOUNDS (f) - + FRAME_BOTTOM_GUTTER_BOUNDS (f)); - + (FRAME_NONPANED_SIZE (f, TOP_EDGE) + FRAME_NONPANED_SIZE (f, BOTTOM_EDGE)); new_pixwidth -= - (FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f) - + FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f) - + FRAME_LEFT_GUTTER_BOUNDS (f) - + FRAME_RIGHT_GUTTER_BOUNDS (f)); - - XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top - = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); + (FRAME_NONPANED_SIZE (f, LEFT_EDGE) + FRAME_NONPANED_SIZE (f, RIGHT_EDGE)); + + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top = FRAME_PANED_TOP_EDGE (f); if (FRAME_HAS_MINIBUF_P (f) && ! FRAME_MINIBUF_ONLY_P (f)) @@ -3631,8 +3635,7 @@ new_pixheight - minibuf_height, 0); XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = - FRAME_TOP_BORDER_END (f) + - FRAME_TOP_GUTTER_BOUNDS (f) + + FRAME_PANED_TOP_EDGE (f) + FRAME_BOTTOM_GUTTER_BOUNDS (f) + new_pixheight - minibuf_height; @@ -3646,14 +3649,13 @@ if (FRAME_TTY_P (f)) f->pixheight = newheight; - XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = - FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = FRAME_PANED_LEFT_EDGE (f); set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0); if (FRAME_HAS_MINIBUF_P (f)) { XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left = - FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); + FRAME_PANED_LEFT_EDGE (f); set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); } @@ -3661,10 +3663,10 @@ if (FRAME_TTY_P (f)) f->pixwidth = newwidth; - /* #### On MS Windows, this references FRAME_PIXWIDTH() and FRAME_PIXHEIGHT(). - I'm not sure we can count on those values being set. Instead we should - use the total pixel size we got near the top by calling - frame_conversion_internal(). We should inline the logic in + /* #### On MS Windows, this references FRAME_PIXWIDTH() and + FRAME_PIXHEIGHT(). I'm not sure we can count on those values being + set. Instead we should use the total pixel size we got near the top + by calling frame_conversion_internal(). We should inline the logic in get_frame_char_size() here and change that function so it just looks at FRAME_CHARWIDTH() and FRAME_CHARHEIGHT(). */ get_frame_char_size (f, &FRAME_CHARWIDTH (f), &FRAME_CHARHEIGHT (f));
--- a/src/frame.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/frame.h Sun Mar 07 02:09:59 2010 -0600 @@ -161,4 +161,18 @@ void init_frame (void); +enum edge_pos +{ + TOP_EDGE, + BOTTOM_EDGE, + LEFT_EDGE, + RIGHT_EDGE, + NUM_EDGES +}; + +/* Iterate over all possible edge positions */ +#define EDGE_POS_LOOP(var) \ + for (var = (enum edge_pos) 0; var < NUM_EDGES; \ + var = (enum edge_pos) (var + 1)) + #endif /* INCLUDED_frame_h_ */
--- a/src/general-slots.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/general-slots.h Sun Mar 07 02:09:59 2010 -0600 @@ -49,6 +49,7 @@ SYMBOL (Qactually_requested); SYMBOL (Qafter); SYMBOL (Qall); +SYMBOL_KEYWORD (Q_allow_other_keys); SYMBOL (Qand); SYMBOL (Qappend); SYMBOL (Qascii);
--- a/src/gtk-glue.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/gtk-glue.c Sun Mar 07 02:09:59 2010 -0600 @@ -208,17 +208,21 @@ static GdkGC * face_to_gc (Lisp_Object face) { - Lisp_Object device = Fselected_device (Qnil); + Lisp_Object frame = Fselected_frame (Qnil); - return (gtk_get_gc (XDEVICE (device), + return (gtk_get_gc (XFRAME (frame), Fspecifier_instance (Fget (face, Qfont, Qnil), - device, Qnil, Qnil), + frame, Qnil, Qnil), Fspecifier_instance (Fget (face, Qforeground, Qnil), - device, Qnil, Qnil), + frame, Qnil, Qnil), Fspecifier_instance (Fget (face, Qbackground, Qnil), - device, Qnil, Qnil), + frame, Qnil, Qnil), Fspecifier_instance (Fget (face, Qbackground_pixmap, - Qnil), device, Qnil, Qnil), + Qnil), + frame, Qnil, Qnil), + Fspecifier_instance (Fget (face, Qbackground_placement, + Qnil), + frame, Qnil, Qnil), Qnil)); }
--- a/src/gutter.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/gutter.c Sun Mar 07 02:09:59 2010 -0600 @@ -36,10 +36,10 @@ #include "window.h" #include "gutter.h" -Lisp_Object Vgutter[4]; -Lisp_Object Vgutter_size[4]; -Lisp_Object Vgutter_visible_p[4]; -Lisp_Object Vgutter_border_width[4]; +Lisp_Object Vgutter[NUM_EDGES]; +Lisp_Object Vgutter_size[NUM_EDGES]; +Lisp_Object Vgutter_visible_p[NUM_EDGES]; +Lisp_Object Vgutter_border_width[NUM_EDGES]; Lisp_Object Vdefault_gutter, Vdefault_gutter_visible_p; Lisp_Object Vdefault_gutter_width, Vdefault_gutter_height; @@ -52,46 +52,7 @@ Lisp_Object Qdefault_gutter_position_changed_hook; static void -update_gutter_geometry (struct frame *f, enum gutter_pos pos); - -#define SET_GUTTER_WAS_VISIBLE_FLAG(frame, pos, flag) \ - do { \ - switch (pos) \ - { \ - case TOP_GUTTER: \ - (frame)->top_gutter_was_visible = flag; \ - break; \ - case BOTTOM_GUTTER: \ - (frame)->bottom_gutter_was_visible = flag; \ - break; \ - case LEFT_GUTTER: \ - (frame)->left_gutter_was_visible = flag; \ - break; \ - case RIGHT_GUTTER: \ - (frame)->right_gutter_was_visible = flag; \ - break; \ - default: \ - ABORT (); \ - } \ - } while (0) - -static int gutter_was_visible (struct frame* frame, enum gutter_pos pos) -{ - switch (pos) - { - case TOP_GUTTER: - return frame->top_gutter_was_visible; - case BOTTOM_GUTTER: - return frame->bottom_gutter_was_visible; - case LEFT_GUTTER: - return frame->left_gutter_was_visible; - case RIGHT_GUTTER: - return frame->right_gutter_was_visible; - default: - ABORT (); - return 0; /* To keep the compiler happy */ - } -} +update_gutter_geometry (struct frame *f, enum edge_pos pos); #if 0 static Lisp_Object @@ -172,46 +133,48 @@ if it is not the window nearest the gutter. Instead we predetermine the nearest window and then use that.*/ static void -get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y, +get_gutter_coords (struct frame *f, enum edge_pos pos, int *x, int *y, int *width, int *height) { - struct window - * bot = XWINDOW (frame_bottommost_window (f)); + /* We use the bottommost window (not the minibuffer, but the bottommost + non-minibuffer window) rather than any FRAME_BOTTOM_GUTTER_START + because the gutter goes *above* the minibuffer -- for this same reason, + FRAME_BOTTOM_GUTTER_START isn't currently defined. */ + struct window *bot = XWINDOW (frame_bottommost_window (f)); /* The top and bottom gutters take precedence over the left and right. */ switch (pos) { - case TOP_GUTTER: - *x = FRAME_LEFT_BORDER_END (f); - *y = FRAME_TOP_BORDER_END (f); - *width = FRAME_RIGHT_BORDER_START (f) - - FRAME_LEFT_BORDER_END (f); + case TOP_EDGE: + *x = FRAME_LEFT_GUTTER_START (f); + *y = FRAME_TOP_GUTTER_START (f); + *width = FRAME_RIGHT_GUTTER_END (f) - *x; *height = FRAME_TOP_GUTTER_BOUNDS (f); break; - case BOTTOM_GUTTER: - *x = FRAME_LEFT_BORDER_END (f); + case BOTTOM_EDGE: + *x = FRAME_LEFT_GUTTER_START (f); +#ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER + *y = FRAME_BOTTOM_GUTTER_START (f); +#else *y = WINDOW_BOTTOM (bot); - *width = FRAME_RIGHT_BORDER_START (f) - - FRAME_LEFT_BORDER_END (f); +#endif + *width = FRAME_RIGHT_GUTTER_END (f) - *x; *height = FRAME_BOTTOM_GUTTER_BOUNDS (f); break; - case LEFT_GUTTER: - *x = FRAME_LEFT_BORDER_END (f); - *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); + case LEFT_EDGE: + *x = FRAME_LEFT_GUTTER_START (f); + *y = FRAME_TOP_GUTTER_END (f); *width = FRAME_LEFT_GUTTER_BOUNDS (f); - *height = WINDOW_BOTTOM (bot) - - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); + *height = WINDOW_BOTTOM (bot) - *y; break; - case RIGHT_GUTTER: - *x = FRAME_RIGHT_BORDER_START (f) - - FRAME_RIGHT_GUTTER_BOUNDS (f); - *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); + case RIGHT_EDGE: + *x = FRAME_RIGHT_GUTTER_START (f); + *y = FRAME_TOP_GUTTER_END (f); *width = FRAME_RIGHT_GUTTER_BOUNDS (f); - *height = WINDOW_BOTTOM (bot) - - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); + *height = WINDOW_BOTTOM (bot) - *y; break; default: @@ -230,8 +193,8 @@ int display_boxes_in_gutter_p (struct frame *f, struct display_box* db, struct display_glyph_area* dga) { - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) + enum edge_pos pos; + EDGE_POS_LOOP (pos) { if (FRAME_GUTTER_VISIBLE (f, pos)) { @@ -257,7 +220,7 @@ /* Convert the gutter specifier into something we can actually display. */ static Lisp_Object construct_window_gutter_spec (struct window* w, - enum gutter_pos pos) + enum edge_pos pos) { Lisp_Object rest, *args; int nargs = 0; @@ -289,14 +252,14 @@ what height will accommodate all lines. This is useless on left and right gutters as we always have a maximal number of lines. */ static int -calculate_gutter_size_from_display_lines (enum gutter_pos pos, +calculate_gutter_size_from_display_lines (enum edge_pos pos, display_line_dynarr* ddla) { int size = 0; struct display_line *dl; /* For top and bottom the calculation is easy. */ - if (pos == TOP_GUTTER || pos == BOTTOM_GUTTER) + if (pos == TOP_EDGE || pos == BOTTOM_EDGE) { /* grab coordinates of last line */ if (Dynarr_length (ddla)) @@ -333,7 +296,7 @@ } static Lisp_Object -calculate_gutter_size (struct window *w, enum gutter_pos pos) +calculate_gutter_size (struct window *w, enum edge_pos pos) { struct frame* f = XFRAME (WINDOW_FRAME (w)); display_line_dynarr *ddla; @@ -360,12 +323,20 @@ ddla = Dynarr_new (display_line); /* generate some display lines */ generate_displayable_area (w, WINDOW_GUTTER (w, pos), - FRAME_LEFT_BORDER_END (f), - FRAME_TOP_BORDER_END (f), - FRAME_RIGHT_BORDER_START (f) - - FRAME_LEFT_BORDER_END (f), - FRAME_BOTTOM_BORDER_START (f) - - FRAME_TOP_BORDER_END (f), + FRAME_LEFT_GUTTER_START (f), + FRAME_TOP_GUTTER_START (f), + FRAME_RIGHT_GUTTER_END (f) + - FRAME_LEFT_GUTTER_START (f), +#ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER + FRAME_BOTTOM_GUTTER_END (f) +#else + /* #### GEOM! This is how it used to read, + and this includes both gutter and + minibuffer below it. Not clear whether + it was intended that way. --ben */ + FRAME_BOTTOM_INTERNAL_BORDER_START (f) +#endif + - FRAME_TOP_GUTTER_START (f), ddla, 0, DEFAULT_INDEX); /* Let GC happen again. */ @@ -379,7 +350,7 @@ } static void -output_gutter (struct frame *f, enum gutter_pos pos, int force) +output_gutter (struct frame *f, enum edge_pos pos, int force) { Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); struct device *d = XDEVICE (f->device); @@ -426,9 +397,9 @@ { #ifdef DEBUG_GUTTERS stderr_out ("gutter redisplay [%s %dx%d@%d+%d] triggered by %s,\n", - pos == TOP_GUTTER ? "TOP" : - pos == BOTTOM_GUTTER ? "BOTTOM" : - pos == LEFT_GUTTER ? "LEFT" : "RIGHT", + pos == TOP_EDGE ? "TOP" : + pos == BOTTOM_EDGE ? "BOTTOM" : + pos == LEFT_EDGE ? "LEFT" : "RIGHT", width, height, x, y, force ? "force" : f->faces_changed ? "f->faces_changed" : f->frame_changed ? "f->frame_changed" : @@ -512,7 +483,7 @@ } static void -clear_gutter (struct frame *f, enum gutter_pos pos) +clear_gutter (struct frame *f, enum edge_pos pos) { int x, y, width, height; Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); @@ -520,7 +491,7 @@ Vwidget_face); get_gutter_coords (f, pos, &x, &y, &width, &height); - SET_GUTTER_WAS_VISIBLE_FLAG (f, pos, 0); + f->gutter_was_visible[pos] = 0; redisplay_clear_region (window, findex, x, y, width, height); } @@ -537,8 +508,8 @@ void mark_gutters (struct frame *f) { - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) + enum edge_pos pos; + EDGE_POS_LOOP (pos) { if (f->current_display_lines[pos]) mark_redisplay_structs (f->current_display_lines[pos]); @@ -564,11 +535,11 @@ FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) { struct frame *f = XFRAME (XCAR (frmcons)); - enum gutter_pos pos; + enum edge_pos pos; Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); struct window* w = XWINDOW (window); - GUTTER_POS_LOOP (pos) + EDGE_POS_LOOP (pos) { if (EQ (WINDOW_GUTTER (w, pos), obj)) { @@ -581,7 +552,7 @@ /* We have to change the gutter geometry separately to the gutter update since it needs to occur outside of redisplay proper. */ static void -update_gutter_geometry (struct frame *f, enum gutter_pos pos) +update_gutter_geometry (struct frame *f, enum edge_pos pos) { /* If the gutter geometry has changed then re-layout the frame. If we are in display there is almost no point in doing @@ -607,13 +578,13 @@ || f->frame_layout_changed || f->windows_structure_changed) { - enum gutter_pos pos; + enum edge_pos pos; /* If the gutter geometry has changed then re-layout the frame. If we are in display there is almost no point in doing anything else since the frame size changes will be delayed until we are out of redisplay proper. */ - GUTTER_POS_LOOP (pos) + EDGE_POS_LOOP (pos) { update_gutter_geometry (f, pos); } @@ -629,7 +600,7 @@ f->windows_changed || f->windows_structure_changed || f->extents_changed || f->frame_layout_changed) { - enum gutter_pos pos; + enum edge_pos pos; /* We don't actually care about these when outputting the gutter so locally disable them. */ @@ -639,12 +610,12 @@ f->buffers_changed = 0; /* and output */ - GUTTER_POS_LOOP (pos) + EDGE_POS_LOOP (pos) { if (FRAME_GUTTER_VISIBLE (f, pos)) output_gutter (f, pos, 0); - else if (gutter_was_visible (f, pos)) + else if (f->gutter_was_visible[pos]) clear_gutter (f, pos); } @@ -657,8 +628,8 @@ void reset_gutter_display_lines (struct frame* f) { - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) + enum edge_pos pos; + EDGE_POS_LOOP (pos) { if (f->current_display_lines[pos]) Dynarr_reset (f->current_display_lines[pos]); @@ -666,7 +637,7 @@ } static void -redraw_exposed_gutter (struct frame *f, enum gutter_pos pos, int x, int y, +redraw_exposed_gutter (struct frame *f, enum edge_pos pos, int x, int y, int width, int height) { int g_x, g_y, g_width, g_height; @@ -697,10 +668,10 @@ redraw_exposed_gutters (struct frame *f, int x, int y, int width, int height) { - enum gutter_pos pos; + enum edge_pos pos; /* We are already inside the critical section -- our caller did that. */ - GUTTER_POS_LOOP (pos) + EDGE_POS_LOOP (pos) { if (FRAME_GUTTER_VISIBLE (f, pos)) redraw_exposed_gutter (f, pos, x, y, width, height); @@ -710,8 +681,8 @@ void free_frame_gutters (struct frame *f) { - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) + enum edge_pos pos; + EDGE_POS_LOOP (pos) { if (f->current_display_lines[pos]) { @@ -726,16 +697,16 @@ } } -static enum gutter_pos +static enum edge_pos decode_gutter_position (Lisp_Object position) { - if (EQ (position, Qtop)) return TOP_GUTTER; - if (EQ (position, Qbottom)) return BOTTOM_GUTTER; - if (EQ (position, Qleft)) return LEFT_GUTTER; - if (EQ (position, Qright)) return RIGHT_GUTTER; + if (EQ (position, Qtop)) return TOP_EDGE; + if (EQ (position, Qbottom)) return BOTTOM_EDGE; + if (EQ (position, Qleft)) return LEFT_EDGE; + if (EQ (position, Qright)) return RIGHT_EDGE; invalid_constant ("Invalid gutter position", position); - RETURN_NOT_REACHED (TOP_GUTTER); + RETURN_NOT_REACHED (TOP_EDGE); } DEFUN ("set-default-gutter-position", Fset_default_gutter_position, 1, 1, 0, /* @@ -745,8 +716,8 @@ */ (position)) { - enum gutter_pos cur = decode_gutter_position (Vdefault_gutter_position); - enum gutter_pos new_ = decode_gutter_position (position); + enum edge_pos cur = decode_gutter_position (Vdefault_gutter_position); + enum edge_pos new_ = decode_gutter_position (position); if (cur != new_) { @@ -760,7 +731,7 @@ set_specifier_fallback (Vgutter[new_], Vdefault_gutter); set_specifier_fallback (Vgutter_size[cur], list1 (Fcons (Qnil, Qzero))); set_specifier_fallback (Vgutter_size[new_], - new_ == TOP_GUTTER || new_ == BOTTOM_GUTTER + new_ == TOP_EDGE || new_ == BOTTOM_EDGE ? Vdefault_gutter_height : Vdefault_gutter_width); set_specifier_fallback (Vgutter_border_width[cur], @@ -797,7 +768,7 @@ (pos, locale)) { int x, y, width, height; - enum gutter_pos p = TOP_GUTTER; + enum edge_pos p = TOP_EDGE; struct frame *f = decode_frame (FW_FRAME (locale)); if (NILP (pos)) @@ -818,7 +789,7 @@ (pos, locale)) { int x, y, width, height; - enum gutter_pos p = TOP_GUTTER; + enum edge_pos p = TOP_EDGE; struct frame *f = decode_frame (FW_FRAME (locale)); if (NILP (pos)) @@ -880,26 +851,26 @@ specifier caching changes */ static void -recompute_overlaying_specifier (Lisp_Object real_one[4]) +recompute_overlaying_specifier (Lisp_Object real_one[NUM_EDGES]) { - enum gutter_pos pos = decode_gutter_position (Vdefault_gutter_position); + enum edge_pos pos = decode_gutter_position (Vdefault_gutter_position); Fset_specifier_dirty_flag (real_one[pos]); } static void gutter_specs_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval, enum gutter_pos pos); + Lisp_Object oldval, enum edge_pos pos); static void gutter_specs_changed_1 (Lisp_Object arg) { gutter_specs_changed (X1ST (arg), XWINDOW (X2ND (arg)), - X3RD (arg), (enum gutter_pos) XINT (X4TH (arg))); + X3RD (arg), (enum edge_pos) XINT (X4TH (arg))); free_list (arg); } static void gutter_specs_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval, enum gutter_pos pos) + Lisp_Object oldval, enum edge_pos pos) { if (in_display) register_post_redisplay_action (gutter_specs_changed_1, @@ -926,28 +897,28 @@ top_gutter_specs_changed (Lisp_Object specifier, struct window *w, Lisp_Object oldval) { - gutter_specs_changed (specifier, w, oldval, TOP_GUTTER); + gutter_specs_changed (specifier, w, oldval, TOP_EDGE); } static void bottom_gutter_specs_changed (Lisp_Object specifier, struct window *w, Lisp_Object oldval) { - gutter_specs_changed (specifier, w, oldval, BOTTOM_GUTTER); + gutter_specs_changed (specifier, w, oldval, BOTTOM_EDGE); } static void left_gutter_specs_changed (Lisp_Object specifier, struct window *w, Lisp_Object oldval) { - gutter_specs_changed (specifier, w, oldval, LEFT_GUTTER); + gutter_specs_changed (specifier, w, oldval, LEFT_EDGE); } static void right_gutter_specs_changed (Lisp_Object specifier, struct window *w, Lisp_Object oldval) { - gutter_specs_changed (specifier, w, oldval, RIGHT_GUTTER); + gutter_specs_changed (specifier, w, oldval, RIGHT_EDGE); } static void @@ -980,8 +951,8 @@ oldval)); else { - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) + enum edge_pos pos; + EDGE_POS_LOOP (pos) { w->real_gutter_size[pos] = w->gutter_size[pos]; if (EQ (w->real_gutter_size[pos], Qautodetect) @@ -1152,12 +1123,12 @@ void init_frame_gutters (struct frame *f) { - enum gutter_pos pos; + enum edge_pos pos; struct window* w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); /* We are here as far in frame creation so cached specifiers are already recomputed, and possibly modified by resource initialization. We need to recalculate autodetected gutters. */ - GUTTER_POS_LOOP (pos) + EDGE_POS_LOOP (pos) { w->real_gutter[pos] = construct_window_gutter_spec (w, pos); w->real_gutter_size[pos] = w->gutter_size[pos]; @@ -1171,7 +1142,7 @@ } /* Keep a record of the current sizes of things. */ - GUTTER_POS_LOOP (pos) + EDGE_POS_LOOP (pos) { f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); } @@ -1279,19 +1250,19 @@ 0, 0, 1); DEFVAR_SPECIFIER ("top-gutter", - &Vgutter[TOP_GUTTER] /* + &Vgutter[TOP_EDGE] /* Specifier for the gutter at the top of the frame. Use `set-specifier' to change this. See `default-gutter' for a description of a valid gutter instantiator. */ ); - Vgutter[TOP_GUTTER] = Fmake_specifier (Qgutter); - set_specifier_caching (Vgutter[TOP_GUTTER], - offsetof (struct window, gutter[TOP_GUTTER]), + Vgutter[TOP_EDGE] = Fmake_specifier (Qgutter); + set_specifier_caching (Vgutter[TOP_EDGE], + offsetof (struct window, gutter[TOP_EDGE]), top_gutter_specs_changed, 0, 0, 1); DEFVAR_SPECIFIER ("bottom-gutter", - &Vgutter[BOTTOM_GUTTER] /* + &Vgutter[BOTTOM_EDGE] /* Specifier for the gutter at the bottom of the frame. Use `set-specifier' to change this. See `default-gutter' for a description of a valid gutter instantiator. @@ -1301,14 +1272,14 @@ `bottom-gutter-height') is 0; thus, a bottom gutter will not be displayed even if you provide a value for `bottom-gutter'. */ ); - Vgutter[BOTTOM_GUTTER] = Fmake_specifier (Qgutter); - set_specifier_caching (Vgutter[BOTTOM_GUTTER], - offsetof (struct window, gutter[BOTTOM_GUTTER]), + Vgutter[BOTTOM_EDGE] = Fmake_specifier (Qgutter); + set_specifier_caching (Vgutter[BOTTOM_EDGE], + offsetof (struct window, gutter[BOTTOM_EDGE]), bottom_gutter_specs_changed, 0, 0, 1); DEFVAR_SPECIFIER ("left-gutter", - &Vgutter[LEFT_GUTTER] /* + &Vgutter[LEFT_EDGE] /* Specifier for the gutter at the left edge of the frame. Use `set-specifier' to change this. See `default-gutter' for a description of a valid gutter instantiator. @@ -1318,14 +1289,14 @@ `left-gutter-width') is 0; thus, a left gutter will not be displayed even if you provide a value for `left-gutter'. */ ); - Vgutter[LEFT_GUTTER] = Fmake_specifier (Qgutter); - set_specifier_caching (Vgutter[LEFT_GUTTER], - offsetof (struct window, gutter[LEFT_GUTTER]), + Vgutter[LEFT_EDGE] = Fmake_specifier (Qgutter); + set_specifier_caching (Vgutter[LEFT_EDGE], + offsetof (struct window, gutter[LEFT_EDGE]), left_gutter_specs_changed, 0, 0, 1); DEFVAR_SPECIFIER ("right-gutter", - &Vgutter[RIGHT_GUTTER] /* + &Vgutter[RIGHT_EDGE] /* Specifier for the gutter at the right edge of the frame. Use `set-specifier' to change this. See `default-gutter' for a description of a valid gutter instantiator. @@ -1335,9 +1306,9 @@ `right-gutter-width') is 0; thus, a right gutter will not be displayed even if you provide a value for `right-gutter'. */ ); - Vgutter[RIGHT_GUTTER] = Fmake_specifier (Qgutter); - set_specifier_caching (Vgutter[RIGHT_GUTTER], - offsetof (struct window, gutter[RIGHT_GUTTER]), + Vgutter[RIGHT_EDGE] = Fmake_specifier (Qgutter); + set_specifier_caching (Vgutter[RIGHT_EDGE], + offsetof (struct window, gutter[RIGHT_EDGE]), right_gutter_specs_changed, 0, 0, 1); @@ -1345,10 +1316,10 @@ changed with `set-default-gutter-position'. */ fb = list1 (Fcons (Qnil, Qnil)); set_specifier_fallback (Vdefault_gutter, fb); - set_specifier_fallback (Vgutter[TOP_GUTTER], Vdefault_gutter); - set_specifier_fallback (Vgutter[BOTTOM_GUTTER], fb); - set_specifier_fallback (Vgutter[LEFT_GUTTER], fb); - set_specifier_fallback (Vgutter[RIGHT_GUTTER], fb); + set_specifier_fallback (Vgutter[TOP_EDGE], Vdefault_gutter); + set_specifier_fallback (Vgutter[BOTTOM_EDGE], fb); + set_specifier_fallback (Vgutter[LEFT_EDGE], fb); + set_specifier_fallback (Vgutter[RIGHT_EDGE], fb); DEFVAR_SPECIFIER ("default-gutter-height", &Vdefault_gutter_height /* *Height of the default gutter, if it's oriented horizontally. @@ -1394,51 +1365,51 @@ 0, 0, 1); DEFVAR_SPECIFIER ("top-gutter-height", - &Vgutter_size[TOP_GUTTER] /* + &Vgutter_size[TOP_EDGE] /* *Height of the top gutter. This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgutter_size); - set_specifier_caching (Vgutter_size[TOP_GUTTER], - offsetof (struct window, gutter_size[TOP_GUTTER]), + Vgutter_size[TOP_EDGE] = Fmake_specifier (Qgutter_size); + set_specifier_caching (Vgutter_size[TOP_EDGE], + offsetof (struct window, gutter_size[TOP_EDGE]), gutter_geometry_changed_in_window, 0, 0, 1); DEFVAR_SPECIFIER ("bottom-gutter-height", - &Vgutter_size[BOTTOM_GUTTER] /* + &Vgutter_size[BOTTOM_EDGE] /* *Height of the bottom gutter. This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_size); - set_specifier_caching (Vgutter_size[BOTTOM_GUTTER], - offsetof (struct window, gutter_size[BOTTOM_GUTTER]), + Vgutter_size[BOTTOM_EDGE] = Fmake_specifier (Qgutter_size); + set_specifier_caching (Vgutter_size[BOTTOM_EDGE], + offsetof (struct window, gutter_size[BOTTOM_EDGE]), gutter_geometry_changed_in_window, 0, 0, 1); DEFVAR_SPECIFIER ("left-gutter-width", - &Vgutter_size[LEFT_GUTTER] /* + &Vgutter_size[LEFT_EDGE] /* *Width of left gutter. This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qgutter_size); - set_specifier_caching (Vgutter_size[LEFT_GUTTER], - offsetof (struct window, gutter_size[LEFT_GUTTER]), + Vgutter_size[LEFT_EDGE] = Fmake_specifier (Qgutter_size); + set_specifier_caching (Vgutter_size[LEFT_EDGE], + offsetof (struct window, gutter_size[LEFT_EDGE]), gutter_geometry_changed_in_window, 0, 0, 1); DEFVAR_SPECIFIER ("right-gutter-width", - &Vgutter_size[RIGHT_GUTTER] /* + &Vgutter_size[RIGHT_EDGE] /* *Width of right gutter. This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qgutter_size); - set_specifier_caching (Vgutter_size[RIGHT_GUTTER], - offsetof (struct window, gutter_size[RIGHT_GUTTER]), + Vgutter_size[RIGHT_EDGE] = Fmake_specifier (Qgutter_size); + set_specifier_caching (Vgutter_size[RIGHT_EDGE], + offsetof (struct window, gutter_size[RIGHT_EDGE]), gutter_geometry_changed_in_window, 0, 0, 1); fb = Qnil; @@ -1475,11 +1446,11 @@ if (!NILP (fb)) set_specifier_fallback (Vdefault_gutter_width, fb); - set_specifier_fallback (Vgutter_size[TOP_GUTTER], Vdefault_gutter_height); + set_specifier_fallback (Vgutter_size[TOP_EDGE], Vdefault_gutter_height); fb = list1 (Fcons (Qnil, Qzero)); - set_specifier_fallback (Vgutter_size[BOTTOM_GUTTER], fb); - set_specifier_fallback (Vgutter_size[LEFT_GUTTER], fb); - set_specifier_fallback (Vgutter_size[RIGHT_GUTTER], fb); + set_specifier_fallback (Vgutter_size[BOTTOM_EDGE], fb); + set_specifier_fallback (Vgutter_size[LEFT_EDGE], fb); + set_specifier_fallback (Vgutter_size[RIGHT_EDGE], fb); DEFVAR_SPECIFIER ("default-gutter-border-width", &Vdefault_gutter_border_width /* @@ -1502,55 +1473,55 @@ 0, 0, 0); DEFVAR_SPECIFIER ("top-gutter-border-width", - &Vgutter_border_width[TOP_GUTTER] /* + &Vgutter_border_width[TOP_EDGE] /* *Border width of the top gutter. This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_border_width[TOP_GUTTER] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vgutter_border_width[TOP_GUTTER], + Vgutter_border_width[TOP_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vgutter_border_width[TOP_EDGE], offsetof (struct window, - gutter_border_width[TOP_GUTTER]), + gutter_border_width[TOP_EDGE]), gutter_geometry_changed_in_window, 0, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-border-width", - &Vgutter_border_width[BOTTOM_GUTTER] /* + &Vgutter_border_width[BOTTOM_EDGE] /* *Border width of the bottom gutter. This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_border_width[BOTTOM_GUTTER] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER], + Vgutter_border_width[BOTTOM_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vgutter_border_width[BOTTOM_EDGE], offsetof (struct window, - gutter_border_width[BOTTOM_GUTTER]), + gutter_border_width[BOTTOM_EDGE]), gutter_geometry_changed_in_window, 0, 0, 0); DEFVAR_SPECIFIER ("left-gutter-border-width", - &Vgutter_border_width[LEFT_GUTTER] /* + &Vgutter_border_width[LEFT_EDGE] /* *Border width of left gutter. This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_border_width[LEFT_GUTTER] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vgutter_border_width[LEFT_GUTTER], + Vgutter_border_width[LEFT_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vgutter_border_width[LEFT_EDGE], offsetof (struct window, - gutter_border_width[LEFT_GUTTER]), + gutter_border_width[LEFT_EDGE]), gutter_geometry_changed_in_window, 0, 0, 0); DEFVAR_SPECIFIER ("right-gutter-border-width", - &Vgutter_border_width[RIGHT_GUTTER] /* + &Vgutter_border_width[RIGHT_EDGE] /* *Border width of right gutter. This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_border_width[RIGHT_GUTTER] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER], + Vgutter_border_width[RIGHT_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vgutter_border_width[RIGHT_EDGE], offsetof (struct window, - gutter_border_width[RIGHT_GUTTER]), + gutter_border_width[RIGHT_EDGE]), gutter_geometry_changed_in_window, 0, 0, 0); fb = Qnil; @@ -1567,11 +1538,11 @@ if (!NILP (fb)) set_specifier_fallback (Vdefault_gutter_border_width, fb); - set_specifier_fallback (Vgutter_border_width[TOP_GUTTER], Vdefault_gutter_border_width); + set_specifier_fallback (Vgutter_border_width[TOP_EDGE], Vdefault_gutter_border_width); fb = list1 (Fcons (Qnil, Qzero)); - set_specifier_fallback (Vgutter_border_width[BOTTOM_GUTTER], fb); - set_specifier_fallback (Vgutter_border_width[LEFT_GUTTER], fb); - set_specifier_fallback (Vgutter_border_width[RIGHT_GUTTER], fb); + set_specifier_fallback (Vgutter_border_width[BOTTOM_EDGE], fb); + set_specifier_fallback (Vgutter_border_width[LEFT_EDGE], fb); + set_specifier_fallback (Vgutter_border_width[RIGHT_EDGE], fb); DEFVAR_SPECIFIER ("default-gutter-visible-p", &Vdefault_gutter_visible_p /* *Whether the default gutter is visible. @@ -1596,64 +1567,64 @@ 0, 0, 0); DEFVAR_SPECIFIER ("top-gutter-visible-p", - &Vgutter_visible_p[TOP_GUTTER] /* + &Vgutter_visible_p[TOP_EDGE] /* *Whether the top gutter is visible. This is a specifier; use `set-specifier' to change it. See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qgutter_visible); - set_specifier_caching (Vgutter_visible_p[TOP_GUTTER], + Vgutter_visible_p[TOP_EDGE] = Fmake_specifier (Qgutter_visible); + set_specifier_caching (Vgutter_visible_p[TOP_EDGE], offsetof (struct window, - gutter_visible_p[TOP_GUTTER]), + gutter_visible_p[TOP_EDGE]), top_gutter_specs_changed, 0, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-visible-p", - &Vgutter_visible_p[BOTTOM_GUTTER] /* + &Vgutter_visible_p[BOTTOM_EDGE] /* *Whether the bottom gutter is visible. This is a specifier; use `set-specifier' to change it. See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_visible); - set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER], + Vgutter_visible_p[BOTTOM_EDGE] = Fmake_specifier (Qgutter_visible); + set_specifier_caching (Vgutter_visible_p[BOTTOM_EDGE], offsetof (struct window, - gutter_visible_p[BOTTOM_GUTTER]), + gutter_visible_p[BOTTOM_EDGE]), bottom_gutter_specs_changed, 0, 0, 0); DEFVAR_SPECIFIER ("left-gutter-visible-p", - &Vgutter_visible_p[LEFT_GUTTER] /* + &Vgutter_visible_p[LEFT_EDGE] /* *Whether the left gutter is visible. This is a specifier; use `set-specifier' to change it. See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qgutter_visible); - set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER], + Vgutter_visible_p[LEFT_EDGE] = Fmake_specifier (Qgutter_visible); + set_specifier_caching (Vgutter_visible_p[LEFT_EDGE], offsetof (struct window, - gutter_visible_p[LEFT_GUTTER]), + gutter_visible_p[LEFT_EDGE]), left_gutter_specs_changed, 0, 0, 0); DEFVAR_SPECIFIER ("right-gutter-visible-p", - &Vgutter_visible_p[RIGHT_GUTTER] /* + &Vgutter_visible_p[RIGHT_EDGE] /* *Whether the right gutter is visible. This is a specifier; use `set-specifier' to change it. See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qgutter_visible); - set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER], + Vgutter_visible_p[RIGHT_EDGE] = Fmake_specifier (Qgutter_visible); + set_specifier_caching (Vgutter_visible_p[RIGHT_EDGE], offsetof (struct window, - gutter_visible_p[RIGHT_GUTTER]), + gutter_visible_p[RIGHT_EDGE]), right_gutter_specs_changed, 0, 0, 0); /* initially, top inherits from default; this can be changed with `set-default-gutter-position'. */ fb = list1 (Fcons (Qnil, Qt)); set_specifier_fallback (Vdefault_gutter_visible_p, fb); - set_specifier_fallback (Vgutter_visible_p[TOP_GUTTER], + set_specifier_fallback (Vgutter_visible_p[TOP_EDGE], Vdefault_gutter_visible_p); - set_specifier_fallback (Vgutter_visible_p[BOTTOM_GUTTER], fb); - set_specifier_fallback (Vgutter_visible_p[LEFT_GUTTER], fb); - set_specifier_fallback (Vgutter_visible_p[RIGHT_GUTTER], fb); + set_specifier_fallback (Vgutter_visible_p[BOTTOM_EDGE], fb); + set_specifier_fallback (Vgutter_visible_p[LEFT_EDGE], fb); + set_specifier_fallback (Vgutter_visible_p[RIGHT_EDGE], fb); }
--- a/src/gutter.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/gutter.h Sun Mar 07 02:09:59 2010 -0600 @@ -1,5 +1,6 @@ /* Define general gutter support. Copyright (C) 1999 Andy Piper. + Copyright (C) 2010 Ben Wing. This file is part of XEmacs. @@ -36,18 +37,6 @@ #define DEFAULT_GUTTER_WIDTH 40 #define DEFAULT_GUTTER_BORDER_WIDTH 2 -enum gutter_pos -{ - TOP_GUTTER = 0, - BOTTOM_GUTTER = 1, - LEFT_GUTTER = 2, - RIGHT_GUTTER = 3 -}; - -/* Iterate over all possible gutter positions */ -#define GUTTER_POS_LOOP(var) \ - for (var = (enum gutter_pos) 0; var < 4; var = (enum gutter_pos) (var + 1)) - extern Lisp_Object Qgutter; extern Lisp_Object Vgutter_size[4]; @@ -97,13 +86,13 @@ /* these macros predicate size on position and type of window */ #define WINDOW_REAL_TOP_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,TOP_GUTTER) + WINDOW_REAL_GUTTER_BOUNDS (w, TOP_EDGE) #define WINDOW_REAL_BOTTOM_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,BOTTOM_GUTTER) + WINDOW_REAL_GUTTER_BOUNDS (w, BOTTOM_EDGE) #define WINDOW_REAL_LEFT_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,LEFT_GUTTER) + WINDOW_REAL_GUTTER_BOUNDS (w, LEFT_EDGE) #define WINDOW_REAL_RIGHT_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,RIGHT_GUTTER) + WINDOW_REAL_GUTTER_BOUNDS (w, RIGHT_EDGE) #define FRAME_GUTTER_VISIBLE(f, pos) \ WINDOW_REAL_GUTTER_VISIBLE (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) @@ -118,13 +107,9 @@ WINDOW_GUTTER (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) /* these macros predicate size on position and type of window */ -#define FRAME_TOP_GUTTER_BOUNDS(f) \ - WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), TOP_GUTTER) -#define FRAME_BOTTOM_GUTTER_BOUNDS(f) \ - WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), BOTTOM_GUTTER) -#define FRAME_LEFT_GUTTER_BOUNDS(f) \ - WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), LEFT_GUTTER) -#define FRAME_RIGHT_GUTTER_BOUNDS(f) \ - WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), RIGHT_GUTTER) +#define FRAME_TOP_GUTTER_BOUNDS(f) FRAME_GUTTER_BOUNDS (f, TOP_EDGE) +#define FRAME_BOTTOM_GUTTER_BOUNDS(f) FRAME_GUTTER_BOUNDS (f, BOTTOM_EDGE) +#define FRAME_LEFT_GUTTER_BOUNDS(f) FRAME_GUTTER_BOUNDS (f, LEFT_EDGE) +#define FRAME_RIGHT_GUTTER_BOUNDS(f) FRAME_GUTTER_BOUNDS (f, RIGHT_EDGE) #endif /* INCLUDED_gutter_h_ */
--- a/src/input-method-xlib.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/input-method-xlib.c Sun Mar 07 02:09:59 2010 -0600 @@ -1,6 +1,6 @@ /* Various functions for X11R5+ input methods, using the Xlib interface. Copyright (C) 1996 Sun Microsystems. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2010 Ben Wing. This file is part of XEmacs. @@ -411,10 +411,15 @@ if (needed->width == 0) /* Use XNArea instead of XNAreaNeeded */ XIC_Value (Get, xic, XNStatusAttributes, XNArea, &needed); + /* #### This will partially cover the gutter if there is a bottom + gutter. Perhaps what was intended was FRAME_PANED_RIGHT_EDGE() + and FRAME_PANED_BOTTOM_EDGE()? That will actually place itself + in the paned area (covering the right edge of the minibuffer) + in all circumstances. */ area.width = needed->width; area.height = needed->height; - area.x = FRAME_RIGHT_BORDER_START (f) - area.width; - area.y = FRAME_BOTTOM_BORDER_START (f) - area.height; + area.x = FRAME_RIGHT_INTERNAL_BORDER_START (f) - area.width; + area.y = FRAME_BOTTOM_INTERNAL_BORDER_START (f) - area.height; #ifdef DEBUG_XIM stderr_out ("Putting StatusArea in x=%d y=%d w=%d h=%d\n", @@ -430,10 +435,10 @@ /* We include the border because Preedit window might be larger than display line at edge. #### FIX: we should adjust to make sure that there is always room for the spot sub-window */ - area.x = FRAME_LEFT_BORDER_START (f); - area.y = FRAME_TOP_BORDER_START (f); - area.width = FRAME_RIGHT_BORDER_END (f) - area.x; - area.height = FRAME_BOTTOM_BORDER_END (f) - area.y; + area.x = FRAME_LEFT_INTERNAL_BORDER_START (f); + area.y = FRAME_TOP_INTERNAL_BORDER_START (f); + area.width = FRAME_RIGHT_INTERNAL_BORDER_END (f) - area.x; + area.height = FRAME_BOTTOM_INTERNAL_BORDER_END (f) - area.y; XIC_Value(Set, xic, XNPreeditAttributes, XNArea, &area); }
--- a/src/keymap.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/keymap.c Sun Mar 07 02:09:59 2010 -0600 @@ -1728,7 +1728,7 @@ if (indx == 0) new_keys = keys; else if (STRINGP (keys)) - new_keys = Fsubstring (keys, Qzero, make_int (indx)); + new_keys = Fsubseq (keys, Qzero, make_int (indx)); else if (VECTORP (keys)) { new_keys = make_vector (indx, Qnil);
--- a/src/linuxplay.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/linuxplay.c Sun Mar 07 02:09:59 2010 -0600 @@ -72,7 +72,7 @@ static int mix_fd; static int audio_vol; static int audio_fd; -static Ascbyte *audio_dev = "/dev/dsp"; +static const Ascbyte *audio_dev = "/dev/dsp"; /* Intercept SIGINT and SIGHUP in order to close the audio and mixer devices before terminating sound output; this requires reliable
--- a/src/lisp.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/lisp.h Sun Mar 07 02:09:59 2010 -0600 @@ -85,6 +85,16 @@ %%#### marks places that need work for KKCC (the new garbage collector). + @@#### marks places that need work to get Unicode-internal working, + i.e. using UTF-8 as the internal text format. + + #### BILL! marks places that need work for GTK. + + #### GEOM! marks places needing work to fix various bugs in the handling + of window and frame sizing and positioning. Often the root of the + problems is that the code was originally written before there was a + gutter and then not completely fixed up to accommodate the gutter. + */ /************************************************************************/ @@ -1229,6 +1239,9 @@ /* Highly dubious kludge */ /* (thanks, Jamie, I feel better now -- ben) */ MODULE_API void assert_failed (const Ascbyte *, int, const Ascbyte *); +void assert_equal_failed (const Ascbyte *file, int line, EMACS_INT x, + EMACS_INT y, const Ascbyte *exprx, + const Ascbyte *expry); #define ABORT() assert_failed (__FILE__, __LINE__, "ABORT()") #define abort_with_message(msg) assert_failed (__FILE__, __LINE__, msg) @@ -1249,6 +1262,10 @@ ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, msg)) # define assert_at_line(x, file, line) \ ((x) ? (void) 0 : assert_failed (file, line, #x)) +# define assert_equal(x, y) \ + ((x) == (y) ? (void) 0 : \ + assert_equal_failed (__FILE__, __LINE__, (EMACS_INT) x, (EMACS_INT) y, \ + #x, #y)) #else /* This used to be ((void) (0)) but that triggers lots of unused variable warnings. It's pointless to force all that code to be rewritten, with @@ -1257,6 +1274,7 @@ # define assert(x) disabled_assert (x) # define assert_with_message(x, msg) disabled_assert_with_message (x, msg) # define assert_at_line(x, file, line) disabled_assert_at_line (x, file, line) +# define assert_equal(x, y) disabled_assert ((x) == (y)) #endif /************************************************************************/ @@ -1544,16 +1562,6 @@ RUN_HOOKS_UNTIL_FAILURE }; -#ifdef HAVE_TOOLBARS -enum toolbar_pos -{ - TOP_TOOLBAR, - BOTTOM_TOOLBAR, - LEFT_TOOLBAR, - RIGHT_TOOLBAR -}; -#endif - enum edge_style { EDGE_ETCHED_IN, @@ -3458,8 +3466,18 @@ x = wrong_type_argument (Qnatnump, x); \ } while (0) +END_C_DECLS + +/* -------------- properties of internally-formatted text ------------- */ + +#include "text.h" + /*------------------------------- char ---------------------------------*/ +BEGIN_C_DECLS + +#ifdef ERROR_CHECK_TYPES + /* NOTE: There are basic functions for converting between a character and the string representation of a character in text.h, as well as lots of other character-related stuff. There are other functions/macros for @@ -3467,31 +3485,6 @@ Ichar, the length of an Ichar when converted to text, etc. */ -#ifdef MULE - -MODULE_API int non_ascii_valid_ichar_p (Ichar ch); - -/* Return whether the given Ichar is valid. - */ - -DECLARE_INLINE_HEADER ( -int -valid_ichar_p (Ichar ch) -) -{ - return (! (ch & ~0xFF)) || non_ascii_valid_ichar_p (ch); -} - -#else /* not MULE */ - -/* This works when CH is negative, and correctly returns non-zero only when CH - is in the range [0, 255], inclusive. */ -#define valid_ichar_p(ch) (! (ch & ~0xFF)) - -#endif /* not MULE */ - -#ifdef ERROR_CHECK_TYPES - DECLARE_INLINE_HEADER ( int CHARP_1 (Lisp_Object obj, const Ascbyte *file, int line) @@ -3839,37 +3832,6 @@ END_C_DECLS /************************************************************************/ -/* Definitions related to the format of text and of characters */ -/************************************************************************/ - -/* Note: - - "internally formatted text" and the term "internal format" in - general are likely to refer to the format of text in buffers and - strings; "externally formatted text" and the term "external format" - refer to any text format used in the O.S. or elsewhere outside of - XEmacs. The format of text and of a character are related and - there must be a one-to-one relationship (hopefully through a - relatively simple algorithmic means of conversion) between a string - of text and an equivalent array of characters, but the conversion - between the two is NOT necessarily trivial. - - In a non-Mule XEmacs, allowed characters are numbered 0 through - 255, where no fixed meaning is assigned to them, but (when - representing text, rather than bytes in a binary file) in practice - the lower half represents ASCII and the upper half some other 8-bit - character set (chosen by setting the font, case tables, syntax - tables, etc. appropriately for the character set through ad-hoc - means such as the `iso-8859-1' file and the - `standard-display-european' function). - - #### Finish this. - - */ -#include "text.h" - - -/************************************************************************/ /* Definitions of primitive Lisp functions and variables */ /************************************************************************/ @@ -4051,6 +4013,136 @@ while (NILP (Ffunctionp (fun))) \ signal_invalid_function_error (fun); \ } while (0) + +/************************************************************************/ +/* Parsing keyword arguments */ +/************************************************************************/ + +/* The C subr must have been declared with MANY as its max args, and this + PARSE_KEYWORDS call must come before any statements. + + FUNCTION is the name of the current function, as a symbol. + + NARGS is the count of arguments supplied to FUNCTION. + + ARGS is a pointer to the argument vector (not a Lisp vector) supplied to + FUNCTION. + + KEYWORDS_OFFSET is the offset into ARGS where the keyword arguments start. + + KEYWORD_COUNT is the number of keywords FUNCTION is normally prepared to + handle. + + KEYWORDS is a parenthesised list of those keywords, without the initial + Q_. + + KEYWORD_DEFAULTS allows you to set non-nil defaults. Put (keywordname = + initial_value) in this parameter, a collection of C statements surrounded + by parentheses and separated by the comma operator. If you don't need + this, supply NULL as KEYWORD_DEFAULTS. + + ALLOW_OTHER_KEYS corresponds to the &allow-other-keys argument list + entry in defun*; it is 1 if other keys are normally allowed, 0 + otherwise. This may be overridden in the caller by specifying + :allow-other-keys t in the argument list. + + For keywords which appear multiple times in the called argument list, the + leftmost one overrides, as specified in section 7.1.1 of the CLHS. + + If you want to check whether a given keyword argument was set (as in the + SVAR argument to defun*), supply Qunbound as its default in + KEYWORD_DEFAULTS, and examine it once PARSE_KEYWORDS is done. Lisp code + cannot supply Qunbound as an argument, so if it is still Qunbound, it was + not set. + + There is no elegant way with this macro to have one name for the keyword + and an unrelated name for the local variable, as is possible with the + ((:keyword unrelated-var)) syntax in defun* and in Common Lisp. That + shouldn't matter in practice. */ + +#define PARSE_KEYWORDS(function, nargs, args, keywords_offset, \ + keyword_count, keywords, keyword_defaults, \ + allow_other_keys) \ + DECLARE_N_KEYWORDS_##keyword_count keywords; \ + \ + do \ + { \ + Lisp_Object pk_key, pk_value; \ + Elemcount pk_i = nargs - 1; \ + Boolint pk_allow_other_keys = allow_other_keys; \ + \ + if ((nargs - keywords_offset) & 1) \ + { \ + if (!allow_other_keys \ + && !(pk_allow_other_keys \ + = non_nil_allow_other_keys_p (keywords_offset, \ + nargs, args))) \ + { \ + signal_wrong_number_of_arguments_error (function, nargs); \ + } \ + else \ + { \ + /* Ignore the trailing arg; so below always sees an even \ + number of arguments. */ \ + pk_i -= 1; \ + } \ + } \ + \ + (void)(keyword_defaults); \ + \ + /* Start from the end, because the leftmost element overrides. */ \ + while (pk_i > keywords_offset) \ + { \ + pk_value = args[pk_i--]; \ + pk_key = args[pk_i--]; \ + \ + if (0) {} \ + CHECK_N_KEYWORDS_##keyword_count keywords \ + else if (allow_other_keys || pk_allow_other_keys) \ + { \ + continue; \ + } \ + else if (!(pk_allow_other_keys \ + = non_nil_allow_other_keys_p (keywords_offset, \ + nargs, args))) \ + { \ + invalid_keyword_argument (function, pk_key); \ + } \ + } \ + } while (0) + +#define DECLARE_N_KEYWORDS_1(a) \ + Lisp_Object a = Qnil +#define DECLARE_N_KEYWORDS_2(a,b) \ + DECLARE_N_KEYWORDS_1(a), b = Qnil +#define DECLARE_N_KEYWORDS_3(a,b,c) \ + DECLARE_N_KEYWORDS_2(a,b), c = Qnil +#define DECLARE_N_KEYWORDS_4(a,b,c,d) \ + DECLARE_N_KEYWORDS_3(a,b,c), d = Qnil +#define DECLARE_N_KEYWORDS_5(a,b,c,d,e) \ + DECLARE_N_KEYWORDS_4(a,b,c,d), e = Qnil +#define DECLARE_N_KEYWORDS_6(a,b,c,d,e,f) \ + DECLARE_N_KEYWORDS_5(a,b,c,d,e), f = Qnil +#define DECLARE_N_KEYWORDS_7(a,b,c,d,e,f,g) \ + DECLARE_N_KEYWORDS_6(a,b,c,d,e,f), g = Qnil + +#define CHECK_N_KEYWORDS_1(a) \ + else if (EQ (pk_key, Q_##a)) { a = pk_value; } +#define CHECK_N_KEYWORDS_2(a,b) CHECK_N_KEYWORDS_1(a) \ + else if (EQ (pk_key, Q_##b)) { b = pk_value; } +#define CHECK_N_KEYWORDS_3(a,b,c) CHECK_N_KEYWORDS_2(a,b) \ + else if (EQ (pk_key, Q_##c)) { c = pk_value; } +#define CHECK_N_KEYWORDS_4(a,b,c,d) CHECK_N_KEYWORDS_3(a,b,c) \ + else if (EQ (pk_key, Q_##d)) { d = pk_value; } +#define CHECK_N_KEYWORDS_5(a,b,c,d,e) CHECK_N_KEYWORDS_4(a,b,c,d) \ + else if (EQ (pk_key, Q_##e)) { e = pk_value; } +#define CHECK_N_KEYWORDS_6(a,b,c,d,e,f) CHECK_N_KEYWORDS_5(a,b,c,d,e) \ + else if (EQ (pk_key, Q_##f)) { f = pk_value; } +#define CHECK_N_KEYWORDS_7(a,b,c,d,e,f,g) CHECK_N_KEYWORDS_6(a,b,c,d,e,f) \ + else if (EQ (pk_key, Q_##g)) { g = pk_value; } + +Boolint non_nil_allow_other_keys_p (Elemcount offset, int nargs, + Lisp_Object *args); /************************************************************************/ @@ -4907,7 +4999,8 @@ Qcircular_list, Qcircular_property_list, Qconversion_error, Qcyclic_variable_indirection, Qdomain_error, Qediting_error, Qend_of_buffer, Qend_of_file, Qerror, Qfile_error, Qinternal_error, - Qinvalid_change, Qinvalid_constant, Qinvalid_function, Qinvalid_operation, + Qinvalid_change, Qinvalid_constant, Qinvalid_function, + Qinvalid_keyword_argument, Qinvalid_operation, Qinvalid_read_syntax, Qinvalid_state, Qio_error, Qlist_formation_error, Qmalformed_list, Qmalformed_property_list, Qno_catch, Qout_of_memory, Qoverflow_error, Qprinting_unreadable_object, Qquit, Qrange_error, @@ -5135,6 +5228,8 @@ Lisp_Object frob2)); void maybe_invalid_argument (const Ascbyte *, Lisp_Object, Lisp_Object, Error_Behavior); +MODULE_API DECLARE_DOESNT_RETURN (invalid_keyword_argument (Lisp_Object fun, + Lisp_Object kw)); MODULE_API DECLARE_DOESNT_RETURN (invalid_operation (const Ascbyte *reason, Lisp_Object frob)); MODULE_API DECLARE_DOESNT_RETURN (invalid_operation_2 (const Ascbyte *reason, @@ -5528,7 +5623,7 @@ EXFUN (Fsort, 2); EXFUN (Fstring_equal, 2); EXFUN (Fstring_lessp, 2); -EXFUN (Fsubstring, 3); +EXFUN (Fsubseq, 3); EXFUN (Fvalid_plist_p, 1); Lisp_Object list_sort (Lisp_Object, Lisp_Object,
--- a/src/lread.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/lread.c Sun Mar 07 02:09:59 2010 -0600 @@ -1982,8 +1982,14 @@ if (*read_ptr == '+') read_ptr++; ratio_set_string (scratch_ratio, read_ptr, 0); - ratio_canonicalize (scratch_ratio); - return Fcanonicalize_number (make_ratio_rt (scratch_ratio)); + if (bignum_sign (ratio_denominator (scratch_ratio)) != 0) { + ratio_canonicalize (scratch_ratio); + return Fcanonicalize_number (make_ratio_rt (scratch_ratio)); + } + return Fsignal (Qinvalid_read_syntax, + list2 (build_msg_string + ("Invalid ratio constant in reader"), + make_string ((Ibyte *) read_ptr, len))); } #endif if (isfloat_string (read_ptr))
--- a/src/lrecord.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/lrecord.h Sun Mar 07 02:09:59 2010 -0600 @@ -747,12 +747,10 @@ doesn't care about the dumper flag and makes use of some of the stuff normally omitted from the "abbreviated" description -- see above. - A memory_description is an array of values. (This is actually - misnamed, in that it does not just describe lrecords, but any - blocks of memory.) The first value of each line is a type, the - second the offset in the lrecord structure. The third and - following elements are parameters; their presence, type and number - is type-dependent. + A memory_description is an array of values. The first value of each + line is a type, the second the offset in the lrecord structure. The + third and following elements are parameters; their presence, type and + number is type-dependent. The description ends with an "XD_END" record.
--- a/src/minibuf.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/minibuf.c Sun Mar 07 02:09:59 2010 -0600 @@ -513,7 +513,7 @@ return Qt; /* Else extract the part in which all completions agree */ - return Fsubstring (bestmatch, Qzero, make_int (bestmatchsize)); + return Fsubseq (bestmatch, Qzero, make_int (bestmatchsize)); }
--- a/src/mule-coding.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/mule-coding.c Sun Mar 07 02:09:59 2010 -0600 @@ -1,7 +1,7 @@ /* Conversion functions for I18N encodings, but not Unicode (in separate file). Copyright (C) 1991, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2010 Ben Wing. This file is part of XEmacs. @@ -2545,7 +2545,7 @@ if (EQ (charset, Vcharset_control_1)) { if (XCODING_SYSTEM_ISO2022_ESCAPE_QUOTED (codesys) - && fit_to_be_escape_quoted (c)) + && fit_to_be_escape_quoted (c - 0x20)) Dynarr_add (dst, ISO_CODE_ESC); /* you asked for it ... */ Dynarr_add (dst, c - 0x20);
--- a/src/native-gtk-toolbar.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/native-gtk-toolbar.c Sun Mar 07 02:09:59 2010 -0600 @@ -1,5 +1,6 @@ /* toolbar implementation -- GTK interface. Copyright (C) 2000 Aaron Lehmann + Copyright (C) 2010 Ben Wing. This file is part of XEmacs. @@ -32,29 +33,8 @@ #include "toolbar.h" #include "window.h" -#define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag) \ - do { \ - switch (pos) \ - { \ - case TOP_TOOLBAR: \ - (frame)->top_toolbar_was_visible = flag; \ - break; \ - case BOTTOM_TOOLBAR: \ - (frame)->bottom_toolbar_was_visible = flag; \ - break; \ - case LEFT_TOOLBAR: \ - (frame)->left_toolbar_was_visible = flag; \ - break; \ - case RIGHT_TOOLBAR: \ - (frame)->right_toolbar_was_visible = flag; \ - break; \ - default: \ - ABORT (); \ - } \ - } while (0) - static void -gtk_clear_toolbar (struct frame *f, enum toolbar_pos pos); +gtk_clear_toolbar (struct frame *f, enum edge_pos pos); static void gtk_toolbar_callback (GtkWidget *UNUSED (w), gpointer user_data) @@ -66,7 +46,7 @@ static void -gtk_output_toolbar (struct frame *f, enum toolbar_pos pos) +gtk_output_toolbar (struct frame *f, enum edge_pos pos) { GtkWidget *toolbar; Lisp_Object button, window, glyph, instance; @@ -114,7 +94,7 @@ { gtk_clear_toolbar (f, pos); FRAME_GTK_TOOLBAR_WIDGET (f)[pos] = toolbar = - gtk_toolbar_new (((pos == TOP_TOOLBAR) || (pos == BOTTOM_TOOLBAR)) ? + gtk_toolbar_new (((pos == TOP_EDGE) || (pos == BOTTOM_EDGE)) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL, GTK_TOOLBAR_BOTH); } @@ -193,7 +173,7 @@ } static void -gtk_clear_toolbar (struct frame *f, enum toolbar_pos pos) +gtk_clear_toolbar (struct frame *f, enum edge_pos pos) { FRAME_GTK_TOOLBAR_CHECKSUM (f, pos) = 0; SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0); @@ -204,25 +184,15 @@ static void gtk_output_frame_toolbars (struct frame *f) { - if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) - gtk_output_toolbar (f, TOP_TOOLBAR); - else if (f->top_toolbar_was_visible) - gtk_clear_toolbar (f, TOP_TOOLBAR); - - if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) - gtk_output_toolbar (f, BOTTOM_TOOLBAR); - else if (f->bottom_toolbar_was_visible) - gtk_clear_toolbar (f, LEFT_TOOLBAR); + enum edge_pos pos; - if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) - gtk_output_toolbar (f, LEFT_TOOLBAR); - else if (f->left_toolbar_was_visible) - gtk_clear_toolbar (f, LEFT_TOOLBAR); - - if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) - gtk_output_toolbar (f, RIGHT_TOOLBAR); - else if (f->right_toolbar_was_visible) - gtk_clear_toolbar (f, RIGHT_TOOLBAR); + EDGE_POS_LOOP (pos) + { + if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos)) + gtk_output_toolbar (f, pos); + else if (f->toolbar_was_visible[pos]) + gtk_clear_toolbar (f, pos); + } } static void
--- a/src/objects-impl.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/objects-impl.h Sun Mar 07 02:09:59 2010 -0600 @@ -1,6 +1,7 @@ /* Generic object functions -- header implementation. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995, 1996, 2002 Ben Wing. + Copyright (C) 2010 Didier Verna This file is part of XEmacs. @@ -93,6 +94,31 @@ #define CONCHECK_FACE_BOOLEAN_SPECIFIER(x) \ CONCHECK_SPECIFIER_TYPE (x, face_boolean) +/***************************************************************************** + * Background Placement Specifier Object * + *****************************************************************************/ + +struct face_background_placement_specifier +{ + Lisp_Object face; /* face this is attached to, or nil */ +}; + +#define FACE_BACKGROUND_PLACEMENT_SPECIFIER_DATA(g) \ + SPECIFIER_TYPE_DATA (g, face_background_placement) +#define FACE_BACKGROUND_PLACEMENT_SPECIFIER_FACE(g) \ + (FACE_BACKGROUND_PLACEMENT_SPECIFIER_DATA (g)->face) + +DECLARE_SPECIFIER_TYPE (face_background_placement); +extern Lisp_Object Qface_background_placement, Qabsolute, Qrelative; +#define XFACE_BACKGROUND_PLACEMENT_SPECIFIER(x) \ + XSPECIFIER_TYPE (x, face_background_placement) +#define FACE_BACKGROUND_PLACEMENT_SPECIFIERP(x) \ + SPECIFIER_TYPEP (x, face_background_placement) +#define CHECK_FACE_BACKGROUND_PLACEMENT_SPECIFIER(x) \ + CHECK_SPECIFIER_TYPE (x, face_background_placement) +#define CONCHECK_FACE_BACKGROUND_PLACEMENT_SPECIFIER(x) \ + CONCHECK_SPECIFIER_TYPE (x, face_background_placement) + /**************************************************************************** * Color Instance Object * ****************************************************************************/
--- a/src/objects.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/objects.c Sun Mar 07 02:09:59 2010 -0600 @@ -2,6 +2,7 @@ Copyright (C) 1995 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995, 1996, 2002, 2004, 2005, 2010 Ben Wing. + Copyright (C) 2010 Didier Verna This file is part of XEmacs. @@ -1210,6 +1211,130 @@ } +/***************************************************************************** + Face Background Placement Object + ****************************************************************************/ +Lisp_Object Qabsolute, Qrelative; + +static const struct memory_description +face_background_placement_specifier_description[] = { + { XD_LISP_OBJECT, offsetof (struct face_background_placement_specifier, + face) }, + { XD_END } +}; + +DEFINE_SPECIFIER_TYPE_WITH_DATA (face_background_placement); +Lisp_Object Qface_background_placement; + +static void +face_background_placement_create (Lisp_Object obj) +{ + Lisp_Specifier *face_background_placement + = XFACE_BACKGROUND_PLACEMENT_SPECIFIER (obj); + + FACE_BACKGROUND_PLACEMENT_SPECIFIER_FACE (face_background_placement) = Qnil; +} + +static void +face_background_placement_mark (Lisp_Object obj) +{ + Lisp_Specifier *face_background_placement + = XFACE_BACKGROUND_PLACEMENT_SPECIFIER (obj); + + mark_object + (FACE_BACKGROUND_PLACEMENT_SPECIFIER_FACE (face_background_placement)); +} + +/* No equal or hash methods; ignore the face the background-placement is based + off of for `equal' */ + +extern Lisp_Object Qbackground_placement; + +static Lisp_Object +face_background_placement_instantiate (Lisp_Object UNUSED (specifier), + Lisp_Object UNUSED (matchspec), + Lisp_Object domain, + Lisp_Object instantiator, + Lisp_Object depth, + int no_fallback) +{ + /* When called, we're inside of call_with_suspended_errors(), + so we can freely error. */ + if (EQ (instantiator, Qabsolute) || EQ (instantiator, Qrelative)) + return instantiator; + else if (VECTORP (instantiator)) + { + assert (XVECTOR_LENGTH (instantiator) == 1); + + return FACE_PROPERTY_INSTANCE_1 + (Fget_face (XVECTOR_DATA (instantiator)[0]), + Qbackground_placement, domain, ERROR_ME, no_fallback, depth); + } + else + ABORT (); /* Eh? */ + + return Qunbound; +} + +static void +face_background_placement_validate (Lisp_Object instantiator) +{ + if (EQ (instantiator, Qabsolute) || EQ (instantiator, Qrelative)) + return; + else if (VECTORP (instantiator) && + (XVECTOR_LENGTH (instantiator) == 1)) + { + Lisp_Object face = XVECTOR_DATA (instantiator)[0]; + + Fget_face (face); /* just to check that the face exists -- dvl */ + } + else if (VECTORP (instantiator)) + sferror ("Wrong length for background-placement inheritance spec", + instantiator); + else + invalid_argument + ("\ +Background-placement instantiator must be absolute, relative or vector", + instantiator); +} + +static void +face_background_placement_after_change (Lisp_Object specifier, + Lisp_Object locale) +{ + Lisp_Object face + = FACE_BACKGROUND_PLACEMENT_SPECIFIER_FACE + (XFACE_BACKGROUND_PLACEMENT_SPECIFIER (specifier)); + + if (!NILP (face)) + { + face_property_was_changed (face, Qbackground_placement, locale); + if (BUFFERP (locale)) + XBUFFER (locale)->buffer_local_face_property = 1; + } +} + +void +set_face_background_placement_attached_to (Lisp_Object obj, Lisp_Object face) +{ + Lisp_Specifier *face_background_placement + = XFACE_BACKGROUND_PLACEMENT_SPECIFIER (obj); + + FACE_BACKGROUND_PLACEMENT_SPECIFIER_FACE (face_background_placement) = face; +} + +DEFUN ("face-background-placement-specifier-p", Fface_background_placement_specifier_p, 1, 1, 0, /* +Return non-nil if OBJECT is a face-background-placement specifier. + +See `make-face-background-placement-specifier' for a description of possible +face-background-placement instantiators. +*/ + (object)) +{ + return FACE_BACKGROUND_PLACEMENT_SPECIFIERP (object) ? Qt : Qnil; +} + + /************************************************************************/ /* initialization */ /************************************************************************/ @@ -1223,6 +1348,7 @@ DEFSUBR (Fcolor_specifier_p); DEFSUBR (Ffont_specifier_p); DEFSUBR (Fface_boolean_specifier_p); + DEFSUBR (Fface_background_placement_specifier_p); DEFSYMBOL_MULTIWORD_PREDICATE (Qcolor_instancep); DEFSUBR (Fmake_color_instance); @@ -1247,6 +1373,10 @@ /* Qcolor, Qfont defined in general.c */ DEFSYMBOL (Qface_boolean); + + DEFSYMBOL (Qface_background_placement); + DEFSYMBOL (Qabsolute); + DEFSYMBOL (Qrelative); } void @@ -1256,26 +1386,35 @@ INITIALIZE_SPECIFIER_TYPE_WITH_DATA (font, "font", "font-specifier-p"); INITIALIZE_SPECIFIER_TYPE_WITH_DATA (face_boolean, "face-boolean", "face-boolean-specifier-p"); + INITIALIZE_SPECIFIER_TYPE_WITH_DATA (face_background_placement, + "face-background-placement", + "\ +face-background-placement-specifier-p"); SPECIFIER_HAS_METHOD (color, instantiate); SPECIFIER_HAS_METHOD (font, instantiate); SPECIFIER_HAS_METHOD (face_boolean, instantiate); + SPECIFIER_HAS_METHOD (face_background_placement, instantiate); SPECIFIER_HAS_METHOD (color, validate); SPECIFIER_HAS_METHOD (font, validate); SPECIFIER_HAS_METHOD (face_boolean, validate); + SPECIFIER_HAS_METHOD (face_background_placement, validate); SPECIFIER_HAS_METHOD (color, create); SPECIFIER_HAS_METHOD (font, create); SPECIFIER_HAS_METHOD (face_boolean, create); + SPECIFIER_HAS_METHOD (face_background_placement, create); SPECIFIER_HAS_METHOD (color, mark); SPECIFIER_HAS_METHOD (font, mark); SPECIFIER_HAS_METHOD (face_boolean, mark); + SPECIFIER_HAS_METHOD (face_background_placement, mark); SPECIFIER_HAS_METHOD (color, after_change); SPECIFIER_HAS_METHOD (font, after_change); SPECIFIER_HAS_METHOD (face_boolean, after_change); + SPECIFIER_HAS_METHOD (face_background_placement, after_change); #ifdef MULE SPECIFIER_HAS_METHOD (font, validate_matchspec); @@ -1288,6 +1427,7 @@ REINITIALIZE_SPECIFIER_TYPE (color); REINITIALIZE_SPECIFIER_TYPE (font); REINITIALIZE_SPECIFIER_TYPE (face_boolean); + REINITIALIZE_SPECIFIER_TYPE (face_background_placement); } void
--- a/src/objects.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/objects.h Sun Mar 07 02:09:59 2010 -0600 @@ -76,4 +76,12 @@ void set_face_boolean_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property); +/***************************************************************************** + * Face Background Placement Specifier Object * + *****************************************************************************/ + +void set_face_background_placement_attached_to +(Lisp_Object obj, Lisp_Object face); + + #endif /* INCLUDED_objects_h_ */
--- a/src/redisplay-msw.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/redisplay-msw.c Sun Mar 07 02:09:59 2010 -0600 @@ -1212,8 +1212,13 @@ struct device *UNUSED (d), struct frame *f, face_index UNUSED (findex), int x, int y, int width, int height, Lisp_Object fcolor, - Lisp_Object bcolor, Lisp_Object background_pixmap) + Lisp_Object bcolor, + Lisp_Object background_pixmap, + Lisp_Object background_placement) { + /* #### FIXME: don't know how to handle background_placement in mswindows. + -- dvl */ + RECT rect = { x, y, x+width, y+height }; HDC hdc = get_frame_dc (f, 1);
--- a/src/redisplay-output.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/redisplay-output.c Sun Mar 07 02:09:59 2010 -0600 @@ -3,6 +3,7 @@ Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. Copyright (C) 1996 Chuck Thompson. Copyright (C) 1999, 2002 Andy Piper. + Copyright (C) 2010 Didier Verna This file is part of XEmacs. @@ -637,8 +638,8 @@ Lisp_Object window = wrap_window (w); redisplay_clear_region (window, DEFAULT_INDEX, - FRAME_LEFT_BORDER_START (f), y, - FRAME_INTERNAL_BORDER_WIDTH (f), height); + FRAME_LEFT_INTERNAL_BORDER_START (f), y, + FRAME_INTERNAL_BORDER_WIDTH (f), height); } /***************************************************************************** @@ -653,8 +654,8 @@ Lisp_Object window = wrap_window (w); redisplay_clear_region (window, DEFAULT_INDEX, - FRAME_RIGHT_BORDER_START (f), - y, FRAME_INTERNAL_BORDER_WIDTH (f), height); + FRAME_RIGHT_INTERNAL_BORDER_START (f), + y, FRAME_INTERNAL_BORDER_WIDTH (f), height); } /***************************************************************************** @@ -1662,8 +1663,7 @@ dga->width = IMAGE_INSTANCE_PIXMAP_WIDTH (p); #ifdef DEBUG_REDISPLAY - printf ("redisplay_output_pixmap(request) \ -[%dx%d@%d+%d] in [%dx%d@%d+%d]\n", + printf ("redisplay_output_pixmap(request) [%dx%d@%d+%d] in [%dx%d@%d+%d]\n", db->width, db->height, db->xpos, db->ypos, dga->width, dga->height, dga->xoffset, dga->yoffset); #endif @@ -1673,8 +1673,7 @@ return; #ifdef DEBUG_REDISPLAY - printf ("redisplay_output_pixmap(normalized) \ -[%dx%d@%d+%d] in [%dx%d@%d+%d]\n", + printf ("redisplay_output_pixmap(normalized) [%dx%d@%d+%d] in [%dx%d@%d+%d]\n", db->width, db->height, db->xpos, db->ypos, dga->width, dga->height, dga->xoffset, dga->yoffset); #endif @@ -1721,6 +1720,7 @@ struct frame *f = NULL; struct device *d; Lisp_Object background_pixmap = Qunbound; + Lisp_Object background_placement = Qunbound; Lisp_Object fcolor = Qnil, bcolor = Qnil; if (!width || !height) @@ -1747,11 +1747,12 @@ /* #### This isn't quite right for when this function is called from the toolbar code. */ + /* #### GEOM! This uses a backing pixmap in the gutter. Correct? */ /* Don't use a backing pixmap in the border area */ - if (x >= FRAME_LEFT_BORDER_END (f) - && x < FRAME_RIGHT_BORDER_START (f) - && y >= FRAME_TOP_BORDER_END (f) - && y < FRAME_BOTTOM_BORDER_START (f)) + if (x >= FRAME_LEFT_INTERNAL_BORDER_END (f) + && x < FRAME_RIGHT_INTERNAL_BORDER_START (f) + && y >= FRAME_TOP_INTERNAL_BORDER_END (f) + && y < FRAME_BOTTOM_INTERNAL_BORDER_START (f)) { Lisp_Object temp; @@ -1765,22 +1766,26 @@ /* #### maybe we could implement such that a string can be a background pixmap? */ background_pixmap = temp; + background_placement + = WINDOW_FACE_CACHEL_BACKGROUND_PLACEMENT (w, findex); } } else { temp = FACE_BACKGROUND_PIXMAP (Vdefault_face, locale); - + if (IMAGE_INSTANCEP (temp) && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp))) { background_pixmap = temp; + background_placement + = FACE_BACKGROUND_PLACEMENT (Vdefault_face, locale); } } } - if (!UNBOUNDP (background_pixmap) && - XIMAGE_INSTANCE_PIXMAP_DEPTH (background_pixmap) == 0) + if (!UNBOUNDP (background_pixmap) + && XIMAGE_INSTANCE_PIXMAP_DEPTH (background_pixmap) == 0) { if (w) { @@ -1804,8 +1809,9 @@ if (UNBOUNDP (background_pixmap)) background_pixmap = Qnil; - DEVMETH (d, clear_region, - (locale, d, f, findex, x, y, width, height, fcolor, bcolor, background_pixmap)); + DEVMETH (d, clear_region, (locale, d, f, findex, x, y, width, height, + fcolor, bcolor, + background_pixmap, background_placement)); } /**************************************************************************** @@ -2091,7 +2097,10 @@ { Lisp_Object window = wrap_window (w); - + /* #### GEOM! FIXME #### This is definitely wrong. It was clearly not + fixed up to accommodate the gutter. The internal border width is now + no longer adjacent to the leftmost window, since the gutter + intervenes. */ if (!NILP (Fwindow_highest_p (window))) { struct frame *f = XFRAME (w->frame); @@ -2108,7 +2117,8 @@ if (window_is_rightmost (w)) width += FRAME_INTERNAL_BORDER_WIDTH (f); - y = FRAME_TOP_BORDER_START (f) - 1; + /* #### This off-by-one stuff also occurs in XLIKE_clear_frame(). */ + y = FRAME_TOP_INTERNAL_BORDER_START (f) - 1; height = FRAME_INTERNAL_BORDER_HEIGHT (f) + 1; redisplay_clear_region (window, DEFAULT_INDEX, x, y, width, height); @@ -2144,12 +2154,15 @@ window = wrap_window (w); if (window_is_leftmost (w)) - redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f), - ypos1, FRAME_INTERNAL_BORDER_WIDTH (f), height); + redisplay_clear_region (window, DEFAULT_INDEX, + FRAME_LEFT_INTERNAL_BORDER_START (f), + ypos1, FRAME_INTERNAL_BORDER_WIDTH (f), + height); if (bounds.left_in - bounds.left_out > 0) redisplay_clear_region (window, - get_builtin_face_cache_index (w, Vleft_margin_face), + get_builtin_face_cache_index + (w, Vleft_margin_face), bounds.left_out, ypos1, bounds.left_in - bounds.left_out, height); @@ -2161,13 +2174,17 @@ if (bounds.right_out - bounds.right_in > 0) redisplay_clear_region (window, - get_builtin_face_cache_index (w, Vright_margin_face), + get_builtin_face_cache_index + (w, Vright_margin_face), bounds.right_in, ypos1, - bounds.right_out - bounds.right_in, height); + bounds.right_out - bounds.right_in, + height); if (window_is_rightmost (w)) - redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f), - ypos1, FRAME_INTERNAL_BORDER_WIDTH (f), height); + redisplay_clear_region (window, DEFAULT_INDEX, + FRAME_RIGHT_INTERNAL_BORDER_START (f), + ypos1, FRAME_INTERNAL_BORDER_WIDTH (f), + height); } } }
--- a/src/redisplay-tty.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/redisplay-tty.c Sun Mar 07 02:09:59 2010 -0600 @@ -428,7 +428,8 @@ struct frame * f, face_index findex, int x, int y, int width, int height, Lisp_Object UNUSED (fcolor), Lisp_Object UNUSED (bcolor), - Lisp_Object UNUSED (background_pixmap)) + Lisp_Object UNUSED (background_pixmap), + Lisp_Object UNUSED (background_placement)) { struct console *c = XCONSOLE (FRAME_CONSOLE (f)); int line;
--- a/src/redisplay-xlike-inc.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/redisplay-xlike-inc.c Sun Mar 07 02:09:59 2010 -0600 @@ -3,6 +3,7 @@ Copyright (C) 1994 Lucid, Inc. Copyright (C) 1995 Sun Microsystems, Inc. Copyright (C) 2002, 2003, 2005, 2009, 2010 Ben Wing. + Copyright (C) 2010 Didier Verna This file is part of XEmacs. @@ -812,8 +813,9 @@ /* Called as gtk_get_gc from gtk-glue.c */ -XLIKE_GC XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, - Lisp_Object bg, Lisp_Object bg_pmap, +XLIKE_GC XLIKE_get_gc (struct frame *f, Lisp_Object font, + Lisp_Object fg, Lisp_Object bg, + Lisp_Object bg_pixmap, Lisp_Object bg_placement, Lisp_Object lwidth); /***************************************************************************** @@ -822,9 +824,12 @@ Given a number of parameters return a GC with those properties. ****************************************************************************/ XLIKE_GC -XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, - Lisp_Object bg, Lisp_Object bg_pmap, Lisp_Object lwidth) +XLIKE_get_gc (struct frame *f, Lisp_Object font, + Lisp_Object fg, Lisp_Object bg, + Lisp_Object bg_pixmap, Lisp_Object bg_placement, + Lisp_Object lwidth) { + struct device *d = XDEVICE (f->device); XLIKE_GCVALUES gcv; unsigned long mask; @@ -836,7 +841,8 @@ gcv.clip_x_origin = 0; gcv.clip_y_origin = 0; XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_SOLID); - mask = XLIKE_GC_EXPOSURES | XLIKE_GC_CLIP_MASK | XLIKE_GC_CLIP_X_ORIGIN | XLIKE_GC_CLIP_Y_ORIGIN; + mask = XLIKE_GC_EXPOSURES + | XLIKE_GC_CLIP_MASK | XLIKE_GC_CLIP_X_ORIGIN | XLIKE_GC_CLIP_Y_ORIGIN; mask |= XLIKE_GC_FILL; if (!NILP (font) @@ -882,7 +888,7 @@ /* This special case comes from a request to draw text with a face which has the dim property. We'll use a stippled foreground GC. */ - if (EQ (bg_pmap, Qdim)) + if (EQ (bg_pixmap, Qdim)) { assert (DEVICE_XLIKE_GRAY_PIXMAP (d) != XLIKE_NONE); @@ -890,21 +896,35 @@ gcv.stipple = DEVICE_XLIKE_GRAY_PIXMAP (d); mask |= (XLIKE_GC_FILL | XLIKE_GC_STIPPLE); } - else if (IMAGE_INSTANCEP (bg_pmap) - && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) + else if (IMAGE_INSTANCEP (bg_pixmap) + && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pixmap))) { - if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0) + if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pixmap) == 0) { XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_OPAQUE_STIPPLED); - gcv.stipple = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap); + gcv.stipple = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pixmap); mask |= (XLIKE_GC_STIPPLE | XLIKE_GC_FILL); } else { XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_TILED); - gcv.tile = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap); + gcv.tile = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pixmap); mask |= (XLIKE_GC_TILE | XLIKE_GC_FILL); } + if (EQ (bg_placement, Qabsolute)) + { +#ifdef THIS_IS_GTK + /* #### WARNING: this does not currently work. -- dvl + gcv.ts_x_origin = - FRAME_GTK_X (f); + gcv.ts_y_origin = - FRAME_GTK_Y (f); + mask |= (XLIKE_GC_TS_X_ORIGIN | XLIKE_GC_TS_Y_ORIGIN); + */ +#else + gcv.ts_x_origin = - FRAME_X_X (f); + gcv.ts_y_origin = - FRAME_X_Y (f); + mask |= (XLIKE_GC_TS_X_ORIGIN | XLIKE_GC_TS_Y_ORIGIN); +#endif + } } if (!NILP (lwidth)) @@ -1076,8 +1096,8 @@ && !NILP (w->text_cursor_visible_p)) || NILP (bg_pmap)) bgc = 0; else - bgc = XLIKE_get_gc (d, Qnil, cachel->foreground, cachel->background, - bg_pmap, Qnil); + bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background, + bg_pmap, cachel->background_placement, Qnil); if (bgc) { @@ -1157,8 +1177,8 @@ fg = XFT_FROB_LISP_COLOR (cursor_cachel->foreground, 0); bg = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0); #endif - gc = XLIKE_get_gc (d, font, cursor_cachel->foreground, - cursor_cachel->background, Qnil, Qnil); + gc = XLIKE_get_gc (f, font, cursor_cachel->foreground, + cursor_cachel->background, Qnil, Qnil, Qnil); } else if (cachel->dim) { @@ -1179,8 +1199,8 @@ fg = XFT_FROB_LISP_COLOR (cachel->foreground, 1); bg = XFT_FROB_LISP_COLOR (cachel->background, 0); #endif - gc = XLIKE_get_gc (d, font, cachel->foreground, cachel->background, - Qdim, Qnil); + gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background, + Qdim, Qnil, Qnil); } else { @@ -1188,8 +1208,8 @@ fg = XFT_FROB_LISP_COLOR (cachel->foreground, 0); bg = XFT_FROB_LISP_COLOR (cachel->background, 0); #endif - gc = XLIKE_get_gc (d, font, cachel->foreground, cachel->background, - Qnil, Qnil); + gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background, + Qnil, Qnil, Qnil); } #ifdef USE_XFT { @@ -1462,8 +1482,8 @@ { XLIKE_RECTANGLE clip_box; XLIKE_GC cgc; - cgc = XLIKE_get_gc (d, font, cursor_cachel->foreground, - cursor_cachel->background, Qnil, Qnil); + cgc = XLIKE_get_gc (f, font, cursor_cachel->foreground, + cursor_cachel->background, Qnil, Qnil, Qnil); clip_box.x = 0; clip_box.y = 0; @@ -1534,13 +1554,14 @@ if (!NILP (bar_cursor_value)) { - gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, + gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, + Qnil, Qnil, make_int (bar_width)); } else { - gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, - Qnil, Qnil, Qnil); + gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, + Qnil, Qnil, Qnil, Qnil); } tmp_y = dl->ypos - bogusly_obtained_ascent_value; @@ -1728,7 +1749,8 @@ get_builtin_face_cache_index (w, Vtext_cursor_face)); - gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil); + gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil, + Qnil); if (cursor_width > db->xpos + dga->width - cursor_start) cursor_width = db->xpos + dga->width - cursor_start; @@ -1872,11 +1894,13 @@ bg_pmap = Qnil; if (NILP (bg_pmap)) - gc = XLIKE_get_gc (d, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), - Qnil, Qnil, Qnil); + gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), + Qnil, Qnil, Qnil, Qnil); else - gc = XLIKE_get_gc (d, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex), - WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), bg_pmap, + gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex), + WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), + bg_pmap, + WINDOW_FACE_CACHEL_BACKGROUND_PLACEMENT (w, rb->findex), Qnil); XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, y, width, height); @@ -1897,7 +1921,8 @@ (WINDOW_FACE_CACHEL (w, rb->findex), Vcharset_ascii)); - gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil); + gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, + Qnil, Qnil, Qnil); cursor_y = dl->ypos - fi->ascent; cursor_height = fi->height; @@ -1915,8 +1940,9 @@ { int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2; - gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, - Qnil, Qnil, make_int (bar_width)); + gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, + Qnil, Qnil, Qnil, + make_int (bar_width)); XLIKE_DRAW_LINE (dpy, x_win, gc, cursor_start + bar_width - 1, cursor_y, cursor_start + bar_width - 1, cursor_y + cursor_height - 1); @@ -1959,9 +1985,9 @@ /* First clear the area not covered by the line. */ if (height - rb->object.hline.thickness > 0) { - gc = XLIKE_get_gc (d, Qnil, + gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex), - Qnil, Qnil, Qnil); + Qnil, Qnil, Qnil, Qnil); if (ypos2 - ypos1 > 0) XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1); @@ -1977,8 +2003,8 @@ } #else /* THIS_IS_X */ /* Now draw the line. */ - gc = XLIKE_get_gc (d, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), - Qnil, Qnil, Qnil); + gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), + Qnil, Qnil, Qnil, Qnil); if (ypos2 < ypos1) ypos2 = ypos1; @@ -1999,8 +2025,10 @@ static void XLIKE_clear_region (Lisp_Object UNUSED (locale), struct device* d, struct frame* f, face_index UNUSED (findex), int x, int y, - int width, int height, Lisp_Object fcolor, - Lisp_Object bcolor, Lisp_Object background_pixmap) + int width, int height, + Lisp_Object fcolor, Lisp_Object bcolor, + Lisp_Object background_pixmap, + Lisp_Object background_placement) { XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d); XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f); @@ -2008,7 +2036,8 @@ if (!UNBOUNDP (background_pixmap)) { - gc = XLIKE_get_gc (d, Qnil, fcolor, bcolor, background_pixmap, Qnil); + gc = XLIKE_get_gc (f, Qnil, fcolor, bcolor, + background_pixmap, background_placement, Qnil); } if (gc) @@ -2054,7 +2083,8 @@ if (NILP (w->text_cursor_visible_p)) return; - gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil); + gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, + Qnil, Qnil, Qnil); default_face_font_info (window, &defascent, 0, 0, &defheight, 0); @@ -2078,7 +2108,8 @@ { int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2; - gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, + gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, + Qnil, Qnil, make_int (bar_width)); XLIKE_DRAW_LINE (dpy, x_win, gc, x + bar_width - 1, cursor_y, x + bar_width - 1, cursor_y + cursor_height - 1); @@ -2127,19 +2158,16 @@ int x, y, width, height; Lisp_Object frame; - x = FRAME_LEFT_BORDER_START (f); - width = (FRAME_PIXWIDTH (f) - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) - - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f) - - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)); + /* #### GEOM! This clears the internal border and gutter (and scrollbars) + but not the toolbar. Correct? */ + x = FRAME_LEFT_INTERNAL_BORDER_START (f); + width = (FRAME_RIGHT_INTERNAL_BORDER_END (f) - x); /* #### This adjustment by 1 should be being done in the macros. There is some small differences between when the menubar is on - and off that we still need to deal with. */ - y = FRAME_TOP_BORDER_START (f) - 1; - height = (FRAME_PIXHEIGHT (f) - FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) - - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - - 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f) - - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) + 1; + and off that we still need to deal with. The adjustment also occurs in + redisplay_clear_top_of_window(). */ + y = FRAME_TOP_INTERNAL_BORDER_START (f) - 1; + height = (FRAME_BOTTOM_INTERNAL_BORDER_END (f) - y); XLIKE_CLEAR_AREA (dpy, x_win, x, y, width, height);
--- a/src/redisplay.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/redisplay.c Sun Mar 07 02:09:59 2010 -0600 @@ -8768,7 +8768,7 @@ d->pixel_to_glyph_cache.obj_x = *obj_x; \ d->pixel_to_glyph_cache.obj_y = *obj_y; \ d->pixel_to_glyph_cache.w = *w; \ - d->pixel_to_glyph_cache.charpos = *charpos; \ + d->pixel_to_glyph_cache.charpos = *charpos; \ d->pixel_to_glyph_cache.closest = *closest; \ d->pixel_to_glyph_cache.modeline_closest = *modeline_closest; \ d->pixel_to_glyph_cache.obj1 = *obj1; \ @@ -8785,10 +8785,15 @@ OVER_TOOLBAR: over one of the 4 frame toolbars OVER_MODELINE: over a modeline OVER_BORDER: over an internal border + OVER_V_DIVIDER: over a vertical divider between windows (used as a + grab bar for resizing) OVER_NOTHING: over the text area, but not over text OVER_OUTSIDE: outside of the frame border OVER_TEXT: over text in the text area + #### GEOM! We need to also have an OVER_GUTTER, OVER_SCROLLBAR and + OVER_DEAD_BOX. + OBJ1 is one of -- a toolbar button @@ -8881,25 +8886,28 @@ if (device_check_failed) return OVER_NOTHING; - frm_left = FRAME_LEFT_BORDER_END (f); - frm_right = FRAME_RIGHT_BORDER_START (f); - frm_top = FRAME_TOP_BORDER_END (f); - frm_bottom = FRAME_BOTTOM_BORDER_START (f); + /* #### GEOM! The gutter is just inside of this. We should also have an + OVER_GUTTER return value to indicate that we're over a gutter. See + above. */ + frm_left = FRAME_LEFT_INTERNAL_BORDER_END (f); + frm_right = FRAME_RIGHT_INTERNAL_BORDER_START (f); + frm_top = FRAME_TOP_INTERNAL_BORDER_END (f); + frm_bottom = FRAME_BOTTOM_INTERNAL_BORDER_START (f); /* Check if the mouse is outside of the text area actually used by redisplay. */ if (y_coord < frm_top) { - if (y_coord >= FRAME_TOP_BORDER_START (f)) - { - low_y_coord = FRAME_TOP_BORDER_START (f); + if (y_coord >= FRAME_TOP_INTERNAL_BORDER_START (f)) + { + low_y_coord = FRAME_TOP_INTERNAL_BORDER_START (f); high_y_coord = frm_top; position = OVER_BORDER; } else if (y_coord >= 0) { low_y_coord = 0; - high_y_coord = FRAME_TOP_BORDER_START (f); + high_y_coord = FRAME_TOP_INTERNAL_BORDER_START (f); position = OVER_TOOLBAR; } else @@ -8911,15 +8919,15 @@ } else if (y_coord >= frm_bottom) { - if (y_coord < FRAME_BOTTOM_BORDER_END (f)) + if (y_coord < FRAME_BOTTOM_INTERNAL_BORDER_END (f)) { low_y_coord = frm_bottom; - high_y_coord = FRAME_BOTTOM_BORDER_END (f); + high_y_coord = FRAME_BOTTOM_INTERNAL_BORDER_END (f); position = OVER_BORDER; } else if (y_coord < FRAME_PIXHEIGHT (f)) { - low_y_coord = FRAME_BOTTOM_BORDER_END (f); + low_y_coord = FRAME_BOTTOM_INTERNAL_BORDER_END (f); high_y_coord = FRAME_PIXHEIGHT (f); position = OVER_TOOLBAR; } @@ -8935,16 +8943,16 @@ { if (x_coord < frm_left) { - if (x_coord >= FRAME_LEFT_BORDER_START (f)) - { - low_x_coord = FRAME_LEFT_BORDER_START (f); + if (x_coord >= FRAME_LEFT_INTERNAL_BORDER_START (f)) + { + low_x_coord = FRAME_LEFT_INTERNAL_BORDER_START (f); high_x_coord = frm_left; position = OVER_BORDER; } else if (x_coord >= 0) { low_x_coord = 0; - high_x_coord = FRAME_LEFT_BORDER_START (f); + high_x_coord = FRAME_LEFT_INTERNAL_BORDER_START (f); position = OVER_TOOLBAR; } else @@ -8956,15 +8964,15 @@ } else if (x_coord >= frm_right) { - if (x_coord < FRAME_RIGHT_BORDER_END (f)) + if (x_coord < FRAME_RIGHT_INTERNAL_BORDER_END (f)) { low_x_coord = frm_right; - high_x_coord = FRAME_RIGHT_BORDER_END (f); + high_x_coord = FRAME_RIGHT_INTERNAL_BORDER_END (f); position = OVER_BORDER; } else if (x_coord < FRAME_PIXWIDTH (f)) { - low_x_coord = FRAME_RIGHT_BORDER_END (f); + low_x_coord = FRAME_RIGHT_INTERNAL_BORDER_END (f); high_x_coord = FRAME_PIXWIDTH (f); position = OVER_TOOLBAR; }
--- a/src/search.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/search.c Sun Mar 07 02:09:59 2010 -0600 @@ -2801,8 +2801,8 @@ Lisp_Object before, after; speccount = specpdl_depth (); - before = Fsubstring (string, Qzero, make_int (search_regs.start[sub])); - after = Fsubstring (string, make_int (search_regs.end[sub]), Qnil); + before = Fsubseq (string, Qzero, make_int (search_regs.start[sub])); + after = Fsubseq (string, make_int (search_regs.end[sub]), Qnil); /* Do case substitution into REPLACEMENT if desired. */ if (NILP (literal)) @@ -2888,13 +2888,12 @@ Lisp_Object literal_text = Qnil; Lisp_Object substring = Qnil; if (literal_end != literal_start) - literal_text = Fsubstring (replacement, - make_int (literal_start), - make_int (literal_end)); + literal_text = Fsubseq (replacement, + make_int (literal_start), + make_int (literal_end)); if (substart >= 0 && subend != substart) - substring = Fsubstring (string, - make_int (substart), - make_int (subend)); + substring = Fsubseq (string, make_int (substart), + make_int (subend)); if (!NILP (literal_text) || !NILP (substring)) accum = concat3 (accum, literal_text, substring); literal_start = strpos + 1; @@ -2903,9 +2902,9 @@ if (strpos != literal_start) /* some literal text at end to be inserted */ - replacement = concat2 (accum, Fsubstring (replacement, - make_int (literal_start), - make_int (strpos))); + replacement = concat2 (accum, Fsubseq (replacement, + make_int (literal_start), + make_int (strpos))); else replacement = accum; }
--- a/src/text.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/text.h Sun Mar 07 02:09:59 2010 -0600 @@ -47,6 +47,33 @@ BEGIN_C_DECLS +/************************************************************************/ +/* A short intro to the format of text and of characters */ +/************************************************************************/ + +/* + "internally formatted text" and the term "internal format" in + general are likely to refer to the format of text in buffers and + strings; "externally formatted text" and the term "external format" + refer to any text format used in the O.S. or elsewhere outside of + XEmacs. The format of text and of a character are related and + there must be a one-to-one relationship (hopefully through a + relatively simple algorithmic means of conversion) between a string + of text and an equivalent array of characters, but the conversion + between the two is NOT necessarily trivial. + + In a non-Mule XEmacs, allowed characters are numbered 0 through + 255, where no fixed meaning is assigned to them, but (when + representing text, rather than bytes in a binary file) in practice + the lower half represents ASCII and the upper half some other 8-bit + character set (chosen by setting the font, case tables, syntax + tables, etc. appropriately for the character set through ad-hoc + means such as the `iso-8859-1' file and the + `standard-display-european' function). + + For more info, see `text.c' and the Internals Manual. +*/ + /* ---------------------------------------------------------------------- */ /* Super-basic character properties */ /* ---------------------------------------------------------------------- */ @@ -166,6 +193,29 @@ #endif /* not MULE */ +#ifdef MULE + +MODULE_API int non_ascii_valid_ichar_p (Ichar ch); + +/* Return whether the given Ichar is valid. + */ + +DECLARE_INLINE_HEADER ( +int +valid_ichar_p (Ichar ch) +) +{ + return (! (ch & ~0xFF)) || non_ascii_valid_ichar_p (ch); +} + +#else /* not MULE */ + +/* This works when CH is negative, and correctly returns non-zero only when CH + is in the range [0, 255], inclusive. */ +#define valid_ichar_p(ch) (! (ch & ~0xFF)) + +#endif /* not MULE */ + /* For more discussion, see text.c, "handling non-default formats" */ typedef enum internal_format
--- a/src/toolbar-msw.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/toolbar-msw.c Sun Mar 07 02:09:59 2010 -0600 @@ -1,7 +1,7 @@ /* toolbar implementation -- mswindows interface. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2002, 2010 Ben Wing. Copyright (C) 1996 Chuck Thompson. Copyright (C) 1998 Andy Piper. @@ -52,39 +52,18 @@ #define TOOLBAR_ITEM_ID_BITS(x) (((x) & 0x3FFF) | 0x4000) #define TOOLBAR_ID_BIAS 16 #define TOOLBAR_HANDLE(f,p) \ -GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), TOOLBAR_ID_BIAS + p) +GetDlgItem (FRAME_MSWINDOWS_HANDLE (f), TOOLBAR_ID_BIAS + p) #define MSWINDOWS_BUTTON_SHADOW_THICKNESS 2 #define MSWINDOWS_BLANK_SIZE 5 #define MSWINDOWS_MINIMUM_TOOLBAR_SIZE 8 static void -mswindows_move_toolbar (struct frame *f, enum toolbar_pos pos); - -#define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag) \ - do { \ - switch (pos) \ - { \ - case TOP_TOOLBAR: \ - (frame)->top_toolbar_was_visible = flag; \ - break; \ - case BOTTOM_TOOLBAR: \ - (frame)->bottom_toolbar_was_visible = flag; \ - break; \ - case LEFT_TOOLBAR: \ - (frame)->left_toolbar_was_visible = flag; \ - break; \ - case RIGHT_TOOLBAR: \ - (frame)->right_toolbar_was_visible = flag; \ - break; \ - default: \ - ABORT (); \ - } \ - } while (0) +mswindows_move_toolbar (struct frame *f, enum edge_pos pos); static int allocate_toolbar_item_id (struct frame *f, struct toolbar_button *button, - enum toolbar_pos UNUSED (pos)) + enum edge_pos UNUSED (pos)) { /* hmm what do we generate an id based on */ int id = TOOLBAR_ITEM_ID_BITS (internal_hash (button->callback, 0)); @@ -97,7 +76,7 @@ } static void -mswindows_clear_toolbar (struct frame *f, enum toolbar_pos pos, +mswindows_clear_toolbar (struct frame *f, enum edge_pos pos, int UNUSED (thickness_change)) { HIMAGELIST ilist = NULL; @@ -123,11 +102,11 @@ qxeSendMessage (toolbarwnd, TB_GETIMAGELIST, 0, (LONG) &ilist); if (ilist) { - ImageList_Destroy(ilist); + ImageList_Destroy (ilist); } qxeSendMessage (toolbarwnd, TB_SETIMAGELIST, 0, (LPARAM)NULL); - ShowWindow(toolbarwnd, SW_HIDE); + ShowWindow (toolbarwnd, SW_HIDE); } FRAME_MSWINDOWS_TOOLBAR_CHECKSUM (f, pos) = 0; @@ -135,7 +114,7 @@ } static void -mswindows_output_toolbar (struct frame *f, enum toolbar_pos pos) +mswindows_output_toolbar (struct frame *f, enum edge_pos pos) { int x, y, bar_width, bar_height, vert; int width=-1, height=-1, bmwidth=0, bmheight=0, maxbmwidth, maxbmheight; @@ -208,7 +187,7 @@ struct toolbar_button *tb = XTOOLBAR_BUTTON (button); checksum = HASH5 (checksum, - internal_hash (get_toolbar_button_glyph(w, tb), 0), + internal_hash (get_toolbar_button_glyph (w, tb), 0), internal_hash (tb->callback, 0), width, LISP_HASH (w->toolbar_buttons_captioned_p)); @@ -217,7 +196,7 @@ } /* only rebuild if something has changed */ - if (!toolbarwnd || FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos)!=checksum) + if (!toolbarwnd || FRAME_MSWINDOWS_TOOLBAR_CHECKSUM (f,pos)!=checksum) { /* remove the old one */ mswindows_clear_toolbar (f, pos, 0); @@ -401,7 +380,7 @@ /* finally populate with images */ if (qxeSendMessage (toolbarwnd, TB_BUTTONSTRUCTSIZE, - (WPARAM)sizeof(TBBUTTON), (LPARAM)0) == -1) + (WPARAM)sizeof (TBBUTTON), (LPARAM)0) == -1) { mswindows_clear_toolbar (f, pos, 0); gui_error ("couldn't set button structure size", Qunbound); @@ -446,7 +425,7 @@ else { RECT tmp; - qxeSendMessage (toolbarwnd, TB_SETROWS, MAKEWPARAM(1, FALSE), + qxeSendMessage (toolbarwnd, TB_SETROWS, MAKEWPARAM (1, FALSE), (LPARAM)&tmp); } @@ -475,10 +454,10 @@ } static void -mswindows_move_toolbar (struct frame *f, enum toolbar_pos pos) +mswindows_move_toolbar (struct frame *f, enum edge_pos pos) { int bar_x, bar_y, bar_width, bar_height, vert; - HWND toolbarwnd = TOOLBAR_HANDLE(f,pos); + HWND toolbarwnd = TOOLBAR_HANDLE (f,pos); if (toolbarwnd) { @@ -490,19 +469,19 @@ by Windows and by XEmacs. */ switch (pos) { - case TOP_TOOLBAR: + case TOP_EDGE: bar_x--; bar_y-=2; bar_width+=3; bar_height+=3; break; - case LEFT_TOOLBAR: + case LEFT_EDGE: bar_x--; bar_y-=2; bar_height++; bar_width++; break; - case BOTTOM_TOOLBAR: + case BOTTOM_EDGE: bar_y-=2; bar_width+=4; bar_height+=4; break; - case RIGHT_TOOLBAR: + case RIGHT_EDGE: bar_y-=2; bar_x++; bar_width++; bar_height++; break; @@ -517,19 +496,14 @@ int UNUSED (x), int UNUSED (y), int UNUSED (width), int UNUSED (height)) { + enum edge_pos pos; assert (FRAME_MSWINDOWS_P (f)); - if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) - mswindows_move_toolbar (f, TOP_TOOLBAR); - - if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) - mswindows_move_toolbar (f, BOTTOM_TOOLBAR); - - if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) - mswindows_move_toolbar (f, LEFT_TOOLBAR); - - if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) - mswindows_move_toolbar (f, RIGHT_TOOLBAR); + EDGE_POS_LOOP (pos) + { + if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos)) + mswindows_move_toolbar (f, pos); + } } static void @@ -542,41 +516,33 @@ static void mswindows_initialize_frame_toolbars (struct frame *UNUSED (f)) { - } static void mswindows_output_frame_toolbars (struct frame *f) { + enum edge_pos pos; assert (FRAME_MSWINDOWS_P (f)); - if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) - mswindows_output_toolbar (f, TOP_TOOLBAR); - if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) - mswindows_output_toolbar (f, BOTTOM_TOOLBAR); - if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) - mswindows_output_toolbar (f, LEFT_TOOLBAR); - if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) - mswindows_output_toolbar (f, RIGHT_TOOLBAR); + EDGE_POS_LOOP (pos) + { + if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos)) + mswindows_output_toolbar (f, pos); + } } static void mswindows_clear_frame_toolbars (struct frame *f) { + enum edge_pos pos; assert (FRAME_MSWINDOWS_P (f)); - if (f->top_toolbar_was_visible - && !FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) - mswindows_clear_toolbar (f, TOP_TOOLBAR, 0); - if (f->bottom_toolbar_was_visible - && !FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) - mswindows_clear_toolbar (f, BOTTOM_TOOLBAR, 0); - if (f->left_toolbar_was_visible - && !FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) - mswindows_clear_toolbar (f, LEFT_TOOLBAR, 0); - if (f->right_toolbar_was_visible - && !FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) - mswindows_clear_toolbar (f, RIGHT_TOOLBAR, 0); + EDGE_POS_LOOP (pos) + { + if (f->toolbar_was_visible[pos] + && !FRAME_REAL_TOOLBAR_VISIBLE (f, pos)) + mswindows_clear_toolbar (f, pos, 0); + } } static void @@ -584,15 +550,15 @@ { HWND twnd=NULL; #define DELETE_TOOLBAR(pos) \ - mswindows_clear_toolbar(f, pos, 0); \ - if ((twnd=GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), \ + mswindows_clear_toolbar (f, pos, 0); \ + if ((twnd=GetDlgItem (FRAME_MSWINDOWS_HANDLE (f), \ TOOLBAR_ID_BIAS + pos))) \ - DestroyWindow(twnd) + DestroyWindow (twnd) - DELETE_TOOLBAR(TOP_TOOLBAR); - DELETE_TOOLBAR(BOTTOM_TOOLBAR); - DELETE_TOOLBAR(LEFT_TOOLBAR); - DELETE_TOOLBAR(RIGHT_TOOLBAR); + DELETE_TOOLBAR (TOP_EDGE); + DELETE_TOOLBAR (BOTTOM_EDGE); + DELETE_TOOLBAR (LEFT_EDGE); + DELETE_TOOLBAR (RIGHT_EDGE); #undef DELETE_TOOLBAR }
--- a/src/toolbar-xlike.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/toolbar-xlike.c Sun Mar 07 02:09:59 2010 -0600 @@ -38,14 +38,14 @@ /* Only a very few things need to differ based on the toolkit used. ** -** Some of the routines used assert(FRAME_yyy_P(f)) checks, this is +** Some of the routines used assert (FRAME_yyy_P(f)) checks, this is ** now abstracted into __INTERNAL_APPROPRIATENESS_CHECK(). When we ** add new window systems that use this code, we should either add a ** new case here, or just remove the checks completely. ** ** At least for X & GTK redraw_frame_toolbars() might end up getting ** called before we are completely initialized. To avoid this, we use -** the __INTERNAL_MAPPED_P(f) macro, that should return 0 if we should +** the __INTERNAL_MAPPED_P (f) macro, that should return 0 if we should ** not draw the toolbars yet. When we add new window systems that use ** this code, we should add a new case here, if they need it. ** @@ -85,7 +85,7 @@ Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); struct window *w = XWINDOW (window); int shadow_thickness; - int def_shadow_thickness = XINT (Fspecifier_instance(Vtoolbar_shadow_thickness, window, Qnil, Qnil)); + int def_shadow_thickness = XINT (Fspecifier_instance (Vtoolbar_shadow_thickness, window, Qnil, Qnil)); face_index toolbar_findex; if (tb->vertical) @@ -103,7 +103,7 @@ toolbar_findex = get_builtin_face_cache_index (w, Vtoolbar_face); - /* Blank toolbar buttons that should be 3d will have EQ(tb->up_glyph, Qt) + /* Blank toolbar buttons that should be 3d will have EQ (tb->up_glyph, Qt) ** Blank toolbar buttons that should be flat will have NILP (tb->up_glyph) ** ** Real toolbar buttons will check tb->enabled && tb->down @@ -143,7 +143,7 @@ MAYBE_DEVMETH (d, bevel_area, (w, toolbar_findex, sx + x_adj, sy + y_adj, swidth + width_adj, - sheight + height_adj, abs(shadow_thickness), + sheight + height_adj, abs (shadow_thickness), EDGE_ALL, (shadow_thickness < 0) ? EDGE_BEVEL_IN : EDGE_BEVEL_OUT)); } @@ -370,7 +370,7 @@ return (size); } -#define XLIKE_OUTPUT_BUTTONS_LOOP(left) \ +#define XLIKE_OUTPUT_BUTTONS_LOOP(left) \ do { \ while (!NILP (button)) \ { \ @@ -436,29 +436,8 @@ } \ } while (0) -#define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag) \ - do { \ - switch (pos) \ - { \ - case TOP_TOOLBAR: \ - (frame)->top_toolbar_was_visible = flag; \ - break; \ - case BOTTOM_TOOLBAR: \ - (frame)->bottom_toolbar_was_visible = flag; \ - break; \ - case LEFT_TOOLBAR: \ - (frame)->left_toolbar_was_visible = flag; \ - break; \ - case RIGHT_TOOLBAR: \ - (frame)->right_toolbar_was_visible = flag; \ - break; \ - default: \ - ABORT (); \ - } \ - } while (0) - static void -xlike_output_toolbar (struct frame *f, enum toolbar_pos pos) +xlike_output_toolbar (struct frame *f, enum edge_pos pos) { int x, y, bar_width, bar_height, vert; int max_pixpos, right_size, right_start, blank_size; @@ -582,7 +561,7 @@ } static void -xlike_clear_toolbar (struct frame *f, enum toolbar_pos pos, int thickness_change) +xlike_clear_toolbar (struct frame *f, enum edge_pos pos, int thickness_change) { Lisp_Object frame; int x, y, width, height, vert; @@ -594,7 +573,7 @@ to clear any excess toolbar if the size shrinks. */ if (thickness_change < 0) { - if (pos == LEFT_TOOLBAR || pos == RIGHT_TOOLBAR) + if (pos == LEFT_EDGE || pos == RIGHT_EDGE) { x = x + width + thickness_change; width = -thickness_change; @@ -616,42 +595,32 @@ void xlike_output_frame_toolbars (struct frame *f) { - __INTERNAL_APPROPRIATENESS_CHECK(f); - - if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) - xlike_output_toolbar (f, TOP_TOOLBAR); + enum edge_pos pos; + __INTERNAL_APPROPRIATENESS_CHECK (f); - if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) - xlike_output_toolbar (f, BOTTOM_TOOLBAR); - - if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) - xlike_output_toolbar (f, LEFT_TOOLBAR); - - if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) - xlike_output_toolbar (f, RIGHT_TOOLBAR); + EDGE_POS_LOOP (pos) + { + if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos)) + xlike_output_toolbar (f, pos); + } } void xlike_clear_frame_toolbars (struct frame *f) { - __INTERNAL_APPROPRIATENESS_CHECK(f); + enum edge_pos pos; + __INTERNAL_APPROPRIATENESS_CHECK (f); - if (f->top_toolbar_was_visible - && !FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) - xlike_clear_toolbar (f, TOP_TOOLBAR, 0); - if (f->bottom_toolbar_was_visible - && !FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) - xlike_clear_toolbar (f, BOTTOM_TOOLBAR, 0); - if (f->left_toolbar_was_visible - && !FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) - xlike_clear_toolbar (f, LEFT_TOOLBAR, 0); - if (f->right_toolbar_was_visible - && !FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) - xlike_clear_toolbar (f, RIGHT_TOOLBAR, 0); + EDGE_POS_LOOP (pos) + { + if (f->toolbar_was_visible[pos] + && !FRAME_REAL_TOOLBAR_VISIBLE (f, pos)) + xlike_clear_toolbar (f, pos, 0); + } } static void -xlike_redraw_exposed_toolbar (struct frame *f, enum toolbar_pos pos, int x, int y, +xlike_redraw_exposed_toolbar (struct frame *f, enum edge_pos pos, int x, int y, int width, int height) { int bar_x, bar_y, bar_width, bar_height, vert; @@ -701,19 +670,14 @@ xlike_redraw_exposed_toolbars (struct frame *f, int x, int y, int width, int height) { - __INTERNAL_APPROPRIATENESS_CHECK(f); - - if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) - xlike_redraw_exposed_toolbar (f, TOP_TOOLBAR, x, y, width, height); + enum edge_pos pos; + __INTERNAL_APPROPRIATENESS_CHECK (f); - if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) - xlike_redraw_exposed_toolbar (f, BOTTOM_TOOLBAR, x, y, width, height); - - if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) - xlike_redraw_exposed_toolbar (f, LEFT_TOOLBAR, x, y, width, height); - - if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) - xlike_redraw_exposed_toolbar (f, RIGHT_TOOLBAR, x, y, width, height); + EDGE_POS_LOOP (pos) + { + if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos)) + xlike_redraw_exposed_toolbar (f, pos, x, y, width, height); + } } void @@ -724,7 +688,7 @@ particular before we have actually mapped it. That routine can call this one. So, we need to make sure that the frame is actually ready before we try and draw all over it. */ - if (__INTERNAL_MAPPED_P(f)) + if (__INTERNAL_MAPPED_P (f)) xlike_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f)); }
--- a/src/toolbar.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/toolbar.c Sun Mar 07 02:09:59 2010 -0600 @@ -37,10 +37,10 @@ #include "toolbar.h" #include "window.h" -Lisp_Object Vtoolbar[4]; -Lisp_Object Vtoolbar_size[4]; -Lisp_Object Vtoolbar_visible_p[4]; -Lisp_Object Vtoolbar_border_width[4]; +Lisp_Object Vtoolbar[NUM_EDGES]; +Lisp_Object Vtoolbar_size[NUM_EDGES]; +Lisp_Object Vtoolbar_visible_p[NUM_EDGES]; +Lisp_Object Vtoolbar_border_width[NUM_EDGES]; Lisp_Object Vdefault_toolbar, Vdefault_toolbar_visible_p; Lisp_Object Vdefault_toolbar_width, Vdefault_toolbar_height; @@ -256,16 +256,16 @@ } -static enum toolbar_pos +static enum edge_pos decode_toolbar_position (Lisp_Object position) { - if (EQ (position, Qtop)) return TOP_TOOLBAR; - if (EQ (position, Qbottom)) return BOTTOM_TOOLBAR; - if (EQ (position, Qleft)) return LEFT_TOOLBAR; - if (EQ (position, Qright)) return RIGHT_TOOLBAR; + if (EQ (position, Qtop)) return TOP_EDGE; + if (EQ (position, Qbottom)) return BOTTOM_EDGE; + if (EQ (position, Qleft)) return LEFT_EDGE; + if (EQ (position, Qright)) return RIGHT_EDGE; invalid_constant ("Invalid toolbar position", position); - RETURN_NOT_REACHED (TOP_TOOLBAR); + RETURN_NOT_REACHED (TOP_EDGE); } DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, 1, 1, 0, /* @@ -275,8 +275,8 @@ */ (position)) { - enum toolbar_pos cur = decode_toolbar_position (Vdefault_toolbar_position); - enum toolbar_pos new_ = decode_toolbar_position (position); + enum edge_pos cur = decode_toolbar_position (Vdefault_toolbar_position); + enum edge_pos new_ = decode_toolbar_position (position); if (cur != new_) { @@ -288,7 +288,7 @@ set_specifier_fallback (Vtoolbar[new_], Vdefault_toolbar); set_specifier_fallback (Vtoolbar_size[cur], list1 (Fcons (Qnil, Qzero))); set_specifier_fallback (Vtoolbar_size[new_], - new_ == TOP_TOOLBAR || new_ == BOTTOM_TOOLBAR + new_ == TOP_EDGE || new_ == BOTTOM_EDGE ? Vdefault_toolbar_height : Vdefault_toolbar_width); set_specifier_fallback (Vtoolbar_border_width[cur], @@ -594,7 +594,7 @@ } void -mark_frame_toolbar_buttons_dirty (struct frame *f, enum toolbar_pos pos) +mark_frame_toolbar_buttons_dirty (struct frame *f, enum edge_pos pos) { Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, pos); @@ -608,7 +608,7 @@ } static Lisp_Object -compute_frame_toolbar_buttons (struct frame *f, enum toolbar_pos pos, +compute_frame_toolbar_buttons (struct frame *f, enum edge_pos pos, Lisp_Object toolbar) { Lisp_Object buttons, prev_button, first_button; @@ -717,7 +717,7 @@ } static void -set_frame_toolbar (struct frame *f, enum toolbar_pos pos) +set_frame_toolbar (struct frame *f, enum edge_pos pos) { struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); Lisp_Object toolbar = w->toolbar[pos]; @@ -729,10 +729,10 @@ static void compute_frame_toolbars_data (struct frame *f) { - set_frame_toolbar (f, TOP_TOOLBAR); - set_frame_toolbar (f, BOTTOM_TOOLBAR); - set_frame_toolbar (f, LEFT_TOOLBAR); - set_frame_toolbar (f, RIGHT_TOOLBAR); + set_frame_toolbar (f, TOP_EDGE); + set_frame_toolbar (f, BOTTOM_EDGE); + set_frame_toolbar (f, LEFT_EDGE); + set_frame_toolbar (f, RIGHT_EDGE); } /* Update the toolbar geometry separately from actually displaying the @@ -766,14 +766,15 @@ unchanged, as it will hose windows whose pixsizes are not multiple of character sizes. */ - for (pos = 0; pos < 4; pos++) + EDGE_POS_LOOP (pos) if (FRAME_REAL_TOOLBAR_SIZE (f, pos) != FRAME_CURRENT_TOOLBAR_SIZE (f, pos)) frame_size_changed = 1; - for (pos = 0; pos < 4; pos++) { - f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); - } + EDGE_POS_LOOP (pos) + { + f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); + } /* Removed the check for the minibuffer here. We handle this more correctly now by consistently using @@ -781,6 +782,17 @@ throughout the toolbar code. */ compute_frame_toolbars_data (f); + /* #### GEOM! Turning the toolbar on and off repeatedly causes the + frame to steadily shrink. Basically, turning it on doesn't + increase the frame size, while turning it off does reduce the + frame size. The cause has something to do with the combination + of this maybe questionable code here, plus the fact that toolbars + are included in the displayable area, and the difference between + real and theoretical toolbar sizes, and exactly when the various + computations happen w.r.t. the specifiers or whatever that control + whether toolbars are visible and hence whether their thickness is + greater than zero. --ben */ + if (frame_size_changed) { int width, height; @@ -837,7 +849,7 @@ already recomputed, and possibly modified by resource initialization. Remember current toolbar geometry so next redisplay will not needlessly relayout toolbars. */ - for (pos = 0; pos < 4; pos++) + EDGE_POS_LOOP (pos) f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); } } @@ -872,7 +884,7 @@ } void -get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x, int *y, +get_toolbar_coords (struct frame *f, enum edge_pos pos, int *x, int *y, int *width, int *height, int *vert, int for_layout) { int visible_top_toolbar_height, visible_bottom_toolbar_height; @@ -896,7 +908,7 @@ switch (pos) { - case TOP_TOOLBAR: + case TOP_EDGE: *x = 1; *y = 0; /* #### should be 1 if no menubar */ *width = FRAME_PIXWIDTH (f) - 2; @@ -904,7 +916,7 @@ 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f) - adjust; *vert = 0; break; - case BOTTOM_TOOLBAR: + case BOTTOM_EDGE: *x = 1; *y = FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); @@ -913,7 +925,7 @@ 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f) - adjust; *vert = 0; break; - case LEFT_TOOLBAR: + case LEFT_EDGE: *x = 1; *y = visible_top_toolbar_height; *width = FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + @@ -922,7 +934,7 @@ visible_bottom_toolbar_height - 1); *vert = 1; break; - case RIGHT_TOOLBAR: + case RIGHT_EDGE: *x = FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); *y = visible_top_toolbar_height; @@ -938,7 +950,7 @@ } #define CHECK_TOOLBAR(pos) do { \ - if (FRAME_REAL_##pos##_VISIBLE (f)) \ + if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos)) \ { \ int x, y, width, height, vert; \ \ @@ -954,10 +966,10 @@ static Lisp_Object toolbar_buttons_at_pixpos (struct frame *f, int x_coord, int y_coord) { - CHECK_TOOLBAR (TOP_TOOLBAR); - CHECK_TOOLBAR (BOTTOM_TOOLBAR); - CHECK_TOOLBAR (LEFT_TOOLBAR); - CHECK_TOOLBAR (RIGHT_TOOLBAR); + CHECK_TOOLBAR (TOP_EDGE); + CHECK_TOOLBAR (BOTTOM_EDGE); + CHECK_TOOLBAR (LEFT_EDGE); + CHECK_TOOLBAR (RIGHT_EDGE); return Qnil; } @@ -1001,9 +1013,9 @@ DEFINE_SPECIFIER_TYPE (toolbar); -#define CTB_ERROR(msg) do { \ - maybe_signal_error (Qinvalid_argument, msg, button, Qtoolbar, errb); \ - RETURN_SANS_WARNINGS Qnil; \ +#define CTB_ERROR(msg) do { \ + maybe_signal_error (Qinvalid_argument, msg, button, Qtoolbar, errb); \ + RETURN_SANS_WARNINGS Qnil; \ } while (0) /* Returns Q_style if key was :style, Qt if ok otherwise, Qnil if error. */ @@ -1220,9 +1232,9 @@ specifier caching changes */ static void -recompute_overlaying_specifier (Lisp_Object real_one[4]) +recompute_overlaying_specifier (Lisp_Object real_one[NUM_EDGES]) { - enum toolbar_pos pos = decode_toolbar_position (Vdefault_toolbar_position); + enum edge_pos pos = decode_toolbar_position (Vdefault_toolbar_position); Fset_specifier_dirty_flag (real_one[pos]); } @@ -1505,19 +1517,19 @@ 0, 0, 0); DEFVAR_SPECIFIER ("top-toolbar", - &Vtoolbar[TOP_TOOLBAR] /* + &Vtoolbar[TOP_EDGE] /* Specifier for the toolbar at the top of the frame. Use `set-specifier' to change this. See `default-toolbar' for a description of a valid toolbar instantiator. */ ); - Vtoolbar[TOP_TOOLBAR] = Fmake_specifier (Qtoolbar); - set_specifier_caching (Vtoolbar[TOP_TOOLBAR], - offsetof (struct window, toolbar[TOP_TOOLBAR]), + Vtoolbar[TOP_EDGE] = Fmake_specifier (Qtoolbar); + set_specifier_caching (Vtoolbar[TOP_EDGE], + offsetof (struct window, toolbar[TOP_EDGE]), toolbar_specs_changed, 0, 0, 0); DEFVAR_SPECIFIER ("bottom-toolbar", - &Vtoolbar[BOTTOM_TOOLBAR] /* + &Vtoolbar[BOTTOM_EDGE] /* Specifier for the toolbar at the bottom of the frame. Use `set-specifier' to change this. See `default-toolbar' for a description of a valid toolbar instantiator. @@ -1527,14 +1539,14 @@ `bottom-toolbar-height') is 0; thus, a bottom toolbar will not be displayed even if you provide a value for `bottom-toolbar'. */ ); - Vtoolbar[BOTTOM_TOOLBAR] = Fmake_specifier (Qtoolbar); - set_specifier_caching (Vtoolbar[BOTTOM_TOOLBAR], - offsetof (struct window, toolbar[BOTTOM_TOOLBAR]), + Vtoolbar[BOTTOM_EDGE] = Fmake_specifier (Qtoolbar); + set_specifier_caching (Vtoolbar[BOTTOM_EDGE], + offsetof (struct window, toolbar[BOTTOM_EDGE]), toolbar_specs_changed, 0, 0, 0); DEFVAR_SPECIFIER ("left-toolbar", - &Vtoolbar[LEFT_TOOLBAR] /* + &Vtoolbar[LEFT_EDGE] /* Specifier for the toolbar at the left edge of the frame. Use `set-specifier' to change this. See `default-toolbar' for a description of a valid toolbar instantiator. @@ -1544,14 +1556,14 @@ `left-toolbar-width') is 0; thus, a left toolbar will not be displayed even if you provide a value for `left-toolbar'. */ ); - Vtoolbar[LEFT_TOOLBAR] = Fmake_specifier (Qtoolbar); - set_specifier_caching (Vtoolbar[LEFT_TOOLBAR], - offsetof (struct window, toolbar[LEFT_TOOLBAR]), + Vtoolbar[LEFT_EDGE] = Fmake_specifier (Qtoolbar); + set_specifier_caching (Vtoolbar[LEFT_EDGE], + offsetof (struct window, toolbar[LEFT_EDGE]), toolbar_specs_changed, 0, 0, 0); DEFVAR_SPECIFIER ("right-toolbar", - &Vtoolbar[RIGHT_TOOLBAR] /* + &Vtoolbar[RIGHT_EDGE] /* Specifier for the toolbar at the right edge of the frame. Use `set-specifier' to change this. See `default-toolbar' for a description of a valid toolbar instantiator. @@ -1561,9 +1573,9 @@ `right-toolbar-width') is 0; thus, a right toolbar will not be displayed even if you provide a value for `right-toolbar'. */ ); - Vtoolbar[RIGHT_TOOLBAR] = Fmake_specifier (Qtoolbar); - set_specifier_caching (Vtoolbar[RIGHT_TOOLBAR], - offsetof (struct window, toolbar[RIGHT_TOOLBAR]), + Vtoolbar[RIGHT_EDGE] = Fmake_specifier (Qtoolbar); + set_specifier_caching (Vtoolbar[RIGHT_EDGE], + offsetof (struct window, toolbar[RIGHT_EDGE]), toolbar_specs_changed, 0, 0, 0); @@ -1571,10 +1583,10 @@ changed with `set-default-toolbar-position'. */ fb = list1 (Fcons (Qnil, Qnil)); set_specifier_fallback (Vdefault_toolbar, fb); - set_specifier_fallback (Vtoolbar[TOP_TOOLBAR], Vdefault_toolbar); - set_specifier_fallback (Vtoolbar[BOTTOM_TOOLBAR], fb); - set_specifier_fallback (Vtoolbar[LEFT_TOOLBAR], fb); - set_specifier_fallback (Vtoolbar[RIGHT_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar[TOP_EDGE], Vdefault_toolbar); + set_specifier_fallback (Vtoolbar[BOTTOM_EDGE], fb); + set_specifier_fallback (Vtoolbar[LEFT_EDGE], fb); + set_specifier_fallback (Vtoolbar[RIGHT_EDGE], fb); DEFVAR_SPECIFIER ("default-toolbar-height", &Vdefault_toolbar_height /* *Height of the default toolbar, if it's oriented horizontally. @@ -1636,59 +1648,59 @@ default_toolbar_size_changed_in_frame, 0); DEFVAR_SPECIFIER ("top-toolbar-height", - &Vtoolbar_size[TOP_TOOLBAR] /* + &Vtoolbar_size[TOP_EDGE] /* *Height of the top toolbar. This is a specifier; use `set-specifier' to change it. See `default-toolbar-height' for more information. */ ); - Vtoolbar_size[TOP_TOOLBAR] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vtoolbar_size[TOP_TOOLBAR], - offsetof (struct window, toolbar_size[TOP_TOOLBAR]), + Vtoolbar_size[TOP_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vtoolbar_size[TOP_EDGE], + offsetof (struct window, toolbar_size[TOP_EDGE]), toolbar_geometry_changed_in_window, - offsetof (struct frame, toolbar_size[TOP_TOOLBAR]), + offsetof (struct frame, toolbar_size[TOP_EDGE]), frame_size_slipped, 0); DEFVAR_SPECIFIER ("bottom-toolbar-height", - &Vtoolbar_size[BOTTOM_TOOLBAR] /* + &Vtoolbar_size[BOTTOM_EDGE] /* *Height of the bottom toolbar. This is a specifier; use `set-specifier' to change it. See `default-toolbar-height' for more information. */ ); - Vtoolbar_size[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vtoolbar_size[BOTTOM_TOOLBAR], - offsetof (struct window, toolbar_size[BOTTOM_TOOLBAR]), + Vtoolbar_size[BOTTOM_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vtoolbar_size[BOTTOM_EDGE], + offsetof (struct window, toolbar_size[BOTTOM_EDGE]), toolbar_geometry_changed_in_window, - offsetof (struct frame, toolbar_size[BOTTOM_TOOLBAR]), + offsetof (struct frame, toolbar_size[BOTTOM_EDGE]), frame_size_slipped, 0); DEFVAR_SPECIFIER ("left-toolbar-width", - &Vtoolbar_size[LEFT_TOOLBAR] /* + &Vtoolbar_size[LEFT_EDGE] /* *Width of left toolbar. This is a specifier; use `set-specifier' to change it. See `default-toolbar-height' for more information. */ ); - Vtoolbar_size[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vtoolbar_size[LEFT_TOOLBAR], - offsetof (struct window, toolbar_size[LEFT_TOOLBAR]), + Vtoolbar_size[LEFT_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vtoolbar_size[LEFT_EDGE], + offsetof (struct window, toolbar_size[LEFT_EDGE]), toolbar_geometry_changed_in_window, - offsetof (struct frame, toolbar_size[LEFT_TOOLBAR]), + offsetof (struct frame, toolbar_size[LEFT_EDGE]), frame_size_slipped, 0); DEFVAR_SPECIFIER ("right-toolbar-width", - &Vtoolbar_size[RIGHT_TOOLBAR] /* + &Vtoolbar_size[RIGHT_EDGE] /* *Width of right toolbar. This is a specifier; use `set-specifier' to change it. See `default-toolbar-height' for more information. */ ); - Vtoolbar_size[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vtoolbar_size[RIGHT_TOOLBAR], - offsetof (struct window, toolbar_size[RIGHT_TOOLBAR]), + Vtoolbar_size[RIGHT_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vtoolbar_size[RIGHT_EDGE], + offsetof (struct window, toolbar_size[RIGHT_EDGE]), toolbar_geometry_changed_in_window, - offsetof (struct frame, toolbar_size[RIGHT_TOOLBAR]), + offsetof (struct frame, toolbar_size[RIGHT_EDGE]), frame_size_slipped, 0); DEFVAR_SPECIFIER ("toolbar-shadow-thickness", @@ -1754,11 +1766,11 @@ if (!NILP (fb)) set_specifier_fallback (Vdefault_toolbar_width, fb); - set_specifier_fallback (Vtoolbar_size[TOP_TOOLBAR], Vdefault_toolbar_height); + set_specifier_fallback (Vtoolbar_size[TOP_EDGE], Vdefault_toolbar_height); fb = list1 (Fcons (Qnil, Qzero)); - set_specifier_fallback (Vtoolbar_size[BOTTOM_TOOLBAR], fb); - set_specifier_fallback (Vtoolbar_size[LEFT_TOOLBAR], fb); - set_specifier_fallback (Vtoolbar_size[RIGHT_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar_size[BOTTOM_EDGE], fb); + set_specifier_fallback (Vtoolbar_size[LEFT_EDGE], fb); + set_specifier_fallback (Vtoolbar_size[RIGHT_EDGE], fb); DEFVAR_SPECIFIER ("default-toolbar-border-width", &Vdefault_toolbar_border_width /* @@ -1790,67 +1802,67 @@ default_toolbar_border_width_changed_in_frame, 0); DEFVAR_SPECIFIER ("top-toolbar-border-width", - &Vtoolbar_border_width[TOP_TOOLBAR] /* + &Vtoolbar_border_width[TOP_EDGE] /* *Border width of the top toolbar. This is a specifier; use `set-specifier' to change it. See `default-toolbar-height' for more information. */ ); - Vtoolbar_border_width[TOP_TOOLBAR] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vtoolbar_border_width[TOP_TOOLBAR], + Vtoolbar_border_width[TOP_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vtoolbar_border_width[TOP_EDGE], offsetof (struct window, - toolbar_border_width[TOP_TOOLBAR]), + toolbar_border_width[TOP_EDGE]), toolbar_geometry_changed_in_window, offsetof (struct frame, - toolbar_border_width[TOP_TOOLBAR]), + toolbar_border_width[TOP_EDGE]), frame_size_slipped, 0); DEFVAR_SPECIFIER ("bottom-toolbar-border-width", - &Vtoolbar_border_width[BOTTOM_TOOLBAR] /* + &Vtoolbar_border_width[BOTTOM_EDGE] /* *Border width of the bottom toolbar. This is a specifier; use `set-specifier' to change it. See `default-toolbar-height' for more information. */ ); - Vtoolbar_border_width[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vtoolbar_border_width[BOTTOM_TOOLBAR], + Vtoolbar_border_width[BOTTOM_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vtoolbar_border_width[BOTTOM_EDGE], offsetof (struct window, - toolbar_border_width[BOTTOM_TOOLBAR]), + toolbar_border_width[BOTTOM_EDGE]), toolbar_geometry_changed_in_window, offsetof (struct frame, - toolbar_border_width[BOTTOM_TOOLBAR]), + toolbar_border_width[BOTTOM_EDGE]), frame_size_slipped, 0); DEFVAR_SPECIFIER ("left-toolbar-border-width", - &Vtoolbar_border_width[LEFT_TOOLBAR] /* + &Vtoolbar_border_width[LEFT_EDGE] /* *Border width of left toolbar. This is a specifier; use `set-specifier' to change it. See `default-toolbar-height' for more information. */ ); - Vtoolbar_border_width[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vtoolbar_border_width[LEFT_TOOLBAR], + Vtoolbar_border_width[LEFT_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vtoolbar_border_width[LEFT_EDGE], offsetof (struct window, - toolbar_border_width[LEFT_TOOLBAR]), + toolbar_border_width[LEFT_EDGE]), toolbar_geometry_changed_in_window, offsetof (struct frame, - toolbar_border_width[LEFT_TOOLBAR]), + toolbar_border_width[LEFT_EDGE]), frame_size_slipped, 0); DEFVAR_SPECIFIER ("right-toolbar-border-width", - &Vtoolbar_border_width[RIGHT_TOOLBAR] /* + &Vtoolbar_border_width[RIGHT_EDGE] /* *Border width of right toolbar. This is a specifier; use `set-specifier' to change it. See `default-toolbar-height' for more information. */ ); - Vtoolbar_border_width[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vtoolbar_border_width[RIGHT_TOOLBAR], + Vtoolbar_border_width[RIGHT_EDGE] = Fmake_specifier (Qnatnum); + set_specifier_caching (Vtoolbar_border_width[RIGHT_EDGE], offsetof (struct window, - toolbar_border_width[RIGHT_TOOLBAR]), + toolbar_border_width[RIGHT_EDGE]), toolbar_geometry_changed_in_window, offsetof (struct frame, - toolbar_border_width[RIGHT_TOOLBAR]), + toolbar_border_width[RIGHT_EDGE]), frame_size_slipped, 0); fb = Qnil; @@ -1869,11 +1881,11 @@ if (!NILP (fb)) set_specifier_fallback (Vdefault_toolbar_border_width, fb); - set_specifier_fallback (Vtoolbar_border_width[TOP_TOOLBAR], Vdefault_toolbar_border_width); + set_specifier_fallback (Vtoolbar_border_width[TOP_EDGE], Vdefault_toolbar_border_width); fb = list1 (Fcons (Qnil, Qzero)); - set_specifier_fallback (Vtoolbar_border_width[BOTTOM_TOOLBAR], fb); - set_specifier_fallback (Vtoolbar_border_width[LEFT_TOOLBAR], fb); - set_specifier_fallback (Vtoolbar_border_width[RIGHT_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar_border_width[BOTTOM_EDGE], fb); + set_specifier_fallback (Vtoolbar_border_width[LEFT_EDGE], fb); + set_specifier_fallback (Vtoolbar_border_width[RIGHT_EDGE], fb); DEFVAR_SPECIFIER ("default-toolbar-visible-p", &Vdefault_toolbar_visible_p /* *Whether the default toolbar is visible. @@ -1903,78 +1915,78 @@ default_toolbar_visible_p_changed_in_frame, 0); DEFVAR_SPECIFIER ("top-toolbar-visible-p", - &Vtoolbar_visible_p[TOP_TOOLBAR] /* + &Vtoolbar_visible_p[TOP_EDGE] /* *Whether the top toolbar is visible. This is a specifier; use `set-specifier' to change it. See `default-toolbar-visible-p' for more information. */ ); - Vtoolbar_visible_p[TOP_TOOLBAR] = Fmake_specifier (Qboolean); - set_specifier_caching (Vtoolbar_visible_p[TOP_TOOLBAR], + Vtoolbar_visible_p[TOP_EDGE] = Fmake_specifier (Qboolean); + set_specifier_caching (Vtoolbar_visible_p[TOP_EDGE], offsetof (struct window, - toolbar_visible_p[TOP_TOOLBAR]), + toolbar_visible_p[TOP_EDGE]), toolbar_geometry_changed_in_window, offsetof (struct frame, - toolbar_visible_p[TOP_TOOLBAR]), + toolbar_visible_p[TOP_EDGE]), frame_size_slipped, 0); DEFVAR_SPECIFIER ("bottom-toolbar-visible-p", - &Vtoolbar_visible_p[BOTTOM_TOOLBAR] /* + &Vtoolbar_visible_p[BOTTOM_EDGE] /* *Whether the bottom toolbar is visible. This is a specifier; use `set-specifier' to change it. See `default-toolbar-visible-p' for more information. */ ); - Vtoolbar_visible_p[BOTTOM_TOOLBAR] = Fmake_specifier (Qboolean); - set_specifier_caching (Vtoolbar_visible_p[BOTTOM_TOOLBAR], + Vtoolbar_visible_p[BOTTOM_EDGE] = Fmake_specifier (Qboolean); + set_specifier_caching (Vtoolbar_visible_p[BOTTOM_EDGE], offsetof (struct window, - toolbar_visible_p[BOTTOM_TOOLBAR]), + toolbar_visible_p[BOTTOM_EDGE]), toolbar_geometry_changed_in_window, offsetof (struct frame, - toolbar_visible_p[BOTTOM_TOOLBAR]), + toolbar_visible_p[BOTTOM_EDGE]), frame_size_slipped, 0); DEFVAR_SPECIFIER ("left-toolbar-visible-p", - &Vtoolbar_visible_p[LEFT_TOOLBAR] /* + &Vtoolbar_visible_p[LEFT_EDGE] /* *Whether the left toolbar is visible. This is a specifier; use `set-specifier' to change it. See `default-toolbar-visible-p' for more information. */ ); - Vtoolbar_visible_p[LEFT_TOOLBAR] = Fmake_specifier (Qboolean); - set_specifier_caching (Vtoolbar_visible_p[LEFT_TOOLBAR], + Vtoolbar_visible_p[LEFT_EDGE] = Fmake_specifier (Qboolean); + set_specifier_caching (Vtoolbar_visible_p[LEFT_EDGE], offsetof (struct window, - toolbar_visible_p[LEFT_TOOLBAR]), + toolbar_visible_p[LEFT_EDGE]), toolbar_geometry_changed_in_window, offsetof (struct frame, - toolbar_visible_p[LEFT_TOOLBAR]), + toolbar_visible_p[LEFT_EDGE]), frame_size_slipped, 0); DEFVAR_SPECIFIER ("right-toolbar-visible-p", - &Vtoolbar_visible_p[RIGHT_TOOLBAR] /* + &Vtoolbar_visible_p[RIGHT_EDGE] /* *Whether the right toolbar is visible. This is a specifier; use `set-specifier' to change it. See `default-toolbar-visible-p' for more information. */ ); - Vtoolbar_visible_p[RIGHT_TOOLBAR] = Fmake_specifier (Qboolean); - set_specifier_caching (Vtoolbar_visible_p[RIGHT_TOOLBAR], + Vtoolbar_visible_p[RIGHT_EDGE] = Fmake_specifier (Qboolean); + set_specifier_caching (Vtoolbar_visible_p[RIGHT_EDGE], offsetof (struct window, - toolbar_visible_p[RIGHT_TOOLBAR]), + toolbar_visible_p[RIGHT_EDGE]), toolbar_geometry_changed_in_window, offsetof (struct frame, - toolbar_visible_p[RIGHT_TOOLBAR]), + toolbar_visible_p[RIGHT_EDGE]), frame_size_slipped, 0); /* initially, top inherits from default; this can be changed with `set-default-toolbar-position'. */ fb = list1 (Fcons (Qnil, Qt)); set_specifier_fallback (Vdefault_toolbar_visible_p, fb); - set_specifier_fallback (Vtoolbar_visible_p[TOP_TOOLBAR], + set_specifier_fallback (Vtoolbar_visible_p[TOP_EDGE], Vdefault_toolbar_visible_p); - set_specifier_fallback (Vtoolbar_visible_p[BOTTOM_TOOLBAR], fb); - set_specifier_fallback (Vtoolbar_visible_p[LEFT_TOOLBAR], fb); - set_specifier_fallback (Vtoolbar_visible_p[RIGHT_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar_visible_p[BOTTOM_EDGE], fb); + set_specifier_fallback (Vtoolbar_visible_p[LEFT_EDGE], fb); + set_specifier_fallback (Vtoolbar_visible_p[RIGHT_EDGE], fb); DEFVAR_SPECIFIER ("toolbar-buttons-captioned-p", &Vtoolbar_buttons_captioned_p /*
--- a/src/toolbar.h Fri Mar 05 04:08:17 2010 -0600 +++ b/src/toolbar.h Sun Mar 07 02:09:59 2010 -0600 @@ -1,6 +1,6 @@ /* Define general toolbar support. Copyright (C) 1995 Board of Trustees, University of Illinois. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2010 Ben Wing. Copyright (C) 1996 Chuck Thompson. This file is part of XEmacs. @@ -33,6 +33,11 @@ ((frame)->toolbar_buttons[pos]) #define FRAME_CURRENT_TOOLBAR_SIZE(frame, pos) \ ((frame)->current_toolbar_size[pos]) +#define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag) \ + do { \ + (frame)->toolbar_was_visible[pos] = flag; \ + } while (0) + #define DEVICE_SUPPORTS_TOOLBARS_P(d) \ HAS_DEVMETH_P (d, output_frame_toolbars) @@ -76,7 +81,7 @@ #define CHECK_TOOLBAR_BUTTON(x) CHECK_RECORD (x, toolbar_button) #define CONCHECK_TOOLBAR_BUTTON(x) CONCHECK_RECORD (x, toolbar_button) -void get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x, +void get_toolbar_coords (struct frame *f, enum edge_pos pos, int *x, int *y, int *width, int *height, int *vert, int for_layout); Lisp_Object toolbar_button_at_pixpos (struct frame *f, int x_coord, @@ -106,7 +111,7 @@ void free_frame_toolbars (struct frame *f); Lisp_Object get_toolbar_button_glyph (struct window *w, struct toolbar_button *tb); -void mark_frame_toolbar_buttons_dirty (struct frame *f, enum toolbar_pos pos); +void mark_frame_toolbar_buttons_dirty (struct frame *f, enum edge_pos pos); #endif /* HAVE_TOOLBARS */
--- a/src/vdb-posix.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/vdb-posix.c Sun Mar 07 02:09:59 2010 -0600 @@ -73,7 +73,7 @@ } else /* default sigsegv handler */ { - char *signal_name = ""; + const Ascbyte *signal_name = ""; if (signum == SIGSEGV) signal_name = "SIGSEGV"; else if (signum == SIGBUS)
--- a/src/window.c Fri Mar 05 04:08:17 2010 -0600 +++ b/src/window.c Sun Mar 07 02:09:59 2010 -0600 @@ -1804,10 +1804,8 @@ struct window *w = decode_window (window); struct frame *f = XFRAME (w->frame); - int left = - w->pixel_left - FRAME_LEFT_BORDER_END (f) - FRAME_LEFT_GUTTER_BOUNDS (f); - int top = - w->pixel_top - FRAME_TOP_BORDER_END (f) - FRAME_TOP_GUTTER_BOUNDS (f); + int left = w->pixel_left - FRAME_PANED_LEFT_EDGE (f); + int top = w->pixel_top - FRAME_PANED_TOP_EDGE (f); return list4 (make_int (left), make_int (top),