Commit graph

72659 commits

Author SHA1 Message Date
Basil L. Contovounesios
63ffb61396 Remove XEmacs audio checks from mm-decode.el
For discussion, see the following threads:
https://lists.gnu.org/archive/html/emacs-devel/2019-03/msg01087.html
https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00584.html
* lisp/gnus/mm-decode.el (mm-inline-media-tests): Remove no-op media
tests for XEmacs features.
2019-05-18 18:12:04 +01:00
Paul Eggert
db9af10394 For SVG, 8192 is the new 256
Prefer librsvg for display of splash.svg
When both librsvg and Imagemagick are available, Emacs should
prefer librsvg to render SVG images.  However, Emacs was using
Imagemagick to render its own splash.svg file because
image-type-from-file-header returned nil for that file.
* lisp/image.el (image-type-from-buffer)
(image-type-from-file-header): Look at the first 8192 bytes of
the image, not just the first 256.  For Emacs’s own splash.svg
file, image-type-header-regexps needs to look at 939 bytes.
8192 bytes is a reasonable number nowadays given typical file
system design.
* test/lisp/image-tests.el (image-tests--emacs-images-directory):
New contant.
(image-type-from-file-header-test): New test.
2019-05-18 10:01:10 -07:00
Michael Albinus
5b8be5809e Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2019-05-18 18:14:39 +02:00
Michael Albinus
16f14a4dbb Bug#35769
* lisp/net/tramp-sh.el: (tramp-maybe-open-connection):
Arrange `process-environment' that it doesn't work for local
processes.  (Bug#35769)
2019-05-18 18:14:17 +02:00
Alan Mackenzie
95fb826dc5 CC Mode: Handle several consecutive noise macros in declaration contexts.
In the bug scenario, the second and subsequent noise macros with parentheses
were getting font-lock-type-face.

* lisp/progmodes/cc-engine.el (c-end-of-token)
(c-forward-noise-clause-not-macro-decl): New functions.
(c-find-decl-prefix-search): Handle noise macros by skipping over them.
(c-forward-decl-or-cast-1): In the loop checking for types, skip over all
consecutive noise macros with parens, not just one.
2019-05-18 15:20:49 +00:00
Bastien
9fcc991229 Fix missing declaration in gnus-sum.el
* lisp/gnus/gnus-sum.el (gnus-tmp-name): Declare var.
2019-05-18 16:45:00 +02:00
Michael Albinus
cac8884d89 Require less packages in Tramp
* lisp/net/tramp-compat.el (format-spec): Do not require advice, cl-lib,
custom, password-cache, timer and ucs-normalize.

* lisp/net/tramp-gvfs.el: Do not require zeroconf.  Declare
zeroconf-* functions.
(tramp-gvfs-enabled): Autoload `zeroconf-init'.

* lisp/net/tramp-sh.el: Do not require dired.

