1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-15 09:47:20 +00:00
Commit Graph

150120 Commits

Author SHA1 Message Date
Mattias Engdegård
020a408eda Propagate aliased lexical variables in byte compiler
Replace uses of a variable aliasing another variable with that aliased
variable, to allow for variable removal when possible.  This also
enables opportunities for other optimisations.  Example:

 (let ((y x)) (f y)) => (f x)

The optimisation is only performed if both aliased and aliasing
variables are lexically bound.  Shadowing bindings are α-renamed when
necessary for correctness.  Example:

   (let* ((b a) (a EXPR)) (f a b))
=> (let* ((a{new} EXPR)) (f a{new} a))

* lisp/emacs-lisp/byte-opt.el (byte-optimize--aliased-vars): New.
(byte-optimize-form-code-walker): Cancel aliasing upon mutation.
(byte-optimize--rename-var-body, byte-optimize--rename-var): New.
(byte-optimize-let-form): Add the optimisation.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add relevant test cases.
2021-09-11 17:17:33 +02:00
Eli Zaretskii
376a31b0cd Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2021-09-11 17:50:42 +03:00
Eli Zaretskii
c7aaf2fcb8 ; * src/w32term.c (w32_read_socket): Avoid compiler warning. 2021-09-11 17:50:08 +03:00
Philip Kaludercic
2e24b66079
* rcirc.texi: Replace defun-rcirc-command with rcirc-define-command 2021-09-11 16:43:56 +02:00
Philip Kaludercic
251a9f5fe0
* rcirc.texi: Document rcirc-track-abbrevate-flag 2021-09-11 16:40:18 +02:00
Philip Kaludercic
88b623772b
* rcirc.texi: Document rcirc-nick-filter and rcirc-channel-filter 2021-09-11 16:37:42 +02:00
Philip Kaludercic
0d08745806
* rcirc.texi: Document rcirc-track-ignore-server-buffer-flag 2021-09-11 16:02:03 +02:00
Philip Kaludercic
550011ca58
* rcirc.texi: Document rcirc-omit-responses-after-join 2021-09-11 16:01:56 +02:00
Philip Kaludercic
7a89e0f822
Rename rcirc-omit-after-reconnect to rcirc-omit-after-connect
* rcirc.el (rcirc-omit-after-reconnect): Remove variable
(rcirc-omit-responses-after-join): Add variable
(rcirc-reconncting): Remove variable
(rcirc-joined): Add variable
(rcirc-get-buffer-create): Set rcirc-joined
(rcirc-print): Use rcirc-joined
(reconnect): Remove code relating to rcirc-reconncting
2021-09-11 15:53:05 +02:00
Augusto Stoffel
84e35ff786 Keep python.el compatible with older Emacsen
* progmodes/python.el (python-shell-send-string): Don't assume
comint-max-line-length is defined (bug#50503).
2021-09-11 15:39:32 +02:00
Michael Albinus
ef65d717d0 Tramp code cleanup
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-make-directory): Simplify.

* lisp/net/tramp-sh.el (tramp-methods) <telnet, nc>: Don't use
"%n" marker.

