Stefan Kangas [Wed, 23 Sep 2020 21:06:02 +0000 (23:06 +0200)]
Add ert macros to get resource file names (Bug#43792)
* lisp/emacs-lisp/ert-x.el (subr-x): Require.
(ert-resource-dir, ert-resource-file): New macros to get the file name
of the resource directory belonging to a test.
(ert-resource-dir-format, ert-resource-dir-trim-left-regexp)
(ert-resource-dir-trim-right-regexp): New variables.
Stephen Berman [Fri, 16 Oct 2020 08:33:19 +0000 (10:33 +0200)]
Adjust some tests so that they work in symlinked environs
* test/lisp/help-fns-tests.el (help-fns-test-lisp-macro)
(help-fns-test-lisp-defsubst):
* test/lisp/emacs-lisp/cl-generic-tests.el
(cl-generic-tests--method-files--finds-methods): Adjust test so
that they work in a symlinked environment (bug#43004).
(cl-generic-tests--method-files--finds-methods): Use file-truename
so that this works in a symlinked environment (bug#43004).
Sanitize ical data in gnus-icalendar-event-from-ical
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-ical):
Sanitise the data before passing it on to the constructor. This
avoids backtraces on icals with extra, unknown slots (bug#43057).
Substitute command keys in button help-echo values
* lisp/button.el (button--help-echo): Pass resulting string through
substitute-command-keys for consistency with show-help-function.
* test/lisp/button-tests.el (button-tests--map): New test keymap.
(button--help-echo-string, button--help-echo-form)
(button--help-echo-function): Use it to test command key
substitution in help-echo strings (bug#43070).
Make package-install-from-buffer maybe refresh the quickstart file
* lisp/emacs-lisp/package.el (package-install-from-buffer):
Refresh the quickstart file (bug#43237). This makes this command
more consistent with package-install.
* lisp/vc/vc.el (vc-revision-other-window): This function used to
change the current buffer, but this was changed in the previous
patch for indirect buffer support. Ensure that it still does
this, because this is what the callers expect (bug#44026).
Add way to prevent asking "increase specpdl size?"
* net/shr.el (shr-offer-extend-specpdl): New option, default t.
(shr-descend): If shr-offer-extend-specpdl is nil, don't even ask
whether to extend the specpdl, just signal error.
* lisp/hi-lock.el (hi-lock-face-buffer): If given a face name a
string, convert it to a symbol first, as later usage of this
expects a symbol and not a string (bug#43339).
Stefan Kangas [Thu, 15 Oct 2020 13:00:05 +0000 (15:00 +0200)]
Remove some references to "in Emacs 21 or later"
* doc/misc/efaq.texi (Colors on a TTY, Disabling backups)
(Errors with init files, Backspace invokes help)
(Backspace invokes help): Remove some references to "in Emacs 21 or
later". Now everyone can be assumed to use at least that version.
Fix problem with next-error-message-highlight in *Occur*
* lisp/simple.el (next-error-message-highlight): This function is
called directly, so clean up the code a bit (bug#32676).
(next-error-found): Pass in the error buffer.
Stefan Monnier [Wed, 14 Oct 2020 22:03:52 +0000 (18:03 -0400)]
* lisp/calc: Fix a few issues introduced by lexical scoping
Fix a few places I missed, where we incorrectly used lexical scoping on a var
that needed dynamic scoping.
These were detected thanks to a bit of footwork by Mattias Engdegård!
* lisp/calc/calc-ext.el (math-read-big-lines): Declare as dynbound.
(math-read-big-bigp): Bind it inside a `let`.
* lisp/calc/calc-graph.el (math-arglist): Declare as dynbound.
* lisp/calc/calc-map.el (math-arglist): Declare as dynbound.
* lisp/calc/calc-misc.el (math-trunc-prec): Declare as dynbound.
(math-trunc): Bind it inside a `let`.
(math-floor-prec): Declare as dynbound.
(math-floor): Bind it inside a `let`.
* lisp/calc/calc-nlfit.el (calc-curve-varnames, calc-curve-coefnames):
Declare as dynbound.
* lisp/calc/calc-sel.el (math-comp-sel-tag): Declare as dynbound.
* lisp/calc/calcsel2.el (calc-sel-reselect): Declare as dynbound.
Juri Linkov [Wed, 14 Oct 2020 08:56:23 +0000 (11:56 +0300)]
Highlight regexp sub-expressions in query-replace
* lisp/replace.el (query-replace-highlight-submatches): New defcustom.
(replace-submatches-overlays): New variable.
(replace-highlight): Use query-replace-highlight-submatches.
(replace-dehighlight): Use query-replace-highlight-submatches.
* doc/emacs/search.texi (Query Replace):
Add documentation for query-replace-highlight-submatches.
Suggested by Drew Adams <drew.adams@oracle.com> in bug#43702.
Juri Linkov [Wed, 14 Oct 2020 08:45:26 +0000 (11:45 +0300)]
* lisp/progmodes/grep.el: More fixes for 'lgrep' (bug#23590)
* lisp/progmodes/grep.el (grep-expand-template): Add new arg 'more-opts'.
(grep-use-directories-skip): New variable.
(lgrep): Set 'grep-use-directories-skip' to the result of 'grep-probe'.
Use "--directories=skip" when 'grep-use-directories-skip' is t.
Ernesto Alfonso [Wed, 14 Oct 2020 05:45:21 +0000 (07:45 +0200)]
Add option to highlight the 'next-error' error message
* lisp/simple.el (next-error-message-highlight):
(next-error-message): New faces (bug#32676).
(next-error--message-highlight-overlay): New internal variable.
(next-error-message-highlight): New function.
(next-error-found): Call the function.
* lisp/dired-x.el (dired-x-guess-filename-at-point): Rename (bug#43961).
(dired-filename-at-point): Made into an obsolete alias, since the name
can be confused with the unrelated dired-file-name-at-point function.
* lisp/emacs-lisp/package.el (package-install-button-action)
(package-delete-button-action): Run describe-package instead of
revert-buffer in order to use newer package-desc (bug#43983).
Paul Eggert [Tue, 13 Oct 2020 17:21:40 +0000 (10:21 -0700)]
nnimap MODSEQ cleanup
* lisp/gnus/nnimap.el (nnimap-parse-flags):
Remove old hack that deletes MODSEQ entries in the buffer, as
Emacs now has bignums and so won't misparse MODSEQs (Bug#38938).
Paul Eggert [Tue, 13 Oct 2020 17:04:21 +0000 (10:04 -0700)]
eql doc improvements
* doc/lispref/numbers.texi (Comparison of Numbers):
Copy some useful text from eql help string.
* src/fns.c (Feql): In doc string, say that eql also compares
integers by value.
Setting the word size ("b w") to 0 removes the word size clipping for
all bit operations (effectively as if a word size of -∞ had been set).
Rotation is disallowed; logical and arithmetic shifts behave
identically.
After a suggestion by Vincent Belaïche.
* lisp/calc/calc-bin.el (calc-word-size, math-binary-arg)
(math-binary-modulo-args, calcFunc-lsh, calcFunc-ash, calcFunc-rot)
(math-clip, math-format-twos-complement): Allow a word size of 0,
meaning -∞.
* test/lisp/calc/calc-tests.el
(calc-tests--not, calc-tests--and, calc-tests--or, calc-tests--xor)
(calc-tests--diff): New functions.
(calc-tests--clip, calc-tests--rot, calc-shift-binary): Extend to
cover word size 0.
(calc-bit-ops): New test.
* doc/misc/calc.texi (Binary Functions): Update manual.
* etc/NEWS: Announce the change.
* etc/emacs.service (ExecStop): Partially revert previous patch
for bug#37847, since: "This appears to break packages that rely on
`invocation-name' to be executable."
Yuan Fu [Tue, 13 Oct 2020 03:14:21 +0000 (05:14 +0200)]
Add cycling commands to outline
* lisp/outline.el (outline--cycle-state, outline-has-subheading-p)
(outline-cycle, outline-cycle-buffer): New functions.
(outline-mode-map): Add key bindings for the two new commands.
(outline--cycle-buffer-state): New variable.
* doc/emacs/text.text (Outline Visibility): Add 'outline-cycle' and
'outline-cycle-buffer'.
* etc/NEWS (Outline): Record the change (bug#41130).
* lisp/subr.el (read-char-choice): Use `read-char-from-minibuffer'
here (bug#42708) so that we're not as modal (and users can copy
the help buffer, if they should so want).
Make diary fontify headers correctly (if the date has been customized)
* lisp/calendar/diary-lib.el (diary-fancy-display): Insert the
heading with the correct face, so that it doesn't have to be
re-matched later (which is generally impossible) (bug#13072).
(diary-fancy-date-pattern, diary-fancy-date-matcher): Make obsolete.
(diary-fancy-font-lock-keywords): Don't use.
(diary-fancy-font-lock-fontify-region-function): Don't use.
Mauro Aranda [Tue, 13 Oct 2020 01:32:17 +0000 (03:32 +0200)]
Don't bind sort-fold-case when saving the custom-file
* lisp/cus-edit.el (custom-save-variables, custom-save-faces): These
functions sort a list, not buffer text, so they don't need
to use sort-fold-case at all. Remove the let-binding for
sort-fold-case (bug#43919).
Have header-line-highlight inherit from mode-line-highlight
* lisp/faces.el (header-line-highlight): Inherit from
mode-line-highlight instead of highlight (bug#43926). This is
consistent with header-line inheriting from mode-line.
Stefan Kangas [Mon, 12 Oct 2020 18:59:14 +0000 (20:59 +0200)]
Fix man page title lines and timestamps
* doc/man/ebrowse.1:
* doc/man/emacs.1.in:
* doc/man/emacsclient.1:
* doc/man/etags.1: Update date to match last significant change. Set
file local variable time-stamp-pattern. Fix title line to match the
recommendations in "man man-pages".
Ref: https://lists.gnu.org/r/emacs-devel/2020-09/msg01002.html
Stefan Monnier [Sun, 11 Oct 2020 22:21:48 +0000 (18:21 -0400)]
* lisp/proced.el: Fix behavior with variable-pitch `header-line` face
Also, use lexical-scoping. Remove redundant `:group` args.
(proced-process-alist, proced-header-line): Use `defvar-local`
(proced-header-line): Put :align-to on spaces to improve result with
variable-pitch header-line face.
(proced-filter, proced-format): Use a closure instead of `(lambda ...).
Stefan Monnier [Sun, 11 Oct 2020 21:08:25 +0000 (17:08 -0400)]
* lisp/hexl.el: Fix behavior with variable-pitch `header-line` face
(hexl-ascii-region): Don't inherit from the `header-line`.
(hexl-font-lock-keywords): Fix text alignment.
(hexl-mode): Set `font-lock-extra-managed-props` accordingly.
Alan Third [Sun, 11 Oct 2020 19:46:07 +0000 (20:46 +0100)]
Fix GNUstep build
Fix mistakes made when removing Cocoa code from nsfont.m.
* src/nsfont.m (nsfont_draw): Remove spurious #ifdef.
(ns_uni_to_glyphs): The #if/#endif was removed from this code, but the
code itself not removed. Remove it now.
Stephen Berman [Sun, 11 Oct 2020 04:05:49 +0000 (06:05 +0200)]
Allow killing files with C-k in wdired if -F is used
* lisp/wdired.el (wdired-change-to-wdired-mode): Add hook to
restore properties.
(wdired-change-to-wdired-mode): Adjust check for symlinks.
(wdired-preprocess-files): Fix parsing when using the -F flag.
(wdired-get-filename): Fix parsing of symlinks when using the -F flag.
(wdired--restore-properties): Renamed, and restore more properties
(bug#18475).
Robert Weiner [Sun, 11 Oct 2020 02:03:47 +0000 (04:03 +0200)]
Make posn-set-point work on frame events
* lisp/subr.el (event-start): Mention the frame part of the events.
(posn-window): Ditto.
(posn-set-point): Make this work if the event is a frame event
(bug#28621).
Rasmus [Sat, 10 Oct 2020 20:32:41 +0000 (22:32 +0200)]
gnus-icalendar.el: Fix bug in gnus-icalendar-identities
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event--find-attendee):
(gnus-icalendar-identities) `gnus-ignored-from-addresses' and
`message-alternative-emails' may be functions. This is not
supported by `gnus-icalendar-event--find-attendee' (bug#43908).
Stefan Monnier [Sat, 10 Oct 2020 20:00:51 +0000 (16:00 -0400)]
* lisp/calc/: Use lexical scoping in all the files
Includes the following pervasive changes:
- Move some defvars earlier in the file so they cover earlier let-bindings
- Change dynamically scoped `calc-FOO` or `math-FOO` function arguments
to just FOO and then let-bind the `calc-FOO` or `math-FOO` variable
explicitly in the body of the function. In some cases, the
beginning of the function was changed to refer to FOO so as to delay
the binding to a nearby `let` when I could ensure that it did
not make a difference.
- Add an underscore in front of unused vars or comment them out altogether.
- Replace unused `err` arg to `condition-case` with nil.
* lisp/calc/calc-embed.el (calc-embedded-modes-change):
Declare `the-language` and `the-display-just` as dynamically scoped.
* lisp/calc/calc-forms.el (math-setup-year-holidays): Use `dolist`.
* lisp/calc/calc-graph.el (calc-graph-set-styles): Use `symbol-value`
rather than `eval.`
(calc-graph-delete-temps, calc-graph-set-styles): Use ignore-errors.
* lisp/calc/calc-macs.el (calc-with-trail-buffer): Add artificial use
of `save-buf` to silence compiler warnings in all the cases where
`body` doesn't make use of it.
* lisp/calc/calc-math.el (math-largest-emacs-expt)
(math-smallest-emacs-expt, math-use-emacs-fn): Use ignore-errors.
* lisp/calc/calc-mode.el (calc-total-algebraic-mode): Remove "P" from
interactive spec since it's not used anyway.
* lisp/calc/calc-rewr.el (calc-match): Simplify.
* lisp/calc/calc.el (calc-buffer): Give it a global nil value,
so it's automatically declared dynbound in any file that requires `calc`.
(calcDigit-nondigit): Adjust accordingly.
* lisp/calc/calcalg2.el (calcFunc-table): Declare `var-dummy` as dynbound.
(math-scan-for-limits): Comment out dead code.
* lisp/calc/calcalg3.el (math-general-fit): Declare `var-YVAL` and
`var-YVALX` as dynbound.
Glenn Morris [Sat, 10 Oct 2020 14:50:20 +0000 (07:50 -0700)]
Merge from origin/emacs-27
c00606171f (origin/emacs-27) A better fix for bug#43886 3196fd44c3 Avoid crashes when a theme is loaded with one frame suspended 0407b15500 Removed an incorrectly placed extra word in the semantic docs 040dcbe53e Fix current-line hscrolling when overlays change c56eeba2ce Extend tests for shell-command-dont-erase-buffer