1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-10 13:40:36 -08:00
Commit graph

145267 commits

Author SHA1 Message Date
Stefan Kangas
7d4d577ed1 Prefer setq-local in a few more places
* lisp/calc/calc-embed.el (calc-embedded-make-info):
* lisp/calc/calcalg2.el (calcFunc-integ):
* lisp/comint.el (comint-mode):
* lisp/epa.el (epa--list-keys, epa--show-key):
* lisp/epg.el (epg--start):
* lisp/vc/ediff-util.el (ediff-activate-mark): Prefer setq-local.
2021-02-08 00:25:16 +01:00
Stefan Kangas
651aefa312 Add tests for count-lines
* test/lisp/simple-tests.el (simple-test-count-lines)
(simple-test-count-lines/ignore-invisible-lines): Add tests.
2021-02-08 00:24:36 +01:00
Eric Abrahamsen
fa735ebc0c 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.
2021-02-07 13:46:50 -08:00
Michael Albinus
5a1222196b ; Rearrange changed entry in etc/NEWS 2021-02-07 19:38:49 +01:00
Lars Ingebrigtsen
7c5938ad7d Use line-number-at-pos' in count-lines'
* lisp/simple.el (count-lines): Use `line-number-at-pos', which
should be faster.
2021-02-07 17:30:02 +01:00
Tino Calancha
9380a7ed90 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.

* doc/emacs/windows.texi (Other Window):
* doc/emacs/display.texi (Recentering):
Document recenter-other-window.

* etc/NEWS (Changes in Specialized Modes and Packages in Emacs 28.1):
Announce the changes.
2021-02-07 16:51:07 +01:00
Lars Ingebrigtsen
5461808c40 Allow Fline_number_at_pos being called with a marker
* src/fns.c (Fline_number_at_pos): Also allow being called with a
marker (since the Lisp function allowed that).
2021-02-07 16:42:25 +01:00
Lars Ingebrigtsen
56e76f0eb0 Move line-number-at-pos to C
* doc/lispref/positions.texi (Text Lines): Revert previous change.

* lisp/simple.el (line-number-at-pos): Remove definition.

* 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.
2021-02-07 16:28:34 +01:00
Stefan Kangas
5a4d50dfb1 Minor doc fixes in dictionary-connection.el
* lisp/net/dictionary-connection.el:
(dictionary-connection-p, dictionary-connection-read-to-point):
Minor doc fixes to adhere to our conventions.
2021-02-07 16:07:42 +01:00
Stefan Kangas
e027842f4f Fix copyright and license statement in dictionary*.el
* lisp/net/dictionary-connection.el:
* lisp/net/dictionary.el: Add copyright statement and fix license
statement.
2021-02-07 16:07:42 +01:00
Lars Ingebrigtsen
094a109b8e Add a new function 'line-number-at-position'
* doc/lispref/positions.texi (Text Lines): Document it.

* lisp/simple.el (count-lines): Use it.
(line-number-at-pos): Ditto.

* src/fns.c (Fline_number_at_position): New function (bug#22763).
2021-02-07 16:03:02 +01:00
Stefan Kangas
4e8d36fdaa Various doc fixes in dictionary.el
* lisp/net/dictionary.el (dictionary-set-server-var)
(dictionary-server, dictionary-port)
(dictionary-default-dictionary)
(dictionary-default-popup-strategy, dictionary-proxy-server)
(dictionary-proxy-port, dictionary-description-open-delimiter)
(dictionary-description-close-delimiter)
(dictionary-window-configuration, dictionary-selected-window)
(dictionary-position-stack, dictionary-data-stack)
(dictionary-positions, dictionary-current-data)
(dictionary-connection, dictionary-instances)
(dictionary-color-support, dictionary-word-history)
(dictionary-mode, dictionary, dictionary-check-connection)
(dictionary-mode-p, dictionary-send-command)
(dictionary-read-reply-and-split, dictionary-check-reply)
(dictionary-check-initial-reply, dictionary-store-state)
(dictionary-store-positions, dictionary-new-search)
(dictionary-new-search-internal, dictionary-do-search)
(dictionary-display-search-result)
(dictionary-display-word-definition)
(dictionary-special-dictionary, dictionary-set-strategy)
(dictionary-tooltip-dictionary, dictionary-switch-tooltip-mode)
(dictionary-tooltip-mode, global-dictionary-tooltip-mode): Doc fixes
to adhere to our conventions.
2021-02-07 15:53:51 +01:00
Lars Ingebrigtsen
5ffc55d1e9 Revert "Fix inferior octave single-quote font lock"
This reverts commit 9e68413c7f.

This patch led to bug#46327:

x = [2 2]'
disp(x)

Which meant that the transpose operator was interpreted
as the start of a string.
2021-02-07 15:12:15 +01:00
Lars Ingebrigtsen
5beddcd325 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.
2021-02-07 15:07:21 +01:00
Lars Ingebrigtsen
a1a31ecb40 Clarify that #s(hash-table ...) doesn't always create a new hash table
* doc/lispref/hash.texi (Creating Hash): Note that the printed
representation doesn't necessarily create a new table (bug#23417).

* doc/lispref/lists.texi (Rearrangement): Link to Self-Evaluating
Forms to further expand upon immutability.
2021-02-07 14:47:09 +01:00
Lars Ingebrigtsen
e0c9399454 Add more commands to the new `C-x x' keymap
* doc/emacs/killing.texi (Accumulating Text):
* doc/emacs/display.texi (Line Truncation):
* doc/emacs/buffers.texi (Misc Buffer): Document it.

