commit 48d7720993283a3387807fa5582bb10b1636bba5 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sun Dec 9 17:07:16 2018 -0800 Remove CHECK_FIXNUM_CAR etc. * src/coding.c (CHECK_FIXNAT_CAR, CHECK_FIXNAT_CDR): * src/lisp.h (CHECK_FIXNUM_CAR, CHECK_FIXNUM_CDR): Remove. All uses removed. These seem to have been based on the assumption that the argument cons needs to be modified, an assumption that is incorrect for fixnums. (Fdefine_coding_system_internal): Use CHECK_RANGED_INTEGER instead of a special diagnostic for graphic register numbers. diff --git a/src/coding.c b/src/coding.c index 398691fc86..c2945707e2 100644 --- a/src/coding.c +++ b/src/coding.c @@ -617,23 +617,7 @@ inhibit_flag (int encoded_flag, bool var) do { \ (attrs) = CODING_ID_ATTRS ((coding)->id); \ (charset_list) = CODING_ATTR_CHARSET_LIST (attrs); \ - } while (0) - -static void -CHECK_FIXNAT_CAR (Lisp_Object x) -{ - Lisp_Object tmp = XCAR (x); - CHECK_FIXNAT (tmp); - XSETCAR (x, tmp); -} - -static void -CHECK_FIXNAT_CDR (Lisp_Object x) -{ - Lisp_Object tmp = XCDR (x); - CHECK_FIXNAT (tmp); - XSETCDR (x, tmp); -} + } while (false) /* True if CODING's destination can be grown. */ @@ -10271,15 +10255,9 @@ usage: (define-coding-system-internal ...) */) else { CHECK_CONS (val); - CHECK_FIXNAT_CAR (val); - CHECK_FIXNUM_CDR (val); - if (XFIXNUM (XCAR (val)) > 255) - args_out_of_range_3 (XCAR (val), - make_fixnum (0), make_fixnum (255)); + CHECK_RANGED_INTEGER (XCAR (val), 0, 255); from = XFIXNUM (XCAR (val)); - if (! (from <= XFIXNUM (XCDR (val)) && XFIXNUM (XCDR (val)) <= 255)) - args_out_of_range_3 (XCDR (val), - XCAR (val), make_fixnum (255)); + CHECK_RANGED_INTEGER (XCDR (val), from, 255); to = XFIXNUM (XCDR (val)); } for (int i = from; i <= to; i++) @@ -10354,23 +10332,18 @@ usage: (define-coding-system-internal ...) */) reg_usage = args[coding_arg_iso2022_reg_usage]; CHECK_CONS (reg_usage); - CHECK_FIXNUM_CAR (reg_usage); - CHECK_FIXNUM_CDR (reg_usage); + CHECK_FIXNUM (XCAR (reg_usage)); + CHECK_FIXNUM (XCDR (reg_usage)); request = Fcopy_sequence (args[coding_arg_iso2022_request]); for (Lisp_Object tail = request; CONSP (tail); tail = XCDR (tail)) { int id; - Lisp_Object tmp1; val = XCAR (tail); CHECK_CONS (val); - tmp1 = XCAR (val); - CHECK_CHARSET_GET_ID (tmp1, id); - CHECK_FIXNAT_CDR (val); - if (XFIXNUM (XCDR (val)) >= 4) - error ("Invalid graphic register number: %"pI"d", - XFIXNUM (XCDR (val))); + CHECK_CHARSET_GET_ID (XCAR (val), id); + CHECK_RANGED_INTEGER (XCDR (val), 0, 3); XSETCAR (val, make_fixnum (id)); } diff --git a/src/indent.c b/src/indent.c index 18855768d3..8761388b85 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1756,14 +1756,14 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) CHECK_FIXNUM_COERCE_MARKER (from); CHECK_CONS (frompos); - CHECK_FIXNUM_CAR (frompos); - CHECK_FIXNUM_CDR (frompos); + CHECK_FIXNUM (XCAR (frompos)); + CHECK_FIXNUM (XCDR (frompos)); CHECK_FIXNUM_COERCE_MARKER (to); if (!NILP (topos)) { CHECK_CONS (topos); - CHECK_FIXNUM_CAR (topos); - CHECK_FIXNUM_CDR (topos); + CHECK_FIXNUM (XCAR (topos)); + CHECK_FIXNUM (XCDR (topos)); } if (!NILP (width)) CHECK_FIXNUM (width); @@ -1771,8 +1771,8 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) if (!NILP (offsets)) { CHECK_CONS (offsets); - CHECK_FIXNUM_CAR (offsets); - CHECK_FIXNUM_CDR (offsets); + CHECK_FIXNUM (XCAR (offsets)); + CHECK_FIXNUM (XCDR (offsets)); if (! (0 <= XFIXNUM (XCAR (offsets)) && XFIXNUM (XCAR (offsets)) <= PTRDIFF_MAX && 0 <= XFIXNUM (XCDR (offsets)) && XFIXNUM (XCDR (offsets)) <= INT_MAX)) args_out_of_range (XCAR (offsets), XCDR (offsets)); diff --git a/src/lisp.h b/src/lisp.h index 3943bf63ee..bda848430a 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2906,24 +2906,6 @@ CHECK_INTEGER (Lisp_Object x) else \ CHECK_TYPE (INTEGERP (x), Qnumber_or_marker_p, x); \ } while (false) - -/* Since we can't assign directly to the CAR or CDR fields of a cons - cell, use these when checking that those fields contain numbers. */ -INLINE void -CHECK_FIXNUM_CAR (Lisp_Object x) -{ - Lisp_Object tmp = XCAR (x); - CHECK_FIXNUM (tmp); - XSETCAR (x, tmp); -} - -INLINE void -CHECK_FIXNUM_CDR (Lisp_Object x) -{ - Lisp_Object tmp = XCDR (x); - CHECK_FIXNUM (tmp); - XSETCDR (x, tmp); -} /* Define a built-in function for calling from Lisp. `lname' should be the name to give the function in Lisp, diff --git a/src/w32proc.c b/src/w32proc.c index cb02ba6341..5a075ff1a9 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -3476,8 +3476,8 @@ If successful, the new layout id is returned, otherwise nil. */) HKL kl; CHECK_CONS (layout); - CHECK_FIXNUM_CAR (layout); - CHECK_FIXNUM_CDR (layout); + CHECK_FIXNUM (XCAR (layout)); + CHECK_FIXNUM (XCDR (layout)); kl = (HKL) (UINT_PTR) ((XFIXNUM (XCAR (layout)) & 0xffff) | (XFIXNUM (XCDR (layout)) << 16)); commit 87bc518afcc3adc23762944ef49f89d375f90260 Author: Glenn Morris Date: Sun Dec 9 15:54:35 2018 -0800 * test/lisp/eshell/eshell-tests.el (with-temp-eshell): Avoid permanently changing HISTFILE. diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index cefbeef567..330dd87ae4 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -33,7 +33,7 @@ `(let* ((eshell-directory-name (make-temp-file "eshell" t)) ;; We want no history file, so prevent Eshell from falling ;; back on $HISTFILE. - (_ (setenv "HISTFILE")) + (process-environment (cons "HISTFILE" process-environment)) (eshell-history-file-name nil) (eshell-buffer (eshell t))) (unwind-protect commit f8179cd366664484e849849027cdf6ecd55dbae9 Author: Juri Linkov Date: Mon Dec 10 01:53:08 2018 +0200 Fix occur for non-nil list-matching-lines-jump-to-current-line (bug#33476) * lisp/replace.el (occur-engine): Move orig-line let-binding higher. Don't use start-line in forward-line. diff --git a/lisp/replace.el b/lisp/replace.el index ecb47936e7..dcae12e9b7 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1657,7 +1657,10 @@ See also `multi-occur'." (lines 0) ; count of matching lines (matches 0) ; count of matches (headerpt (with-current-buffer out-buf (point))) - ) + (orig-line (if (not (overlayp boo)) + (line-number-at-pos) + (line-number-at-pos + (overlay-get boo 'occur--orig-point))))) (save-excursion ;; begin searching in the buffer (goto-char (if (overlayp boo) (overlay-start boo) (point-min))) @@ -1665,9 +1668,6 @@ See also `multi-occur'." (let* ((limit (if (overlayp boo) (overlay-end boo) (point-max))) (start-line (line-number-at-pos)) (curr-line start-line) ; line count - (orig-line (if (not (overlayp boo)) 1 - (line-number-at-pos - (overlay-get boo 'occur--orig-point)))) (orig-line-shown-p) (prev-line nil) ; line number of prev match endpt (prev-after-lines nil) ; context lines of prev match @@ -1796,7 +1796,7 @@ See also `multi-occur'." (setq orig-line-shown-p t) (save-excursion (goto-char (point-min)) - (forward-line (- orig-line start-line 1)) + (forward-line (1- orig-line)) (occur-engine-line (line-beginning-position) (line-end-position) keep-props))))) ;; Actually insert the match display data @@ -1834,7 +1834,7 @@ See also `multi-occur'." (let ((orig-line-str (save-excursion (goto-char (point-min)) - (forward-line (- orig-line start-line 1)) + (forward-line (1- orig-line)) (occur-engine-line (line-beginning-position) (line-end-position) keep-props)))) (add-face-text-property commit 38f2b582711041ea75b8e486f5bf286542207f27 Author: Michael Albinus Date: Sun Dec 9 17:09:53 2018 +0100 * test/lisp/net/tramp-tests.el (tramp-test03-file-name-host-rules): Use proper error symbol. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 1fcecb85eb..d68804a1c4 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -1854,8 +1854,7 @@ handled properly. BODY shall not contain a timeout." "%s|%s:foo:" (substring (file-remote-p tramp-test-temporary-file-directory) 0 -1) m)) - :type - (if (tramp-method-out-of-band-p vec 0) 'file-error 'user-error))))) + :type 'user-error)))) (ert-deftest tramp-test03-file-name-method-rules () "Check file name rules for some methods." commit d1c77129b067a97d854196527f6ec68e4138ae9f Author: Alan Mackenzie Date: Sun Dec 9 12:59:03 2018 +0000 Don't create *Compile-Log* due to byte-compile. Amend message to it. This fixes bug #33602 and is a partial reversion of a commit from 2018-11-28T13:15:50. * lisp/emacs-lisp/bytecomp.el (byte-compile-log-file): Don't create buffer *Compile-Log* because it doesn't already exist. Amend message "Compiling no file" to be clearer (?and less irritating). diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index d6986cb786..c0a764bafc 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1179,9 +1179,7 @@ we go into emacs-lisp-compilation-mode.") ;; Return the position of the start of the page in the log buffer. ;; But do nothing in batch mode. (defun byte-compile-log-file () - (and (not - (and (get-buffer byte-compile-log-buffer) - (equal byte-compile-current-file byte-compile-last-logged-file))) + (and (not (equal byte-compile-current-file byte-compile-last-logged-file)) (not noninteractive) (with-current-buffer (get-buffer-create byte-compile-log-buffer) (goto-char (point-max)) @@ -1204,7 +1202,7 @@ we go into emacs-lisp-compilation-mode.") (concat "in buffer " (buffer-name byte-compile-current-file))) " at " (current-time-string) "\n") - (insert "\f\nCompiling no file at " (current-time-string) "\n")) + (insert "\f\nCompiling internal form(s) at " (current-time-string) "\n")) (when dir (setq default-directory dir) (unless was-same