* 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).
Juri Linkov [Wed, 17 Mar 2021 17:42:27 +0000 (19:42 +0200)]
* lisp/tab-bar.el: New faces and face options.
* lisp/tab-bar.el (tab-bar-tab-group-current)
(tab-bar-tab-group-inactive, tab-bar-tab-ungrouped): New deffaces.
(tab-bar-tab-face-function): New defcustom.
(tab-bar-tab-face-default): New function.
(tab-bar-tab-name-format-default): Use it.
(tab-bar-tab-group-format-default): Use tab-bar-tab-group-inactive face.
(tab-bar-tab-group-face-function): New defcustom.
(tab-bar-tab-group-face-default): New function.
(tab-bar--format-tab-group): Add new arg 'current-p'.
(tab-bar-format-tabs-groups): Prepend current group name before first tab.
Override tab-bar-tab-face-function with tab-bar-tab-group-face-function.
Juri Linkov [Tue, 16 Mar 2021 17:53:27 +0000 (19:53 +0200)]
* lisp/tab-bar.el: Simplify internal functions.
* lisp/tab-bar.el (tab-bar-tabs-set): New function.
(tab-bar-tabs): Use tab-bar--current-tab-find and tab-bar-tabs-set.
(tab-bar--tab): Use tab-bar--current-tab-find.
(tab-bar--current-tab): Remove unused line (assq 'current-tab ...)
because there is no current-tab when it's called. Remove unused arg 'frame'.
(tab-bar--current-tab-find): Simplify.
(tab-bar-move-tab-to, tab-bar-move-tab-to-frame)
(tab-bar-new-tab-to, tab-bar-close-tab)
(tab-bar-close-other-tabs, tab-bar-undo-close-tab)
(tab-switcher-delete-from-list): Use tab-bar-tabs-set
instead of set-frame-parameter.
(tab-bar-close-group-tabs): Simplify using tab-bar--current-tab-find
without arg.
Michael Albinus [Tue, 16 Mar 2021 17:40:24 +0000 (18:40 +0100)]
Fix problem of image-tests.el on emba
* test/README: Mention $EMACS_TEST_DIRECTORY.
* test/lisp/image-tests.el (image-tests--emacs-images-directory):
Use `data-directory', for runs w/o of make.
(image-type/from-filename): Check for `image-load-path'.
Daniel Martín [Tue, 16 Mar 2021 00:29:28 +0000 (01:29 +0100)]
Add minibuffer input support to commands that set the frame size
* lisp/frame.el (set-frame-property--interactive): Internal function to
produce the interactive form of `set-frame-width' and
`set-frame-height'. Offer the current size as default. (Bug#9970)
* src/frame.c (Fset_frame_height): Modify to call
`set-frame-property--interactive'.
(Fset_frame_width): Modify to call `set-frame-property--interactive'.
* doc/lispref/frames.texi (Frame Size): Update the manuals.
* etc/NEWS: Advertise the change (bug#9970).
Juri Linkov [Mon, 15 Mar 2021 17:20:06 +0000 (19:20 +0200)]
* lisp/tab-bar.el (tab-bar-tab-group-format-function): New defcustom.
(tab-bar-tab-group-default): New function.
(tab-bar-tab-group-format-default, tab-bar-format-tabs-groups)
(tab-bar-change-tab-group, tab-bar-close-group-tabs): Use it.
Glenn Morris [Mon, 15 Mar 2021 15:51:05 +0000 (08:51 -0700)]
* CONTRIBUTE: Refer to gnulib for request-assign.future.
The vast majority of the exchanges on this topic are "please send me
the form; ok I sent you the form", and there's no need to involve a
mailing list for that.
Stefan Monnier [Mon, 15 Mar 2021 04:08:34 +0000 (00:08 -0400)]
* lisp/cedet: Convert remaining files to lexical-binding
Remove a few more redundant `:group` args.
Make use of lexical scoping to replace `(lambda...) with proper closures.
* lisp/cedet/ede/custom.el (ede-project-sort-targets-list):
Use `dotimes` and replace `(lambda..) with closures.
* lisp/cedet/ede/proj-comp.el (proj-comp-insert-variable-once):
* lisp/cedet/ede/pmake.el (ede-pmake-insert-variable-once):
Remove unused var `addcr`.
* lisp/cedet/semantic/complete.el: Use lexical-binding.
(semantic-displayer-show-request): Remove unused var `typing-count`.
Use `equal` instead of `stringp+string=`.
* lisp/cedet/semantic/db-ebrowse.el: Use lexical-binding.
(semanticdb-create-ebrowse-database): Remove unused vars `mma` and `regexp`.
(semanticdb-ebrowse-strip-trees): Remove unused var `class` and `filename`.
(semanticdb-ebrowse-add-globals-to-table): Remove unused var `fname`.
* lisp/cedet/semantic/db-find.el: Use lexical-binding.
(semanticdb-find-adebug-insert-scanned-tag-cons): Remove always-nil var
`tip`.
* lisp/cedet/semantic/db-global.el: Use lexical-binding.
(semanticdb-enable-gnu-global-databases): Access local var
`semantic--ih` by sticking its value in the code passed to `eval`
rather than by dynamic scoping.
* lisp/cedet/semantic/db-typecache.el: Use lexical-binding.
(semanticdb-db-typecache-dump): Remove unused var `junk`.
* lisp/cedet/semantic/debug.el: Use lexical-binding.
* lisp/cedet/semantic/dep.el: Use lexical-binding.
(semantic-add-system-include): Avoid `add-to-list` on a local variable.
Access local var `value` by sticking its value in the code passed to
`eval` rather than by dynamic scoping.
(semantic-remove-system-include): Don't use `delete` on a list received
from elsewhere.
Access local var `value` by sticking its value in the code passed to
`eval` rather than by dynamic scoping.
(semantic-reset-system-include): Simplify a bit.
* lisp/cedet/semantic/ede-grammar.el: Use lexical-binding.
(project-compile-target): Remove unused vars `csrc` and `cb`.
Use `cl-incf`. Remove apparently unneeded `with-no-warnings`.
* lisp/cedet/semantic/edit.el: Use lexical-binding.
(semantic-edits-change-over-tags): Remove unused var `inner-start`.
(semantic-edits-incremental-parser-1): Silence warnings about
intentionally unused var `last-cond`.
* lisp/cedet/semantic/ia-sb.el: Use lexical-binding.
(semantic-ia-sb-key-map): Move initialization into declaration.
(semantic-ia-sb-more-buttons): Remove unused var `idx`.
(semantic-ia-sb-line-path): Simplify `if` -> `or`.
* lisp/cedet/semantic/idle.el (semantic-idle-breadcrumbs--tag-function):
Make it a function returning a closure.
* lisp/cedet/semantic/senator.el: Use lexical-binding.
(senator-search-set-tag-class-filter): Replace `(lambda..) with a closure.
* lisp/cedet/semantic/sort.el: Use lexical-binding.
(semanticdb-search-system-databases): Declare var.
(semantic-tag-external-member-children-default): Replace `(lambda..)
with a closure.
* lisp/cedet/semantic/tag-ls.el: Use lexical-binding.
(semantic-tag-protection-default, semantic-tag-abstract-p-default):
Simplify with `member`.
* lisp/cedet/semantic/util.el: Use lexical-binding.
(semantic-something-to-tag-table): Declare function
`semanticdb-abstract-table--eieio-childp` called via `cl-typep`.
* lisp/cedet/semantic/bovine/scm.el (semantic-default-scheme-setup):
Remove duplicate setting of `imenu-create-index-function`.
* lisp/cedet/semantic/decorate/mode.el (semantic-decoration-build-style-menu):
Replace `(lambda..) with a closure.
* lisp/cedet/srecode/mode.el (srecode-minor-mode-templates-menu):
Replace `(lambda..) with a closure. Use `push`.
* lisp/cedet/semantic/chart.el: Use lexical-binding.
* lisp/cedet/semantic/db-debug.el: Use lexical-binding.
* lisp/cedet/semantic/db-el.el: Use lexical-binding.
* lisp/cedet/semantic/db-file.el: Use lexical-binding.
* lisp/cedet/semantic/db-javascript.el: Use lexical-binding.
* lisp/cedet/semantic/db-mode.el: Use lexical-binding.
* lisp/cedet/semantic/db-ref.el: Use lexical-binding.
* lisp/cedet/semantic/decorate.el: Use lexical-binding.
* lisp/cedet/semantic/doc.el: Use lexical-binding.
* lisp/cedet/semantic/find.el: Use lexical-binding.
* lisp/cedet/semantic/format.el: Use lexical-binding.
* lisp/cedet/semantic/html.el: Use lexical-binding.
* lisp/cedet/semantic/ia.el: Use lexical-binding.
* lisp/cedet/semantic/imenu.el: Use lexical-binding.
* lisp/cedet/semantic/java.el: Use lexical-binding.
* lisp/cedet/semantic/mru-bookmark.el: Use lexical-binding.
* lisp/cedet/semantic/symref.el: Use lexical-binding.
* lisp/cedet/semantic/tag-file.el: Use lexical-binding.
* lisp/cedet/semantic/tag-write.el: Use lexical-binding.
* lisp/cedet/semantic/texi.el: Use lexical-binding.
* lisp/cedet/semantic/util-modes.el: Use lexical-binding.
Init archive and add noconfirm to 'package-install-selected-packages'
* lisp/emacs-lisp/package.el (package-install-selected-packages):
Add call to 'package--archives-initialize' and add optional argument
NOCONFIRM to skip user confirmation when installing packages. (Bug#47124)
Stefan Monnier [Sun, 14 Mar 2021 15:35:55 +0000 (11:35 -0400)]
Revert "* lisp/calendar/appt.el (appt-activate): Set the local `write-file-functions`"
This reverts commit 587a97bcb23bc6ea429ab790efa03f2260a9bca8.
We really do want to affect the global part of the hook.
Reported by Gabriel <gabriel376@hotmail.com>.
Juri Linkov [Sun, 14 Mar 2021 09:29:31 +0000 (11:29 +0200)]
* lisp/tab-bar.el: Tab groups can be displayed with tab-bar-format-tabs-groups
* lisp/tab-bar.el (tab-bar-format): Turn defvar into defcustom.
Add :options and force-mode-line-update in :set.
(tab-bar--format-tab): New function refactored from tab-bar-format-tabs.
(tab-bar-format-tabs): Move most of code to tab-bar--format-tab and call it.
(tab-bar-tab-group-format-function): New defcustom.
(tab-bar-tab-group-format-default): New function.
(tab-bar--format-tab-group, tab-bar-format-tabs-groups): New functions.
(tab-bar-format-align-right, tab-bar-format-global): Shorten id.
(tab-bar-change-tab-group): Add refs to tab-bar-format in docstring.
* lisp/tab-line.el: Add face for group-tab (bug#47118)
(tab-line-tab-face-functions): Add choice for 'tab-line-tab-face-group'.
(tab-line-tab-group): New face.
(tab-line-tabs-buffer-groups): Set alist key 'group-tab' for group tabs.
(tab-line-tab-face-group): New function to set face for group tabs.
Juri Linkov [Sat, 13 Mar 2021 21:33:14 +0000 (23:33 +0200)]
Separate values 'override' and 'append' in 'outline-minor-mode-highlight'
* lisp/outline.el (outline-font-lock-keywords): Handle 'override' and 'append'
separately.
(outline-minor-mode-highlight): Separate values 'override' and 'append'.
(outline-minor-mode-highlight-buffer): Go to match-beginning
before checking '(point)'.
Eli Zaretskii [Sat, 13 Mar 2021 15:00:15 +0000 (17:00 +0200)]
Fix rare redisplay glitches when image has been removed from display
* src/dispnew.c (update_window): Make sure all glyph rows below
the last visible one are marked as invalid, even when the loop
which "updates the rest of the lines" didn't examine the last
visible row. (Bug#47093)
Stefan Kangas [Sat, 13 Mar 2021 14:17:24 +0000 (15:17 +0100)]
Adjust colors of help-key-binding face for readability
* lisp/faces.el (help-key-binding): Adjust colors for improved
readability, and use a flat :box for highlighting (with negative
:line-width height to avoid any vertical resizing of the minibuffer).
This was discussed in:
https://lists.gnu.org/r/emacs-devel/2021-03/msg00535.html
This reverts commit 02a5cfce471613f671722b35536d2a78f17b0429.
That commit breaks because of a missing patch to `parse_modifiers_uncached`
in `src/keyboard.c`. IOW, too risky for `emacs-27`.
Glenn Morris [Fri, 12 Mar 2021 16:41:03 +0000 (08:41 -0800)]
Skip recent undo tests in batch mode for now
* test/lisp/simple-tests.el (simple-tests--undo-in-region):
Split into separate test. Skip in batch mode for now.
(simple-tests--undo-equiv-table): Skip in batch mode for now.
Stefan Monnier [Fri, 12 Mar 2021 16:32:42 +0000 (11:32 -0500)]
* lisp/cedet/{*.el,ede/*.el}: Use lexical-binding
Remove a few redundant `:group` arguments as well.
* lisp/cedet/ede.el: Use lexical-binding.
Don't load `ede/files` at compile-time.
(ede-speedbar): Declare function.
(ede-load-project-file): Allow `rootreturn` to be a reference rather
than a symbol.
(ede-initialize-state-current-buffer): Pass `ROOT` as a reference
rather than a symbol to `ede-directory-get-open-project` and
`ede-load-project-file` so we don't need to make it dynamically scoped.
(ede-flush-deleted-projects): Avoid `add-to-list` on a local var.
* lisp/cedet/ede/files.el: Use lexical-binding.
(ede-directory-get-open-project): Allow `rootreturn` to be a reference
rather than a symbol.
(ede-project-root-directory): Remove unused var `root`.
(ede-expand-filename-impl): Remove unused vars `path` and `proj`.
* lisp/cedet/cedet-idutils.el: Use lexical-binding.
(cedet-idutils-search): Remove always-nil variable `scopeflags`.
* lisp/cedet/data-debug.el: Use lexical-binding.
(data-debug-insert-overlay-button, data-debug-insert-overlay-list-button)
(data-debug-insert-buffer-button, data-debug-insert-buffer-list-button)
(data-debug-insert-process-button): Remove always-nil variable `tip`.
(data-debug-insert-ring-button): Remove unused var `ringthing`.
(data-debug-insert-widget-properties): Remove unused var `type`.
* lisp/cedet/semantic.el: Use lexical-binding.
(semantic-mode): Strength-reduce `eval` to `symbol-value`.
* lisp/cedet/ede/custom.el: Use lexical-binding.
(ede-project-sort-targets): Remove unused vars `count`, `current`, and
`order`.
* lisp/cedet/ede/pconf.el: Use lexical-binding.
(ede-proj-configure-synchronize): Remove unused var `add-missing`.
* lisp/cedet/ede/pmake.el (ede-proj-makefile-garbage-patterns):
Simplify via η-reduction.
(ede-proj-makefile-dependencies): Use `seq-some` rather than `eval+or`.
* lisp/cedet/ede/proj-elisp.el: Use lexical-binding.
(project-compile-target): Remove unused var `elc`.
(ede-update-version-in-source): Remove unused var `match`.
(project-compile-target): Declare function `cedet-update-autoloads`
from file we don't have.
* lisp/cedet/cedet-cscope.el: Use lexical-binding.
* lisp/cedet/cedet-files.el: Use lexical-binding.
* lisp/cedet/cedet-global.el: Use lexical-binding.
* lisp/cedet/cedet.el: Use lexical-binding.
* lisp/cedet/ede/auto.el: Use lexical-binding.
* lisp/cedet/ede/autoconf-edit.el: Use lexical-binding.
* lisp/cedet/ede/config.el: Use lexical-binding.
* lisp/cedet/ede/cpp-root.el: Use lexical-binding.
* lisp/cedet/ede/detect.el: Use lexical-binding.
* lisp/cedet/ede/generic.el: Use lexical-binding.
* lisp/cedet/ede/linux.el: Use lexical-binding.
* lisp/cedet/ede/locate.el: Use lexical-binding.
* lisp/cedet/ede/makefile-edit.el: Use lexical-binding.
* lisp/cedet/ede/proj-info.el: Use lexical-binding.
* lisp/cedet/ede/proj-obj.el: Use lexical-binding.
* lisp/cedet/ede/proj-prog.el: Use lexical-binding.
* lisp/cedet/ede/proj-shared.el: Use lexical-binding.
* lisp/cedet/ede/proj.el: Use lexical-binding.
* lisp/cedet/ede/shell.el: Use lexical-binding.
* lisp/cedet/ede/simple.el: Use lexical-binding.
* lisp/cedet/ede/source.el: Use lexical-binding.
* lisp/cedet/ede/speedbar.el: Use lexical-binding.
* lisp/cedet/ede/util.el: Use lexical-binding.
* doc/lispref/display.texi (Image Descriptors): Document it.
* lisp/image.el (image-transform-smoothing): New user option.
(create-image): Use it.
(image--default-smoothing): New function.