Eli Zaretskii [Tue, 19 Nov 2019 15:48:55 +0000 (17:48 +0200)]
Fix updating members of zip archives
* lisp/arc-mode.el (archive-zip-case-fiddle): Change the
default to nil except on MS-DOS. Update the doc string to
make clear that a non-nil value also affects updating the
archive. (Bug#38260)
Robert Pluim [Mon, 18 Nov 2019 09:57:55 +0000 (10:57 +0100)]
Don't error when comparing IPv4 and IPv6 addresses
* lisp/net/nsm.el (nsm-network-same-subnet): Compare lengths of
local-ip and ip; different lengths can never match.
(nsm-should-check): Chop port off end of address.
* lisp/image.el (image-type): Allow passing in the image type.
(create-image): Make conversion work with data in addition to files.
* lisp/image/image-converter.el (image-convert-p): Allow taking
working on data in addition to files (bug#38036).
(image-convert): Ditto.
(image-converter--convert): Extend signature to say whether we're
getting a file or data.
(image-converter--convert-magick): Convert data.
(image-converter--convert): Ditto.
Juri Linkov [Mon, 18 Nov 2019 21:53:11 +0000 (23:53 +0200)]
* lisp/vc/ediff-util.el: Set this-command to ediff-quit (bug#38219)
* lisp/vc/ediff-util.el (ediff-toggle-read-only, ediff-quit):
Set this-command to the same command after using y-or-n-p
that doesn't guarantee to keep this-command unchanged
to check it later for some contrived logic.
* lisp/emacs-lisp/cl-extra.el (cl-prettyexpand): This function has
apparently not worked for at least a couple of decades
(bug#38206) unless supplied with a FULL parameter. Make the FULL
parameter obsolete and make the function always work as it did
with a non-nil FULL.
Phil Sainty [Sat, 16 Nov 2019 02:48:44 +0000 (15:48 +1300)]
lisp/so-long.el: Refactor menu action commands
* lisp/so-long.el (so-long-menu): Call `so-long' with an ACTION
argument instead of using `so-long-menu-item-replace-action'.
(so-long-menu-item-replace-action): Remove the deprecated function.
* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-so-long-menu-item-replace-action): Update the test.
Phil Sainty [Sat, 16 Nov 2019 13:11:20 +0000 (02:11 +1300)]
* lisp/so-long.el (so-long): Firstly revert the existing action, if any
This makes `so-long' consistent with the action commands in the menu.
If multiple actions were to be layered on top of one another, we would
lose the ability to revert to the normal state. Custom actions
combining multiple other actions can be defined if necessary.
Stefan Monnier [Sat, 16 Nov 2019 01:39:00 +0000 (14:39 +1300)]
lisp/so-long.el: Use (interactive "@") for menu commands
* lisp/so-long.el (so-long-menu, so-long-menu-item-replace-action)
(so-long-revert): Use interactive code "@", replacing all uses of
`so-long-menu-click-window'. This approach leaves the window selected
afterwards, whereas the old code did not; but that is not a problem.
(so-long-menu-click-window, so-long-menu-item-revert): Remove the
deprecated functions.
* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-so-long-menu-item-replace-action): Update the test.
Co-authored-by: Phil Sainty <psainty@orcon.net.nz>
* configure.ac (HAVE_HARFBUZZ): Remove the check for explicit
harfbuzz -- have_harfbuzz defaults to "yes", so we have no way of
checking whether the user really asked for it, apparently.
(do-after-load-evaluation): Replace run-with-timer with run-with-idle-timer
to give a chance for the minibuffer to handle initial events before sit-for.
https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00581.html
* src/xftfont.c (xftfont_open): FC_CHARCELL is apparently an alias
for FC_DUAL used in some east Asian fonts (bug#35079). Modelled
after a patch suggested by Kenichi Handa.
Eli Zaretskii [Sun, 17 Nov 2019 16:19:18 +0000 (18:19 +0200)]
Support more font weight values on MS-Windows
* src/w32font.c (w32_to_fc_weight): Support a few more weight
values, for compatibility with the GTK font selection widget
(see gtkutil.c:XG_WEIGHT_TO_SYMBOL). (Bug#24226)
Alan Mackenzie [Sun, 17 Nov 2019 14:59:42 +0000 (14:59 +0000)]
Compilation Mode: Fix arrow handling when compilation-context-lines is t
In particular, fix some exception occurrences, fix handling of a Compilation
Mode buffer being displayed in several windows, and fix the margin when
temporarily displaying a different buffer in a window, then returning to the
compilation mode buffer. The fix is relevant for frames without fringes,
e.g. tty frames.
* lisp/progmodes/compile.el: (compilation-set-window): Always set point to
(parameter) MK.
(compilation--set-up-margin, compilation--tear-down-margin): New functions.
(compilation--set-up-arrow-spec-in-margins)
(compilation--tear-down-arrow-spec-in-margins): Renamed by introducing -- and
pluralising margin to margins. Handle the margins in _all_ windows displaying
the pertinent buffer by using get-buffer-window-list. In ...--set-up-... add
compilation--set-up-margin to window-buffer-change-functions. In
...--tear-down-... remove the hook functions added in ...--set-up-....
* lisp/textmodes/table.el (table--put-cell-face-property)
(table--remove-cell-properties): Ensure that we don't lose the
table face when switching from buffers with font locking to ones
without (or vice versa) (bug#35481).
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-insert-button):
* lisp/gnus/gnus-art.el (gnus-insert-mime-button)
(gnus-mime-display-alternative, gnus-insert-prev-page-button)
(gnus-insert-next-page-button)
(gnus-insert-mime-security-button): Make button-1 work on all the
Gnus buttons (bug#38144).
João Távora [Fri, 15 Nov 2019 20:27:18 +0000 (20:27 +0000)]
Make icomplete-tidy-shadowed-file-names less aggressive
When using this option and editing input, some transient situations
may arise that lead to file-name shadowing, but that shouldn't
necessarily lead to auto-delete behaviour, which will be suprising.
In '/foo/x/bar', if the user deletes the 'x', shadowing occurs, but
probably shouldn't. So, somewhat like ido-mode, only auto-tidy
shadowed file names if the user is inserting text at end of input.
Robert Pluim [Fri, 15 Nov 2019 10:23:20 +0000 (11:23 +0100)]
Used magic-fallback-mode-alist to detect .doc files (Bug#20891)
This avoids running doc-view-mode on files that are actually text
files.
* lisp/files.el (auto-mode-alist): Don't use doc-view-mode-maybe
for .doc (but continue to do so for .docx).
(magic-fallback-mode-alist): Add signature for .doc files.
Paul Eggert [Fri, 15 Nov 2019 09:28:33 +0000 (01:28 -0800)]
Port hexdigit init to non-GCC + pdumper
The old code assumed that hexdigit initialization (needed by
non-GCC) could be done in syms_of_character, but that is no longer
true with pdumper. Instead, simplify hexdigit init so that it can
be done statically on all C99 platforms. Problem discovered on
Solaris 10 sparc + Oracle Solaris Studio 12.6.
* src/character.c (hexdigit): Add 1 to every value; all uses
changed. This simplifies the initialization so that it can be
done statically on any C99 compiler. hexdigit is now always const.
(syms_of_character): Omit no-longer-necessary initialization.
* src/character.h (HEXDIGIT_CONST, HEXDIGIT_IS_CONST):
Remove. All uses removed.
Martin Rudalics [Fri, 15 Nov 2019 08:43:02 +0000 (09:43 +0100)]
In 'dframe-frame-mode' avoid 'switch-to-buffer' (Bug#37840)
* lisp/dframe.el (dframe-frame-mode): Use 'set-window-buffer'
instead of 'switch-to-buffer’ to avoid that
'switch-to-buffer-obey-display-actions' butts in (Bug#37840).
Eli Zaretskii [Fri, 15 Nov 2019 07:54:43 +0000 (09:54 +0200)]
Fix a recent change in xdisp.c
* src/xdisp.c (tty_handle_tab_bar_click): Revert the last
change which made this work only in the HAVE_NTGUI build.
This function is needed by any build which supports a mouse
on TTY frames.
Stefan Monnier [Thu, 14 Nov 2019 23:55:18 +0000 (18:55 -0500)]
* lisp/cedet/semantic/db.el: Use lexical-binding
Also prefer setf over oset.
(semanticdb-abstract-table-list): Always define.
(semanticdb--inhibit-make-directory): Fix name of declaration to match
name of variable actually used.
(semanticdb-with-match-any-mode): Use `declare`. Add Edebug spec.
(semanticdb-project-roots): Remove redundant :group.
Paul Eggert [Thu, 14 Nov 2019 22:42:39 +0000 (14:42 -0800)]
Fix byte-counting error in ‘format’
Problem reported by Paul Pogonyshev (Bug#38191).
* src/editfns.c (styled_format): When checking for adjacent
%-sequences, use byte position rather than character position.
* test/src/editfns-tests.el (format-properties): Test for fix.
Dmitry Gutov [Thu, 14 Nov 2019 21:41:07 +0000 (23:41 +0200)]
(repos-count-screen-lines): Narrow without changing point-min
* lisp/reposition.el (repos-count-screen-lines): Narrow without
changing point-min. It wasn't necessary for vertical-motion to
work, and it had some adverse effects on how font-lock rules were
applied
(https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00522.html).
This can also be an alternative fix for bug#38049.
Alan Mackenzie [Thu, 14 Nov 2019 19:51:01 +0000 (19:51 +0000)]
CC Mode: Fix two bugs in the "state cache".
This (along with a suggestion to the OP to set
open-paren-in-column-0-is-defun-start to nil) fixes bug #37910. It may also
have fixed bug #5490 and bug #18072.
* lisp/progmodes/cc-engine.el (c-state-cache-non-literal-place): Remove thi
non-sensical function, replacing it with ....
(c-state-cache-lower-good-pos): New function.
(c-renarrow-state-cache, c-append-lower-brace-pair-to-state-cache)
(c-remove-stale-state-cache, c-remove-stale-state-cache-backwards): Instead of
altering the state-cache list structure with setcar and setcdr, use setq and
consing.
(c-parse-state-1): Call c-state-cache-lower-good-pos rather than
c-state-cache-non-literal-place.
Phil Sainty [Mon, 21 Oct 2019 11:05:50 +0000 (00:05 +1300)]
Support loading so-long.el on top of an earlier version
* so-long.el (so-long-version, so-long--latest-version): New variables.
This enables users to safely load version 1.0 of so-long.el on top of
an earlier version, as well as making provisions for doing likewise
following any incompatible changes arising in future versions.
Phil Sainty [Mon, 21 Oct 2019 11:01:59 +0000 (00:01 +1300)]
Backwards-compatibility function definitions for so-long.el
* so-long.el (so-long-inhibit-whitespace-mode)
(so-long-make-buffer-read-only, so-long-revert-buffer-read-only)
(so-long-inhibit-global-hl-line-mode): Restore dummy definitions of
now-obsolete hook functions used by earlier versions of so-long.el,
to support users who have saved these symbols in their customized
values for the hooks in question.
Phil Sainty [Mon, 21 Oct 2019 10:52:29 +0000 (23:52 +1300)]
Defer triggering `so-long' until the buffer is displayed
* lisp/so-long.el (so-long-invisible-buffer-function): New user option.
(so-long--set-auto-mode): Use so-long-invisible-buffer-function.
(so-long-deferred): New function/value for so-long-invisible-buffer-function.
(so-long, so-long--disable): Support for so-long-deferred.
* test/lisp/so-long-tests/autoload-longlines-mode-tests.el
* test/lisp/so-long-tests/autoload-major-mode-tests.el
* test/lisp/so-long-tests/autoload-minor-mode-tests.el
* test/lisp/so-long-tests/so-long-tests.el:
Support for so-long-deferred.
Pre-existing tests have been updated to ensure the buffer is already
displayed in cases where a call to `normal-mode' is the (potential)
trigger for `so-long'.
Phil Sainty [Mon, 21 Oct 2019 12:01:28 +0000 (01:01 +1300)]
; Documentation and spelling
* lisp/so-long.el: Documentation fixes. For the purposes of
consistency, this reverts some of the changes made in commit 41ba8231ef072571e1a6feabc15d113e5cf57556, including one which
had introduced inconsistent spelling.
ispell configuration and LocalWords have been added such that
`ispell-buffer' should find no misspellings for this library.
* test/lisp/so-long-tests/spelling-tests.el (so-long-spelling):
New test to check the spelling using `ispell-buffer'.
Eli Zaretskii [Thu, 14 Nov 2019 10:25:10 +0000 (12:25 +0200)]
Fix recent documentation changes
* doc/lispref/minibuf.texi (Multiple Queries): Move the
reference to 'read-char-from-minibuffer' from here...
* doc/lispref/commands.texi (Reading One Event): ...to here.
Fix the wording of the description of
'read-char-from-minibuffer'.
Robert Pluim [Wed, 13 Nov 2019 14:19:04 +0000 (15:19 +0100)]
Make GTK font chooser respect face-ignored-fonts
* src/font.c (font_delete_unmatched): Move Vface_ignored_fonts
matching to...
(font_is_ignored): ..Here. New function.
* src/gtkutil.c (xg_font_filter): New function, uses font_is_ignored
to filter fonts.
(xg_get_font): Set GTK font chooser filter to xg_font_filter.
* src/gtkutil.h: Add prototype for font_is_ignored.
* lisp/mail/rfc2047.el
(rfc2047-quote-special-characters-in-quoted-strings): Remove function.
(rfc2047-encode-message-header, rfc2047-encode-region): Don't use it.
* lisp/vc/vc.el (vc-default-update-on-retrieve-tag): New function.
(vc-retrieve-tag): Call `update-on-retrieve-tag' backend function
to determine if prompt for update buffers is needed; Include tag
name into the "Retrieving tag" message.
* lisp/vc/vc-git.el (vc-git-update-on-retrieve-tag):
* lisp/vc/vc-hg.el (vc-hg-update-on-retrieve-tag):
* lisp/vc/vc-svn.el (vc-svn-udate-on-retrieve-tag): New functions.
Buffers update prompt on `vc-retrieve-tag' is omitted (bug#38156).
Allow using edebug-remove-instrumentation more fine-grained
* lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation):
Prompt the user for what functions to remove instrumentation from
a la cancel-edebug-on-entry (bug#38195).
Stephen Gildea [Thu, 14 Nov 2019 04:21:42 +0000 (20:21 -0800)]
time-stamp: update support for time zone numeric offset
* time-stamp.el (time-stamp-string-preprocess): Change new format for
numeric time zone from %:z to %5z to match format-time-string better.
(time-stamp-format): Document support for numeric time zone.
See discussion in bug#32931.
Paul Eggert [Wed, 13 Nov 2019 21:07:01 +0000 (13:07 -0800)]
Fix double-rounding bug in ceiling etc.
This is doable now that we have bignums.
* src/floatfns.c (integer_value): Remove; no longer used.
(rescale_for_division): New function.
(rounding_driver): Use it to divide properly (by using bignums)
even when arguments are float, fixing a double-rounding FIXME.
* src/lisp.h (LOG2_FLT_RADIX): Move here ...
* src/timefns.c (frac_to_double): ... from here.
* test/src/floatfns-tests.el (big-round):
Add a test to catch the double-rounding bug.
Paul Eggert [Wed, 13 Nov 2019 20:10:31 +0000 (12:10 -0800)]
Refactor bignum multiplication, exponentiation
This doesn’t alter behavior, and simplifies the next commit.
* src/bignum.c (GMP_NLIMBS_MAX, NLIMBS_LIMIT, emacs_mpz_size)
(emacs_mpz_mul, emacs_mpz_mul_2exp, emacs_mpz_pow_ui): Move here ...
* src/data.c: ... from here.
Paul Eggert [Sun, 10 Nov 2019 23:06:49 +0000 (15:06 -0800)]
Refactor double integer scaling
This doesn’t alter behavior, and simplifies a future commit.
* src/floatfns.c (double_integer_scale): New function,
with body adapted from the old timefns.c.
* src/timefns.c (decode_float_time): Use it.