summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2017-11-29 17:12:05 -0800
committerGlenn Morris <rgm@gnu.org>2017-11-29 17:12:05 -0800
commit7aedb6116ffaa6590c86e70380f533385c1ced58 (patch)
tree186436d57261f5bd0e5f1bff8844615c17b46128 /lisp
parent728d259243206136387b6b59c2efb7de8cd9f6ed (diff)
parent02d114d6b85e02132d5f99ead517b69dbdd77e35 (diff)
downloademacs-7aedb6116ffaa6590c86e70380f533385c1ced58.tar.gz
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
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el2
-rw-r--r--lisp/emacs-lisp/edebug.el67
-rw-r--r--lisp/emacs-lisp/subr-x.el8
-rw-r--r--lisp/net/tramp.el5
-rw-r--r--lisp/tree-widget.el2
5 files changed, 48 insertions, 36 deletions
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."
(defmacro cl-destructuring-bind (args expr &rest body)
"Bind the variables in ARGS to the result of EXPR and execute BODY."
(declare (indent 2)
- (debug (&define cl-macro-list def-form cl-declarations def-body)))
+ (debug (&define cl-macro-list1 def-form cl-declarations def-body)))
(let* ((cl--bind-lets nil) (cl--bind-forms nil)
(cl--bind-defs nil) (cl--bind-block 'cl-none) (cl--bind-enquote nil))
(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."
;;; Cursors for traversal of list and vector elements with offsets.
-(defvar edebug-dotted-spec nil)
+(defvar edebug-dotted-spec nil
+ "Set to t when matching after the dot in a dotted spec list.")
(defun edebug-new-cursor (expressions offsets)
;; Return a new cursor for EXPRESSIONS with OFFSETS.
@@ -1526,8 +1527,6 @@ expressions; a `progn' form will be returned enclosing these forms."
;;; Matching of specs.
-(defvar edebug-after-dotted-spec nil)
-
(defvar edebug-matching-depth 0) ;; initial value
@@ -1588,36 +1587,48 @@ expressions; a `progn' form will be returned enclosing these forms."
(let ((edebug-dotted-spec t));; Containing spec list was dotted.
(edebug-match-specs cursor (list specs) remainder-handler)))
- ;; Is the form dotted?
- ((not (listp (edebug-cursor-expressions cursor)));; allow nil
+ ;; The reason for processing here &optional, &rest, and vectors
+ ;; which might contain them even when the form is dotted is to
+ ;; allow them to match nothing, so we can advance to the dotted
+ ;; part of the spec.
+ ((or (listp (edebug-cursor-expressions cursor))
+ (vectorp (car specs))
+ (memq (car specs) '(&optional &rest))) ; Process normally.
+ ;; (message "%scursor=%s specs=%s"
+ ;; (make-string edebug-matching-depth ?|) cursor (car specs))
+ (let* ((spec (car specs))
+ (rest)
+ (first-char (and (symbolp spec) (aref (symbol-name spec) 0)))
+ (match (cond
+ ((eq ?& first-char);; "&" symbols take all following specs.
+ (funcall (get-edebug-spec spec) cursor (cdr specs)))
+ ((eq ?: first-char);; ":" symbols take one following spec.
+ (setq rest (cdr (cdr specs)))
+ (funcall (get-edebug-spec spec) cursor (car (cdr specs))))
+ (t;; Any other normal spec.
+ (setq rest (cdr specs))
+ (edebug-match-one-spec cursor spec)))))
+ ;; The first match result may not be a list, which can happen
+ ;; when matching the tail of a dotted list. In that case
+ ;; there is no remainder.
+ (if (listp match)
+ (nconc match
+ (funcall remainder-handler cursor rest remainder-handler))
+ match)))
+
+ ;; Must be a dotted form, with no remaining &rest or &optional specs to
+ ;; match.
+ (t
(if (not edebug-dotted-spec)
(edebug-no-match cursor "Dotted spec required."))
;; Cancel dotted spec and dotted form.
(let ((edebug-dotted-spec)
- (this-form (edebug-cursor-expressions cursor))
- (this-offset (edebug-cursor-offsets cursor)))
- ;; Wrap the form in a list, (by changing the cursor??)...
+ (this-form (edebug-cursor-expressions cursor))
+ (this-offset (edebug-cursor-offsets cursor)))
+ ;; Wrap the form in a list, by changing the cursor.
(edebug-set-cursor cursor (list this-form) this-offset)
- ;; and process normally, then unwrap the result.
- (car (edebug-match-specs cursor specs remainder-handler))))
-
- (t;; Process normally.
- (let* ((spec (car specs))
- (rest)
- (first-char (and (symbolp spec) (aref (symbol-name spec) 0))))
- ;;(message "spec = %s first char = %s" spec first-char) (sit-for 1)
- (nconc
- (cond
- ((eq ?& first-char);; "&" symbols take all following specs.
- (funcall (get-edebug-spec spec) cursor (cdr specs)))
- ((eq ?: first-char);; ":" symbols take one following spec.
- (setq rest (cdr (cdr specs)))
- (funcall (get-edebug-spec spec) cursor (car (cdr specs))))
- (t;; Any other normal spec.
- (setq rest (cdr specs))
- (edebug-match-one-spec cursor spec)))
- (funcall remainder-handler cursor rest remainder-handler)))))))
-
+ ;; Process normally, then unwrap the result.
+ (car (edebug-match-specs cursor specs remainder-handler)))))))
;; Define specs for all the symbol specs with functions used to process them.
;; 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
nil; i.e. SYMBOL can be omitted if only the test result is of
interest."
(declare (indent 2)
- (debug ((&rest [&or symbolp (symbolp form) (sexp)])
+ (debug ((&rest [&or symbolp (symbolp form) (form)])
form body)))
(if varlist
`(let* ,(setq varlist (internal--build-bindings varlist))
@@ -156,7 +156,9 @@ VARLIST is the same as in `if-let*'."
"Bind variables according to VARLIST and conditionally eval BODY.
Like `when-let*', except if BODY is empty and all the bindings
are non-nil, then the result is non-nil."
- (declare (indent 1) (debug when-let*))
+ (declare (indent 1)
+ (debug ((&rest [&or symbolp (symbolp form) (form)])
+ body)))
(let (res)
(if varlist
`(let* ,(setq varlist (internal--build-bindings varlist))
@@ -168,7 +170,7 @@ are non-nil, then the result is non-nil."
"Bind variables according to SPEC and eval THEN or ELSE.
Like `if-let*' except SPEC can have the form (SYMBOL VALUEFORM)."
(declare (indent 2)
- (debug ([&or (&rest [&or symbolp (symbolp form) (sexp)])
+ (debug ([&or (&rest [&or symbolp (symbolp form) (form)])
(symbolp form)]
form body))
(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'.")
"\\(-\\|[^/|:]\\{2,\\}\\)"
;; At least one character for method.
"[^/|:]+")
- ":\\'")
+ ":")
"Regular expression matching file names handled by Tramp autoload.
It must match the initial `tramp-syntax' settings. It should not
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."
'tramp-autoload-file-name-handler))
(put 'tramp-autoload-file-name-handler 'safe-magic t)))
-;;;###autoload
-(tramp-register-autoload-file-name-handlers)
+;;;###autoload (tramp-register-autoload-file-name-handlers)
(defun tramp-use-absolute-autoload-file-names ()
"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.")
(define-widget 'tree-widget-end-guide 'item
"End of a vertical guide line."
- :tag " `"
+ :tag " \\=`"
;;:tag-glyph (tree-widget-find-image "end-guide")
:format "%t"
)