João Távora [Sun, 5 Nov 2017 14:58:07 +0000 (14:58 +0000)]
Fix Flymake help-echo functions across windows (bug#29142)
* lisp/progmodes/flymake.el (flymake--highlight-line): Use
with-selected-window.
(flymake-goto-next-error): Call help-echo with a window and an
overlay.
João Távora [Fri, 3 Nov 2017 16:05:39 +0000 (16:05 +0000)]
Add a Flymake backend for Perl
Define a simple backend in perl-mode.el, which cperl-mode.el also
uses.
* lisp/progmodes/cperl-mode.el (cperl-mode): Add to
flymake-diagnostic-functions.
* lisp/progmodes/flymake-proc.el
(flymake-proc-allowed-file-name-masks): Disable legacy backend
for perl files.
* lisp/progmodes/perl-mode.el (perl-flymake-command): New
defcustom.
(perl--flymake-proc): New buffer-local variable.
(perl-flymake): New function.
(perl-mode): Add to flymake-diagnostic-functions.
João Távora [Fri, 3 Nov 2017 12:43:11 +0000 (12:43 +0000)]
Add a Flymake backend for Ruby
* lisp/progmodes/ruby-mode.el (ruby-flymake-command): New
defcustom.
(ruby--flymake-proc): New buffer-local variable.
(ruby-flymake): New function.
(ruby-mode): Add flymake-diagnostic-functions.
Lele Gaifax [Fri, 3 Nov 2017 12:20:36 +0000 (12:20 +0000)]
Add a Flymake backend for Python (bug#28808)
Implement new Flymake backend with related customizable settings.
* lisp/progmodes/python.el (python-flymake-command)
(python-flymake-command-output-pattern)
(python-flymake-msg-alist): New defcustom.
(python--flymake-parse-output): New function, able to parse
python-flymake-command output accordingly to
python-flymake-command-output-pattern.
(python-flymake): New function implementing the backend
interface using python--flymake-parse-output for the real
work.
(python-mode): Add python-flymake to flymake-diagnostic-functions.
Noam Postavsky [Tue, 31 Oct 2017 17:31:46 +0000 (13:31 -0400)]
Use hybrid malloc for FreeBSD (Bug#28308)
FreeBSD aarch64 does not provide sbrk, so gmalloc cannot be used; when
using system malloc dumping does not work correctly (allocated data is
invalid after dumping).
* configure.ac: Set hybrid_malloc for freebsd.
* src/gmalloc.c (gdefault_morecore) [!HAVE_SBRK]: Don't call sbrk.
Add html-, mhtml- and python-mode support to semantic symref
* lisp/cedet/semantic/symref/grep.el
(semantic-symref-filepattern-alist): Fix the entry for
'html-mode', which used a regexp-like syntax where only glob
syntax is permitted. As a result, 'xref-find-references' (M-?)
can now find references in HTML files. Also duplicate the same
entry for the sake of 'mhtml-mode', and add a new one for
'python-mode'.
(semantic-symref-derive-find-filepatterns): In the documentation,
clarify that returned patterns must follow the glob syntax. Fix
an 'if' test that always evaluates to nil.
(semantic-symref-tool-grep):
(semantic-symref-perform-search): Fix typos.
Eli Zaretskii [Sat, 4 Nov 2017 14:28:25 +0000 (16:28 +0200)]
Fix subtle problems in tabulated-list-mode with line numbers
* lisp/emacs-lisp/tabulated-list.el
(tabulated-list-watch-line-number-width): Call
tabulated-list-init-header instead of tabulated-list-revert.
(tabulated-list-window-scroll-function): New function.
(tabulated-list-mode): Put 'tabulated-list-window-scroll-function'
on the buffer-local 'window-scroll-functions' list.
Eli Zaretskii [Sat, 4 Nov 2017 09:56:26 +0000 (11:56 +0200)]
Improve documentation of window hooks
* doc/lispref/windows.texi (Window Hooks): Fix the description of
window-configuration-change-hook. (Bug#29049)
<run-window-scroll-functions, run-window-configuration-change-hook>:
Document these functions.
João Távora [Fri, 13 Oct 2017 15:37:47 +0000 (16:37 +0100)]
New xref-quit-and-goto-xref command bound to TAB (bug#28814)
This is like xref-goto-xref, but quits the *xref* window just before
the user jump to ref.
* lisp/progmodes/xref.el (xref--show-location): Handle 'quit
value for SELECT.
(xref-goto-xref): Take optional QUIT arg.
(xref-quit-and-goto-xref): New command.
(xref--xref-buffer-mode-map): Bind "Q" and "TAB" to
xref-quit-and-goto-xref.
* doc/emacs/maintaining.texi (Xref Commands): Describe new bindings in
*xref*.
João Távora [Mon, 23 Oct 2017 08:05:32 +0000 (09:05 +0100)]
Allow split-window-sensibly to split threshold in further edge case
As a fallback, and to avoid creating a frame, split-window-sensibly
would previously disregard split-height-threshold if the window to be
split is the frame's root window.
This change generalizes that: it disregards the threshold if the
window to be split is the frame's only _usable_ window (it is either
the only one, as before, or all the other windows are dedicated to
some buffer and thus cannot be touched).
This is required for the fix to bug#28814.
* lisp/window.el (split-height-threshold): Adjust doc to match
split-window-sensibly.
(split-window-sensibly): Also disregard threshold if all other
windows are dedicated.
João Távora [Fri, 13 Oct 2017 14:13:14 +0000 (15:13 +0100)]
Honor window-switching intents in xref-find-definitions (bug#28814)
When there is more than one xref to jump to, and an *xref* window
appears to help the user choose, the original intent to open a
definition in another window or frame is remembered when the choice to
go to or show a reference is finally made.
* lisp/progmodes/xref.el (xref--show-pos-in-buf): Rewrite.
(xref--original-window-intent): New variable.
(xref--original-window): Rename from xref--window and move up
here for clarity.
(xref--show-pos-in-buf): Rewrite. Don't take SELECT arg here.
(xref--show-location): Handle window selection decision here.
(xref--window): Rename to xref--original-window.
(xref-show-location-at-point): Don't attempt window management here.
(xref--show-xrefs): Ensure display-action intent is saved.
Paul Eggert [Fri, 3 Nov 2017 09:20:15 +0000 (02:20 -0700)]
Change GCALIGNMENT back to an integer literal
* src/lisp.h (GCALIGNMENT): Change it back to a macro
that expands to a literal integer constant, for older GCC.
I had mistakenly thought that only MSVC had the problem.
Problem repored by Eli Zaretskii (Bug#29040#69).
Hong Xu [Tue, 29 Nov 2016 23:17:27 +0000 (15:17 -0800)]
Improve the doc of eshell-cmpl-* custom variables (Bug#25069)
* lisp/eshell/em-cmpl.el (eshell-cmpl--custom-variable-docstring): New
function to generate the docstring for custom variables derived from
pcomplete-* variables.
(eshell-cmpl-file-ignore, eshell-cmpl-dir-ignore)
(eshell-cmpl-ignore-case, eshell-cmpl-autolist)
(eshell-cmpl-suffix-list, eshell-cmpl-recexact)
(eshell-cmpl-man-function, eshell-cmpl-compare-entry-function)
(eshell-cmpl-expand-before-complete, eshell-cmpl-cycle-completions)
(eshell-cmpl-cycle-cutoff-length, eshell-cmpl-restore-window-delay)
(eshell-command-completion-function, eshell-cmpl-command-name-function)
(eshell-default-completion-function, eshell-cmpl-use-paring): Use it
to set the docstring.
Paul Eggert [Thu, 2 Nov 2017 20:18:16 +0000 (13:18 -0700)]
Merge from Gnulib
This incorporates:
2017-10-29 timespec: prefer ‘assume’ to ‘assure’
2017-10-27 timespec.h: use "assure" to avoid a spurious warning
2017-10-09 getopt-posix: Fix build failure if ac_cv_header_getopt_h=no
* build-aux/config.guess, build-aux/config.sub:
* lib/timespec.h, lib/unistd.in.h:
Copy from Gnulib.
Paul Eggert [Thu, 2 Nov 2017 20:06:38 +0000 (13:06 -0700)]
Fix alignment portability problems
Do not assume that the natural alignment of Lisp objects is a
multiple of GCALIGNMENT. This improves on the portability of the
recent fix for Bug#29040.
* lib-src/make-docfile.c (close_emacs_globals):
* src/buffer.c (buffer_defaults, buffer_local_symbols):
* src/lisp.h (DEFUN):
* src/thread.c (main_thread):
Use GCALIGNED, not alignas (GCALIGNMENT).
* src/alloc.c (COMMON_MULTIPLE):
Move back here from lisp.h, since it is no longer used elsewhere.
* src/lisp.h (GCALIGNMENT): No longer a macro, since we need not
worry about MSVC. Omit no-longer-needed consistency check.
* src/thread.c (THREAD_ALIGNMENT): Remove.
Martin Rudalics [Thu, 2 Nov 2017 08:28:25 +0000 (09:28 +0100)]
In frame parameters documentation mention desktop saving/restoring
* doc/lispref/frames.texi (Frame Parameters): Mention that
applications have to care about which parameters they want to
get saved and restored by the desktop library.
Phil Sainty [Mon, 16 Oct 2017 10:38:42 +0000 (23:38 +1300)]
Don't clobber docstrings of explicitly-defined mode hook variables
* lisp/emacs-lisp/derived.el (define-derived-mode):
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): When defining the
mode hook variable, do not clobber pre-existing docstrings.
Alan Mackenzie [Mon, 30 Oct 2017 17:33:03 +0000 (17:33 +0000)]
Fix "Args out of range" error in c-determine-limit. Fixes bug #28598.
* lisp/progmodes/cc-engine.el (c-determine-limit-get-base): If the candidate
position for BASE is below point-min, scan forward to the end of the current
literal.
(c-determine-limit): Add an extra arm to the final cond form, testing for BASE
being at point-min.
Mark Oteiza [Sun, 29 Oct 2017 00:32:50 +0000 (20:32 -0400)]
Add ChkTeX flymake backend for latex-mode
* lisp/textmodes/tex-mode.el (tex-flymake): New custom group.
(tex-chktex-program, tex-chktex-extra-flags): New custom variables.
(latex-mode): Add backend to flymake-diagnostic-functions.
(tex-chktex--process): New variable.
(tex-chktex-command, tex-chktex): New functions.
Eli Zaretskii [Sat, 28 Oct 2017 16:39:48 +0000 (19:39 +0300)]
Avoid segfaults in 64-bit Windows builds
* src/lisp.h (COMMON_MULTIPLE): Move here from alloc.c.
* src/thread.c (THREAD_ALIGNMENT): New macro.
(main_thread): Use THREAD_ALIGNMENT to align propertly. (Bug#29040)
Eli Zaretskii [Fri, 27 Oct 2017 14:43:21 +0000 (17:43 +0300)]
Improve documentation of how faces are applied to display stings
* doc/lispref/display.texi (Displaying Faces): Describe how the
faces of the "underlying" text affect overlay and display strings.
(Display Margins): Add a cross-reference to "Displaying Faces".
Tak Kunihiro [Fri, 27 Oct 2017 14:17:42 +0000 (17:17 +0300)]
Improve pixel-scroll-mode
Scroll vertically by number of pixels returned by
'frame-char-height' with or without horizontally scrolled.
(Bug#28922)
* lisp/pixel-scroll.el (pixel-resolution-fine-flag): When t, scroll
by number of pixels returned by 'frame-char-height'.
(pixel-scroll-up): Scroll by 'frame-char-height'. Fix algorithm to
move cursor to avoid unexpected jump.
(pixel-scroll-down): Scroll by 'frame-char-height'.
(pixel-bob-at-top-p): Consider number of pixels that is about to
scroll.
(pixel-posn-y-at-point): Consider existence of an overlay string.
Return nil when horizontally scrolled.
(pixel-point-at-top-p): Consider number of pixels that is about to
scroll. Use different algorithm when horizontally scrolled.
(pixel-point-at-bottom-p): Consider number of pixels that is about
to scroll. Return nil when horizontally scrolled.
(pixel-scroll-pixel-down): Move cursor when horizontally scrolled.
(pixel--whistlestop-line-up): Change cosmetics and move cursor when
horizontally scrolled.
(pixel-line-height): Call 'pixel-visual-line-height' instead of
'line-pixel-height'.
(pixel-visual-line-height): New function to return height in pixels
of text line where cursor is with or without horizontally scrolled,
considering response of display engine.
(pixel-visible-pos-in-window): New function to return position of
a char shown on text line where cursor is on screen with or without
horizontally scrolled.
Katsumi Yamaoka [Fri, 27 Oct 2017 01:13:25 +0000 (01:13 +0000)]
Enable gnus-read-ephemeral-* to run multiple times (bug#29008)
NOTE: *DO NOT* merge this change to the trunk.
* lisp/gnus/gnus-group.el (gnus-read-ephemeral-gmane-group)
(gnus-read-ephemeral-bug-group): Make it work for any number of times
for the case `url-automatic-caching' is set (bug#29008).
Alan Mackenzie [Thu, 26 Oct 2017 18:29:39 +0000 (18:29 +0000)]
Fix another "wrong side of point" error in CC Mode.
This fixes (a follow-up to) bug #28850.
A internal generated form for scanning text to fontify had a LIMIT parameter.
It also locally bound LIMIT to a value possibly beyond the original LIMIT,
allowing point to move beyond the original LIMIT, and to create the wrong side
error. Fix it by checking point is not beyond LIMIT in the outer context
before using it.
* lisp/progmodes/cc-fonts.el (c-make-font-lock-search-form): Add a new
parameter CHECK-POINT which, when non-nil, directs the function to generate a
check on point.
(c-make-font-lock-context-search-function): Invoke the above function with new
argument value t.
Michael Albinus [Thu, 26 Oct 2017 14:24:28 +0000 (16:24 +0200)]
Fix Bug#28959
* lisp/net/tramp.el (tramp-handle-find-backup-file-name):
Use `tramp-tramp-file-p' rather than `tramp-file-name-p'. Add
hop to backup file name. (Bug#28959)
Paul Eggert [Thu, 26 Oct 2017 03:47:48 +0000 (20:47 -0700)]
Fix duplicate .o file on QNX
* configure.ac (CYGWIN_OBJ): Leave empty on QNX.
Problem reported by Elad Lahav in:
https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00750.html
Dmitry Gutov [Wed, 25 Oct 2017 23:43:33 +0000 (02:43 +0300)]
Fix two js indentation problems
Fix intentation problems reported in
https://github.com/mooz/js2-mode/issues/463.
* lisp/progmodes/js.el (js--continued-expression-p):
Check syntax state after /.
(js--multi-line-declaration-indentation):
Check syntax state before "const".
Alan Mackenzie [Wed, 25 Oct 2017 18:14:00 +0000 (18:14 +0000)]
Fix a "wrong side of point" error in CC Mode. Fixes bug #28850.
The cause was a scanning over a bracket pair taking us beyond the supplied
LIMIT parameter in c-forward-declarator.
* lisp/progmodes/cc-engine.el (c-forward-declarator): Add three checks (<
(point) limit) whilst dealing with tokens after the declared identifier.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Don't supply a LIMIT
argument to `c-forward-declarator' (twice), since we want to fontify up till
the end of a declarator, not an arbitrary jit-lock chunk end.