1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-14 09:39:42 +00:00
Commit Graph

9908 Commits

Author SHA1 Message Date
Andrea Corallo
b99a474482 Merge remote-tracking branch 'savannah/master' into HEAD 2020-12-23 19:49:58 +01:00
Philipp Stephani
3cbd4169d6 Reject filenames containing NUL bytes.
Such filenames are dangerous, as Emacs would silently only use the
part up to the first NUL byte.  Reject them explicitly instead.

* src/coding.c (encode_file_name_1): New helper function.
(encode_file_name): Check that encoded filename doesn't contain a
NUL byte.
(syms_of_coding): Define 'filenamep' symbol.

* test/src/fileio-tests.el (fileio-tests/null-character): New unit
test.

* etc/NEWS: Document change.
2020-12-23 12:00:46 +01:00
Alan Mackenzie
9920929e7b Re-order the items in `profiler-report' output.
Putting the usage figures first on the line will eliminate the truncation of
function names.

lisp/profiler.el (profiler-version): Change to "28.1".
(profiler-format): Enhance, so that a width of zero means print the string
without padding or truncation.
(profiler-report-cpu-line-format, profiler-report-memory-line-format): Amend
for the new layout.  The number of places for the cpu samples has been reduced
from 19 to 12 (enough for ~30 years at 1,000 samples per second).
(profiler-report-line-format, profiler-report-describe-entry): Amend for the
new order of arguments to profiler-format.

etc/NEWS (Specialized Modes): Add an entry documenting this change.

doc/lispref/debugging.texi (Profiling): Describe the new ordering of the items
in place of the old ordering.
2020-12-22 12:06:21 +00:00
Lars Ingebrigtsen
f329a3180e Add string-chop-newline
* doc/lispref/strings.texi (Creating Strings): Document it.
* lisp/emacs-lisp/subr-x.el (string-chop-newline): Add new function.
2020-12-21 22:05:37 +01:00
Basil L. Contovounesios
e967ba3018 ; Fix recent string utility additions
* etc/NEWS: Fix typo.
* lisp/emacs-lisp/subr-x.el (string-limit): Fix typos in docstring.
Simplify.
(string-slice): Improve docstring wording.
(string-pad): Simplify.
2020-12-21 20:51:29 +00:00
Lars Ingebrigtsen
cf2e832185 Rename slice-string to string-slice
* lisp/emacs-lisp/subr-x.el (string-slice): Rename from slice-string.
* doc/lispref/strings.texi (Creating Strings): Ditto.
2020-12-21 20:18:57 +01:00
Lars Ingebrigtsen
b3dec31766 Add `string-pad'
* doc/lispref/strings.texi (Creating Strings): Document it.
* lisp/emacs-lisp/shortdoc.el (string): Add example.

* lisp/emacs-lisp/subr-x.el (string-pad): New function.
2020-12-21 20:01:28 +01:00
Lars Ingebrigtsen
87e422f104 Beef up the Emacs string utility set a bit
* doc/lispref/strings.texi (Modifying Strings): Document them.
* lisp/emacs-lisp/shortdoc.el (string): Add examples.

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace)
(string-fill, string-limit, string-lines, slice-string): New
functions.
2020-12-21 18:53:40 +01:00
Andrea Corallo
f244c21902 Merge remote-tracking branch 'savannah/master' into HEAD 2020-12-20 22:08:42 +01:00
Michael Albinus
ecb5ebf156 Improve make-process in Tramp
* doc/misc/tramp.texi (Remote processes): Remove INSIDE_EMACS
restriction.
(Frequently Asked Questions, External packages): Add indices.

* etc/NEWS: 'start-process-shell-command' and
'start-file-process-shell-command' do not support the old calling
conventions any longer.

* lisp/subr.el (start-process-shell-command)
(start-file-process-shell-command): Remove old calling conventions.

* lisp/net/tramp-compat.el (remote-file-error): Remove, it isn't
necessary.

