Add filters, useful for backends like the upcoming
flymake-elisp-checkdoc backend, for example, which litters everything
with low-priority notes.
Also re-implement wraparound for flymake-goto-next-error. Manual
mentions this, so it's probably a good idea to keep it. Added a new
customization variable flymake-wrap-around to control it.
* lisp/progmodes/flymake.el (flymake-goto-prev-error)
(flymake-goto-next-error): Accept FILTER argument.
(flymake-wrap-around): New variable.
(flymake-goto-next-error): Wrap around according to flymake-wrap-around.
* test/lisp/progmodes/flymake-tests.el
(different-diagnostic-types, dummy-backends): Pass FILTER to
flymake-goto-prev-error.
(different-diagnostic-types)
(dummy-backends): Use flymake-wrap-around.
João Távora [Mon, 25 Sep 2017 23:45:46 +0000 (00:45 +0100)]
New Flymake API variable flymake-diagnostic-functions
Lay groundwork for multiple active backends in the same buffer.
Backends are lisp functions called when flymake-mode sees fit. They
are responsible for examining the current buffer and telling
flymake.el, via return value, if they can syntax check it.
Backends should return quickly and inexpensively, but they are also
passed a REPORT-FN argument which they may or may not call
asynchronously after performing more expensive work.
REPORT-FN's calling convention stipulates that a backend calls it with
a list of diagnostics as argument, or, alternatively, with a symbol
denoting an exceptional situation, usually some panic resulting from a
misconfigured backend. In keeping with legacy behaviour,
flymake.el's response to a panic is to disable the issuing backend.
The flymake--diag object representing a diagnostic now also keeps
information about its source backend. Among other uses, this allows
flymake to selectively cleanup overlays based on which backend is
updating its diagnostics.
* lisp/progmodes/flymake-proc.el (flymake-proc--report-fn):
New dynamic variable.
(flymake-proc--process): New variable.
(flymake-can-syntax-check-buffer): Remove.
(flymake-proc--process-sentinel): Simplify. Use
unwind-protect. Affect flymake-proc--processes here.
Bind flymake-proc--report-fn.
(flymake-proc--process-filter): Bind flymake-proc--report-fn.
(flymake-proc--post-syntax-check): Delete
(flymake-proc-start-syntax-check): Take mandatory
report-fn. Rewrite. Bind flymake-proc--report-fn.
(flymake-proc--process-sentinel): Rewrite and simplify.
(flymake-proc--panic): New helper.
(flymake-proc--start-syntax-check-process): Record report-fn
in process. Use flymake-proc--panic.
(flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect
flymake-proc--processes here. Record interruption reason.
(flymake-proc--init-find-buildfile-dir)
(flymake-proc--init-create-temp-source-and-master-buffer-copy):
Use flymake-proc--panic.
(flymake-diagnostic-functions): Add
flymake-proc-start-syntax-check.
(flymake-proc-compile): Call
flymake-proc-stop-all-syntax-checks with a reason.
* lisp/progmodes/flymake.el (flymake-backends): Delete.
(flymake-check-was-interrupted): Delete.
(flymake--diag): Add backend slot.
(flymake-delete-own-overlays): Take optional filter arg.
(flymake-diagnostic-functions): New user-visible variable.
(flymake--running-backends, flymake--disabled-backends): New
buffer-local variables.
(flymake-is-running): Now a function, not a variable.
(flymake-mode-line, flymake-mode-line-e-w)
(flymake-mode-line-status): Delete.
(flymake-lighter): flymake's minor-mode "lighter".
(flymake-report): Delete.
(flymake--backend): Delete.
(flymake--can-syntax-check-buffer): Delete.
(flymake--handle-report, flymake--disable-backend)
(flymake--run-backend, flymake--run-backend): New helpers.
(flymake-make-report-fn): Make a lambda.
(flymake--start-syntax-check): Iterate
flymake-diagnostic-functions.
(flymake-mode): Use flymake-lighter. Simplify. Initialize
flymake--running-backends and flymake--disabled-backends.
(flymake-find-file-hook): Simplify.
* test/lisp/progmodes/flymake-tests.el
(flymake-tests--call-with-fixture): Use flymake-is-running the
function. Check if flymake-mode already active before activating it.
Add a thorough test for flymake multiple backends
* lisp/progmodes/flymake.el (flymake--start-syntax-check):
Don't use condition-case-unless-debug, use condition-case
* test/lisp/progmodes/flymake-tests.el
(flymake-tests--assert-set): New helper macro.
(dummy-backends): New test.
João Távora [Sat, 23 Sep 2017 17:15:40 +0000 (18:15 +0100)]
More Flymake cleanup before advancing to backend redesign
Diagnostics are reported for buffers, not necessarily files. It’s the
backend’s responsibility to compute the buffer where the diagnostic is
applicable. For now, this has to match the buffer where flymake-mode
is active and which is at the origin of the backend call.
flymake.el knows nothing about line/column diagnostics (except for
backward-compatible flymake-ler-make-ler, which must yet be tested).
It’s also the backend’s reponsibility to compute a BEG and END
positions for the diagnostic in the relevant buffer.
* lisp/progmodes/flymake-proc.el
(flymake-proc--diagnostics-for-pattern): Convert LINE/COL to
region here. Check file buffer here.
(flymake-proc--process-sentinel): Don’t kill output buffer if
high enough log level.
* lisp/progmodes/flymake.el (flymake-diag-region): Make this a utility
function. (flymake--highlight-line): Diagnostic has region now.
(flymake-popup-current-error-menu): Don’t add file and line numbers to
already this silly menu. (flymake--fix-line-numbers): Remove.
(flymake-report): No need to fix diagnostics here.
João Távora [Fri, 22 Sep 2017 00:31:23 +0000 (01:31 +0100)]
Protect Flymake's eager checks against commands like fill-paragraph
If flymake-start-syntax-check-on-newline is t, check should start as
soon as a newline is seen by after-change-functions. But don't rush
it: since the buffer state might not be final, we might end up with
invalid diagnostic regions after some commands silently insert and
delete newlines (looking at you, fill-paragraph).
* lisp/progmodes/flymake.el (flymake-after-change-function): Pass
`deferred' to flymake--start-syntax-check.
(flymake--start-syntax-check): Take optional `deferred' arg.
João Távora [Thu, 21 Sep 2017 13:44:13 +0000 (14:44 +0100)]
Flymake highlights GCC info/notes as detected by flymake-proc.el
* lisp/progmodes/flymake-proc.el
(flymake-proc--diagnostics-for-pattern): Rewrite (using cl-loop) to
honour more sophisticated flymake-proc-diagnostic-type-pred.
(flymake-warning-re): Is now an obsolete alias for
flymake-proc-diagnostic-type-pred.
(flymake-proc-diagnostic-type-pred): Rename and augment from
flymake-proc-warning-predicate. (flymake-proc-warning-predicate):
Delete.
* lisp/progmodes/flymake.el (flymake-note): New face.
(flymake-diagnostic-types-alist): Simplify.
(flymake-note): New overlay category.
(flymake--lookup-type-property): Only lookup single keys, not lists.
(flymake--diag-errorp): Rewrite.
(flymake--highlight-line): Use flymake--lookup-type-property.
* test/lisp/progmodes/flymake-tests.el
(different-diagnostic-types): Rename from errors-and-warnings.
Check notes.
(flymake-tests--call-with-fixture): Use
flymake-proc-diagnostic-type-pred.
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.