1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-15 17:00:26 +00:00

merge master

This commit is contained in:
Joakim Verona 2015-01-22 08:27:13 +01:00
commit 5c1d2b0f06
29 changed files with 181 additions and 122 deletions

View File

@ -1,3 +1,8 @@
2015-01-22 Paul Eggert <eggert@cs.ucla.edu>
Don't downcase system diagnostics' first letters
* NEWS: Document this.
2015-01-16 Artur Malabarba <bruce.connor.am@gmail.com>
* NEWS: Document installing packages from directories.

View File

@ -538,6 +538,11 @@ position list returned for such events is now nil.
These slots used to hold key-shortcut data, but have been obsolete since
Emacs-21.
** Emacs no longer downcases the first letter of a system diagnostic
when signaling a file error. For example, it now reports "Permission
denied" instead of "permission denied". The old behavior was problematic
in languages like German where downcasing rules depend on grammar.
* Lisp Changes in Emacs 25.1

View File

@ -1,3 +1,9 @@
2015-01-22 Ulrich Müller <ulm@gentoo.org>
* Makefile.in ($(DESTDIR)${archlibdir}): Don't fail if the chown
or chgrp command is unsuccessful; the 'update-game-score' program
has a fallback for this at runtime.
2015-01-21 Ulrich Müller <ulm@gentoo.org>
* update-game-score.c: Allow the program to run sgid instead

View File

@ -265,15 +265,15 @@ $(DESTDIR)${archlibdir}: all
touch "$(DESTDIR)${gamedir}/snake-scores"; \
touch "$(DESTDIR)${gamedir}/tetris-scores"
ifneq ($(gameuser),)
chown ${gameuser} "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"
chmod u+s,go-r "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"
chown ${gameuser} "$(DESTDIR)${gamedir}"
chmod u=rwx,g=rx,o=rx "$(DESTDIR)${gamedir}"
-if chown ${gameuser} "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && chmod u+s,go-r "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; then \
chown ${gameuser} "$(DESTDIR)${gamedir}"; \
chmod u=rwx,g=rx,o=rx "$(DESTDIR)${gamedir}"; \
fi
else ifneq ($(gamegroup),)
chgrp ${gamegroup} "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"
chmod g+s,o-r "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"
chgrp ${gamegroup} "$(DESTDIR)${gamedir}"
chmod u=rwx,g=rwx,o=rx "$(DESTDIR)${gamedir}"
-if chgrp ${gamegroup} "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && chmod g+s,o-r "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; then \
chgrp ${gamegroup} "$(DESTDIR)${gamedir}"; \
chmod u=rwx,g=rwx,o=rx "$(DESTDIR)${gamedir}"; \
fi
endif
exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \
if [ "$$exp_archlibdir" != "`cd ${srcdir} && /bin/pwd`" ]; then \

View File