* lisp/net/tramp.el (tramp-handle-make-process): Remove special shell
handling.  Support environment variables.

* test/lisp/net/tramp-tests.el
(tramp--test--deftest-direct-async-process): Skip for mock method.
(tramp--test-async-shell-command): Suppress `shell-command-sentinel'.
(tramp-test32-shell-command, tramp-test33-environment-variables):
Adapt tests.
(tramp-test32-shell-command-direct-async)
(tramp-test33-environment-variables-direct-async): New tests.
2020-12-20 19:45:11 +01:00
Basil L. Contovounesios
1a0a11f7d2 Inhibit buffer hooks in temporary buffers
Give get-buffer-create an optional argument to inhibit buffer hooks
in internal or temporary buffers for efficiency (bug#34765).

* etc/NEWS: Announce new parameter of get-buffer-create and
generate-new-buffer, and that with-temp-buffer and with-temp-file
now inhibit buffer hooks.

* doc/lispref/buffers.texi (Buffer Names): Fix typo.
(Creating Buffers): Document new parameter of get-buffer-create and
generate-new-buffer.
(Buffer List, Killing Buffers): Document when buffer hooks are
inhibited.
(Current Buffer):
* doc/lispref/files.texi (Writing to Files): Document that
with-temp-buffer and with-temp-file inhibit buffer hooks.
* doc/lispref/internals.texi (Buffer Internals): Document
inhibit_buffer_hooks flag.  Remove stale comment.
* doc/misc/gnus-faq.texi (FAQ 5-8):
* lisp/simple.el (shell-command-on-region): Fix indentation.

* lisp/files.el (kill-buffer-hook): Document when hook is inhibited.
(create-file-buffer):
* lisp/gnus/gnus-uu.el (gnus-uu-unshar-article):
* lisp/international/mule.el (load-with-code-conversion):
* lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image):
* lisp/net/imap.el (imap-open):
* lisp/net/mailcap.el (mailcap-maybe-eval):
* lisp/progmodes/flymake-proc.el
(flymake-proc--read-file-to-temp-buffer)
(flymake-proc--copy-buffer-to-temp-buffer): Simplify.

* lisp/subr.el (generate-new-buffer): Forward new optional argument
to inhibit buffer hooks to get-buffer-create.
(with-temp-file, with-temp-buffer, with-output-to-string):
* lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer
used.

* src/buffer.c (run_buffer_list_update_hook): New helper function.
(Fget_buffer_create): Use it.  Add optional argument to set
inhibit_buffer_hooks flag instead of comparing the buffer name to
Vcode_conversion_workbuf_name.  All callers changed.
(Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal)
(record_buffer): Use run_buffer_list_update_hook.
(Fkill_buffer): Document when buffer hooks are inhibited.  Use
run_buffer_list_update_hook.
(init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer.
(Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document
when hooks are inhibited.
* src/buffer.h (struct buffer): Update inhibit_buffer_hooks
commentary.
* src/coding.h (Vcode_conversion_workbuf_name):
* src/coding.c (Vcode_conversion_workbuf_name): Make static again
since it is no longer needed in src/buffer.c.
(code_conversion_restore, code_conversion_save, syms_of_coding):
Prefer boolean over integer constants.
* src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in
" *code-converting-work*" buffer.
* src/window.c (Fselect_window): Fix grammar.  Mention
window-selection-change-functions alongside buffer-list-update-hook.

* test/src/buffer-tests.el: Fix requires.
(buffer-tests-inhibit-buffer-hooks): New test.
2020-12-20 17:32:24 +00:00
Roland Winkler
9f7e0a3e7d bibtex-mode: Permit user-defined schemes for sorting entries.
* lisp/textmodes/bibtex.el (bibtex-maintain-sorted-entries):
New allowed value (INDEX-FUN PREDICATE).
(bibtex-entry-index, bibtex-lessp): Use it.
(bibtex-init-sort): Rename from bibtex-init-sort-entry-class-alist.
2020-12-18 22:26:40 -06:00
Glenn Morris
8d2d8d7f53 Merge from origin/emacs-27
48b9c47805 Minor fixes in authors.el and in tarball-making instructions
d7a4ceaa1e ; Add a new item to TODO
64fe805b19 Improve documentation of 'query-replace'
7cacf5da47 Update to Org 9.4.3

# Conflicts:
#	admin/authors.el
2020-12-18 08:55:06 -08:00
Eli Zaretskii
d7a4ceaa1e ; Add a new item to TODO
* etc/TODO (redisplay): Add an item for making redisplay cycle
more scalable when there are many frames.
2020-12-17 16:22:05 +02:00
Glenn Morris
cbdd48a07b Merge from origin/emacs-27
668f0a7f84 Fix point location when completing in gdb-mi.el
2dbc95063b Update to Org 9.4.2
f22856a5c5 Update to Org 9.4.1

# Conflicts:
#	doc/misc/org.texi
#	lisp/org/ob-core.el
#	lisp/org/ob-ruby.el
#	lisp/org/ob-screen.el
#	lisp/org/ol-gnus.el
#	lisp/org/ol.el
#	lisp/org/org.el
2020-12-15 09:24:21 -08:00
Michael Albinus
c0c6cd2d5d Add 'remote-file-error' for Tramp
* doc/lispref/errors.texi (Standard Errors): Add 'remote-file-error'.

* etc/NEWS: Mention 'remote-file-error'.

* lisp/net/ange-ftp.el (ftp-error): Add error condition
`remote-file-error'.

