João Távora [Tue, 19 Sep 2017 13:25:34 +0000 (14:25 +0100)]
Flymake's flymake-proc.el parses column numbers from gcc/javac errors
Column numbers are not a great way of marking diagnostic regions, but
that's probably all that can be expected from the flymake-proc.el
backend. For now, try (end-of-thing 'sexp) to discover the
diagnostic's end position.
* lisp/progmodes/flymake-proc.el ()
(flymake-proc-err-line-patterns): Also parse column numbers,
if available, for gcc/javac warnings.
João Távora [Thu, 7 Sep 2017 14:13:39 +0000 (15:13 +0100)]
New Flymake variable flymake-diagnostic-types-alist and much cleanup
A new user-visible variable is introduced where different diagnostic
types can be categorized. Flymake backends can also contribute to
this variable. Anything that doesn’t match an existing error type
is considered.
The variable’s alists are used to propertize the overlays pertaining
to each error type. The user can override the built-in properties by
either by modifying the alist, or by modifying the properties of a
special "category" symbol, named by the `flymake-category' entry in
the alist.
The `flymake-category' entry is especially useful for, say, the author
of foo-flymake-backend, who issues diagnostics of type :foo-note, that
should behave like notes, except with no fringe bitmap:
For essential properties like `severity', `priority', etc, a default
value is produced. Some properties like `evaporate' cannot be
overriden.
* lisp/progmodes/flymake.el (flymake--diag): Rename from
flymake-ler.
(flymake-ler-make): Obsolete alias for flymake-diagnostic-make
(flymake-ler-errorp): Rewrite using flymake--severity.
(flymake--place-overlay): Delete.
(flymake--overlays): Now a cl-defun with &key args. Document.
Use `overlays-at' if BEG is non-nil and END is nil.
(flymake--lookup-type-property): New helper.
(flymake--highlight-line): Rewrite.
(flymake-diagnostic-types-alist): New API variable.
(flymake--diag-region)
(flymake--severity, flymake--face)
(flymake--fringe-overlay-spec): New helper.
(flymake-popup-current-error-menu): Use new flymake-overlays.
(flymake-popup-current-error-menu, flymake-report): Use
flymake--diag-errorp.
(flymake--fix-line-numbers): Use flymake--diag-line.
(flymake-goto-next-error): Pass :key to flymake-overlays
* lisp/progmodes/flymake-proc.el
(flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
João Távora [Thu, 7 Sep 2017 13:19:33 +0000 (14:19 +0100)]
Refactor Flymake tests in preparation for more tests
Introduce a slightly more generic fixture macro.
Also make flymake-tests.el friendlier to interactive runs, by not
killing buffers visited by the user.
* test/lisp/progmodes/flymake-tests.el
(flymake-tests--call-with-fixture): New helper from
flymake-tests--current-face. Don't kill file buffers already
being visited before the test starts.
(flymake-tests--with-flymake): New macro.
(flymake-tests--current-face): Delete.
(warning-predicate-rx-gcc, warning-predicate-function-gcc)
(warning-predicate-rx-perl, warning-predicate-function-perl):
Use flymake-test--with-flymake.
João Távora [Sun, 20 Aug 2017 11:19:45 +0000 (12:19 +0100)]
Allow running Flymake tests from interactive sessions
* test/lisp/progmodes/flymake-tests.el (flymake-tests-data-directory):
Expand to reasonable value if no
EMACS_TEST_DIRECTORY. (flymake-tests--current-face): Work around
"weirdness" of bug 17647 with read-event.
João Távora [Wed, 6 Sep 2017 15:03:24 +0000 (16:03 +0100)]
Flymake diagnostics now apply to arbitrary buffer regions
Make Flymake UI some 150 lines lighter
Strip away much of the original implementation's complexity in
manipulating objects representing diagnostics as well as creating and
navigating overlays.
Lay some groundwork for a more flexible approach that allows for
different classes of diagnostics, not necessarily line-based.
Importantly, one overlay per diagnostic is created, whereas the
original implementation had one per line, and on it it concatenated
the results of errors and warnings.
This means that currently, an error and warning on the same line are
problematic and the warning might be overlooked but this will soon be
fixed by setting appropriate priorities.
Since diagnostics can highlight arbitrary regions, not just lines, the
faces were renamed.
Tests pass and backward compatibility with interactive functions is
maintained, but probably any third-party extension or customization
relying on more than a trivial set of flymake.el internals has stopped
working.
* lisp/progmodes/flymake-proc.el
(flymake-proc--diagnostics-for-pattern): Use new flymake-ler-make
constructor syntax.
* test/lisp/progmodes/flymake-tests.el (warning-predicate-rx-gcc)
(warning-predicate-function-gcc, warning-predicate-rx-perl)
(warning-predicate-function-perl): Use face `flymake-warning'.
João Távora [Wed, 23 Aug 2017 22:18:05 +0000 (23:18 +0100)]
Move symbols in flymake-proc.el to separate namespace
Every symbol in this flymake now starts with the prefix flymake-proc-.
Make obsolete aliases for (almost?) every symbol.
Furthermore, many flymake-proc.el symbols are prefixed with
"flymake-proc--", that is they were considered internal.
Some customization variables, interactive functions, and other symbols
considered useful to user customizations or third-party libraries are
considered "public" or "external" and so use a "flymake-proc-" prefix.
* lisp/progmodes/flymake-proc.el: Every symbol renamed.
* test/lisp/progmodes/flymake-tests.el
(flymake-tests--current-face): Use
flymake-proc-warning-predicate, not flymake-warning-predicate.
Instead of parsing and matching regexps line-by-line, insert
subprocess output in a separate buffer and parse using
`search-forward-regexp'. This eventually enables multi-line error
patterns and simplifies code all around. Store per-check information
in the subprocess using `process-get' and `process-put'. Treat error
messages, warnings, etc. more generically as "diagnostics". Create
these objects as soon as possible, reusing existing `flymake-ler'
structure. Fix some whitespace.
* lisp/progmodes/flymake.el (cl-lib): Require also when
loading.
(flymake--fix-line-numbers): Rename from
flymake-fix-line-numbers. Simplify.
(flymake-report): Call flymake--fix-line-numbers. Rearrange
plain diagnostics list into alist format expected by
flymake-highlight-err-lines.
* lisp/progmodes/flymake-proc.el (flymake-process-filter): Insert
process output and parse in dedicated output buffer.
(flymake-proc--diagnostics-for-pattern): New helper function.
(flymake-process-sentinel): Call flymake-post-syntax-check with
collected diagnostics. Kill output buffer.
(flymake-post-syntax-check): Receive diagnostics as third argument.
(flymake-parse-output-and-residual, flymake-new-err-info)
(flymake-parse-residual, flymake-parse-err-lines)
(flymake-split-output, flymake-proc-parse-line)
(flymake-output-residual): Delete.
(flymake-start-syntax-check-process): Use make-process. Setup
dedicated an output buffer
Noam Postavsky [Tue, 3 Oct 2017 02:54:36 +0000 (22:54 -0400)]
Give more helpful messages for python completion setup failures
* lisp/progmodes/python.el (python-shell-completion-native-setup): In
case the completion setup failed with some exception, print out the
exception type and message. If libedit is detected, raise an
exception, since this is known to fail.
Eli Zaretskii [Mon, 2 Oct 2017 18:35:51 +0000 (21:35 +0300)]
Fix the --without-x build
* src/frame.c (Ficonify_frame) [HAVE_WINDOW_SYSTEM]: Use
frame_parent only in GUI builds to avoid compilation errors in
--without-x builds. (Bug#28611)
Paul Eggert [Mon, 2 Oct 2017 16:04:46 +0000 (09:04 -0700)]
Fix customization of zoneinfo-style-world-list
A customizable variable's initial value cannot depend on that of
another customizable variable, since the variables are initialized
in other than textual order. Problem reported by N. Jackson
(Bug#24291).
* lisp/time.el (display-time-world-list): Default to t,
a special value that expands to zoneinfo-style-word-list
if that works, and to legacy-style-word-list otherwise.
(time--display-world-list): New function.
(display-time-world, display-time-world-timer): Use it.
Alan Mackenzie [Mon, 2 Oct 2017 14:42:13 +0000 (14:42 +0000)]
Fix a CC Mode brace stack cache bug.
* lisp/progmodes/cc-engine.el (c-update-brace-stack): Call
c-beginning-of-current-token after a failing search operation, to ensure we
don't cache a point inside a token.
Paul Eggert [Mon, 2 Oct 2017 02:53:56 +0000 (19:53 -0700)]
Prefer HTTPS to HTTP for gnu.org
This fixes some URLs I omitted from my previous pass,
notably those in lists.gnu.org. Although lists.gnu.org
does not yet support TLS 1.1, TLS 1.0 is better than nothing.
* lisp/erc/erc.el (erc-official-location):
* lisp/mail/emacsbug.el (report-emacs-bug):
Use https:, not http:.
Keep eww buffer current when looking up CSS on MDN
* lisp/textmodes/css-mode.el (css-lookup-symbol): Keep the eww buffer
current when looking up CSS documentation on MDN. This fixes a bug
where the eww buffer's content sometimes get mangled when switching
buffers mid-render.
Alan Mackenzie [Sun, 1 Oct 2017 16:08:20 +0000 (16:08 +0000)]
Doc amendment for syntax-ppss.
* doc/elisp/syntax.texi (Position Parse): Note, twice, that syntax-ppss is
equivalent to parse-partial-sexp from the beginning of THE VISIBLE PART OF the
buffer. Final part of the fix for bug #22983.
* etc/NEWS (Changes in Emacs 26.1): Remove an entry about
'find-library' taking a prefix argument to pop to a different
window. This behavior was added in "Allow a prefix argument to
find-library to pop to a different window" (commit e1f2d14a), and
then removed in "New commands: find-library-other-window,
find-library-other-frame" (commit 021430f4).
Alan Mackenzie [Sat, 30 Sep 2017 11:08:16 +0000 (11:08 +0000)]
Amend documentation for text-quoting-style becoming a user option.
* doc/lispref/control.texi (Signaling Errors):
* doc/lispref/display.texi (Displaying Messages):
* doc/lispref/strings.texi (Formatting Strings):
Edit for brevity, farming out the details to the new
Text Quoting Style node.
* doc/lispref/help.texi (Text Quoting Style): New section.
Move detailed discussion of text-quoting-style here.
Add discussion about how to output grave accent and apostrophe in
documentation and messages. Adjust xrefs to point to this section
when appropriate.
* etc/NEWS: text-quoting-style semantics have not changed.
* lisp/cus-start.el: (top level): Amend the entry for text-quoting-style.
* etc/NEWS: Amend the entry for text-quoting-style.
* doc/lispref/control.texi (Signalling Errors)
* doc/lispref/display.texi (Displaying Messages)
* doc/lispref/strings.texi (Formatting Strings): Bind text-quoting-style to
grave rather than nil to inhibit translation of quotes.
* doc/lispref/help.texi (Keys in Documentation): Revert the description of the
proposed new default, t.
Alan Mackenzie [Thu, 21 Sep 2017 20:31:06 +0000 (20:31 +0000)]
Make text-quoting-style customizable. Introduce t and new meaning for nil.
A value of nil for text-quoting-style now means "no translation". t means
"Use curved quotes if displayable".
* src/doc.c (text-quoting-style (function)): modify for new semantics.
(text-quoting-style (variable)): Amend the doc string, set the default value
to t.
* lisp/cus-start.el: (top level): Create a customize entry for
text-quoting-style in group display.
* etc/NEWS: Amend the entry for text-quoting-style.
* doc/emacs/display.texi (Text Display): Describe the translation of ASCII
quotes to curved quotes, and how to influence or inhibit it.
* doc/lispref/help.texi (Keys in Documentation): Change text-quoting-style
from a variable to a user option. Describe its changed set of values. State
that it can be customized freely.
Michael Albinus [Sun, 1 Oct 2017 11:31:39 +0000 (13:31 +0200)]
eshell.texi improvements
* doc/misc/eshell.texi (Built-ins): eshell/sudo is a compiled
Lisp function in `em-tramp.el'. Mention also $*, $1, $2, ...
(Aliases): Add $*, $1, $2, ... to the variable index.
Revert "Don't lose arguments to eshell aliases (Bug#27954)"
It broke the established argument handling methods provided by eshell
aliases (Bug#28568).
* doc/misc/eshell.texi (Aliases): Fix example, call out use of
arguments in aliases.
* lisp/eshell/em-alias.el (eshell-maybe-replace-by-alias): Ignore
ARGS.
Eric Abrahamsen [Sat, 30 Sep 2017 17:57:52 +0000 (10:57 -0700)]
Fix slot typecheck in eieio-persistent
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p):
An `or' form can specify multiple potential classes (or null) as
valid types for a slot, but previously only the final element of the
`or' was actually checked. Now returns all valid classes in the `or'
form.
(eieio-persistent-validate/fix-slot-value): Check if proposed value
matches any of the valid classes.
* test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el
(eieio-test-multiple-class-slot): Test this behavior.
* lisp/vc/vc-hooks.el (vc-prefix-map):
Bind `vc-region-history' to 'C-x v h', which was earlier bound to
`vc-insert-headers' (Bug#27644).
* doc/emacs/maintaining.texi (VC Change Log): Mention the new binding.
* doc/emacs/vc1-xtra.texi (Version Headers): Remove the association of
'C-x v h' with `vc-insert-headers'.
(http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00957.html)
Andy Moreton [Sat, 30 Sep 2017 13:21:39 +0000 (16:21 +0300)]
Avoid assertions in vc-hg.el on MS-Windows
* lisp/vc/vc-hg.el (vc-hg--pcre-to-elisp-re)
(vc-hg--slurp-hgignore, vc-hg--read-repo-requirements)
(vc-hg-state-fast): Use file-name-absolute-p and directory-name-p
instead of relying on Unix file-name syntax. This avoids
assertion violations on MS-Windows.
Eli Zaretskii [Sat, 30 Sep 2017 12:08:47 +0000 (15:08 +0300)]
Improve indexing of multi-file/buffer Isearch commands
* doc/emacs/maintaining.texi (Identifier Search): Change wording
of index entries to make them different from those for multi-file
isearch commands. (Bug#28584)
* doc/emacs/search.texi (Other Repeating Search): Index the
multi-* commands. (Bug#28584) Rearrange the indexing to keep
each index entry close to its subject.
Wait for frame visibility with timeout in w32term too
* src/w32term.c (syms_of_w32term) [x-wait-for-event-timeout]: New
variable.
(x_make_frame_visible): Wait for frame to become visible according to
its value.
(input_signal_count): Remove.
Noam Postavsky [Thu, 31 Aug 2017 03:12:22 +0000 (23:12 -0400)]
Bring back the busy wait after x_make_frame_visible (Bug#25521)
But wait specfically for a MapNotify event, and only for a
configurable amount of time.
* src/xterm.c (syms_of_xterm) [x-wait-for-event-timeout]: New
variable.
(x_wait_for_event): Use it instead of hardcoding the wait to 0.1s.
(x_make_frame_visible): Call x_wait_for_event at the end.
* etc/NEWS: Announce x_wait_for_event.
* test/lisp/textmodes/css-mode-tests.el (css-test-current-defun-name)
(css-test-current-defun-name-nested)
(css-test-current-defun-name-complex): New tests for
`css-current-defun-name'.
João Távora [Wed, 27 Sep 2017 21:35:49 +0000 (22:35 +0100)]
Revert "Split flymake.el into flymake-proc.el and flymake-ui.el"
In other words, re-coalesce the two files,
lisp/progmodes/flymake-proc.el and lisp/progmodes/flymake-ui.el, back
into a single one, lisp/progmodes/flymake.el.
The changesets "Prefer HTTPS to FTP and HTTP in documentation" and
"allow nil init in flymake-allowed-file-name-masks to disable flymake"
are kept in place in the new lisp/progmodes/flymake.el.
Don't merge this back to master as development happening there builds
upon this work. See also
https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00932.html.
Don't merge this back to master as development happening there builds
upon this work. See also
https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00932.html
Paul Eggert [Tue, 26 Sep 2017 23:31:57 +0000 (16:31 -0700)]
Avoid some unnecessary copying in Fformat etc.
This patch is just for performance; it should not affect behavior.
On my platform, it made the microbenchmark (format "%S" load-path)
run about 45% faster. It should also speed up calls like (message
"%s" STRING).
* src/callint.c (Fcall_interactively):
* src/dbusbind.c (XD_OBJECT_TO_STRING):
* src/editfns.c (Fmessage, Fmessage_box):
* src/xdisp.c (vadd_to_log, Ftrace_to_stderr):
Use styled_format instead of Fformat or Fformat_message,
to avoid unnecessary copying.
* src/editfns.c (styled_format): New arg NEW_RESULT.
All uses changed. Reuse an input string if it has the
right value and if !NEW_RESULT.
* src/lisp.h (style_format): New decl.
Use a separate syntax-ppss cache for narrowed buffers
* lisp/emacs-lisp/syntax.el (syntax-ppss-wide):
New variable, to contain the data from `syntax-ppss-last' and
`syntax-ppss-cache'.
(syntax-ppss-cache, syntax-ppss-last): Remove.
(syntax-ppss-narrow, syntax-ppss-narrow-start): New variables.
(syntax-ppss-flush-cache): Flush both caches.
(syntax-ppss--data): Return the appropriate last result and
buffer cache for the current restriction.
(syntax-ppss, syntax-ppss-debug): Use it (bug#22983).
Improve python3-compatibility of fallback completion (Bug#28499)
* lisp/progmodes/python.el (python-eldoc-setup-code): Use
inspect.getfullargspec instead of inspect.getargspec to avoid a
deprecation warning on every usage of eldoc in python-mode.
Noam Postavsky [Wed, 30 Aug 2017 23:42:47 +0000 (19:42 -0400)]
Make sh-indentation into an alias for sh-basic-offset (Bug#21751)
* lisp/progmodes/sh-script.el (sh-indentation): Redefine as obsolete
variable alias for `sh-basic-offset'.
(sh-mode, sh-smie--indent-continuation)
(sh-smie-rc-rules, sh-basic-indent-line): Replace `sh-indentation'
with `sh-basic-offset'.
Noam Postavsky [Wed, 30 Aug 2017 23:31:48 +0000 (19:31 -0400)]
Fix loading of smie-config rules (Bug#24848)
* lisp/emacs-lisp/smie.el (smie-config--setter): Use `set-default'
instead of `setq-default'.
(smie-config): Use `custom-initialize-set' instead of
`custom-initialize-default' as the :initialize argument.
* lisp/progmodes/sh-script.el (sh-learn-buffer-indent): Mention that
we call `smie-config-guess' so that the user will have a chance to
find the correct docstring to consult. Remove hedging comments
regarding use of abnormal hooks.
Mark Oteiza [Mon, 25 Sep 2017 12:45:08 +0000 (08:45 -0400)]
Loosen strict parsing requirement for desktop files
There are other desktop-looking files, for instance those having to do
with MIME typess, that would benefit from being able to be read by this
function. It helps to have some flexibility.
* lisp/xdg.el (xdg-desktop-read-file): Remove an error condition.
* test/lisp/xdg-tests.el: Remove a test.
* lisp/files.el (buffer-offer-save): In addition to nil and t, now
allows a third symbol value, `always'. A buffer where this option is
set to `always' will always be offered for save by
`save-some-buffers'.
(save-some-buffers): Check the exact value of this buffer-local
variable. No longer check the buffer name, or the value of
`write-contents-functions'.
* doc/lispref/buffers.texi (Killing Buffers): Note change in manual.
* doc/lispref/files.texi (Saving Buffers): Remove note about buffer
names.
* etc/NEWS: Mention in NEWS.
Alan Third [Sat, 23 Sep 2017 18:43:58 +0000 (19:43 +0100)]
Fix undecorated frame resizing issues on NS (bug#28512)
* src/nsterm.m (EmacsView::updateFrameSize): Don't wait for the
toolbar on undecorated frames.
(EmacsView::initFrameFromEmacs): Group window flags correctly.