Paul Eggert [Sat, 6 Jun 2020 19:05:10 +0000 (12:05 -0700)]
make-text-button no longer modifies its string arg
* etc/NEWS: Mention this.
* lisp/apropos.el (apropos-library-button):
* lisp/ibuf-ext.el (ibuffer-old-saved-filters-warning):
There’s no longer a need copy make-text-button’s string arg.
* lisp/button.el (make-text-button): Return a copy of a string arg.
Delay making the copy until after error-checking.
For discussion see the following threads:
https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00630.html
https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00674.html
https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00099.html
* lisp/emacs-lisp/eieio.el (oset, oset-default): Un-deprecate.
* lisp/emacs-lisp/eieio-core.el (eieio-oref): Declare gv-setter here
instead of in lisp/emacs-lisp/eieio.el. Suggested by
Stefan Monnier <monnier@iro.umontreal.ca>.
(eieio-oref-default): Add gv-setter declaration.
* etc/NEWS: Announce these changes.
* doc/misc/eieio.texi (Accessing Slots): Document oref and
oref-default as generalized variables. Consistently document
getters before setters.
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el: Use
lexical-binding.
(eieio-test-13-init-methods): Simplify.
(eieio-test-33-instance-tracker): Declare IT-list as special.
Paul Eggert [Fri, 5 Jun 2020 01:46:11 +0000 (18:46 -0700)]
Streamline live_*_holding
(live_string_holding, live_cons_holding, live_symbol_holding)
(live_float_p, live_vector_holding):
Assert that m->type is correct, instead of testing this at
runtime. All callers changed.
(live_large_vector_holding, live_small_vector_holding):
Now two functions instead of the old live_vector_holding.
All callers changed.
(live_large_vector_p, live_small_vector_p):
Now two functions instead of the old live_vector_p.
All callers changed.
(mark_maybe_object): Ignore Lisp_Type_Unused0 quickly too,
since that cannot possibly be an object.
(CHECK_LIVE, CHECK_ALLOCATED_AND_LIVE):
New arg MEM_TYPE. All callers changed.
(CHECK_ALLOCATED_AND_LIVE_SYMBOL): Simplify by combining
GC_CHECK_MARKED_OBJECTS code.
Paul Eggert [Fri, 5 Jun 2020 01:46:10 +0000 (18:46 -0700)]
Make live_*_p more accurate
* src/alloc.c (live_string_holding, live_cons_holding)
(live_symbol_holding, live_vector_holding):
Return a C pointer, not a Lisp_Object. All callers changed.
This helps the compiler a bit.
(live_string_p, live_cons_p, live_symbol_p, live_vector_p):
Require that P point directly at the object, rather than
somewhere within the object. This fixes some false positives
with valid_lisp_object_p (used only in debugging).
(mark_maybe_object): Rely on the new accuracy.
For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00117.html
* lisp/apropos.el (apropos-library-button):
* lisp/help-fns.el (help-fns--first-release): Return result of
make-text-button instead of relying on its side effects.
* lisp/ibuf-ext.el (ibuffer-old-saved-filters-warning): Avoid
modifying an immutable string.
Juri Linkov [Thu, 4 Jun 2020 22:17:30 +0000 (01:17 +0300)]
* lisp/dired.el (dired-toggle-marks): Use region for non-nil dired-mark-region
(dired-mark--region-use-p, dired-mark--region-beginning)
(dired-mark--region-end): New internal functions.
(dired-mark-if): Use new functions. (Bug#39902)
Use characters for keys in project-switch-commands
* lisp/progmodes/project.el (project-switch-commands): Use
characters for keys instead of string for better future
compatibility with 'read-multiple-choice'.
(project-switch-project): Adjust to above change.
Stefan Monnier [Thu, 4 Jun 2020 13:58:22 +0000 (09:58 -0400)]
* lisp/font-lock.el (font-lock--syntax-table-affects-ppss): New var
This tries to make `font-lock-syntax-table` work correctly even when
it changes the parsing of strings and comments, as was the case in
`font-latex.el`.
We should probably deprecate the use of `font-lock-syntax-table` since
the present fix is still not 100% and since it comes with performance
problems in large files.
(font-lock-set-defaults): Set it.
(font-lock-fontify-syntactically-region): Don't use `syntax-ppss`
when we think that `font-lock-syntax-table` would interfere.
Paul Eggert [Thu, 4 Jun 2020 01:58:45 +0000 (18:58 -0700)]
Don’t default to Valgrind unless ENABLE_CHECKING
* src/alloc.c (USE_VALGRIND): If not defined, don’t default it to
1 unless ENABLE_CHECKING. The Valgrind hooks bloat the garbage
collector a bit in production, and there’s no need for them these
days if one has a Valgrind suppressions file (which one needs anyway).
(mark_maybe_pointer): Use ‘#if USE_VALGRIND’ instead of ‘#ifdef
USE_VALGRIND’ for consistency with other uses of USE_VALGRIND.
This is in case someone builds with ‘-DENABLE_CHECKING
-DUSE_VALGRIND=0’ in CFLAGS.
Paul Eggert [Thu, 4 Jun 2020 01:15:54 +0000 (18:15 -0700)]
Revert make-text-button string copy
* lisp/button.el (make-text-button): Don’t make a copy of
a button’s string label. This reverts the change made in
2020-05-17T05:23:28Z!eggert@cs.ucla.edu, which broke SLY.
Problem reported by João Távora in:
https://lists.gnu.org/r/emacs-devel/2020-06/msg00117.html
However, we’ll need a better fix for this once string
literals become contents, if SLY uses string constants
for text button labels.
Paul Eggert [Wed, 3 Jun 2020 22:39:29 +0000 (15:39 -0700)]
Fix make-text-button bug with string copy
* lisp/button.el (make-text-button): Use the copy of BEG
uniformly, instead of in just one place. This fixes a typo
introduced in 2020-05-17T05:23:28Z!eggert@cs.ucla.edu.
Problem reported by João Távora in:
https://lists.gnu.org/r/emacs-devel/2020-06/msg00117.html
* src/xfaces.c (color_distance): Don't throw away the low 8 bits of
the colours, and make the function symmetric (bug41544)
(Fcolor_distance): Add caution about this not being a true metric.
* test/src/xfaces-tests.el: New file.
Paul Eggert [Wed, 3 Jun 2020 01:40:10 +0000 (18:40 -0700)]
Fix bug in recent byte-code checking hoist
Problem reported by Daniel Colascione (Bug#41680).
* src/lread.c (read1): Check that AREF (tmp, COMPILED_BYTECODE)
is a string before subjecting it to STRING_MULTIBYTE.
Be more consistent about using AREF in the neighborhood,
to help prevent this sort of problem from recurring.
Dmitry Gutov [Tue, 2 Jun 2020 21:27:29 +0000 (00:27 +0300)]
project-list-file: New user option
* lisp/progmodes/project.el (project): New custom group.
(project-vc): Use it as parent.
(project-vc-merge-submodules): Tag with Emacs version.
(project-read-file-name-function): Assign to the 'project' group.
(project-list-file): New user option (bug#41600).
(project--write-project-list, project--read-project-list): Use it.
Simen Heggestøyl [Fri, 29 May 2020 14:58:09 +0000 (16:58 +0200)]
Remove 'project--ensure-file-exists'
* lisp/progmodes/project.el (project--ensure-file-exists): Remove.
(project--read-project-list): Set 'project--list' to nil when the
project list file doesn't exist.
Juri Linkov [Mon, 1 Jun 2020 23:01:25 +0000 (02:01 +0300)]
* lisp/progmodes/project.el (project-vc-dir, project-shell): New commands.
(project-compile): Add args and interactive spec like in 'compile'.
(project-switch-commands): Bind project-vc-dir to "v",
project-shell to "s", and rebind project-find-regexp from "s" to "r".
* doc/emacs/maintaining.texi (Project File Commands):
Describe project-vc-dir and project-shell.
For discussion of the autoloaded function declaration, see
https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00910.html.
* lisp/dnd.el (dnd-handle-one-url): It is no longer necessary to
declare the autoloaded function browse-url-select-handler after
ldefs-boot.el was updated.
* lisp/progmodes/elisp-mode.el: Declare xref.el function to silence
byte-compiler.
Dmitry Gutov [Mon, 1 Jun 2020 01:44:33 +0000 (04:44 +0300)]
Change xref-find-apropos to pass PATTERN to backend verbatim
* lisp/progmodes/xref.el (xref-backend-apropos): Rename this
generic's second arg to PATTERN, to clarify that it should be
handled entirely in the backend, with no pre-processing by the
command.
(xref-find-apropos): Update accordingly, but keep compatibility
with backends in older Emacs versions.
(xref-apropos-regexp): Extract from xref-find-apropos.
* lisp/progmodes/etags.el (xref-backend-apropos): Use it here.
* lisp/progmodes/elisp-mode.el (xref-backend-apropos): And here.
Paul Eggert [Sun, 31 May 2020 22:29:23 +0000 (15:29 -0700)]
Be more aggressive in marking objects during GC
Simplified version of a patch from Pip Cet (Bug#41321#299).
* src/alloc.c (maybe_lisp_pointer): Remove. All uses removed.
(mark_memory): Also look at the pointer offset by ‘lispsym’,
for symbols.
Eli Zaretskii [Sun, 31 May 2020 14:34:09 +0000 (17:34 +0300)]
Protect bidi cache from inadvertent resets
* src/xdisp.c (Fline_pixel_height, Fmove_point_visually): Save and
restore the bidi cache, to avoid inadvertently resetting it by
starting a new iteration through buffer text. This could cause
trouble if these functions are called during a redisplay cycle,
especially while we were processing RTL text.
Eli Zaretskii [Sun, 31 May 2020 14:23:11 +0000 (17:23 +0300)]
Avoid crashes due to bidi cache being reset during redisplay
If automatic character composition triggers GC, and
'garbage-collection-messages' are turned on, we could have the
bidi cache reset while processing RTL text, which would then
consistently crash.
* src/xdisp.c (display_echo_area_1): Protect the bidi cache
against changes inside 'try_window'.
Tino Calancha [Sun, 31 May 2020 10:31:27 +0000 (12:31 +0200)]
occur: Add bindings for next-error-no-select
Make the navigation in the occur buffer closer
to the navigation in the compilation buffer.
Add bindings to navigate the occur matches (Bug#39121).
Honor `next-error-highlight' and `next-error-highlight-no-select'
when navigating the occurrences.
* lisp/replace.el (occur-highlight-regexp, occur-highlight-overlay):
New variables.
(occur-1): Set `occur-highlight-regexp' to the searched regexp.
(occur-goto-locus-delete-o, occur--highlight-occurrence): New defuns.
(occur-mode-display-occurrence, occur-mode-goto-occurrence):
Use `occur--highlight-occurrence'.
(occur-mode-map): Bind n to `next-error-no-select'
and p to `previous-error-no-select'
* etc/NEWS (Changes in Specialized Modes and Packages in Emacs 28.1):
Announce this change.
* lisp/tab-bar.el (switch-to-buffer-other-tab): Use
'window-normalize-buffer-to-switch-to' on 'buffer-or-name',
like does 'pop-to-buffer' used by 'switch-to-buffer-other-frame',
instead of raising the error "Invalid buffer" on a non-existent buffer name.
Dmitry Gutov [Sat, 30 May 2020 16:57:06 +0000 (19:57 +0300)]
Don't return transient projects with MAYBE-PROMPT=nil
* lisp/progmodes/project.el (project-current): Only return
transient projects when called with non-nil MAYBE-PROMPT.
Also only update the known projects lists in this case.
(https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg03375.html).
immerrr [Sun, 17 May 2020 11:47:23 +0000 (13:47 +0200)]
Minor fix in 'find-alternate-file'
This fixes the use case when, for example, 'find-file-hooks'
fails.
* lisp/files.el (find-alternate-file): If buffer 'oname' exists,
kill it before renaming the new one. (Bug#41359)
Eli Zaretskii [Sat, 30 May 2020 10:56:20 +0000 (13:56 +0300)]
Remove private prototype for 'execve' and its uses in MinGW build
* src/sysdep.c (emacs_exec_file): Don't compile this function
anymore on WINDOWSNT, since it is not used there. This function
was the only reason for having 'execve' prototype in ms-w32.h.
* nt/inc/ms-w32.h (execve): Remove prototype and the MinGW64 vs
ming.org mess that it causes.
Eli Zaretskii [Fri, 29 May 2020 20:02:10 +0000 (23:02 +0300)]
Another fix of display of line-prefix with fringe bitmaps
* src/xdisp.c (redisplay_internal): Don't use "optimization 1"
if a glyph row from which to start display begins with a display
property that draws into the fringes. (Bug#41584)
Eli Zaretskii [Fri, 29 May 2020 14:00:52 +0000 (17:00 +0300)]
Fix display of line-prefix with fringe bitmaps
* src/xdisp.c (try_window_id): Don't use this optimization if a
glyph row from which to start display begins with a display
property that draws into the fringes. (Bug#41584)
akater [Fri, 29 May 2020 04:26:09 +0000 (00:26 -0400)]
* lisp/emacs-lisp/lisp-mode.el: Add new indentation convention
(calculate-lisp-indent): To distinguish code and data when indenting,
introduce the convention that a space between an open paren and
a symbol indicate that this should be indented as a simple data list.
James Thomas [Mon, 27 Apr 2020 02:36:48 +0000 (08:06 +0530)]
Improve Malayalam language transliteration
The existing ITRANS scheme did not support some characters and
language quirks like 'chillu's. The Inscript method had errors.
* lisp/language/ind-util.el (indian-mlm-base-table): Add archaic
chars, Mozhi combos; cleanup.
(indian-mlm-mozhi-table): New scheme Mozhi.
* lisp/leim/quail/indian.el (inscript-mlm-keytable): Correct
errors. Add Inscript chillus & zero-width chars, Mozhi scheme.
* etc/NEWS: Mention the changes.
Document that {en,de}code-coding-string preserve match data
* lisp/international/mule.el (define-coding-system):
Require :pre-write-conversion and :post-read-conversion functions
to leave the match data untouched.
* src/coding.c (Fdecode_coding_string, Fencode_coding_string):
Document functions as match-data-preserving.
Glenn Morris [Thu, 28 May 2020 14:50:26 +0000 (07:50 -0700)]
Merge from origin/emacs-27
bd7b681dc4 (origin/emacs-27) Tiny texinfo markup fixes d0dd0e0612 ; Fix more @var/@code mixups in Elisp manual 313dc0439e ; Fix another format-spec typo in the Elisp manual 9d7fd78421 Make next-error behavior a bit more flexible 0691d25295 * etc/NEWS.25: Belatedly announce upcase-dwim and downcase... df91c94ca8 Fix access to single-byte characters in buffer text
Dmitry Gutov [Wed, 27 May 2020 19:15:41 +0000 (22:15 +0300)]
Make next-error behavior a bit more flexible
* lisp/simple.el (next-error-no-navigation-try-current):
Extract from the case #2 in next-error-find-buffer (bug#40919).
(next-error-find-buffer-function): Use it as the default.
Paul Eggert [Wed, 27 May 2020 16:50:07 +0000 (09:50 -0700)]
Fix crash with invalid bytecode vectors
* src/lread.c (read_vector): If the vector is to short to be for
bytecodes don’t do bytecode processing for it, as the processing
might run past the end of the vector.
Paul Eggert [Wed, 27 May 2020 16:45:49 +0000 (09:45 -0700)]
--with-wide-int is a no-op on 64-bit hosts
* configure.ac: Clarify wording for --with-wide-int help.
* src/pdumper.c (dump_vectorlike_generic):
Do the eassert even if --with-wide-int was specified unnecessarily.
Simen Heggestøyl [Wed, 27 May 2020 15:17:15 +0000 (17:17 +0200)]
Simplify the previous commit
* lisp/progmodes/project.el (project--read-project-list): Simplify the
previous commit by utilizing the optional OMIT-NULLS argument to
'split-string'.
Don't clobber match data in utf-8-hfs conversion (bug#41445)
Reported by Ture Pålsson.
* lisp/international/ucs-normalize.el
(ucs-normalize-hfs-nfd-post-read-conversion)
(ucs-normalize-hfs-nfd-pre-write-conversion):
Use save-match-data to avoid match data clobber in normalisation.
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-save-match-data): New test.
Paul Eggert [Tue, 26 May 2020 22:47:59 +0000 (15:47 -0700)]
Tweak GC performance if !USE_LSB_TAG
Performance issue reported by Eli Zaretskii (Bug#41321#149).
* src/alloc.c (GC_OBJECT_ALIGNMENT_MINIMUM): New constant.
(maybe_lisp_pointer): Use it instead of GCALIGNMENT.
Simen Heggestøyl [Mon, 25 May 2020 19:10:03 +0000 (21:10 +0200)]
Adapt project functions to the new 'project-root'
* lisp/progmodes/project.el (project-dired, project-eshell)
(project--read-project-list, project--write-project-list)
(project--add-to-project-list-front)
(project--remove-from-project-list): Adapt to the new 'project-root'.
Simen Heggestøyl [Mon, 18 May 2020 16:17:10 +0000 (18:17 +0200)]
Update the Emacs manual with recent project.el changes
* doc/emacs/maintaining.texi (Projects): Add a menu.
(Project File Commands): New subsection describing project file
commands (moved here from 'Working with Projects'). Describe the new
commands 'project-dired' and 'project-eshell'.
(Switching Projects): New subsection.
Simen Heggestøyl [Sun, 17 May 2020 11:54:32 +0000 (13:54 +0200)]
Rename 'project-switch-menu' to 'project-switch-commands'
* lisp/progmodes/project.el (project-switch-commands): Rename from
'project-switch-menu'.
(project--keymap-prompt, project-switch-project): Update after the
renaming.
Simen Heggestøyl [Sat, 16 May 2020 07:53:43 +0000 (09:53 +0200)]
Turn project switch menu var into a public alist
* lisp/progmodes/project.el: Require seq.
(project--switch-alist): Remove in favor of the public
'project-switch-menu'.
(project-add-switch-command): Remove; not needed now that
'project-switch-menu' is a public alist.
(project-switch-menu): New variable mapping keys to project switching
menu entries.
(project--keymap-prompt, project-switch-project): Adjust to the new
'project-switch-menu' format.
Dmitry Gutov [Tue, 12 May 2020 01:20:26 +0000 (04:20 +0300)]
Integrate project-switch-project with project-find-regexp
* lisp/progmodes/project.el:
(project-find-regexp): Add to the list of 'switch' commands.
(project-switch-project): Use call-interactively so that the
former can read its arguments.