Cf http://lists.gnu.org/archive/html/emacs-devel/2005-08/msg00472.html
* lisp/files.el (interpreter-mode-alist): Convert to regexps.
(set-auto-mode): Adapt for this.
* lisp/progmodes/cperl-mode.el (cperl-clobber-mode-lists):
Comment out unused variable.
* lisp/progmodes/cc-mode.el (interpreter-mode-alist):
* lisp/progmodes/python.el (interpreter-mode-alist):
* lisp/progmodes/ruby-mode.el (interpreter-mode-alist): Convert to regexps.
* lisp/progmodes/sh-script.el (sh-set-shell):
No longer use interpreter-mode-alist to get list of shells.
* etc/NEWS: Mention this.
Fixes: debbugs:15306
(dir-locals-read-from-file): Remove unused `err' variable.
(hack-dir-local-variables--warned-coding): New var.
(hack-dir-local-variables): Use it to avoid repeated warnings.
(make-backup-file-name--default-function): New function.
(make-backup-file-name-function): Use it as default.
(buffer-stale--default-function): New function.
(buffer-stale-function): Use it as default.
(revert-buffer-insert-file-contents--default-function): New function.
(revert-buffer-insert-file-contents-function): Use it as default.
(insert-directory): Avoid add-to-list.
* lisp/autorevert.el (auto-revert-handler): Simplify.
Use buffer-stale--default-function.
* lisp/files.el (save-buffers-kill-terminal):
* lisp/net/browse-url.el (browse-url):
* lisp/server.el (server-save-buffers-kill-terminal):
* lisp/textmodes/reftex-toc.el (reftex-toc, reftex-toc-revert):
Prefer nil to selected-frame for the first arg of frame-parameter.
(revert-buffer-preserve-modes): Declare var to
provide access to the `preserve-modes' argument.
(revert-buffer): Let-bind it.
(revert-buffer--default): New function, extracted from revert-buffer.
* doc/lispref/text.texi (Undo):
Document (t . 0) and (t . -1) in buffer-undo-list.
* etc/NEWS: Changes to visited-file-modtime, set-visited-file-modtime.
* lisp/files.el (clear-visited-file-modtime): Move here from fileio.c.
* src/atimer.c (schedule_atimer):
* src/fileio.c (Ffile_newer_than_file_p):
Minor cleanup: use EMACS_TIME_LT so that we can remove EMACS_TIME_GT.
* src/buffer.c (buffer-undo-list): Document (t . 0) and (t . -1).
* src/fileio.c (Fclear_visited_file_modtime): Move to lisp/files.el.
(syms_of_fileio): Remove Sclear_visited_file_name.
(Fvisited_file_modtime): Return -1, not (-1 ...), when the visited
file doesn't exist; this avoids an ambiguity with negative timestamps.
(Fset_visited_file_modtime): Accept -1 and 0 as time-list arg.
* src/systime.h (make_emacs_time, invalid_emacs_time):
Don't assume struct timespec layout; POSIX doesn't guarantee it.
(EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE): Remove.
* src/undo.c (record_first_change): Push (visited-file-modtime) onto
undo list rather than reimplementing it by hand, incorrectly.
Fixes: debbugs:14824
it does its own dialog, which can't be cancelled.
* src/nsfns.m: Remove panelOK.
(ns_fd_data): New.
(ns_run_file_dialog): New function.
(Fns_read_file_name): Fill in ns_fd_data, post an event and start the
event loop, so file dialog is popped up by ns_run_file_dialog, called
by sendEvent (Bug#14578).
(EmacsSavePanel, EmacsOpenPanel): Remove ok and cancel methods.
* src/nsterm.h (NSSavePanel): Update comment.
(NSAPP_DATA2_RUNFILEDIALOG): Define.
(ns_run_file_dialog): Declare.
* src/nsterm.m (sendEvent:): Handle NSAPP_DATA2_RUNFILEDIALOG.
restarts.
* remember.el (remember-data-file): Add :set callback to affect
notes buffer (if any).
(remember-notes): New command.
(remember-notes-buffer-name, bury-remember-notes-on-kill):
New defcustoms for the `remember-notes' function.
(remember-notes-save-and-bury-buffer): New command.
(remember-notes-mode-map): New variable.
(remember-mode): New minor mode.
(remember-notes--kill-buffer-query): New function.
* lisp/startup.el (initial-buffer-choice): Add notes to custom type.
* src/buffer.c (FKill_buffer): Run `kill-buffer-query-functions'
before checking whether buffer is modified. This lets
`kill-buffer-query-functions' cancel killing of the buffer or save
its content before `kill-buffer' asks user the "Buffer %s
modified; kill anyway?" question.
* remember.el (remember-append-to-file):
Don't mix `find-buffer-visiting' and `get-file-buffer'.
* lisp/files.el (find-file-noselect): Simplify conditional expression.
* calculator.el (electric, ehelp): No need to load when compiling.
(Electric-command-loop, electric-describe-mode): Declare.
* doc-view.el (doc-view-current-converter-processes): Move before use.
* files.el (dired-unmark):
* progmodes/gud.el (gdb-input): Update declarations.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Move MODE-set-explicitly definition before use.
* erc/erc-log.el (erc-network-name): Declare.
* erc/erc-notify.el (pcomplete--here): Declare.
(pcomplete/erc-mode/NOTIFY): Require pcomplete.
* international/mule-diag.el (mule-diag):
Don't use obsolete window-system-version.
* mail/feedmail.el (smtpmail): No need to load when compiling.
(smtpmail-via-smtp, smtpmail-smtp-server): Declare.
* mail/mail-utils.el (rfc822): No need to load when compiling.
(rfc822-addresses): Autoload it.
(mail-strip-quoted-names): Trivial simplification.
* mail/rmail.el (rmail-mime-message-p, rmail-mime-toggle-raw): Declare.
(rmail-retry-failure): Don't assume that rmail-mime-feature == rmailmm.
* net/snmp-mode.el (tempo): Don't duplicate requires.
* progmodes/prolog.el (info): No need to load when compiling.
(comint): Require before shell requires it.
(Info-goto-node): Autoload it.
(Info-follow-nearest-node): Declare.
(prolog-help-info, prolog-goto-predicate-info): No need to require info.
* textmodes/artist.el (picture-mode-exit): Declare.
* textmodes/reftex-parse.el (reftex-parse-from-file):
Trivial rewrite so the compiler can parse it better.
* url/url-dav.el (url-http): Require it.
(url-http-head-file-attributes): Don't autoload it.
* url/url-proxy.el (url-http): Autoload it.
lisp/files.el (normal-backup-enable-predicate): On MS-Windows and
MS-DOS compare truenames of temporary-file-directory and of the
file, so that 8+3 aliases (usually found in $TEMP on Windows)
don't fail comparison by compare-strings. Also, compare file
names case-insensitively on MS-Windows and MS-DOS.
* lisp/emacs-lisp/edebug.el (edebug-mode): Make sure edebug-kill-buffer
is the last entry in kill-buffer-hook.
* lisp/nxml/rng-valid.el (rng-validate-while-idle)
(rng-validate-quick-while-idle): Guard against deleted buffer.
Fixes: debbugs:13999
* lisp/files.el (basic-save-buffer-2):
Choose coding system for writing the file before backing it up.
* src/fileio.c (choose_write_coding_system): Make it callable from Lisp.
(Fwrite_region): If coding-system-for-write is set, don't call
choose_write_coding_system.
Move the last piece of choose_write_coding_system here.
(syms_of_fileio): Add choose-write-coding-system.
Fixes: debbugs:13522
and view-mode-disable and assume it's called from view-mode.
(view-mode-enable, view-mode-disable): Redefine as obsolete
compatibility layer above view-mode.
(view-mode-enter): Call `view-mode'.
* lisp/files.el (after-find-file): Call `view-mode'.
src/fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
file's SELinux context or ACLs successfully set, nil otherwise.
lisp/files.el (backup-buffer-copy, basic-save-buffer-2): If
set-file-extended-attributes fails, fall back on set-file-modes
instead of signaling an error.
doc/lispref/files.texi (Changing Files): Document the return values of
set-file-selinux-context and set-file-acl.
* configure.ac (acl): New option.
(HAVE_POSIX_ACL): Test for POSIX ACL support. This is typically
provided by libacl on GNU/Linux.
* fileio.c (Ffile_acl, Fset_file_acl): New functions.
(Fcopy_file): Change last arg to `preserve_extended_attributes'
and copy ACL entries of file in addition to SELinux context if
set.
(syms_of_fileio): Add `file-acl' and `set-file-acl'.
* Makefile.in (LIBACL_LIBS): New macro.
(LIBES): Use it.
* files.el (file-extended-attributes)
(set-file-extended-attributes): New functions.
(backup-buffer): Use them to handle both SELinux context and ACL
entries.
(backup-buffer-copy): Work with an alist of extended attributes,
rather than an SELinux context.
(basic-save-buffer-2): Ditto.
* files.texi (File Attributes): Document ACL support and new
`file-acl' function.
(Changing Files): Mention argument name change of `copy-file' and
document new function `set-file-acl'.
* configure.ac (BSD4_2): Remove; no longer needed.
* admin/CPP-DEFINES (BSD4_2): Remove.
* doc/lispintro/emacs-lisp-intro.texi (Files List):
directory-files-and-attributes now outputs t for attribute that's
now a placeholder.
* doc/lispref/files.texi (Testing Accessibility): Document GROUP arg
of file-ownership-preserved-p.
(File Attributes): Document that 9th element is now
just a placeholder.
* doc/lispref/os.texi (User Identification): Document new functions group-gid,
group-real-gid.
* etc/NEWS: Document changes to file-attributes,
file-ownership-preserved-p.
Mention new functions group-gid, group-real-gid.
* lisp/files.el (backup-buffer): Don't rely on 9th output of
file-attributes, as it's now a placeholder. Instead, use the new
optional arg of file-ownership-preserved-p.
(file-ownership-preserved-p): New optional arg GROUP.
Fix mishandling of setuid directories that would cause this
function to return t when it should have returned nil.
Document what happens if the file does not exist, and when
it's not known whether the ownership will be preserved.
* lisp/net/tramp-sh.el (tramp-sh-handle-file-ownership-preserved-p):
Likewise.
(tramp-get-local-gid): Use group-gid for integer, as that's
faster and more reliable.
* src/dired.c (Ffile_attributes): Return t as the 9th attribute,
to mark it as a placeholder. The old value was often wrong.
The only user of this attribute has been changed to use
file-ownership-preserved-p instead, with its new group arg.
* src/editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
Fixes: debbugs:13125
* doc/lispref/os.texi (Time Parsing): Time values can now be four integers.
* lisp/files.el (dir-locals-directory-cache):
* lisp/ps-bdf.el (bdf-file-mod-time, bdf-read-font-info):
Doc fixes.
* lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls):
* lisp/ps-bdf.el (bdf-file-newer-than-time):
Process four-integers time stamps, not two. Doc fixes.
* doc/lispref/files.texi (File Attributes): Describe it.
(Magic File Names): Use it.
* etc/NEWS: Document the change.
* lisp/files.el (remote-file-name-inhibit-cache):
* lisp/time.el (display-time-file-nonempty-p): Use it.
* lisp/files.el (after-find-file): Don't chase links before calling
file-exists-p, as file-exists-p already does the right thing.
* src/dired.c (directory_files_internal, Ffile_attributes):
New arg follow_symlinks. All uses changed.
* lisp/files.el (hack-local-variables-filter): If an eval: form is not
known to be safe, and enable-local-variables is :safe, then ignore
the form totally, as is done for non-eval forms.
src/w32.c: Include winioctl.h and aclapi.h.
(is_symlink, chase_symlinks, enable_privilege, restore_privilege)
(revert_to_self): Forward declarations of static functions.
<static BOOL g_b_init_get_security_info>:
<g_b_init_create_symbolic_link>: New static flags.
(globals_of_w32): Initialize them to zero.
(GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
(map_w32_filename): Improve commentary. Simplify switch.
(SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
headers (most versions of MinGW w32api don't).
(get_security_info, create_symbolic_link)
(get_file_security_desc_by_handle, is_symlink, chase_symlinks):
New functions.
(sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
in the argument file name.
(sys_access): Call unc_volume_file_attributes only if
GetFileAttributes fails with network-related error codes.
(sys_rename): Diagnose renaming of a symlink when the user doesn't
have the required privileges.
(get_file_security_desc_by_name): Renamed from
get_file_security_desc.
(stat_worker): New function, with most of the guts of 'stat', and
with addition of handling of symlinks and support for 'lstat'. If
possible, get file's attributes and security information by
handle, not by name. Produce S_IFLNK bit for symlinks, when
called from 'lstat'.
(stat, lstat): New functions, call 'stat_worker'.
(symlink, readlink, careadlinkat): Rewritten to create and resolve
symlinks when the underlying filesystem supports them.
lib/src/ntlib.c (lstat): New function, calls 'stat'.
nt/inc/sys/stat.h (S_IFLNK): Define.
(S_ISLNK): A non-trivial definition.
(lstat): Prototype instead of a macro that redirects to 'stat'.
lisp/files.el (file-truename): Don't skip symlink-chasing part on
windows-nt. Incorporate the resolution of 8+3 short aliases on
Windows into the loop that recursively chases symlinks. Compare
directory and its parent case-insensitively on MS-Windows and
MS-DOS.
etc/NEWS: Announce the symlink support on MS-Windows.
Clarify the documentation of toggle-read-only, and audit the code tree
for uses of toggle-read-only; where appropriate, switch to setting the
variable buffer-read-only or calling toggle-read-only with a (new)
second arg.
* lisp/files.el (toggle-read-only): Doc fix and code cleanup. New arg
to allow printing the message when called from Lisp.
* lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
Remove toggle-read-only.
* lisp/bindings.el (mode-line-toggle-read-only):
* lisp/dired.el (dired-toggle-read-only):
* lisp/ibuffer.el (ibuffer-do-toggle-read-only): Call toggle-read-only
with non-nil second arg.
* lisp/bs.el (bs-toggle-readonly):
* lisp/buff-menu.el (Buffer-menu-toggle-read-only): Remove
with-no-warnings around toggle-read-only.
* lisp/ffap.el (ffap--toggle-read-only): Accept a list of buffers.
Remove with-no-warnings around toggle-read-only.
(ffap-read-only, ffap-read-only-other-window)
(ffap-read-only-other-frame): Callers changed.
* lisp/help-mode.el: Don't require view package.
(help-mode-finish): Set buffer-read-only instead of calling
toggle-read-only.
* lisp/emacs-lisp/eieio-custom.el (eieio-customize-object):
* lisp/vc/ediff.el (ediff-set-read-only-in-buf-A): Set buffer-read-only
directly.
* lisp/gnus/smime.el (smime-certificate-info): Set buffer-read-only directly,
instead of calling toggle-read-only with a (bogus) argument.
* doc/emacs/buffers.texi (Misc Buffer): Document view-read-only.
* doc/lispref/buffers.texi (Read Only Buffers): Document toggle-read-only
changes. Reword to account for the fact that read-only is currently not
supported in overlay properties.
(find-file--read-only): New function.
(find-file-read-only, find-file-read-only-other-window)
(find-file-read-only-other-frame): Use it.
(insert-file-contents-literally): Don't `fset'.
(get-free-disk-space): Use locate-dominating-file.
lisp/files.el (file-relative-name): Compare file names
case-insensitively if on MS-Windows or MS-DOS, or if
read-file-name-completion-ignore-case is non-nil. Don't use
case-fold-search for this purpose.
* lisp/autoinsert.el, lisp/cus-dep.el, lisp/doc-view.el, lisp/image-dired.el,
* lisp/woman.el, lisp/eshell/esh-cmd.el, lisp/progmodes/ada-xref.el,
* lisp/progmodes/cc-defs.el, lisp/progmodes/cperl-mode.el,
* lisp/progmodes/flymake.el, lisp/progmodes/gud.el, lisp/progmodes/idlwave.el,
* lisp/textmodes/ispell.el, lisp/textmodes/reftex-ref.el,
* lisp/textmodes/tex-mode.el: Use it.
Did not touch cedet and org because they are maintained elsewhere.
* lisp/emacs-lisp/gv.el (gv-get): Autoload functions to find their
gv-expander.
(gv--defun-declaration): New function.
(defun-declarations-alist): Use it.
(gv-define-modify-macro, gv-pushnew!, gv-inc!, gv-dec!): Remove.
(gv-place): Autoload.
* lisp/emacs-lisp/cl.el (cl--dotimes, cl--dolist): Remember subr.el's
original definition of dotimes and dolist.
* lisp/emacs-lisp/cl-macs.el (cl-expr-access-order): Remove unused.
(cl-dolist, cl-dotimes): Use `dolist' and `dotimes'.
* lisp/emacs-lisp/cl-lib.el: Move gv handlers from cl-macs to here.
(cl-fifth, cl-sixth, cl-seventh, cl-eighth)
(cl-ninth, cl-tenth): Move gv handler to the function's definition.
* lisp/emacs-lisp/cl-extra.el (cl-subseq, cl-get, cl-getf): Move gv handler
to the function's definition.
* lisp/Makefile.in (COMPILE_FIRST): Re-order to speed it up by about 50%.
* lisp/window.el:
* lisp/files.el:
* lisp/faces.el:
* lisp/env.el: Don't use CL.
* lisp/startup.el (argv, argi): Make lexically scoped.
* lisp/emacs-lisp/float-sup.el (pi): Use internal-make-var-non-special.
* lisp/emacs-lisp/cl-macs.el: Use lexical-binding.
Rename cl-bind-* to cl--bind-*.
* lisp/files.el: Don't require `cl' since it doesn't use it.
* lisp/emacs-lisp/pcase.el, lisp/emacs-lisp/macroexp.el: Add coding cookie.
* src/eval.c (Fmake_var_non_special): New primitive.
(syms_of_eval): Defsubr it.
* src/lread.c (syms_of_lread): Mark `values' as lexically scoped.
* doc/lispref/os.texi (Killing Emacs): Copyedits.
(Suspending Emacs): Copyedits. Mention not very relevant with GUIs.
Shorten the example, use more standard shell prompts.
* lisp/files.el (save-buffers-kill-emacs): Doc fix.
Now return nil when one or both files doesn't exists.
(file-subdir-of-p): Now only top directory must exists,
return nil if it doesn't.
(copy-directory): No need to test with `file-subdir-of-p' after creating dir.
* tramp.el (tramp-file-name-for-operation): Rename `files-equal-p' to `file-equal-p'.
* files.texi: Rename `files-equal-p' to `file-equal-p'.
* lisp/files.el (files-equal-p): Doc fix.
(file-subdir-of-p): Doc fix. Convert loop macro to plain Lisp,
and quit the loop once a mismatch is found.
* doc/lispref/files.texi (Kinds of Files): Improve documentation of
files-equal-p and file-subdir-of-p.
* lisp/files.el (files-equal-p): New, simple equality check between two filename.
(file-subdir-of-p): New, Check if dir1 is subdir of dir2.
(copy-directory): Return error when trying to copy a directory on itself.
Add missing copy-contents arg to tramp handler.
* lisp/dired-aux.el (dired-copy-file-recursive): Same.
(dired-create-files): Modify destination when source is equal to dest when copying files.
Return also when dest is a subdir of source.
* lisp/files.el (local-enable-local-variables): Doc fix.
(inhibit-local-variables-regexps): Rename from inhibit-first-line-modes-regexps.
Keep old name as obsolete alias. Doc fix.
Add some extensions from auto-coding-alist.
(inhibit-local-variables-suffixes):
Rename from inhibit-first-line-modes-suffixes. Doc fix.
(inhibit-local-variables-p): New function, extracted from set-auto-mode-1.
(set-auto-mode): Doc fix. Respect inhibit-local-variables-regexps.
(set-auto-mode-1): Doc fix. Use inhibit-local-variables-p.
(hack-local-variables): Doc fix.
Make the mode-only case respect enable-local-variables and friends.
Respect inhibit-local-variables-regexps for file-locals,
but not for directory-locals.
(set-visited-file-name): Take account of inhibit-local-variables-regexps.
Whether it applies may change as the file name is changed.
* lisp/jka-cmpr-hook.el (jka-compr-install):
* lisp/jka-compr.el (jka-compr-uninstall):
Update for inhibit-first-line-modes-suffixes name change.
* etc/NEWS: Mention this change.
Fixes: debbugs:10506
* doc/emacs/custom.texi (Specifying File Variables): The mode: keyword
doesn't have to be first anymore. Add example of specifying minor
modes.
(Directory Variables): Simplify example. Mention application to
non-file buffers.
(Disabling): Use "initialization file" terminology.
(Init Examples): Fix hook example.
* doc/lispref/variables.texi (Directory Local Variables): Document
hack-dir-local-variables-non-file-buffer.
* lisp/files.el (hack-dir-local-variables-non-file-buffer): Add doc.
(hack-one-local-variable-eval-safep): Allow 0 arg for minor mode
functions, along with 1 and -1.
* lisp/window.el (switch-to-buffer): Better match Emacs-23 behavior and only
use pop-to-buffer if the selected window can't be used.
(pop-to-buffer-same-window): Use display-buffer--same-window-action.
Fixes: debbugs:10144
* doc/lispref/buffers.texi (Read Only Buffers): Expand a bit on why
toggle-read-only should only be used interactively.
* lisp/files.el (toggle-read-only): Mention that it should only
be used interactively.
* lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
Add toggle-read-only.
It hasn't worked in a VC sense since 2008-05-02T07:12:59Z!esr@snark.thyrsus.com, though this was
not documented at the time (grr).
* lisp/vc/vc-hooks.el (vc-toggle-read-only): Make it an obsolete alias
for toggle-read-only. Note that this hasn't called vc-next-action
since 2008-05-02, though it wasn't documented at the time.
* lisp/files.el (toggle-read-only): Remove obsolete comment about
version control.
* doc/emacs/buffers.texi (Misc Buffer): Don't mention vc-toggle-read-only.
* lisp/cedet/ede.el (ede-maybe-checkout): Function deleted;
vc-toggle-read-only does not do version control now.
* lisp/cedet/ede/project-am.el (project-remove-file, project-add-file)
(project-new-target): Don't call ede-maybe-checkout.
* lisp/cedet/ede/util.el (ede-make-buffer-writable): Don't use
vc-toggle-read-only.
* lisp/vc/ediff-init.el (ediff-toggle-read-only-function): Use
toggle-read-only.
* files.el (set-auto-mode): Call `file-name-sans-versions' for the
complete `buffer-file-name', the local file name part could look
remotely (for example on VMS).
* net/ange-ftp.el (ange-ftp-run-real-handler): Make it an alias of
`tramp-run-real-handler'.
(ange-ftp-fix-name-for-vms): Handle the case, where `name' is
already quoted by '"'.
* net/tramp.el (tramp-rfn-eshadow-update-overlay): Ignore errors.
Let `file-name-handler-alist' be nil, the local file name part
could look remotely (for example on VMS).
(dired-do-chxxx): Treat empty input for "touch" as no -t option.
Omit initial minibuffer contents.
(dired-do-chmod): Signal an error on empty input.
(dired-mark-read-string): Don't return default on empty input.
* files.el (file-modes-symbolic-to-number): Doc fix.
Fixes: debbugs:9361
* lisp/cus-edit.el (customize-push-and-save): New function.
* lisp/files.el (hack-local-variables-confirm): Use it.
* lisp/custom.el (load-theme): New arg NO-CONFIRM. Use
customize-push-and-save (Bug#8720).
(custom-enabled-themes): Doc fix.
* lisp/cus-theme.el (customize-create-theme)
(custom-theme-merge-theme): Callers to load-theme changed.
* buffer.c: New Lisp objects Qbuffer_list_update_hook and
Qclone_number. Remove external declaration of Qdelete_window.
(Fbuffer_list): Rewrite doc-string. Minor restructuring of
code.
(Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run
Qbuffer_list_update_hook if allowed.
(Fother_buffer): Rewrite doc-string. Major rewrite for new
buffer list implementation.
(other_buffer_safely): New function.
(Fkill_buffer): Replace call to replace_buffer_in_all_windows by
calls to replace_buffer_in_windows and
replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
if allowed.
(record_buffer): Inhibit quitting and rewrite using quittable
functions. Run Qbuffer_list_update_hook if allowed.
(Frecord_buffer, Funrecord_buffer): New functions.
(switch_to_buffer_1, Fswitch_to_buffer): Remove. Move
switch-to-buffer to window.el.
(bury-buffer): Move to window.el.
(Vbuffer_list_update_hook): New variable.
* lisp.h (other_buffer_safely): Add prototype in buffer.c
section.
* window.h (resize_frame_windows): Move up in code.
(Fwindow_frame): Remove EXFUN.
(replace_buffer_in_all_windows): Remove prototype.
(replace_buffer_in_windows_safely): Add prototype.
* window.c: Declare Qdelete_window static again. Move down
declaration of select_count.
(Fnext_window, Fprevious_window): Rewrite doc-strings.
(Fother_window): Move to window.el.
(window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
(Fdelete_windows_on, Freplace_buffer_in_windows): Move to
window.el.
(replace_buffer_in_windows): Implement by calling
Qreplace_buffer_in_windows.
(replace_buffer_in_all_windows): Remove with some functionality
moved into replace_buffer_in_windows_safely.
(replace_buffer_in_windows_safely): New function.
(select_window_norecord, select_frame_norecord): Move in front
of run_window_configuration_change_hook. Remove now obsolete
declarations.
(Fset_window_buffer): Rewrite doc-string. Call
Qrecord_window_buffer.
(keys_of_window): Move binding for other-window to window.el.
* loadup.el (top-level): Load window before files for the sake
of replace-buffer-in-windows.
* files.el (read-buffer-to-switch)
(switch-to-buffer-other-window)
(switch-to-buffer-other-frame, display-buffer-other-frame): Move
to window.el.
* simple.el (get-next-valid-buffer, last-buffer, next-buffer)
(previous-buffer): Move to window.el.
* bindings.el (unbury-buffer): Move to window.el.
* window.el (delete-other-windows-vertically): Move after
definition of delete-other-windows.
(other-window, delete-windows-on, replace-buffer-in-windows):
Move here from window.c.
(record-window-buffer, unrecord-window-buffer)
(set-window-buffer-start-and-point, switch-to-prev-buffer)
(switch-to-next-buffer): New functions.
(get-next-valid-buffer, last-buffer, next-buffer): Move here
from simple.el. Call switch-to-next-buffer.
(previous-buffer): Move here from simple.el. Call
switch-to-prev-buffer.
(bury-buffer): Move here from buffer.c. Switch to previous
buffer when window cannot be deleted.
(unbury-buffer): Move here from bindings.el.
(ctl-x-map): Move binding for other-window from window.c to
here.
(read-buffer-to-switch, switch-to-buffer-other-window)
(switch-to-buffer-other-frame): Move here from files.el.
(normalize-buffer-to-switch-to): New functions.
(switch-to-buffer): Move here from buffer.c. Use
read-buffer-to-switch and normalize-buffer-to-switch-to.
* lisp/files.el (set-auto-mode):
Also respect mode: entries at the end of the file.
* doc/lispref/modes.texi (Auto Major Mode):
Update for set-auto-mode changes.
* doc/emacs/custom.texi (Specifying File Variables):
Major modes no longer need come first.
* etc/NEWS: Mention this.
* lisp/files.el (hack-local-variables-prop-line): Small simplifications.
(hack-local-variables, hack-local-variables-prop-line):
If MODE-ONLY, return the mode, rather than just `t'.
* lisp/files.el (hack-one-local-variable-eval-safep):
Consider "eval: (foo-mode)" to be safe.
* doc/emacs/custom.texi (Specifying File Variables):
Deprecate using mode: for minor modes.
* etc/NEWS: Mention this.
* lisp/doc-view.el, lisp/net/soap-client.el:
Change "mode:" minor-mode file local variables to use "eval:".
lisp/files.el (file-size-human-readable): Produce one digit after
decimal, like "ls -lh" does.
lisp/ls-lisp.el (ls-lisp-format-file-size): Allow for 7 characters in
the file size representation.
lisp/files.el (file-size-human-readable): New function.
lisp/ls-lisp.el (ls-lisp-format-file-size): Use it, instead of
computing the representation inline. Don't require `cl'.
* lisp/simple.el: Lisp reimplement of list-processes. Based on an
earlier reimplementation by Leo Liu, but using tabulated-list.el.
(process-menu-mode): New major mode.
(list-processes--refresh, list-processes):
(process-menu-visit-buffer): New functions.
* lisp/files.el (save-buffers-kill-emacs): Don't assume any return
value of list-processes, which is undocumented anyway.
* lisp/files.el (after-find-file-from-revert-buffer): Remove variable.
(after-find-file): Dont' bind it.
(revert-buffer-in-progress-p): New variable.
(revert-buffer): Bind it.
Pass nil for `after-find-file-from-revert-buffer'.
* lisp/saveplace.el (save-place-find-file-hook): Use new variable
`rever-buffer-in-progress-p', not `after-find-file-from-revert-buffer'.
* etc/NEWS: New variable `revert-buffer-in-progress-p'.
lisp/files.el (file-ownership-preserved-p): Pass `integer' as an
explicit 2nd argument to `file-attributes'. If the file's owner
is the Administrators group on Windows, and the current user is
Administrator, consider that a match.
lisp/server.el (server-ensure-safe-dir): Consider server directory
safe on MS-Windows if its owner is the Administrators group while
the current Emacs user is Administrator. Use `=' to compare
numerical UIDs, since they could be integers or floats.
* lisp/files.el (dir-locals-collect-variables):
Add the ability to exclude subdirectories.
* doc/emacs/custom.texi (Directory Variables):
Give an example of excluding subdirectories.
* doc/lispref/variables.texi (Directory Local Variables):
Mention `(subdirs . nil)' alist element.
* etc/NEWS: Mention this addition.
* lisp/dired-x.el (dired-omit-here-always): Add `(subdirs . nil)' to locals.
* lisp/files.el (hack-local-variables-confirm, hack-local-variables-filter):
Doc fix (say _which_ directory `dir-name' is).
(hack-dir-local-variables): Fix setting of `dir-name'.
Previous value seems clearly wrong. Eg put a risky variable in a
dir-locals file, visit a file in a subdirectory, see which directory
it says the risky variables come from. It should be the one with the
associated directory variables, not the one containing the visited file.
* lisp/files.el (dir-locals-find-file): Doc fix.
Fix the check for cache elements that have no associated file,
and the mtime check for those that do.
Still to do: some places that use dir-locals-find-file assume the
result is always a file, which is not true. (The function name is
misleading.)
* lread.c (Qdir_ok): New constant.
(syms_of_lread): Initialize it.
(openp): Don't ignore directories if the predicate returns dir-ok.
Fixes: debbugs:7924
* lisp/files.el (lexical-binding): Add a safe-local-variable property.
* lisp/emacs-lisp/byte-opt.el (byte-inline-lapcode): Check how many elements
are added to the stack.
(byte-compile-splice-in-already-compiled-code): Don't touch lexical nor
byte-compile-depth now that byte-inline-lapcode does it for us.
(byte-compile-inline-expand): Don't inline dynbind byte code into
lexbind code, since it has to be done differently.
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
Correctly extract arglist from `closure's.
(byte-compile-cl-warn): Compiler-macros are run earlier now.
(byte-compile-top-level): Bind byte-compile-lexical-environment to nil,
except for lambdas.
(byte-compile-form): Don't run the compiler-macro expander here.
(byte-compile-let): Merge with byte-compile-let*.
Don't preserve-body-value if the body's value was discarded.
* lisp/emacs-lisp/cconv.el (cconv--set-diff, cconv--set-diff-map)
(cconv--map-diff, cconv--map-diff-elem, cconv--map-diff-set): New funs.
(cconv--env-var): New constant.
(cconv-closure-convert-rec): Use it and use them. Fix a typo that
ended up forgetting to remove entries from lmenvs in `let'.
For `lambda' use the outer `fvrs' when building the closure and don't
forget to remove `vars' from the `emvrs' and `lmenvs' of the body.
* lisp/emacs-lisp/cl-macs.el (cl-byte-compile-block): Disable optimization
in lexbind, because it needs a different implementation.
* src/bytecode.c (exec_byte_code): Fix handling of &rest.
* src/eval.c (Vinternal_interpreter_environment): Remove.
(syms_of_eval): Do declare Vinternal_interpreter_environment as
a global lisp var, but unintern it to hide it.
(Fcommandp):
* src/data.c (Finteractive_form): Understand `closure's.