* lisp/net/tramp.el (tramp-get-debug-buffer): Do not require outline.
(tramp-file-name-for-operation): Extend docstring.
(tramp-parse-netrc): Do not require netrc.  Autoload `netrc-parse'.
2019-05-18 16:04:02 +02:00
Mattias Engdegård
1943220d1b Don't use file notification on non-file buffers
Allow non-file buffers to declare that notification on their
default-directory is sufficient to know when auto-revert updates are
required by setting the new variable `buffer-auto-revert-by-notification'
to non-nil.  If nil, the default, then auto-revert will poll
those buffers instead. (bug#35418).
Currently, only Dired sets that variable.

* lisp/autorevert.el (auto-revert-buffers):
Modify condition for using notification.
* lisp/files.el (buffer-auto-revert-by-notification): New variable.
* lisp/dired.el (dired-mode): Set buffer-auto-revert-by-notification.
* doc/emacs/arevert-xtra.texi (Non-File Buffers): Document new variable.
* etc/NEWS (Changes in Specialized Modes and Packages): Describe new variable.
2019-05-18 14:16:21 +02:00
Lars Ingebrigtsen
4bf447bb91 (epa-file-decode-and-insert): Byte compilation warning fix
* lisp/epa-file.el (epa-file-decode-and-insert): Remove
superfluous call to `string-to-multibyte string'.
2019-05-18 11:18:53 +02:00
Michael Albinus
168b8322c3 * lisp/net/tramp.el (tramp-interrupt-process): Return proper value. 2019-05-18 11:11:36 +02:00
Michael Albinus
b9303ac293 ; Add comment in tramp-archive.el 2019-05-18 11:11:23 +02:00
Eli Zaretskii
45ffe7329e Remove usage of string-as-unibyte in arc-mode
* lisp/arc-mode.el (archive-l-e): Encode with utf-8-emacs-unix
instead of using string-as-unibyte.
2019-05-18 10:12:57 +02:00
Eli Zaretskii
6c9a1deb41 Fix visiting and saving UTF-16 encoded XML files
* lisp/international/mule.el (sgml-xml-auto-coding-function):
When the 'enncoding' tag specifies a UTF-16 encoding, enforce
saving the buffer with BOM, per the XML spec.
(xml-find-file-coding-system): Recognize UTF-16 encodings with
BOM.  (Bug#35766)  (Bug#8282)
* lisp/international/mule-cmds.el (select-safe-coding-system):
Don't consider UTF-16 encodings with and without BOM as
"different", so as not to annoy users with redundant questions
about mismatch between the XML/SGML header and the selected
explicit encoding.
2019-05-18 10:15:19 +03:00
Lars Ingebrigtsen
d0b72dbba0 Mitigate byte-compile warning in arc-mode
* lisp/arc-mode.el (byte-after): Remove defsubst.
Replace all calls to byte-after with get-byte throughout the file,
because byte-after gave compilation warnings.
2019-05-18 07:47:32 +02:00
Eli Zaretskii
a7a730e32a (hexl-insert-multibyte-char): Avoid using `string-as-unibyte'
* lisp/hexl.el (hexl-insert-multibyte-char): Avoid using
`string-as-unibyte' in the fallback case.
2019-05-18 07:25:20 +02:00
Lars Ingebrigtsen
635d7a39bc (dirtrack-toggle, dirtrackp): Remove obsolete aliases
* lisp/dirtrack.el (dirtrack-toggle, dirtrackp): Remove
function/variable aliases declared obsolete in Emacs 23.1 (and
that issued a byte-compile warning).
2019-05-18 07:25:19 +02:00
Stefan Monnier
4fbcecfaef * lisp/gnus/gnus-sum.el (gnus-tmp-thread): New var
The recent change to use lexical-binding introduced a bug because
gnus-summary-line-format-alist refers to variable `thread` which is now
lexical and hence not available there any more.  Replace it with
a dynamically scoped var `gnus-tmp-thread` as was already done with
all other vars.

(gnus-summary-line-format-alist): Use it instead of `thread`.
(gnus-summary-prepare-threads): Bind it around call to (eval
gnus-summary-line-format-spec).
2019-05-17 14:42:36 -04:00
Lars Ingebrigtsen
deb88392c6 Move Info-edit-* commands from info.el to obsolete/info-edit.el
* lisp/info.el: Move Info-edit-* commands to obsolete/info-edit.el.

* lisp/obsolete/info-edit.el: New file.
2019-05-17 13:55:43 +02:00
Lars Ingebrigtsen
81ce8d9d11 Use cl-assert instead of assert in ps-print.el
* lisp/ps-print.el (ps-begin-job): Use cl-assert instead of assert
and require cl-lib.
2019-05-17 12:27:26 +02:00
Lars Ingebrigtsen
004ef8a8e1 (ps-begin-job): Remove two unneeded string-as-unibyte calls
* lisp/ps-print.el (ps-begin-job): Remove two unneeded
string-as-unibyte calls to avoid byte compilation warnings.
2019-05-17 12:16:31 +02:00
Eli Zaretskii
53e18401e5 Fix a recent commit in select.el
* lisp/select.el (gui-get-selection): Revert a recent
incorrect change.  Add a comment explaining what we are trying
to do with C_STRING and why.
(xselect--encode-string): Add a comment explaining what we are
trying to do with C_STRING and why.
2019-05-17 11:01:20 +03:00
Lars Ingebrigtsen
e0ea878a89 Remove obsolete example functions from imenu.el
* lisp/imenu.el (imenu-example--create-c-index)
(imenu-example--function-name-regexp-c)
(imenu-example--create-lisp-index)
(imenu-example--lisp-extract-index-name): Remove functions (and
internal variables used by those functions) declared obsolete in
Emacs 23.2.  The functions gave compilation warnings.
2019-05-17 06:53:58 +02:00
Lars Ingebrigtsen
670c5126a0 Remove unused internal function completion-pcm--optimize-pattern
* lisp/minibuffer.el (completion-pcm--optimize-pattern): Remove
unused internal function (that signalled a compilation warning).
2019-05-17 06:21:43 +02:00
Stefan Monnier
a93e672e27 * lisp/gnus: Remove assumptions about mail-header being a vector
Use `mail-header-p` and `make-full-mail-header` instead of `vectorp` and
`vector`, respectively.

* lisp/gnus/message.el (message-cite-original-1, message-reply)
(message-followup):
* lisp/gnus/gnus-sum.el (gnus-get-newsgroup-headers):
Use make-full-mail-header instead of `vector`.
(gnus--dummy-mail-header): New const, using make-full-mail-header.
(gnus-update-summary-mark-positions): Use it instead of
an immediate vector.
(gnus-set-mode-line, gnus-summary-article-pseudo-p)
(gnus-summary-article-subject, gnus-summary-insert-subject)
(gnus-summary-find-subject, gnus-summary-goto-subject)
(gnus-summary-limit-to-age, gnus-summary-find-matching)
(gnus-summary-mark-article-as-unread, gnus-summary-mark-article)
(gnus-summary-save-article):
* lisp/gnus/gnus.el (gnus-news-group-p): Use mail-header-p instead
of vectorp.
2019-05-17 00:09:16 -04:00
Lars Ingebrigtsen
9843e7b6b1 Declare fileloop-continue in dired-aux to avoid warning
* lisp/dired-aux.el (fileloop-continue): Declare to avoid
compilation warning.  `fileloop-initialize-search' (used before
-continue) will load fileloop.el.
2019-05-17 06:07:00 +02:00
Lars Ingebrigtsen
6a2968b9e7 Avoind string-as-multibyte in ps-output-string-prim
* lisp/ps-print.el (ps-output-string-prim): Avoid
`string-as-multibyte', and encode as utf-8 instead if multibyte.
2019-05-17 06:00:22 +02:00
Lars Ingebrigtsen
ab263a7980 (gui-get-selection): Avoid using `string-to-multibyte'
* lisp/select.el (gui-get-selection): Avoid using
`string-to-multibyte' -- instead encode as `eight-bit' if the
string is unibyte.
2019-05-17 05:42:12 +02:00
Lars Ingebrigtsen
54f5d678dc Declare two w32 functions to avoid byte compilation warnings
* lisp/w32-fns.el (w32-version, w32-read-registry): Declare these
functions to avoid byte compilation warnings.  The functions
should be loaded when `w32--os-description' is called, as far as I
can tell.
2019-05-17 05:18:12 +02:00
Lars Ingebrigtsen
92b1edb1f8 Remove obsolete epg functions
* lisp/epg.el (epg-start-sign-keys, epg-sign-keys): Remove
functions declared obsolete since Emacs 23.1.
2019-05-17 04:47:31 +02:00
Lars Ingebrigtsen
cad2bbbe25 Declare rectangle functions in mouse.el to avoid warnings
* lisp/mouse.el (rectangle-dimensions)
(rectangle-position-as-coordinates, rectangle-intersect-p):
Declare these functions from rect.el to avoid compilation warnings.
2019-05-17 04:23:20 +02:00
Stefan Monnier
2e8f6ad287 * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Fix docstring of accessors. 2019-05-16 22:00:57 -04:00
Stefan Monnier
5f6c08ef2c * lisp/gnus/nnheader.el (mail-header-*): Define via cl-defstruct
This also has the side effect that the accessors are now defined as proper
functions rather than as macros, so they can be passed to `mapcar` etc..

* lisp/gnus/nnheader.el (mail-header-number, mail-header-subject)
(mail-header-from, mail-header-date, mail-header-id)
(mail-header-references, mail-header-chars, mail-header-lines)
(mail-header-xref, mail-header-extra): Define via cl-defstruct.
(mail-header-set-number, mail-header-set-subject)
(mail-header-set-from, mail-header-set-date, mail-header-set-id)
(mail-header-set-message-id, mail-header-set-references)
(mail-header-set-chars, mail-header-set-lines, mail-header-set-xref)
(mail-header-set-extra): Remove, use `setf` instead.  All callers adjusted.

* lisp/gnus/gnus-sum.el (gnus-select-newsgroup)
(gnus-summary-pop-limit, gnus-summary-limit-mark-excluded-as-read)
(gnus-summary-find-matching, gnus-find-matching-articles):
* lisp/gnus/gnus-kill.el (gnus-apply-kill-file-internal, gnus-execute):
* lisp/gnus/gnus-score.el (gnus-score-adaptive):
Eta-reduce, now that mail-header-FIELD are functions.
2019-05-16 21:50:16 -04:00
Katsumi Yamaoka
ca3c59146b Fix ffap behavior in the Gnus group buffer (bug#35693)
* lisp/ffap.el (ffap-file-exists-string, ffap-file-at-point):
Don't recognize "" as a path or a file name (bug#35693).
2019-05-17 01:34:47 +00:00
Stefan Monnier
802dcafb5e * mule.el (set-buffer-file-coding-system): Don't burp on iso-2022-7bit 2019-05-16 20:49:06 -04:00
Paul Pogonyshev
8d3fff6bd6 Make `package' not "uninhibit" messages (Bug#34037)
* lisp/emacs-lisp/package.el: Don't let-bind inhibit-message to a
different value if it was non-nil.
2019-05-16 20:08:27 -04:00
Basil L. Contovounesios
9408e36b84 Fix gnus-summary-expand-window placement of point
* lisp/gnus/gnus-win.el (gnus-configure-frame): Replace
switch-to-buffer with pop-to-buffer-same-window to avoid messing
with point. (bug#35613)
2019-05-17 00:55:58 +01:00
Basil L. Contovounesios
b2c0eb63dd Add docstring to project--read-file-cpd-relative
For discussion, see thread starting at:
https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00460.html
* lisp/progmodes/project.el (project--read-file-cpd-relative):
Describe arglist as promised by user option
project-read-file-name-function.
2019-05-16 23:26:27 +01:00
Eric Abrahamsen
c89b0add51 Fix stray call to make-vector
* lisp/gnus/gnus-agent.el (gnus-agent-fetch-group-1): This is meant to
  be a hash table.
2019-05-16 12:47:18 -07:00
Stefan Monnier
37c41c6ef0 * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand) <setq>: Rewrite
The previous code had 2 problems:
- It converted `setq` to `setf` in unrelated cases such as
  (cl-symbol-macrolet ((x 1)) (setq (car foo) bar))
