Bind 'n' and 'p' to move between symbols in apropos
* lisp/apropos.el (apropos-next-symbol)
(apropos-previous-symbol): New commands.
(apropos-mode-map): Bind above commands to 'n' and 'p'. (Bug#20694)
* etc/NEWS: Announce the new commands.
Alan Third [Tue, 14 Apr 2020 21:56:06 +0000 (22:56 +0100)]
Use native image API for NS
* configure.ac (NATIVE_IMAGE_API): Move above NS definitions.
(HAVE_NATIVE_IMAGE_API): Set for NS.
(HAVE_PNG, HAVE_JPEG, HAVE_GIF, HAVE_TIFF): Enable on NS builds.
* src/image.c (HAVE_NS): Fix a number of #if's so they no longer rely
on HAVE_NS.
(PIX_MASK_DRAW): Add for HAVE_NS so libpng support will compile.
(image_can_use_native_api):
(native_image_load): Add NS support.
(png_load):
(jpeg_load):
(tiff_load):
(gif_load): Remove NS specific definitions.
* src/nsimage.m (ns_can_use_native_image_api): New function.
* src/nsterm.h: (ns_can_use_native_image_api): New function.
Alan Third [Sat, 11 Apr 2020 13:18:39 +0000 (14:18 +0100)]
Allow dynamic choice of drawing path on NS (bug#39883)
* src/nsterm.h (NS_DRAW_TO_BUFFER): Let this be enabled on versions
older than 10.14.
* src/nsterm.m (ns_update_begin):
(ns_update_end):
(ns_focus):
(ns_unfocus):
([EmacsView viewDidResize:]):
([EmacsView createDrawingBuffer]):
([EmacsView windowDidChangeBackingProperties:]):
([EmacsView copyRect:to:]):
([EmacsView wantsUpdateLayer]): Dynamically switch between drawing to a
buffer and drawing to the screen, depending on the version of AppKit
in use.
([EmacsView dealloc]): We can't release the context unless
NS_DRAW_TO_BUFFER is defined.
* src/nsmenu.m (update_frame_tool_bar): Remove reference to
updateFrameSize.
* src/nsterm.h: ([EmacsView updateFrameSize]):
([EmacsView setRows:andColumns:]): Remove unused
method definitions.
(NS_PARENT_WINDOW_LEFT_POS):
(NS_PARENT_WINDOW_TOP_POS): Move to nsterm.m.
* src/nsterm.m (ns_parent_window_rect): New function.
(NS_PARENT_WINDOW_LEFT_POS):
(NS_PARENT_WINDOW_TOP_POS): Move to nsterm.m and simplify.
(ns_set_offset): Fix strange behaviours when using negative values.
(ns_set_window_size):
(ns_set_undecorated):
([EmacsView windowDidResize:]):
([EmacsView windowDidExitFullScreen]):
(ns_judge_scroll_bars): Remove references to updateFrameSize.
([EmacsView dealloc]): Unset resize notification and release buffer.
([EmacsView updateFrameSize:]): Remove function.
([EmacsView windowWillResize:toSize:]): Move some code to
viewDidResize.
([EmacsView viewDidResize]): New function.
([EmacsView initFrameFromEmacs:]): Set up resize notification and move
buffer creation until after the prerequisite objects are created.
([EmacsView toggleFullScreen:]): Set frame to the size of the
contentview, not the whole window, and remove reference to
updateFrameSize.
([EmacsView setRows:andColumns:]): Remove unused method.
([EmacsView windowDidMove:]): Tidy up.
Alan Mackenzie [Thu, 16 Apr 2020 17:01:14 +0000 (17:01 +0000)]
(forward-comment -n): escaped newline is sometimes NOT end of comment
* src/syntax.c (Fforward_comment) When comment-end-can-be-escaped is non-nil,
don't attempt back_comment when point is just after an escaped newline, etc.
Found by relint. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00265.html
* lisp/org/org-table.el (org-table-finish-edit-field):
* lisp/arc-mode.el (archive-rar-summarize):
Avoid wrapped subsumption in repeated sequences.
* lisp/erc/erc-dcc.el (erc-dcc-ctcp-query-send-regexp): Replace
inefficient repeated empty-matching expression with a plain greedy
form.
(erc-dcc-handle-ctcp-send): Adjust group numbers.
* lisp/net/puny.el (puny-encode-domain): Fix fast-path shortcut
pattern so that it actually works as intended.
* lisp/progmodes/gdb-mi.el (gdb-control-commands-regexp):
* lisp/vc/diff-mode.el (diff-imenu-generic-expression):
Remove superfluous backslashes.
* lisp/progmodes/scheme.el (scheme-imenu-generic-expression):
Correct confused definition-matching pattern which would match more
than intended.
* lisp/textmodes/sgml-mode.el (sgml-tag-name-re): Avoid inefficient
matching by using the fact that the first character cannot match the
last char of sgml-name-re.
Eli Zaretskii [Thu, 16 Apr 2020 06:14:07 +0000 (09:14 +0300)]
File-handling cleanup in w32image.c
* src/w32image.c (w32_load_image): Encode the image file name and
convert it via 'map_w32_filename'. No need to do anything special
when 'w32_unicode_filenames' is zero, since file names are in
UTF-8 internally, and this code will never run on Windows 9X.
* src/w32.h (map_w32_filename): Add prototype; removed prototypes
from all *.c files.
Eli Zaretskii [Wed, 15 Apr 2020 20:15:03 +0000 (23:15 +0300)]
Fix retrieval of frame delay when using GDI+
* src/w32image.c (enum PropertyItem_type): New enumeration.
(decode_delay): New function.
(w32_frame_delay): Call 'decode_delay' to retrieve the frame delay
from image data.
a5f7c26907 (origin/emacs-27) * admin/authors.el: Add an author alias. d87a4d1f4e Limit RLIMIT_NOFILE to FD_SETSIZE on macOS e5ca8e5e73 Fix Elisp manual entry on 'set-window-configuration' 485f24223f ; Update ChangeLog.3 8f200254fb ; Update etc/AUTHORS c7adc851ad * admin/authors.el: Add missing author aliases. 4acdd7fe58 Fix edge case errors in filename-matching regexps 5f36e21fe5 Clarify the doc string of 'yank' 13301d4266 New function erc-track-switch-buffer-other-window 38f7538d8f New function erc-switch-to-buffer-other-window
Eli Zaretskii [Wed, 15 Apr 2020 11:28:21 +0000 (14:28 +0300)]
Avoid infloop in redisplay when wrap-prefix is too wide
* src/xdisp.c (move_it_to): Avoid infloop due to wrap-prefix that
is wide enough to leave no space to display even the first
character of the continuation line. (Bug#40632)
* src/nsterm.m ([EmacsApp applicationDidFinishLaunching:]): Call
CoreFoundation functions that increase RLIMIT_NOFILE behind our back
during startup, and then set RLIMIT_NOFILE back to FD_SETSIZE to avoid
crashes in setup_process_coding_system (Bug#39164).
Stefan Monnier [Wed, 15 Apr 2020 04:23:09 +0000 (00:23 -0400)]
* lisp/htmlfontify.el: Use `font-lock-ensure` unconditionally
Remove redundant `:group`s.
(hfy-force-fontification): Make it an obsolete alias for `font-lock-ensure`.
Update all callers.
(hfy-init-kludge-hooks, hfy-init-kludge-hook): Remove vars, not used any more.
(hfy-kludge-cperl-mode): Declare it obsolete.
Eli Zaretskii [Tue, 14 Apr 2020 19:22:07 +0000 (22:22 +0300)]
Avoid compiler warning in image.c
* src/image.c (image_can_use_native_api): Avoid compiler warnings
by making this function conditioned on HAVE_NATIVE_IMAGE_API.
(initialize_image_type): Call image_can_use_native_api only if
HAVE_NATIVE_IMAGE_API is non-zero. Reported by Basil
L. Contovounesios <contovob@tcd.ie>.
Eli Zaretskii [Tue, 14 Apr 2020 15:10:41 +0000 (18:10 +0300)]
Make use of MS-Windows native image API be selectable at run time
* configure.ac: Minor cleanup in how w32image.o is added to the
build when native image APIs are requested.
* src/w32gui.h (w32_load_image, w32_can_use_native_image_api)
(w32_gdiplus_shutdown): Move prototypes from w32term.h here, since
w32.c doesn't include w32term.h.
* src/image.c (struct image_type): No need to pass TYPE to the
'valid_p' method. All callers changed.
(initialize_image_type) [HAVE_NATIVE_IMAGE_API]: Call
'image_can_use_native_api' before trying image-specific methods.
(image_can_use_native_api): New function.
(image_types): Remove the native_image_type parts.
(syms_of_image): New symbol 'native-image'.
(parse_image_spec): Accept native-image "type" for any image type.
* src/w32term.c (syms_of_w32term): New variable
'w32-use-native-image-API'.
* src/w32image.c: (w32_can_use_native_image_api): New function.
(gdiplus_init): Rename from w32_gdiplus_startup. Simplify code.
Move the call to GdiplusStartup to a separate function. Use
ordinal number for SHCreateMemStream if cannot load it by name.
(w32_load_image): Ignore Win32Error status from
w32_select_active_frame.
Move DEFSYMs from here...
* src/image.c (syms_of_image) [HAVE_NATIVE_IMAGE_API]: ...to here.
* etc/NEWS: Update the entry about native image API use.
These changes fix actual or latent bugs in regexps that match
file names, such as PATTERN arguments to 'directory-files'. See
https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00265.html
Eli Zaretskii [Tue, 14 Apr 2020 05:38:00 +0000 (08:38 +0300)]
Clarify the doc string of 'yank'
* lisp/simple.el (yank): Mention 'current-kill' in the doc string,
so that people could find all the gory details of what is "the most
recent kill" for this purpose. (Bug#40375)
* lisp/erc/erc-track.el (erc-track-switch-buffer): Factor out the
implementation from here ...
(erc-track--switch-buffer): ... to here.
(erc-track-switch-buffer-other-window): New function, like
`erc-track-switch-buffer', but uses `switch-to-buffer-other-window'
instead, to open the buffer in another window.
* lisp/erc/erc.el (erc-switch-to-buffer): Factor out the buffer choice
implementation from here ...
(erc--switch-to-buffer): ... to here.
(erc-switch-to-buffer-other-window): New function, like
`erc-switch-to-buffer', but uses `switch-to-buffer-other-window'
instead, to open the buffer in another window.
1dfc497fac Minor wording change in Introduction to Programming in Ema... ff09b4eeac Fix 'flymake-show-diagnostics-buffer' when line numbers ar... 63e8d0ea87 Fix last changes describing mail commands 01212a762f Do setup Flymake in file-less Elisp buffers 36873ef2b2 Fix error message for ‘cl-struct-unknown-slot’ (bug#39995) 3f9310b0fe Fix and improve documentation of mail-related features 1482a75efa Fix build failure with Fx_gtk_debug cf57663f2a Mention jit-lock deferred as an alternative to fast-but-im...
Albert [Mon, 13 Apr 2020 10:02:17 +0000 (18:02 +0800)]
Support toggling native Input Methods on MS-Windows
* src/w32term.h (WM_EMACS_IME_STATUS): New message code.
* src/w32fns.c (ImmGetOpenStatus_Proc, ImmSetOpenStatus_Proc): New
typedefs.
(w32_msg_pump): Handle the WM_EMACS_IME_STATUS message.
(Fw32_get_ime_open_status, Fw32_set_ime_open_status): New functions
(syms_of_w32fns): Defsubr them.
(globals_of_w32fns): Load ImmGetOpenStatus and ImmSetOpenStatus
from IMM2.DLL.
Štěpán Němec [Sat, 7 Mar 2020 17:26:44 +0000 (18:26 +0100)]
gnus-shorten-url: Improve and avoid args-out-of-range error
'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored
fragment identifiers and didn't check substring bounds, in some cases
leading to runtime errors, e.g.:
gnus-shorten-url: Improve and avoid args-out-of-range error
'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored
fragment identifiers and didn't check substring bounds, in some cases
leading to runtime errors, e.g.:
This commit makes it account for #fragments and fixes faulty string
computation. (bug#39980)
Do not merge to master, where the helper is put to subr-x.el.
* lisp/gnus/gnus-sum.el (gnus--string-truncate-left): New helper
function (copied from 'ediff-truncate-string-left').
(gnus-shorten-url): Use it and don't drop #fragments.
Eli Zaretskii [Mon, 13 Apr 2020 08:53:47 +0000 (11:53 +0300)]
Minor wording change in Introduction to Programming in Emacs Lisp
* doc/lispintro/emacs-lisp-intro.texi (Prevent confusion): Mention
that dynamic scoping is only the default in Emacs Lisp, not the
only scoping rule. (Bug#40594)
Eli Zaretskii [Mon, 13 Apr 2020 08:43:39 +0000 (11:43 +0300)]
Improve support of "Re:" in Rmail
* lisp/mail/rmail.el (rmail-simplified-subject)
(rmail-reply-regexp): Recognize U+FF1A FULLWIDTH COLON as a colon
after "Re:"-type prefixes.
(rmail-re-abbrevs): New defcustom with localized abbreviations of
"Re:".
(rmail-reply-regexp): Use 'rmail-re-abbrevs'. Recognize U+FF1A
in addition to the ASCII colon.
* etc/NEWS: Call out the new defcustom 'rmail-re-abbrevs'.
Juri Linkov [Sun, 12 Apr 2020 23:40:56 +0000 (02:40 +0300)]
Fix hi-lock test and add new test for case-fold (bug#40337)
* lisp/hi-lock.el (hi-lock--regexps-at-point): Handle font-lock faces.
(hi-lock-unface-buffer): Simplify default value handling.
(hi-lock-set-pattern): Add either lighter or regexp to
hi-lock-interactive-lighters.
(hi-lock-set-pattern): Put overlay prop hi-lock-overlay-regexp to
either lighter or regexp.
* test/lisp/hi-lock-tests.el (hi-lock-bug26666): Use "b" instead of "a".
(hi-lock-case-fold): New test.
Eli Zaretskii [Sun, 12 Apr 2020 08:31:29 +0000 (11:31 +0300)]
Fix and improve documentation of mail-related features
* lisp/simple.el (compose-mail): Clarify the effect of the
CONTINUE argument.
* lisp/mail/sendmail.el (mail-from-style): Update the RFC value in
the obsolescence warning text.
* doc/emacs/sending.texi (Sending Mail): Fix the description of
the behavior of 'C-x m' wrt prefix argument.
(Mail Headers): Remove the description of 'mail-from-style'.
* etc/NEWS: Mention that 'mail-from-style' is obsolete.
Martin Rudalics [Sun, 12 Apr 2020 08:00:28 +0000 (10:00 +0200)]
Fix build failure with Fx_gtk_debug
* src/xfns.c (Fx_gtk_debug, Sx_gtk_debug): Define only for GTK
versions >= 3.14.0 so gtk_window_set_interactive_debugging is
defined. Reported by Andreas Schwab <schwab@linux-m68k.org>.
Paul Eggert [Sun, 12 Apr 2020 01:35:35 +0000 (18:35 -0700)]
Remove UNSIGNED_CMP
I added this macro in 2011 to fix some signedness comparison bugs.
However, it’s a weird macro and the bugs can be fixed in a
more-straightforward way. This helps performance slightly (0.5%) on my
platform (Fedora 31 x86-64, GCC 9.3.1 with -O2).
* src/casefiddle.c (do_casify_natnum): Use simple comparison
instead of UNSIGNED_CMP.
* src/character.h (CHAR_VALID_P, SINGLE_BYTE_CHAR_P, CHAR_STRING):
* src/composite.h (COMPOSITION_ENCODE_RULE_VALID):
* src/lisp.h (ASCII_CHAR_P):
Now an inline function, and uses simple comparison instead of
UNSIGNED_CMP.
* src/dispextern.h (FACE_FROM_ID, FACE_FROM_ID_OR_NULL)
(IMAGE_FROM_ID, IMAGE_OPT_FROM_ID): Move these to ...
* src/frame.h (FACE_FROM_ID, FACE_FROM_ID_OR_NULL)
(IMAGE_FROM_ID, IMAGE_OPT_FROM_ID): ... here, and make them
inline functions that no longer use UNSIGNED_CMP.
* src/keyboard.c (read_char): UNSIGNED_CMP is not needed here
since XFIXNAT always returns a nonnegative value.
* src/lisp.h (UNSIGNED_CMP): Remove; no longer used.
Juri Linkov [Sat, 11 Apr 2020 23:45:02 +0000 (02:45 +0300)]
Implement case-insensitivity in hi-lock (bug#40337)
* lisp/hi-lock.el (hi-lock-interactive-lighters): New buffer-local variable.
(hi-lock-mode): Set hi-lock-interactive-lighters to nil.
(hi-lock-line-face-buffer): Use case-fold-search and search-upper-case.
(hi-lock-face-buffer): Add new arg LIGHTER. Use case-fold-search,
search-upper-case and search-spaces-regexp.
(hi-lock-face-phrase-buffer): Don't call hi-lock-process-phrase.
Use case-fold-search, search-upper-case and search-whitespace-regexp.
(hi-lock-face-symbol-at-point): Use case-fold-search and search-upper-case.
(hi-lock-unface-buffer): Use hi-lock-interactive-lighters to get
a human-readable string for completion and x-popup-menu.
(hi-lock-process-phrase): Remove function.
(hi-lock-set-pattern): Add new args LIGHTER, CASE-FOLD, SPACES-REGEXP.
Set font-lock pattern to a search function. Add mapping from
lighter or regexp to pattern to hi-lock-interactive-lighters.
Let-bind case-fold-search and search-spaces-regexp in search functions.
* lisp/isearch.el (isearch--highlight-regexp-or-lines): Replace ugly code
with let-binding of case-fold-search, search-upper-case, search-spaces-regexp.
(isearch-highlight-regexp, isearch-highlight-lines-matching-regexp):
Use lambda.
Alan Mackenzie [Sat, 11 Apr 2020 21:04:50 +0000 (21:04 +0000)]
Mention jit-lock deferred as an alternative to fast-but-imprecise-scrolling
* doc/emacs/display.texi (Scrolling): Add a paragraph on using jit-lock
deferred fontification as a way of obviating Emacs hanging after
auto-repeated scrolling.
Stefan Monnier [Fri, 10 Apr 2020 22:27:36 +0000 (18:27 -0400)]
* lisp/progmodes/cl-font-lock.el: New file
Taken from commit 1a54066611da213626ab69ea426ba3c63ece3438
of https://github.com/cl-font-lock/cl-font-lock,
but with names reverted to a `cl-font-lock-` prefix.
fd27685c1e (origin/emacs-27) ; * doc/lispref/keymaps.texi (Extended M... 6057d79a4e * doc/lispref/keymaps.texi (Extended Menu Items): Tweak :k... 17a1bb5a03 Fix redisplay when scrolling under redisplay-dont-pause 90321f595c Fix face extension in pulse.el 36c42d2a30 * doc/misc/tramp.texi (Bug Reports): Avoid line breaks in ... d5750af151 Avoid assertion violation in intervals.c 18d1bc0a09 Improve documentation of 'jit-lock-contextually' 08486f4cae Speed up 'resize-mode' child frames a little f451ef9308 ; * etc/NEWS: Mention 'executing-macro' in removed vars. c49d379f17 Fix some problems with moving and resizing child frames
Stefan Monnier [Fri, 10 Apr 2020 21:04:19 +0000 (17:04 -0400)]
* doc/lispref/keymaps.texi (Extended Menu Items): Tweak :key-sequence
Don't make it sound like `:key-sequence nil` is any different than the
absence of `:key-sequence`. And the performance advantage of
`:key-sequence` disappeared long ago.
Eli Zaretskii [Fri, 10 Apr 2020 15:30:21 +0000 (18:30 +0300)]
Fix redisplay when scrolling under redisplay-dont-pause
* src/dispnew.c (update_window): Reset the window's
'must_be_updated_p' flag if the window's update was completed
without interruption. This fixes redisplay glitches when
'redisplay-dont-pause' is nil, at least on MS-Windows, because
'expose_window' doesn't redraw the exposed rectangle when the
window's 'must_be_updated_p' flag is set.
Eli Zaretskii [Thu, 9 Apr 2020 16:44:55 +0000 (19:44 +0300)]
Fix face extension in pulse.el
* lisp/cedet/pulse.el (pulse-reset-face): Propagate the :extend
attribute of FACE to the face used for displaying the pulse.
Reported by Adam Porter <adam@alphapapa.net>.
To sidestep conversion altogether when EOL conversion applies, we must
either be encoding a string without NL, or decoding without CR.
* src/coding.c (string_ascii_p): Revert to a pure predicate.
(code_convert_string): Fix logic. Don't use uninitialised
ascii_p (removed). Use memchr to detect CR or LF in string when needed.
* test/src/coding-tests.el (coding-nocopy-ascii):
Update tests to include encodings with explicit EOL conversions.
Don't crash with invalid argument in check-coding-systems-region
* src/coding.c (Fcheck_coding_systems_region): Don't crash if
the third arg contains something that isn't a coding system.
* test/src/coding-tests.el (coding-check-coding-systems-region):
New test.
Callers of ENCODE_FILE and DECODE_FILE should not assume that these
functions always return a new string (bug#40407).
* src/w32fns.c (Fw32_shell_execute):
* src/w32proc.c (Fw32_application_type):
Sink taking the address of a Lisp string past GC points.
Copy values returned from ENCODE_FILE before mutating them.
Eli Zaretskii [Thu, 9 Apr 2020 09:20:24 +0000 (12:20 +0300)]
Fix decoding of ASCII strings with embedded CR characters
* src/coding.c (string_ascii_p): Return a negative value if an
all-ASCII string STR includes the CR character, otherwise a
positive value.
(code_convert_string): If the string is ASCII, but includes CR
characters, use the fast path only if EOL doesn't need to be
decoded. (Bug#40519)
* test/src/coding-tests.el (coding-nocopy-ascii): Add more tests
for bug#40519.
Eli Zaretskii [Thu, 9 Apr 2020 09:18:30 +0000 (12:18 +0300)]
Fix decoding ASCII strings with embedded CR characters
* src/coding.c (string_ascii_p): Return a negative value if an
all-ASCII string STR includes the CR character, otherwise a
positive value.
(code_convert_string): If the string is ASCII, but includes CR
characters, use the fast path only if EOL doesn't need to be
decoded. (Bug#40519)
* test/src/coding-tests.el (coding-nocopy-ascii): Add tests for
bug#40519.
Eli Zaretskii [Thu, 9 Apr 2020 08:21:18 +0000 (11:21 +0300)]
Avoid assertion violation in intervals.c
* src/intervals.c (delete_interval): Allow negative values of
LENGTH (i). This happens when delete_interval is called from
set_intervals_multibyte_1, because the caller zeroes out the
total_length field of the interval to be deleted. See
https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00131.html
for more details. See also a related old discussion at
https://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00399.html.
Eli Zaretskii [Wed, 8 Apr 2020 15:33:52 +0000 (18:33 +0300)]
Improve documentation of 'jit-lock-contextually'
* lisp/jit-lock.el (jit-lock-contextually): Clarify the jit-lock
operation when 'jit-lock-contextually' is non-nil and non-t.
* doc/lispref/modes.texi (Syntactic Font Lock)
(Other Font Lock Variables): Document the relation between
'jit-lock-register', 'font-lock-keywords-only', and syntactic
refontification.
* src/gtkutil.c (xg_frame_set_char_size): Skip resizing if the
target dimensions are unchanged for child frames with
'resize-mode' resize policy as well.
Paul Eggert [Wed, 8 Apr 2020 03:52:28 +0000 (20:52 -0700)]
Revert my KEY_OPS_CFLAGS change to src/Makefile.in
Now that -Og inlining has been improved this is no longer helpful.
* src/Makefile.in (KEY_OPS_CFLAGS): Remove. All uses removed.
This improved CPU performance of ‘make compile-always’ by 5% on my
platform, which was gcc -Og, GCC 9.3.1 20200317 (Red Hat 9.3.1-1),
Fedora 31 x86-64 (AMD Phenom II X4 910e, circa 2010).
Paul Eggert [Tue, 7 Apr 2020 23:57:04 +0000 (16:57 -0700)]
Improve inlining when compiling with -Og
* src/conf_post.h (EXTERN_INLINE) [!EMACS_EXTERN_INLINE]:
Make it static inline, not merely static. This is a worthwhile
performance improvement on my two platforms A and B (see below).
On my platform A this change improves user+system CPU performance of
‘make compile-always’ by 52% on an -Og build, and by 1.4% on the
default -O2 build. On my platform B this improves the same benchmark
by 41% on an -Og build, and by -0.8% on the default -O2 build.
That "-0.8%" is a small negative for this change, and I recall that
it is why I didn't make this change earlier. However, Platform B uses
an older GCC so we needn't worry overmuch about this small negative.
With this change the performance advantage of -O2 over -Og has dropped
on platform A; formerly -O2 was 87% faster than -Og, and now it is
only 25% faster. On platform B the performance advantage of -O2 over
-Og has dropped from being 62% faster to being 14% faster.
Platform A is GCC 9.3.1 20200317 (Red Hat 9.3.1-1) on Fedora 31
x86-64 (AMD Phenom II X4 910e, circa 2010). Platform B is GCC (Ubuntu
7.5.0-3ubuntu1~18.04) 7.5.0 on Ubuntu 18.04.4 (Intel Xeon E3-1225 V2,
circa 2012).
This patch was inspired by a suggestion by Andrea Corallo in:
https://lists.gnu.org/r/emacs-devel/2020-04/msg00263.html