* lisp/net/tramp-cmds.el (tramp-cleanup-all-connections): Do not set
`tramp-locked'.

* lisp/net/tramp-compat.el (remote-file-error): Define if it
doesn't exist.

* lisp/net/tramp-sh.el (tramp-timeout-session): Check for "locked"
property.
(tramp-maybe-open-connection): Simplify.

* lisp/net/tramp.el (tramp-locked, tramp-locker): Remove them.
(tramp-file-name-handler): Do not set them.
(with-tramp-locked-connection): New defmacro.
(tramp-accept-process-output, tramp-send-string): Use it.

* src/fileio.c (Qremote_file_error): New error symbol.

* test/lisp/net/tramp-tests.el (tramp-test43-asynchronous-requests):
Adapt test.  Remove :unstable tag.
2020-12-14 19:30:01 +01:00
Tim Ruffing
e5348f125f * etc/emacs.service:
* etc/emacs.service (ExecStart): Make Emacs exit from systemd work
better (bug#45181).

The problem here is the exit code 15, which emacs will return *only* if
it has received SIGTERM. I believe what's happening here is that
emacsclient will call kill-emacs but not wait until the emacs server
has properly shut down. However, it's supposed to wait for the shutdown
as an "ExecStop" command according to "man systemd.service". So since
the process is still alive when emacsclient comes back, systemd will
still issue SIGTERM, making emacs return 15 (maybe after calling kill-
emacs again?!).

Copyright-paperwork-exempt: yes
2020-12-14 17:59:58 +01:00
Daniel Martín
0dd8d53344 Make goto-char offer the number at point as default
* lisp/subr.el (read-natnum-interactive): New function to read natural
numbers for interactive functions.
* src/editfns.c (Fgoto_char): Call read-natnum-interactive from the
interactive definition of goto-char to offer the number at point as
default.  Also expand the docstring to document this new interactive
behavior.
* doc/emacs/basic.texi (Moving Point): Expand the Emacs manual to
document this new behavior.
* etc/NEWS: And announce it (bug#45199).
2020-12-14 17:16:00 +01:00
Lars Ingebrigtsen
252366866b Add a new recursively bound `current-minibuffer-command' variable
* doc/lispref/commands.texi (Command Loop Info): Document it
(bug#45177).

* src/callint.c (Fcall_interactively): Bind it.

* src/keyboard.c (syms_of_keyboard): Define
current-minibuffer-command.
2020-12-14 16:44:00 +01:00
Torsten Hilbrich
c42965745d Merge branch 'feature/integration-of-dictionary-el'
b6227446d9 Importing dictionary module
658ec3ccee Renamed connection.el
e2ebffdd62 Renamed link.el
723906c444 Removed some compability parts in dictionary
5dc17d73b0 Add :version tag to defcustom statement
49c250b388 Dont't check coding-system-list for existence
99a7e918c8 Don't check for existence of defface
1773b9b687 Dictionary now uses button
329b6a0210 Adding details page for dictionary
837505075c Fix dictionary tooltip mode
2f1e4fbc42 Support nil value for dictionary-server
91ff1c8f7c Move placement of dictionary-tooltip-mouse-event
28fe134971 Remove text property from empty line
7ca331a4f9 Add history of search words to read-string
d5a4da25b0 * lisp/net/dictionary.el: Remove remnants of package
cc5f280378 * lisp/net/dictionary.el: Add lexical-binding:t
09952ce434 Removed useless check for popup-menu
81ebe86d8d Show error message when asking to match for nothing
0044a2e888 * lisp/net/dictionary-connection.el: Add lexical-binding:t
f58443780c * lisp/net/dictionary-connection.el: Remove obsolete Version
54a3964e29 Update GPL version
a557a103cc * lisp/net/dictionary-connection.el: Prefer defsubst
ffa7d6671d * lisp/net/dictionary.el: Prefer defsubst over defmacro
4deb8618e4 * lisp/net/dictionary.el (dictionary-mode): Use setq-local
d30618cbc1 * lisp/net/dictionary.el (dictionary-tooltip-mode): Use ...
a25a12ddaf Use when where else case returns nil
89e9c1686e * lisp/net/dictionary.el (dictionary-display-more-info): ...
d466231c3e A number of docstring fixes
b18217eb87 A number of docstring fixes
ca0de4d1e0 * etc/NEWS: Add entry for dictionary.el
62d14e10f9 * lisp/net/dictionary.el (dictionary-pre-buffer): Unify casing
2020-12-14 12:09:41 +01:00
Torsten Hilbrich
ca0de4d1e0 * etc/NEWS: Add entry for dictionary.el 2020-12-14 11:45:24 +01:00
Juri Linkov
dc6e616dfe Don't show matches with no input for nil icomplete-show-matches-on-no-input
* lisp/icomplete.el (icomplete-show-matches-on-no-input): Fix docstring.
(icomplete--initial-input): New internal variable.
(icomplete-minibuffer-setup): Set buffer-local
icomplete--initial-input to icomplete--field-string.
(icomplete-ret, icomplete-force-complete-and-exit)
(icomplete--sorted-completions, icomplete-exhibit):
Compare icomplete--initial-input with icomplete--field-string
to detect no input.  (Bug#19031)

etc/NEWS: Remove duplicate entry.
2020-12-14 10:44:04 +02:00
Bastien Guerry
2dbc95063b Update to Org 9.4.2
Mostly fixing compiler warnings.
2020-12-13 22:26:51 +01:00
Bastien Guerry
f22856a5c5 Update to Org 9.4.1 2020-12-13 13:44:15 +01:00
Eric Abrahamsen
8a220d7c8f New option gnus-registry-register-all
* lisp/gnus/gnus-registry.el (gnus-registry-register-all): If nil,
the registry won't automatically create new entries for all seen
messages. Defaults to t to preserve previous behavior.
(gnus-registry-handle-action): Don't automatically create entries; if
one doesn't exist, don't handle anything.
(gnus-registry-register-message-ids): Only register if this option is
t.
(gnus-registry-get-or-make-entry): Add optional no-create argument.
(gnus-registry-get-id-key): This "get" operation should only create an
entry if this option is t.
* doc/misc/gnus.texi: Documentation and news.
2020-12-12 09:03:13 -08:00
Stefan Monnier
d165b5a46b New variable redisplay_adhoc_scroll_in_resize_mini_windows
* src/xdisp.c (syms_of_xdisp): Define it.
(resize_mini_window): Obey it.
2020-12-12 10:16:42 -05:00
Andrea Corallo
0474fda62d Merge remote-tracking branch 'savannah/master' into HEAD 2020-12-12 15:31:33 +01:00
Zajcev Evgeny
f45ce78c40 Explicitly specify svg base_uri using `:base-uri' image property
* src/image.c (svg_load): Check `:base-uri' image property to
explicitly set base_uri for images embedded into SVG
(enum svg_keyword_index):
(svg_format): Add :base-uri.
* lisp/svg.el (svg-embed-base-uri-image): New function to embed images
located relative to images `:base-uri'
2020-12-12 12:48:32 +00:00
Pankaj Jangid
dba74cb5ec Allow customizing the Gnus summary thread indicators
* doc/misc/gnus.texi (Summary Buffer Lines): Document them.

* lisp/gnus/gnus-sum.el (gnus-summary-prepare-threads): Use them.

* lisp/gnus/gnus-sum.el (gnus-sum-opening-bracket)
(gnus-sum-closing-bracket, gnus-sum-opening-bracket-adopted)
(gnus-sum-closing-bracket-adopted): New variables.
2020-12-12 11:47:17 +01:00
Stefan Monnier
78607f21b5 * lisp/play/dunnet.el: Make it so loading the file is harmless
Move comments into docstrings while at it.

(dun-batch): New function.
2020-12-11 19:06:55 -05:00
Lars Ingebrigtsen
004d7e97e2 Add a new command `memory-report'
* doc/lispref/internals.texi (Garbage Collection): Document it.
* lisp/emacs-lisp/memory-report.el: New package.
2020-12-11 14:49:53 +01:00
Lars Ingebrigtsen
aa7e5ce651 Add new function `object-intervals'
* doc/lispref/text.texi (Examining Properties): Document it.
* src/fns.c (Fobject_intervals): New defun.
(collect_interval): New function.
2020-12-11 14:40:20 +01:00
Lars Ingebrigtsen
9d598ef93c Add new function 'image-cache-size'
* src/image.c (Fimage_cache_size): New defun.
(image_frame_cache_size): New function.
2020-12-11 14:30:44 +01:00
Lars Ingebrigtsen
14ffab8263 Add a new function `button-buttonize'
* doc/lispref/display.texi (Manipulating Buttons): Document it.

* lisp/button.el (button-buttonize): Implement it.
2020-12-11 14:25:20 +01:00
Juri Linkov
303f0a19cc Support highlighting of ripgrep output (bug#44983)
* etc/grep.txt: Add ripgrep samples.

* lisp/progmodes/grep.el (grep-match-regexp): Highlight ripgrep matches too.
(grep-regexp-alist): Remove $ to highlight ripgrep binary file matches.
2020-12-09 21:16:03 +02:00
Glenn Morris
4adc79641f Merge from origin/emacs-27
c0b3e38d7c Update publicsuffix.txt from upstream
3fe6cea6e0 * lisp/vc/vc.el: Update args of backend API calls in the h...
2020-12-09 08:50:12 -08:00
Stefan Kangas
c0b3e38d7c Update publicsuffix.txt from upstream
* etc/publicsuffix.txt: Update from
https://publicsuffix.org/list/public_suffix_list.dat
dated 2020-11-30 21:57:25 UTC.
2020-12-09 11:52:59 +01:00
Lars Ingebrigtsen
ef711b1556 Make hexl scrolling commands work more like the normal ones
* lisp/hexl.el (hexl-scroll-down):
(hexl-scroll-up): Heed `next-screen-context-lines' (bug#7031).
2020-12-08 17:57:10 +01:00
Eli Zaretskii
26b198cef9 Improve documentation of 'backtrace-on-error-noninteractive'
* src/eval.c (syms_of_eval) <backtrace-on-error-noninteractive>:
Format the doc string according to conventions.

* etc/NEWS: Improve formatting and wording of the entry describing
'backtrace-on-error-noninteractive.
2020-12-08 18:43:09 +02:00
Basil L. Contovounesios
1537a8c863 ; Fix recent typos/wording in NEWS and server.el 2020-12-07 16:07:41 +00:00
Daniel Martín
6e0080e755 Add commands xref-next-group and xref-prev-group
* lisp/progmodes/xref.el (xref-next-group): New command that navigates
to the first item of the next xref group (typically a file).
(xref-prev-group): New command that navigates
to the first item of the next xref group (typically a file).
(xref--xref-buffer-mode-map): Bound the new commands to 'N' and 'P',
respectively.
* doc/emacs/maintaining.texi (Xref Commands): Document the new
commands in the Emacs manual.
* etc/NEWS: Announce them (bug#45089).
2020-12-07 17:01:35 +01:00
Lars Ingebrigtsen
b218c8b6b5 Allow shutting down Emacs even if there are errors in kill-emacs-hook
* lisp/subr.el (run-hook-query-error-with-timeout): New function
(bug#28542).

* src/emacs.c (Fkill_emacs): Use it to allow exiting Emacs even if
there are errors in kill-emacs-hook.
(syms_of_emacs): Define the symbol.
2020-12-07 15:40:23 +01:00
Lars Ingebrigtsen
ff5a3c74fc Allow inhibiting the instructions on how to close emacsclient frames
* doc/emacs/misc.texi (Invoking emacsclient): Document it.
* lisp/server.el (server-client-instructions): New variable.
(server-execute): Use it.
2020-12-07 13:53:24 +01:00
Philipp Stephani
3970f4ac40 Add new variable to selectively suppress backtraces in batch mode.
* src/eval.c (syms_of_eval): Define new variable
'backtrace-on-error-noninteractive' to selectively enable backtrace
printing in batch mode.
(signal_or_quit): Use it.

* etc/NEWS: Document new variable.

* test/src/eval-tests.el (eval-tests/backtrace-in-batch-mode/inhibit):
New unit test.
2020-12-07 11:59:06 +01:00
Andrea Corallo
715a1ca174 Merge remote-tracking branch 'savannah/master' into HEAD 2020-12-06 18:07:27 +01:00
Philipp Stephani
40e11743ca Print a backtrace on unhandled errors in batch mode (Bug#44942).
* src/eval.c (signal_or_quit): Print a backtrace in batch mode if no
error handler was found.

* test/src/eval-tests.el (eval-tests/backtrace-in-batch-mode)
(eval-tests/backtrace-in-batch-mode/demoted-errors): New unit tests.

* etc/NEWS: Document change.
2020-12-06 17:47:52 +01:00
Spencer Baugh
39915c7084 * src/alloc.c (Fgarbage_collect_maybe): New function 2020-12-04 17:21:02 -05:00
Lars Ingebrigtsen
f365eb2e05 Preload iso-trans.el
* lisp/loadup.el ("international/iso-transl"): Load by default so
that we get `Alt-' bindings (bug#21310).

* lisp/international/iso-transl.el: Remove autoloads and some
comments.
2020-12-04 10:46:34 +01:00
Dmitry Gutov
5e22c5f90e ; Expand on the NEWS entry 2020-12-04 03:54:14 +02:00
Dmitry Gutov
f2a3d6e28d Support using ripgrep in project-find-regexp and friends
Performance results vary here.  Some projects and search terms
don't see much of a change, but for some (including Emacs sources
checkout and case-insensitive search) the switch to ripgrep shows
~2-3x speed improvement.  Another piece of anecdata here:
https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00802.html

* lisp/progmodes/xref.el (xref-search-program-alist)
(xref-search-program): New user options.
(xref-matches-in-files): Use them.
2020-12-04 03:47:49 +02:00