commit 1a588cb6dcfc2d9db4c1753ac7ba62ba97ee8d67 (HEAD, refs/remotes/origin/master) Author: Mike FABIAN Date: Thu Oct 8 15:45:32 2015 +0200 In gui-get-primary-selection use gui--selection-value-internal (Bug#20906) * lisp/select.el (gui-get-primary-selection): In gui-get-primary-selection use gui--selection-value-internal (Bug#20906) diff --git a/lisp/select.el b/lisp/select.el index 74b48d1..2d2ac5f 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -235,7 +235,7 @@ The value nil is the same as the list (UTF8_STRING COMPOUND_TEXT STRING)." (defun gui-get-primary-selection () "Return the PRIMARY selection, or the best emulation thereof." - (or (gui-get-selection 'PRIMARY) + (or (gui--selection-value-internal 'PRIMARY) (and (fboundp 'w32-get-selection-value) (eq (framep (selected-frame)) 'w32) ;; MS-Windows emulates PRIMARY in x-get-selection, but only commit 70c811c0479125f1bab27c7c0b9b4a79d659035d Author: Tassilo Horn Date: Mon Oct 12 08:04:29 2015 +0200 Support RTF in doc-view * lisp/doc-view.el (doc-view-set-doc-type): Add entry for RTF extension. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 5f1c94a..9227b82 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1648,7 +1648,7 @@ If BACKWARD is non-nil, jump to the previous match." ;; Microsoft Office formats (also handled by the odf ;; conversion chain). ("doc" odf) ("docx" odf) ("xls" odf) ("xlsx" odf) - ("ppt" odf) ("pps" odf) ("pptx" odf)) + ("ppt" odf) ("pps" odf) ("pptx" odf) ("rtf" odf)) t)))) (content-types (save-excursion commit 3f1c88de2ec78fba14e2b28ce43939017b723083 Author: Juanma Barranquero Date: Mon Oct 12 06:55:02 2015 +0200 * w32fns.c (get_wm_chars): Increment counter, not pointer. diff --git a/src/w32fns.c b/src/w32fns.c index 99fd3ba..9b0770a 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2917,7 +2917,7 @@ get_wm_chars (HWND aWnd, int *buf, int buflen, int ignore_ctrl, int ctrl, /* Non-character payload in a WM_CHAR (Ctrl-something pressed, see above). Ignore, and report. */ if (ctrl_cnt) - *ctrl_cnt++; + (*ctrl_cnt)++; continue; } /* Traditionally, Emacs would ignore the character payload of VK_NUMPAD* commit 644d31a2690ba512600a96a7db801d074b26f48d Author: Nicolas Petton Date: Sun Oct 11 22:58:35 2015 +0200 Replace the usage of an obsolete function in auth-source.el * lisp/gnus/auth-source.el (auth-source-epa-make-gpg-token): Replace an usage of `epg-context-set-armor' with `setf'. diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index 52ea368..75e6d04 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -1152,7 +1152,7 @@ FILE is the file from which we obtained this token." (let ((context (epg-make-context 'OpenPGP)) (pp-escape-newlines nil) cipher) - (epg-context-set-armor context t) + (setf (epg-context-armor context) t) (epg-context-set-passphrase-callback context (cons #'auth-source-token-passphrase-callback-function commit 831807fafeb782c43dcf4c1927a0a4f886e226e0 Author: Nicolas Petton Date: Sun Oct 11 22:58:25 2015 +0200 * lisp/gnus/auth-source.el: Use sharp-quoting with functions. diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index 32e22eb..52ea368 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -340,12 +340,12 @@ If the value is not a list, symmetric encryption will be used." ;; (let ((auth-source-debug nil)) (auth-source-do-debug "hello")) (defun auth-source-do-debug (&rest msg) (when auth-source-debug - (apply 'auth-source-do-warn msg))) + (apply #'auth-source-do-warn msg))) (defun auth-source-do-trivia (&rest msg) (when (or (eq auth-source-debug 'trivia) (functionp auth-source-debug)) - (apply 'auth-source-do-warn msg))) + (apply #'auth-source-do-warn msg))) (defun auth-source-do-warn (&rest msg) (apply @@ -365,7 +365,7 @@ Only one of CHOICES will be returned. The PROMPT is augmented with \"[a/b/c] \" if CHOICES is \(?a ?b ?c)." (when choices (let* ((prompt-choices - (apply 'concat (loop for c in choices + (apply #'concat (loop for c in choices collect (format "%c/" c)))) (prompt-choices (concat "[" (substring prompt-choices 0 -1) "] ")) (full-prompt (concat prompt prompt-choices)) @@ -685,7 +685,7 @@ actually useful. So the caller must arrange to call this function. The token's :secret key can hold a function. In that case you must call it to obtain the actual value." - (let* ((backends (mapcar 'auth-source-backend-parse auth-sources)) + (let* ((backends (mapcar #'auth-source-backend-parse auth-sources)) (max (or max 1)) (ignored-keys '(:require :create :delete :max)) (keys (loop for i below (length spec) by 2 @@ -902,7 +902,7 @@ while \(:host t) would find all host entries." ;; (auth-source-pick-first-password :port "imap") (defun auth-source-pick-first-password (&rest spec) "Pick the first secret found from applying SPEC to `auth-source-search'." - (let* ((result (nth 0 (apply 'auth-source-search (plist-put spec :max 1)))) + (let* ((result (nth 0 (apply #'auth-source-search (plist-put spec :max 1)))) (secret (plist-get result :secret))) (if (functionp secret) @@ -1011,8 +1011,8 @@ Note that the MAX parameter is used so we can exit the parse early." (auth-source--aput auth-source-netrc-cache file (list :mtime (nth 5 (file-attributes file)) - :secret (lexical-let ((v (mapcar '1+ (buffer-string)))) - (lambda () (apply 'string (mapcar '1- v))))))) + :secret (lexical-let ((v (mapcar #'1+ (buffer-string)))) + (lambda () (apply #'string (mapcar #'1- v))))))) (goto-char (point-min)) (let ((entries (auth-source-netrc-parse-entries check max)) alist) @@ -1241,7 +1241,7 @@ See `auth-source-search' for details on SPEC." ;; to get the updated data. ;; the result will be returned, even if the search fails - (apply 'auth-source-netrc-search + (apply #'auth-source-netrc-search (plist-put spec :create nil))))) results)) @@ -1591,7 +1591,7 @@ authentication tokens: ;; build a search spec without the ignored keys ;; if a search key is nil or t (match anything), we skip it (search-specs (auth-source-secrets-listify-pattern - (apply 'append (mapcar + (apply #'append (mapcar (lambda (k) (if (or (null (plist-get spec k)) (eq t (plist-get spec k))) @@ -1605,7 +1605,7 @@ authentication tokens: (items (loop for search-spec in search-specs nconc - (loop for item in (apply 'secrets-search-items coll search-spec) + (loop for item in (apply #'secrets-search-items coll search-spec) unless (and (stringp label) (not (string-match label item))) collect item))) @@ -1620,7 +1620,7 @@ authentication tokens: (lexical-let ((v (secrets-get-secret coll item))) (lambda () v))) ;; rewrite the entry from ((k1 v1) (k2 v2)) to plist - (apply 'append + (apply #'append (mapcar (lambda (entry) (list (car entry) (cdr entry))) (secrets-get-attributes coll item))))) @@ -1628,7 +1628,7 @@ authentication tokens: ;; ensure each item has each key in `returned-keys' (items (mapcar (lambda (plist) (append - (apply 'append + (apply #'append (mapcar (lambda (req) (if (plist-get plist req) nil @@ -1722,7 +1722,7 @@ entries for git.gnus.org: collect (nth i spec))) ;; build a search spec without the ignored keys ;; if a search key is nil or t (match anything), we skip it - (search-spec (apply 'append (mapcar + (search-spec (apply #'append (mapcar (lambda (k) (if (or (null (plist-get spec k)) (eq t (plist-get spec k))) @@ -1733,7 +1733,7 @@ entries for git.gnus.org: (returned-keys (mm-delete-duplicates (append '(:host :login :port :secret) search-keys))) - (items (apply 'auth-source-macos-keychain-search-items + (items (apply #'auth-source-macos-keychain-search-items coll type max @@ -1742,7 +1742,7 @@ entries for git.gnus.org: ;; ensure each item has each key in `returned-keys' (items (mapcar (lambda (plist) (append - (apply 'append + (apply #'append (mapcar (lambda (req) (if (plist-get plist req) nil @@ -1782,7 +1782,7 @@ entries for git.gnus.org: (setq args (append args (list coll)))) (with-temp-buffer - (apply 'call-process "/usr/bin/security" nil t nil args) + (apply #'call-process "/usr/bin/security" nil t nil args) (goto-char (point-min)) (while (not (eobp)) (cond @@ -1850,7 +1850,7 @@ entries for git.gnus.org: collect (nth i spec))) ;; build a search spec without the ignored keys ;; if a search key is nil or t (match anything), we skip it - (search-spec (apply 'append (mapcar + (search-spec (apply #'append (mapcar (lambda (k) (let ((v (plist-get spec k))) (if (or (null v) @@ -1881,7 +1881,7 @@ entries for git.gnus.org: ;; ensure each item has each key in `returned-keys' (items (mapcar (lambda (plist) (append - (apply 'append + (apply #'append (mapcar (lambda (req) (if (plist-get plist req) nil @@ -1903,7 +1903,7 @@ entries for git.gnus.org: ;; to get the updated data. ;; the result will be returned, even if the search fails - (apply 'auth-source-plstore-search + (apply #'auth-source-plstore-search (plist-put spec :create nil))))) ((and delete item-names) @@ -2103,7 +2103,7 @@ MODE can be \"login\" or \"password\"." host port username) found) ; return the found data ;; else, if not found, search with a max of 1 - (let ((choice (nth 0 (apply 'auth-source-search + (let ((choice (nth 0 (apply #'auth-source-search (append '(:max 1) search))))) (when choice (dolist (m mode) commit 732d259948833935c343ed88b08316253e12b306 Author: Jay Belanger Date: Sun Oct 11 15:35:18 2015 -0500 Have calc-yank recognize numbers in different bases. * lisp/calc/calc-yank.el (math-number-regexp): New function. (calc-yank): Use `math-number-regexp' to recognize numbers. diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index cd44750..5105ba9 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -107,6 +107,46 @@ (interactive "r") (calc-kill-region top bot t)) +(defun math-number-regexp (radix-num) + "Return a regexp which will match a Calc number base RADIX-NUM." + (let* ((digit-range + (cond + ;; radix 2 to 10 + ((and (<= 2 radix-num) + (>= 10 radix-num)) + (concat "[0-" + (number-to-string (1- radix-num)) + "]")) + ;; radix 11 + ((= 11 radix-num) "[0-9aA]") + ;; radix 12+ + (t + (concat "[0-9" + "a-" (format "%c" (+ (- ?a 11) radix-num)) + "A-" (format "%c" (+ (- ?A 11) radix-num)) + "]")))) + (integer-regexp (concat digit-range "+")) + (decimal-regexp (concat digit-range "+\\." digit-range "*"))) + (concat + " *\\(" + ;; "e" notation + "[-_+]?" decimal-regexp "[eE][-+]?[0-9]+" + "\\|" + "[-_+]?" integer-regexp "[eE][-+]?[0-9]+" + "\\|" + ;; Integer+fractions + "[-_+]?" integer-regexp "*[:/]" integer-regexp "[:/]" integer-regexp + "\\|" + ;; Fractions + "[-_+]?" integer-regexp "[:/]" integer-regexp + "\\|" + ;; Decimal point + "[-_+]?" decimal-regexp + "\\|" + ;; Integers + "[-_+]?" integer-regexp + "\\) *\\(\n\\|\\'\\)"))) + ;; This function uses calc-last-kill if possible to get an exact result, ;; otherwise it just parses the yanked string. ;; Modified to use Emacs 19 extended concept of kill-ring. -- daveg 12/15/96 @@ -171,21 +211,7 @@ alteration." (setq radix-notation (concat (number-to-string radix-num) "#")) (setq valid-num-regexp - (cond - ;; radix 2 to 10 - ((and (<= 2 radix-num) - (>= 10 radix-num)) - (concat "[0-" - (number-to-string (1- radix-num)) - "]+")) - ;; radix 11 - ((= 11 radix-num) "[0-9aA]+") - ;; radix 12+ - (t - (concat "[0-9" - "a-" (format "%c" (+ (- ?a 11) radix-num)) - "A-" (format "%c" (+ (- ?A 11) radix-num)) - "]+")))) + (math-number-regexp radix-num)) ;; Ensure that the radix-notation is prefixed ;; correctly even for multi-line yanks like below, ;; 111 commit 358794e5a75e96eb512ec3c64efcc10deaa8383a Author: Glenn Morris Date: Sun Oct 11 06:25:44 2015 -0400 ; Auto-commit of ChangeLog files. diff --git a/ChangeLog.2 b/ChangeLog.2 index 94c8508..9e04ab0 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -1,3 +1,561 @@ +2015-10-11 Ken Raeburn + + Handle an opaque-move X11 window manager operation more efficiently. + + * src/xterm.c (handle_one_xevent): If a ConfigureNotify event is + followed by more ConfigureNotify events for the same window, process + only the last one. + +2015-10-11 Ken Raeburn + + Fix cursor setting for tip frame; re-enable cursor generation. + + * src/xfns.c (x_create_tip_frame): Include the cursor in the window + attributes sent when creating the new X window. Don't skip setting + the pointerColor parameter. + +2015-10-11 Ken Raeburn + + Rewrite x_set_mouse_color to sync less. + + We can track serial numbers of X requests and correlate error events + with the associated requests. This way we can identify errors for + specific calls without having to use XSync after every one. + + * src/xfns.c (enum mouse_cursor): New type. + (struct mouse_cursor_types, struct mouse_cursor_data): New types. + (mouse_cursor_types): New array listing the Lisp variables and default + cursor appearances for each cursor type. + (x_set_mouse_color_handler): New function; checks error event serial + number against submitted requests. + (x_set_mouse_color): Updated to use the new error handler callback, + and to be more table-driven, to simplify repetitious code. + +2015-10-11 Ken Raeburn + + Add x_catch_errors_with_handler. + + * src/xterm.c (struct x_error_message_stack): Add new fields for a + callback function and associated data pointer. + (x_error_catcher): If the callback function is set, call it after + saving the error message string. + (x_catch_errors_with_handler): Renamed from x_catch_errors but now + accepts a callback function and data pointer. + (x_catch_errors): Now a wrapper function. + * src/xterm.h (x_special_error_handler): New typedef. + (x_catch_errors_with_handler): Declare. + +2015-10-11 Ken Raeburn + + Introduce x_uncatch_errors_after_check to reduce XSync calls. + + Both x_had_errors_p and x_check_errors call XSync, so if they're + immediately followed by x_uncatch_errors, its XSync call will be + redundant, resulting in a wasted round trip to the X server. + + * src/xterm.c (x_uncatch_errors_after_check): New routine; a copy of + x_uncatch_errors without the XSync call. + (XTmouse_position, x_wm_supports): + * src/xfns.c (x_set_mouse_color): + * src/xmenu.c (Fx_menu_bar_open_internal): + * src/xselect.c (x_own_selection, x_get_foreign_selection): + (Fx_get_atom_name): Call it instead of x_uncatch_errors. + * src/xterm.h (x_uncatch_errors_after_check): Declare. + +2015-10-10 Jay Belanger + + Document the optional prefix to `calc-yank'. + + * doc/misc/calc.texi (Yanking into the Stack): Document the optional + prefix to `calc-yank'. + * lisp/calc/calc-yank.el (calc-yank): Ensure that things killed from + the Calc buffer are yanked back unchanged. + +2015-10-10 Mark Oteiza + + * lisp/calendar/calendar.el: Display buffer before executing body. + + In each use of this macro, the modeline is derived from a window width + calculation, which will be wrong if (display-buffer) splits the window + horizontally. + +2015-10-10 Paul Eggert + + Use ‘echo’ safely with ‘\’ or leading ‘-’ + + POSIX says that ‘echo FOO’ produces implementation-defined output + if FOO contains leading ‘-’, or ‘\’ anywhere, so don’t assume GNU + behavior in that case. + * Makefile.in (removenullpaths): Remove. + (epaths-force): Rewrite to avoid the need for ‘echo’. + (install-etc): Be clearer about escaping the shell metacharacters + ‘\’ and ‘$’. + * Makefile.in (install-arch-indep, install-etcdoc): + * admin/charsets/mapconv, admin/merge-gnulib, admin/merge-pkg-config: + * admin/quick-install-emacs, build-aux/gitlog-to-emacslog: + * configure.ac, lib-src/rcs2log, make-dist: + * src/Makefile.in (lisp.mk): + Don’t assume ‘echo’ outputs ‘\’ and leading ‘-’ unscathed. + For example, use ‘printf '%s\n' "$foo"’ rather than ‘echo "$foo"’ + if $foo can contain arbitrary characters. + * lisp/Makefile.in (TAGS): Use ‘ls’, not ‘echo’, to avoid ‘\’ issues. + * doc/lispref/two-volume.make (vol1.pdf): + * test/etags/make-src/Makefile (web ftp publish): + Use ‘printf’ rather than ‘echo -e’. + +2015-10-10 Kaushal Modi + + Allow numbers with different radixes to be yanked. + + * lisp/calc/calc-yank.el (calc-yank): Allow radixes besides the + default base 10. + +2015-10-10 Paul Eggert + + Improve CHECK_IMPURE and PURE_P speedup + + * src/data.c (Faset): Use XVECTOR and XSTRING rather than XPNTR. + +2015-10-10 Jay Belanger + + Use events instead of chars to keep track of steps. + + * lisp/calc/calc-prog.el (calc-kbd-loop): Use events instead of chars + to keep track of steps. + +2015-10-10 Paul Eggert + + Fix --enable-gcc-warnings problem with older GCC + + * src/puresize.h: Add INLINE_HEADER_BEGIN, INLINE_HEADER_END. + This is for building with --enable-gcc-warnings with + GCC 4.6 through 5.0. + +2015-10-10 Eli Zaretskii + + Fix vertical-motion in truncated lines that end in a stretch + + * src/indent.c (Fvertical_motion): Expect overshoot when point is + beyond window margin and lines are truncated, even if we have a + stretch at point. (Bug#21468) + +2015-10-10 Eli Zaretskii + + Avoid link-time errors due to inline functions + + * src/emacs.c: Include puresize.h, to avoid link-time errors in + unoptimized builds due to PURE_P and CHECK_IMPURE, which are now + inline functions. + +2015-10-10 Andreas Schwab + + * src/data.c (Faset): Fix last change. + +2015-10-10 Paul Eggert + + CHECK_IMPURE and PURE_P speedup + + * src/intervals.c (create_root_interval): + Do CHECK_IMPURE only for strings; not needed for buffers. + Prefer ! STRINGP to BUFFERP, for a tad more speed. + * src/puresize.h (CHECK_IMPURE, PURE_P): + Now inline functions instead of macros. + (PURE_P): Don’t use XPNTR; that is now the caller’s responsibility. + All callers changed. + (CHECK_IMPURE): New argument PTR, to save us the work of running XPNTR. + All callers changed. + +2015-10-09 Noah Friedman + + (tramp-open-connection-setup-interactive-shell): Send -onlcr as well. + +2015-10-09 Stefan Monnier + + * lisp/progmodes/cc-mode.el (c-after-font-lock-init): Only *move* + + our after-change-function, rather than re-adding it if it was removed. + +2015-10-09 Stefan Monnier + + * lisp/cedet/ede: Silence some compiler warnings + + * lisp/cedet/ede.el: Require cl-lib. Silence some compiler warnings. + (ede-menu-obj-of-class-p): Use cl-some rather than `eval'. + (ede-apply-object-keymap, ede-reset-all-buffers) + (ede-auto-add-to-target): Use dolist. + (ede-new, ede-flush-deleted-projects, ede-global-list-sanity-check): + Use field names rather than initarg names in `oref'. + (ede-load-project-file): Remove unused var `file'. + (ede-map-any-target-p): Use cl-some rather than ede-map-targets. + (ede-set): Remove unused var `a'. + + * lisp/cedet/ede/emacs.el: Silence some compiler warnings. + (ede-project-autoload): Avoid the old-style "name" argument. + (ede-emacs-find-matching-target): Use field names rather than initarg + names in `oref'. + + * lisp/cedet/ede/linux.el: Silence some compiler warnings. + (ede-linux-load, ede-project-autoload): Avoid the old-style "name" argument. + (ede-linux-find-matching-target): Use field names rather than initarg + names in `oref'. + +2015-10-09 Stefan Monnier + + * lisp/textmodes/reftex.el: Silence byte-compiler warnings. + +2015-10-09 Stefan Monnier + + * lisp/progmodes/prolog.el: Avoid indenting too much, after ":-" + + (prolog-smie-rules): Try and avoid indenting too far after ":-". + +2015-10-09 Eli Zaretskii + + Update case-table and categories of recently added characters + + * lisp/international/characters.el: Update information about Latin + Extended-C, Latin Extended-D, Latin Extended-E, Cyrillic Extended, + Georgian, Glagolitic, Deseret, Old Hungarian, and Warang Citi + blocks. (Byug#21654) + +2015-10-09 Martin Rudalics + + In adjust_frame_size don't count minibuffer height twice (Bug#21643) + + * src/frame.c (adjust_frame_size): In minibuffer-only windows + don't count minibuffer height twice. (Bug#21643) + +2015-10-09 Eli Zaretskii + + Avoid inflooping in font-lock + + * lisp/font-lock.el (font-lock-extend-region-wholelines): Bind + inhibit-field-text-motion around the call to + line-beginning-position, to avoid inflooping. (Bug#21615) + +2015-10-09 Tassilo Horn + + Refactor duplicated code; ensure default is in completions + + * lisp/textmodes/reftex-cite.el (reftex--query-search-regexps): New function. + (reftex-extract-bib-entries): Use it. + (reftex-extract-bib-entries-from-thebibliography): Use it. + +2015-10-09 Vincent Belaïche + + Typo in example + + * autotype.texi (Skeletons as Abbrevs): "if" -> "ifst" in the example. + +2015-10-08 Stefan Monnier + + * lisp/calc/calc.el: Silence byte-compiler warnings + + (calc-scan-for-dels): Use ignore-errors. + (calc-dispatch, calc-do-dispatch): Make unused arg optional. + (calc-read-key-sequence): Remove unused var `prompt2'. + (calc-kill-stack-buffer): Remove unused var `buflist'. + (calc): Remove unused var `oldbuf'. + (calc-refresh): Use inhibit-read-only. + (calc-can-abbrev-vectors): Declare. + (calc-record): Remove unused var `mainbuf'. + (math-sub-bignum): Remove unused var `sum'. + (math-svo-c, math-svo-wid, math-svo-off): Declare. + +2015-10-08 Daiki Ueno + + Use g_clear_error instead of g_error_free + + * src/image.c: Define g_clear_error instead of g_error_free. + (init_svg_functions): Resolve symbol g_clear_error instead of + g_error_free. + (svg_load_image): Use g_clear_error instead of g_error_free, to + suppress GLib warnings when ERR is not set. See bug#21641. + +2015-10-08 Paul Eggert + + * src/image.c (image_size_error): Simplify. + +2015-10-08 Paul Eggert + + Fix problems caught with --enable-gcc-warnings + + * src/image.c (lookup_rgb_color): + * src/xfns.c (x_defined_color): + * src/xterm.c (x_parse_color): + Remove unused locals. + +2015-10-08 Jay Belanger + + * lisp/calc/calc.el (calc-digit-start-entry): Fix typo. + +2015-10-08 Jay Belanger + + Format initial input uniformly. + + * lisp/calc/calc.el (calc-digit-start-entry): New function. + * lisp/calc/calc.el (calcDigit-start): + * lisp/calc/calc-aent.el (calc-alg-digit-entry): + Use `calc-digit-start-entry' to format input. + +2015-10-08 Ken Raeburn + + Disable non-working pointerColor setting for X tooltip frame. + + It generates a bunch of server traffic, but there's some bug wherein + the new mouse cursor settings don't seem to get used. In most + situations the cursor isn't likely to be seen anyway, so it's not + urgent to fix. + + * src/xfns.c (x_create_tip_frame): Don't set pointerColor. + +2015-10-08 Ken Raeburn + + Reduce some unnecessary X calls. + + * src/xfns.c (x_real_pos_and_offsets): Remove a redundant XGetGeometry + call. If border width is wanted, get it from the XGetGeometry call + instead of calling XGetWindowAttributes on the same window. Skip some + X calls if we've already detected an error from the X server. + * src/xterm.c (x_wm_supports): Delete x_sync before x_had_errors_p. + (handle_one_xevent): Delete XSync call before x_uncatch_errors. + +2015-10-08 Ken Raeburn + + Reduce color allocation/query traffic in the TrueColor case. + + When working with an X visual with TrueColor class, pixel values can + be generated from the RGB values according to mask value provided by + the server on connection. Some of the image-handling code was already + doing this. + + * src/xterm.h (x_make_truecolor_pixel): New function; code taken from + lookup_rgb_color. + (x_mutable_colormap): New function. + * src/image.c (lookup_rgb_color): Move pixel composition code to + x_make_truecolor_pixel. + (x_kill_gs_process): Call x_mutable_colormap. + * src/xfaces.c (x_free_colors, x_free_dpy_colors): Call + x_mutable_colormap. + * src/xftfont.c (xftfont_get_colors): Call x_query_colors. + * src/xterm.c (x_query_colors): For a TrueColor display, decompose the + pixel value into RGB values directly, and don't send a request to the + server. + (x_alloc_nearest_color): For a TrueColor display, construct the pixel + value with x_make_truecolor_pixel. + (x_copy_color): For an immutable color map, just return the provided + pixel value. + +2015-10-08 Ken Raeburn + + Cache XParseColor results in the X display info structure. + + With repeated lookups of foreground and background colors for multiple + faces per frame, we issue a lot of redundant color name lookups to the + X server, waiting every time for the response. On a remote network + with, say, 30ms round-trip time, this can add nearly a full second to + creation of a new frame. + + * src/gtkutil.c (xg_check_special_colors): Call x_parse_color. + * src/image.c (get_spec_bg_or_alpha_as_argb): + (xpm_init_color_cache, xpm_lookup_color): + * src/xfns.c (x_defined_color): + * src/xterm.c (x_parse_color): New function; caches color names not + starting with "#" in the display-info structure. + (x_delete_display): Delete the cache content. + * src/xterm.h (struct color_name_cache_entry): New type. + (x_parse_color): Declare. + (struct x_display_info): Add a new field for the cache. + +2015-10-07 Stefan Monnier + + * src/syntax.c (syms_of_syntax): Make syntax-propertize--done local + +2015-10-07 Eli Zaretskii + + Fix segfault in image_size_error + + * src/image.c (image_size_error): Pass a Lisp string to + image_error, not a C string. (Bug#21641) + +2015-10-07 Simen Heggestøyl + + Highlight CSS variable definitions + + * lisp/textmodes/css-mode.el (css-nmstart-re): Tweak regexp to accept + CSS variables. (Bug#21638) + +2015-10-07 Artur Malabarba + + * test/automated/tabulated-list-test.el: New file + + Test bug#21639 and some basic functionality. + +2015-10-07 Artur Malabarba + + * lisp/emacs-lisp/tabulated-list.el (tabulated-list-sort): + + Check if column can be sorted before trying. (Bug#21639) + +2015-10-07 Nicolas Richard + + Add test for `self-insert-command' (bug#21633) + + * test/automated/cmds-tests.el: New file. + +2015-10-07 Martin Rudalics + + In resize_frame_windows don't set a top position when resizing horizontally. + + * src/window.c (resize_frame_windows): Don't set root window's + top position when resizing horizontally. + +2015-10-07 Artur Malabarba + + * lisp/progmodes/prog-mode.el (prettify-symbols-alist): + + Document more possible values. + +2015-10-06 Stefan Monnier + + * lisp/textmodes/tex-mode.el: Use lexical-binding + +2015-10-06 Stefan Monnier + + * lisp/indent.el (indent--default-inside-comment): New function + + (indent-for-tab-command): Use it for `noindent' indentation. + +2015-10-06 Paul Eggert + + Fix bug in GC_CHECK_MARKED_OBJECTS check + + * src/alloc.c (mark_object): Fix bug in checking code. + When GC_CHECK_MARKED_OBJECTS is defined, the bug caused + CHECK_ALLOCATED_AND_LIVE_SYMBOL to repeatedly do the + CHECK_ALLOCATED and CHECK_LIVE tests for the first symbol in each + bucket. The bug did not affect behavior either in the normal case + where GC_CHECK_MARKED_OBJECTS is not defined, or where Emacs does + not have an internal error that a properly-written + CHECK_ALLOCATED_AND_LIVE_SYMBOL would detect. + +2015-10-06 Tassilo Horn + + Add prettified version of \\Bbb{Q}. + + * lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Add + prettified version for \\Bbb{Q}. + +2015-10-06 Artur Malabarba + + * test/automated/package-test.el (package-test-install-single): + + Add a test for bug#21625. + +2015-10-06 Aaron Ecay + + lisp/emacs-lisp/package.el (package-install): Fix name error + + * lisp/emacs-lisp/package.el (package-install): Fix error when pkg is + not a package-desc object. Also clarify documentation. (Bug#21625) + +2015-10-06 Eli Zaretskii + + Fix display of characters adjacent to ZWJ and ZWNJ + + * src/bidi.c (bidi_resolve_neutral): Treat all Bn (a.k.a. "control") + characters the same as directional formatting controls. + (bidi_level_of_next_char): Include all Bn characters in rule L1, + as mandated by the UBA. + +2015-10-06 Andreas Schwab + + Don't use XFASTINT on a negative number + + * src/cmds.c (Fself_insert_command): Don't use XFASTINT on a negative + number. (Bug#21633) + +2015-10-05 Xue Fuqiao + + * doc/lispref/objects.texi (Window Type): Add a cross reference. + + * src/buffer.c (syms_of_buffer): Typo fix. (Bug#21622) + +2015-10-05 Eli Zaretskii + + Fix composition-function-table for Arabic and Syriac + + * lisp/language/misc-lang.el (composition-function-table): Fix + entries for Arabic and Syriac. + +2015-10-05 Damien Cassou + + Add first unit tests for auth-source.el + + * test/automated/auth-source-tests.el: New file. + +2015-10-05 Eli Zaretskii + + Remove redundant redisplay code + + * src/xdisp.c (redisplay_internal, try_cursor_movement) + (try_window_reusing_current_matrix, try_window_id): Remove + redundant restrictions on redisplay optimizations based on the + frame's 'redisplay' flag. See + http://osdir.com/ml/general/2015-10/msg02110.html for the relevant + discussions. + +2015-10-04 Stefan Monnier + + * src/xdisp.c (windows_or_buffers_changed): Improve docstring + +2015-10-04 Xue Fuqiao + + Update tutorials/TUTORIAL.cn + + * etc/tutorials/TUTORIAL.cn: Improve translation. + +2015-10-04 YAMAMOTO Mitsuharu + + * src/macfont.m (macfont_encode_char, syms_of_macfont): Remove unused vars. + +2015-10-04 Stefan Merten + + Pull in version numbers from rst.el upstream release. + + * lisp/textmodes/rst.el (rst-cvs-header, rst-svn-rev) + (rst-svn-timestamp, rst-official-version) + (rst-official-cvs-rev, rst-package-emacs-version-alist): + Update version numbers. + +2015-10-04 Eli Zaretskii + + * test/automated/coding-tests.el: New file. + +2015-10-04 Michael Albinus + + Improve XEmacs compatibility of Tramp + + * lisp/net/tramp-compat.el (directory-listing-before-filename-regexp): + Declare if it doesn't exist. + (file-remote-p): Remove defalias, which was necessary for GNU Emacs 21. + (redisplay): Make it an alias if it doesn't exist. + + * lisp/net/tramp.el (tramp-get-remote-tmpdir): Don't use + `file-remote-p' (due to XEmacs compatibility). + + * lisp/net/trampver.el (locate-dominating-file) + (tramp-compat-replace-regexp-in-string): Autoload. + (tramp-repository-get-version): Do not dupe byte-compiler. + +2015-09-02 K. Handa + + fix for the case that M17N_FLT_USE_NEW_FEATURE is not defined + + * ftfont.c (ftfont_drive_otf) [not M17N_FLT_USE_NEW_FEATURE]: + Adjusted for the change of type of elements in the array + MFLTGlyphString.glyphs. + 2015-10-04 Eli Zaretskii Michael Heerdegen @@ -14528,7 +15086,7 @@ This file records repository revisions from commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to -commit 2021680e9dcd277a4ebbdb613d535e6edc86f384 (inclusive). +commit ce402dd77fe39c3a6d968e23d7a4a20f2b04ccf0 (inclusive). See ChangeLog.1 for earlier changes. ;; Local Variables: commit ce402dd77fe39c3a6d968e23d7a4a20f2b04ccf0 Author: Ken Raeburn Date: Sat Oct 10 03:26:42 2015 -0400 Handle an opaque-move X11 window manager operation more efficiently. * src/xterm.c (handle_one_xevent): If a ConfigureNotify event is followed by more ConfigureNotify events for the same window, process only the last one. diff --git a/src/xterm.c b/src/xterm.c index 7ff6b17..dd57a54 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7480,6 +7480,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, says that a portable program can't use this, but Stephen Gildea assures me that letting the compiler initialize it to zeros will work okay. */ static XComposeStatus compose_status; + XEvent configureEvent; + XEvent next_event; USE_SAFE_ALLOCA; @@ -8389,17 +8391,41 @@ handle_one_xevent (struct x_display_info *dpyinfo, } case ConfigureNotify: - f = x_top_window_to_frame (dpyinfo, event->xconfigure.window); + /* An opaque move can generate a stream of events as the window + is dragged around. If the connection round trip time isn't + really short, they may come faster than we can respond to + them, given the multiple queries we can do to check window + manager state, translate coordinates, etc. + + So if this ConfigureNotify is immediately followed by another + for the same window, use the info from the latest update, and + consider the events all handled. */ + /* Opaque resize may be trickier; ConfigureNotify events are + mixed with Expose events for multiple windows. */ + configureEvent = *event; + while (XPending (dpyinfo->display)) + { + XNextEvent (dpyinfo->display, &next_event); + if (next_event.type != ConfigureNotify + || next_event.xconfigure.window != event->xconfigure.window) + { + XPutBackEvent (dpyinfo->display, &next_event); + break; + } + else + configureEvent = next_event; + } + f = x_top_window_to_frame (dpyinfo, configureEvent.xconfigure.window); #ifdef USE_CAIRO if (f) x_cr_destroy_surface (f); #endif #ifdef USE_GTK if (!f && (f = any) - && event->xconfigure.window == FRAME_X_WINDOW (f)) + && configureEvent.xconfigure.window == FRAME_X_WINDOW (f)) { - xg_frame_resized (f, event->xconfigure.width, - event->xconfigure.height); + xg_frame_resized (f, configureEvent.xconfigure.width, + configureEvent.xconfigure.height); #ifdef USE_CAIRO x_cr_destroy_surface (f); #endif @@ -8408,24 +8434,26 @@ handle_one_xevent (struct x_display_info *dpyinfo, #endif if (f) { - x_net_wm_state (f, event->xconfigure.window); + x_net_wm_state (f, configureEvent.xconfigure.window); #ifdef USE_X_TOOLKIT /* Tip frames are pure X window, set size for them. */ if (! NILP (tip_frame) && XFRAME (tip_frame) == f) { - if (FRAME_PIXEL_HEIGHT (f) != event->xconfigure.height - || FRAME_PIXEL_WIDTH (f) != event->xconfigure.width) + if (FRAME_PIXEL_HEIGHT (f) != configureEvent.xconfigure.height + || FRAME_PIXEL_WIDTH (f) != configureEvent.xconfigure.width) SET_FRAME_GARBAGED (f); - FRAME_PIXEL_HEIGHT (f) = event->xconfigure.height; - FRAME_PIXEL_WIDTH (f) = event->xconfigure.width; + FRAME_PIXEL_HEIGHT (f) = configureEvent.xconfigure.height; + FRAME_PIXEL_WIDTH (f) = configureEvent.xconfigure.width; } #endif #ifndef USE_X_TOOLKIT #ifndef USE_GTK - int width = FRAME_PIXEL_TO_TEXT_WIDTH (f, event->xconfigure.width); - int height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, event->xconfigure.height); + int width = + FRAME_PIXEL_TO_TEXT_WIDTH (f, configureEvent.xconfigure.width); + int height = + FRAME_PIXEL_TO_TEXT_HEIGHT (f, configureEvent.xconfigure.height); /* In the toolkit version, change_frame_size is called by the code that handles resizing @@ -8436,8 +8464,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, to check the pixel dimensions as well. */ if (width != FRAME_TEXT_WIDTH (f) || height != FRAME_TEXT_HEIGHT (f) - || event->xconfigure.width != FRAME_PIXEL_WIDTH (f) - || event->xconfigure.height != FRAME_PIXEL_HEIGHT (f)) + || configureEvent.xconfigure.width != FRAME_PIXEL_WIDTH (f) + || configureEvent.xconfigure.height != FRAME_PIXEL_HEIGHT (f)) { change_frame_size (f, width, height, false, true, false, true); x_clear_under_internal_border (f); commit ec2d99026ff2f928b0669da2c2cf909b62aeb6c1 Author: Ken Raeburn Date: Thu Oct 8 04:13:06 2015 -0400 Fix cursor setting for tip frame; re-enable cursor generation. * src/xfns.c (x_create_tip_frame): Include the cursor in the window attributes sent when creating the new X window. Don't skip setting the pointerColor parameter. diff --git a/src/xfns.c b/src/xfns.c index 468a856..fefd8e8 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5319,12 +5319,8 @@ x_create_tip_frame (struct x_display_info *dpyinfo, "foreground", "Foreground", RES_TYPE_STRING); x_default_parameter (f, parms, Qbackground_color, build_string ("white"), "background", "Background", RES_TYPE_STRING); -#if 0 /* This code currently doesn't work for tooltip frames; the - cursor being set doesn't seem to get used. The call generates - a bit of traffic, so skip it for now. */ x_default_parameter (f, parms, Qmouse_color, build_string ("black"), "pointerColor", "Foreground", RES_TYPE_STRING); -#endif x_default_parameter (f, parms, Qcursor_color, build_string ("black"), "cursorColor", "Foreground", RES_TYPE_STRING); x_default_parameter (f, parms, Qborder_color, build_string ("black"), @@ -5345,7 +5341,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Atom type = FRAME_DISPLAY_INFO (f)->Xatom_net_window_type_tooltip; block_input (); - mask = CWBackPixel | CWOverrideRedirect | CWEventMask; + mask = CWBackPixel | CWOverrideRedirect | CWEventMask | CWCursor; if (DoesSaveUnders (dpyinfo->screen)) mask |= CWSaveUnder; @@ -5355,6 +5351,9 @@ x_create_tip_frame (struct x_display_info *dpyinfo, attrs.override_redirect = True; attrs.save_under = True; attrs.background_pixel = FRAME_BACKGROUND_PIXEL (f); + attrs.cursor = + f->output_data.x->current_cursor + = f->output_data.x->text_cursor; /* Arrange for getting MapNotify and UnmapNotify events. */ attrs.event_mask = StructureNotifyMask; tip_window commit 08e27d294468aa72cb06a50821dbade8ea03b2ce Author: Ken Raeburn Date: Fri Oct 2 23:36:31 2015 -0400 Rewrite x_set_mouse_color to sync less. We can track serial numbers of X requests and correlate error events with the associated requests. This way we can identify errors for specific calls without having to use XSync after every one. * src/xfns.c (enum mouse_cursor): New type. (struct mouse_cursor_types, struct mouse_cursor_data): New types. (mouse_cursor_types): New array listing the Lisp variables and default cursor appearances for each cursor type. (x_set_mouse_color_handler): New function; checks error event serial number against submitted requests. (x_set_mouse_color): Updated to use the new error handler callback, and to be more table-driven, to simplify repetitious code. diff --git a/src/xfns.c b/src/xfns.c index 898359c..468a856 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -665,15 +665,95 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) } } +/* This array must stay in sync with the mouse_cursor_types array below! */ +enum mouse_cursor { + mouse_cursor_text, + mouse_cursor_nontext, + mouse_cursor_hourglass, + mouse_cursor_mode, + mouse_cursor_hand, + mouse_cursor_horizontal_drag, + mouse_cursor_vertical_drag, + mouse_cursor_max +}; + +struct mouse_cursor_types { + /* Printable name for error messages (optional). */ + const char *name; + + /* Lisp variable controlling the cursor shape. */ + /* FIXME: A couple of these variables are defined in the C code but + are not actually accessible from Lisp. They should probably be + made accessible or removed. */ + Lisp_Object *shape_var_ptr; + + /* The default shape. */ + int default_shape; +}; + +/* This array must stay in sync with enum mouse_cursor above! */ +static const struct mouse_cursor_types mouse_cursor_types[] = { + { "text", &Vx_pointer_shape, XC_xterm }, + { "nontext", &Vx_nontext_pointer_shape, XC_left_ptr }, + { "hourglass", &Vx_hourglass_pointer_shape, XC_watch }, + { "modeline", &Vx_mode_pointer_shape, XC_xterm }, + { NULL, &Vx_sensitive_text_pointer_shape, XC_hand2 }, + { NULL, &Vx_window_horizontal_drag_shape, XC_sb_h_double_arrow }, + { NULL, &Vx_window_vertical_drag_shape, XC_sb_v_double_arrow }, +}; + +struct mouse_cursor_data { + /* Last index for which XCreateFontCursor has been called, and thus + the last index for which x_request_serial[] is valid. */ + int last_cursor_create_request; + + /* Last index for which an X error event was received in response to + attempting to create the cursor. */ + int error_cursor; + + /* Cursor numbers chosen. */ + unsigned int cursor_num[mouse_cursor_max]; + + /* Allocated Cursor values, or zero for failed attempts. */ + Cursor cursor[mouse_cursor_max]; + + /* X serial numbers for the first request sent by XCreateFontCursor. + Note that there may be more than one request sent. */ + unsigned long x_request_serial[mouse_cursor_max]; + + /* If an error has been received, a pointer to where the current + error-message text is stored. */ + char *error_string; +}; + +static void +x_set_mouse_color_handler (Display *dpy, XErrorEvent *event, + char *error_string, void *data) +{ + struct mouse_cursor_data *cursor_data = data; + int i; + + cursor_data->error_cursor = -1; + cursor_data->error_string = error_string; + for (i = 0; i < cursor_data->last_cursor_create_request; i++) + { + if (event->serial >= cursor_data->x_request_serial[i]) + cursor_data->error_cursor = i; + } + if (cursor_data->error_cursor >= 0) + /* If we failed to allocate it, don't try to free it. */ + cursor_data->cursor[cursor_data->error_cursor] = 0; +} + static void x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { struct x_output *x = f->output_data.x; Display *dpy = FRAME_X_DISPLAY (f); - Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; - Cursor hourglass_cursor, horizontal_drag_cursor, vertical_drag_cursor; + struct mouse_cursor_data cursor_data = { -1, -1 }; unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f); + int i; /* Don't let pointers be invisible. */ if (mask_color == pixel) @@ -685,137 +765,93 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) unload_color (f, x->mouse_pixel); x->mouse_pixel = pixel; - block_input (); - - /* It's not okay to crash if the user selects a screwy cursor. */ - x_catch_errors (dpy); - - if (!NILP (Vx_pointer_shape)) + for (i = 0; i < mouse_cursor_max; i++) { - CHECK_NUMBER (Vx_pointer_shape); - cursor = XCreateFontCursor (dpy, XINT (Vx_pointer_shape)); + Lisp_Object shape_var = *mouse_cursor_types[i].shape_var_ptr; + if (!NILP (shape_var)) + { + CHECK_TYPE_RANGED_INTEGER (unsigned, shape_var); + cursor_data.cursor_num[i] = XINT (shape_var); + } + else + cursor_data.cursor_num[i] = mouse_cursor_types[i].default_shape; } - else - cursor = XCreateFontCursor (dpy, XC_xterm); - x_check_errors (dpy, "bad text pointer cursor: %s"); - if (!NILP (Vx_nontext_pointer_shape)) - { - CHECK_NUMBER (Vx_nontext_pointer_shape); - nontext_cursor - = XCreateFontCursor (dpy, XINT (Vx_nontext_pointer_shape)); - } - else - nontext_cursor = XCreateFontCursor (dpy, XC_left_ptr); - x_check_errors (dpy, "bad nontext pointer cursor: %s"); + block_input (); - if (!NILP (Vx_hourglass_pointer_shape)) - { - CHECK_NUMBER (Vx_hourglass_pointer_shape); - hourglass_cursor - = XCreateFontCursor (dpy, XINT (Vx_hourglass_pointer_shape)); - } - else - hourglass_cursor = XCreateFontCursor (dpy, XC_watch); - x_check_errors (dpy, "bad hourglass pointer cursor: %s"); + /* It's not okay to crash if the user selects a screwy cursor. */ + x_catch_errors_with_handler (dpy, x_set_mouse_color_handler, &cursor_data); - if (!NILP (Vx_mode_pointer_shape)) + for (i = 0; i < mouse_cursor_max; i++) { - CHECK_NUMBER (Vx_mode_pointer_shape); - mode_cursor = XCreateFontCursor (dpy, XINT (Vx_mode_pointer_shape)); + cursor_data.x_request_serial[i] = XNextRequest (dpy); + cursor_data.last_cursor_create_request = i; + cursor_data.cursor[i] = XCreateFontCursor (dpy, + cursor_data.cursor_num[i]); } - else - mode_cursor = XCreateFontCursor (dpy, XC_xterm); - x_check_errors (dpy, "bad modeline pointer cursor: %s"); - if (!NILP (Vx_sensitive_text_pointer_shape)) + /* Now sync up and process all received errors from cursor + creation. */ + if (x_had_errors_p (dpy)) { - CHECK_NUMBER (Vx_sensitive_text_pointer_shape); - hand_cursor - = XCreateFontCursor (dpy, XINT (Vx_sensitive_text_pointer_shape)); - } - else - hand_cursor = XCreateFontCursor (dpy, XC_hand2); + const char *bad_cursor_name = NULL; + /* Bounded by X_ERROR_MESSAGE_SIZE in xterm.c. */ + size_t message_length = strlen (cursor_data.error_string); + char *xmessage = alloca (1 + message_length); + memcpy (xmessage, cursor_data.error_string, message_length); - if (!NILP (Vx_window_horizontal_drag_shape)) - { - CHECK_TYPE_RANGED_INTEGER (unsigned, Vx_window_horizontal_drag_shape); - horizontal_drag_cursor - = XCreateFontCursor (dpy, XINT (Vx_window_horizontal_drag_shape)); - } - else - horizontal_drag_cursor - = XCreateFontCursor (dpy, XC_sb_h_double_arrow); + x_uncatch_errors (); - if (!NILP (Vx_window_vertical_drag_shape)) - { - CHECK_NUMBER (Vx_window_vertical_drag_shape); - vertical_drag_cursor - = XCreateFontCursor (dpy, XINT (Vx_window_vertical_drag_shape)); + /* Free any successfully created cursors. */ + for (i = 0; i < mouse_cursor_max; i++) + if (cursor_data.cursor[i] != 0) + XFreeCursor (dpy, cursor_data.cursor[i]); + + /* This should only be able to fail if the server's serial + number tracking is broken. */ + if (cursor_data.error_cursor >= 0) + bad_cursor_name = mouse_cursor_types[cursor_data.error_cursor].name; + if (bad_cursor_name) + error ("bad %s pointer cursor: %s", bad_cursor_name, xmessage); + else + error ("can't set cursor shape: %s", xmessage); } - else - vertical_drag_cursor - = XCreateFontCursor (dpy, XC_sb_v_double_arrow); - /* Check and report errors with the above calls. */ - x_check_errors (dpy, "can't set cursor shape: %s"); x_uncatch_errors_after_check (); { - XColor fore_color, back_color; - - fore_color.pixel = x->mouse_pixel; - x_query_color (f, &fore_color); - back_color.pixel = mask_color; - x_query_color (f, &back_color); - - XRecolorCursor (dpy, cursor, &fore_color, &back_color); - XRecolorCursor (dpy, nontext_cursor, &fore_color, &back_color); - XRecolorCursor (dpy, mode_cursor, &fore_color, &back_color); - XRecolorCursor (dpy, hand_cursor, &fore_color, &back_color); - XRecolorCursor (dpy, hourglass_cursor, &fore_color, &back_color); - XRecolorCursor (dpy, horizontal_drag_cursor, &fore_color, &back_color); - XRecolorCursor (dpy, vertical_drag_cursor, &fore_color, &back_color); + XColor colors[2]; /* 0=foreground, 1=background */ + + colors[0].pixel = x->mouse_pixel; + colors[1].pixel = mask_color; + x_query_colors (f, colors, 2); + + for (i = 0; i < mouse_cursor_max; i++) + XRecolorCursor (dpy, cursor_data.cursor[i], &colors[0], &colors[1]); } if (FRAME_X_WINDOW (f) != 0) - XDefineCursor (dpy, FRAME_X_WINDOW (f), - f->output_data.x->current_cursor = cursor); - - if (cursor != x->text_cursor - && x->text_cursor != 0) - XFreeCursor (dpy, x->text_cursor); - x->text_cursor = cursor; - - if (nontext_cursor != x->nontext_cursor - && x->nontext_cursor != 0) - XFreeCursor (dpy, x->nontext_cursor); - x->nontext_cursor = nontext_cursor; - - if (hourglass_cursor != x->hourglass_cursor - && x->hourglass_cursor != 0) - XFreeCursor (dpy, x->hourglass_cursor); - x->hourglass_cursor = hourglass_cursor; - - if (mode_cursor != x->modeline_cursor - && x->modeline_cursor != 0) - XFreeCursor (dpy, f->output_data.x->modeline_cursor); - x->modeline_cursor = mode_cursor; - - if (hand_cursor != x->hand_cursor - && x->hand_cursor != 0) - XFreeCursor (dpy, x->hand_cursor); - x->hand_cursor = hand_cursor; - - if (horizontal_drag_cursor != x->horizontal_drag_cursor - && x->horizontal_drag_cursor != 0) - XFreeCursor (dpy, x->horizontal_drag_cursor); - x->horizontal_drag_cursor = horizontal_drag_cursor; - - if (vertical_drag_cursor != x->vertical_drag_cursor - && x->vertical_drag_cursor != 0) - XFreeCursor (dpy, x->vertical_drag_cursor); - x->vertical_drag_cursor = vertical_drag_cursor; + { + f->output_data.x->current_cursor = cursor_data.cursor[mouse_cursor_text]; + XDefineCursor (dpy, FRAME_X_WINDOW (f), + f->output_data.x->current_cursor); + } + +#define INSTALL_CURSOR(FIELD, SHORT_INDEX) \ + eassert (x->FIELD != cursor_data.cursor[mouse_cursor_ ## SHORT_INDEX]); \ + if (x->FIELD != 0) \ + XFreeCursor (dpy, x->FIELD); \ + x->FIELD = cursor_data.cursor[mouse_cursor_ ## SHORT_INDEX]; + + INSTALL_CURSOR (text_cursor, text); + INSTALL_CURSOR (nontext_cursor, nontext); + INSTALL_CURSOR (hourglass_cursor, hourglass); + INSTALL_CURSOR (modeline_cursor, mode); + INSTALL_CURSOR (hand_cursor, hand); + INSTALL_CURSOR (horizontal_drag_cursor, horizontal_drag); + INSTALL_CURSOR (vertical_drag_cursor, vertical_drag); + +#undef INSTALL_CURSOR XFlush (dpy); unblock_input (); commit fcb5d3e8b158f7ea8492aa14f79804fae18e76f9 Author: Ken Raeburn Date: Fri Oct 2 05:00:23 2015 -0400 Add x_catch_errors_with_handler. * src/xterm.c (struct x_error_message_stack): Add new fields for a callback function and associated data pointer. (x_error_catcher): If the callback function is set, call it after saving the error message string. (x_catch_errors_with_handler): Renamed from x_catch_errors but now accepts a callback function and data pointer. (x_catch_errors): Now a wrapper function. * src/xterm.h (x_special_error_handler): New typedef. (x_catch_errors_with_handler): Declare. diff --git a/src/xterm.c b/src/xterm.c index 6e870c5..7ff6b17 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9190,6 +9190,8 @@ x_text_icon (struct frame *f, const char *icon_name) struct x_error_message_stack { char string[X_ERROR_MESSAGE_SIZE]; Display *dpy; + x_special_error_handler handler; + void *handler_data; struct x_error_message_stack *prev; }; static struct x_error_message_stack *x_error_message; @@ -9204,6 +9206,9 @@ x_error_catcher (Display *display, XErrorEvent *event) XGetErrorText (display, event->error_code, x_error_message->string, X_ERROR_MESSAGE_SIZE); + if (x_error_message->handler) + x_error_message->handler (display, event, x_error_message->string, + x_error_message->handler_data); } /* Begin trapping X errors for display DPY. Actually we trap X errors @@ -9223,7 +9228,8 @@ x_error_catcher (Display *display, XErrorEvent *event) x_had_errors_p or x_check_errors. */ void -x_catch_errors (Display *dpy) +x_catch_errors_with_handler (Display *dpy, x_special_error_handler handler, + void *handler_data) { struct x_error_message_stack *data = xmalloc (sizeof *data); @@ -9232,10 +9238,18 @@ x_catch_errors (Display *dpy) data->dpy = dpy; data->string[0] = 0; + data->handler = handler; + data->handler_data = handler_data; data->prev = x_error_message; x_error_message = data; } +void +x_catch_errors (Display *dpy) +{ + x_catch_errors_with_handler (dpy, NULL, NULL); +} + /* Undo the last x_catch_errors call. DPY should be the display that was passed to x_catch_errors. diff --git a/src/xterm.h b/src/xterm.h index fe3455f..f7d2803 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1024,8 +1024,13 @@ XrmDatabase x_load_resources (Display *, const char *, const char *, /* Defined in xterm.c */ +typedef void (*x_special_error_handler)(Display *, XErrorEvent *, char *, + void *); + extern bool x_text_icon (struct frame *, const char *); extern void x_catch_errors (Display *); +extern void x_catch_errors_with_handler (Display *, x_special_error_handler, + void *); extern void x_check_errors (Display *, const char *) ATTRIBUTE_FORMAT_PRINTF (2, 0); extern bool x_had_errors_p (Display *); commit 5504ede9518053e619b2cc4bb01ce6eff254d3c8 Author: Ken Raeburn Date: Wed Oct 7 06:04:01 2015 -0400 Introduce x_uncatch_errors_after_check to reduce XSync calls. Both x_had_errors_p and x_check_errors call XSync, so if they're immediately followed by x_uncatch_errors, its XSync call will be redundant, resulting in a wasted round trip to the X server. * src/xterm.c (x_uncatch_errors_after_check): New routine; a copy of x_uncatch_errors without the XSync call. (XTmouse_position, x_wm_supports): * src/xfns.c (x_set_mouse_color): * src/xmenu.c (Fx_menu_bar_open_internal): * src/xselect.c (x_own_selection, x_get_foreign_selection): (Fx_get_atom_name): Call it instead of x_uncatch_errors. * src/xterm.h (x_uncatch_errors_after_check): Declare. diff --git a/src/xfns.c b/src/xfns.c index f78e541..898359c 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -759,7 +759,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) /* Check and report errors with the above calls. */ x_check_errors (dpy, "can't set cursor shape: %s"); - x_uncatch_errors (); + x_uncatch_errors_after_check (); { XColor fore_color, back_color; diff --git a/src/xmenu.c b/src/xmenu.c index f183c70..192ed89 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -325,7 +325,7 @@ If FRAME is nil or not given, use the selected frame. */) /* Child of win. */ &child); error_p = x_had_errors_p (FRAME_X_DISPLAY (f)); - x_uncatch_errors (); + x_uncatch_errors_after_check (); if (! error_p) { diff --git a/src/xselect.c b/src/xselect.c index 9aaa10c..9a7e697 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -316,7 +316,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, x_catch_errors (display); XSetSelectionOwner (display, selection_atom, selecting_window, timestamp); x_check_errors (display, "Can't set selection: %s"); - x_uncatch_errors (); + x_uncatch_errors_after_check (); unblock_input (); /* Now update the local cache */ @@ -1179,7 +1179,7 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type, XConvertSelection (display, selection_atom, type_atom, target_property, requestor_window, requestor_time); x_check_errors (display, "Can't convert selection: %s"); - x_uncatch_errors (); + x_uncatch_errors_after_check (); /* Prepare to block until the reply has been read. */ reading_selection_window = requestor_window; @@ -2364,7 +2364,7 @@ If the value is 0 or the atom is not known, return the empty string. */) x_catch_errors (dpy); name = atom ? XGetAtomName (dpy, atom) : empty; had_errors_p = x_had_errors_p (dpy); - x_uncatch_errors (); + x_uncatch_errors_after_check (); if (!had_errors_p) ret = build_string (name); diff --git a/src/xterm.c b/src/xterm.c index cd6cdb0..6e870c5 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4992,7 +4992,7 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, if (x_had_errors_p (FRAME_X_DISPLAY (*fp))) f1 = 0; - x_uncatch_errors (); + x_uncatch_errors_after_check (); /* If not, is it one of our scroll bars? */ if (! f1) @@ -9217,7 +9217,10 @@ x_error_catcher (Display *display, XErrorEvent *event) Calling x_check_errors signals an Emacs error if an X error has occurred since the last call to x_catch_errors or x_check_errors. - Calling x_uncatch_errors resumes the normal error handling. */ + Calling x_uncatch_errors resumes the normal error handling. + Calling x_uncatch_errors_after_check is similar, but skips an XSync + to the server, and should be used only immediately after + x_had_errors_p or x_check_errors. */ void x_catch_errors (Display *dpy) @@ -9234,6 +9237,25 @@ x_catch_errors (Display *dpy) } /* Undo the last x_catch_errors call. + DPY should be the display that was passed to x_catch_errors. + + This version should be used only if the immediately preceding + X-protocol-related thing was x_check_errors or x_had_error_p, both + of which issue XSync calls, so we don't need to re-sync here. */ + +void +x_uncatch_errors_after_check (void) +{ + struct x_error_message_stack *tmp; + + block_input (); + tmp = x_error_message; + x_error_message = x_error_message->prev; + xfree (tmp); + unblock_input (); +} + +/* Undo the last x_catch_errors call. DPY should be the display that was passed to x_catch_errors. */ void @@ -9928,7 +9950,7 @@ x_wm_supports (struct frame *f, Atom want_atom) XSelectInput (dpy, wmcheck_window, StructureNotifyMask); if (x_had_errors_p (dpy)) { - x_uncatch_errors (); + x_uncatch_errors_after_check (); unblock_input (); return false; } diff --git a/src/xterm.h b/src/xterm.h index d8edbc2..fe3455f 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1030,6 +1030,7 @@ extern void x_check_errors (Display *, const char *) ATTRIBUTE_FORMAT_PRINTF (2, 0); extern bool x_had_errors_p (Display *); extern void x_uncatch_errors (void); +extern void x_uncatch_errors_after_check (void); extern void x_clear_errors (Display *); extern void xembed_request_focus (struct frame *); extern void x_ewmh_activate_frame (struct frame *); commit 54e3734a322aca9d396e4c7b0e73f08ac6c12501 Author: Jay Belanger Date: Sat Oct 10 22:08:33 2015 -0500 Document the optional prefix to `calc-yank'. * doc/misc/calc.texi (Yanking into the Stack): Document the optional prefix to `calc-yank'. * lisp/calc/calc-yank.el (calc-yank): Ensure that things killed from the Calc buffer are yanked back unchanged. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index ecf2ef9..8579d0f 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -29903,6 +29903,19 @@ number in its displayed form, 3.142. (Since the default display modes show all objects to their full precision, this feature normally makes no difference.) +The @kbd{C-y} command can be given a prefix, which will interpret the +text being yanked with a different radix. If the text being yanked can be +interpreted as a binary, octal, hexadecimal, or decimal number, then a +prefix of @kbd{2}, @kbd{8}, @kbd{6} or @kbd{0} will have Calc +interpret the yanked text as a number in the appropriate base. For example, +if @samp{111} has just been killed and is yanked into Calc with a command +of @kbd{C-2 C-y}, then the number @samp{7} will be put on the stack. +If you use the plain prefix @kbd{C-u}, then you will be prompted for a +base to use, which can be any integer from 2 to 36. If Calc doesn't +allow the text being yanked to be read in a different base (such as if +the text is an algebraic expression), then the prefix will have no +effect. + @node Saving Into Registers, Inserting From Registers, Yanking Into Stack, Kill and Yank @section Saving into Registers diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index c93b64b..cd44750 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -195,7 +195,7 @@ alteration." (concat radix-notation "\\&") thing-raw)) thing-raw))))) - (if (eq (car-safe calc-last-kill) thing) + (if (eq (car-safe calc-last-kill) thing-raw) (cdr calc-last-kill) (if (stringp thing) (let ((val (math-read-exprs (calc-clean-newlines thing)))) commit 4cbd0713000c5f0a184e16df3556e8408ea3b894 Author: Mark Oteiza Date: Sat Oct 10 22:23:59 2015 -0400 * lisp/calendar/calendar.el: Display buffer before executing body. In each use of this macro, the modeline is derived from a window width calculation, which will be wrong if (display-buffer) splits the window horizontally. diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index f188b68..6c1b4c2 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1107,11 +1107,11 @@ with disabled undo. Leaves point at point-min, displays BUFFER." (setq buffer-read-only nil buffer-undo-list t) (erase-buffer) + (display-buffer ,buffer) ,@body (goto-char (point-min)) (set-buffer-modified-p nil) - (setq buffer-read-only t) - (display-buffer ,buffer))) + (setq buffer-read-only t))) ;; The following are in-line for speed; they can be called thousands of times ;; when looking up holidays or processing the diary. Here, for example, are commit 29dfca23553b9995a8ec3b50090a652a6a0ecb01 Author: Paul Eggert Date: Sat Oct 10 18:03:49 2015 -0700 Use ‘echo’ safely with ‘\’ or leading ‘-’ POSIX says that ‘echo FOO’ produces implementation-defined output if FOO contains leading ‘-’, or ‘\’ anywhere, so don’t assume GNU behavior in that case. * Makefile.in (removenullpaths): Remove. (epaths-force): Rewrite to avoid the need for ‘echo’. (install-etc): Be clearer about escaping the shell metacharacters ‘\’ and ‘$’. * Makefile.in (install-arch-indep, install-etcdoc): * admin/charsets/mapconv, admin/merge-gnulib, admin/merge-pkg-config: * admin/quick-install-emacs, build-aux/gitlog-to-emacslog: * configure.ac, lib-src/rcs2log, make-dist: * src/Makefile.in (lisp.mk): Don’t assume ‘echo’ outputs ‘\’ and leading ‘-’ unscathed. For example, use ‘printf '%s\n' "$foo"’ rather than ‘echo "$foo"’ if $foo can contain arbitrary characters. * lisp/Makefile.in (TAGS): Use ‘ls’, not ‘echo’, to avoid ‘\’ issues. * doc/lispref/two-volume.make (vol1.pdf): * test/etags/make-src/Makefile (web ftp publish): Use ‘printf’ rather than ‘echo -e’. diff --git a/Makefile.in b/Makefile.in index 4ee84f9..1245f76 100644 --- a/Makefile.in +++ b/Makefile.in @@ -314,8 +314,6 @@ etc-emacsver: ${srcdir}/build-aux/move-if-change emacsver.tex.$$$$ \ ${srcdir}/etc/refcards/emacsver.tex -removenullpaths=sed -e 's/^:*//' -e 's/:*$$//g' -e 's/::*/:/g' - # Generate epaths.h from epaths.in. This target is invoked by 'configure'. # See comments in configure.ac for why it is done this way, as opposed # to just letting configure generate epaths.h from epaths.in in a @@ -324,20 +322,18 @@ epaths-force: @for dir in '$(abs_srcdir)' '$(lispdir)' '$(archlibdir)'; do \ case $$dir in \ *:*) \ - echo >&2 "Build or installation directory '$$dir'"; \ + printf >&2 "Build or installation directory '%s'\\n" "$$dir"; \ echo >&2 "cannot contain ':'."; \ exit 1;; \ esac; \ done - @(standardlisppath=`echo "${standardlisppath}" | ${removenullpaths}` ; \ - locallisppath=`echo "${locallisppath}" | ${removenullpaths}` ; \ - buildlisppath=`echo "${buildlisppath}" | ${removenullpaths}` ; \ - x_default_search_path=`echo ${x_default_search_path}`; \ - gamedir=`echo ${gamedir}`; \ + @(gamedir='${gamedir}'; \ sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \ - -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'"$${standardlisppath}"'";' \ - -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${locallisppath}"'";' \ - -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'"$${buildlisppath}"'";' \ + -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "${standardlisppath}";' \ + -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "${locallisppath}";' \ + -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "${buildlisppath}";' \ + -e '/^#define PATH_[^ ]*SEARCH /s/\([":]\):*/\1/g' \ + -e '/^#define PATH_[^ ]*SEARCH /s/:"/"/' \ -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \ -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \ -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \ @@ -577,7 +573,7 @@ install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} fi; \ rm -rf "$${dest}" ; \ umask 022; ${MKDIR_P} "$${dest}" ; \ - echo "Copying $${dir} to $${dest}..." ; \ + printf 'Copying %s to %s...\n' "$$dir" "$$dest" ; \ (cd $${dir}; tar -chf - . ) \ | (cd "$${dest}"; umask 022; \ tar -xvf - && cat > /dev/null) || exit 1; \ @@ -632,7 +628,8 @@ install-etcdoc: src install-arch-indep if [ "`cd ./etc; /bin/pwd`" != "$$exp_etcdocdir" ]; \ then \ docfile="DOC"; \ - echo "Copying etc/$${docfile} to $(DESTDIR)${etcdocdir} ..." ; \ + printf 'Copying %s to %s ...\n' "etc/$$docfile" \ + "$(DESTDIR)${etcdocdir}"; \ ${INSTALL_DATA} etc/$${docfile} "$(DESTDIR)${etcdocdir}/$${docfile}"; \ $(set_installuser); \ chown $${installuser} "$(DESTDIR)${etcdocdir}/$${docfile}" || true ; \ @@ -721,7 +718,7 @@ install-etc: for icon in $${dir}/${EMACS_ICON}[.-]*; do \ [ -r $${icon} ] || continue ; \ ext=`echo "$${icon}" | sed -e 's|.*\.||'`; \ - dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\.$${ext}$$||" -e 's/$(EMACS_ICON)/emacs/' -e '$(TRANSFORM)'`.$${ext} ; \ + dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\\.$${ext}\$$||" -e 's/$(EMACS_ICON)/emacs/' -e '$(TRANSFORM)'`.$${ext} ; \ ( cd "$${thisdir}"; \ ${INSTALL_DATA} ${iconsrcdir}/$${icon} "$(DESTDIR)${icondir}/$${dir}/$${dest}" ) \ || exit 1; \ diff --git a/admin/charsets/mapconv b/admin/charsets/mapconv index 32ba642..3747ae2 100755 --- a/admin/charsets/mapconv +++ b/admin/charsets/mapconv @@ -64,7 +64,7 @@ case "$3" in KANJI-DATABASE) SOURCE="http://kanji-database.cvs.sourceforge.net/viewvc/*checkout*/kanji-database/kanji-database/data/cns2ucsdkw.txt?revision=1.4";; *) - echo "Unknown file type: $3"; + printf 'Unknown file type: %s\n' "$3" exit 1;; esac @@ -147,7 +147,6 @@ elif [ "$3" = "KANJI-DATABASE" ] ; then | sed -e 's/...\(....\) U+\([0-9A-F]*\).*/0x\1 0x\2/' \ | sort | ${AWKPROG} else - echo "Invalid arguments: $3" + printf 'Invalid arguments: %s\n' "$3" exit 1 fi - diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 963c3a0..818dc1a 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -71,7 +71,7 @@ case $gnulib_srcdir in esac case $src in -*) - echo >&2 "$0: usage: $0 [GNULIB_SRCDIR [SRCDIR]] + printf '%s\n' >&2 "$0: usage: $0 [GNULIB_SRCDIR [SRCDIR]] SRCDIR is the Emacs source directory (default: working directory). GNULIB_SRCDIR is the Gnulib source directory (default: SRCDIR/../gnulib)." @@ -79,7 +79,7 @@ case $src in esac test -x "$src"autogen.sh || { - echo >&2 "$0: '${src:-.}' is not an Emacs source directory." + printf '%s\n' >&2 "$0: '${src:-.}' is not an Emacs source directory." exit 1 } @@ -88,7 +88,7 @@ git clone -- "$GNULIB_URL" "$gnulib_srcdir" || exit test -x "$gnulib_srcdir"/gnulib-tool || { - echo >&2 "$0: '$gnulib_srcdir' is not a Gnulib source directory." + printf '%s\n' >&2 "$0: '$gnulib_srcdir' is not a Gnulib source directory." exit 1 } diff --git a/admin/merge-pkg-config b/admin/merge-pkg-config index 2ee633d..3029372 100755 --- a/admin/merge-pkg-config +++ b/admin/merge-pkg-config @@ -49,15 +49,15 @@ test -n "$dir" } || { - echo >&2 "$0: cannot find pkg.m4" + printf >&2 '%s\n' "$0: cannot find pkg.m4" exit 1 } test -d m4 || { - echo >&2 "$0: please run this command in the main source directory" + printf >&2 '%s\n' "$0: please run this command in the main source directory" exit 1 } -echo >&2 "$0: copying $dir/pkg.m4 to m4/pkg.m4" +printf >&2 '%s\n' "$0: copying $dir/pkg.m4 to m4/pkg.m4" cp $dir/pkg.m4 m4 diff --git a/admin/quick-install-emacs b/admin/quick-install-emacs index 55510fb..4de7416 100755 --- a/admin/quick-install-emacs +++ b/admin/quick-install-emacs @@ -121,11 +121,11 @@ EOF -[!-]?*) # split concatenated single-letter options apart FIRST="$1"; shift - set -- `echo $FIRST | sed 's/-\(.\)\(.*\)/-\1 -\2/'` "$@" + set -- `printf '%s\n' "$FIRST" | sed 's/-\(.\)\(.*\)/-\1 -\2/'` "$@" ;; -*) - echo 1>&2 "$me: unrecognized option '$1'" - echo 1>&2 "$TRY" + printf '%s\n' >&2 "$me: unrecognized option '$1'" + printf '%s\n' >&2 "$TRY" exit 1 ;; *) @@ -140,17 +140,18 @@ case $# in 1) BUILD="$1";; 2) BUILD="$1"; prefix="$2";; *) - echo 1>&2 "$USAGE" - echo 1>&2 "$TRY" + printf '%s\n' >&2 "$USAGE" + printf '%s\n' >&2 "$TRY" exit 1 ;; esac if test ! -d "$BUILD"; then - echo 1>&2 "$me: $BUILD: Build tree not found" + printf '%s\n' >&2 "$me: $BUILD: Build tree not found" exit 2 elif test ! -r "$BUILD/config.status"; then - echo 1>&2 "$me: $BUILD: Not a proper build tree, config.status not found" + printf '%s\n' >&2 \ + "$me: $BUILD: Not a proper build tree, config.status not found" exit 2 fi @@ -160,7 +161,8 @@ get_config_var () { sed -n "s/^S[[]\"$1\"[]]=\"\([^\"]*\)\"/\1/p" $CONFIG_STATUS | sed q | grep ''; } || { sed -n "s/^s\(.\)@$1@\1\(|#_!!_#|\)*\(.*\)\1.*$/\3/p" $CONFIG_STATUS | sed q | grep ''; } || { - echo 1>&2 "$me: $1: Configuration variable not found in $CONFIG_STATUS" + printf '%s\n' >&2 \ + "$me: $1: Configuration variable not found in $CONFIG_STATUS" exit 4 } } @@ -172,7 +174,7 @@ test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; } VERSION=` sed -n 's/^AC_INIT(emacs,[ ]*\([^ )]*\).*/\1/p' <$SRC/configure.ac ` || exit 4 -test -n "$VERSION" || { echo >&2 "$me: no version in configure.ac"; exit 4; } +test -n "$VERSION" || { printf '%s\n' >&2 "$me: no version in configure.ac"; exit 4; } DST_SHARE="$prefix/share/emacs/$VERSION" DST_BIN="$prefix/bin" @@ -209,7 +211,7 @@ maybe_mkdir "$DST_INFO" PRUNED="" if test x"$PRUNE" != xno; then for D in `ls -1t $BUILD/src/emacs-$VERSION.* | sed 1d`; do - echo $REMOVE_CMD $D + printf '%s\n' "$REMOVE_CMD $D" PRUNED="$PRUNED $D" done fi @@ -219,7 +221,7 @@ test x"$PRUNE" = xonly && exit 0 maybe_emit_copy () { if test "$FORCE" = yes || ! cmp -s $1 $2; then - echo $LINK_CMD $1 $2 + printf '%s\n' "$LINK_CMD $1 $2" fi } @@ -240,7 +242,7 @@ for SUBDIR in lisp leim etc lib-src info; do # defaults SHARED=no FORCED='' - AVOID_PAT="`echo "($AVOID)" | tr ' ' '|'`" + AVOID_PAT="`printf '%s\n' "($AVOID)" | tr ' ' '|'`" # Set subdir-specific values case $SUBDIR in @@ -255,7 +257,7 @@ for SUBDIR in lisp leim etc lib-src info; do ;; lib-src) DST="$DST_LIBEXEC" - AVOID_PAT="`echo "($AVOID ($PUBLIC_LIBSRC_BINARIES)\$)" | tr ' ' '|'`" + AVOID_PAT="`printf '%s\n' "($AVOID ($PUBLIC_LIBSRC_BINARIES)\$)" | tr ' ' '|'`" ;; info) DST="$DST_INFO" @@ -267,10 +269,10 @@ for SUBDIR in lisp leim etc lib-src info; do if [ -d $PFX/$SUBDIR ]; then for DIR in `(cd $PFX/$SUBDIR; find . -type d -print | sed 's@^./@@')`; do if [ -d $DST/$DIR ]; then - echo Directory $DST/$DIR exists + printf '%s\n' "Directory $DST/$DIR exists" else - echo Directory $DST/$DIR non-existent - if [ "`echo $DIR | egrep -v "$AVOID_PAT"`" ]; then + printf '%s\n' "Directory $DST/$DIR non-existent" + if [ "`printf '%s\n' "$DIR" | grep -Ev "$AVOID_PAT"`" ]; then maybe_mkdir $DST/$DIR fi fi diff --git a/build-aux/gitlog-to-emacslog b/build-aux/gitlog-to-emacslog index 51ef2a7..3d61ba1 100755 --- a/build-aux/gitlog-to-emacslog +++ b/build-aux/gitlog-to-emacslog @@ -35,14 +35,14 @@ while [ $# -gt 0 ]; do -f|--force) force=1 ;; -n|--nmax) nmax="$2"; shift ;; -o|--output) output="$2" ; shift ;; - *) echo "Unrecognized argument: $1" >&2; exit 1 ;; + *) printf '%s\n' "Unrecognized argument: $1" >&2; exit 1 ;; esac shift done if [ ! -f ChangeLog.$nmax ]; then - echo "Can't find ChangeLog.$nmax" >&2 - echo "Must be run from the top source directory" >&2 + printf '%s\n' "Can't find ChangeLog.$nmax" >&2 + printf '%s\n' "Must be run from the top source directory" >&2 exit 1 fi @@ -52,7 +52,7 @@ fi gen_origin_line=` grep -E '^commit [0-9a-f]+ [(]inclusive[)]' ChangeLog.$nmax ` || { - echo "ChangeLog.$nmax lacks a 'commit ... (inclusive)' line" >&2 + printf '%s\n' "ChangeLog.$nmax lacks a 'commit ... (inclusive)' line" >&2 exit 1 } set $gen_origin_line @@ -63,7 +63,7 @@ fi new_origin=`git log --pretty=format:%H 'HEAD^!'` || exit if [ -f "$output" ]; then - [ ! "$force" ] && echo "$output exists" >&2 && exit 1 + [ ! "$force" ] && printf '%s\n' "$output exists" >&2 && exit 1 rm -f "$output" || exit 1 fi diff --git a/configure.ac b/configure.ac index d537f73..90c4e12 100644 --- a/configure.ac +++ b/configure.ac @@ -401,7 +401,7 @@ gamegroup= case ${with_gameuser} in no) ;; "" | yes) gamegroup=games ;; - :*) gamegroup=`echo "${with_gameuser}" | sed -e "s/://"` ;; + :*) gamegroup=${with_gameuser#:} ;; *) gameuser=${with_gameuser} ;; esac @@ -1702,15 +1702,17 @@ fi LD_SWITCH_X_SITE_RPATH= if test "${x_libraries}" != NONE; then if test -n "${x_libraries}"; then - LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"` - LD_SWITCH_X_SITE_RPATH=-Wl,-rpath,`echo ${x_libraries} | sed -e "s/:/ -Wl,-rpath,/g"` + LD_SWITCH_X_SITE=-L`AS_ECHO(["$x_libraries"]) | sed -e 's/:/ -L/g'` + LD_SWITCH_X_SITE_RPATH=-Wl,-rpath,` + AS_ECHO(["$x_libraries"]) | sed -e 's/:/ -Wl,-rpath,/g' + ` fi x_default_search_path="" x_search_path=${x_libraries} if test -z "${x_search_path}"; then x_search_path=/usr/lib fi - for x_library in `echo ${x_search_path}: | \ + for x_library in `AS_ECHO(["$x_search_path:"]) | \ sed -e "s/:/ /g" -e p -e "s:/lib[[^ /]]* :/share :g"`; do x_search_path="\ ${x_library}/X11/%L/%T/%N%C%S:\ @@ -1729,15 +1731,15 @@ fi AC_SUBST(LD_SWITCH_X_SITE_RPATH) if test "${x_includes}" != NONE && test -n "${x_includes}"; then - C_SWITCH_X_SITE="$isystem"`echo ${x_includes} | sed -e "s/:/ $isystem/g"` + C_SWITCH_X_SITE=$isystem`AS_ECHO(["$x_includes"]) | sed -e "s/:/ $isystem/g"` fi if test x"${x_includes}" = x; then bitmapdir=/usr/include/X11/bitmaps else # accumulate include directories that have X11 bitmap subdirectories - bmd_acc="dummyval" - for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do + bmd_acc= + for bmd in `AS_ECHO(["$x_includes"]) | sed -e 's/:/ /g'`; do if test -d "${bmd}/X11/bitmaps"; then bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps" fi @@ -1745,9 +1747,7 @@ else bmd_acc="${bmd_acc}:${bmd}/bitmaps" fi done - if test ${bmd_acc} != "dummyval"; then - bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"` - fi + bitmapdir=${bmdacc#:} fi test "${with_ns}" = maybe && test "${opsys}" != darwin && with_ns=no @@ -1777,11 +1777,23 @@ if test "${with_ns}" != no; then elif test -f $GNUSTEP_CONFIG_FILE; then NS_IMPL_GNUSTEP=yes dnl FIXME sourcing this several times in subshells seems inefficient. - GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)" - GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)" + GNUSTEP_SYSTEM_HEADERS=$( + . $GNUSTEP_CONFIG_FILE + AS_ECHO(["$GNUSTEP_SYSTEM_HEADERS"]) + ) + GNUSTEP_SYSTEM_LIBRARIES=$( + . $GNUSTEP_CONFIG_FILE + AS_ECHO(["$GNUSTEP_SYSTEM_LIBRARIES"]) + ) dnl I seemed to need these as well with GNUstep-startup 0.25. - GNUSTEP_LOCAL_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_LOCAL_HEADERS)" - GNUSTEP_LOCAL_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_LOCAL_LIBRARIES)" + GNUSTEP_LOCAL_HEADERS=$( + . $GNUSTEP_CONFIG_FILE + AS_ECHO(["$GNUSTEP_LOCAL_HEADERS"]) + ) + GNUSTEP_LOCAL_LIBRARIES=$( + . $GNUSTEP_CONFIG_FILE + AS_ECHO(["$GNUSTEP_LOCAL_LIBRARIES"]) + ) test "x${GNUSTEP_LOCAL_HEADERS}" != "x" && \ GNUSTEP_LOCAL_HEADERS="-I${GNUSTEP_LOCAL_HEADERS}" test "x${GNUSTEP_LOCAL_LIBRARIES}" != "x" && \ @@ -2057,7 +2069,11 @@ if test "$window_system" = none && test "X$with_x" != "Xno"; then AC_CHECK_PROG(HAVE_XSERVER, X, true, false) if test "$HAVE_XSERVER" = true || test -n "$DISPLAY" || - test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then + { + for emacs_libX11 in /usr/lib/libX11.*; do break; done + test "$emacs_libX11" != '/usr/lib/libX11.*' + } + then AC_MSG_ERROR([You seem to be running X, but no X development libraries were found. You should install the relevant development files for X and for the toolkit you want, such as Gtk+ or Motif. Also make @@ -4718,11 +4734,13 @@ CPPFLAGS="$REAL_CPPFLAGS" LIBS="$REAL_LIBS" ## Hack to detect a buggy GCC version. -if test "x$GCC" = xyes \ - && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \ - && test x"`echo $CFLAGS | grep '\-O@<:@23@:>@'`" != x \ - && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then - AC_MSG_ERROR([GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'.]) +if test "$GCC" = yes && \ + $CC --version 2> /dev/null | grep 'gcc.* 4.5.0' >/dev/null; then + case $CFLAGS in + *-fno-optimize-sibling-calls*) ;; + *-O@<:@23@:>@*) + AC_MSG_ERROR([GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS.]);; + esac fi version=$PACKAGE_VERSION @@ -4976,7 +4994,7 @@ LIBS=$SAVE_LIBS if test "${opsys}" = "mingw32"; then CPPFLAGS="$CPPFLAGS -DUSE_CRT_DLL=1 -I \${abs_top_srcdir}/nt/inc" # Remove unneeded switches from the value of CC that goes to Makefiles - CC=`echo $CC | sed -e "s,$GCC_TEST_OPTIONS,,"` + CC=`AS_ECHO(["$CC"]) | sed -e "s,$GCC_TEST_OPTIONS,,"` fi case "$opsys" in @@ -5124,7 +5142,8 @@ else ACL_SUMMARY=no fi -echo " +emacs_standard_dirs='Standard dirs' +AS_ECHO([" Configured for '${canonical}'. Where should the build process find the source code? ${srcdir} @@ -5133,18 +5152,9 @@ Configured for '${canonical}'. Should Emacs use a relocating allocator for buffers? ${REL_ALLOC} Should Emacs use mmap(2) for buffer allocation? $use_mmap_for_buffers What window system should Emacs use? ${window_system} - What toolkit should Emacs use? ${USE_X_TOOLKIT}" - -if test -n "${x_includes}"; then -echo " Where do we find X Windows header files? ${x_includes}" -else -echo " Where do we find X Windows header files? Standard dirs" -fi -if test -n "${x_libraries}"; then -echo " Where do we find X Windows libraries? ${x_libraries}" -else -echo " Where do we find X Windows libraries? Standard dirs" -fi + What toolkit should Emacs use? ${USE_X_TOOLKIT} + Where do we find X Windows header files? ${x_includes:-$emacs_standard_dirs} + Where do we find X Windows libraries? ${x_libraries:-$emacs_standard_dirs}"]) optsep= emacs_config_features= @@ -5174,57 +5184,53 @@ done AC_DEFINE_UNQUOTED(EMACS_CONFIG_FEATURES, "${emacs_config_features}", [Summary of some of the main features enabled by configure.]) -echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}" -echo " Does Emacs use -lXpm? ${HAVE_XPM}" -echo " Does Emacs use -ljpeg? ${HAVE_JPEG}" -echo " Does Emacs use -ltiff? ${HAVE_TIFF}" -echo " Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF" -echo " Does Emacs use a png library? ${HAVE_PNG} $LIBPNG" -echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}" -echo " Does Emacs use cairo? ${USE_CAIRO}" -echo " Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}" - -echo " Does Emacs support sound? ${HAVE_SOUND}" - -echo " Does Emacs use -lgpm? ${HAVE_GPM}" -echo " Does Emacs use -ldbus? ${HAVE_DBUS}" -echo " Does Emacs use -lgconf? ${HAVE_GCONF}" -echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}" -echo " Does Emacs use a file notification library? ${NOTIFY_SUMMARY}" -echo " Does Emacs use access control lists? ${ACL_SUMMARY}" -echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" -echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" -echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" - -echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" -echo " Does Emacs use -lm17n-flt? ${HAVE_M17N_FLT}" -echo " Does Emacs use -lotf? ${HAVE_LIBOTF}" -echo " Does Emacs use -lxft? ${HAVE_XFT}" -echo " Does Emacs directly use zlib? ${HAVE_ZLIB}" - -echo " Does Emacs use toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}" -echo +AS_ECHO([" Does Emacs use -lXaw3d? ${HAVE_XAW3D} + Does Emacs use -lXpm? ${HAVE_XPM} + Does Emacs use -ljpeg? ${HAVE_JPEG} + Does Emacs use -ltiff? ${HAVE_TIFF} + Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF + Does Emacs use a png library? ${HAVE_PNG} $LIBPNG + Does Emacs use -lrsvg-2? ${HAVE_RSVG} + Does Emacs use cairo? ${USE_CAIRO} + Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK} + Does Emacs support sound? ${HAVE_SOUND} + Does Emacs use -lgpm? ${HAVE_GPM} + Does Emacs use -ldbus? ${HAVE_DBUS} + Does Emacs use -lgconf? ${HAVE_GCONF} + Does Emacs use GSettings? ${HAVE_GSETTINGS} + Does Emacs use a file notification library? ${NOTIFY_SUMMARY} + Does Emacs use access control lists? ${ACL_SUMMARY} + Does Emacs use -lselinux? ${HAVE_LIBSELINUX} + Does Emacs use -lgnutls? ${HAVE_GNUTLS} + Does Emacs use -lxml2? ${HAVE_LIBXML2} + Does Emacs use -lfreetype? ${HAVE_FREETYPE} + Does Emacs use -lm17n-flt? ${HAVE_M17N_FLT} + Does Emacs use -lotf? ${HAVE_LIBOTF} + Does Emacs use -lxft? ${HAVE_XFT} + Does Emacs directly use zlib? ${HAVE_ZLIB} + Does Emacs use toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS} +"]) if test -n "${EMACSDATA}"; then - echo " Environment variable EMACSDATA set to: $EMACSDATA" + AS_ECHO([" Environment variable EMACSDATA set to: $EMACSDATA"]) fi if test -n "${EMACSDOC}"; then - echo " Environment variable EMACSDOC set to: $EMACSDOC" + AS_ECHO([" Environment variable EMACSDOC set to: $EMACSDOC"]) fi echo if test "$HAVE_NS" = "yes"; then echo - echo "You must run \"${MAKE-make} install\" in order to test the built application. + AS_ECHO(["You must run \"${MAKE-make} install\" in order to test the built application. The installed application will go to nextstep/Emacs.app and can be -run or moved from there." +run or moved from there."]) if test "$EN_NS_SELF_CONTAINED" = "yes"; then echo "The application will be fully self-contained." else - echo "The lisp resources for the application will be installed under ${prefix}. + AS_ECHO(["The lisp resources for the application will be installed under ${prefix}. You may need to run \"${MAKE-make} install\" with sudo. The application will fail -to run if these resources are not installed." +to run if these resources are not installed."]) fi echo fi @@ -5238,10 +5244,12 @@ if test "${opsys}" = "cygwin"; then fi # Remove any trailing slashes in these variables. -[test "${prefix}" != NONE && - prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'` -test "${exec_prefix}" != NONE && - exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`] +case $prefix in + */) prefix=`AS_DIRNAME(["$prefix."])`;; +esac +case $exec_prefix in + */) exec_prefix=`AS_DIRNAME(["$exec_prefix."])`;; +esac if test "$HAVE_NS" = "yes"; then if test "$NS_IMPL_GNUSTEP" = yes; then @@ -5319,7 +5327,7 @@ dnl is not yet set, sigh. Or we could use ../$srcdir/src/.gdbinit, dnl or a symlink? AC_CONFIG_COMMANDS([src/.gdbinit], [ if test ! -f src/.gdbinit && test -f "$srcdir/src/.gdbinit"; then - echo "source $ac_abs_top_srcdir/src/.gdbinit" > src/.gdbinit + AS_ECHO(["source $ac_abs_top_srcdir/src/.gdbinit"]) > src/.gdbinit fi ]) diff --git a/doc/lispref/two-volume.make b/doc/lispref/two-volume.make index 64799d8..bdcdb2f 100644 --- a/doc/lispref/two-volume.make +++ b/doc/lispref/two-volume.make @@ -26,9 +26,9 @@ tex2 = sed '/^@setfilename/a\ # elisp.texi specially defines \tocreadfilename when VOL1 or VOL2 is # set, so we can use our premade .toc's. -# +# vol1.pdf: elisp1med-fns-ready elisp1med-aux-ready elisp1med-toc-ready - @echo -e "\f Final TeX run for volume 1..." + @printf '\f Final TeX run for volume 1...\n' cp elisp1med-toc-ready elisp1-toc-ready.toc cp elisp1med-fns-ready vol1.fns cp elisp1med-aux-ready vol1.aux @@ -42,27 +42,27 @@ vol2.pdf: elisp2med-fns-ready elisp2med-aux-ready elisp2med-toc-ready $(tex2) # intermediate toc files. -# +# # vol1 toc: volume 1, page break, volume 2 (with II: prepended). elisp1med-toc-ready: elisp1med-init elisp2med-init echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ cat elisp1med-toc >>$@ echo '@page' >>$@ echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ - sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2med-toc >>$@ + sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2med-toc >>$@ # # vol2 toc: volume 1 (with I: prepended), page break, volume 2. elisp2med-toc-ready: elisp1med-init elisp2med-init echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ - sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1med-toc >>$@ + sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1med-toc >>$@ echo '@page' >>$@ echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ cat elisp2med-toc >>$@ # intermediate aux files. -# -# append vol2's fixed aux to normal vol1. +# +# append vol2's fixed aux to normal vol1. elisp1med-aux-ready: elisp2med-aux-vol-added cat elisp1med-aux $< >$@ # @@ -78,7 +78,7 @@ elisp2med-aux-vol-added: elisp2med-init sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie2}/' elisp2med-aux >$@ # intermediate index (fns) file. -# +# elisp1med-fns-ready: elisp1med-fn-vol-added elisp2med-fn-vol-added cat elisp2med-fn-vol-added >>vol1.fn texindex vol1.fn @@ -103,17 +103,17 @@ elisp2med-fn-vol-added: elisp2med-init # ----------------------------------------------------------------------------- # intermediate TeX runs. -# +# # this generates what would be the final versions -- except the page # numbers aren't right. The process of adding the I: and II: changes # the page breaks, so a few index entries, at least are wrong. (In # 2007, x-meta-keysym in vol.II ended up on page 374 when the index had # it on page 375 from the initial run.) -# +# # So, we start all over again, from these fns/aux/toc files. -# +# elisp1med-init: elisp1-fns-ready elisp1-aux-ready elisp1init-toc-ready $(texinfodir)/texinfo.tex - @echo -e "\f Intermediate TeX run for volume 1..." + @printf '\f Intermediate TeX run for volume 1...\n' cp elisp1init-toc-ready elisp1-toc-ready.toc cp elisp1-fns-ready vol1.fns cp elisp1-aux-ready vol1.aux @@ -134,26 +134,26 @@ elisp2med-init: elisp2-fns-ready elisp2-aux-ready elisp2init-toc-ready $(texinfo # initial toc files. -# +# # vol1 toc: volume 1, page break, volume 2 (with II: prepended). elisp1init-toc-ready: elisp1-init elisp2-init echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ cat elisp1-toc >>$@ echo '@page' >>$@ echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ - sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2-toc >>$@ + sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2-toc >>$@ # # vol2 toc: volume 1 (with I: prepended), page break, volume 2. elisp2init-toc-ready: elisp1-init elisp2-init echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ - sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1-toc >>$@ + sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1-toc >>$@ echo '@page' >>$@ echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ cat elisp2-toc >>$@ # initial aux files. -# +# # append vol2's fixed aux to normal vol1. The initial runs saved # elisp1-aux and elisp2-aux. elisp1-aux-ready: elisp2-aux-vol-added @@ -171,7 +171,7 @@ elisp2-aux-vol-added: elisp2-init sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie2}/' elisp2-aux >$@ # initial index (fns) file. -# +# # Append other volume's index entries to this one's. # Index entries in this volume will then take precedence. elisp1-fns-ready: elisp1-fn-vol-added elisp2-fn-vol-added @@ -195,14 +195,14 @@ elisp2-fn-vol-added: elisp2-init # initial TeX runs. -# +# # We use the .fn, .aux, and .toc files created here in subsequent # processing. The page numbers generated here will not be correct yet, # but we run texindex and TeX a second time just to get them closer. # Otherwise it might take even longer for them to converge. -# +# elisp1-init: elisp.texi - @echo -e "\f Initial TeX run for volume 1..." + @printf '\f Initial TeX run for volume 1...\n' rm -f vol1.aux vol1.toc $(tex1) texindex vol1.?? @@ -220,17 +220,16 @@ elisp2-init: elisp.texi touch $@ # COPYING CONDITIONS -# +# # This file is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This file is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this file. If not, see . - diff --git a/lib-src/rcs2log b/lib-src/rcs2log index d1bd369..4ee303d 100755 --- a/lib-src/rcs2log +++ b/lib-src/rcs2log @@ -130,7 +130,8 @@ do case $1 in -n) case ${2?}${3?}${4?} in *"$tab"* | *"$nl"*) - echo >&2 "$0: -n '$2' '$3' '$4': tabs, newlines not allowed" + printf '%s\n' >&2 \ + "$0: -n '$2' '$3' '$4': tabs, newlines not allowed" exit 1;; esac login=$2 @@ -140,7 +141,7 @@ do # If $2 is not tab-separated, use colon for separator. case ${2?} in *"$nl"*) - echo >&2 "$0: -u '$2': newlines not allowed" + printf '%s\n' >&2 "$0: -u '$2': newlines not allowed" exit 1;; *"$tab"*) t=$tab;; @@ -149,7 +150,7 @@ do esac case $2 in *"$t"*"$t"*"$t"*) - echo >&2 "$0: -u '$2': too many fields" + printf '%s\n' >&2 "$0: -u '$2': too many fields" exit 1;; *"$t"*"$t"*) uf="[^$t]*$t" # An unselected field, followed by a separator. @@ -161,7 +162,7 @@ do expr "X$2" : "$uf$uf$sf" `;; *) - echo >&2 "$0: -u '$2': not enough fields" + printf '%s\n' >&2 "$0: -u '$2': not enough fields" exit 1;; esac shift;; @@ -186,9 +187,9 @@ do --version) set $Id rcs2logVersion=$3 - echo >&2 "rcs2log (GNU Emacs) $rcs2logVersion$nl$Copyright" + printf '%s\n' >&2 "rcs2log (GNU Emacs) $rcs2logVersion$nl$Copyright" exit 0;; - -*) echo >&2 "Usage: $0 [OPTION]... [FILE ...]$nl$Help" + -*) printf '%s\n' >&2 "Usage: $0 [OPTION]... [FILE ...]$nl$Help" case $1 in --help) exit 0;; *) exit 1;; @@ -303,7 +304,8 @@ case $rlogfile in esac if test ! -d "$repository" then - echo >&2 "$0: $repository: bad repository (see CVS/Repository)" + printf '%s\n' >&2 \ + "$0: $repository: bad repository (see CVS/Repository)" exit 1 fi pository=$repository;; @@ -330,7 +332,7 @@ case $rlogfile in T?*) rlog_options=-r`expr "$CVSTAG" : 'T\(.*\)'`;; *) - echo >&2 "$0: invalid CVS/Tag"; exit 1;; + printf '%s\n' >&2 "$0: invalid CVS/Tag"; exit 1;; esac fi;; esac @@ -595,7 +597,7 @@ case $hostname in hostname=`( hostname || uname -n || uuname -l || cat /etc/whoami ) 2>/dev/null` || { - echo >&2 "$0: cannot deduce hostname" + printf '%s\n' >&2 "$0: cannot deduce hostname" exit 1 } diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 15d4d37..ed1246b 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -221,7 +221,7 @@ lisptagsfiles2 = $(srcdir)/*/*.el lisptagsfiles3 = $(srcdir)/*/*/*.el lisptagsfiles4 = $(srcdir)/*/*/*/*.el -## The echo | sed | xargs is to stop the command line getting too long +## The ls | sed | xargs is to stop the command line getting too long ## on MS Windows, when the MSYS Bash passes it to a MinGW compiled ## etags. It might be better to use find in a similar way to ## compile-main. But maybe this is not even necessary any more now @@ -229,10 +229,9 @@ lisptagsfiles4 = $(srcdir)/*/*/*/*.el TAGS: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) rm -f $@ touch $@ - echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | \ - sed -e 's,$(srcdir)/[^ ]*loaddefs[^ ]*,,g' \ - -e 's,$(srcdir)/ldefs-boot[^ ]*,,' \ - -e 's,$(srcdir)/[^ ]*esh-groups.el[^ ]*,,' | \ + ls $(lisptagsfiles1) $(lisptagsfiles2) \ + $(lisptagsfiles3) $(lisptagsfiles4) | \ + sed -e '/loaddefs/d; /\/ldefs-boot/d; /esh-groups\.el/d' | \ xargs $(XARGS_LIMIT) "$(ETAGS)" -a -o $@ diff --git a/lisp/term.el b/lisp/term.el index e5ae553..41577c9 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -245,86 +245,48 @@ ;; ---------------------------------------- ;; ;; Notice: for directory/host/user tracking you need to have something -;; like this in your shell startup script ( this is for tcsh but should -;; be quite easy to port to other shells ) +;; like this in your shell startup script (this is for a POSIXish shell +;; like Bash but should be quite easy to port to other shells) ;; ;; ---------------------------------------- ;; -;; -;; set os = `uname` -;; set host = `hostname` -;; set date = `date` +;; # Set HOSTNAME if not already set. +;; : ${HOSTNAME=$(uname -n)} ;; ;; # su does not change this but I'd like it to ;; -;; set user = `whoami` +;; USER=$(whoami) ;; ;; # ... ;; -;; if ( eterm =~ $TERM ) then -;; -;; echo -------------------------------------------------------------- -;; echo Hello $user -;; echo Today is $date -;; echo We are on $host running $os under Emacs term mode -;; echo -------------------------------------------------------------- -;; -;; setenv EDITOR emacsclient -;; -;; # Notice: $host and $user have been set before to 'hostname' and 'whoami' -;; # this is necessary because, f.e., certain versions of 'su' do not change -;; # $user, YMMV: if you don't want to fiddle with them define a couple -;; # of new variables and use these instead. -;; # NOTICE that there is a space between "AnSiT?" and $whatever NOTICE -;; -;; # These are because we want the real cwd in the messages, not the login -;; # time one ! -;; -;; set cwd_hack='$cwd' -;; set host_hack='$host' -;; set user_hack='$user' +;; case $TERM in +;; eterm*) ;; -;; # Notice that the ^[ character is an ESC, not two chars. You can -;; # get it in various ways, for example by typing -;; # echo -e '\033' > escape.file -;; # or by using your favorite editor +;; printf '%s\n' \ +;; -------------------------------------------------------------- \ +;; "Hello $user" \ +;; "Today is $(date)" \ +;; "We are on $HOSTNAME running $(uname) under Emacs term mode" \ +;; -------------------------------------------------------------- ;; -;; foreach temp (cd pushd) -;; alias $temp "$temp \!* ; echo 'AnSiTc' $cwd_hack" -;; end -;; alias popd 'popd ;echo "AnSiTc" $cwd' +;; export EDITOR=emacsclient ;; -;; # Every command that can modify the user/host/directory should be aliased -;; # as follows for the tracking mechanism to work. +;; # The \033 stands for ESC. +;; # There is a space between "AnSiT?" and $whatever. ;; -;; foreach temp ( rlogin telnet rsh sh ksh csh tcsh zsh bash tcl su ) -;; alias $temp "$temp \!* ; echo 'AnSiTh' $host_hack ; \ -;; echo 'AnSiTu' $user_hack ;echo 'AnSiTc' $cwd_hack" -;; end +;; cd() { command cd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } +;; pushd() { command pushd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } +;; popd() { command popd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } ;; -;; # Start up & use color ls +;; printf '\033AnSiTc %s\n' "$PWD" +;; printf '\033AnSiTh %s\n' "$HOSTNAME" +;; printf '\033AnSiTu %s\n' "$USER" ;; -;; echo "AnSiTh" $host -;; echo "AnSiTu" $user -;; echo "AnSiTc" $cwd -;; -;; # some housekeeping -;; -;; unset cwd_hack -;; unset host_hack -;; unset user_hack -;; unset temp -;; -;; eval `/bin/dircolors /home/marco/.emacs_dircolors` -;; endif +;; eval $(dircolors $HOME/.emacs_dircolors) +;; esac ;; ;; # ... ;; -;; # Let's not clutter user space -;; -;; unset os -;; unset date -;; ;; ;;; Original Commentary: diff --git a/make-dist b/make-dist index 79db904..48a2836 100755 --- a/make-dist +++ b/make-dist @@ -110,7 +110,7 @@ while [ $# -gt 0 ]; do ;; "--help") - echo "Usage: ${progname} [options]" + printf '%s\n' "Usage: ${progname} [options]" echo "" echo " --bzip2 use bzip2 instead of gzip" echo " --clean-up delete staging directories when done" @@ -128,7 +128,7 @@ while [ $# -gt 0 ]; do ;; * ) - echo "${progname}: Unrecognized argument: $1" >&2 + printf '%s\n' "${progname}: Unrecognized argument: $1" >&2 exit 1 ;; esac @@ -137,9 +137,9 @@ done ### Make sure we're running in the right place. if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/subr.el ]; then - echo "${progname}: Can't find 'src/lisp.h' and 'lisp/subr.el'." >&2 - echo "${progname} must be run in the top directory of the Emacs" >&2 - echo "distribution tree. cd to that directory and try again." >&2 + printf '%s\n' "${progname}: Can't find 'src/lisp.h' and 'lisp/subr.el'." >&2 + printf '%s\n' "${progname} must be run in the top directory of the Emacs" >&2 + printf '%s\n' "distribution tree. cd to that directory and try again." >&2 exit 1 fi @@ -155,7 +155,7 @@ then /*) ;; *) if [ ! -f "$EMACS" ]; then - echo "$0: You must set the EMACS environment variable " \ + printf '%s\n' "$0: You must set the EMACS environment variable " \ "to an absolute file name." 2>&1 exit 1 fi;; @@ -168,7 +168,8 @@ version=` sed -n 's/^AC_INIT(GNU Emacs,[ ]*\([^ ,)]*\).*/\1/p' &2 + printf '%s\n' \ + "${progname}: can't find current Emacs version in './src/emacs.c'" >&2 exit 1 fi @@ -195,7 +196,7 @@ fi ### Make sure the subdirectory is available. tempparent="make-dist.tmp.$$" if [ -d ${tempparent} ]; then - echo "${progname}: staging directory '${tempparent}' already exists. + printf '%s\n' "${progname}: staging directory '${tempparent}' already exists. Perhaps a previous invocation of '${progname}' failed to clean up after itself. Check that directories whose names are of the form 'make-dist.tmp.NNNNN' don't contain any important information, remove @@ -530,7 +531,7 @@ for subdir in . etc leim lib lib-src lisp lwlib msdos nt src; do done if [ "${newer}" ]; then - echo "Removing files older than $newer" + printf '%s\n' "Removing files older than $newer" ## We remove .elc files unconditionally, on the theory that anyone picking ## up an incremental distribution already has a running Emacs to byte-compile ## them with. @@ -544,8 +545,9 @@ find ${tempparent} \( -name '*~' -o -name '#*#' -o -name '.*ignore' -o -name '=* if [ "${make_tar}" = yes ]; then echo "Looking for $default_gzip" found=0 - temppath=`echo $PATH | sed -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \ - -e 's/:/ /g'` + temppath=`printf '%s\n' "$PATH" | + sed -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' -e 's/:/ /g' + ` for dir in ${temppath}; do [ -x ${dir}/$default_gzip ] || continue found=1; break diff --git a/src/Makefile.in b/src/Makefile.in index 1fb770d..f735759 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -443,7 +443,7 @@ all: emacs$(EXEEXT) $(OTHER_FILES) shortlisp = lisp.mk: $(lispsource)/loadup.el @rm -f $@ - ${AM_V_GEN}( echo "shortlisp = \\"; \ + ${AM_V_GEN}( printf 'shortlisp = \\\n'; \ sed -n 's/^[ \t]*(load "\([^"]*\)".*/\1/p' $< | \ sed -e 's/$$/.elc \\/' -e 's/\.el\.elc/.el/'; \ echo "" ) > $@ diff --git a/test/etags/make-src/Makefile b/test/etags/make-src/Makefile index daf605d..016c633 100644 --- a/test/etags/make-src/Makefile +++ b/test/etags/make-src/Makefile @@ -15,7 +15,7 @@ ERLSRC=gs_dialog.erl lines.erl lists.erl FORTHSRC=test-forth.fth FSRC=entry.for entry.strange_suffix entry.strange HTMLSRC=softwarelibero.html index.shtml algrthms.html software.html -JAVASRC=AWTEMul.java KeyEve.java SMan.java SysCol.java TG.java +JAVASRC=AWTEMul.java KeyEve.java SMan.java SysCol.java TG.java LUASRC=allegro.lua MAKESRC=Makefile OBJCSRC=Subprocess.h Subprocess.m PackInsp.h PackInsp.m @@ -120,9 +120,9 @@ rsyncfromfly: rsync --exclude "*~" --exclude core --exclude etags -zauRv fly:gnu/etags/ ../.. web ftp publish: - @-echo -e \\ttesting with debugging enabled...; $(MAKE) quiettest - @-echo -e \\ttesting standalone...; $(MAKE) standalone quiettest - @-echo -e \\ttesting fast versions...; $(MAKE) fastetags fastctags quiettest + @-printf '\ttesting with debugging enabled...\n'; $(MAKE) quiettest + @-printf '\ttesting standalone...\n'; $(MAKE) standalone quiettest + @-printf '\ttesting fast versions...\n'; $(MAKE) fastetags fastctags quiettest @$(MAKE) /home/www/pub/etags.c.gz @$(MAKE) /home/www/pub/software/unix/etags.tar.gz commit ec0d4d24fd11b5040de9f7657b486c3b1e743071 Author: Kaushal Modi Date: Sat Oct 10 18:36:51 2015 -0500 Allow numbers with different radixes to be yanked. * lisp/calc/calc-yank.el (calc-yank): Allow radixes besides the default base 10. diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index c5a837d..8d97bc6 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1287,7 +1287,7 @@ Redefine the corresponding command." (setq rpt-count (if rpt-count (prefix-numeric-value rpt-count) 1000000)) (let* ((count 0) (parts nil) - (body (vector) ) + (body (vector)) (open last-command-event) (counter initial) ch) @@ -1300,7 +1300,7 @@ Redefine the corresponding command." (if (eq ch ?Z) (progn (setq ch (read-event) - body (vconcat body (vector ?Z ch) )) + body (vconcat body (vector ?Z ch))) (cond ((memq ch '(?\< ?\( ?\{)) (setq count (1+ count))) ((memq ch '(?\> ?\) ?\})) diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 5694a4e..c93b64b 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -111,25 +111,101 @@ ;; otherwise it just parses the yanked string. ;; Modified to use Emacs 19 extended concept of kill-ring. -- daveg 12/15/96 ;;;###autoload -(defun calc-yank () - (interactive) +(defun calc-yank (radix) + "Yank a value into the Calculator buffer. + +Valid numeric prefixes for RADIX: 0, 2, 6, 8 +No radix notation is prepended for any other numeric prefix. + +If RADIX is 2, prepend \"2#\" - Binary. +If RADIX is 8, prepend \"8#\" - Octal. +If RADIX is 0, prepend \"10#\" - Decimal. +If RADIX is 6, prepend \"16#\" - Hexadecimal. + +If RADIX is a non-nil list (created using \\[universal-argument]), the user +will be prompted to enter the radix in the minibuffer. + +If RADIX is nil or if the yanked string already has a calc radix prefix, the +yanked string will be passed on directly to the Calculator buffer without any +alteration." + (interactive "P") (calc-wrapper (calc-pop-push-record-list 0 "yank" - (let ((thing (if (fboundp 'current-kill) - (current-kill 0 t) - (car kill-ring-yank-pointer)))) + (let* (radix-num + radix-notation + valid-num-regexp + (thing-raw + (if (fboundp 'current-kill) + (current-kill 0 t) + (car kill-ring-yank-pointer))) + (thing + (if (or (null radix) + ;; Match examples: -2#10, 10\n(10#10,01) + (string-match-p "^[-(]*[0-9]\\{1,2\\}#" thing-raw)) + thing-raw + (progn + (if (listp radix) + (progn + (setq radix-num + (read-number + "Set radix for yanked content (2-36): ")) + (when (not (and (integerp radix-num) + (<= 2 radix-num) + (>= 36 radix-num))) + (error (concat "The radix has to be an " + "integer between 2 and 36.")))) + (setq radix-num + (cond ((eq radix 2) 2) + ((eq radix 8) 8) + ((eq radix 0) 10) + ((eq radix 6) 16) + (t (message + (concat "No radix prepended " + "for invalid *numeric* " + "prefix %0d.") + radix) + nil)))) + (if radix-num + (progn + (setq radix-notation + (concat (number-to-string radix-num) "#")) + (setq valid-num-regexp + (cond + ;; radix 2 to 10 + ((and (<= 2 radix-num) + (>= 10 radix-num)) + (concat "[0-" + (number-to-string (1- radix-num)) + "]+")) + ;; radix 11 + ((= 11 radix-num) "[0-9aA]+") + ;; radix 12+ + (t + (concat "[0-9" + "a-" (format "%c" (+ (- ?a 11) radix-num)) + "A-" (format "%c" (+ (- ?A 11) radix-num)) + "]+")))) + ;; Ensure that the radix-notation is prefixed + ;; correctly even for multi-line yanks like below, + ;; 111 + ;; 1111 + (replace-regexp-in-string + valid-num-regexp + (concat radix-notation "\\&") + thing-raw)) + thing-raw))))) (if (eq (car-safe calc-last-kill) thing) - (cdr calc-last-kill) - (if (stringp thing) - (let ((val (math-read-exprs (calc-clean-newlines thing)))) - (if (eq (car-safe val) 'error) - (progn - (setq val (math-read-exprs thing)) - (if (eq (car-safe val) 'error) - (error "Bad format in yanked data") - val)) - val)))))))) + (cdr calc-last-kill) + (if (stringp thing) + (let ((val (math-read-exprs (calc-clean-newlines thing)))) + (if (eq (car-safe val) 'error) + (progn + (setq val (math-read-exprs thing)) + (if (eq (car-safe val) 'error) + (error "Bad format in yanked data") + val)) + val)))))))) ;;; The Calc set- and get-register commands are modified versions of functions ;;; in register.el commit 89f2c79868e7bcc2fc5436796f063d1e903dea41 Author: Paul Eggert Date: Sat Oct 10 15:46:28 2015 -0700 Improve CHECK_IMPURE and PURE_P speedup * src/data.c (Faset): Use XVECTOR and XSTRING rather than XPNTR. diff --git a/src/data.c b/src/data.c index a910f6e..b85d8a7 100644 --- a/src/data.c +++ b/src/data.c @@ -2215,10 +2215,10 @@ bool-vector. IDX starts at 0. */) CHECK_NUMBER (idx); idxval = XINT (idx); CHECK_ARRAY (array, Qarrayp); - CHECK_IMPURE (array, XPNTR (array)); if (VECTORP (array)) { + CHECK_IMPURE (array, XVECTOR (array)); if (idxval < 0 || idxval >= ASIZE (array)) args_out_of_range (array, idx); ASET (array, idxval, newelt); @@ -2238,6 +2238,7 @@ bool-vector. IDX starts at 0. */) { int c; + CHECK_IMPURE (array, XSTRING (array)); if (idxval < 0 || idxval >= SCHARS (array)) args_out_of_range (array, idx); CHECK_CHARACTER (newelt); commit 5186c998574a8807713b9a43518fdeae52feac67 Author: Jay Belanger Date: Sat Oct 10 17:21:44 2015 -0500 Use events instead of chars to keep track of steps. * lisp/calc/calc-prog.el (calc-kbd-loop): Use events instead of chars to keep track of steps. diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 57af0d2..c5a837d 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1287,37 +1287,37 @@ Redefine the corresponding command." (setq rpt-count (if rpt-count (prefix-numeric-value rpt-count) 1000000)) (let* ((count 0) (parts nil) - (body "") + (body (vector) ) (open last-command-event) (counter initial) ch) (or executing-kbd-macro (message "Reading loop body...")) (while (>= count 0) - (setq ch (read-char)) - (if (= ch -1) + (setq ch (read-event)) + (if (eq ch -1) (error "Unterminated Z%c in keyboard macro" open)) - (if (= ch ?Z) + (if (eq ch ?Z) (progn - (setq ch (read-char) - body (concat body "Z" (char-to-string ch))) + (setq ch (read-event) + body (vconcat body (vector ?Z ch) )) (cond ((memq ch '(?\< ?\( ?\{)) (setq count (1+ count))) ((memq ch '(?\> ?\) ?\})) (setq count (1- count))) ((and (= ch ?/) (= count 0)) - (setq parts (nconc parts (list (concat (substring body 0 -2) - "Z]"))) + (setq parts (nconc parts (list (vconcat (substring body 0 -2) + (vector ?Z ?\]) ))) body "")) ((eq ch 7) (keyboard-quit)))) - (setq body (concat body (char-to-string ch))))) + (setq body (vconcat body (vector ch))))) (if (/= ch (cdr (assq open '( (?\< . ?\>) (?\( . ?\)) (?\{ . ?\}) )))) (error "Mismatched Z%c and Z%c in keyboard macro" open ch)) (or executing-kbd-macro (message "Looping...")) - (setq body (concat (substring body 0 -2) "Z]")) + (setq body (vconcat (substring body 0 -2) (vector ?Z ?\]) )) (and (not executing-kbd-macro) (= rpt-count 1000000) (null parts) commit bb61fa844885a9a9219fc6df7eaaabdbdce45b28 Author: Eli Zaretskii Date: Sat Oct 10 22:50:06 2015 +0300 ; admin/notes/unicode: Update for latest changes. diff --git a/admin/notes/unicode b/admin/notes/unicode index bdef4cb..3901f60 100644 --- a/admin/notes/unicode +++ b/admin/notes/unicode @@ -27,10 +27,11 @@ so will cause aborts in redisplay. Next, review the changes in UnicodeData.txt vs the previous version used by Emacs. Any changes, be it introduction of new scripts or -addition of codepoints to existing scripts, need corresponding changes -in the data used for filling char-script-table, see characters.el -around line 1300. Other databases and settings in characters.el, such -as the data for char-width-table, might also need changes. +addition of codepoints to existing scripts, might need corresponding +changes in the data used for filling the category-table, case-table, +and char-width-table. The additional scripts should cause automatic +updates in charscript.el, but it is a good idea to look at the results +and see if any changes in admin/unidata/blocks.awk are required. Any new scripts added by UnicodeData.txt will also need updates to script-representative-chars defined in fontset.el. Other databases in @@ -39,7 +40,7 @@ fontset.el might also need to be updated as needed. Problems, fixmes and other unicode-related issues ------------------------------------------------------------- -Notes by fx to record various things of variable importance. handa +Notes by fx to record various things of variable importance. Handa needs to check them -- don't take too seriously, especially with regard to completeness. commit c0ae12581c8f961ecad6d8ae1a1c4489c0e0abed Author: Paul Eggert Date: Sat Oct 10 11:56:20 2015 -0700 Fix --enable-gcc-warnings problem with older GCC * src/puresize.h: Add INLINE_HEADER_BEGIN, INLINE_HEADER_END. This is for building with --enable-gcc-warnings with GCC 4.6 through 5.0. diff --git a/src/conf_post.h b/src/conf_post.h index 785e5d7..2c3eee5 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -316,6 +316,11 @@ extern int emacs_setenv_TZ (char const *); before including config.h or any other .h file. Other .c files should not define INLINE. + For Emacs, this is done by having emacs.c first '#define INLINE + EXTERN_INLINE' and then include every .h file that uses INLINE. + + The INLINE_HEADER_BEGIN and INLINE_HEADER_END suppress bogus + warnings in some GCC versions; see ../m4/extern-inline.m4. C99 compilers compile functions like 'incr' as C99-style extern inline functions. Buggy GCC implementations do something similar with diff --git a/src/puresize.h b/src/puresize.h index d0926c6..c61b31f 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -16,6 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ +INLINE_HEADER_BEGIN + /* Define PURESIZE, the number of bytes of pure Lisp code to leave space for. At one point, this was defined in config.h, meaning that changing @@ -88,3 +90,5 @@ CHECK_IMPURE (Lisp_Object obj, void *ptr) if (PURE_P (ptr)) pure_write_error (obj); } + +INLINE_HEADER_END commit 5b2c9f4339c6cd9778b099268fcfee87a888324d Author: Eli Zaretskii Date: Sat Oct 10 20:01:00 2015 +0300 Fix vertical-motion in truncated lines that end in a stretch * src/indent.c (Fvertical_motion): Expect overshoot when point is beyond window margin and lines are truncated, even if we have a stretch at point. (Bug#21468) diff --git a/src/indent.c b/src/indent.c index 584f217..330065b 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2082,7 +2082,11 @@ whether or not it is currently displayed in some window. */) } else it_overshoot_count = - !(it.method == GET_FROM_IMAGE || it.method == GET_FROM_STRETCH); + (!(it.method == GET_FROM_IMAGE + || it.method == GET_FROM_STRETCH) + /* We will overshoot if lines are truncated and PT lies + beyond the right margin of the window. */ + || it.line_wrap == TRUNCATE); if (start_x_given) { commit f655d09fd5b49652f11ab91a31b920dbc36eb10f Author: Eli Zaretskii Date: Sat Oct 10 13:45:15 2015 +0300 Avoid link-time errors due to inline functions * src/emacs.c: Include puresize.h, to avoid link-time errors in unoptimized builds due to PURE_P and CHECK_IMPURE, which are now inline functions. diff --git a/src/emacs.c b/src/emacs.c index 5a6999d..3eff5a7 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -82,6 +82,7 @@ along with GNU Emacs. If not, see . */ #include "syntax.h" #include "sysselect.h" #include "systime.h" +#include "puresize.h" #include "gnutls.h" commit 8f41c3098e6b716cf09f5ea95b0ea1253fd98656 Author: Andreas Schwab Date: Sat Oct 10 10:58:53 2015 +0200 * src/data.c (Faset): Fix last change. diff --git a/src/data.c b/src/data.c index 5ee40c5..a910f6e 100644 --- a/src/data.c +++ b/src/data.c @@ -2215,7 +2215,7 @@ bool-vector. IDX starts at 0. */) CHECK_NUMBER (idx); idxval = XINT (idx); CHECK_ARRAY (array, Qarrayp); - CHECK_IMPURE (array, XVECTOR (array)); + CHECK_IMPURE (array, XPNTR (array)); if (VECTORP (array)) {