@ -1,3 +1,41 @@
2015-01-22 Paul Eggert <eggert@cs.ucla.edu>
Don't downcase system diagnostics' first letters
* emacs-lisp/bytecomp.el (byte-compile-file):
* ffap.el (find-file-at-point):
* files.el (insert-file-1):
* net/ange-ftp.el (ange-ftp-barf-if-not-directory)
(ange-ftp-copy-file-internal):
* progmodes/etags.el (visit-tags-table):
Keep diagnostics consistent with system's.
* ffap.el (ffap-machine-p):
Ignore case while comparing diagnostics.
2015-01-22 Stefan Monnier <monnier@iro.umontreal.ca>
* help.el (help-make-usage): Don't turn a "_" arg into an empty-string
arg (bug#19645).
* emacs-lisp/cl-generic.el (cl--generic-lambda): Don't confuse a string
body with a docstring.
2015-01-22 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/xref.el (xref-location-marker, xref-location-group):
Use `cl-defgeneric' and `cl-defmethod' instead of the EIEIO
counterparts.
* progmodes/etags.el (xref-location-marker): Same.
* progmodes/xref.el (xref--current): Rename from `xref--selected'.
(xref--inhibit-mark-current): Rename from
`xref--inhibit-mark-selected'. Update the usages.
(xref-quit): Reword the docstring. Kill buffers after quitting
windows instead of before.
(xref--insert-xrefs): Tweak help-echo.
(xref--read-identifier-history, xref--read-pattern-history):
New variables.
(xref--read-identifier, xref-find-apropos): Use them.
2015-01-21 Ulrich Müller <ulm@gentoo.org>
* play/gamegrid.el (gamegrid-add-score-with-update-game-score):

View File

@ -1863,8 +1863,8 @@ The value is non-nil if there were no errors, nil if errors."
(signal 'file-error
(list "Opening output file"
(if (file-exists-p target-file)
"cannot overwrite file"
"directory not writable or nonexistent")
"Cannot overwrite file"
"Directory not writable or nonexistent")
target-file)))
(kill-buffer (current-buffer)))
(if (and byte-compile-generate-call-tree

View File

@ -228,7 +228,8 @@ This macro can only be used within the lexical scope of a cl-generic method."
"Make the lambda expression for a method with ARGS and BODY."
(let ((plain-args ())
(specializers nil)
(doc-string (if (stringp (car-safe body)) (pop body)))
(doc-string (if (and (stringp (car-safe body)) (cdr body))
(pop body)))
(mandatory t))
(dolist (arg args)
(push (pcase arg
@ -252,7 +253,7 @@ This macro can only be used within the lexical scope of a cl-generic method."
;; destructuring args, `declare' and whatnot).
(pcase (macroexpand fun macroenv)
(`#'(lambda ,args . ,body)
(let* ((doc-string (and doc-string (stringp (car body))
(let* ((doc-string (and doc-string (stringp (car body)) (cdr body)
(pop body)))
(cnm (make-symbol "cl--cnm"))
(nmp (make-symbol "cl--nmp"))

View File

@ -1,3 +1,8 @@
2015-01-22 Paul Eggert <eggert@cs.ucla.edu>
Don't downcase system diagnostics' first letters
* erc-dcc.el (erc-dcc-server): Ignore case while comparing diagnostics.
2014-11-23 Michael Albinus <michael.albinus@gmx.de>
* erc-desktop-notifications.el (erc-notifications-bus):

View File

@ -379,7 +379,7 @@ created subprocess, or nil."
(set-process-filter-multibyte process nil)))))
(file-error
(unless (and (string= "Cannot bind server socket" (nth 1 err))
(string= "address already in use" (nth 2 err)))
(string= "address already in use" (downcase (nth 2 err))))
(signal (car err) (cdr err)))
(setq port (1+ port))
(unless (< port upper)
@ -1264,4 +1264,3 @@ other client."
;; Local Variables:
;; indent-tabs-mode: nil
;; End:

View File

@ -476,7 +476,7 @@ Returned values:
;; (file-error "connection failed" "address already in use"
;; "ftp.uu.net" "ffap-machine-p")
((equal mesg "connection failed")
(if (equal (nth 2 error) "permission denied")
(if (string= (downcase (nth 2 error)) "permission denied")
nil ; host does not exist
;; Other errors mean the host exists:
(nth 2 error)))
@ -1439,7 +1439,7 @@ and the functions `ffap-file-at-point' and `ffap-url-at-point'."
(expand-file-name filename)))
;; User does not want to find a non-existent file:
((signal 'file-error (list "Opening file buffer"
"no such file or directory"
"No such file or directory"
filename)))))))
;; Shortcut: allow {M-x ffap} rather than {M-x find-file-at-point}.

View File

@ -2128,7 +2128,7 @@ This function ensures that none of these modifications will take place."
(defun insert-file-1 (filename insert-func)
(if (file-directory-p filename)
(signal 'file-error (list "Opening input file" "file is a directory"
(signal 'file-error (list "Opening input file" "Is a directory"
filename)))
;; Check whether the file is uncommonly large
(abort-if-file-too-large (nth 7 (file-attributes filename)) "insert" filename)

View File

@ -1445,7 +1445,7 @@ the same names as used in the original source code, when possible."
(let ((name (symbol-name arg)))
(cond
((string-match "\\`&" name) arg)
((string-match "\\`_" name)
((string-match "\\`_." name)
(intern (upcase (substring name 1))))
(t (intern (upcase name)))))))
arglist)))

