Avoid failing in desktop-clear due to killed buffers
* lisp/desktop.el (desktop-clear): check that buffer is not already
killed before attempting to kill it. A buffer might become killed as
part of regular operation as a side-effect of killing another buffer,
and then attempt to kill it again causes error (bug#49692).
Remove the (value) bits from cus-start Customize strings
* lisp/cus-start.el (standard): Don't mention the Lisp values in
the choice strings, because that's just confusing in the Customize
interface (bug#49687).
Move generalized variable specs from cl-lib.el to gv.el
* lisp/emacs-lisp/cl-lib.el: Move all the generalized variable
specifications from cl-lib.el...
* lisp/emacs-lisp/gv.el: ... to gv.el. This will make things like
`(setf (getenv "FOO") "BAR")' work without requiring anything,
since `setf' lives in gv.el (bug#49651).
Yan Gajdos [Wed, 21 Jul 2021 21:56:44 +0000 (23:56 +0200)]
Make vc-git-mode-line-string more robust
* lisp/vc/vc-git.el (vc-git-mode-line-string): Make function more
robust (bug#49683). It could previously error out under certain
conditions, like moving directories in and out of the
VC-controlled tree.
Jashank Jeremy [Wed, 21 Jul 2021 14:01:03 +0000 (16:01 +0200)]
Speed up by storing frame faces in hash tables instead of alists
* src/frame.h (struct frame): Add face_hash_table, remove face_alist.
(fset_face_hash_table): New function.
(fset_face_alist): Remove.
* src/frame.c (make_frame): Initialize f->face_hash_table.
(Fmake_terminal_frame): Update to work with hash tables instead of
alists.
* src/xfaces.c (lface_from_face_name_no_resolve):
(Finternal_make_lisp_face):
(update_face_from_frame_parameter): Update to work with hash tables
instead of alists.
(Fframe_face_hash_table): New function.
(Fframe_face_alist): Move to faces.el as frame-face-alist.
(syms_of_xfaces): Add frame_face_hash_table.
* lisp/progmodes/elisp-mode.el (elisp--eval-defun-1):
* lisp/frame.el (frame-set-background-mode): Update to work with hash
tables instead of alists.
* lisp/faces.el (face-new-frame-defaults): Mark obsolete.
(face-list): Update to use face--new-frame-defaults.
(frame-face-alist): Moved here from src/xfaces.c.
(x-create-frame-with-faces): Update to handle subtle semantic change
to how frame faces propagate, which otherwise breaks frame creation
with reverse video enabled (bug#41200).
Reworked from a patch by Clément Pit-Claudel <clement.pitclaudel@live.com>.
Stefan Kangas [Wed, 21 Jul 2021 12:01:57 +0000 (14:01 +0200)]
Factor out char_table_ref_simple for readability
* src/chartab.c (char_table_ref_simple): New function...
(sub_char_table_ref_and_range, char_table_ref_and_range):
...factored out from here. (bug#45550).
* lisp/emacs-lisp/byte-opt.el (byte-optimize-quote): Fix mistake that
made this optimiser ineffective at removing quoting of nil, t, and
keywords. The only obvious consequence is that we no longer need...
(byte-optimize-form): ...a 'nil => nil normalising step here; remove.
(byte-optimize-form-code-walker): Make the compiler warn about (quote).
* lisp/emacs-lisp/bytecomp.el (byte-compile--cond-switch-prefix):
Treat (not VAR) and (null VAR) as (eq VAR nil) when computing the
extent of switch ops.
Improve auto-revert-mode and revert-buffer doc strings
* lisp/autorevert.el (auto-revert-mode):
* lisp/files.el (revert-buffer): Mention that there is
revert-buffer-with-fine-grain that is better suited for markers
preservation (bug#49661).
Ioannis Kappas [Tue, 20 Jul 2021 13:53:34 +0000 (15:53 +0200)]
Allow installing packages with DOS line endings
* lisp/emacs-lisp/package.el (package-install-from-buffer): Allow
installing files with different line ending conventions (Unix, DOS
and Macos) (bug#48137).
Signal an error in json.c function if not available
* src/json.c (Fjson_serialize, Fjson_insert)
(Fjson_parse_string, Fjson_parse_buffer, syms_of_json): Signal
`json-unavailable' if jansson isn't available (bug#48228).
* lisp/minibuffer.el (minibuffer-quit-recursive-edit): New function.
* lisp/simple.el (minibuffer-error-function): Do not abort keyboard
macro execution if is minibuffer-quit is signaled (bug#48603).
* src/data.c (syms_of_data): New error symbol `minibuffer-quit'
* src/keyboard.c (recursive_edit_1): Implement throwing of function
values to `exit`. In that case, the function will be called without
arguments before returning from the command loop.
(cmd_error):
(Fcommand_error_default_function): Do not abort keyboard macro
execution if minibuffer-quit is signaled.
(command_loop_2): New argument HANDLERS.
* src/macros.c (Fexecute_kbd_macro): Use command_loop_2 instead of
command_loop_1.
Earl Hyatt [Sat, 19 Jun 2021 12:30:31 +0000 (08:30 -0400)]
Add commands 'kill-matching-lines' and 'copy-matching-lines'
* doc/emacs/search.texi: Document these additions.
* lisp/replace.el:
Add the commands 'kill-matching-lines' and 'copy-matching-lines'.
'kill-matching-lines' is like 'flush-lines', but adds the lines to the
kill ring as a single string, keeping line endings.
'copy-matching-lines' is like 'kill-matching-lines', but only copies
those lines instead of killing them.
* lisp/wdired.el (wdired--before-change-fn):
(wdired--restore-properties): Widen before doing anything so that
we get all the changed bits (bug#49124).
Make the `s' command in *Help* work for Lisp variables defined in C
* lisp/help-fns.el (describe-variable): Store the type.
* lisp/help-mode.el (help-view-source): Use the type. This fixes
the problem when looking for a variable defined in a C file.
Make make-indirect-buffer inherit inhibit-buffer-hook from base buffer
* src/buffer.c (Fmake_indirect_buffer):
Match base buffer's inhibit-buffer-hooks.
* test/src/buffer-tests.el (buffer-tests-inhibit-buffer-hooks-indirect):
Add a test (bug#49160).
* lisp/progmodes/compile.el (compilation-parse-errors):
Don't omit messages from the error count when FILE is a function
rather than a regexp match number.
The internal representation of columns uses half-open intervals but
don't expose that in the test cases, where we want to use the same
numbers as in the compilation messages.
* lisp/pcmpl-unix.el (pcomplete/xargs): Add support for completing xargs
options, including the ability to distinguish them from the command
xargs runs (bug#49603).
Copyright-paperwork-exempt: yes
Make 'n'/'p' work again in shortdoc after previous changes
* lisp/emacs-lisp/shortdoc.el (shortdoc--goto-section): Adjust to
changes in how the text properties are inserted in 22a5482ab6
(bug#49605). Also make into a regular function.
* lisp/emacs-lisp/eieio.el (initialize-instance):
Do not evaluate initform of a slot when initarg for the slot is provided,
according to the following secitons of CLHS:
- Object Creation and Initialization
- Initialization Arguments
- Defaulting of Initialization Arguments
- Rules for Initialization Arguments
* test/lisp/emacs-lisp/eieio-etests/eieio-tests.el:
Add corresponding tests
Fix a typo
7ac411ae2c (origin/emacs-27) ; * src/data.c (Fcar, Fcdr): Doc fix. 0d9e1826f7 One more minor update of the Emacs manual for 19th printing 92616d30e0 ; Fix let-alist Texinfo markup c13acf8e34 ; * doc/emacs/mule.texi (International Chars): Mention 'de...
* lisp/progmodes/bug-reference.el (bug-reference-setup-from-vc-alist):
Add support for codeberg.org bug and pull request references.
* doc/emacs/maintaining.texi (Bug Reference): Mention that bug and
pull request references for codeberg projects are supported.
* lisp/progmodes/bug-reference.el (bug-reference-setup-from-vc-alist):
Add support for bug references like #17 and ~user/project#19 for
sourcehut (sr.ht).
* doc/emacs/maintaining.texi (Bug Reference): Document sourcehut
support.