Eric Abrahamsen [Sun, 7 Feb 2021 21:46:50 +0000 (13:46 -0800)]
Fix namazu search result parsing in gnus-search
* lisp/gnus/gnus-search.el (gnus-search-indexed-extract): This method
is documented to leave point at the end of the extracted search
result. The namazu implementation wasn't doing that.
Tino Calancha [Sun, 7 Feb 2021 15:51:07 +0000 (16:51 +0100)]
Add command to recenter errors from Occur/Grep buffers
To scroll up/down the current displayed occurrence/error
without abandon the Occur/Grep buffer.
Add also a command 'recenter-other-window' to recenter
the other window from any kind of buffer.
* lisp/window.el (recenter-other-window): New command.
Bind recenter-other-window to S-M-C-l (Bug#46119).
* lisp/simple.el (recenter-current-error): New command.
* lisp/progmodes/grep.el (grep-mode-map):
Delete bidings for n and p.
* lisp/progmodes/compile.el (compilation-minor-mode-map):
Move here the n and p bindings.
Bind `recenter-current-error' to l.
* lisp/replace.el (occur-mode-map):
Same.
* lisp/simple.el (count-lines): Revert back to using
`forward-line', because there seems to be a disagreement on how
lines should be counted in a region...
* src/fns.c (Fline_number_at_pos): Rename from
Fline_number_at_position and adjust parameter list.
Reverse customize-changed and customize-changed-options aliasing
* lisp/cus-edit.el (customize-changed): Rename from
customize-changed-options (bug#23085), since the old name doesn't
reflect what it does: It's not just about user options, but also
faces and the like.
(customize-changed-options): Make into an obsolete alias.
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.