@@ -4529,96 +4529,25 @@ binding slots have been popped."
4529
4529
; ; (byte-defop-compiler-1 save-window-excursion) ;Obsolete: now a macro.
4530
4530
; ; (byte-defop-compiler-1 with-output-to-temp-buffer) ;Obsolete: now a macro.
4531
4531
4532
- (defvar byte-compile--use-old-handlers nil
4533
- " If nil, use new byte codes introduced in Emacs-24.4." )
4534
-
4535
4532
(defun byte-compile-catch (form )
4536
4533
(byte-compile-form (car (cdr form)))
4537
- (if (not byte-compile--use-old-handlers)
4538
- (let ((endtag (byte-compile-make-tag )))
4539
- (byte-compile-goto 'byte-pushcatch endtag)
4540
- (byte-compile-body (cddr form) nil )
4541
- (byte-compile-out 'byte-pophandler )
4542
- (byte-compile-out-tag endtag))
4543
- (pcase (cddr form)
4544
- (`(:fun-body , f )
4545
- (byte-compile-form `(list 'funcall , f )))
4546
- (body
4547
- (byte-compile-push-constant
4548
- (byte-compile-top-level (cons 'progn body) byte-compile--for-effect))))
4549
- (byte-compile-out 'byte-catch 0 )))
4534
+ (let ((endtag (byte-compile-make-tag )))
4535
+ (byte-compile-goto 'byte-pushcatch endtag)
4536
+ (byte-compile-body (cddr form) nil )
4537
+ (byte-compile-out 'byte-pophandler )
4538
+ (byte-compile-out-tag endtag)))
4550
4539
4551
4540
(defun byte-compile-unwind-protect (form )
4552
4541
(pcase (cddr form)
4553
4542
(`(:fun-body , f )
4554
- (byte-compile-form
4555
- (if byte-compile--use-old-handlers `(list (list 'funcall , f )) f)))
4543
+ (byte-compile-form f))
4556
4544
(handlers
4557
- (if byte-compile--use-old-handlers
4558
- (byte-compile-push-constant
4559
- (byte-compile-top-level-body handlers t ))
4560
- (byte-compile-form `#'(lambda () ,@handlers )))))
4545
+ (byte-compile-form `#'(lambda () ,@handlers ))))
4561
4546
(byte-compile-out 'byte-unwind-protect 0 )
4562
4547
(byte-compile-form-do-effect (car (cdr form)))
4563
4548
(byte-compile-out 'byte-unbind 1 ))
4564
4549
4565
4550
(defun byte-compile-condition-case (form )
4566
- (if byte-compile--use-old-handlers
4567
- (byte-compile-condition-case--old form)
4568
- (byte-compile-condition-case--new form)))
4569
-
4570
- (defun byte-compile-condition-case--old (form )
4571
- (let* ((var (nth 1 form))
4572
- (fun-bodies (eq var :fun-body ))
4573
- (byte-compile-bound-variables
4574
- (if (and var (not fun-bodies))
4575
- (cons var byte-compile-bound-variables)
4576
- byte-compile-bound-variables)))
4577
- (byte-compile-set-symbol-position 'condition-case )
4578
- (unless (symbolp var)
4579
- (byte-compile-warn
4580
- " `%s' is not a variable-name or nil (in condition-case)" var))
4581
- (if fun-bodies (setq var (make-symbol " err" )))
4582
- (byte-compile-push-constant var)
4583
- (if fun-bodies
4584
- (byte-compile-form `(list 'funcall ,(nth 2 form)))
4585
- (byte-compile-push-constant
4586
- (byte-compile-top-level (nth 2 form) byte-compile--for-effect)))
4587
- (let ((compiled-clauses
4588
- (mapcar
4589
- (lambda (clause )
4590
- (let ((condition (car clause)))
4591
- (cond ((not (or (symbolp condition)
4592
- (and (listp condition)
4593
- (let ((ok t ))
4594
- (dolist (sym condition)
4595
- (if (not (symbolp sym))
4596
- (setq ok nil )))
4597
- ok))))
4598
- (byte-compile-warn
4599
- " `%S' is not a condition name or list of such (in condition-case)"
4600
- condition))
4601
- ; ; (not (or (eq condition 't)
4602
- ; ; (and (stringp (get condition 'error-message))
4603
- ; ; (consp (get condition
4604
- ; ; 'error-conditions)))))
4605
- ; ; (byte-compile-warn
4606
- ; ; "`%s' is not a known condition name
4607
- ; ; (in condition-case)"
4608
- ; ; condition))
4609
- )
4610
- (if fun-bodies
4611
- `(list ', condition (list 'funcall ,(cadr clause) ', var ))
4612
- (cons condition
4613
- (byte-compile-top-level-body
4614
- (cdr clause) byte-compile--for-effect)))))
4615
- (cdr (cdr (cdr form))))))
4616
- (if fun-bodies
4617
- (byte-compile-form `(list ,@compiled-clauses ))
4618
- (byte-compile-push-constant compiled-clauses)))
4619
- (byte-compile-out 'byte-condition-case 0 )))
4620
-
4621
- (defun byte-compile-condition-case--new (form )
4622
4551
(let* ((var (nth 1 form))
4623
4552
(body (nth 2 form))
4624
4553
(depth byte-compile-depth)
0 commit comments