1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00
Commit Graph

69635 Commits

Author SHA1 Message Date
João Távora
042b3cfbd2 Fix two Flymake bugs
* lisp/progmodes/flymake.el (define-fringe-bitmap): Protect
against --without-x.
(flymake--mode-line-format): Ensure mode-line's mouse-4 and mouse-5 work
in their own windows.
2017-10-10 13:08:41 +01:00
João Távora
3dfa2ca4dc Don't log "emergencies" in the Flymake legacy backend
* lisp/progmodes/flymake-proc.el (flymake-proc--panic)
(flymake-proc-legacy-flymake): Don't log "emergencies"
2017-10-10 13:08:41 +01:00
João Távora
1c2e188440 Add full documentation on new Flymake API
Also, as a minor addition to this API, set flymake-text
on the diagnostic overlay.  This enables a good example in
the section "Customization Flymake annotations".

* doc/misc/flymake.texi (Overview of Flymake)
(Syntax check statuses): Rework.
(Backend exceptions): Rename from "Troubleshooting"
(Customizable variables): Add flymake-start-on-flymake-mode. Rework.
(Extending Flymake): Write chapter.
(Customizing Flymake annotations, Flymake backends)
(Flymake utility functions, An annotated example backend):
New sections and subsections

* lisp/progmodes/flymake.el (flymake-diagnostic-functions)
(flymake-diagnostic-types-alist): Rework docstring.
(flymake--highlight-line): Set and use flymake-text property in overlay.
(flymake-goto-next-error, flymake-goto-prev-error): Fix funny quotes.
2017-10-10 13:08:41 +01:00
João Távora
0f7f677f82 Fix some Flymake docstrings and messages
* lisp/progmodes/flymake.el
(flymake-start-on-flymake-mode): fix typo.
(flymake-mode): Add docstring.
(flymake-mode-line-format): Fix help-echo indications. mouse-2
describes flymake-mode.
2017-10-10 13:08:41 +01:00
João Távora
21e7075781 Make three new Flymake commands for debugging common problems
* lisp/progmodes/flymake.el (flymake-running-backends)
(flymake-disabled-backends)
(flymake-reporting-backends): Make interactive.
(flymake--collect): Take optional arg.
2017-10-10 13:08:41 +01:00
Paul Eggert
5d51403ceb ; Typo fixes, mostly repeated words 2017-10-09 22:55:06 -07:00
Paul Eggert
0d004ed01a ; Spelling fixes 2017-10-09 22:55:05 -07:00
Stefan Monnier
6c2b1e89ef * lisp/gnus/message.el: Improve last commit
(message-clone-locals): Don't mistakenly match other variables whose
name happens to include "message-default-charset".
2017-10-09 12:33:07 -04:00
Ken Olum
7ed7360855 Fix problems when editing raw undecoded message (Bug#28671)
* lisp/mail/rmailedit.el (rmail-cease-edit): If rmail-old-mime-state
is set, meaning that we are editing the raw message, do not
encode it again.  Delete old body after, not before, inserting
new, to avoid moving marker at beginning of next message.
2017-10-09 16:54:00 +03:00
Eli Zaretskii
aca5f0072b Avoid encoding errors in message.el
* lisp/gnus/message.el (message-clone-locals): Don't clone
message-default-charset.  (Bug#25645)
2017-10-09 16:46:23 +03:00
Eli Zaretskii
0c36663db5 Improve doc string and prompt of 'grep-read-files'
* lisp/progmodes/grep.el (grep-read-files): Clarify in the doc
string and in the prompt that shell wildcards can be used.
Suggested by Allen Li <vianchielfaura@gmail.com>.  (Bug#28615)
2017-10-09 16:39:25 +03:00
Glenn Morris
5b81f65ad0 ; * lisp/emacs-lisp/rmc.el: Minor fix for copyright and license. 2017-10-09 07:44:37 -04:00
João Távora
11b37b4a9f Be lazy when starting Flymake checks
Don't start the check immediately if the buffer is not being
displayed.  Wait until it is, using window-configuration-change-hook.

This enables the user to batch-enable flymake-mode on many buffers and
not have that operation exhaust system resources for checking each
one.  Likewise, an editing or save operation in a currently
non-displayed buffer does not immediately start a check.

* lisp/progmodes/flymake.el (flymake-start-on-flymake-mode):
Rename from flymake-start-syntax-check-on-find-file.
(flymake-start-syntax-check-on-find-file): Obsolete alias for
flymake-start-on-flymake-mode.
(flymake-start): Redesign.  Affect the global post-command-hook
and local window-configuraiton-change-hook.
(flymake--schedule-timer-maybe)
(flymake-after-change-function, flymake-after-save-hook): Pass
t to flymake-start.

* test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture)
(dummy-backends, recurrent-backend): Start flymake check
explicitly and immediately.
2017-10-09 11:12:57 +01:00
Eli Zaretskii
36ed9a9ede Fix last change in frameset.el
* lisp/frameset.el (frameset-filter-font-param): Fix a thinko in
filtering the 'font' parameter.  (Bug#17352)
2017-10-09 10:40:37 +03:00
Alexander Gramiak
e2150d994a Add line-number faces to the display-line-numbers group
See https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00151.html
and its resulting thread.

* lisp/display-line-numbers.el (display-line-numbers): Add to the
convenience group.
* lisp/faces.el (line-number):
(line-number-current-line): Add to the display-line-numbers group.
2017-10-08 17:53:38 -06:00
Alexander Gramiak
89b0023044 Increase xterm click count only within double-click-fuzz
* lisp/xt-mouse.el (xterm-mouse-event): Save the last click's position
and check it against the current click's position.  (Bug#28658)
2017-10-08 17:20:46 -06:00
Alan Third
745aea2296 Change pause in fullscreen toggling for NS port (bug#28496)
* lisp/frame.el (toggle-frame-fullscreen): Replace sit-for with
sleep-for, and reduce time.
2017-10-08 19:26:34 +01:00
Michael Albinus
1cd334cd47 Handle PARENTS properly in tramp-*-handle-make-directory
* lisp/net/tramp-adb.el (tramp-adb-handle-make-directory):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-make-directory):
Handle PARENTS properly.

* test/lisp/net/tramp-tests.el (tramp-test13-make-directory):
Extend test.
2017-10-08 13:55:20 +02:00
K. Handa
a9b72976de Merge branch 'emacs-26' of git.sv.gnu.org:/srv/git/emacs into emacs-26 2017-10-08 11:56:06 +09:00
K. Handa
64baaff8c5 New option for handling ZWNJ in Arabic text rendering
Provide a new option 'arabic-shaper-ZWNJ-handling' that controls how
to display ZWNJ in Arabic text rendering (Bug#28339).
* lisp/language/misc-lang.el: Register arabic-shape-gstring in
composition-function-table.
(arabic-shaper-ZWNJ-handling): New variable.
(arabic-shape-log): New variable.
(arabic-shape-gstring): New function.
* lisp/composite.el (lgstring-remove-glyph): New function.
2017-10-08 11:48:01 +09:00
Noam Postavsky
c194fb61c6 Make python prettify symbols into a defvar (Bug#28713)
* lisp/progmodes/python.el (python-prettify-symbols-alist): New
variable.
(python--prettify-symbols-alist): Make into obsolete alias for
`python-prettify-symbols-alist'.
2017-10-07 19:19:05 -04:00
Alan Third
6dfc778d54 Fix fullscreen crash on macOS (bug#28496)
* lisp/frame.el (toggle-frame-fullscreen): Wait for animation to
complete on macOS.
2017-10-07 21:57:16 +01:00
Michael Albinus
bc80da5bd3 Support gio tool in Tramp
"gvfs-<command>" utilities have been deprecated in GVFS 1.31.1.  We
must use "gio <command>" tool instead.

* lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping): New defconst.
(tramp-gvfs-handle-file-notify-add-watch): Support also "gio monitor"
(tramp-gvfs-gio-tool-p): New defun.
(tramp-gvfs-send-command): Use it.  Call gio tool if available.
2017-10-07 20:17:32 +02:00
João Távora
349e0eb5ff Fix flymake-goto-next-error when message has %-constructs
* lisp/progmodes/flymake.el (flymake-goto-next-error): Fix
message call.  Add missing period in docstring.
2017-10-07 16:57:33 +01:00
Gemini Lasswell
238fbcb20e Create new Edebug spec for docstrings and use it in closures
Since (:documentation FORM) can be used to create a docstring
when lexical-binding is on, allow for that possibility in Edebug
specs (bug#24773).
* lisp/emacs-lisp/edebug.el: Define an Edebug spec for docstrings
called lambda-doc and modify the Edebug specs for defun and
defmacro to use it.
(edebug-instrument-function): Check for generic functions first,
to fix bug where edebug-step-in didn't work on methods now that
cl-defgeneric has an Edebug spec.
* lisp/subr.el (lambda): Modify Edebug spec to use lambda-doc.
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Add Edebug spec
(bug#27747).
(cl-defmethod): Use lambda-doc in Edebug spec.
* lisp/emacs-lisp/cl-macs.el: Modify Edebug spec for
cl-declarations-or-string to use lambda-doc, and modify Edebug
spec for cl-lambda-expr to use cl-declarations-or-string.
* lisp/emacs-lisp/pcase.el (pcase-lambda): Modify Edebug spec to
use lambda-doc, as well as &define and def-body which are
necessary for using Edebug on code wrapped by lambda.
* lisp/emacs-lisp/generator.el (iter-defun, iter-lambda): Add
Edebug specs.
2017-10-06 11:31:12 -07:00
Eli Zaretskii
2d58d51329 Avoid byte-compilation warnings in message.el
* lisp/gnus/message.el: Require 'subr-x' when compiling, to
avoid compiler warnings.
2017-10-06 20:49:39 +03:00
João Távora
fa92f0c447 Cleanup emacs-lisp-mode's use of Flymake
* lisp/progmodes/elisp-mode.el (elisp-flymake--checkdoc-1):
Delete.
(elisp-flymake-checkdoc): Incorporate old
elisp-flymake--checkdoc-1.
(elisp-flymake--byte-compile-done): Simplify.  Don't cleanup
here.
(elisp-flymake-byte-compile): Remove spurious interactive spec.
Simplify.  Cleanup on every possible exit.
2017-10-06 18:12:58 +01:00
Mark Oteiza
295457ae52 Move read-multiple-choice to its own library
* lisp/emacs-lisp/rmc.el: New file.
* lisp/emacs-lisp/subr-x.el (read-multiple-choice): Remove.
* lisp/gnus/message.el:
* lisp/net/nsm.el: Change required library.
2017-10-06 10:42:06 -04:00
Lele Gaifax
9655937da4 Fix typos in Flymake documentation
* doc/misc/flymake.texi (Syntax check statuses)
(Adding support for a new syntax check tool)
(Implementation overview, Locating the buildfile): Fix typos.

* lisp/progmodes/flymake-proc.el (flymake-proc--report-fn)
(flymake-proc--find-possible-master-files):Fix typos.
(flymake-proc--panic)
(flymake-proc-legacy-flymake): Fix function reference in doc.

* lisp/progmodes/flymake.el (flymake-error)
(flymake-diagnostic-functions): Fix typos.
(flymake-diagnostic-types-alist): Rephrase and fix typos.
(flymake--backend-state): Fix typos and rephrase.
(flymake--handle-report): Delete empty line.
(flymake--disable-backend)
(flymake--run-backend): Fix typos.
(flymake-goto-next-error, flymake-goto-prev-error): Rephrase.
2017-10-06 14:09:49 +01:00
Eli Zaretskii
e5bff696bc Revert last change in 'shr-descend'
* lisp/net/shr.el (shr-descend): Revert the part of the last
change which introduced calls to shr-indirect-call into this
function.  Add a comment explaining the rationale for that.
(Bug#28402)
2017-10-06 15:42:22 +03:00
João Távora
6b88f78aa1 Don't error when turning on Flymake with no known backends
Leave it to the mode line indicator to inform the user that there
is still some configuration to do.

* lisp/progmodes/flymake.el (flymake-mode): Simplify.
2017-10-06 00:07:53 +01:00
João Távora
03eab7a05e Delete a Flymake obsolete alias that can't possibly work
The function `flymake-ler-make-ler' can't possibly work as an backward
compatible interface to existing extensinos (even purely hypothetical
ones, since none are known).  This is because every diagnostic
considered by Flymake has to passed to a report-fn function.

* lisp/progmodes/flymake.el (flymake-ler-make-ler): Delete.
2017-10-06 00:07:03 +01:00
Gemini Lasswell
9a10c8713b Fix dynamic binding wrapper in iter-lambda (bug#25965)
* lisp/emacs-lisp/generator.el (cps--make-dynamic-binding-wrapper):
Remove extra evaluation of form.
* test/lisp/emacs-lisp/generator-tests.el
(cps-iter-lambda-with-dynamic-binding): New test.
2017-10-05 12:43:15 -07:00
Rasmus
2a32ee1fbc Update Org to v9.1.2
Please note this is a bugfix release.  See etc/ORG-NEWS for details.
2017-10-05 21:30:05 +02:00
Alan Mackenzie
57ab49f7da Fix irregularities with CC Mode fontification, particularly with "known types"
* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Introduce a new
optional parameter, template-class.  In "class <X = Y>", fontify "Y" as a
type.
(c-font-lock-single-decl): New variable template-class, set to non-nil when we
have a construct like the above.  Pass this as argument to
c-font-lock-declarators.
(c-font-lock-cut-off-declarators): Check more rigorously that a declaration
being processed starts before the function's starting position.
(c-complex-decl-matchers): Remove the redundant clause which fontified "types
preceded by, e.g., "struct"".

* lisp/progmodes/cc-langs.el (c-template-typename-kwds)
(c-template-typename-key): New lang defconsts and defvar.
2017-10-05 17:16:10 +00:00
Eli Zaretskii
bd5326f879 Fix breakage due to recent change in tabulated-list-print-entry
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-printer):
Update the doc string.
(tabulated-list-print-entry): Revert to using only 2 arguments.
Update the doc string.
(tabulated-list-entry-lnum-width): New defvar.
(tabulated-list-print): Compute the width of line-number display
once, then store that value in tabulated-list-entry-lnum-width,
for tabulated-list-printer to use.  (Bug#28704)
2017-10-05 17:57:58 +03:00
Gemini Lasswell
0c8f4e5ea1 * lisp/ses.el (ses-print-cell): Fix alignment of text cells. (Bug#27653) 2017-10-05 16:49:34 +03:00
Alexander Gramiak
c625fb645a Set xterm click count to 1 even with no last click
* lisp/xt-mouse.el (xterm-mouse-event): Move the check for
the last click so that click-count is initialized properly.
Handle the value of t for double-click-time.
(Bug#28658)
2017-10-05 13:50:02 +03:00
Vasilij Schneidermann
e3f4b71c9d Support indirection for all shr-tag-* calls
The 'shr-external-rendering-functions' variable was previously only
honored in the shr-descend function, now all direct calls to the
shr-tag-* functions have been replaced by a call to
'shr-indirect-call' which tries using an alternative rendering
function first.

* lisp/net/shr.el (shr-indirect-call): New helper function.
(shr-descend, shr-tag-object, shr-tag-video):
(shr-collect-extra-strings-in-table): Fix callers to call via
shr-indirect-call.  (Bug#28402)
2017-10-05 13:00:13 +03:00
Eli Zaretskii
3c4ff63bea Speed up list-packages when 'visual' line numbers are displayed
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-printer):
Update the doc string.
(tabulated-list-print-entry): Accept an additional optional
argument INDENT.  Update the doc string.
(tabulated-list-print): Compute the width of line-number display
once, then call tabulated-list-printer with that value as 3rd
argument.  (Bug#28704)
2017-10-05 12:41:36 +03:00
João Távora
7a1133f1ff Misc. minor adjustments to Flymake
- Add a half-decent minor-mode menu;
- Fix "waiting for backends" mode line message;
- Adjust the flymake-diag-region API;
- Autoload the flymake-log macro;
- Auto-disable the legacy backend in more situations;
- Fix a couple of warnings in legacy backend.

* lisp/progmodes/flymake-proc.el
(flymake-proc--diagnostics-for-pattern): Use new
flymake-diag-region.

* lisp/progmodes/flymake-proc.el
(flymake-proc-legacy-flymake): Do error when no
buffer-file-name or not writable.
(flymake-proc-legacy-flymake)
(flymake-proc-simple-cleanup): Don't reference flymake-last-change-time

* lisp/progmodes/flymake.el (flymake-diag-region):
Autoload.  Take buffer as first argument.

* lisp/progmodes/flymake.el (flymake-switch-to-log-buffer):
New command.
(flymake-menu): Add a simple menu.
(flymake--mode-line-format): Use menu.  Fix message.  Switch to
log buffer when clicking exceptional warnings.
2017-10-05 03:09:12 +01:00
Alan Mackenzie
4e0b67ed27 Fontify untyped function declarations in C Mode correctly.
Also correct two bugs where deleting WS at a BOL could leave an untyped
function declaration unfontified.

* lisp/progmodes/cc-engine.el (c-find-decl-spots): Don't set the flag
"top-level" when we're in a macro.
(c-forward-decl-or-cast-1): Recognize top-level "foo(bar)" or "foo()" in C
Mode as a implicitly typed function declaration.
(c-just-after-func-arglist-p): Don't get confused by "defined (foo)" inside a
macro.  It's not a function plus arglist.

* lisp/progmodes/cc-langs.el (c-cpp-expr-functions-key): New defconst and
defvar.

* lisp/progmodes/cc-mode.el (c-fl-decl-end): After c-forward-declarator, move
over any following parenthesis expression (i.e. parameter list).
(c-change-expand-fl-region): When c-new-END is at a BOL, include that line in
the returned region, to cope with deletions at column 0.
2017-10-04 17:34:27 +00:00
Michael Albinus
0b558b4acb * lisp/net/tramp.el (tramp-tramp-file-p): Use `string-match-p'.
Reported by Clément Pit-Claudel <cpitclaudel@gmail.com>.
2017-10-04 11:48:37 +02:00
Paul Eggert
fdbaebde08 ; Spelling fixes 2017-10-03 16:05:05 -07:00
Michael Albinus
4ac5ac50c9 Merge branch 'emacs-26' of git.sv.gnu.org:/srv/git/emacs into emacs-26 2017-10-03 16:08:04 +02:00
Michael Albinus
a9ac20c179 Add support for `file-system-info' in Tramp
* lisp/net/tramp.el (tramp-file-name-for-operation):
Add `file-system-info'.

* lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info): New defun.
(tramp-adb-file-name-handler-alist): Use it.

* lisp/net/tramp-gvfs.el (tramp-gvfs-file-system-attributes)
(tramp-gvfs-file-system-attributes-regexp): New defconst.
(tramp-gvfs-handle-file-system-info): New defun.
(tramp-gvfs-file-name-handler-alist): Use it.
(tramp-gvfs-get-directory-attributes): Fix property name.
(tramp-gvfs-get-root-attributes): Support also file system attributes.

* lisp/net/tramp-sh.el (tramp-sh-handle-file-system-info): New defun.
(tramp-sh-file-name-handler-alist): Use it.
(tramp-sh-handle-insert-directory): Insert size information.
(tramp-get-remote-df): New defun.

* lisp/net/tramp-smb.el (tramp-smb-handle-file-system-info): New defun.
(tramp-smb-file-name-handler-alist): Use it.
(tramp-smb-handle-insert-directory): Insert size information.

* test/lisp/net/tramp-tests.el (tramp-test37-file-system-info):
New test.
(tramp-test38-asynchronous-requests)
(tramp-test39-recursive-load, tramp-test40-remote-load-path)
(tramp-test41-unload): Rename.
2017-10-03 16:07:32 +02:00
João Távora
f964aa9973 Minimal tweak as an attempt to future-proof Flymake API
Discussed with Stefan that this should allow Flymake to request more
from backends in the future, while also allowing backends to report
more accurately.

* lisp/progmodes/elisp-mode.el (elisp-flymake-checkdoc)
(elisp-flymake-byte-compile): Adjust to new API.

* lisp/progmodes/flymake-proc.el ()
(flymake-proc-legacy-flymake): Adjust to new API.

* lisp/progmodes/flymake.el (flymake-diagnostic-functions):
Review API again.
(flymake--handle-report): Allow other keys.  Change ACTION to
REPORT-ACTION.
2017-10-03 14:20:29 +01:00
João Távora
602d9376db Integrate Flymake elisp checkers into elisp-mode.el directly
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Use
elisp-flymake-checkdoc and elisp-flymake-byte-compile.
(elisp-flymake--checkdoc-1, elisp-flymake-checkdoc)
(elisp-flymake--byte-compile-done)
(elisp-flymake--byte-compile-process)
(elisp-flymake-byte-compile): Rename from flymake-elisp
counterparts in deleted flymake-elisp.el
(elisp-flymake--batch-compile-for-flymake): New helper.
(checkdoc-create-error-function)
(checkdoc-autofix-flag)
(checkdoc-generate-compile-warnings-flag)
(checkdoc-diagnostic-buffer): Forward declare.

* lisp/progmodes/flymake-elisp.el: Delete.
2017-10-03 14:20:29 +01:00
João Távora
30ea272fe4 Hook Flymake onto proper checkdoc and byte-compile interfaces
The interfaces in bytecomp.el and checkdoc.el are mostly boilerplate,
with little knowledge of actual internals or thought given to the
usefulness of said interfaces in contexts other than Flymake's.

* lisp/emacs-lisp/bytecomp.el
(byte-compile-log-warning-function): New variable.
(byte-compile-log-warning): Use it.
(byte-compile--log-warning-for-byte-compile): New function.

* lisp/emacs-lisp/checkdoc.el
(checkdoc-create-error-function): New variable.
(checkdoc-create-error): Use it.
(checkdoc--create-error-for-checkdoc): New function.xo

* lisp/progmodes/flymake-elisp.el (flymake-elisp--checkdoc-1):
Use checkdoc-create-error-function.
(flymake-elisp--batch-byte-compile): Use
byte-compile-log-warning-function.
2017-10-03 14:18:55 +01:00
João Távora
2e84179a29 Tweak Flymake autoloads and dependencies
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Add to
flymake-diagnostic-functions here.

* lisp/progmodes/flymake-elisp.el[top]: Don't add to
emacs-lisp-mode-hook.  Don't call flymake-elisp-setup-backends in
every buffer.  (flymake-elisp-checkdoc) (flymake-elisp-byte-compile):
Autoload.  (flymake-elisp-setup-backends): Remove.

* lisp/progmodes/flymake.el: Add some top-level comments.
(flymake-make-diagnostic)
(flymake-mode, flymake-mode-on, flymake-mode-off): Add autoloads

Where to fixup this shit?
2017-10-03 14:18:55 +01:00