View File

@ -1536,8 +1536,8 @@ then kill the related FTP process."
(signal 'file-error
(list "Opening directory"
(if (file-exists-p directory)
"not a directory"
"no such file or directory")
"Not a directory"
"No such file or directory")
directory))))
;;;; ------------------------------------------------------------
@ -3664,7 +3664,7 @@ so return the size on the remote host exactly. See RFC 3659."
(or (file-exists-p filename)
(signal 'file-error
(list "Copy file" "no such file or directory" filename)))
(list "Copy file" "No such file or directory" filename)))
;; canonicalize newname if a directory.
(if (file-directory-p newname)

View File

@ -308,7 +308,7 @@ file the tag was in."
(save-excursion
(or (visit-tags-table-buffer file)
(signal 'file-error (list "Visiting tags table"
"file does not exist"
"No such file or directory"
file)))
;; Set FILE to the expanded name.
(setq file tags-file-name)))
@ -2122,7 +2122,7 @@ for \\[find-tag] (which see)."
(make-instance 'xref-etags-location :tag-info tag-info
:file (expand-file-name file)))
(defmethod xref-location-marker ((l xref-etags-location))
(cl-defmethod xref-location-marker ((l xref-etags-location))
(with-slots (tag-info file) l
(let ((buffer (find-file-noselect file)))
(with-current-buffer buffer

View File

@ -66,10 +66,10 @@
;; If a backend decides to subclass xref-location it can provide
;; methods for some of the following functions:
(defgeneric xref-location-marker (location)
(cl-defgeneric xref-location-marker (location)
"Return the marker for LOCATION.")
(defgeneric xref-location-group (location)
(cl-defgeneric xref-location-group (location)
"Return a string used to group a set of locations.
This is typically the filename.")
@ -88,7 +88,7 @@ Line numbers start from 1 and columns from 0.")
"Create and return a new xref-file-location."
(make-instance 'xref-file-location :file file :line line :column column))
(defmethod xref-location-marker ((l xref-file-location))
(cl-defmethod xref-location-marker ((l xref-file-location))
(with-slots (file line column) l
(with-current-buffer
(or (get-file-buffer file)
@ -102,7 +102,7 @@ Line numbers start from 1 and columns from 0.")
(move-to-column column)
(point-marker))))))
(defmethod xref-location-group ((l xref-file-location))
(cl-defmethod xref-location-group ((l xref-file-location))
(oref l :file))
(defclass xref-buffer-location (xref-location)
@ -113,12 +113,12 @@ Line numbers start from 1 and columns from 0.")
"Create and return a new xref-buffer-location."
(make-instance 'xref-buffer-location :buffer buffer :position position))
(defmethod xref-location-marker ((l xref-buffer-location))
(cl-defmethod xref-location-marker ((l xref-buffer-location))
(with-slots (buffer position) l
(let ((m (make-marker)))
(move-marker m position buffer))))
(defmethod xref-location-group ((l xref-buffer-location))
(cl-defmethod xref-location-group ((l xref-buffer-location))
(with-slots (buffer) l
(or (buffer-file-name buffer)
(format "(buffer %s)" (buffer-name buffer)))))
@ -134,10 +134,10 @@ actual location is not known.")
"Create and return a new xref-bogus-location."
(make-instance 'xref-bogus-location :message message))
(defmethod xref-location-marker ((l xref-bogus-location))
(cl-defmethod xref-location-marker ((l xref-bogus-location))
(user-error "%s" (oref l :message)))
(defmethod xref-location-group ((_ xref-bogus-location)) "(No location)")
(cl-defmethod xref-location-group ((_ xref-bogus-location)) "(No location)")
;; This should be in elisp-mode.el, but it's preloaded, and we can't
;; preload defclass and defmethod (at least, not yet).
@ -151,7 +151,7 @@ actual location is not known.")
(defun xref-make-elisp-location (symbol type file)
(make-instance 'xref-elisp-location :symbol symbol :type type :file file))
(defmethod xref-location-marker ((l xref-elisp-location))
(cl-defmethod xref-location-marker ((l xref-elisp-location))
(with-slots (symbol type file) l
(let ((buffer-point
(pcase type
@ -342,15 +342,15 @@ WINDOW controls how the buffer is displayed:
(defvar-local xref--temporary-buffers nil
"List of buffers created by xref code.")
(defvar-local xref--selected nil
"t if the current buffer has ever been selected.
(defvar-local xref--current nil
"Non-nil if this buffer was once current, except while displaying xrefs.
Used for temporary buffers.")
(defvar xref--inhibit-mark-selected nil)
(defvar xref--inhibit-mark-current nil)
(defun xref--mark-selected ()
(unless xref--inhibit-mark-selected
(setq xref--selected t))
(unless xref--inhibit-mark-current
(setq xref--current t))
(remove-hook 'buffer-list-update-hook #'xref--mark-selected t))
(defun xref--save-to-history (buf win)
@ -375,7 +375,7 @@ Used for temporary buffers.")
(condition-case err
(let ((xref-buf (current-buffer))
(bl (buffer-list))
(xref--inhibit-mark-selected t))
(xref--inhibit-mark-current t))
(xref--goto-location location)
(let ((buf (current-buffer)))
(unless (memq buf bl)
@ -438,29 +438,28 @@ Used for temporary buffers.")
(setq buffer-read-only t))
(defun xref-quit (&optional kill)
"Perform cleanup, then quit the current window.
The cleanup consists of burying all temporarily displayed
buffers, and if KILL is non-nil, of killing all buffers that were
created in the process of showing xrefs.
"Bury temporarily displayed buffers, then quit the current window.
Exceptions are made for buffers switched to by the user in the
meantime, and other window configuration changes. These are
preserved."
If KILL is non-nil, kill all buffers that were created in the
process of showing xrefs, and also kill the current buffer.
The buffers that the user has otherwise interacted with in the
meantime are preserved."
(interactive "P")
(let ((window (selected-window))
(history xref--display-history))
(setq xref--display-history nil)
(when kill
(let ((xref--inhibit-mark-selected t)
kill-buffer-query-functions)
(dolist (buf xref--temporary-buffers)
(unless (buffer-local-value 'xref--selected buf)
(kill-buffer buf)))
(setq xref--temporary-buffers nil)))
(pcase-dolist (`(,buf . ,win) history)
(when (and (window-live-p win)
(eq buf (window-buffer win)))
(quit-window nil win)))
(when kill
(let ((xref--inhibit-mark-current t)
kill-buffer-query-functions)
(dolist (buf xref--temporary-buffers)
(unless (buffer-local-value 'xref--current buf)
(kill-buffer buf)))
(setq xref--temporary-buffers nil)))
(quit-window kill window)))
(defconst xref-buffer-name "*xref*"
@ -496,7 +495,9 @@ GROUP is a string for decoration purposes and XREF is an
'face 'font-lock-keyword-face
'mouse-face 'highlight
'keymap xref--button-map
'help-echo "mouse-2: display in another window, RET or mouse-1: navigate")
'help-echo
(concat "mouse-2: display in another window, "
"RET or mouse-1: follow reference"))
description))
(when (or more1 more2)
(insert "\n")))))
@ -535,6 +536,10 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
(defvar xref-show-xrefs-function 'xref--show-xref-buffer
"Function to display a list of xrefs.")
(defvar xref--read-identifier-history nil)
(defvar xref--read-pattern-history nil)
(defun xref--show-xrefs (input kind arg window)
(let* ((bl (buffer-list))
(xrefs (funcall xref-find-function kind arg))
@ -557,7 +562,8 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
(cond ((or current-prefix-arg (not id))
(completing-read prompt
(funcall xref-identifier-completion-table-function)
nil t id))
nil t id
'xref--read-identifier-history))
(t id))))
@ -593,12 +599,15 @@ With prefix argument, prompt for the identifier."
(interactive (list (xref--read-identifier "Find references of: ")))
(xref--show-xrefs identifier 'references identifier nil))
(declare-function apropos-parse-pattern "apropos" (pattern))
;;;###autoload
(defun xref-find-apropos (pattern)
"Find all meaningful symbols that match PATTERN.
The argument has the same meaning as in `apropos'."
(interactive (list (read-from-minibuffer
"Search for pattern (word list or regexp): ")))
"Search for pattern (word list or regexp): "
nil nil nil 'xref--read-pattern-history)))
(require 'apropos)
(xref--show-xrefs pattern 'apropos
(apropos-parse-pattern

View File

@ -1,3 +1,9 @@
2015-01-22 Paul Eggert <eggert@cs.ucla.edu>
Don't downcase system diagnostics' first letters
* url-dav.el (url-dav-delete-directory, url-dav-delete-file)
(url-dav-directory-files): Keep diagnostics consistent with system's.
2014-12-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
* url-http.el (url-http-parse-headers): `gnutls-available-p' is

View File

@ -741,7 +741,7 @@ files in the collection as well."
(if (and (not recursive)
(/= (length props) 1))
(signal 'file-error (list "Removing directory"
"directory not empty" url)))))
"Directory not empty" url)))))
(mapc (lambda (result)
(setq status (plist-get (cdr result) 'DAV:status))
@ -760,7 +760,7 @@ files in the collection as well."
url lock-token
(setq props (url-dav-get-properties url))
(if (eq (plist-get (cdar props) 'DAV:resourcetype) 'DAV:collection)
(signal 'file-error (list "Removing old name" "is a collection" url)))))
(signal 'file-error (list "Removing old name" "Is a collection" url)))))
(mapc (lambda (result)
(setq status (plist-get (cdr result) 'DAV:status))
@ -787,7 +787,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
(when (and (= (length properties) 1)
(not (url-dav-file-directory-p url)))
(signal 'file-error (list "Opening directory" "not a directory" url)))
(signal 'file-error (list "Opening directory" "Not a directory" url)))
(while properties
(setq child-props (pop properties)

View File

@ -1,3 +1,21 @@
2015-01-22 Paul Eggert <eggert@cs.ucla.edu>
Don't downcase system diagnostics' first letters
* fileio.c (report_file_errno): Don't downcase, and simplify.
Fixes: bug#19642
Isolate NIL_IS_ZERO-assuming code better
Suggested by Stefan Monnier in:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00588.html
* alloc.c (allocate_pseudovector):
Use memclear, not memsetnil, to remove a 'verify'.
* callint.c (Fcall_interactively):
* dispnew.c (realloc_glyph_pool):
* xdisp.c (init_iterator):
Use memclear, not memset, to remove a 'verify'.
* lisp.h (memclear): Rename from memsetnil, and take a byte
count rather than a word count. All callers changed.
2015-01-20 Paul Eggert <eggert@cs.ucla.edu>
Undo port to hypothetical nonzero Qnil case

View File

@ -3174,11 +3174,8 @@ allocate_pseudovector (int memlen, int lisplen,
eassert (memlen - lisplen <= (1 << PSEUDOVECTOR_REST_BITS) - 1);
eassert (lisplen <= (1 << PSEUDOVECTOR_SIZE_BITS) - 1);
/* Only the first LISPLEN slots will be traced normally by the GC.
Since Qnil == 0, we can memset Lisp and non-Lisp data at one go. */
verify (NIL_IS_ZERO);
memsetnil (v->contents, zerolen);
/* Only the first LISPLEN slots will be traced normally by the GC. */
memclear (v->contents, zerolen * word_size);
XSETPVECTYPESIZE (v, tag, lisplen, memlen - lisplen);
return v;
}

View File

@ -509,8 +509,7 @@ invoke it. If KEYS is omitted or nil, the return value of
visargs = args + nargs;
varies = (signed char *) (visargs + nargs);
verify (NIL_IS_ZERO);
memset (args, 0, nargs * (2 * word_size + 1));
memclear (args, nargs * (2 * word_size + 1));
GCPRO5 (prefix_arg, function, *args, *visargs, up_event);
gcpro3.nvars = nargs;

View File

@ -11273,7 +11273,7 @@ internal character representation. */);
{
Lisp_Object args[coding_arg_undecided_max];
memsetnil (args, ARRAYELTS (args));
memclear (args, sizeof args);
Lisp_Object plist[16];
plist[0] = intern_c_string (":name");

View File

@ -1343,14 +1343,8 @@ realloc_glyph_pool (struct glyph_pool *pool, struct dim matrix_dim)
ptrdiff_t old_nglyphs = pool->nglyphs;
pool->glyphs = xpalloc (pool->glyphs, &pool->nglyphs,
needed - old_nglyphs, -1, sizeof *pool->glyphs);
/* Redisplay relies on nil as the object of special glyphs
(truncation and continuation glyphs and also blanks used to
extend each line on a TTY), so verify that memset does this. */
verify (NIL_IS_ZERO);
memset (pool->glyphs + old_nglyphs, 0,
(pool->nglyphs - old_nglyphs) * sizeof *pool->glyphs);
memclear (pool->glyphs + old_nglyphs,
(pool->nglyphs - old_nglyphs) * sizeof *pool->glyphs);
}
/* Remember the number of rows and columns because (a) we use them

View File

@ -2299,7 +2299,8 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
/* Avoid making funcall cons up a yet another new vector of arguments
by explicitly supplying nil's for optional values. */
SAFE_ALLOCA_LISP (funcall_args, 1 + XSUBR (fun)->max_args);
memsetnil (funcall_args + numargs + 1, XSUBR (fun)->max_args - numargs);
memclear (funcall_args + numargs + 1,
(XSUBR (fun)->max_args - numargs) * word_size);
funcall_nargs = 1 + XSUBR (fun)->max_args;
}
else
@ -2693,8 +2694,8 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
eassert (XSUBR (fun)->max_args <= ARRAYELTS (internal_argbuf));
internal_args = internal_argbuf;
memcpy (internal_args, args + 1, numargs * word_size);
memsetnil (internal_args + numargs,
XSUBR (fun)->max_args - numargs);
memclear (internal_args + numargs,
(XSUBR (fun)->max_args - numargs) * word_size);
}
else
internal_args = args + 1;

View File

@ -186,37 +186,17 @@ void
report_file_errno (char const *string, Lisp_Object name, int errorno)
{
Lisp_Object data = CONSP (name) || NILP (name) ? name : list1 (name);
Lisp_Object errstring;
char *str;
synchronize_system_messages_locale ();
str = strerror (errorno);
errstring = code_convert_string_norecord (build_unibyte_string (str),
Vlocale_coding_system, 0);
char *str = strerror (errorno);
Lisp_Object errstring
= code_convert_string_norecord (build_unibyte_string (str),
Vlocale_coding_system, 0);
Lisp_Object errdata = Fcons (errstring, data);
while (1)
switch (errorno)
{
case EEXIST:
xsignal (Qfile_already_exists, Fcons (errstring, data));
break;
default:
/* System error messages are capitalized. Downcase the initial
unless it is followed by a slash. (The slash case caters to
error messages that begin with "I/O" or, in German, "E/A".) */
if (STRING_MULTIBYTE (errstring)
&& ! EQ (Faref (errstring, make_number (1)), make_number ('/')))
{
int c;
str = SSDATA (errstring);
c = STRING_CHAR ((unsigned char *) str);
Faset (errstring, make_number (0), make_number (downcase (c)));
}
xsignal (Qfile_error,
Fcons (build_string (string), Fcons (errstring, data)));
}
if (errorno == EEXIST)
xsignal (Qfile_already_exists, errdata);
else
xsignal (Qfile_error, Fcons (build_string (string), errdata));
}
/* Signal a file-access failure that set errno. STRING describes the

View File

@ -2524,7 +2524,7 @@ mapcar1 (EMACS_INT leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq)
if (vals)
{
/* Don't let vals contain any garbage when GC happens. */
memsetnil (vals, leni);
memclear (vals, leni * word_size);
GCPRO3 (dummy, fn, seq);
gcpro1.var = vals;
@ -3700,7 +3700,7 @@ larger_vector (Lisp_Object vec, ptrdiff_t incr_min, ptrdiff_t nitems_max)
new_size = old_size + incr;
v = allocate_vector (new_size);
memcpy (v->contents, XVECTOR (vec)->contents, old_size * sizeof *v->contents);
memsetnil (v->contents + old_size, new_size - old_size);
memclear (v->contents + old_size, incr * word_size);
XSETVECTOR (vec, v);
return vec;
}

View File

@ -989,14 +989,14 @@ font_expand_wildcards (Lisp_Object *field, int n)
if (i == 0 || ! NILP (tmp[i - 1]))
/* None of TMP[X] corresponds to Jth field. */
return -1;
memsetnil (field + j, range[i].from - j);
memclear (field + j, (range[i].from - j) * word_size);
j = range[i].from;
}
field[j++] = tmp[i];
}
if (! NILP (tmp[n - 1]) && j < XLFD_REGISTRY_INDEX)
return -1;
memsetnil (field + j, XLFD_LAST_INDEX - j);
memclear (field + j, (XLFD_LAST_INDEX - j) * word_size);
if (INTEGERP (field[XLFD_ENCODING_INDEX]))
field[XLFD_ENCODING_INDEX]
= Fintern (Fnumber_to_string (field[XLFD_ENCODING_INDEX]), Qnil);

View File

@ -1513,13 +1513,15 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
to find such assumptions later if we change Qnil to be nonzero. */
enum { NIL_IS_ZERO = XLI_BUILTIN_LISPSYM (iQnil) == 0 };
/* Set a Lisp_Object array V's N entries to nil. */
/* Clear the object addressed by P, with size NBYTES, so that all its
bytes are zero and all its Lisp values are nil. */
INLINE void
memsetnil (Lisp_Object *v, ptrdiff_t n)
memclear (void *p, ptrdiff_t nbytes)
{
eassert (0 <= n);
eassert (0 <= nbytes);
verify (NIL_IS_ZERO);
memset (v, 0, n * sizeof *v);
/* Since Qnil is zero, memset suffices. */
memset (p, 0, nbytes);
}
/* If a struct is made to look like a vector, this macro returns the length

View File

@ -2752,13 +2752,7 @@ init_iterator (struct it *it, struct window *w,
row = MATRIX_HEADER_LINE_ROW (w->desired_matrix);
}
/* Clear IT. */
/* The code assumes it->object and other Lisp_Object components are
set to nil, so verify that memset does this. */
verify (NIL_IS_ZERO);
memset (it, 0, sizeof *it);
memclear (it, sizeof *it);
it->current.overlay_string_index = -1;
it->current.dpvec_index = -1;
it->base_face_id = remapped_base_face_id;

View File

@ -655,7 +655,7 @@ Do not override for `prot-2'."
(oref eitest-p1 slot-1)
(oref eitest-p2 slot-1)
;; Accessing protected slot out of context used to fail, but we dropped this
;; feature, since it was underused and noone noticed that the check was
;; feature, since it was underused and no one noticed that the check was
;; incorrect (much too loose).
;;PROTECTED (should-error (oref eitest-p1 slot-2) :type 'invalid-slot-name)
;; Access protected slot in method