Stefan Kangas [Fri, 24 Apr 2020 21:43:57 +0000 (23:43 +0200)]
Support sorting timer-list-mode by column (Bug#40854)
* lisp/emacs-lisp/timer-list.el (timer-list-mode)
(timer-list--idle-predicate, timer-list--next-predicate)
(timer-list--repeat-predicate)
(timer-list--function-predicate): Add support for sorting by column.
Stefan Kangas [Fri, 24 Apr 2020 21:42:37 +0000 (23:42 +0200)]
Base timer-list-mode on tabulated-list-mode (Bug#40854)
* lisp/emacs-lisp/timer-list.el (list-timers)
(timer-list-mode): Inherit from 'tabulated-list-mode' instead of
'special-mode' and make the necessary changes to support that.
Paul Eggert [Tue, 12 May 2020 00:41:16 +0000 (17:41 -0700)]
Pacify GCC 10.1.0
Pacify GCC 10.1.0 so that it does not issue false alarms
when Emacs is configured with --enable-gcc-warnings.
* src/dispnew.c (clear_glyph_row):
* src/fns.c (hash_clear):
* src/keyboard.c (append_tab_bar_item):
* src/lisp.h (vcopy):
* src/xfaces.c (get_lface_attributes_no_remap)
(Finternal_copy_lisp_face, realize_default_face):
* src/xmenu.c (set_frame_menubar):
Work around -Warray-bounds false alarm in GCC 10.1.0.
* src/intervals.c (copy_properties):
Avoid -Wnull-dereference false alarm in GCC 10.1.0.
* src/lisp.h (xvector_contents_addr, xvector_contents):
New functions, useful for working around GCC bug 95072.
Alan Mackenzie [Mon, 11 May 2020 20:05:54 +0000 (20:05 +0000)]
Fix bug #40992 whilst still allowing breakpoint highlights in edebug
Strategy: when an instrumented function gets re-evaluated, save the former
value of its symbol's `edebug' property in the new propery `ghost-edebug'. If
this function is still being edebugged, edebug will then access its info from
this new property.
Also fix the bug whereby compile-defun'ing an instrumented function prevents
the function being re-instrumented by I (edebug-instrument-callee).
* lisp/emacs-lisp/edebug.el (edebug-get-edebug-or-ghost): New function.
(edebug-read-and-maybe-wrap-form1): save value of `edebug' property in
'ghost-edebug'.
(edebug-make-form-wrapper): Set value of `ghost-edebug' to nil.
(edebug-make-form-wrapper, edebug-find-stop-point, edebug-next-break-point)
(edebug-modify-breakpoint, edebug--overlay-breakpoints, edebug-set-breakpoint)
(edebug-unset-breakpoints, edebug-toggle-disable-breakpoint)
(edebug--backtrace-goto-source, edebug-display-freq-count)
(edebug-set-conditional-breakpoint): Use edebug-get-edebug-or-ghost to access
edebug information.
(edebug-instrument-function): Also check a function is a cons before declaring
it "already instrumented".
Dmitry Gutov [Mon, 11 May 2020 01:34:55 +0000 (04:34 +0300)]
Use the "modern" toolbars in Gnus again
* lisp/gnus/gmm-utils.el (gmm-tool-bar-style):
Undo the breakage from commit d88118db37dd
(https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg02094.html).
Stefan Monnier [Sun, 10 May 2020 23:07:45 +0000 (19:07 -0400)]
* lisp/emacs-lisp/pcase.el: Don't bind unused vars in branches
(pcase--fgrep): Change calling convention to take bindings rather than
just variables.
(pcase--funcall, pcase--eval): Adjust to this new calling convention.
(pcase--expand): Use `pcase--fgrep` to bind only the vars that are used.
* lisp/help-mode.el: Use lexical-binding.
(help-mode-map, help-mode-menu, help-mode-setup)
(help-mode-finish): Make spelling of "Help mode" consistent throughout
the doc strings (also making it consistent with the spelling of "Help
mode" used in the Elisp manual).
(help-do-xref): Re-indent to make the else-branch easier to see.
* test/lisp/help-mode-tests.el: New file with tests for help-mode.el.
Glenn Morris [Sat, 9 May 2020 17:03:21 +0000 (10:03 -0700)]
Merge from origin/emacs-27
be0d1cac83 (origin/emacs-27) Small fix for type of 'display-fill-colu... c5e5839776 Fix customization of 'display-fill-column-indicator-charac... d5c184aa3e Refer to fill column indicator Info node in some places. e13300ae50 Merge branch 'emacs-27' of git.sv.gnu.org:/srv/git/emacs i... 0bae57033f Fix GTK's Tool Bar menu radio buttons 4c98aa7ea5 Minor clarifications in NEWS a1cbd05f38 Improve documentation of 'with-suppressed-warnings'. 4a895c1b26 Fix a typo in a comment 2caf3e997e Improve documentation of Hi Lock mode 7081c1d66f Fix typos in the Emacs user manual 0385771e2f Fix references to Speedbar in VHDL mode a76cafea0d Fix handling of FROM = t and TO = t by 'window-text-pixel-...
Add new filter command to Package Menu (Bug#39903)
* lisp/emacs-lisp/package.el
(package-menu-filter-marked): New filter command.
* test/lisp/emacs-lisp/package-tests.el
(package-test-list-filter-marked): New test.
(package-menu-mode-menu):
(package-menu-mode-map): Update menu to include new filter command.
* doc/emacs/package.texi (Package Menu): Document the new command.
* etc/NEWS: Announce the new command.
* lisp/progmodes/cc-mode (c-or-c++-mode--regexp): Expand the regexp to
match some more C++-only constructs and recognise a few more standard
C++ header files. Also make sure identifiers start with non-digit.
(c-or-c++-mode): Add ‘(interactive)’ declaration.
* test/lisp/progmodes/cc-mode-tests.el (c-or-c++-mode): Add test case
for the newly recognised constructs.
Introduce ‘c-lineup-ternary-bodies’ function which, when used as
a c lineup function, aligns question mark and colon of a ternary
operator. For example:
return arg % 2 == 0 ? arg / 2
: (3 * arg + 1);
* lisp/progmodes/cc-align.el (c-lineup-ternary-bodies): New function.
* doc/misc/cc-mode.texi (Operator Line-Up Functions): Document the
new function.
* test/lisp/progmodes/cc-mode-tests.el (c-lineup-ternary-bodies): New
test case.
Martin Rudalics [Sat, 9 May 2020 07:38:27 +0000 (09:38 +0200)]
Fix GTK's Tool Bar menu radio buttons
* lisp/menu-bar.el (menu-bar-showhide-tool-bar-menu): Fix typo
that makes the radio buttons pretend that the tool bar is always
shown on the left side of the frame.
Federico Tedin [Sun, 3 May 2020 13:47:56 +0000 (15:47 +0200)]
Prevent hanging in next-single-char-property-change
* src/textprop.c (Fnext_single_char_property_change): Clarify in
the doc string the behavior when LIMIT is past the end of OBJECT.
Stop the search when position gets to end of buffer, for when LIMIT
is beyond that. (Bug#40000)
Improve documentation of 'with-suppressed-warnings'.
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): Refer to
'byte-compile-warnings' instead of 'byte-compile-warning-types', as
only the former variable documents the available warning types.
Tassilo Horn [Fri, 8 May 2020 18:57:19 +0000 (20:57 +0200)]
Allow predicates for matching in browse-url-handlers.
* lisp/net/browse-url.el (browse-url-handlers): Allow predicates for
matching in browse-url-handlers. Adapt docs and customize type.
(browse-url-select-handler): Support predicates in addition to
regexes.
(browse-url--non-html-file-url-p): New defun.
(browse-url-default-handlers): Use above predicate entry instead of
two entries.
Eli Zaretskii [Fri, 8 May 2020 14:25:45 +0000 (17:25 +0300)]
Improve documentation of Hi Lock mode
* lisp/hi-lock.el (hi-lock-mode, hi-lock-face-buffer)
(hi-lock-face-phrase-buffer, hi-lock-face-symbol-at-point):
Clarify when 'hi-lock-mode' will use Font Lock and when it will
use overlays. (Bug#41124)
Eli Zaretskii [Fri, 8 May 2020 11:21:35 +0000 (14:21 +0300)]
Fix typos in the Emacs user manual
* doc/emacs/calendar.texi (Holidays): Fix usage of non-ASCII
accents.
* doc/emacs/custom.texi (Init Rebinding): Fix a cross-reference.
* doc/emacs/dired.texi (Operating on Files): Make the
cross-reference to "VC Delete/Rename" be to a different manual in
the printed version. (Bug#41100)
Don't increment array index in cl-loop twice (Bug#40727)
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): Put the temp-idx
increment in cl--loop-body, leaving just the side-effect free testing
of the index for both cl--loop-body and cl--loop-conditions.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-and-arrays):
Extend test to cover this case.
Revert "cl-loop: Calculate the array length just once"
It fails when using 'and' (parallel bindings) for arrays (Bug#40727).
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): Revert to
recomputing array length.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-and-arrays): New
test.
* lisp/dnd.el (dnd-handle-one-url): Don't require browse-url twice
in the same function. Declare non-autoloaded browse-url-handlers to
silence byte-compiler.
Tassilo Horn [Wed, 6 May 2020 20:23:03 +0000 (22:23 +0200)]
Restore HTML rendering behavior of browse-url-of-buffer/file.
* lisp/net/browse-url.el (browse-url-default-handlers): Add a browser
handler for HTML page file:// URLs before the generic file:// handler.
(browse-url--browser): New defun.
Glenn Morris [Wed, 6 May 2020 16:28:36 +0000 (09:28 -0700)]
; Merge from origin/emacs-27
The following commits were skipped:
1e09364d67 ; Mark Bug#29799 tests as failing since we reverted the fix de1b33f5a8 Revert "cl-loop: Calculate the array length just once" caf155c463 Revert "cl-loop: Add missing guard condition" 79e133da03 Revert "Refix conditional step clauses in cl-loop"
Tassilo Horn [Wed, 6 May 2020 14:48:57 +0000 (16:48 +0200)]
Consult browse-url-{default-,}handlers in drag&drop.
* lisp/dnd.el (dnd-handle-one-url): Consult `browse-url-handlers' and
`browse-url-default-handlers' for a matching handler. Adapt
docstring.
* doc/lispref/frames.texi (Drag and Drop): Remove the docs for the
deprecated alist choice of `browse-url-browser-function' and mention
`browse-url-handlers' and `browse-url-default-handlers'.
Tassilo Horn [Mon, 4 May 2020 09:24:08 +0000 (11:24 +0200)]
Allow for custom URL handlers in browse-url.
* lisp/net/browse-url.el (browse-url-handlers): New defcustom.
(browse-url-default-handlers): New defvar.
(browse-url): Use them. Adapt docstring. Issue a warning pointing to
browse-url-handlers when browse-url-browser-function is an alist.
(browse-url--mailto, browse-url--man): New functions.
(browse-url--browser-defcustom-type): Add :doc that the alist usage is
deprecated.
(browse-url-browser-function): Remove documentation referring to the
alist usage and mention browse-url-handlers.
* doc/emacs/misc.texi: Document browse-url-handlers in Browse-URL
node.
* etc/NEWS: Mention browse-url-default-handlers and
browse-url-handlers.
Stefan Kangas [Wed, 6 May 2020 01:30:20 +0000 (03:30 +0200)]
Prefer 'strong' and 'em' to 'b' and 'i' in html-mode
* lisp/textmodes/sgml-mode.el (html-face-tag-alist): Prefer inserting
'strong' and 'em' tags to 'b' and 'i' in html-mode. (Bug#41031)
* lisp/textmodes/sgml-mode.el (html-mode): Update docstring to do the
same.
Paul Eggert [Wed, 6 May 2020 00:16:49 +0000 (17:16 -0700)]
Don’t assume __has_attribute in emacs-module.c
Problem reported by Glenn Morris in:
https://lists.gnu.org/r/emacs-devel/2020-05/msg00724.html
* src/emacs-module.c: Use HAS_ATTRIBUTE instead of assuming
the compiler supports __has_attribute.
Paul Eggert [Tue, 5 May 2020 07:48:48 +0000 (00:48 -0700)]
Fix typos in recent attribute.h simplification
Problem reported by Andreas Schwab in:
https://lists.gnu.org/r/emacs-devel/2020-05/msg00650.html
* src/conf_post.h (HAS_ATTR_no_sanitize): Define to false in case
cpp is picky, fixing a longstanding glitch here.
(ATTRIBUTE_NO_SANITIZE_ADDRESS, ATTRIBUTE_NO_SANITIZE_UNDEFINED):
Use HAS_ATTRIBUTE, not __has_attribute.
Alan Mackenzie [Mon, 4 May 2020 18:26:38 +0000 (18:26 +0000)]
Remove calls to non-existent functions from edebug.el.
Do not merge to master.
*lisp/emacs-lisp/edebug.el (edebug--display-1)
(edebug-toggle-disable-breakpoint): Remove calls to
edebug--overlay-breakpoints and edebug--overlay-breakpoints-removed which had
been overlooked in a recent changed to edebug.
Dmitry Gutov [Sun, 3 May 2020 23:56:10 +0000 (02:56 +0300)]
Honor search-upper-case
* lisp/fileloop.el (fileloop--case-fold):
Extract from existing code. Honor search-upper-case (bug#40940).
(fileloop-initialize-replace, fileloop-initialize-search): Use it.
Update the docstring.
Juri Linkov [Sun, 3 May 2020 22:31:44 +0000 (01:31 +0300)]
Revert part of recent commit 85544f8ef5 (bug#40808)
* lisp/isearch.el (isearch-lazy-highlight-search): Remove recent fix of
lazy-highlighting of hidden matches. In emacs-27 leave only the fix for
lazy-counting of hidden matches when isearch-lazy-count is non-nil.
Paul Eggert [Sun, 3 May 2020 22:06:58 +0000 (15:06 -0700)]
Simplify by using attribute.h macros
attribute.h is partly designed for C2X forward compatibility,
since C2X will add some standard attributes. Using its macros
should help insulate Emacs from C2X teething problems.
* src/conf_post.h: Include attribute.h.
(HAS_ATTRIBUTE, HAS_FEATURE): Rename from __has_attribute and
__has_feature, to avoid polluting the builtin namespace.
All uses changed.
(ATTRIBUTE_COLD, ATTRIBUTE_FORMAT, FALLTHROUGH, ATTRIBUTE_CONST)
(ATTRIBUTE_PURE, ATTRIBUTE_UNUSED, ATTRIBUTE_MAY_ALIAS)
(ATTRIBUTE_MALLOC, ATTRIBUTE_ALLOC_SIZE)
(ATTRIBUTE_RETURNS_NONNULL): Remove, as attribute.h does this now.
(NO_INLINE, EXTERNALLY_VISIBLE, ARG_NONNULL, ATTRIBUTE_UNUSED):
Simplify by defining in terms of attribute.h macros.
* src/systhread.h (ATTRIBUTE_WARN_UNUSED_RESULT): Remove.
All uses replaced by attribute.h’s NODISCARD.
Paul Eggert [Sun, 3 May 2020 21:57:10 +0000 (14:57 -0700)]
Update from Gnulib
This incorporates:
2020-05-03 attribute: new module
2020-04-13 explicit_bzero: improve code style
2020-04-13 explicit_bzero: On native Windows, use SecureZeroMemory
2020-04-13 explicit_bzero: use memset_s() when available
2020-04-04 maint: remove a stray inter-word space
* build-aux/config.guess, build-aux/config.sub:
* build-aux/gitlog-to-changelog, build-aux/update-copyright:
* doc/misc/texinfo.tex, lib/explicit_bzero.c, lib/ieee754.in.h:
* lib/nstrftime.c, m4/explicit_bzero.m4, m4/gnulib-common.m4:
Copy from Gnulib.
* lib/attribute.h: New file, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lisp/calculator.el (calculator-string-to-number): Convert decimal
numbers input to float, fixing a regression introduced in f248292ede.
Reported by Aitor Soroa.