Sean Whitton [Sun, 7 Feb 2021 12:30:33 +0000 (13:30 +0100)]
Move 'revert-buffer' global binding to 'C-x g g'
* lisp/bindings.el: Define ctl-x-g-map and bind 'revert-buffer' to
'C-x x g' globally.
* doc/emacs/files.texi: Replace 'C-x g' with 'C-x x g'.
* etc/NEWS: Document the change (bug#46300).
; Improved commentary in the variable constprop mechanism
* lisp/emacs-lisp/byte-opt.el (byte-optimize--lexvars)
(byte-optimize--vars-outside-condition)
(byte-optimize-form-code-walker, byte-optimize-let-form):
Clarify various aspects in the variable constant-propagation code,
as kindly pointed out by Stefan Monnier.
Fix spurious warnings from unwise condition order in inlined code
These are both conditions having the form (and A B) where A is
side-effect-free and B may be known to be nil at compile time.
The compiler will then warn about A being useless and thrown away.
The fix is to test B first.
* lisp/gnus/gnus.el (gnus-method-to-server):
Test `(not no-enter-cache)` first.
(gnus-server-get-method): Test `group` first.
Lexical variables bound to a constant value (symbol, number or string)
are substituted at their point of use and the variable then eliminated
if possible. Example:
(let ((x (+ 2 3))) (f x)) => (f 5)
This reduces code size, eliminates stack operations, and enables
further optimisations. The implementation is conservative, and is
strongly curtailed by the presence of variable mutation, conditions
and loops.
* lisp/emacs-lisp/byte-opt.el
(byte-optimize-enable-variable-constprop)
(byte-optimize-warn-eliminated-variable): New constants.
(byte-optimize--lexvars, byte-optimize--vars-outside-condition)
(byte-optimize--vars-outside-loop, byte-optimize--dynamic-vars):
New dynamic variables.
(byte-optimize--substitutable-p, byte-optimize-let-form):
New functions.
(byte-optimize-form-code-walker): Adapt clauses for variable
constprop, and add clauses for 'setq' and 'defvar'.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-var)
(bytecomp-test-get-var, bytecomp-test-identity)
(byte-opt-testsuite-arith-data): Add test cases.
Martin Rudalics [Sat, 6 Feb 2021 17:22:29 +0000 (18:22 +0100)]
Permit zero value for 'child-frame-border-width' parameter (Bug#46184)
* doc/lispref/frames.texi (Layout Parameters): Update entry on
'child-frame-border-width' parameter.
* src/frame.c (make_frame): Init child_frame_border_width to -1.
(Fframe_child_frame_border_width): Return internal border width if
child frame border width parameter is nil.
(gui_report_frame_params): Report nil as child frame border
width parameter if the frame value is negative.
* src/frame.h (FRAME_INTERNAL_BORDER_WIDTH): Return value of
child frame border width only if it is not negative.
* src/xfns.c (Fx_create_frame): Default child frame border to -1
when recording it in its frame slot via gui_default_parameter.
* src/nsfns.m (ns_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
* src/w32fns.c (w32_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
* src/xfns.c (x_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
Glenn Morris [Sat, 6 Feb 2021 16:10:38 +0000 (08:10 -0800)]
Merge from origin/emacs-27
8ad48a0bdd (origin/emacs-27) Improve doc string of 'text-scale-adjust' 7a25ff767d Clarify the indent-rigidly doc string 6c5ddf0e0b Fix two small tab bar issues c71e08eba9 Fix last change in syntax.texi
Glenn Morris [Sat, 6 Feb 2021 16:05:29 +0000 (08:05 -0800)]
; Merge from origin/emacs-27
The following commits were skipped:
b99848c72c Bind default-directory to the project root 19534f988c Make sure default-directory relates to the originating buffer d1455027e0 Initialize signal descriptions after pdumping 256356a36f Clarify the "Sentinels" node in the lispref manual 89f1634afc Fix problem with non-ASCII characters in nnmaildir
* lisp/subr.el (provided-mode-derived-p): Remove detail about "or
their aliases", since that seems self-evident (bug#46331) (and
derived-mode-p works the same, and doesn't have the bit in
question).
* lisp/emacs-lisp/testcover.el: Rename the symbol `1value'
throughout the file to `testcover-1value' to allow using the
variable in code that's to be tested (bug#25471).
* lisp/subr.el (provided-mode-derived-p): Allow this to work on
modes that are aliases of other modes (bug#46331). For instance:
(provided-mode-derived-p 'javascript-mode 'prog-mode)
Michael Albinus [Sat, 6 Feb 2021 10:50:55 +0000 (11:50 +0100)]
Modernize use of prompts in auth-source.el
* lisp/auth-source.el (auth-source-search): Adapt docstring
(auth-source-format-prompt): Remove trailing ": ".
(auth-source-netrc-create, auth-source-secrets-create)
(auth-source-plstore-create): Adapt prompts. Use `format-prompt'.
Do not ask interactively if `auth-source-save-behavior' is nil.
Eli Zaretskii [Fri, 5 Feb 2021 12:24:01 +0000 (14:24 +0200)]
Fix last change in 'window-text-pixel-size'
* src/xdisp.c (Fwindow_text_pixel_size): Fix last change: preserve
the original Y coordinate after start_display, instead of zeroing
it out. Reported by martin rudalics <rudalics@gmx.at>.
Clarify how transient indentation modes are exited in the manual
* doc/emacs/indent.texi (Indentation Commands): Clarify that the
other keys don't just exit the transient mode, but are also
handled as normally (bug#46296).
Protect against killed buffers in term-emulate-terminal
* lisp/term.el (term-emulate-terminal): Ensure that the buffer is
still alive before selecting it (bug#46323). This avoids an error
when saying `C-x k' in an ansi-term buffer.
Dmitry Gutov [Thu, 4 Feb 2021 23:17:09 +0000 (01:17 +0200)]
Fix the previous change
* lisp/progmodes/project.el (project-find-regexp):
Fix the previous change (project-root is not defined in this version).
(project-or-external-find-regexp): Same.
Dmitry Gutov [Thu, 4 Feb 2021 01:38:27 +0000 (03:38 +0200)]
Bind default-directory to the project root
* lisp/progmodes/project.el (project-find-regexp):
Bind default-directory to the project root, to save this value
in the resulting buffer (esp. if the project selector was used,
(https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg00140.html).
(project-or-external-find-regexp): Same.
Dmitry Gutov [Sat, 9 Jan 2021 00:08:59 +0000 (02:08 +0200)]
Make sure default-directory relates to the originating buffer
* lisp/progmodes/xref.el (xref--show-xref-buffer):
Pick up default-directory value from the caller
(https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00551.html).
(xref-show-definitions-buffer-at-bottom): Same.
Eli Zaretskii [Thu, 4 Feb 2021 17:35:07 +0000 (19:35 +0200)]
Avoid overwriting minibuffer prompt by keystrokes echo
* src/lread.c (Fread_char, Fread_event, Fread_char_exclusive):
Call cancel_echoing to make sure the prompt is not obscured by
keystrokes echo. (Bug#46243)
* lisp/progmodes/python.el (python-shell-send-region): Deactivate
mark after executing (bug#28789). This is how this command worked
in Emacs 24, apparently.
Eli Zaretskii [Thu, 4 Feb 2021 16:00:29 +0000 (18:00 +0200)]
Fix 'window-text-pixel-size' for short spans of text
* src/xdisp.c (Fwindow_text_pixel_size): Support the use case
where FROM and TO belong to the same screen line. Reported by
Yuan Fu <casouri@gmail.com>.
Allow a :variable keyword in define-globalized-minor-mode
* doc/lispref/modes.texi (Defining Minor Modes): Document it.
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Allow specifying a :variable to be used if the underlying mode has
a divergent variable to store the state (bug#29081).
Make the recency sorting stable when we have inverted sorting
* lisp/ibuffer.el (recency): Remove.
(recency): New macro function so that sorting by recency is
stable when inverted sorting is switched on (bug#30129).
Don't ask the user to make a bug report on missing arglists
* lisp/help-fns.el (help-fns--signature): Don't ask the user to
make a bug report (bug#30223) because the symbol may very well be
one that the user has defined themselves.
(help-fns-function-description-header): Ditto.
Robert Pluim [Thu, 4 Feb 2021 10:24:13 +0000 (11:24 +0100)]
Update description of 'tramp-crypt-remove-directory'
* doc/misc/tramp.texi (Keeping files encrypted): Correct name of
function to use to indicate files should no longer be encrypted,
and update its description.
Fix problem with non-ASCII characters in nnmaildir
* lisp/gnus/nnmaildir.el (nnmaildir-request-article): Enable
multipart 8bit-content-transfer-encoded files to be displayed
correctly by reading as `raw-text' instead of having Emacs
(incorrectly) decode the files (bug#44307).
Stefan Kangas [Thu, 4 Feb 2021 07:16:33 +0000 (08:16 +0100)]
Don't set removed variable facemenu-unlisted-faces
* lisp/vc/ediff-init.el (ediff-hide-face): Redefine as obsolete
function alias for 'ignore'; the variable 'facemenu-unlisted-faces'
was removed in Emacs 22. Remove all calls.
* lisp/mh-e/mh-e.el: Add comment saying that the variable
'facemenu-unlisted-faces' is removed.
Dmitry Gutov [Thu, 4 Feb 2021 01:38:27 +0000 (03:38 +0200)]
Bind default-directory to the project root
* lisp/progmodes/project.el (project-find-regexp):
Bind default-directory to the project root, to save this value
in the resulting buffer (esp. if the project selector was used,
(https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg00140.html).
(project-or-external-find-regexp): Same.
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler): Sync args
with other `tramp-*-file-name-handler'.
* lisp/net/tramp-compat.el (tramp-error): Declare.
(tramp-compat-file-missing): New defsubst.
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
Handle volatile files.
(tramp-gvfs-set-attribute): New defun.
(tramp-gvfs-handle-set-file-modes)
(tramp-gvfs-handle-set-file-times)
(tramp-gvfs-handle-set-file-uid-gid): Use it.
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file):
Use `msg-operation'.
* lisp/net/tramp.el (tramp-handle-file-truename): Drop volume letter from
symlinked files.
* test/lisp/net/tramp-tests.el (tramp--test-gdrive-p): New defun.
(tramp--test-nextcloud-p): Remove.
(tramp-test40-special-characters-with-ls): Do not skip on MS Windows.
(tramp-test41-utf8): Skip if needed.
Make backslash characters no longer escape in `f90-mode'
* lisp/progmodes/f90.el (f90-backslash-not-special): Make obsolete
(bug#32766).
(f90-mode-syntax-table): Make the backslash be a normal
(non-escape) character, which is the default since about 2007 (and
F2K): https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34203
Wilson Snyder [Wed, 3 Feb 2021 04:22:44 +0000 (23:22 -0500)]
Update lisp/progmodes/verilog-mode.el
* lisp/progmodes/verilog-mode.el: Cleanup compile-time warning
suppression. Use underscore for unused arguments and other style
cleanups. Use '# for function references. By Stefan Monnier.
(verilog-auto-reset, verilog-sig-tieoff):
Fix AUTORESET '0 (#1714). Reported by Paul Adams.
(verilog-simplify-range-expression):
Fix AUTOWIRE simplifying X/Y where there is a remainder (#1712).
Reported by Joachim Lechner.
(verilog-read-sub-decls-expr):
Fix multiplication in multidimensional AUTOINST output (#1698).
Reported by alanamckee.
(verilog-at-constraint-p, verilog-at-streaming-op-p, verilog-streaming-op-re):
Add streaming operator support (#1692) (#1516),
(verilog-auto-assign-modport, verilog-auto-inout-modport):
Support adding prefix to AUTOASSIGNMODPORT and AUTOINOUTMODPORT (#1690).
(verilog-signals-matching-dir-re):
Fix error when matching regexp with 2D packed memory.
Reported by Chris DeMarco.
(verilog-declaration-core-re): Allow parameter
declaration statements to align like any other declaration (#1683).
Suggested by Vinam Arora.
(verilog-auto-inout, verilog-auto-inout-in)
(verilog-auto-inout-module, verilog-auto-input, verilog-auto-inst)
(verilog-auto-inst-param, verilog-auto-output-every)
(verilog-signals-matching-regexp)
(verilog-signals-not-matching-regexp):
When "?!" is at the front of a signal-matching regexp, invert it.
(verilog-declaration-varname-matcher)
(verilog-highlight-max-lookahead, verilog-mode)
(verilog-single-declaration-end) (verilog-font-lock-keywords-1):
Improve syntax highlighting in declaration statements, and support
multi-line declarations, #1681. Reported by Vinam Arora.
Alan Mackenzie [Tue, 2 Feb 2021 20:34:42 +0000 (20:34 +0000)]
CC Mode: Prevent "const" inside an identifier being recognized as the keyword
This fixes bug #45560.
* lisp/progmodes/cc-engine.el (c-forward-declarator)
(c-forward-decl-or-cast-1): Amend certain regexp match numbers on account of
the change below. Surround some looking-at calls with save-match-data.
* lisp/progmodes/cc-langs.el (c-type-decl-prefix-keywords-key): New lang
const.
(c-type-decl-prefix-key): Reformulate to match operators and keywords
separately, using the new lang const (above).