Paul W. Rankin [Wed, 24 Mar 2021 14:26:59 +0000 (00:26 +1000)]
Remove font-lock toggle from font-lock-update
* lisp/font-lock.el (font-lock-update): Remove call to
font-lock-unfontify-region and font-lock-mode toggle with ARG; this
did not perform what original author intended
Stefan Monnier [Tue, 23 Mar 2021 05:00:56 +0000 (01:00 -0400)]
* lisp/mh-e: Enable lexical-binding in all the files
* lisp/mh-e/mh-alias.el: Use lexical-binding.
(mh-alias-insert-file): Completion tables can be mere lists of strings.
* lisp/mh-e/mh-mime.el: Use lexical-binding.
(mh-mm-inline-message): Remove always-nil var `visible-headers`.
* lisp/mh-e/mh-search.el: Use lexical-binding.
(mh-search-folder): Remove unused var `pick-folder`.
* lisp/mh-e/mh-show.el: Use lexical-binding.
(mh-display-msg): Remove always-nil var `visible-headers`.
* lisp/mh-e/mh-utils.el: Use lexical-binding.
(completion-root-regexp): Always declare var.
* lisp/mh-e/mh-buffers.el: Use lexical-binding.
* lisp/mh-e/mh-comp.el: Use lexical-binding.
* lisp/mh-e/mh-folder.el: Use lexical-binding.
* lisp/mh-e/mh-funcs.el: Use lexical-binding.
* lisp/mh-e/mh-gnus.el: Use lexical-binding.
* lisp/mh-e/mh-identity.el: Use lexical-binding.
* lisp/mh-e/mh-inc.el: Use lexical-binding.
* lisp/mh-e/mh-junk.el: Use lexical-binding.
* lisp/mh-e/mh-letter.el: Use lexical-binding.
* lisp/mh-e/mh-limit.el: Use lexical-binding.
* lisp/mh-e/mh-print.el: Use lexical-binding.
* lisp/mh-e/mh-scan.el: Use lexical-binding.
* lisp/mh-e/mh-seq.el: Use lexical-binding.
* lisp/mh-e/mh-speed.el: Use lexical-binding.
* lisp/mh-e/mh-thread.el: Use lexical-binding.
* lisp/mh-e/mh-tool-bar.el: Use lexical-binding.
* lisp/mh-e/mh-xface.el: Use lexical-binding.
Juri Linkov [Mon, 22 Mar 2021 18:55:49 +0000 (20:55 +0200)]
* lisp/tab-bar.el (tab-bar-new-tab-group): Set default to t.
(tab-bar-tabs, tab-bar-select-tab, tab-bar-new-tab-to):
Use tab-bar--current-tab-make instead of tab-bar--current-tab.
(tab-bar--tab): Add arg 'frame' to tab-bar--current-tab-find.
(tab-bar--current-tab, tab-bar--current-tab-make): Move most of body
from the former to the latter, thus reverting tab-bar--current-tab
to its previous behavior.
https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00959.html
Alan Mackenzie [Sun, 21 Mar 2021 16:54:31 +0000 (16:54 +0000)]
Prevent open minibuffers getting lost when their frame gets deleted
This happened with minibuffer-follows-selected-frame set to t.
* doc/emacs/mini.texi (Basic Minibuffer): State where a command's action takes
place when a minibuffer's frame has been deleted.
* lisp/window.el (window--before-delete-windows, record-window-buffer): Take
into account that minibuffers are now recorded on w->prev_buffers field.
* src/fns.c (merge_c): New version of `merge' taking a C function, rather than
a Lisp function as the comparison function.
* src/frame.c (do_switch_frame): Pass arguments sf and for_deletion to
move_minibuffers_onnto_frame.
* src/lisp.h (top level): Declare merge_c and
move_minibuffers_onto_selected_frame.
* src/minibuf.c (MB_frame): New Lisp_Object recording the minibuffer's frame.
(choose_minibuf_frame): Remove all code except that which sets minibuf_window
to the current frame's minibuffer.
(minibuffer_ent_greater): New comparison function, passed to merge_c.
(zip_minibuffer_stacks): New function.
(move_minibuffers_onto_frame): Renamed from `move_minibuffer_onto_frame' given
two arguments, the old frame and for_deletion, and simplified. Minibuffers
are now stacked in the mini-window's ->prev_buffers field.
(read_minibuf): Several detailed amendments.
(exp_MB_frame): New Lisp_Object, the expired minibuffer's frame.
(read_minibuf_unwind): Search for the expired minibuffer's frame, rather than
taking it from (unreliable) variables. Switch temporarily to this frame for
tidying up operations.
(minibuffer_unwind): New function which pops a stacked minibuffer.
(syms_of_minibuf): Call staticpro for the two new Lisp variables.
* src/window.c (Fset_window_configuration): Don't record minibuffers with
record-window-buffer.
* src/xdisp.c (gui_consider_frame_title): Remove redundant Fselect_window,
which caused an unwanted frame switch. Amend the arguments to
format_mode_line_unwind_data to match.
* lisp/progmodes/project.el (project-shell): Behave the same way as
'M-x project-eshell'.
* lisp/shell.el (shell): Behave the same way as 'M-x eshell'.
* etc/NEWS: Add news entry describing the change.
* lisp/tutorial.el: Use lexical-binding.
Stefan Kangas [Sat, 20 Mar 2021 08:58:02 +0000 (09:58 +0100)]
Remove Gnus specific .dir-locals.el
* lisp/gnus/.dir-locals.el: Delete file. The only variable it set was
'show-trailing-whitespace', but this should be up to the individual
developer. (Bug#47278)
Stefan Kangas [Sat, 20 Mar 2021 00:16:26 +0000 (01:16 +0100)]
Assume something more recent than X11R6
* lisp/bindings.el:
* lisp/menu-bar.el:
* lisp/printing.el:
* lisp/thumbs.el (thumbs-conversion-program): Assume we have something
more recent than X11R6.
Stefan Monnier [Fri, 19 Mar 2021 23:04:27 +0000 (19:04 -0400)]
* lisp/wdired.el: Use lexical-binding
Remove redundant `:group` args.
(wdired-change-to-wdired-mode): Use `add-function` to modify
`revert-buffer-function`.
(wdired-change-to-dired-mode): Adjust accordingly.
(wdired-do-renames): Make sure to bind `dired-backup-overwrite` dynamically.
Stefan Monnier [Fri, 19 Mar 2021 22:33:38 +0000 (18:33 -0400)]
* lisp/emacs-lisp/bytecomp.el: Remember location of unresolved calls
I've gotten tired of seeing the "function foo not known to be defined"
warning without any line number information. So this patch adds as
line number the position of the first use of that function in the file
(well, approximately, as usual).
(byte-compile-unresolved-functions): Add POSITIONs in the alist.
(byte-compile-function-warn): Store the current position in
`byte-compile-unresolved-functions`.
(byte-compile-arglist-warn): Adjust accordingly.
(byte-compile-print-syms): Delete unused function.
(byte-compile-warn-about-unresolved-functions): Use the stored position
to give more precise warnings.
Eli Zaretskii [Fri, 19 Mar 2021 12:46:15 +0000 (14:46 +0200)]
Improve the docs of a recent change in mb-depth.el
* lisp/mb-depth.el (minibuffer-depth-indicator-function): Improve
the wording of the doc string and of the label used for the
default value. (Bug#47252)
Stefan Monnier [Fri, 19 Mar 2021 03:14:33 +0000 (23:14 -0400)]
lisp/erc: Use lexical-binding
Also remove various redundant `:group` arguments.
* lisp/erc/erc-backend.el (define-erc-response-handler): Move `declare`
after the docstring.
* lisp/erc/erc-capab.el: Use lexical-binding.
(erc-capab-identify-activate): Simplify with `member`.
* lisp/erc/erc-dcc.el (erc-dcc): Move before erc-dcc-mode definition,
which refers to it.
(erc-dcc-chat-accept): Remove unused vars `nick` and `buffer`.
* lisp/erc/erc-imenu.el: Use lexical-binding.
(erc-create-imenu-index): Remove unused var `prev-pos`.
* lisp/erc/erc-match.el: Use lexical-binding.
(erc-match-message): Remove unused var `old-pt`.
(erc-match-message): Strength-reduce `eval` to `symbol-value`.
* lisp/erc/erc-page.el: Use lexical-binding.
(erc-page): Move Custom group before `erg-page-mode` which refers to it.
* lisp/erc/erc-replace.el: Use lexical-binding.
(erc-replace-insert): Use `functionp`.
* lisp/erc/erc-status-sidebar.el: Use lexical-binding.
(erc-status-sidebar-open): Remove unused var `sidebar-window`.
* lisp/erc/erc.el: Fix header to use the customary 3 semi-colons.
(erc-fill-column): Declare variable.
* lisp/erc/erc-autoaway.el: Use lexical-binding.
* lisp/erc/erc-ezbounce.el: Use lexical-binding.
* lisp/erc/erc-fill.el: Use lexical-binding.
* lisp/erc/erc-goodies.el: Use lexical-binding.
* lisp/erc/erc-ibuffer.el: Use lexical-binding.
* lisp/erc/erc-identd.el: Use lexical-binding.
* lisp/erc/erc-join.el: Use lexical-binding.
* lisp/erc/erc-lang.el: Use lexical-binding.
* lisp/erc/erc-log.el: Use lexical-binding.
* lisp/erc/erc-menu.el: Use lexical-binding.
* lisp/erc/erc-netsplit.el: Use lexical-binding.
* lisp/erc/erc-networks.el: Use lexical-binding.
* lisp/erc/erc-pcomplete.el: Use lexical-binding.
* lisp/erc/erc-ring.el: Use lexical-binding.
* lisp/erc/erc-speedbar.el: Use lexical-binding.
* lisp/erc/erc-spelling.el: Use lexical-binding.
* lisp/erc/erc-truncate.el: Use lexical-binding.
* lisp/erc/erc-xdcc.el: Use lexical-binding.
* lisp/emacs-lisp/chart.el (chart-face-list): Allow a function as
the value (bug#47133) so that we can compute the faces dynamically
on different displays.
(chart--face-list): New function.
(chart-draw-data): Use it.
Document that `buffer-string' retains text properties
* doc/lispref/text.texi (Buffer Contents): Mention text properties
in the `buffer-string' documentation.
* src/editfns.c (Fbuffer_string): Mention text properties in the
doc string (bug#47220).
(uniquify-item): New slot 'original-dirname'.
(uniquify-rationalize-file-buffer-names): Use new slot.
(uniquify-rationalize): Use new slot.
(uniquify-get-proposed-name): New optional argument 'original-dirname'
to properly add a trailing separator when the corresponding user option
is set and the dirname is an existing directory (bug#47132).
Fix problem of trashing files to an inconsistent trash directory
* lisp/files.el (move-file-to-trash): Allow moving files to trash
even if there's a file in trash with the same name (but no entry
in info) (bug#47135).
Document that `buffer-string' retains text properties
* doc/lispref/text.texi (Buffer Contents): Mention text properties
in the `buffer-string' documentation.
* src/editfns.c (Fbuffer_string): Mention text properties in the
doc string (bug#47220).
Stefan Monnier [Thu, 18 Mar 2021 03:32:39 +0000 (23:32 -0400)]
* lisp/textmodes: Use lexical-binding
* lisp/textmodes/enriched.el: Use lexical-binding.
(enriched-mode): Use `delete-dups` to avoid `add-to-list` on
a local variable.
* lisp/textmodes/makeinfo.el: Use lexical-binding.
(makeinfo-region): Remove unused var `filename-or-header`.
* lisp/textmodes/refbib.el: Use lexical-binding.
(r2b-put-field): Remove unused var `multi-line`.
(r2b-barf-output): Remove unused var `match`.
* lisp/textmodes/refer.el: Use lexical-binding.
(refer-find-entry-internal): Remove unused vars `old-buffer` and `found`.
* lisp/textmodes/reftex-auc.el: Use lexical-binding.
(LaTeX-add-bibitems): Declare function.
(reftex-plug-into-AUCTeX): Use `add-function` and `advice-add` so we
can properly unplug.
* lisp/textmodes/reftex-cite.el: Use lexical-binding.
(reftex-create-bibtex-file): Remove unused var `file`.
(reftex--found-list): Declare var.
(reftex-offer-bib-menu): Rename local var to `reftex--found-list`.
* lisp/textmodes/reftex-dcr.el: Use lexical-binding.
(reftex-use-itimer-in-xemacs): Delete XEmacs-only var.
(reftex-toggle-auto-view-crossref): Delete XEmacs-only code.
(reftex-start-itimer-once): Delete XEmacs-only function.
* lisp/textmodes/reftex-global.el: Use lexical-binding.
(reftex-isearch-push-state-function): Use a closure instead of `(lambda).
* lisp/textmodes/reftex-index.el: Use lexical-binding.
(mark-active, transient-mark-mode): Delete var declarations.
(reftex-index-mode-map): Remove XEmacs-only code.
Use `mapc` so we can use closures instead of hand-built lambdas.
(reftex-index-next, reftex-index-previous): Tweak interactive spec to
remove unused prefix arg and mark it as a motion command.
(reftex-index-phrases-font-lock-keywords)
(reftex-index-phrases-font-lock-keywords): Move initialization into
declaration.
(reftex-index-initialize-phrases-buffer, reftex-index-phrases-mode)
reftex-index-phrases-apply-to-region: Remove XEmacs-only code.
(TeX-master): Remove redundant declaration.
(reftex--chars-first): Rename dynvar from `chars-first`. Adjust all uses.
* lisp/textmodes/reftex-parse.el: Use lexical-binding.
* lisp/textmodes/reftex-ref.el: Use lexical-binding.
(reftex-label): Remove always-nil var `text`.
(reftex-refstyle): Declare before first use.
(<toplevel>): Use closures rather than `eval` when building commands from
`reftex-ref-style-alist`.
* lisp/textmodes/reftex-sel.el: Use lexical-binding.
(reftex-select-label-mode-map, reftex-select-bib-mode-map):
Use `mapc` so we can use closures instead of hand-built lambdas.
(reftex-select-label-mode, reftex-select-bib-mode): Remove XEmacs-only code.
(reftex-select-data, reftex-select-prompt, reftex-refstyle):
Move declaration before first use.
(reftex--found-list, reftex--cb-flag, reftex--last-data)
(reftex--call-back, reftex--help-string): Move declaration before use,
and rename by adding `reftext--` prefix. Adjust all uses in this file.
For `reftex--found-list` adjust corresponding uses in `reftex-cite.el`.
(reftex-select-item): Explicitly let-bind them.
Remove XEmacs-only code.
* lisp/textmodes/reftex-vars.el: Use lexical-binding.
* lisp/textmodes/reftex.el: Use lexical-binding.
(reftex-mode-map, reftex-mode, reftex-fontify-select-label-buffer)
(reftex-verified-face): Remove XEmacs-only code.
(reftex-region-active-p, reftex-overlay-put, reftex-move-overlay)
(reftex-make-overlay, reftex-get-buffer-visiting, reftex-delete-overlay):
Redefine as obsolete aliases. Replace all callers.
(current-message): Remove XEmacs-only definition.
* lisp/textmodes/remember.el: Use lexical-binding.
* lisp/textmodes/table.el (<toplevel>): Use closures rather than `(lambda)
to build commands.
* lisp/textmodes/texinfmt.el: Use lexical-binding.
(texinfo-example-start): Declare var.
(texinfo-format-region, texinfo-format-buffer-1): Remove unused var
`last-input-buffer`.
(texinfo-format-scan): Use `dlet` to bind `whitespace-silent`.
(texinfo-optional-braces-discard, texinfo-format-parse-line-args)
(texinfo-format-parse-args): Remove unused var `start`.
(texinfo-multitable-widths): Remove unused var `start-of-templates`.
(texinfo-multitable-item): Strength-reduce `eval` to `symbol-value`.
(texinfo-alias): Remove unused vars `start` and `args`.
(texinfo-defun-type symbol-property): Change the car to help the type
symbol rather than an expression returning it.
(texinfo-format-deffn): Remove corresponding `eval`.
(texinfo-clear): Remove unused var `value`.
(texinfo-format-ifeq): Remove unused var `end`.
* lisp/textmodes/texinfo.el: Use lexical-binding.
(tex-show-print-queue): Declare function.
* lisp/textmodes/texnfo-upd.el: Use lexical-binding.
(texinfo-start-menu-description): Remove unused var `end`.
(texinfo-insert-node-lines): Remove unused var `beginning-marker`.
(texinfo-multiple-files-update): Remove unused vars `next-node-name`
and `previous-node-name`.
* lisp/textmodes/two-column.el: Use lexical-binding.
Dmitry Gutov [Thu, 18 Mar 2021 00:35:10 +0000 (02:35 +0200)]
Leave signaling the exact error to cl-generic's internals
* lisp/progmodes/project.el (project-root): Extract default
definition to a new method, predicated on a context
(https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00771.html).