Martin Rudalics [Fri, 11 Oct 2019 06:46:52 +0000 (08:46 +0200)]
Fixes for fitting windows and frames to their buffers (Bug#37563)
* lisp/window.el (window-default-font-height)
(window-default-line-height): New functions.
(fit-frame-to-buffer): Interpret values of MAX-HEIGHT and
MIN-HEIGHT arguments in terms of WINDOW's default line height
(Bug#37563).
(fit-window-to-buffer): Obey size restricting arguments even
when size of WINDOW's text does not change. Do not
temporarily select WINDOW and perform height/width related
calculations if and only if WINDOW is accordingly combined.
Interpret values of MAX-HEIGHT and MIN-HEIGHT arguments in
terms of WINDOW's default line height.
Stefan Kangas [Fri, 11 Oct 2019 00:15:24 +0000 (02:15 +0200)]
Change font size in correct window using mouse wheel
* lisp/mwheel.el (mouse-wheel-follow-mouse): Doc fix.
(mouse-wheel--get-scroll-window): New function extracted from...
(mwheel-scroll): ...here.
(mouse-wheel-text-scale): New function to change face height in
the correct window, depending on the value of
'mouse-wheel-follows-mouse'. (Bug#28182)
(mouse-wheel-mode): Bind 'mouse-wheel-text-scale' instead of
'text-scale-increase' and 'text-scale-decrease'.
Stephen Gildea [Thu, 10 Oct 2019 16:21:38 +0000 (09:21 -0700)]
Remove tabs from time-stamp-format documentation
* time-stamp.el (time-stamp-format): Untabify the doc string, so
the two-column layout displays consistently in several contexts,
in particular when displayed by customize-variable.
Allow filtering out warnings/errors from compile.el detection
* lisp/progmodes/compile.el
(compilation-transform-file-match-alist): New variable (bug#32968).
(compilation-error-properties): Use it to remove known false
positives.
(compilation-error-regexp-alist): Mention it in this doc string.
Juri Linkov [Wed, 9 Oct 2019 22:42:56 +0000 (01:42 +0300)]
* lisp/tab-bar.el: Don't show window count for one window.
* lisp/tab-bar.el (tab-bar-tab-name-selected-window): Don't show the number
of windows when there is only one window in the window configuration.
(tab-bar-close-other-tabs): Rename from tab-close-other.
Take into account tab-bar-show to turn off when needed.
(tab-close-other): Alias to tab-bar-close-other-tabs.
Fix nnimap tick/readedness thinko introduced some weeks back
* lisp/gnus/nnimap.el (nnimap-request-set-mark): Fix thinko in the
tick/read change: Unticking a message shouldn't make it unread,
but ticking it should make it read.
Make mml-secure-epg-sign bug out if we can't find an identity
* lisp/gnus/mml-sec.el (mml-secure-epg-sign): Bug out if we
couldn't find anything to sign with instead of silently pretending
to sign.
* lisp/gnus/mml-smime.el (mml-smime-epg-sign): Don't bind
inhibit-display because that makes debugging impossible.
Stephen Gildea [Wed, 9 Oct 2019 16:19:10 +0000 (09:19 -0700)]
time-stamp: revert recent change to "%04y"
* time-stamp.el (time-stamp-string-preprocess): Revert change to "%04y"
format made 2 weeks ago by commit 0e56883878 (the previous commit to
this file). Although undocumented, "%04y" was discovered to be in use
in the wild (2016) and had not issued a warning that it would change.
Add a warning that it will change.
* time-stamp-tests.el (time-stamp-test-year-2digit): add test of "%04y"
Simen Heggestøyl [Sat, 27 Jan 2018 11:18:40 +0000 (12:18 +0100)]
Warn about missing executables in RST PDF preview
* lisp/textmodes/rst.el (rst-compile-pdf-preview): Warn about missing
executables when attempting to compile and preview an RST file as PDF.
(Bug#30063)
Stephen Gildea [Wed, 9 Oct 2019 16:06:23 +0000 (09:06 -0700)]
Expand testing of time-stamp format "%y"
* time-stamp-tests.el (time-stamp-test-year): break into two tests,
time-stamp-test-year-2digit and time-stamp-test-year-4digit. Expand
time-stamp-test-year-2digit to look more like tests for other 2-digit
conversions.
Robert Pluim [Wed, 9 Oct 2019 13:12:18 +0000 (15:12 +0200)]
Expand documentation on Lisp variables defined in C sources
* doc/lispref/internals.texi (Writing Emacs Primitives): Add
description of DEFVAR_* arguments. Describe variable naming
conventions. Explain how to express quoting of symbols in C, plus
'specbind' and how to create buffer-local variables.
Michael Albinus [Wed, 9 Oct 2019 10:58:43 +0000 (12:58 +0200)]
Support zsh as local shell in Tramp (Bug#31924)
* lisp/net/tramp-sh.el (tramp-sh-extra-args): Extend zsh
arguments. Add :version.
(tramp-maybe-open-connection): Use extra args for
`tramp-encoding-shell'. (Bug#31924)
* src/xdisp.c (syms_of_xdisp) <display-line-numbers-offset>:
New variable to add an offset to absolute line numbers.
(syms_of_xdisp) <display-line-numbers>: Mention it in docstring.
(maybe_produce_line_number): Use it.
* doc/emacs/display.texi (Display Custom): Document it.
* etc/NEWS (value): Announce it.
* lisp/frame.el: Add `display-line-numbers-offset' to list of
variables which should trigger redisplay of the current buffer.
* src/xdisp.c (maybe_produce_line_number): Check beyond_zv
before using a tick face for the line number. Move all face
selection code outside the loop that draws the line number.
Hong Xu [Wed, 9 Oct 2019 05:03:33 +0000 (07:03 +0200)]
Fix up previous visit-tags-table change
* lisp/progmodes/etags.el (visit-tags-table): Reimplement
`tags--find-default-tags-dir-recursively' using the much simpler
`locate-dominating-file'. Following up bug#37518.
Move point in the dired buffer with `n'/`p' in an image-mode buffer
* lisp/image-mode.el (image-next-file): If the image is in a dired
buffer, then move point in that buffer when advancing
(bug#21752). This makes it easier to select images.
Make menu bar entries only point to named functions, not lambdas
* lisp/menu-bar.el ()
(menu-bar--display-line-numbers-mode-visual)
(menu-bar--display-line-numbers-mode-relative)
(menu-bar--display-line-numbers-mode-absolute)
(menu-bar--display-line-numbers-mode-none)
(menu-bar--visual-line-mode-enable)
(menu-bar--toggle-truncate-long-lines)
(menu-bar--wrap-long-lines-window-edge): Make lambdas into trivial
wrapper functions so that `C-h k' on the menu items work (bug#13841).
(menu-bar-showhide-line-numbers-menu)
(menu-bar-line-wrapping-menu): Use them.
Make add-face-text-property not be destructive on strings
* src/textprop.c (add_properties): Take a parameter to say whether
it's allowed to be destructive or not (bug#20153).
(add_text_properties_1): Ditto.
(Fadd_face_text_property): Use this to say that it shouldn't
modify face properties on strings destructively. This avoids
altering the face properties of one string when altering them on a
copy of the string.
Filter packages by name in list-packages. (Bug#36981)
* lisp/emacs-lisp/package.el (package-menu-filter-by-name): New
function to filter packages by name.
(package-menu-clear-filter): New function to clear applied filters.
(package-menu-filter-by-keyword): Rename function from
package-menu-filter.
(package-menu--generate): Don't change 'q' binding anymore.
(package-menu-mode-map): Bind '/ n' to package-menu-filter-by-name, '/
k' to package-menu-filter-by-keyword and '/ /' to
package-menu-clear-filter.
(package-menu-mode-menu): Update menu entries for the three functions.
* test/lisp/emacs-lisp/package-tests.el (package-test-list-filter-by-name)
(package-test-list-clear-filter): New tests.
* doc/emacs/package.texi: Document usage of
package-menu-filter-by-name, package-menu-clear-filter and update
reference to package-menu-filter-by-keyword.
* etc/NEWS: Announce changes.
Hong Xu [Tue, 8 Oct 2019 16:43:47 +0000 (18:43 +0200)]
Search upward from current dir for the default TAGS file
* doc/emacs/maintaining.texi (Select Tags Table): Update the doc
of `visit-tags-table' (bug#37518).
* lisp/progmodes/etags.el (tags--find-default-tags-dir-recursively)
(visit-tags-table): Search upward from current dir for the default
TAGS file.
Eli Zaretskii [Tue, 8 Oct 2019 13:57:23 +0000 (16:57 +0300)]
Fix crashes on TTY frames due to "C-x 6 f"
* src/xdisp.c (redisplay_internal): Revert the recent change
regarding TTY frames' garbaged flag. It is not needed.
* src/dispnew.c (adjust_frame_glyphs_for_frame_redisplay):
When returning due to mismatch between the desired and actual
dimensions of the glyph matrix, set the frame's garbaged flag
for TTY frames. This avoids crashes when we are later called
from redisplay. Reported by Ergus <spacibba@aol.com>.
* lisp/faces.el (line-number-major-tick, line-number-minor-tick):
Set default color different from `line-number' so after customizing
the tick number variables, the ticks are immediately visible.
Suggested by Juri Linkov <juri@linkov.net>.
* doc/lispref/text.texi (Commands for Insertion):
* lisp/simple.el (newline): Do not mention conditions specific to
'do-auto-fill' under documentation of 'newline' (bug#36702).
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag): Use
this to allow using commands like `C-s' to search for even
truncated bits.
* lisp/international/mule-util.el (truncate-string-to-width):
Allow using text properties to truncate strings instead of
actually truncating strings (bug#17782).
* lisp/emacs-lisp/cl-seq.el: (cl-reduce): Clarify treatment of
:INITIAL-VALUE when :FROM-END is non-nil. Improve wording when SEQ
is empty and :INITIAL-VALUE is unspecified (bug#37400). Describe
behavior when SEQ comprises a single element.
Eli Zaretskii [Mon, 7 Oct 2019 16:03:04 +0000 (19:03 +0300)]
Fix infloop in redisplay caused by a recent change
* src/xdisp.c (redisplay_internal): Avoid inflooping due to a
frame's garbaged flag being set after update_frame. Reported
by Michael Heerdegen <michael_heerdegen@web.de>.
Make ido-display-buffer work interactively more like display-buffer
* lisp/ido.el (ido-display-buffer): Take an interactive parameter,
like `display-buffer' (bug#14904).
(ido-visit-buffer): Use it to emulate `C-u M-x display-buffer'.
Paul Eggert [Mon, 7 Oct 2019 06:08:34 +0000 (23:08 -0700)]
Fix port of file-acl errno checking to non-GNU
I had misinterpreted the private email from Ashish Shukla.
* src/fileio.c (Ffile_acl): Fix typo in previous change
by negating the call to acl_errno_valid.
Hong Xu [Mon, 7 Oct 2019 04:03:21 +0000 (06:03 +0200)]
Default FILE to the current buffer for list-tags
* doc/emacs/maintaining.texi (List Identifiers): Update
`list-tags' doc (bug#37611).
* lisp/progmodes/etags.el (list-tags)
(tags--get-current-buffer-name-in-tags-file): Default FILE to the
current buffer for list-tags.
Make mailcap-prefer-mailcap-viewers work as documented
* lisp/emacs-lisp/seq.el (seq-find): Autoload.
* lisp/net/mailcap.el (mailcap-parse-mailcaps): Note where all the
entries come from so that we can later distinguish between user
values and system values (bug#36771).
(mailcap-parse-mailcap): Take a source parameter.
(mailcap-possible-viewers): No need to sort wildcards/exact
matches; these are later sorted anyway.
(mailcap-add-mailcap-entry): Remove `after' parameter.
(mailcap-mime-info): Make mailcap-prefer-mailcap-viewers work as
documented.
Mauro Aranda [Mon, 7 Oct 2019 01:59:43 +0000 (03:59 +0200)]
Only complete words inside of the string widget
* lisp/wid-edit.el ('string widget): Peek the word that
ispell-complete-word will try to complete, and only offer completions
when the word is inside of the field (bug#11046).
Mauro Aranda [Mon, 7 Oct 2019 01:36:09 +0000 (03:36 +0200)]
Fix message when no completions available for editable field
* lisp/wid-edit.el (widget-completions-at-point): Detect here if point
is not in an editable field.
(widget-complete): And here say there are no completions available
(bug#11562).
Juri Linkov [Sun, 6 Oct 2019 21:08:10 +0000 (00:08 +0300)]
Use tabs in EWW (bug#37592)
* lisp/net/eww.el (eww-open-in-new-buffer): Call tab-new when tab-bar-mode
is enabled.
(eww-browse-url): Add docstring. Call tab-new when tab-bar-mode
is enabled.
* lisp/net/shr.el (shr-map): Bind [C-down-mouse-1] to
shr-mouse-browse-url-new-window.
(shr-mouse-browse-url-new-window): New command.
(shr-browse-url): Add optional arg new-window.
* doc/misc/eww.texi (Basics): Mention opening tabs on M-RET.
Stefan Monnier [Sun, 6 Oct 2019 20:00:21 +0000 (16:00 -0400)]
* eieio-core.el (eieio--full-class-object): New function.
Rather than explicitly call eieio-class-un-autoload, the autoloading is
now performed on-demand if you use eieio--full-class-object.
* lisp/emacs-lisp/eieio-core.el (eieio-class-un-autoload): Remove.
(eieio--full-class-object): New function, to replace it.
(eieio-oref, eieio--class-precedence-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object):
Use it instead of eieio-class-un-autoload.
* lisp/emacs-lisp/eieio.el (eieio-class-parents, child-of-class-p):
Load the class if needed.
Stefan Kangas [Wed, 21 Aug 2019 01:38:49 +0000 (03:38 +0200)]
Support changing font size using mouse wheel
* lisp/mwheel.el (mouse-wheel-mode): Support changing font size (text
scaling) using mouse wheel. (Bug#28182)
(mouse-wheel-scroll-amount): Bind the Ctrl modifier to text scaling.
(mwheel-installed-text-scale-bindings): New variable.
(mouse-wheel--remove-bindings): New helper function for
'mouse-wheel-mode'.
* doc/emacs/frames.texi (Mouse Commands): Document this feature.
* etc/NEWS: Announce it.
Set alternate faces for some line numbers (bug#27734)
* lisp/faces.el (line-number-major-tick, line-number-minor-tick):
New faces.
* lisp/cus-start.el (display-line-numbers-major-tick)
(display-line-numbers-minor-tick): Add customization info.
* lisp/frame.el: Add `display-line-numbers-major-tick' and
`display-line-numbers-minor-tick' to list of variables which
should trigger redisplay of the current buffer.
* src/xdisp.c (syms_of_xdisp) <display-line-numbers-major-tick>
<display-line-numbers-major-tick>: Defvar new options.
(syms_of_xdisp) <line-number-major-tick, line-number-minor-tick>:
Defsym new faces.
(maybe_produce_line_number): Use new faces for line numbers
that are multiple of `display-line-numbers-major-tick' and
`display-line-numbers-minor-tick'.
* etc/NEWS (value): Announce new feature.
* doc/emacs/display.texi (Display Custom): Describe it. Wording by
Robert Pluim <rpluim@gmail.com>
Avoid inf-recursion with dependency cycles.
Remove unused `only` arg. Prune duplicates early rather than late.
(package--removable-packages): Simplify code accordingly.
Paul Eggert [Sun, 6 Oct 2019 16:53:53 +0000 (09:53 -0700)]
Port file-acl errno checking to non-GNU
Problem reported privately for FreeBSD 12 by Ashish Shukla.
* src/fileio.c (Ffile_acl): Treat EINVAL etc. like ENOTSUP if
acl_get_file fails, to port to FreeBSD 12 and other non-GNU
platforms.