- It macroexpanded places before `setf` had a chance to see if they
  have a gv-expander.
2019-05-16 15:29:36 -04:00
Lars Ingebrigtsen
bc0adf112d Make shr-rescale-image respect get-buffer-window again
* lisp/net/shr.el (shr-rescale-image): Partially revert previous
change -- ressurrect the check for `get-buffer-window'.
2019-05-16 13:38:11 +02:00
Ivan Shmakov
63a71535a8 Improve user convenience of the rcirc debug buffer
* lisp/net/rcirc.el (rcirc-debug): Ignore rcirc-debug-buffer read-only
status.  Restore point after insertion unless it was at the end.
Ensure a newline before each [lead].  Replace %Y-%m-%d with the
equivalent %F in format-time-string; remove useless concat.  (Bug#32470)
2019-05-16 06:54:54 -04:00
Noam Postavsky
04e9938350 Accept NO-PROPERTIES in thing-at-point aliases (Bug#35491)
* lisp/thingatpt.el (word-at-point, sentence-at-point): Accept and
pass NO-PROPERTIES to thing-at-point.
* etc/NEWS: Announce change.
2019-05-16 06:53:05 -04:00
Michael Albinus
88cc910abe * lisp/net/tramp.el (tramp-yesno-prompt-regexp): Extend. 2019-05-16 08:36:33 +02:00
Stefan Monnier
9a74e5666b * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Fix typo
* test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax):
New corresponding test.
2019-05-15 22:21:36 -04:00
Noam Postavsky
e7e92dc5d2 Fix merge of sgml-syntax-propertize-rules
During the merge of emacs-26, the sgml-syntax-propertize-rules part of
2019-01-17 "* lisp/textmodes/sgml-mode.el: Try and fix bug#33887." got
lost in the conflict against 2019-05-09 "Recognize single quote
attribute values in nxml and sgml (Bug#35381)".
* lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Reapply
the 2019-01-17 change to speed up sgml-syntax-propertize-rules, taking
into account the 2019-05-09 which means we have to handle single
quotes as well.
2019-05-15 19:04:14 -04:00
Anders Lindgren
520aca2d89 Fix diff-mode face problem when used in terminals (Bug#35695)
In a terminal supporting 256 colors, both diff-added and diff-removed
was mapped to the same greyish color.

* lisp/vc/diff-mode.el: Modify the colors of diff-removed,
  diff-added, diff-refine-removed, and diff-refine-added when
  used in a 256 color environment.
2019-05-15 21:00:49 +02:00
Stefan Monnier
c3e8381668 * lisp/gnus/gnus-sum.el: Use lexical-binding
(gnus-summary-make-menu-bar, gnus-summary-display-make-predicate)
(gnus-summary-refer-thread, gnus-summary-find-matching)
(gnus-summary-edit-article, gnus-summary-sort):
Replace backquoted lambda with closure.
(gnus-summary-article-header): Use define-inline rather than defmacro,
so it's also a function.
(gnus-save-hidden-threads, gnus-summary-iterate, gnus-with-article):
Use `declare`.
(gnus-thread-sort-by-random): Simplify.
(gnus-summary-display-article, gnus-summary-limit-to-address):
Hoist common code outside of `if`.
2019-05-15 13:53:13 -04:00
Stefan Monnier
32b01c02b4 * lisp/mail/footnote.el (footnote-prefix): Docstring typo. 2019-05-15 13:01:09 -04:00
Mattias Engdegård
26f735ff19 Add standard unmatchable regexp
Add `regexp-unmatchable' as a standard unmatchable regexp, defined as
"\\`a\\`".  Use it where such a regexp is needed, replacing slower
expressions in several places.
From a suggestion by Philippe Schnoebelen.

