Paul Eggert [Thu, 14 Jun 2018 22:59:09 +0000 (15:59 -0700)]
Avoid allocating Lisp_Save_Value for excursions
* src/editfns.c (save_excursion_save): New arg PDL,
specifying where to save the state. All uses changed.
(save_excursion_restore): Args are now the marker and info
rather than a pointer to a Lisp_Save_Value containing them.
All uses changed.
* src/eval.c (default_toplevel_binding, Fbacktrace__locals):
Treat excursions like other miscellaneous pdl types.
(record_unwind_protect_excursion): Save data directly
into the pdl rather than creating an object on the heap.
This avoids the need to allocate and free an object.
(do_one_unbind, backtrace_eval_unrewind):
Unwind excursions directly.
(mark_specpdl): Mark excursions directly.
* src/lisp.h (SPECPDL_UNWIND_EXCURSION): New constant.
(union specbinding): New member unwind_excursion.
Paul Eggert [Thu, 14 Jun 2018 22:59:09 +0000 (15:59 -0700)]
Just use cons in macfont_descriptor_entity
* src/macfont.m (macfont_descriptor_entity): Use cons instead
of make_save_ptr_int, as this avoids the need for a special
type and function for this one-off.
Paul Eggert [Thu, 14 Jun 2018 22:59:08 +0000 (15:59 -0700)]
Avoid allocating a Lisp_Save_Value in ftfont.c
* src/ftfont.c (struct ftfont_cache_data): New member face_refcount.
(ftfont_lookup_cache): Clear it when initializing.
Use make_mint_ptr, since this typically avoids the need to
allocate a Lisp_Save_Value as refcount is now stored elsewhere.
(ftfont_open2, ftfont_close): Manipulate the reference
count in the struct, not in the save object.
Paul Eggert [Thu, 14 Jun 2018 22:59:08 +0000 (15:59 -0700)]
Use record_unwind_protect_ptr to avoid allocation
* src/term.c (struct tty_pop_down_menu): New type.
(tty_pop_down_menu, tty_menu_show): Use it, along with
record_unwind_protect_ptr, to avoid allocating a Lisp_Misc.
* src/xmenu.c (struct pop_down_menu): New type.
(pop_down_menu, x_menu_show): Use it, likewise.
* src/xterm.c (x_cr_destroy, x_cr_export_frames):
Use record_unwind_protect_pointer to avoid possibly allocating
a Lisp_Misc.
Paul Eggert [Thu, 14 Jun 2018 22:59:08 +0000 (15:59 -0700)]
Avoid Lisp_Misc allocation if C stack suffices
* src/fileio.c (union read_non_regular): New type.
(read_non_regular, Finsert_file_contents):
Use it to avoid allocating a Lisp_Misc.
* src/keymap.c (union map_keymap): New type.
(map_keymap_char_table_item, map_keymap_internal):
Use it to avoid allocating a Lisp_Misc.
Paul Eggert [Thu, 14 Jun 2018 22:59:08 +0000 (15:59 -0700)]
Simplify init_module_assertions
* src/emacs-module.c (init_module_assertions): Just use NULL
instead of allocating a dummy on the stack and then using
eassert. Practical platforms check for null pointer
dereferencing nowadays, so this is good enough.
João Távora [Fri, 8 Jun 2018 01:35:50 +0000 (02:35 +0100)]
Also allow custom false and null when serializing to JSON
* doc/lispref/text.texi (Parsing JSON): Describe new arguments of
json-serialize and json-insert.
* src/json.c (enum json_object_type, struct json_configuration):
Move up in file before first usage.
(lisp_to_json_toplevel, lisp_to_json_toplevel_1, lisp_to_json):
Accept a struct json_configuration*.
(Fjson_serialize, Fjson_insert): Accept multiple args.
(json_parse_args): Accept new boolean configure_object_type.
João Távora [Thu, 7 Jun 2018 16:41:19 +0000 (17:41 +0100)]
Support custom null and false objects when parsing JSON
* doc/lispref/text.texi (Parsing JSON): Describe new :null-object
and :false-object kwargs to json-parse-string and
json-parse-buffer.
* src/json.c
(struct json_configuration): New type.
(json_to_lisp): Accept a struct json_configuration* param.
(json_parse_args): Rename from json_parse_object_type.
(Fjson_parse_string): Rework docstring.
(Fjson_parse_string, Fjson_parse_buffer): Update call to
json_to_lisp.
(syms_of_json): Two new syms, QCnull_object and QCfalse_object.
* test/src/json-tests.el
(json-parse-with-custom-null-and-false-objects): New test.
Damien Cassou [Sat, 19 May 2018 06:36:32 +0000 (08:36 +0200)]
Fix pretty-printing empty objects as null
* lisp/json.el (json-pretty-print): Force distinction between empty
objects and null.
(json-encode-list): Remove responsibility to print "null" as this
value is not a list.
(json-encode): Give higher precedence to lists so that an empty list
is printed as an empty object, not as "null".
* test/lisp/json-tests.el (test-json-encode): Add many tests to check
the behavior of pretty-printing.
Paul Eggert [Wed, 13 Jun 2018 20:30:29 +0000 (13:30 -0700)]
Remove some wrong 8-byte alignment assumptions
Do not assume that 8-byte alignment suffices for all C objects,
as some platforms require 16-byte alignment for some objects,
and this will start to bite us as time goes on (e.g., if an
Emacs module ever uses an object containing a long
double, which requires 16-byte alignment on x86-64).
Conversely, on !USE_LSB_TAG platforms, do not insist on
aligning Lisp objects to a multiple of 8, as this is not
needed for high-order tag bits.
* src/alloc.c (LISP_ALIGNMENT, MALLOC_IS_LISP_ALIGNED):
New constants.
(XMALLOC_BASE_ALIGNMENT, XMALLOC_HEADER_ALIGNMENT):
Removed. All uses replaced by LISP_ALIGNMENT.
(aligned_alloc, laligned, lmalloc, lrealloc, union aligned_Lisp_Misc)
(maybe_lisp_pointer, pure_alloc):
Use LISP_ALIGNMENT rather than GCALIGNMENT.
(aligned_alloc): Do not worry about an alignment of
LISP_ALIGNMENT when MALLOC_IS_LISP_ALIGNED, as the code never
uses aligned_alloc with alignment == LISP_ALIGNMENT in that case.
(__alignof__): Remove. All uses removed.
(MALLOC_IS_GC_ALIGNED): Remove.
All uses replaced with MALLOC_IS_LISP_ALIGNED.
(vector_alignment): Remove.
All uses replaced with LISP_ALIGNMENT.
* src/alloc.c (mark_maybe_pointer):
* src/emacs-module.c (value_to_lisp_bits):
Do not assume GCALIGNMENT == 1 << GCTYPEBITS, as GCALIGNMENT
is 1 on !USE_LSB_TAG platforms now.
* src/lisp.h (GCALIGNMENT) [!USE_LSB_TAG]: Now 1.
(struct Lisp_Symbol, union vectorlike_header, struct Lisp_Cons)
(struct Lisp_String): Simplify test for verifying alignment.
Clarify that enabling a theme does not disable other themes
Avoid user confusion by explicitly stating that enabling a theme does
not imply disabling other themes and that theme load functions are not
theme switch functions.
Frames can die between the time we generate a focus event and the time
we get around to processing it. Do run after-focus-change-function,
since that's idempotent and we want to make sure not to miss
any changes.
* lisp/frame.el (handle-focus-in, handle-focus-out): Check for dead frames.
Noam Postavsky [Fri, 25 May 2018 12:40:55 +0000 (08:40 -0400)]
Give warning if losing value to defvaralias (Bug#5950)
* src/eval.c (Fdefvaralias): Call `display-warning' if the alias
target has a non-eq value to the variable being aliased.
* test/src/eval-tests.el (defvaralias-overwrite-warning): New test.
* lisp/progmodes/sql.el Add MariaDB support (Robert Cochran)
(sql-product-alist): Add MariaDB entry
(sql-mariadb-program, sql-mariadb-options, sql-mariadb-login-params,
sql-mode-mariadb-font-lock): New variables, aliases of the MySQL
equivalents
(sql-mariadb, sql-comint-mariadb): New interaction mode functions
for MariaDB
(sql-mode-mysql-font-lock-keywords): Updated font-lock for MySQL
and MariaDB
soap-client: Add byte-code compatibility function (Bug#31742)
* lisp/net/soap-client.el: Bump version to 3.1.4.
(soap-type-of): New function.
(soap-resolve-references, soap-decode-type)
(soap-encode-attributes, soap-encode-value): Replace aref
calls with calls to soap-type-of.
* lisp/net/soap-inspect.el (soap-sample-value, soap-inspect):
Replace aref calls with calls to soap-type-of.
* lisp/frame.el (blink-cursor--should-blink):
(blink-cursor--rescan-frames, blink-frame-mode): Get rid of the
ugly ignored-frame parameter and switch from
`delete-frame-functions' to `after-delete-frame-functions'.
* src/frame.c (syms_of_frame): New variable
`after-delete-frame-functions'.
(delete_frame): Use it.
* lisp/frame.el (blink-cursor--should-blink): New function.
(blink-cursor-check): Call it.
(blink-cursor--rescan-frames): New function.
(blink-cursor-mode): Wire up `blink-cursor--rescan-frames`; stop
using `focus-in-hook' and `focus-out-hook'.
focus-in-hook and focus-out-hook don't accurately reflect actual
user-visible focus states. Add a new focus interface and mark the old
one obsolete.
* doc/lispref/frames.texi (Input Focus): Document new focus
functions. Remove references to the now-obsolete focus hooks.
* lisp/frame.el (frame-focus-state): New function.
(after-focus-change-function): New variable.
(focus-in-hook, focus-out-hook): Move to lisp from C;
mark obsolete.
* lisp/term/xterm.el (xterm-translate-focus-in)
(xterm-translate-focus-out): Track tty focus in `tty-focus-state'
terminal parameter; call `after-focus-change-function'.
(xterm--suspend-tty-function): New function.
* src/frame.c (Fhandle_switch_frame): Update docstring; don't call
focus hooks.
(focus-in-hook, focus-out-hook): Remove: moved to lisp.
(syms_of_frame): Remove unread_switch_frame; add
Vunread_switch_frame.
* src/keyboard.c:
(Finternal_handle_focus_in): New function.
(make_lispy_event): Always report focus events to lisp; don't
translate them to switch events sometimes. Lisp can take care of
creating synthetic switch-frame events via
`internal-handle-focus-in'.
* src/w32term.c (x_focus_changed): Remove switch-avoidance logic:
just directly report focus changes to lisp.
* src/xterm.c (x_focus_changed): Remove switch-avoidance logic:
just directly report focus changes to lisp.
Noam Postavsky [Sun, 10 Jun 2018 22:43:49 +0000 (18:43 -0400)]
Merge from emacs-26
3434edc731 Enlarge DUMPED_HEAP_SIZE for 64-bit Windows builds 36bbdfc017 Update Unicode data files to version 11.0.0 of Unicode b7b7a5f4f3 * etc/NEWS: Belatedly call out vc-hg changes in v26.1. (B... 5b6f8b54d1 Clarify the documentation of 'dired-recursive-deletes' 9db97b49cd ; * etc/DEBUG: Add information about debugging libXft prob... 0214ffbe60 Clarify doc string of 'update-glyphless-char-display' ef35d405b1 Clarify subtle issues with 'eq' in byte-compiled code c6ef3c8321 Make cl-print respect print-quoted (bug#31649) 26b52ac40e Fix unexpected jumps of window-point in 'set-window-config... 4af077ab4d * etc/emacs.appdata.xml: Update Emacs screenshot. e5ab25deae Fix cursor movement by 'next-logical-line' after 'next-line' d20beef5f1 Fix prompt in bookmark.el (Bug#24726) c57e7eaae8 Improve documentation of 'empty' whitespace-style
Noam Postavsky [Sun, 10 Jun 2018 22:41:47 +0000 (18:41 -0400)]
Merge from emacs-26
55c9bb9f3c Fix comint-get-old-input-default for output field case (Bu... 26819cd1c0 ; ChangeLog.3: Fix typo. e35a08ea4b Prevent infloop in 'delete-trailing-whitespace'
* lisp/progmodes/cperl-mode.el:
* lisp/progmodes/cc-engine.el:
* lisp/progmodes/cc-mode.el: Fix tabs mixed with space preventing
commit hook from succeeding.
Paul Eggert [Sun, 10 Jun 2018 17:38:28 +0000 (10:38 -0700)]
Pacify gcc -Wnull-dereference some more
* src/keyboard.c (read_char): Use xevent_start in a couple
more places where it is safe. This is needed with
--enable-gcc-warnings --enable-checking on Fedora 28 x86-64.
Paul Eggert [Sun, 10 Jun 2018 17:13:45 +0000 (10:13 -0700)]
Use native alignment to access Lisp object data
Instead of using __builtin_assume_aligned (P, GCALIGNMENT) to
tell GCC that P has alignment 8, use (T *) P where T is the
type of the pointed-to object, to tell GCC that P has native
alignment. This is simpler, matches the intent better, and
should help simplify future improvements. Some of these
changes are to pacify gcc -Wnull-dereference, since GCC is
smarter about pointers now that Emacs no longer uses
__builtin_assume_aligned; these minor changes should improve
code efficiency slightly. On Fedora 28 x86-64 with default
optimization this patch shrinks the size of the Emacs text
segment by 0.36%.
* src/conf_post.h (__has_builtin, __builtin_assume_aligned):
Remove; no longer used.
* src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE):
Pacify -Wnull-dereference by using XCAR instead of CAR_SAFE
and XCDR instead of CDR_SAFE when this is safe.
* src/fileio.c (Fexpand_file_name):
* src/font.c (clear_font_cache):
Pacify -Wnull-dereference by removing unnecessary NILP test.
* src/keyboard.c (xevent_start): New function.
(read_char, read_key_sequence): Pacify -Wnull-dereference by
using xevent_start instead of EVENT_START.
* src/lisp.h (lisp_h_XUNTAG): Remove; XUNTAG is always a macro
now, since it can no longer be implemented as a function.
(XUNTAG): New third argument CTYPE. All uses changed.
Cast result to CTYPE * instead of using __builtin_assume_aligned.
Simplify by using LISP_WORD_TAG.
(LISP_WORD_TAG): New macro.
(TAG_PTR): Use it.
* src/menu.c (x_popup_menu_1):
Pacify -Wnull-dereference by using XCAR instead of Fcar and
XCDR instead of Fcdr where this is safe.
Reuben Thomas [Fri, 16 Mar 2018 10:50:21 +0000 (10:50 +0000)]
Call enchant-lsmod correctly when Enchant is installed with a suffix
* lisp/textmodes/ispell.el (ispell--call-enchant-lsmod): Cope with a
version suffix on the binary name, so enchant-2 is converted to
enchant-lsmod-2, not enchant-2-lsmod. (Bug#31761)
Paul Eggert [Sun, 10 Jun 2018 01:59:25 +0000 (18:59 -0700)]
Simplify read_key_sequence
* src/keyboard.c (READ_KEY_ELTS): New constant.
(keyremap_step, read_key_sequence): Omit BUFSIZE arg, since it's
always READ_KEY_ELTS. All callers changed.
(grow_bool_vector): Remove; no longer needed.
(read_key_sequence): Use a bool array instead of a Lisp bool
vector, since it's small and this puts less pressure on the GC.
Paul Eggert [Sun, 10 Jun 2018 00:56:29 +0000 (17:56 -0700)]
Fix pointer misuse in JSON parser
* src/json.c (lisp_to_json_toplevel_1): Fix pointer misuse not
caught by C type checking (json_t ** converted to void * where
the program expected json_t *). Bug caught on Fedora 28 x86-64 via
'./configure CFLAGS="-g3 -O2 -fsanitize=address" CANNOT_DUMP=yes'.
Avoid similar problems in the future by rewriting to use
json_t * instead of json_t **.
read_key_sequence can, in various circumstances, play back recorded
events. Make sure that we set last_nonmenu_event as if we weren't
replaying. Without this change, we leave last_nonmenu_event set to
whatever it was before we started replaying, leading to spurious
random keymap menu prompts appearing after reading terminal control
sequences, the translation of which sometimes causes event replays.
* src/keyboard.c:
(grow_bool_vector): New function
(read_key_sequence): Remember menu event history per-event.
The existing debug print commands don't work in rr, since they touch
stderr. The new xfmt command just calls Fformat and doesn't touch the
stdio streams.
Paul Eggert [Sun, 10 Jun 2018 00:17:55 +0000 (17:17 -0700)]
Fix read buffer overrun on overflowed integers
* src/lread.c (read_integer): Fix off-by-1 buffer overrun
introduced in 2018-04-17T23:23:16Z!eggert@cs.ucla.edu. The
bug could occur when Emacs read radixed integers containing
more than 100 digits. Bug caught by AddressSanitizer.
Alan Mackenzie [Sat, 9 Jun 2018 21:39:43 +0000 (21:39 +0000)]
Implement the C++11 "using" type definition.
Cease using the long obsolete c++-template-syntax-table.
* lisp/progmodes/cc-align.el (c-lineup-template-args): Cease using
c++-template-syntax-table.
* lisp/progmodes/cc-engine.el (c-beginning-of-inheritance-list)
(c-search-decl-header-end, c-beginning-of-decl-1, c-end-of-decl-1)
(c-guess-continued-construct, c-guess-basic-syntax): Cease using
c++-template-syntax-table.
(c-guess-basic-syntax): Add CASE 5D.6 to handle C++11's "using" type
definition.
* lisp/progmodes/cc-langs.el (c++-make-template-syntax-table)
(c++-template-syntax-table): Remove.
(c-equals-type-clause-kwds, c-equals-type-clause-key): New language
constants/variables.
We used to treat the start of a focus-in, focus-out, and the start of
a paste sequence as normal events bound in global-map, but this
approach produces problems when we recognize events in the middle of
actions that don't immediately dispatch to the command loop.
Now we handle these events internally inside read-key, translating the
focus events to nothing and paste-start into an xterm-paste event that
neatly encapsulates the entire paste sequence.
* lisp/term/xterm.el:
(xterm-paste): Accept an event argument; insert text from event.
(xterm-translate-focus-in,xterm-translate-focus-out)
(xterm-translate-bracketed-paste): New functions.
(xterm-handle-focus-in,xterm-handle-focus-out): Remove.
(xterm-rxvt-function-map): Bind new translation functions.
Alan Mackenzie [Sat, 9 Jun 2018 17:34:46 +0000 (17:34 +0000)]
CC Mode: In brace lists, anchor an elt on its predecessor, not on first elt
* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): At the end, accept
"." as a unary operator (which it now is in brace lists in, e.g., C Mode).
(c-guess-basic-syntax): Just before CASE 9C, move back to the previous brace
list entry in the block, rather than to the first one.
Make error checking for thread functions stricter.
* src/systhread.c (sys_thread_create): Change return type to bool.
Check for errors returned by pthread_attr_setstacksize and
pthread_attr_destroy.
(sys_mutex_init): Abort on errors. Enable mutex checks when checking
is enabled.
(sys_cond_init): Abort on errors.
(sys_mutex_lock, sys_mutex_unlock, sys_cond_wait)
(sys_cond_signal, sys_cond_broadcast, sys_cond_destroy): Check for
errors in debug mode.
Eli Zaretskii [Sat, 9 Jun 2018 12:41:21 +0000 (15:41 +0300)]
Update Unicode data files to version 11.0.0 of Unicode
* admin/unidata/UnicodeData.txt:
* admin/unidata/SpecialCasing.txt:
* admin/unidata/NormalizationTest.txt:
* admin/unidata/copyright.html:
* admin/unidata/BidiMirroring.txt:
* admin/unidata/BidiBrackets.txt: Import from Unicode 11.0.
* admin/notes/unicode: Update the URL for OTF script tags.
* lisp/international/mule-cmds.el (ucs-names): Update unused ranges.
* lisp/international/fontset.el (script-representative-chars): Add
hanifi-rohingya, old-sogdian, sogdian, dogra, gunjala-gondi,
makasar, and medefaidrin.
(otf-script-alist): Add old-hungarian.
* lisp/international/characters.el (tbl): Add syntax entries for
Supplemental Mathematical Operators, Miscellaneous Symbols and
Arrows, and Supplemental Punctuation.
Update the list of wide characters.
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part2): Update to match
admin/unidata/NormalizationTest.txt.
* doc/lispref/nonascii.texi (Character Properties): Update the
reference to the Unicode Standard.
* doc/misc/efaq.texi (New in Emacs 26):
* etc/NEWS: Mention compatibility with Unicode 11.0.
Eli Zaretskii [Sat, 9 Jun 2018 08:03:20 +0000 (11:03 +0300)]
Allow to reset Deleted flag when exporting messages in Rmail
* lisp/mail/rmailout.el (rmail-output-reset-deleted-flag): New
defcustom.
(rmail-output): When 'rmail-output-reset-deleted-flag' is non-nil,
reset the Deleted flag of the appended messages, and if COUNT is
greater than 1, do not ignore deleted messages. Update the doc
string accordingly. (Bug#31271)
Paul Eggert [Sat, 9 Jun 2018 06:53:58 +0000 (23:53 -0700)]
Remove AddressSanitizer bug workaround
This workaround no longer appears to be needed.
* src/alloc.c (USE_ALIGNED_ALLOC): Don’t leave undefined
merely because ADDRESS_SANITIZER is defined, as that bug
in -fsanitize=address appears to have been fixed. See:
https://github.com/google/sanitizers/issues/337
* src/conf_post.h (vfork): Improve comment.
Avoid unnecessary readahead early in TTY frame init
We query some properties of the terminal early in initialization, and
just before we do, we perform ordinary redisplay. This redisplay can
result in unsightly flickering if we change some aspects of the
display immediately afterward and redisplay again. By avoiding
redisplay in xquery--query as long as we get timely responses from the
terminal, we can avoid this early unwanted redisplay.
* lisp/term/xterm.el:
(xterm-query-redisplay-timeout): New variable.
(xterm--read-event-for-query): New function.
(xterm--report-background-handler,xterm--version-handler,xterm--query):
Call it.
* lisp/frame.el (handle-focus-in,handle-focus-out): Make event
argument optional.
(blink-cursor-check): Make sure that the current frame is a
window-system frame before restarting the blink timer. TTY frames
can get focus, but don't need a blink timer because the terminal
will do the blinking.
* lisp/term/xterm.el
(xterm-handle-focus-in,xterm-handle-focus-out): New functions.
(xterm-rxvt-function-map): Recognize focus notification sequences.
(xterm--init-focus-tracking): New function.
(terminal-init-xterm): Call it.
Alan Mackenzie [Fri, 8 Jun 2018 16:42:18 +0000 (16:42 +0000)]
CC Mode: Fontify unbalanced quotes in unconstrained multiline strings, etc.
("Unconstrained" meaning that every string is multiline, without needing such
special marking as used by Pike Mode.)
* lisp/progmodes/cc-mode.el (c-pps-to-string-delim): Don't process the char
before BOB.
(c-multiline-string-check-final-quote): New function.
(c-bc-changed-stringiness): New variable.
(c-before-change-check-unbalanced-strings): Add handling for unconstrained
multiline strings.
(c-after-change-re-mark-unbalanced-strings): Add handling for unconstrained
multiline strings. Handle escaped double quotes more accurately.
Paul Eggert [Fri, 8 Jun 2018 15:08:03 +0000 (08:08 -0700)]
Port alignment verification to x86 --with-wide-int
Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2018-06/msg00238.html
* src/lisp.h (struct Lisp_Symbol, union vectorlike_header)
(struct Lisp_Cons, struct Lisp_String):
Do not check alignment if !USE_LSB_TAG, as alignment is
needed only if we are tagging the low-order bits.
Extend face specifications to support the notion of filtering to a
specific context and add a filter that limits a face specification to
windows having a certain parameter.
* src/xfaces.c:
(evaluate_face_filter,filter_face_ref): New functions.
(merge_face_ref): Ignore filtered face specifications.
(Fx_list_fonts,get_lface_attributes,merge_face_vectors)
(merge_named_face,merge_face_ref,merge_face_ref)
(Finternal_merge_in_global_face,Fface_font,lookup_named_face)
(lookup_basic_face,Fface_attributes_as_vector)
(x_supports_face_attributes_p)
(Fdisplay_supports_face_attributes_p,realize_named_face)
(compute_char_face,face_at_buffer_position)
(face_at_buffer_position,face_at_buffer_position)
(face_at_buffer_position)
(face_for_overlay_string,face_at_string_position,merge_faces):
Pass window to face machinery.
(syms_of_xfaces): Add :window and :filtered
* src/xdisp.c (init_iterator, handle_face_prop)
(handle_single_display_spec, merge_escape_glyph_face)
(merge_glyphless_glyph_face, get_next_display_element)
(next_element_from_display_vector, append_space_for_newline)
(extend_face_to_end_of_line,highlight_trailing_whitespace)
(maybe_produce_line_number)
(display_line, calc_line_height_property): Pass window to
face machinery.
* src/term.c (tty_menu_activate): Adjust to new face core
function signature.
* src/msdos.c (XMenuActivate): Adjust to new face core
function signature.
* src/fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face):
Pass window to face machinery.
* src/font.c (font_range, Finternal_char_font): Pass window to
face machinery.
* src/dispnew.c (spec_glyph_lookup_face): Pass window to
face machinery.
* src/dispextern.h:
(lookup_named_face,lookup_basic_face)
(lookup_derived_face,merge_faces):
Add struct window arguments to prototypes.
Paul Eggert [Fri, 8 Jun 2018 01:53:27 +0000 (18:53 -0700)]
New function record_unwind_protect_excursion
This simplifies callers a bit, and will simplify future changes.
* src/eval.c (record_unwind_protect_excursion): New function.
* src/buffer.c (Fkill_buffer):
* src/bytecode.c (exec_byte_code):
* src/editfns.c (Fsave_excursion, Freplace_buffer_contents):
* src/lread.c (readevalloop, Feval_buffer):
* src/window.c (scroll_command):
Use it.
Paul Eggert [Fri, 8 Jun 2018 01:53:26 +0000 (18:53 -0700)]
Don’t over-align if WIDE_EMACS_INT
* src/lisp.h (GCALIGNED_UNION): New macro.
(struct Lisp_Symbol, union vectorlike_header)
(struct Lisp_Cons, struct Lisp_String):
Use it to avoid possible over-alignment if !USE_LSB_TAG.
Paul Eggert [Fri, 8 Jun 2018 01:53:26 +0000 (18:53 -0700)]
Fix GC-related commentary
* src/lisp.h: USE_STACK_LISP_OBJECTS is no longer experimental.
Also, remove confusion about scope vs lifetime.
And say that stack-allocated strings should not be given
text properties.
Martin Rudalics [Thu, 7 Jun 2018 07:59:38 +0000 (09:59 +0200)]
Fix unexpected jumps of window-point in 'set-window-configuration' (Bug#31695)
* src/window.c (Fset_window_configuration): Prevent that the
fix for Bug#12208 affects restoration of window points when
using separate minibuffer frames (Bug#31695).
Eli Zaretskii [Wed, 6 Jun 2018 15:28:44 +0000 (18:28 +0300)]
Fix cursor movement by 'next-logical-line' after 'next-line'
* src/indent.c (Fvertical_motion): Adjust TO_X when line-numbers
are being displayed. Remove unneeded "correction" of TO_X at the
goal line.
* lisp/simple.el (last--line-number-width): Remove unneeded
variable.
(line-move-visual): Account for line-number display width by
adjusting the pixel X coordinate that gets converted into
canonical columns passed to vertical-motion, instead of adjusting
temporary-goal-column (which then affects next commands, including
next-logical-line). (Bug#31723)
Allen Li [Sat, 8 Apr 2017 22:21:12 +0000 (15:21 -0700)]
Fix prompt in bookmark.el (Bug#24726)
* lisp/bookmark.el (bookmark-set-internal): Conform to the standard
default prompt format (per `minibuffer-electric-default-mode') which
does not use a colon.
João Távora [Tue, 5 Jun 2018 16:20:43 +0000 (17:20 +0100)]
When navigating Flymake diagnostics, consider their severity
The FILTER arg of flymake-goto-next-error, a list of types, includes
every diagnostic with a severity number `eq` to those types.
* lisp/progmodes/flymake.el (flymake--severity): New helper.
(flymake-goto-next-error, flymake-goto-prev-error): Clarify
meaning of FILTER.
(flymake-goto-next-error): Interpret filter as a severity filter.
(flymake--mode-line-format): Simplify.
* doc/emacs/display.texi (Useless Whitespace): Clarify that the
'empty' whitespace-style option highlights empty lines only at
BOB/EOB, as per the docstring of whitespace-style. (bug#31713)
João Távora [Tue, 5 Jun 2018 14:13:02 +0000 (15:13 +0100)]
Obsolete Flymake's flymake-diagnostic-types-alist
That varaiable was an association between symbols and properties,
effecively duplicating symbol's property lists. It is simpler to just
put properties on symbols. Backward compatibility to the old variable
has been kept.
* etc/NEWS: Mention obsoletion of flymake-diagnostic-types-alist.
* lisp/progmodes/flymake-proc.el
(flymake-proc--diagnostics-for-pattern): Don't use
flymake-diagnostic-types-alist.
* lisp/progmodes/flymake.el: Rewrite commentary.
(flymake-make-diagnostic, flymake-mode, flymake-goto-next-error)
(flymake-goto-prev-error): Don't mention
flymake-diagnostic-types-alist in docstring.
(flymake-diagnostic-types-alist): Make obsolete.
(:error, :warning, :note): Put flymake-category in these symbols.
(flymake-error, flymake-warning, flymake-note): Put
`flymake-bitmap', not `bitmap' in these symbols.
(flymake--lookup-type-property, flymake--highlight-line): Rewrite.
Honor flymake-diagnostic-types-alist for backward
compatibility.
João Távora [Tue, 5 Jun 2018 13:31:38 +0000 (14:31 +0100)]
Correctly filter Flymake diagnostic types shown in mode-line
Thus, if a package foo has its own types foo-error and
foo-warning, and if the buffer has no errors, the mode-line
will correctly show `[0 0]' (zero errors and warnings) instead
of `[0 0 0 0]' (zero errors, zero foo-errors, zero warnings,
zero foo-warnings).
* lisp/progmodes/flymake.el
(flymake--mode-line-format): Coalesce diagnostic types based on
the severity, not the symbol.
Alex Branham [Mon, 12 Feb 2018 19:28:20 +0000 (13:28 -0600)]
Silence byte compiler warning in auth-source-pass
* lisp/auth-source-pass.el (auth-source-pass-backend): Silence byte
compiler warning by only passing a parameter to `auth-source-backend'
in Emacs <= 25.
Jelle Licht [Mon, 8 Jan 2018 16:34:38 +0000 (17:34 +0100)]
Fix auth-source-pass.el to properly handle special inputs
* lisp/auth-source-pass.el (auth-source-pass-search): Warn when
passing multiple hosts in SPEC. Early return and warn when passing a
wildcard as host in SPEC. Early return when host is nil.
* test/lisp/auth-source-pass-tests.el (auth-source-pass-any-host,
auth-source-pass-undefined-host): Add corresponding tests.
Damien Cassou [Thu, 9 Nov 2017 09:40:19 +0000 (10:40 +0100)]
auth-source-pass: Take care of matching hosts when port is provided
* lisp/auth-source-pass.el (auth-source-pass--find-match): Add PORT
parameter and reorganize code by extracting `find-match-unambiguous'.
(auth-source-pass--find-match-unambiguous): New function.
(auth-source-pass--build-result): Fix the call to `find-match'.
(auth-source-pass--hostname, auth-source-pass--hostname-with-user,
auth-source-pass--user): Remove functions.
* test/lisp/auth-source-pass-tests.el: Fix the calls to `find-match'.
(auth-source-pass-find-host-without-port) Add corresponding test.