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.
Stefan Monnier [Wed, 25 Oct 2017 16:31:40 +0000 (12:31 -0400)]
Fix autoload of flymake from elisp-mode during bootstrap (bug#28994)
* lisp/loadup.el: add `progmodes` to load-path so we can find flymake.el.
* lisp/kmacro.el: Require `replace` since we use query-replace-map.
* lisp/replace.el: Require `text-mode` since we use text-mode-map.
Noam Postavsky [Tue, 24 Oct 2017 23:19:37 +0000 (19:19 -0400)]
Fix compile warning for non-w32 builds
Since 2017-07-25 "ls-lisp: Add an unload function and enable lexical
binding", the non-w32 builds would treat the undeclared
w32-collate-ignore-punctuation variable as lexical.
* lisp/ls-lisp.el (top-level): Declare it as a dynamic variable.
David Glasser [Tue, 10 Oct 2017 22:46:53 +0000 (15:46 -0700)]
Display commit in package description, if available (Bug#28637)
MELPA includes a :commit field in its
packages (https://github.com/melpa/package-build/pull/6). You can use
this to tell if MELPA has processed a recently-merged change. This
commit adds that metadata to the package description buffer.
* lisp/emacs-lisp/package.el: Display commit in package description.
Paul Eggert [Tue, 24 Oct 2017 19:54:28 +0000 (12:54 -0700)]
Port to QNX
Simplified version of a patch proposed by Elad Lahav in:
https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00716.html
which is based on a previous patch I proposed in:
https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00707.html
* configure.ac (opsys, CFLAGS, LIBS_SYSTEM, hybrid_malloc)
(system_alloc, FIRST_PTY_LETTER, CYGWIN_OBJ):
Set appropriately for QNX.
* src/unexelf.c [__QNX__]: Include <sys/elf.h> instead of <elf.h>.
(unexec): Check for sbrk failure, and fall back on old BSS end.
Martin Rudalics [Mon, 23 Oct 2017 07:53:41 +0000 (09:53 +0200)]
Fix some ‘window-normalize-’ prefixed functions (Bug#28947)
* lisp/window.el (window-normalize-buffer): Fix case where
BUFFER-OR-NAME is a string specifying a dead buffer. Fix
doc-string (Bug#28947).
(window-normalize-frame, window-normalize-window): Fix
doc-strings (Bug#28947).