* lisp/subr.el (regexp-unmatchable): New defconst.
* etc/NEWS (Lisp Changes): Mention `regexp-unmatchable'.
* doc/lispref/searching.texi (Regexp Functions): Document it.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt)
* lisp/progmodes/cc-defs.el (cc-conditional-require-after-load)
(c-make-keywords-re)
* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1)
(c-forward-<>-arglist-recur, c-forward-decl-or-cast-1)
(c-looking-at-decl-block)
* lisp/progmodes/cc-fonts.el (c-doc-line-join-re)
(c-doc-bright-comment-start-re)
* lisp/progmodes/cc-langs.el (c-populate-syntax-table)
(c-assignment-op-regexp)
(c-block-comment-ender-regexp, c-font-lock-comment-end-skip)
(c-block-comment-start-regexp, c-line-comment-start-regexp)
(c-doc-comment-start-regexp, c-decl-start-colon-kwd-re)
(c-type-decl-prefix-key, c-type-decl-operator-prefix-key)
(c-pre-id-bracelist-key, c-enum-clause-introduction-re)
(c-nonlabel-token-2-key)
* lisp/progmodes/cc-mode.el (c-doc-fl-decl-start, c-doc-fl-decl-end)
* lisp/progmodes/cc-vars.el (c-noise-macro-with-parens-name-re)
(c-noise-macro-name-re, c-make-noise-macro-regexps)
* lisp/progmodes/octave.el (octave-help-mode)
* lisp/vc/vc-bzr.el (vc-bzr-log-view-mode, vc-bzr-revision-completion-table)
* lisp/vc/vc-git.el (vc-git-log-view-mode)
* lisp/vc/vc-hg.el (vc-hg-log-view-mode)
* lisp/vc/vc-mtn.el (vc-mtn-log-view-mode):
Use `regexp-unmatchable'.
* lisp/textmodes/ispell.el (ispell-non-empty-string):
Use `regexp-unmatchable', fixing a broken never-match regexp.
2019-05-15 18:55:27 +02:00
John Shahid
d0ebc389eb Avoid infinitly looping in tramp-interrupt-process (bug#35506)
* lisp/net/tramp.el (tramp-interrupt-process): Remove with-timeout.
Instead pass a timeout to tramp-accept-process-output.
tramp-accept-process-output stops timers from running which makes the
with-timeout ineffective.
2019-05-15 16:29:58 +02:00