* lisp/bindings.el (ctl-x-x-map): Add new bindings for
rename-buffer, rename-uniquely, insert-buffer and
toggle-truncate-lines.
2021-02-07 13:53:44 +01:00
Sean Whitton
a6a5d6a27a 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).
2021-02-07 13:30:42 +01:00
Mattias Engdegård
7e48430a43 ; * lisp/emacs-lisp/byte-opt.el: improved comment 2021-02-07 12:24:40 +01:00
Mattias Engdegård
765ffeb545 ; 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.
2021-02-07 10:35:36 +01:00
Dmitry Gutov
06e1e5eeac Revert "Fix the previous change"
This reverts commit fc37dc298f.

That change was only needed in the release branch.
2021-02-06 22:59:00 +02:00
Mattias Engdegård
4dc3231c91 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.
2021-02-06 20:22:24 +01:00
Mattias Engdegård
83983b6b7a Constprop of lexical variables
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.
2021-02-06 20:22:24 +01:00
Eli Zaretskii
f95266ee68 ; Fix byte-compilation warning
* test/src/process-tests.el (process-sentinel-interrupt-event): Fix
byte compilation warning.
2021-02-06 20:50:57 +02:00
Eli Zaretskii
a3b182954c ; Fix last change 2021-02-06 20:20:31 +02:00
Ioannis Kappas
d640ec2718 New test for src/process.c on MS-Windows
* test/src/process-tests.el (process-sentinel-interrupt-event):
New test.  (Bug#46284)

Copyright-paperwork-exempt: yes
2021-02-06 20:18:57 +02:00
Eric Abrahamsen
b76864ef55 Fix TEXT check in gnus-search IMAP search
* lisp/gnus/gnus-search.el (gnus-search-run-search): It's a string,
not a buffer!
2021-02-06 09:29:53 -08:00
Martin Rudalics
29e9cf291e 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.
2021-02-06 18:22:29 +01:00
Glenn Morris
c0d504eb7e 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

# Conflicts:
#	lisp/indent.el
2021-02-06 08:10:38 -08:00
Glenn Morris
fdc56b5d56 ; Merge from origin/emacs-27
The following commit was skipped:

43bf7f1b06 Correct the lispref manual about flushing ppss info
2021-02-06 08:05:30 -08:00
Glenn Morris
3c0f86312e Merge from origin/emacs-27
8c27af3ff4 Clarify how transient indentation modes are exited in the ...
fc37dc298f Fix the previous change
2021-02-06 08:05:29 -08:00
Glenn Morris
7a960251b3 ; 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
2021-02-06 08:05:29 -08:00
Lars Ingebrigtsen
c4a6f81ca4 Fix previous change in testcover.el
* lisp/emacs-lisp/testcover.el
(testcover-analyze-coverage-edebug-after): The wrapper macro is
called `1value', not `testcover-1value'.
2021-02-06 15:04:52 +01:00
Eli Zaretskii
1e0632e772 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2021-02-06 15:11:29 +02:00
Eli Zaretskii
f534d3fdac Support file names with whitespace in Nroff mode
* lisp/textmodes/nroff-mode.el (nroff-view): Quote argument of
'Man-getpage-in-background' to support file names with special
characters.  (Bug#46051)
2021-02-06 15:09:32 +02:00
Lars Ingebrigtsen
5903db0c20 Tweak provided-mode-derived-p doc string
* 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).
2021-02-06 13:54:33 +01:00
Eli Zaretskii
8ad48a0bdd Improve doc string of 'text-scale-adjust'
* lisp/face-remap.el (text-scale-adjust): Clarify that "default
face height" refers to the 'default' face.  (Bug#25168)
2021-02-06 14:31:51 +02:00
Lars Ingebrigtsen
0100e33f83 Warn in message.el when sending encryptable mail
* lisp/gnus/message.el (message-send): Query if it looks like
encryption was intended, but is not going to happen.

* lisp/gnus/mml-sec.el (mml-secure-is-encrypted-p): Allow saying
whether there's any <#secure tags present (bug#24411).
2021-02-06 13:26:25 +01:00
Lars Ingebrigtsen
cf0869d22b Rename the `1value' symbol in testcover.el
* 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).
2021-02-06 12:28:46 +01:00
Lars Ingebrigtsen
2476abc1f2 Allow provided-mode-derived-p to work on aliases
* 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)
2021-02-06 12:03:47 +01:00
Michael Albinus
23a7da9148 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.
2021-02-06 11:50:55 +01:00
Lars Ingebrigtsen
7a25ff767d Clarify the indent-rigidly doc string
* lisp/indent.el (indent-rigidly): Clarify exiting the transient
mode (bug#46296).
2021-02-06 11:46:58 +01:00
Lars Ingebrigtsen
2932646232 Fix problem when ~/.mailcap had several entries for a MIME type
* lisp/net/mailcap.el (mailcap-mime-info): Use all the matching
entries from ~/.mailcap, not just the first (bug#46318).
2021-02-06 11:40:00 +01:00
Lars Ingebrigtsen
f853f2d428 Avoid a compilation warning in iter-do
* lisp/emacs-lisp/generator.el (iter-do): Avoid a compilation
warning on using variables marked for not using (bug#31641).
Eg. (iter-do (_ i))
2021-02-06 11:31:18 +01:00
Eli Zaretskii
b84b8dff70 Fix copying text properties in 'format'
* src/editfns.c (styled_format): Fix accounting for text
properties that come from the format string.  (Bug#46317)

* test/src/editfns-tests.el (format-properties): Add new tests for
bug#46317.
2021-02-06 11:54:08 +02:00
Martin Rudalics
6c5ddf0e0b Fix two small tab bar issues
* lisp/cus-start.el (frame-inhibit-implied-resize): Update version tag.
* lisp/frame.el (frame-inner-height): Do not count in tab bar.
2021-02-06 09:28:40 +01:00
Stefan Monnier
431b098a20 * lisp/emacs-lisp/pcase.el (let): Reimplement as a pcase macro
(pcase--macroexpand, pcase--u1): Remove handling of `let` from
`pcase`s core.
2021-02-05 15:07:47 -05:00
Eli Zaretskii
a6f23c226e ; * src/xdisp.c (Fwindow_text_pixel_size): Fix comment. 2021-02-05 22:04:15 +02:00
Eli Zaretskii
0484879d3b Fix 'C-d' on the first line in Rmail summary buffer
* lisp/mail/rmailsum.el (rmail-summary-delete-forward): Fix
deleting backward past the beginning of the summary buffer.
(Bug#46325)
2021-02-05 16:27:51 +02:00
Michael Albinus
d5b1deb62e Add command 'dbus-monitor'
* doc/misc/dbus.texi: (Monitoring Messages): Document 'dbus-monitor'.

* etc/NEWS: Mention 'dbus-monitor' but 'dbus-register-monitor'.
Fix typos and other oddities.

* lisp/net/dbus.el (dbus-monitor): New command.

* test/lisp/net/dbus-tests.el (dbus--test-register-service): Extend test.
2021-02-05 14:32:41 +01:00
Lars Ingebrigtsen
a14811fc96 Don't hard-code ignored functions in `indent-according-to-mode'
* lisp/indent.el (indent-line-ignored-functions): New variable
(bug#26945).
(indent-according-to-mode): Use it.
2021-02-05 13:36:06 +01:00