* test/lisp/net/tramp-tests.el (tramp-test13-make-directory): Merge with
`tramp-test-make-directory-helper' and
`tramp-test13-make-directory-with-file-modes'.
(tramp-test44-asynchronous-requests): Use always the same
operation in timer.
2021-09-11 15:35:51 +02:00
Augusto Stoffel
6343384348 Allow using 'python-shell-send-file' across machines
* progmodes/python.el (python-shell-eval-file-setup-code): Look for a
file coding cookie on the Python rather than on the Emacs side, to
avoid additional file transfers.
(python-shell--save-temp-file): Allow argument to be a buffer.
(python-shell-send-file): Address the case where the selected file and
the inferior process are on different machines (bug#50516).
2021-09-11 15:02:04 +02:00
Eli Zaretskii
afa82b3f7f ; * src/keyboard.c (make_lispy_position): Fix a recent change. 2021-09-11 15:59:32 +03:00
Augusto Stoffel
e4300777e8 Implement caching for 'python-shell-completion-at-point'
* lisp/progmodes/python.el (python-shell-completion-at-point): cache
results, since computing them involves talking with the inferior
process and, potentially, network communications
(python-shell--capf-cache): new variable, for cache
(python-shell-completion-get-completions)
(python-shell-completion-native-get-completions): 'import' argument is
not needed anymore.
(python-shell-completion-native-setup)
(python-shell-completion-native-try): pass the setup code
synchronously, to avoid printing a message in the shell (bug#50459).
2021-09-11 14:58:12 +02:00
Alan Third
e40f5a91ee Fix display of tab-bar buttons
* src/xterm.c (x_draw_image_relief):
* src/w32term.c (w32_draw_image_relief): Fix the display of
tab-bar buttons when mouse pointer moves off the button.
(Bug#50424)
2021-09-11 15:09:59 +03:00
Eli Zaretskii
aa6cacd713 Document tool-bar and tab-bar mouse events
* doc/lispref/commands.texi (Click Events): Document the format of
POSITION for tab-bar and tool-bar events.
2021-09-11 14:40:51 +03:00
Eli Zaretskii
2e595b3e8b Fix tab-bar scrolling for mice that report mouse-wheel events
* src/keyboard.c (make_lispy_position): Call
'window_from_coordinates' with last 2 arguments non-zero, to have
it report on tool-bar and tab-bar positions.  Tweak the return
value according to the expectations of 'make_lispy_event'.
(make_lispy_event): No more need to inject "tab-bar" into a click
event on the tab bar: it's already there.
2021-09-11 13:58:10 +03:00
Tassilo Horn
140d722848 ; Add some TODOs for the bug-reference-<forge>-instances variables 2021-09-11 11:59:06 +02:00
Tassilo Horn
ccc9bd774c bug-reference-bug-regexp now defines a contract for the overlay region
Formerly, bug-reference-fontify placed the overlay on the complete
match of bug-reference-bug-regexp.  That made it impossible to encode
constraints like "must not match at BOL" in the regexp without messing
up fontification.  Therefore, now it establishes the contract that
subexpression 1 defines the overlay region.  Subexpression 2 must
still match the part of the bug reference injected into
bug-reference-url-format if that's a string.  If its a function, the
interpretation of subexpressions > 1 is up to the function.

For backwards compatibility, bug-reference-fontify checks if the
bounds of subexpression 2..10 are within the bounds of subexpession
1.  If not, or subexpression 1 doesn't even exist/match, we fall back
to placing the overlay from (match-beginning 0) to (match-end 0) but
issue a warning.

* lisp/progmodes/bug-reference.el (bug-reference-bug-regexp): Document
contract that subexpression 1 defines the overlay region and adapt the
default value accordingly.
(bug-reference--nonconforming-regexps): New internal variable.
(bug-reference--overlay-bounds): New function.
(bug-reference-fontify): Place overlay on subexpression 1's bounds if
bug-reference-bug-regexp conforms to the documented contract.
(bug-reference--setup-from-vc-alist): Adapt regexps to new contract.
* doc/emacs/maintaining.texi (Bug Reference): Adapt regexp used in
example.
2021-09-11 11:51:14 +02:00
Eli Zaretskii
bfd5e268a8 ; * lisp/emacs-lisp/comp.el (native-comp-compiler-options): Doc fix. 2021-09-11 10:22:06 +03:00
Eli Zaretskii
ea3f0bcc78 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2021-09-11 10:18:21 +03:00
Stefan Kangas
74fd89fe17 * lisp/info.el (Info-streamline-headings): Add entry. 2021-09-11 09:17:09 +02:00
Eli Zaretskii
0b362912a4 Improve documentation of Show Paren mode
* doc/emacs/programs.texi (Matching): Improve wording and
indexing.  (Bug#29381)
2021-09-11 10:16:59 +03:00
Eli Zaretskii
f98700af80 Fix restoring from pdumper file on MS-Windows 9X
* src/pdumper.c (dump_map_file_w32): Use PAGE_WRITECOPY flag when
calling CreateFileMapping for DUMP_MEMORY_ACCESS_READWRITE access,
as that is required by Windows 9X.  (Bug#50453)
2021-09-11 09:56:27 +03:00
Stephen Gildea
252a769b11 ; * doc/lispref/files.texi (Changing Files): Fix xref to file-modes.
'file-modes' is in node "Testing Accessibility", not "File Attributes".
2021-09-10 20:22:47 -07:00
Dmitry Gutov
d37dcfa30f New minor mode 'show-paren-local-mode'
* lisp/paren.el (show-paren--delete-overlays):
New function, extracted from show-paren-mode.
(show-paren-local-mode): New minor mode.
(show-paren-mode): Update docstring to mention it (bug#29381).

* doc/emacs/programs.texi (Matching): Update show-paren-mode section.
2021-09-11 05:12:20 +03:00
Tassilo Horn
5c18d35acb Improve overlay placement performance
* lisp/progmodes/bug-reference.el (bug-reference--overlays-in): New
function.
(bug-reference-unfontify): Use it.
(bug-reference-fontify): Reuse and move existing overlays instead of
deleting all and creating them anew.
2021-09-11 00:07:44 +02:00
Arthur Miller
dea67939b6 Add support for GCC compiler command-line options
* lisp/emacs-lisp/comp.el ('native-comp-compiler-options): New option.
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Add support
for new 'native-comp-compiler-options'.
* src/comp.c (Fcomp_native_compiler_options_effective_p): New function.
(add_compiler_options): New function.
(Fcomp__compile_ctxt_to_file): Call 'add_compiler_options'.
2021-09-10 21:04:41 +02:00
Philip Kaludercic
6d31d5b4b4
Merge branch 'master' into feature/rcirc-update 2021-09-10 20:33:15 +02:00
Philip Kaludercic
a66fd7bb37
Fix double reconnection bug
* rcirc.el (rcirc-sentinel): Don't reconnect if reconnecting
(reconnect): Use delete-process instead of kill-process
2021-09-10 18:57:11 +02:00
Dmitry Gutov
6eba633ead Fix test find-defs-defgeneric-el
* test/lisp/progmodes/elisp-mode-tests.el (find-defs-defgeneric-el):
Fix the test.  Reported by dick.r.chiang@gmail.com.
2021-09-10 18:42:55 +03:00
Lars Ingebrigtsen
192a384408 Revert usage of format-prompt in python.el
* lisp/progmodes/python.el (python-eldoc-at-point): Revert usage
of format-prompt in python.el since this is also an ELPA package
(and older Emacs versions doesn't have format-prompt).
2021-09-10 16:39:13 +02:00
Augusto Stoffel
195da78e2e Properly encode all strings sent to Python shell
* lisp/progmodes/python.el: Now depends on Emacs 28.
(python-shell-package-enable, python-shell-completion-get-completions)
(python-ffap-module-path, python-eldoc--get-doc-at-point): Enconde
Python strings using 'python-shell--encode-string' instead of triple
quotes.
(python-shell-completion-string-code, python-eldoc-string-code)
(python-ffap-string-code): Remove defcustoms. (bug#50503).
2021-09-10 16:39:13 +02:00
Stephen Gildea
5ee6583cb2 Tramp: honor default file modes in make-directory
* lisp/net/tramp-sh.el:
* lisp/net/tramp-adb.el:
* lisp/net/tramp-sudoedit.el:
* lisp/net/tramp-gvfs.el: Add support for default file modes to
relevant Tramp back ends for make-directory.  (Closes: Bug#50410)
* test/lisp/net/tramp-tests.el (tramp-test13-make-directory-with-file-modes):
New test.
* etc/NEWS: Note this enhancement.

Thanks to Michael Albinus for helping improve this patch.
2021-09-10 06:30:06 -07:00
Eli Zaretskii
f94b915e2f Doc string followup to last change.
* lisp/progmodes/xref.el (xref-find-apropos): Mention
'tags-apropos-additional-actions' in the doc string.
* lisp/progmodes/etags.el (tags-apropos-additional-actions):
Mention 'xref-find-apropos' in the doc string.
2021-09-10 15:02:41 +03:00
Eli Zaretskii
b4158a75c0 Document 'tags-apropos-additional-actions' with Xref
* doc/emacs/maintaining.texi (Looking Up Identifiers): Rearrange
and reword documentation of 'xref-find-apropos' and
'xref-auto-jump-to-first-definition'.  Add the description of
'tags-apropos-additional-actions'.  Delete the comment with
not-yet implemented features that were available with
'tags-apropos'.

* etc/NEWS: Augment the wording of 'xref-find-apropos' entry.
2021-09-10 14:57:38 +03:00
Lars Ingebrigtsen
28ce3bf5c9 Further fix for the search-whitespace-regexp change
* lisp/isearch.el (search-whitespace-regexp): Fix yet another typo
in this one-line change (bug#21278).
2021-09-10 12:56:22 +02:00
Gregory Heytings
f3cfd47898 New user options to move between isearch matches
* lisp/isearch.el (isearch-allow-motion,
isearch-motion-changes-direction): New user options.
(isearch-pre-command-hook): Handle the new options.

* etc/NEWS: Mention the new user options.

* doc/emacs/search.texi: Document the new user options.
2021-09-10 12:43:45 +02:00
Lars Ingebrigtsen
150ff9c157 Fix typo in previous search-whitespace-regexp change
* lisp/isearch.el (search-whitespace-regexp): Fix typo in last
checkin for this variable.
2021-09-10 12:42:22 +02:00
Gregory Heytings
061f8f2800 Fix behavior of isearch-{beginning,end}-of-buffer
* lisp/isearch.el (isearch-beginning-of-buffer)
(isearch-end-of-buffer): Fix their behavior when
isearch-repeat-on-direction-change is non-nil (bug#50466).
2021-09-10 12:39:33 +02:00
Lars Ingebrigtsen
74d091a0a6 Change the default value of search-whitespace-regexp
* lisp/isearch.el (search-whitespace-regexp): Change the default
to always exclude newlines from the set (bug#21278).  It used to
be mode-dependent whether newlines were included or not, and this
was confusing as a user interface.
2021-09-10 12:27:28 +02:00
Dmitry Gutov
44ba8278a6 * lisp/progmodes/ruby-mode.el (ruby-current-indentation): Tweak obsoletion. 2021-09-10 03:44:49 +03:00
Dmitry Gutov
b2c44706b6 Support tags-apropos-additional-actions in etags Xref backend
* lisp/progmodes/etags.el (xref-etags-apropos-location):
New class.
(xref-location-marker): New method definition.
(xref-make-etags-apropos-location): New function.
(etags--xref-apropos-additional): New function.
(xref-backend-apropos): Use it here.
2021-09-10 03:18:15 +03:00
Eli Zaretskii
ceb60225ba ; * lisp/progmodes/python.el (python-shell-send-string): Fix last change. 2021-09-09 21:04:13 +03:00
Eli Zaretskii
d92db04a9d Improve documentation of tab-bar functions and variables
* etc/NEWS: Improve wording of tab-bar related entries.

* lisp/tab-bar.el (tab-bar-show, tab-bar-select-tab-modifiers):
Improve and clarify the doc strings.
2021-09-09 21:01:53 +03:00
Eli Zaretskii
bac632aaec Fix a recent change wrt 'comint-max-line-length'
* lisp/progmodes/python.el (python-shell-send-string): Only heed
'comint-max-line-length' for subprocesses with which we
communicate via PTYs.  (Bug#49822)

* lisp/comint.el (comint-max-line-length): Doc fix.  Add a value
for MS-Windows.
2021-09-09 20:08:56 +03:00
Stefan Monnier
8c023e5ea1 Change ruby-align-chained-calls indendation
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Align with the
first sibling on the previous line instead of the last (bug#32496).

That is, before it used to be

one.two.three
       .four

and now it is

one.two.three
   .four
2021-09-09 16:24:57 +02:00
Augusto Stoffel
e27385ec37 Better treatment of line length limits for the Python inferior
* lisp/comint.el (comint-max-line-length): New constant reflecting a
safe maximum line size that can be sent to an inferior process.
* lisp/progmodes/python.el
(python-shell-comint-watch-for-first-prompt-output-filter): Send setup
code to the inferior process only once and at this stage.
(python-shell-eval-setup-code, python-shell-eval-file-setup-code):
Move, unchanged, to an earlier point to avoid byte-compiler warnings.
(python-shell-send-string-no-output): Revert changes of e32c7d2a8d
(python-shell-send-string): Use 'comint-max-line-length' to decide
when to resort to temp files.
(python-shell-send-string, python-shell-send-file): Don't send setup
code each time (bug#49822).
2021-09-09 15:48:37 +02:00
Lars Ingebrigtsen
2be75990a7 Clarify Gnus vs. font locking in the Gnus manual
* doc/misc/gnus.texi (Formatting Variables): Explicitly mention
that font locking doesn't work in Gnus buffers (bug#50474).
2021-09-09 15:42:00 +02:00
Lars Ingebrigtsen
8da1f03151 Remove the "Real meaning of copyleft" node in efaq
* doc/misc/efaq.texi (Real meaning of copyleft): Remove the
section (bug#50446).
(Common acronyms): Add a link to the GNU site's page about licenses.
2021-09-09 15:19:56 +02:00