Eli Zaretskii [Tue, 28 May 2019 16:58:27 +0000 (19:58 +0300)]
Fix handling of -xrm on MS-Windows broken by recent commits
* src/w32reg.c (w32_get_string_resource): The argument V_RDB
is a 'char **', not a 'char *'. This fixes -xrm handling on
MS-Windows, broken by conversion of x_get_string_resource to
terminal-specific hook.
Stefan Monnier [Tue, 28 May 2019 13:05:25 +0000 (09:05 -0400)]
* lisp/frameset.el: Stop using obsolete registerv objects
(frameset-register): New type.
(register-val-jump-to): Define on this new type, replacing
frameset--jump-to-register.
(register-val-describe): Define on this new type, replacing
frameset--print-register.
(frameset-to-register): Use new frameset-make-register.
(frameset--reuse-frame): η-reduce.
Stefan Kangas [Sun, 26 May 2019 16:08:01 +0000 (18:08 +0200)]
Cleanup of TODO to prefer report-emacs-bug
* etc/TODO: Remove already completed removal of `report-calc-bug'.
* lisp/calc/calc.el: Remove any mention of `report-calc-bug'.
* lisp/epg-config.el: Redefine `epg-bug-report-address' as obsolete
variable alias for `report-emacs-bug-address'.
* lisp/expand.el: Remove any mention of `expand-submit-report'.
* lisp/obsolete/fast-lock.el: Remove commented out code for
`fast-lock-submit-bug-report'.
Support tool bar icon image also on GTK+2 with cairo
* src/gtkutil.c (xg_get_pixbuf_from_surface) [USE_CAIRO && !HAVE_GTK3]: New
function.
(xg_get_image_for_pixmap) [USE_CAIRO && !HAVE_GTK3]: Use it.
(xg_tool_item_stale_p, update_frame_tool_bar) [USE_CAIRO && !HAVE_GTK3]: Use
cairo code also on GTK+2.
Simen Heggestøyl [Mon, 27 May 2019 19:12:53 +0000 (21:12 +0200)]
Remap `complete-symbol' in CSS mode
* lisp/textmodes/css-mode.el (css-mode-map): Remap `complete-symbol'
to `completion-at-point'.
(css-mode): Update docstring to produce the right key binding.
Noam Postavsky [Mon, 27 May 2019 01:55:00 +0000 (21:55 -0400)]
; Fix read-multiple-choice test
* test/lisp/emacs-lisp/rmc-tests.el (test-read-multiple-choice):
Rebind read-event, read-multiple-choice uses that since 2019-05-26
"Avoid infloop in read-multiple-choice (Bug#32257)".
Noam Postavsky [Wed, 22 May 2019 00:38:00 +0000 (20:38 -0400)]
Avoid infloop in read-multiple-choice (Bug#32257)
* lisp/emacs-lisp/rmc.el (read-multiple-choice): Use `read-event'
which won't get stuck (return the same event over and over again) for
non-character events, unlike `read-char'.
* test/lisp/tabify-tests.el (tabify-tests--test-changes): Rename
third argument to avoid "lexical argument shadows dynamic variable"
warnings. Use mapconcat in place of mapcar+concat.
(tabify-tests-untabify, tabify-tests-tabify): Quote function symbols
as such.
Paul Eggert [Sun, 26 May 2019 07:58:27 +0000 (00:58 -0700)]
Remove Maintainer: when it duplicates Author:
The convention is that a file with Author: but not Maintainer:
means the author is a maintainer, which makes it confusing
when a file lists the same person as author and maintainer.
Avoid the confusion by removing the duplicate Maintainer: line.
Paul Eggert [Sat, 25 May 2019 20:43:06 +0000 (13:43 -0700)]
Go back to "Maintainer: emacs-devel@gnu.org"
Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is
no special maintainer for a file. Although this wasn't documented
it was common practice and removing the lines didn't have consensus.
Dmitry Gutov [Fri, 24 May 2019 21:11:41 +0000 (00:11 +0300)]
Support reverting in xref-find-definitions results as well
* lisp/progmodes/xref.el (xref--show-xref-buffer): Expect the
first argument to always be a function (bug#35702). Handle a
FETCHED-XREFS entry in ALIST.
(xref--show-defs-buffer): Update accordingly.
(xref--create-fetcher): Extract from xref--find-xrefs.
(xref--find-definitions): Use it.
Michael Albinus [Fri, 24 May 2019 13:36:02 +0000 (15:36 +0200)]
Fix Bug#35769
* lisp/net/tramp-adb.el (tramp-adb-connection-local-default-profile):
* lisp/net/tramp-integration.el (tramp-connection-local-default-profile):
Do not set it on w32 systems. (Bug#35769)
Dmitry Gutov [Fri, 24 May 2019 01:50:44 +0000 (04:50 +0300)]
Support "reverting" Xref buffers (bug#35702)
* lisp/progmodes/xref.el (xref--fetcher): New variable.
(xref--xref-buffer-mode-map): Add binding for 'g'.
(xref--revert-xref-buffer): New command.
(xref--show-xref-buffer): Accept a function as the first argument.
(xref--show-xrefs): Same.
(xref--find-xrefs): Pass the above a fetcher function.
Make Cairo build obey hint-style font setting (Bug#35781)
* src/ftfont.h (ftfont_open2): Remove extern.
(ftfont_fix_match, ftfont_add_rendering_parameters)
(ftfont_entity_pattern): Add externs.
(struct font_info): Remove member bitmap_strike_index.
(struct font_info) [USE_CAIRO]: Remove member ft_size_draw. All uses removed.
Add member bitmap_position_unit.
* src/xftfont.c (xftfont_fix_match, xftfont_add_rendering_parameters): Move
functions from here ...
* src/ftfont.c (ftfont_fix_match, ftfont_add_rendering_parameters): ... to
here. All uses changed.
* src/xftfont.c (xftfont_open): Extract FcPattern creation from font entity
from here ...
* src/ftfont.c (ftfont_entity_pattern): ... to here.
* src/xftfont.c (syms_of_xftfont): Move DEFSYMs for Fontconfig's rendering
parameters from here ...
* src/ftfont.c (syms_of_ftfont): ... to here.
* src/ftfont.c (ftfont_open, ftfont_open2): Undo introduction of
bitmap_strike_index. Merge functions into ftfont_open.
* src/ftcrfont.c (ftcrfont_open): Align code with xftfont_open rather than
ftfont_open.
(ftcrfont_close): Likewise.
(ftcrfont_has_char, ftcrfont_encode_char):
(ftcrfont_otf_capability) [HAVE_LIBOTF]:
(ftcrfont_variation_glyphs) [HAVE_OTF_GET_VARIATION_GLYPHS]: New functions.
(ftcrfont_driver): Register them.
(ftcrfont_get_bitmap, ftcrfont_anchor_point):
(ftcrfont_shape) [HAVE_M17N_FLT && HAVE_LIBOTF]: Use bitmap_position_unit
instead of bitmap_strike_index to screen bitmap fonts.
(ftcrfont_get_bitmap, ftcrfont_anchor_point):
(ftcrfont_otf_capability) [HAVE_LIBOTF]:
(ftcrfont_shape) [HAVE_M17N_FLT && HAVE_LIBOTF]:
(ftcrfont_variation_glyphs) [HAVE_OTF_GET_VARIATION_GLYPHS]: Temporarily
assign ftcrfont_info->ft_size and call corresponding ftfont functions.
(ftcrfont_draw): Don't flush cairo surface when exporting.
For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00500.html
* lisp/url/url-handlers.el: Update autoloaded docstrings.
Quote function symbols as such.
(url-handler-regexp): Make grouping construct shy.
(url-file-handler, url-insert-buffer-contents)
(url-handlers-create-wrapper, url-handlers-set-buffer-mode):
Simplify.
(url-file-handler-identity): Clarify calling convention.
(file-name-absolute-p, url-file-local-copy): Mark ignored arguments
as such.
(url-handler-directory-file-name): Prefer string comparison over
regexp match where either will do.
(url-copy-file): Handle integer as third argument as per copy-file.
Stefan Monnier [Wed, 22 May 2019 22:36:37 +0000 (18:36 -0400)]
* lisp/textmodes/sgml-mode.el: Fix lone `>` in sgml text
(sgml--syntax-propertize-ppss):New variable and function.
(sgml-syntax-propertize-rules): Use it.
Don't ignore quotes not followed by a matching quote or a '>' or '<'.
(sgml-syntax-propertize): Set up sgml--syntax-propertize-ppss.
* test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax):
Add test for lone '>'.
Dmitry Gutov [Wed, 22 May 2019 22:30:50 +0000 (01:30 +0300)]
Make xref-find-definitions more customizable
* lisp/progmodes/xref.el (xref--show-defs-buffer): New function.
Move a bit of logic from xref--show-defs to make it more
customizable.
(xref--push-markers): New function, extracted from
xref--show-xrefs.
(xref-show-definitions-function): Set to the new function.
Dmitry Gutov [Wed, 22 May 2019 22:16:41 +0000 (01:16 +0300)]
Separate xref-find-definitions' behavior from other commands
* lisp/progmodes/xref.el (xref-show-definitions-function):
New variable.
(xref--show-defs): Split off from xref--show-xrefs.
(xref--find-definitions): Use it.
(xref--not-found-error): New function.
(xref--show-xrefs): Simplify. Show the list buffer even when
there is just one item in the list. Remove the last argument.
Paul Eggert [Wed, 22 May 2019 20:25:47 +0000 (13:25 -0700)]
Remove fixnum restriction on some display vars
This is a minor patch to remove some fixnum restrictions.
Many more such patches are needed, but one thing at a time.
* doc/emacs/custom.texi (Examining): Update fill-column example.
* src/buffer.c (fill-column, left-margin, tab-width)
(buffer-saved-size, left-margin-width, right-margin-width)
(left-fringe-width, right-fringe-width, scroll-bar-width)
(scroll-bar-height, buffer-display-count):
Allow any integer; do not restrict to fixnums.
* src/character.h (SANE_TAB_WIDTH): Do not assume tab_width
is a nonnegative fixnum.
(sanitize_tab_width): Take a Lisp_Object integer, not an
EMACS_INT. Only use changed.
* src/data.c (store_symval_forwarding): Remove unnecessary
SYMBOLP since the predicate (e.g., Qintegerp) is always a
symbol (leave the test in as an eassert). Avoid assignments
inside if-conditions.
* src/fileio.c (Fdo_auto_save): Do not assume
buffer-saved-size is a fixnum. Avoid undefined behavior
on EMACS_INT overflow by multiplying a fixnum by at most 4,
not by at most 13.
* src/window.c (set_window_buffer): When buffer-display-count
is too large for a fixnum, make it a bignum.
* src/xdisp.c (FILL_COLUMN_INDICATOR_NEEDED): Remove macro, ...
(fill_column_indicator_column): ... replacing with this new function.
All uses changed. The function is a bit pickier, to prevent
problems with non-character fixnums and columns out of range
for int, and to remove the assumption that integers are in
fixnum range.
(append_space_for_newline, extend_face_to_end_of_line):
Avoid undefined behavior with signed integer overflow.
Simplify.
Paul Eggert [Tue, 21 May 2019 15:51:48 +0000 (08:51 -0700)]
Pacify libpng on interlaced images (Bug#35843)
* src/image.c (png_set_interlace_handling) [WINDOWSNT]:
New function to link.
(init_png_functions): Link it.
(png_load_body): Call it before calling png_read_update_info.
Paul Eggert [Tue, 21 May 2019 15:13:04 +0000 (08:13 -0700)]
Remove time-date debugging scaffolding
Problem reported by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2019-05/msg00721.html
* lisp/calendar/time-date.el (date-to-time):
Use plain condition-case, not condition-case-unless-debug.
Federico Tedin [Tue, 14 May 2019 12:16:00 +0000 (09:16 -0300)]
Use lexical-binding in tempo.el and add tests
For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00395.html
* lisp/tempo.el: Use lexical-binding.
(tempo-define-template): Expand documentation to mention
`tempo-user-elements'.
(tempo-local-tags, tempo-collection, tempo-dirty-collection)
(tempo-marks, tempo-match-finder): Define with defvar-local.
(tempo-named-insertions, tempo-region-start, tempo-region-stop): Make
them automatically buffer-local.
* test/lisp/tempo-tests.el: Add tests for tempo.el.
Alan Mackenzie [Tue, 21 May 2019 11:47:14 +0000 (11:47 +0000)]
C Mode: Fix indentation of DEFUN's function's argument list.
Formally, when DEFUNs still used knr argument lists, these were indented by
the syntactic context knr-argdecl-intro (5 columns). Since this is no longer
the case, we now just use c-basic-offset (2 columns in "gnu" style).
* lisp/progmodes/cc-align.el (c-indent-gnu-DEFUN-intro-cont): Modernize the
indentation. Amend the doc string accordingly.
Noam Postavsky [Thu, 16 May 2019 00:29:38 +0000 (20:29 -0400)]
Add option to disable help completion autoloading (Bug#28607)
* lisp/help-fns.el (help-enable-completion-auto-load): New option.
(help--symbol-completion-table): Consult it.
* doc/emacs/building.texi (Lisp Libraries): Document it.
* etc/NEWS: Announce it.
* doc/lispref/loading.texi (Autoload by Prefix): New section.
(Autoload): Reference it.
Make the rx `or' and `seq' forms accept zero arguments to produce a
never-matching regexp and an empty string, respectively.
* lisp/emacs-lisp/rx.el: Require cl-extra.
(rx-constituents, rx-or): Permit zero args.
(rx): Amend doc string for `or' and `seq'.
* test/lisp/emacs-lisp/rx-tests.el (rx-or, rx-seq): Test the change.
* etc/NEWS (Changes in Specialized Modes and Packages): Mention the change.
For discussion, see the following threads:
https://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00457.html
https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00369.html
* autogen.sh: Extend the built-in Git xfuncname pattern 'cpp' to
match preprocessor and DEFUN macros, and the 'elisp' pattern to
match cl-lib and other top-level defuns.
Stefan Kangas [Sun, 5 May 2019 13:48:57 +0000 (15:48 +0200)]
Use lexical-binding in delim-col.el and add tests
Thanks to Basil L. Contovounesios for additional cleanups.
For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00177.html
* lisp/delim-col.el: Use lexical-binding.
* test/lisp/delim-col-tests.el: New file.
(delim-col-tests-delimit-colummns-before-after)
(delim-col-tests-delimit-columns)
(delim-col-tests-delimit-columns-format/nil)
(delim-col-tests-delimit-columns-format/padding)
(delim-col-tests-delimit-columns-format/separator)
(delim-col-tests-delimit-columns-separator)
(delim-col-tests-delimit-columns-str-before-after)
(delim-col-tests-delimit-columns-str-separator)
(delim-col-tests-delimit-rectangle): New unit tests.
Alan Mackenzie [Mon, 20 May 2019 12:46:37 +0000 (12:46 +0000)]
CC Mode: Remove unused code from c-maybe-re-mark-raw-string
Acknowledge that when the function is called, it is always at the start of a
string, never in the middle or at the end of one.
* lisp/progmodes/cc-engine.el (c-maybe-re-mark-raw-string): Reformulate the
cond form into a `when' form, with all but the first arm of the cond
discarded.
Make the rx `or' and `seq' forms accept zero arguments to produce a
never-matching regexp and an empty string, respectively.
* lisp/emacs-lisp/rx.el (rx-constituents, rx-or): Permit zero args.
(rx): Amend doc string for `or' and `seq'.
* test/lisp/emacs-lisp/rx-tests.el (rx-or, rx-seq): Test the change.
* etc/NEWS (Changes in Specialized Modes and Packages): Mention the change.
Avoid polling in global-auto-revert-mode (bug#35418)
Make `auto-revert-avoid-polling' have effect in global-auto-revert-mode.
Buffers actually handled by that mode are marked with a non-nil value
of `auto-revert--global-mode'. When global-auto-revert-mode is
entered, eligible buffers are marked in that way, and hooks are set up
to mark new buffers and take care of buffers whose file names change.
This way the existing poll-avoidance logic can be used, since the
entire set of buffers in auto-revert is known.
A new hook, `after-set-visited-file-name-hook', was added to handle
the case when the file name of a tracked buffer changes.
* lisp/autorevert.el (auto-revert-avoid-polling): Amend doc string.
(auto-revert--global-mode): New buffer-local variable.
(global-auto-revert-mode): Mark existing buffers and set up hooks when
mode is entered; do the opposite when exited.
(auto-revert--global-add-current-buffer)
(auto-revert--global-adopt-current-buffer)
(auto-revert--set-visited-file-name-advice): New functions.
(auto-revert--polled-buffers, auto-revert--need-polling-p)
(auto-revert-notify-handler)
(auto-revert-active-p): Modify logic to cover global-auto-revert-mode.
* lisp/files.el (after-set-visited-file-name-hook): New hook.
(set-visited-file-name-hook): Call new hook.
* test/lisp/autorevert-tests.el (top): Use lexical-binding.
(auto-revert-test--write-file, auto-revert-test--buffer-string)
(auto-revert-test--wait-for, auto-revert-test--wait-for-buffer-text)
(auto-revert-test05-global-notify): New test.
* doc/lispref/hooks.texi (Standard Hooks):
Mention new hook (in a comment, since it's unclear whether it should
actually be documented here)
* etc/NEWS (Changes in Specialized Modes and Packages): Update entry.
Michael Albinus [Mon, 20 May 2019 08:14:13 +0000 (10:14 +0200)]
Fix problems in autorevert-tests
* test/lisp/autorevert-tests.el (auto-revert--deftest-remote):
Fix typo.
(auto-revert-test02-auto-revert-deleted-file): On emba, there are
no stopped events.
Introduce Emacs_Pix_Container and Emacs_Pix_Context typedefs
Emacs_Pix_Container is a pointer to a struct representing pixmap data
on the backend. Emacs_Pix_Context is the context for the
bitmap/pixmap on the backend. Only w32 currently makes this
distinction; they are otherwise the same type.
* src/dispextern.h: Remove XImagePtr in favor of
using XImage* directly. Rename XImagePtr_or_DC to Emacs_Pix_Context.
[HAVE_X_WINDOWS] Alias Emacs_Pix_Container and
Emacs_Pix_Context to XImage*.
[HAVE_NS] Alias Emacs_Pix_Container and Emacs_Pix_Context to trivial
Emacs_Pixmap definition.
[HAVE_NTGUI]: Alias Emacs_Pix_Container to XImage* and
Emacs_Pix_Context to HDC.
* src/dispextern.h:
* src/image.c: Use Emacs_Pix_Container over XImagePtr and
Emacs_Pix_Context over XImagePtr_or_DC.
* src/dispextern.h [HAVE_X_WINDOWS]: Alias Emacs_Rectangle to
XRectangle.
[!HAVE_X_WINDOWS]: Define Emacs_Rectangle struct.
Use Emacs_Rectangle over XRectangle.
* src/frame.h (MonitorInfo):
* src/msdos.h:
* src/w32term.c:
* src/xdisp.c: Use Emacs_Rectangle over XRectangle.
* src/nsgui.h:
* src/w32gui.h: Remove old XRectangle structs.
* src/xdisp.c:
* src/nsgui.h:
* src/w32gui.h: Rename CONVERT_FROM_XRECT and CONVERT_TO_XRECT to
CONVERT_FROM_EMACS_RECT and CONVERT_TO_EMACS_RECT respectively.
* src/dispextern.h [HAVE_X_WINDOWS]: Define Emacs_Cursor alias. Move
the No_Cursor definition from xterm.h.
(redisplay_interface): Use Emacs_Cursor over Cursor.
* src/nsgui.h:
* src/nsterm.h:
* src/nsterm.m:
* src/w32gui.h:
* src/w32term.c:
* src/xdisp.c:
* src/xterm.c (x_define_frame_cursor): Use Emacs_Cursor over Cursor.
* lisp/filenotify.el (file-notify-callback):
Comment out condition that does not seem to make any sense. All it
seems to do is allowing notifications for files on the form DIR/X/X
when we really just are watching DIR/X/Y.
Juri Linkov [Sun, 19 May 2019 20:11:27 +0000 (23:11 +0300)]
Publicize behavior of log-view-diff at beginning/end of active region
* lisp/vc/log-view.el (log-view-diff, log-view-diff-changeset):
* doc/emacs/maintaining.texi (VC Change Log): Document behavior of
log-view-diff at the beginning and the end of the log buffer
when the region is active. (Bug#35624)
* lisp/vc/vc-git.el (vc-git-print-log): Insert newline at the
beginning to enable the feature of diffing with the working revision.
Eric Abrahamsen [Sun, 19 May 2019 16:57:50 +0000 (09:57 -0700)]
Fix Gnus group sorting to use gnus-group-list
* lisp/gnus/gnus-group.el (gnus-group-sort-flat): As
gnus-newsrc-hashtb is now a real (unsorted) hash table, use
gnus-group-list to maintain group sort order.
(gnus-group-sort-selected-flat): Ditto.
* lisp/gnus/gnus-start.el (gnus-subscribe-alphabetically): Simplify
function using seq-find.
(gnus-subscribe-killed, gnus-subscribe-zombies): Use cl-pushnew to
avoid adding duplicates (can happen when un/subscribing multiple
times to one group).