diff options
| author | Glenn Morris | 2017-11-29 17:12:05 -0800 |
|---|---|---|
| committer | Glenn Morris | 2017-11-29 17:12:05 -0800 |
| commit | 7aedb6116ffaa6590c86e70380f533385c1ced58 (patch) | |
| tree | 186436d57261f5bd0e5f1bff8844615c17b46128 | |
| parent | 728d259243206136387b6b59c2efb7de8cd9f6ed (diff) | |
| parent | 02d114d6b85e02132d5f99ead517b69dbdd77e35 (diff) | |
| download | emacs-7aedb6116ffaa6590c86e70380f533385c1ced58.tar.gz emacs-7aedb6116ffaa6590c86e70380f533385c1ced58.zip | |
Merge from origin/emacs-26
02d114d6b8 * lisp/tree-widget.el (tree-widget-end-guide): Escape it. ...
0a85d12474 Fix ELisp "Warning Tips"
06d05fec84 Fix Bug#29163
ac64fdb248 Harden exec_byte_code against redefining 'error'
700f74e4c8 Fix Edebug specs for if-let* and and-let* (Bug#29236)
0ded1b41a9 Fix Edebug's handling of dotted specs (bug#6415)
16358d4fcb Improve documentation of "constant" symbols
| -rw-r--r-- | doc/lispref/errors.texi | 7 | ||||
| -rw-r--r-- | doc/lispref/tips.texi | 14 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 13 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/edebug.el | 67 | ||||
| -rw-r--r-- | lisp/emacs-lisp/subr-x.el | 8 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 5 | ||||
| -rw-r--r-- | lisp/tree-widget.el | 2 | ||||
| -rw-r--r-- | src/buffer.c | 2 | ||||
| -rw-r--r-- | src/bytecode.c | 6 | ||||
| -rw-r--r-- | src/data.c | 6 | ||||
| -rw-r--r-- | src/font.c | 9 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el | 4 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/edebug-tests.el | 14 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/subr-x-tests.el | 2 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 44 |
16 files changed, 143 insertions, 62 deletions
diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi index 1f67819c34e..cd22b70800d 100644 --- a/doc/lispref/errors.texi +++ b/doc/lispref/errors.texi | |||
| @@ -172,8 +172,11 @@ The message is @samp{Search failed}. @xref{Searching and Matching}. | |||
| 172 | 172 | ||
| 173 | @item setting-constant | 173 | @item setting-constant |
| 174 | The message is @samp{Attempt to set a constant symbol}. This happens | 174 | The message is @samp{Attempt to set a constant symbol}. This happens |
| 175 | when attempting to assign values to @code{nil}, @code{t}, and keyword | 175 | when attempting to assign values to @code{nil}, @code{t}, |
| 176 | symbols. @xref{Constant Variables}. | 176 | @code{most-positive-fixnum}, @code{most-negative-fixnum}, and keyword |
| 177 | symbols. It also happens when attempting to assign values to | ||
| 178 | @code{enable-multibyte-characters} and some other symbols whose direct | ||
| 179 | assignment is not allowed for some reason. @xref{Constant Variables}. | ||
| 177 | 180 | ||
| 178 | @c simple.el | 181 | @c simple.el |
| 179 | @item text-read-only | 182 | @item text-read-only |
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 17fd4a1027e..42a68677f58 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi | |||
| @@ -534,9 +534,17 @@ that you know @emph{will} be defined, use a @code{declare-function} | |||
| 534 | statement (@pxref{Declaring Functions}). | 534 | statement (@pxref{Declaring Functions}). |
| 535 | 535 | ||
| 536 | @item | 536 | @item |
| 537 | If you use many functions and variables from a certain file, you can | 537 | If you use many functions, macros, and variables from a certain file, |
| 538 | add a @code{require} for that package to avoid compilation warnings | 538 | you can add a @code{require} (@pxref{Named Features, require}) for |
| 539 | for them. For instance, | 539 | that package to avoid compilation warnings for them, like this: |
| 540 | |||
| 541 | @example | ||
| 542 | (require 'foo) | ||
| 543 | @end example | ||
| 544 | |||
| 545 | @noindent | ||
| 546 | If you need only macros from some file, you can require it only at | ||
| 547 | compile time (@pxref{Eval During Compile}). For instance, | ||
| 540 | 548 | ||
| 541 | @example | 549 | @example |
| 542 | (eval-when-compile | 550 | (eval-when-compile |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 99bbfc91243..a871352b004 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -139,6 +139,13 @@ Variables}). A @code{defconst} form serves to inform human readers | |||
| 139 | that you do not intend to change the value of a variable, but Emacs | 139 | that you do not intend to change the value of a variable, but Emacs |
| 140 | does not raise an error if you actually change it. | 140 | does not raise an error if you actually change it. |
| 141 | 141 | ||
| 142 | @cindex read-only variables | ||
| 143 | A small number of additional symbols are made read-only for various | ||
| 144 | practical reasons. These include @code{enable-multibyte-characters}, | ||
| 145 | @code{most-positive-fixnum}, @code{most-negative-fixnum}, and a few | ||
| 146 | others. Any attempt to set or bind these also signals a | ||
| 147 | @code{setting-constant} error. | ||
| 148 | |||
| 142 | @node Local Variables | 149 | @node Local Variables |
| 143 | @section Local Variables | 150 | @section Local Variables |
| 144 | @cindex binding local variables | 151 | @cindex binding local variables |
| @@ -1355,6 +1362,9 @@ is not current either on entry to or exit from the @code{let}. This is | |||
| 1355 | because @code{let} does not distinguish between different kinds of | 1362 | because @code{let} does not distinguish between different kinds of |
| 1356 | bindings; it knows only which variable the binding was made for. | 1363 | bindings; it knows only which variable the binding was made for. |
| 1357 | 1364 | ||
| 1365 | It is an error to make a constant or a read-only variable | ||
| 1366 | buffer-local. @xref{Constant Variables}. | ||
| 1367 | |||
| 1358 | If the variable is terminal-local (@pxref{Multiple Terminals}), this | 1368 | If the variable is terminal-local (@pxref{Multiple Terminals}), this |
| 1359 | function signals an error. Such variables cannot have buffer-local | 1369 | function signals an error. Such variables cannot have buffer-local |
| 1360 | bindings as well. | 1370 | bindings as well. |
| @@ -1394,6 +1404,9 @@ in a void buffer-local value and leave the default value unaffected. | |||
| 1394 | 1404 | ||
| 1395 | The value returned is @var{variable}. | 1405 | The value returned is @var{variable}. |
| 1396 | 1406 | ||
| 1407 | It is an error to make a constant or a read-only variable | ||
| 1408 | buffer-local. @xref{Constant Variables}. | ||
| 1409 | |||
| 1397 | @strong{Warning:} Don't assume that you should use | 1410 | @strong{Warning:} Don't assume that you should use |
| 1398 | @code{make-variable-buffer-local} for user-option variables, simply | 1411 | @code{make-variable-buffer-local} for user-option variables, simply |
| 1399 | because users @emph{might} want to customize them differently in | 1412 | because users @emph{might} want to customize them differently in |
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 10792aefdcc..f5311041cce 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -694,7 +694,7 @@ its argument list allows full Common Lisp conventions." | |||
| 694 | (defmacro cl-destructuring-bind (args expr &rest body) | 694 | (defmacro cl-destructuring-bind (args expr &rest body) |
| 695 | "Bind the variables in ARGS to the result of EXPR and execute BODY." | 695 | "Bind the variables in ARGS to the result of EXPR and execute BODY." |
| 696 | (declare (indent 2) | 696 | (declare (indent 2) |
| 697 | (debug (&define cl-macro-list def-form cl-declarations def-body))) | 697 | (debug (&define cl-macro-list1 def-form cl-declarations def-body))) |
| 698 | (let* ((cl--bind-lets nil) (cl--bind-forms nil) | 698 | (let* ((cl--bind-lets nil) (cl--bind-forms nil) |
| 699 | (cl--bind-defs nil) (cl--bind-block 'cl-none) (cl--bind-enquote nil)) | 699 | (cl--bind-defs nil) (cl--bind-block 'cl-none) (cl--bind-enquote nil)) |
| 700 | (cl--do-arglist (or args '(&aux)) expr) | 700 | (cl--do-arglist (or args '(&aux)) expr) |
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 0e8f77e29a8..dec986ae3e3 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -950,7 +950,8 @@ circular objects. Let `read' read everything else." | |||
| 950 | 950 | ||
| 951 | ;;; Cursors for traversal of list and vector elements with offsets. | 951 | ;;; Cursors for traversal of list and vector elements with offsets. |
| 952 | 952 | ||
| 953 | (defvar edebug-dotted-spec nil) | 953 | (defvar edebug-dotted-spec nil |
| 954 | "Set to t when matching after the dot in a dotted spec list.") | ||
| 954 | 955 | ||
| 955 | (defun edebug-new-cursor (expressions offsets) | 956 | (defun edebug-new-cursor (expressions offsets) |
| 956 | ;; Return a new cursor for EXPRESSIONS with OFFSETS. | 957 | ;; Return a new cursor for EXPRESSIONS with OFFSETS. |
| @@ -1526,8 +1527,6 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 1526 | 1527 | ||
| 1527 | ;;; Matching of specs. | 1528 | ;;; Matching of specs. |
| 1528 | 1529 | ||
| 1529 | (defvar edebug-after-dotted-spec nil) | ||
| 1530 | |||
| 1531 | (defvar edebug-matching-depth 0) ;; initial value | 1530 | (defvar edebug-matching-depth 0) ;; initial value |
| 1532 | 1531 | ||
| 1533 | 1532 | ||
| @@ -1588,36 +1587,48 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 1588 | (let ((edebug-dotted-spec t));; Containing spec list was dotted. | 1587 | (let ((edebug-dotted-spec t));; Containing spec list was dotted. |
| 1589 | (edebug-match-specs cursor (list specs) remainder-handler))) | 1588 | (edebug-match-specs cursor (list specs) remainder-handler))) |
| 1590 | 1589 | ||
| 1591 | ;; Is the form dotted? | 1590 | ;; The reason for processing here &optional, &rest, and vectors |
| 1592 | ((not (listp (edebug-cursor-expressions cursor)));; allow nil | 1591 | ;; which might contain them even when the form is dotted is to |
| 1592 | ;; allow them to match nothing, so we can advance to the dotted | ||
| 1593 | ;; part of the spec. | ||
| 1594 | ((or (listp (edebug-cursor-expressions cursor)) | ||
| 1595 | (vectorp (car specs)) | ||
| 1596 | (memq (car specs) '(&optional &rest))) ; Process normally. | ||
| 1597 | ;; (message "%scursor=%s specs=%s" | ||
| 1598 | ;; (make-string edebug-matching-depth ?|) cursor (car specs)) | ||
| 1599 | (let* ((spec (car specs)) | ||
| 1600 | (rest) | ||
| 1601 | (first-char (and (symbolp spec) (aref (symbol-name spec) 0))) | ||
| 1602 | (match (cond | ||
| 1603 | ((eq ?& first-char);; "&" symbols take all following specs. | ||
| 1604 | (funcall (get-edebug-spec spec) cursor (cdr specs))) | ||
| 1605 | ((eq ?: first-char);; ":" symbols take one following spec. | ||
| 1606 | (setq rest (cdr (cdr specs))) | ||
| 1607 | (funcall (get-edebug-spec spec) cursor (car (cdr specs)))) | ||
| 1608 | (t;; Any other normal spec. | ||
| 1609 | (setq rest (cdr specs)) | ||
| 1610 | (edebug-match-one-spec cursor spec))))) | ||
| 1611 | ;; The first match result may not be a list, which can happen | ||
| 1612 | ;; when matching the tail of a dotted list. In that case | ||
| 1613 | ;; there is no remainder. | ||
| 1614 | (if (listp match) | ||
| 1615 | (nconc match | ||
| 1616 | (funcall remainder-handler cursor rest remainder-handler)) | ||
| 1617 | match))) | ||
| 1618 | |||
| 1619 | ;; Must be a dotted form, with no remaining &rest or &optional specs to | ||
| 1620 | ;; match. | ||
| 1621 | (t | ||
| 1593 | (if (not edebug-dotted-spec) | 1622 | (if (not edebug-dotted-spec) |
| 1594 | (edebug-no-match cursor "Dotted spec required.")) | 1623 | (edebug-no-match cursor "Dotted spec required.")) |
| 1595 | ;; Cancel dotted spec and dotted form. | 1624 | ;; Cancel dotted spec and dotted form. |
| 1596 | (let ((edebug-dotted-spec) | 1625 | (let ((edebug-dotted-spec) |
| 1597 | (this-form (edebug-cursor-expressions cursor)) | 1626 | (this-form (edebug-cursor-expressions cursor)) |
| 1598 | (this-offset (edebug-cursor-offsets cursor))) | 1627 | (this-offset (edebug-cursor-offsets cursor))) |
| 1599 | ;; Wrap the form in a list, (by changing the cursor??)... | 1628 | ;; Wrap the form in a list, by changing the cursor. |
| 1600 | (edebug-set-cursor cursor (list this-form) this-offset) | 1629 | (edebug-set-cursor cursor (list this-form) this-offset) |
| 1601 | ;; and process normally, then unwrap the result. | 1630 | ;; Process normally, then unwrap the result. |
| 1602 | (car (edebug-match-specs cursor specs remainder-handler)))) | 1631 | (car (edebug-match-specs cursor specs remainder-handler))))))) |
| 1603 | |||
| 1604 | (t;; Process normally. | ||
| 1605 | (let* ((spec (car specs)) | ||
| 1606 | (rest) | ||
| 1607 | (first-char (and (symbolp spec) (aref (symbol-name spec) 0)))) | ||
| 1608 | ;;(message "spec = %s first char = %s" spec first-char) (sit-for 1) | ||
| 1609 | (nconc | ||
| 1610 | (cond | ||
| 1611 | ((eq ?& first-char);; "&" symbols take all following specs. | ||
| 1612 | (funcall (get-edebug-spec spec) cursor (cdr specs))) | ||
| 1613 | ((eq ?: first-char);; ":" symbols take one following spec. | ||
| 1614 | (setq rest (cdr (cdr specs))) | ||
| 1615 | (funcall (get-edebug-spec spec) cursor (car (cdr specs)))) | ||
| 1616 | (t;; Any other normal spec. | ||
| 1617 | (setq rest (cdr specs)) | ||
| 1618 | (edebug-match-one-spec cursor spec))) | ||
| 1619 | (funcall remainder-handler cursor rest remainder-handler))))))) | ||
| 1620 | |||
| 1621 | 1632 | ||
| 1622 | ;; Define specs for all the symbol specs with functions used to process them. | 1633 | ;; Define specs for all the symbol specs with functions used to process them. |
| 1623 | ;; Perhaps we shouldn't be doing this with edebug-form-specs since the | 1634 | ;; Perhaps we shouldn't be doing this with edebug-form-specs since the |
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 9ff742c4331..37bcfc2003d 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el | |||
| @@ -133,7 +133,7 @@ be of the form (VALUEFORM), which is evaluated and checked for | |||
| 133 | nil; i.e. SYMBOL can be omitted if only the test result is of | 133 | nil; i.e. SYMBOL can be omitted if only the test result is of |
| 134 | interest." | 134 | interest." |
| 135 | (declare (indent 2) | 135 | (declare (indent 2) |
| 136 | (debug ((&rest [&or symbolp (symbolp form) (sexp)]) | 136 | (debug ((&rest [&or symbolp (symbolp form) (form)]) |
| 137 | form body))) | 137 | form body))) |
| 138 | (if varlist | 138 | (if varlist |
| 139 | `(let* ,(setq varlist (internal--build-bindings varlist)) | 139 | `(let* ,(setq varlist (internal--build-bindings varlist)) |
| @@ -156,7 +156,9 @@ VARLIST is the same as in `if-let*'." | |||
| 156 | "Bind variables according to VARLIST and conditionally eval BODY. | 156 | "Bind variables according to VARLIST and conditionally eval BODY. |
| 157 | Like `when-let*', except if BODY is empty and all the bindings | 157 | Like `when-let*', except if BODY is empty and all the bindings |
| 158 | are non-nil, then the result is non-nil." | 158 | are non-nil, then the result is non-nil." |
| 159 | (declare (indent 1) (debug when-let*)) | 159 | (declare (indent 1) |
| 160 | (debug ((&rest [&or symbolp (symbolp form) (form)]) | ||
| 161 | body))) | ||
| 160 | (let (res) | 162 | (let (res) |
| 161 | (if varlist | 163 | (if varlist |
| 162 | `(let* ,(setq varlist (internal--build-bindings varlist)) | 164 | `(let* ,(setq varlist (internal--build-bindings varlist)) |
| @@ -168,7 +170,7 @@ are non-nil, then the result is non-nil." | |||
| 168 | "Bind variables according to SPEC and eval THEN or ELSE. | 170 | "Bind variables according to SPEC and eval THEN or ELSE. |
| 169 | Like `if-let*' except SPEC can have the form (SYMBOL VALUEFORM)." | 171 | Like `if-let*' except SPEC can have the form (SYMBOL VALUEFORM)." |
| 170 | (declare (indent 2) | 172 | (declare (indent 2) |
| 171 | (debug ([&or (&rest [&or symbolp (symbolp form) (sexp)]) | 173 | (debug ([&or (&rest [&or symbolp (symbolp form) (form)]) |
| 172 | (symbolp form)] | 174 | (symbolp form)] |
| 173 | form body)) | 175 | form body)) |
| 174 | (obsolete "use `if-let*' instead." "26.1")) | 176 | (obsolete "use `if-let*' instead." "26.1")) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e8d11584fab..cf2218dd1ec 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1055,7 +1055,7 @@ Also see `tramp-file-name-structure'.") | |||
| 1055 | "\\(-\\|[^/|:]\\{2,\\}\\)" | 1055 | "\\(-\\|[^/|:]\\{2,\\}\\)" |
| 1056 | ;; At least one character for method. | 1056 | ;; At least one character for method. |
| 1057 | "[^/|:]+") | 1057 | "[^/|:]+") |
| 1058 | ":\\'") | 1058 | ":") |
| 1059 | "Regular expression matching file names handled by Tramp autoload. | 1059 | "Regular expression matching file names handled by Tramp autoload. |
| 1060 | It must match the initial `tramp-syntax' settings. It should not | 1060 | It must match the initial `tramp-syntax' settings. It should not |
| 1061 | match file names at root of the underlying local file system, | 1061 | match file names at root of the underlying local file system, |
| @@ -2323,8 +2323,7 @@ Falls back to normal file name handler if no Tramp file name handler exists." | |||
| 2323 | 'tramp-autoload-file-name-handler)) | 2323 | 'tramp-autoload-file-name-handler)) |
| 2324 | (put 'tramp-autoload-file-name-handler 'safe-magic t))) | 2324 | (put 'tramp-autoload-file-name-handler 'safe-magic t))) |
| 2325 | 2325 | ||
| 2326 | ;;;###autoload | 2326 | ;;;###autoload (tramp-register-autoload-file-name-handlers) |
| 2327 | (tramp-register-autoload-file-name-handlers) | ||
| 2328 | 2327 | ||
| 2329 | (defun tramp-use-absolute-autoload-file-names () | 2328 | (defun tramp-use-absolute-autoload-file-names () |
| 2330 | "Change Tramp autoload objects to use absolute file names. | 2329 | "Change Tramp autoload objects to use absolute file names. |
diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el index 130d8af07e5..9599cc7f067 100644 --- a/lisp/tree-widget.el +++ b/lisp/tree-widget.el | |||
| @@ -504,7 +504,7 @@ Handle mouse button 1 click on buttons.") | |||
| 504 | 504 | ||
| 505 | (define-widget 'tree-widget-end-guide 'item | 505 | (define-widget 'tree-widget-end-guide 'item |
| 506 | "End of a vertical guide line." | 506 | "End of a vertical guide line." |
| 507 | :tag " `" | 507 | :tag " \\=`" |
| 508 | ;;:tag-glyph (tree-widget-find-image "end-guide") | 508 | ;;:tag-glyph (tree-widget-find-image "end-guide") |
| 509 | :format "%t" | 509 | :format "%t" |
| 510 | ) | 510 | ) |
diff --git a/src/buffer.c b/src/buffer.c index 6e3412c3d05..c6f9eb28e25 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5620,6 +5620,8 @@ file I/O and the behavior of various editing commands. | |||
| 5620 | 5620 | ||
| 5621 | This variable is buffer-local but you cannot set it directly; | 5621 | This variable is buffer-local but you cannot set it directly; |
| 5622 | use the function `set-buffer-multibyte' to change a buffer's representation. | 5622 | use the function `set-buffer-multibyte' to change a buffer's representation. |
| 5623 | To prevent any attempts to set it or make it buffer-local, Emacs will | ||
| 5624 | signal an error in those cases. | ||
| 5623 | See also Info node `(elisp)Text Representations'. */); | 5625 | See also Info node `(elisp)Text Representations'. */); |
| 5624 | make_symbol_constant (intern_c_string ("enable-multibyte-characters")); | 5626 | make_symbol_constant (intern_c_string ("enable-multibyte-characters")); |
| 5625 | 5627 | ||
diff --git a/src/bytecode.c b/src/bytecode.c index ebaf3c3a7fc..8746568f166 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -1346,10 +1346,8 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 1346 | /* Actually this is Bstack_ref with offset 0, but we use Bdup | 1346 | /* Actually this is Bstack_ref with offset 0, but we use Bdup |
| 1347 | for that instead. */ | 1347 | for that instead. */ |
| 1348 | /* CASE (Bstack_ref): */ | 1348 | /* CASE (Bstack_ref): */ |
| 1349 | call3 (Qerror, | 1349 | error ("Invalid byte opcode: op=%d, ptr=%"pD"d", |
| 1350 | build_string ("Invalid byte opcode: op=%s, ptr=%d"), | 1350 | op, pc - 1 - bytestr_data); |
| 1351 | make_number (op), | ||
| 1352 | make_number (pc - 1 - bytestr_data)); | ||
| 1353 | 1351 | ||
| 1354 | /* Handy byte-codes for lexical binding. */ | 1352 | /* Handy byte-codes for lexical binding. */ |
| 1355 | CASE (Bstack_ref1): | 1353 | CASE (Bstack_ref1): |
diff --git a/src/data.c b/src/data.c index 7ca1892f64a..3c9152049b7 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -3896,12 +3896,14 @@ syms_of_data (void) | |||
| 3896 | set_symbol_function (Qwholenump, XSYMBOL (Qnatnump)->u.s.function); | 3896 | set_symbol_function (Qwholenump, XSYMBOL (Qnatnump)->u.s.function); |
| 3897 | 3897 | ||
| 3898 | DEFVAR_LISP ("most-positive-fixnum", Vmost_positive_fixnum, | 3898 | DEFVAR_LISP ("most-positive-fixnum", Vmost_positive_fixnum, |
| 3899 | doc: /* The largest value that is representable in a Lisp integer. */); | 3899 | doc: /* The largest value that is representable in a Lisp integer. |
| 3900 | This variable cannot be set; trying to do so will signal an error. */); | ||
| 3900 | Vmost_positive_fixnum = make_number (MOST_POSITIVE_FIXNUM); | 3901 | Vmost_positive_fixnum = make_number (MOST_POSITIVE_FIXNUM); |
| 3901 | make_symbol_constant (intern_c_string ("most-positive-fixnum")); | 3902 | make_symbol_constant (intern_c_string ("most-positive-fixnum")); |
| 3902 | 3903 | ||
| 3903 | DEFVAR_LISP ("most-negative-fixnum", Vmost_negative_fixnum, | 3904 | DEFVAR_LISP ("most-negative-fixnum", Vmost_negative_fixnum, |
| 3904 | doc: /* The smallest value that is representable in a Lisp integer. */); | 3905 | doc: /* The smallest value that is representable in a Lisp integer. |
| 3906 | This variable cannot be set; trying to do so will signal an error. */); | ||
| 3905 | Vmost_negative_fixnum = make_number (MOST_NEGATIVE_FIXNUM); | 3907 | Vmost_negative_fixnum = make_number (MOST_NEGATIVE_FIXNUM); |
| 3906 | make_symbol_constant (intern_c_string ("most-negative-fixnum")); | 3908 | make_symbol_constant (intern_c_string ("most-negative-fixnum")); |
| 3907 | 3909 | ||
diff --git a/src/font.c b/src/font.c index 51625b49fa8..f7cebdce78c 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -5421,19 +5421,22 @@ gets the repertory information by an opened font and ENCODING. */); | |||
| 5421 | doc: /* Vector of valid font weight values. | 5421 | doc: /* Vector of valid font weight values. |
| 5422 | Each element has the form: | 5422 | Each element has the form: |
| 5423 | [NUMERIC-VALUE SYMBOLIC-NAME ALIAS-NAME ...] | 5423 | [NUMERIC-VALUE SYMBOLIC-NAME ALIAS-NAME ...] |
| 5424 | NUMERIC-VALUE is an integer, and SYMBOLIC-NAME and ALIAS-NAME are symbols. */); | 5424 | NUMERIC-VALUE is an integer, and SYMBOLIC-NAME and ALIAS-NAME are symbols. |
| 5425 | This variable cannot be set; trying to do so will signal an error. */); | ||
| 5425 | Vfont_weight_table = BUILD_STYLE_TABLE (weight_table); | 5426 | Vfont_weight_table = BUILD_STYLE_TABLE (weight_table); |
| 5426 | make_symbol_constant (intern_c_string ("font-weight-table")); | 5427 | make_symbol_constant (intern_c_string ("font-weight-table")); |
| 5427 | 5428 | ||
| 5428 | DEFVAR_LISP_NOPRO ("font-slant-table", Vfont_slant_table, | 5429 | DEFVAR_LISP_NOPRO ("font-slant-table", Vfont_slant_table, |
| 5429 | doc: /* Vector of font slant symbols vs the corresponding numeric values. | 5430 | doc: /* Vector of font slant symbols vs the corresponding numeric values. |
| 5430 | See `font-weight-table' for the format of the vector. */); | 5431 | See `font-weight-table' for the format of the vector. |
| 5432 | This variable cannot be set; trying to do so will signal an error. */); | ||
| 5431 | Vfont_slant_table = BUILD_STYLE_TABLE (slant_table); | 5433 | Vfont_slant_table = BUILD_STYLE_TABLE (slant_table); |
| 5432 | make_symbol_constant (intern_c_string ("font-slant-table")); | 5434 | make_symbol_constant (intern_c_string ("font-slant-table")); |
| 5433 | 5435 | ||
| 5434 | DEFVAR_LISP_NOPRO ("font-width-table", Vfont_width_table, | 5436 | DEFVAR_LISP_NOPRO ("font-width-table", Vfont_width_table, |
| 5435 | doc: /* Alist of font width symbols vs the corresponding numeric values. | 5437 | doc: /* Alist of font width symbols vs the corresponding numeric values. |
| 5436 | See `font-weight-table' for the format of the vector. */); | 5438 | See `font-weight-table' for the format of the vector. |
| 5439 | This variable cannot be set; trying to do so will signal an error. */); | ||
| 5437 | Vfont_width_table = BUILD_STYLE_TABLE (width_table); | 5440 | Vfont_width_table = BUILD_STYLE_TABLE (width_table); |
| 5438 | make_symbol_constant (intern_c_string ("font-width-table")); | 5441 | make_symbol_constant (intern_c_string ("font-width-table")); |
| 5439 | 5442 | ||
diff --git a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el index f52a2b1896c..ca49dcd213d 100644 --- a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el +++ b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el | |||
| @@ -126,5 +126,9 @@ | |||
| 126 | !start!(with-current-buffer (get-buffer-create "*edebug-test-code-buffer*") | 126 | !start!(with-current-buffer (get-buffer-create "*edebug-test-code-buffer*") |
| 127 | !body!(format "current-buffer: %s" (current-buffer)))) | 127 | !body!(format "current-buffer: %s" (current-buffer)))) |
| 128 | 128 | ||
| 129 | (defun edebug-test-code-use-destructuring-bind () | ||
| 130 | (let ((two 2) (three 3)) | ||
| 131 | (cl-destructuring-bind (x . y) (cons two three) (+ x!x! y!y!)))) | ||
| 132 | |||
| 129 | (provide 'edebug-test-code) | 133 | (provide 'edebug-test-code) |
| 130 | ;;; edebug-test-code.el ends here | 134 | ;;; edebug-test-code.el ends here |
diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el index 02f4d1c5abe..f6c016cdf80 100644 --- a/test/lisp/emacs-lisp/edebug-tests.el +++ b/test/lisp/emacs-lisp/edebug-tests.el | |||
| @@ -899,5 +899,19 @@ test and possibly others should be updated." | |||
| 899 | "@g" (should (equal edebug-tests-@-result | 899 | "@g" (should (equal edebug-tests-@-result |
| 900 | '(#("abcd" 1 3 (face italic)) 511)))))) | 900 | '(#("abcd" 1 3 (face italic)) 511)))))) |
| 901 | 901 | ||
| 902 | (ert-deftest edebug-tests-dotted-forms () | ||
| 903 | "Edebug can instrument code matching the tail of a dotted spec (Bug#6415)." | ||
| 904 | (edebug-tests-with-normal-env | ||
| 905 | (edebug-tests-setup-@ "use-destructuring-bind" nil t) | ||
| 906 | (edebug-tests-run-kbd-macro | ||
| 907 | "@ SPC SPC SPC SPC SPC SPC" | ||
| 908 | (edebug-tests-should-be-at "use-destructuring-bind" "x") | ||
| 909 | (edebug-tests-should-match-result-in-messages "2 (#o2, #x2, ?\\C-b)") | ||
| 910 | "SPC" | ||
| 911 | (edebug-tests-should-be-at "use-destructuring-bind" "y") | ||
| 912 | (edebug-tests-should-match-result-in-messages "3 (#o3, #x3, ?\\C-c)") | ||
| 913 | "g" | ||
| 914 | (should (equal edebug-tests-@-result 5))))) | ||
| 915 | |||
| 902 | (provide 'edebug-tests) | 916 | (provide 'edebug-tests) |
| 903 | ;;; edebug-tests.el ends here | 917 | ;;; edebug-tests.el ends here |
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el index 0e8871d9a9c..0187f39d15d 100644 --- a/test/lisp/emacs-lisp/subr-x-tests.el +++ b/test/lisp/emacs-lisp/subr-x-tests.el | |||
| @@ -403,7 +403,7 @@ | |||
| 403 | (should-error (eval '(and-let* (nil (x 1))) lexical-binding) | 403 | (should-error (eval '(and-let* (nil (x 1))) lexical-binding) |
| 404 | :type 'setting-constant) | 404 | :type 'setting-constant) |
| 405 | (should (equal nil (and-let* ((nil) (x 1))))) | 405 | (should (equal nil (and-let* ((nil) (x 1))))) |
| 406 | (should-error (eval (and-let* (2 (x 1))) lexical-binding) | 406 | (should-error (eval '(and-let* (2 (x 1))) lexical-binding) |
| 407 | :type 'wrong-type-argument) | 407 | :type 'wrong-type-argument) |
| 408 | (should (equal 1 (and-let* ((2) (x 1))))) | 408 | (should (equal 1 (and-let* ((2) (x 1))))) |
| 409 | (should (equal 2 (and-let* ((x 1) (2))))) | 409 | (should (equal 2 (and-let* ((x 1) (2))))) |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index efc2c578d59..8310003d9b1 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -3627,11 +3627,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3627 | (skip-unless (tramp--test-enabled)) | 3627 | (skip-unless (tramp--test-enabled)) |
| 3628 | ;; We test it only for the mock-up connection; otherwise there might | 3628 | ;; We test it only for the mock-up connection; otherwise there might |
| 3629 | ;; be problems with the used ports. | 3629 | ;; be problems with the used ports. |
| 3630 | (skip-unless | 3630 | (skip-unless (and (eq tramp-syntax 'default) |
| 3631 | (and | 3631 | (tramp--test-mock-p))) |
| 3632 | (eq tramp-syntax 'default) | ||
| 3633 | (string-equal | ||
| 3634 | "mock" (file-remote-p tramp-test-temporary-file-directory 'method)))) | ||
| 3635 | 3632 | ||
| 3636 | ;; We force a reconnect, in order to have a clean environment. | 3633 | ;; We force a reconnect, in order to have a clean environment. |
| 3637 | (dolist (dir `(,tramp-test-temporary-file-directory | 3634 | (dolist (dir `(,tramp-test-temporary-file-directory |
| @@ -4041,6 +4038,12 @@ Several special characters do not work properly there." | |||
| 4041 | (file-truename tramp-test-temporary-file-directory) nil | 4038 | (file-truename tramp-test-temporary-file-directory) nil |
| 4042 | (string-match "^HP-UX" (tramp-get-connection-property v "uname" "")))) | 4039 | (string-match "^HP-UX" (tramp-get-connection-property v "uname" "")))) |
| 4043 | 4040 | ||
| 4041 | (defun tramp--test-mock-p () | ||
| 4042 | "Check, whether the mock method is used. | ||
| 4043 | This does not support external Emacs calls." | ||
| 4044 | (string-equal | ||
| 4045 | "mock" (file-remote-p tramp-test-temporary-file-directory 'method))) | ||
| 4046 | |||
| 4044 | (defun tramp--test-rsync-p () | 4047 | (defun tramp--test-rsync-p () |
| 4045 | "Check, whether the rsync method is used. | 4048 | "Check, whether the rsync method is used. |
| 4046 | This does not support special file names." | 4049 | This does not support special file names." |
| @@ -4496,8 +4499,7 @@ process sentinels. They shall not disturb each other." | |||
| 4496 | ;; We must distinguish due to performance reasons. | 4499 | ;; We must distinguish due to performance reasons. |
| 4497 | (timer-operation | 4500 | (timer-operation |
| 4498 | (cond | 4501 | (cond |
| 4499 | ((string-equal "mock" (file-remote-p tmp-name 'method)) | 4502 | ((tramp--test-mock-p) 'vc-registered) |
| 4500 | 'vc-registered) | ||
| 4501 | (t 'file-attributes))) | 4503 | (t 'file-attributes))) |
| 4502 | timer buffers kill-buffer-query-functions) | 4504 | timer buffers kill-buffer-query-functions) |
| 4503 | 4505 | ||
| @@ -4615,7 +4617,27 @@ process sentinels. They shall not disturb each other." | |||
| 4615 | (ignore-errors (cancel-timer timer)) | 4617 | (ignore-errors (cancel-timer timer)) |
| 4616 | (ignore-errors (delete-directory tmp-name 'recursive))))))) | 4618 | (ignore-errors (delete-directory tmp-name 'recursive))))))) |
| 4617 | 4619 | ||
| 4618 | (ert-deftest tramp-test42-recursive-load () | 4620 | (ert-deftest tramp-test42-auto-load () |
| 4621 | "Check that Tramp autoloads properly." | ||
| 4622 | (skip-unless (tramp--test-enabled)) | ||
| 4623 | (skip-unless (not (tramp--test-mock-p))) | ||
| 4624 | |||
| 4625 | (let ((default-directory (expand-file-name temporary-file-directory))) | ||
| 4626 | (let ((code | ||
| 4627 | (format | ||
| 4628 | "(message \"Tramp loaded: %%s\" (consp (file-attributes \"%s\")))" | ||
| 4629 | tramp-test-temporary-file-directory))) | ||
| 4630 | (should | ||
| 4631 | (string-match | ||
| 4632 | "Tramp loaded: t[\n\r]+" | ||
| 4633 | (shell-command-to-string | ||
| 4634 | (format | ||
| 4635 | "%s -batch -Q -L %s --eval %s" | ||
| 4636 | (expand-file-name invocation-name invocation-directory) | ||
| 4637 | (mapconcat 'shell-quote-argument load-path " -L ") | ||
| 4638 | (shell-quote-argument code)))))))) | ||
| 4639 | |||
| 4640 | (ert-deftest tramp-test43-recursive-load () | ||
| 4619 | "Check that Tramp does not fail due to recursive load." | 4641 | "Check that Tramp does not fail due to recursive load." |
| 4620 | (skip-unless (tramp--test-enabled)) | 4642 | (skip-unless (tramp--test-enabled)) |
| 4621 | 4643 | ||
| @@ -4638,7 +4660,7 @@ process sentinels. They shall not disturb each other." | |||
| 4638 | (mapconcat 'shell-quote-argument load-path " -L ") | 4660 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4639 | (shell-quote-argument code)))))))) | 4661 | (shell-quote-argument code)))))))) |
| 4640 | 4662 | ||
| 4641 | (ert-deftest tramp-test43-remote-load-path () | 4663 | (ert-deftest tramp-test44-remote-load-path () |
| 4642 | "Check that Tramp autoloads its packages with remote `load-path'." | 4664 | "Check that Tramp autoloads its packages with remote `load-path'." |
| 4643 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. | 4665 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. |
| 4644 | ;; It shall still work, when a remote file name is in the | 4666 | ;; It shall still work, when a remote file name is in the |
| @@ -4661,7 +4683,7 @@ process sentinels. They shall not disturb each other." | |||
| 4661 | (mapconcat 'shell-quote-argument load-path " -L ") | 4683 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4662 | (shell-quote-argument code))))))) | 4684 | (shell-quote-argument code))))))) |
| 4663 | 4685 | ||
| 4664 | (ert-deftest tramp-test44-delay-load () | 4686 | (ert-deftest tramp-test45-delay-load () |
| 4665 | "Check that Tramp is loaded lazily, only when needed." | 4687 | "Check that Tramp is loaded lazily, only when needed." |
| 4666 | ;; Tramp is neither loaded at Emacs startup, nor when completing a | 4688 | ;; Tramp is neither loaded at Emacs startup, nor when completing a |
| 4667 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file | 4689 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file |
| @@ -4688,7 +4710,7 @@ process sentinels. They shall not disturb each other." | |||
| 4688 | (mapconcat 'shell-quote-argument load-path " -L ") | 4710 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4689 | (shell-quote-argument (format code tm))))))))) | 4711 | (shell-quote-argument (format code tm))))))))) |
| 4690 | 4712 | ||
| 4691 | (ert-deftest tramp-test45-unload () | 4713 | (ert-deftest tramp-test46-unload () |
| 4692 | "Check that Tramp and its subpackages unload completely. | 4714 | "Check that Tramp and its subpackages unload completely. |
| 4693 | Since it unloads Tramp, it shall be the last test to run." | 4715 | Since it unloads Tramp, it shall be the last test to run." |
| 4694 | :tags '(:expensive-test) | 4716 | :tags '(:expensive-test) |