lisp/simple.el (line-move): Force movement by logical lines for any
hscrolled window, not only when auto-hscroll-mode is on.
(line-move-visual): Update doc string to that effect.
See discussion at http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00193.html
* lisp/simple.el (count-words-region): Always count in the region.
Report the number of lines and characters too.
(count-words): New command, which counts in the buffer if the
region is inactive, as count-words-region used to.
(count-words--message): New function. Handle plurals.
(count-lines-region): Make it an alias for count-words-region.
* lisp/bindings.el (esc-map): Replace count-lines-region with
count-words-region.
* doc/emacs/basic.texi (Position Info): Omit page commands. Document
count-words-region and count-words.
* doc/emacs/text.texi (Pages): Move what-page documentation here.
lisp/simple.el (line-move): If auto-hscroll-mode is disabled and the
window is hscrolled, move by logical lines.
(line-move-visual): Update the doc string to the above effect.
lisp/simple.el (what-cursor-position): Use get-char-property-change
and next-single-char-property-change, to be able to show display
properties that come from overlays as well as text properties.
lisp/simple.el (line-move): If goal-column is set, move by logical
lines, not by display lines.
(next-line, previous-line, goal-column, line-move-visual): Doc fix
to reflect the above change.
lisp/simple.el (mail-encode-mml): New defvar.
lisp/mail/rmail.el (mail-encode-mml): Add a defvar.
(rmail-enable-mime-composing): Default to t.
(rmail-forward): Use MIME method of forwarding only if both
rmail-enable-mime-composing and rmail-enable-mime are non-nil.
Set mail-encode-mml non-nil if the MIME method was used.
lisp/mail/sendmail.el (mml-to-mime): Add autoload form.
(mail-encode-mml): Add a defvar.
(mail-mode): Make mail-encode-mml buffer-local and initialize it
to nil.
(mail-send): If mail-encode-mml is non-nil, run the outgoing
message through mml-to-mime, and reset mail-encode-mml to nil.
* 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/emacs-lisp/byte-run.el (make-obsolete-variable): New argument
`access-type' and new obsolescence format.
* lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Adjust to
new format.
(byte-compile-check-variable): New `access-type' argument.
Only warn if the access-type is obsolete.
(byte-compile-dynamic-variable-bind, byte-compile-variable-ref)
(byte-compile-variable-set): Adjust callers.
* lisp/help-fns.el (describe-variable): Adjust to new obsolescence format.
* lisp/mail/sendmail.el (mail-mailer-swallows-blank-line): Only mark
setting it as obsolete.
* lisp/simple.el (minibuffer-completing-symbol):
* lisp/font-lock.el (font-lock-beginning-of-syntax-function): Only mark read
access as obsolete.
* lisp/minibuffer.el (minibuffer-completing-file-name): Don't make it
obsolete yet.
* lisp/international/quail.el (quail-mouse-choose-completion): Remove unused
code referring to obsolete var.
(quail-choose-completion-string): Remove.
* lisp/server.el (server-clients-with, server-kill-buffer-query-function)
(server-kill-emacs-query-function): Silence "unused `proc'" warnings.
* lisp/proced.el (proced-send-signal):
* lisp/emacs-lisp/lisp.el (lisp-complete-symbol):
Replace completion-annotate-function with completion-extra-properties.
(overriding-map-is-bound): Remove.
(saved-overriding-map): Change default.
(save&set-overriding-map): Rename from ensure-overriding-map-is-bound;
Take the map as argument.
(universal-argument, negative-argument, digit-argument): Use it.
(restore-overriding-map): Adjust.
(do-auto-fill): Use fill-forward-paragraph.
(keyboard-quit): Don't signal an error when debug-on-quit is non-nil.
(completion-category-overrides): New defcustom.
(completion-metadata, completion--field-metadata)
(completion-metadata-get, completion--styles)
(completion--cycle-threshold): New functions.
(completion-try-completion, completion-all-completions):
Add `metadata' argument to choose completion-styles.
(completion--do-completion): Use metadata to choose cycling.
(completion-all-sorted-completions): Use metadata for sorting.
Remove :completion-cycle-penalty which is not needed any more.
(completion--try-word-completion): Add `metadata' argument.
(minibuffer-completion-help): Check metadata for annotation function
and sorting.
(completion-file-name-table): Return `category' metadata.
(minibuffer-completing-file-name): Make obsolete.
* lisp/simple.el (minibuffer-completing-symbol): Make obsolete.
* lisp/icomplete.el (icomplete-completions): Pass new `metadata' param to
completion-try-completion.
* src/minibuf.c (Finternal_complete_buffer): Return `category' metadata.
(read_minibuf): Use get_minibuffer.
(syms_of_minibuf): Use DEFSYM.
(Qmetadata): New var.
* src/data.c (Qbuffer): Don't make it static.
(syms_of_data): Use DEFSYM.
* lisp/minibuffer.el (completion--done): New fun.
(completion--do-completion): Use it. New arg `expect-exact'.
(minibuffer-complete, minibuffer-complete-word): Don't output message,
since completion--do-completion does it for us now.
(minibuffer-force-complete): Use completion--done and
completion--replace. Handle sole-completion case with more care.
(minibuffer-complete-and-exit): Use new `expect-exact' arg.
(completion-extra-properties): New var.
(completion-annotate-function): Make obsolete.
(minibuffer-completion-help): Adjust accordingly.
Use completion-list-insert-choice-function.
(completion-at-point, completion-help-at-point):
Bind completion-extra-properties.
(completion-pcm-word-delimiters): Add | (for uniquify, for example).
* lisp/simple.el (completion-list-insert-choice-function): New var.
(completion-setup-function): Preserve it.
(choose-completion): Pay attention to it, shuffle the code a bit.
(choose-completion-string): New arg `insert-function'.
* lisp/textmodes/bibtex.el: Convert to lexical binding.
(bibtex-mode-map): Use completion-at-point.
(bibtex-mode): Use define-derived-mode&completion-at-point-functions.
(bibtex-completion-at-point-function): New fun, from bibtex-complete.
(bibtex-complete): Define as obsolete alias.
(bibtex-complete-internal): Remove.
(bibtex-format-entry): Remove unused sub-group in regexp.
* lisp/shell.el (shell--command-completion-data)
(shell-environment-variable-completion):
* lisp/pcomplete.el (pcomplete-completions-at-point):
* lisp/comint.el (comint--complete-file-name-data): Use :exit-function
instead of completion-table-with-terminator so it also works for
choose-completion.
(minibuffer-complete-shell-command): Remove.
(read-shell-command): Setup completion vars here instead.
(read-expression-map): Bind TAB to symbol completion.
* 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/subr.el (apply-partially): Move from subr.el; don't use lexical-let.
(eval-after-load): Obey lexical-binding.
* lisp/simple.el (apply-partially): Move to subr.el.
* lisp/makefile.w32-in: Match changes in Makefile.in.
(BIG_STACK_DEPTH, BIG_STACK_OPTS, BYTE_COMPILE_FLAGS): New vars.
(.el.elc, compile-CMD, compile-SH, compile-always-CMD)
(compile-always-SH, compile-calc-CMD, compile-calc-SH): Use them.
(COMPILE_FIRST): Add pcase, macroexp, and cconv.
* lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Silence warning about
calling CL's `compiler-macroexpand'.
* lisp/emacs-lisp/bytecomp.el (byte-compile-preprocess): New function.
(byte-compile-initial-macro-environment)
(byte-compile-toplevel-file-form, byte-compile, byte-compile-sexp): Use it.
(byte-compile-eval, byte-compile-eval-before-compile): Obey lexical-binding.
(byte-compile--for-effect): Rename from `for-effect'.
(display-call-tree): Use case.
* lisp/emacs-lisp/byte-opt.el (for-effect): Don't declare as dynamic.
(byte-optimize-form-code-walker, byte-optimize-form):
Revert to old arg name.
* lisp/Makefile.in (BYTE_COMPILE_FLAGS): New var.
(compile-onefile, .el.elc, compile-calc, recompile): Use it.
* emacs-lisp/package.el (package-tar-file-info): Handle also
remote files.
* emacs-lisp/package-x.el (package-upload-buffer-internal): Use
`equal' for upload base check.