1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-31 17:30:54 -08:00
Commit graph

129593 commits

Author SHA1 Message Date
Eli Zaretskii
5d1025e716 Allow to disable display of line numbers beyond EOB
* src/buffer.c (disable_line_numbers_overlay_at_eob): New
function.
* src/lisp.h (disable_line_numbers_overlay_at_eob): Add prototype.
* src/xdisp.c (should_produce_line_number): When at ZV, call
disable_line_numbers_overlay_at_eob to determine whether line
numbers should be displayed beyond ZV.
2017-06-25 20:53:05 +03:00
Eli Zaretskii
540669cda9 Fix line number display for overlay/display strings with newlines
* src/xdisp.c (maybe_produce_line_number): Fix the condition for
producing space glyphs instead of a line number to include the
case of display strings and overlays.
2017-06-25 19:33:04 +03:00
Eli Zaretskii
16d2695674 Minor change in NEWS. 2017-06-24 21:10:04 +03:00
Eli Zaretskii
ead4ab6359 Improve documentation in NEWS. 2017-06-24 20:11:56 +03:00
Eli Zaretskii
0d5c713a6b Move additional hscrolling code into a suitable 'if'
* src/xdisp.c (hscroll_window_tree): Make additional calculations
regarding glyphs produced for line numbers conditional on
line-number display.
2017-06-24 19:40:41 +03:00
Eli Zaretskii
13cc19a0a3 Partial fix of hscroll of truncated lines with line numbers
* src/xdisp.c (x_produce_glyphs, hscroll_window_tree): Adjust
hscroll calculations to line-number display.
* src/term.c (produce_glyphs): Adjust tab stop to window's
hscroll.  These two changes fix horizontal scrolling when line
numbers are displayed.  But there's still a bug: the horizontal
shift of lines that begin with a TAB is different from the rest.
* src/xdisp.c (move_it_in_display_line_to): Call
should_produce_line_number to determine whether a line number
should be produced for this screen line.
2017-06-24 19:03:39 +03:00
Eli Zaretskii
6e18841b17 Allow Lisp program to disable line-number display for specific lines
* etc/NEWS: Update the documentation.

* src/xdisp.c (syms_of_xdisp) <display-line-numbers-disable>: New
symbol.
(should_produce_line_number): New function.
(display_line): Use should_produce_line_number to determine
whether a line number should be produced for each glyph row.
2017-06-24 16:58:01 +03:00
Eli Zaretskii
71a7294d0a Support a separate face for displaying the current line's number
* lisp/faces.el (line-number-current-line): New face.

* src/xdisp.c (syms_of_xdisp) <line-number-current-line>: New
symbol.
(try_window_id, try_cursor_movement): Disable these optimizations
when the line-number-current-line face is different from
line-number face.
(maybe_produce_line_number): Display the current line in the
line-number-current-line face, if it's different from line-number.
2017-06-24 15:45:23 +03:00
Eli Zaretskii
fa5e84cccd Change display of current line in relative mode
* src/xdisp.c (maybe_produce_line_number): In relative mode
display the current line number as its absolute value, not as zero.
2017-06-24 15:15:02 +03:00
Eli Zaretskii
efedb66466 Rename display-line-width
* etc/NEWS:
* src/xdisp.c (syms_of_xdisp, maybe_produce_line_number):
* lisp/cus-start.el: Rename display-line-width to
display-line-number-width.
2017-06-24 14:53:35 +03:00
Eli Zaretskii
55a9298d63 Fix tab stops when line numbers are displayed
* src/xdisp.c (x_produce_glyphs):
* src/term.c (produce_glyphs): Adjust tab stops for the horizontal
space taken by the line-number display.
2017-06-24 14:29:32 +03:00
Eli Zaretskii
7d7602cea0 Fix crashes on TTY frames due to negative lnum_width. 2017-06-24 13:26:01 +03:00
Eli Zaretskii
9776d7bcf0 Don't display line numbers in the minibuffer and in tooltip frames. 2017-06-24 13:01:30 +03:00
Eli Zaretskii
5b648ac7a2 Fix problems with line-number updates in Follow mode
* src/xdisp.c (redisplay_window): If forced window-start requires
to move a window's point, and the window is under relative
line-number display, force another round of redisplay to update
the relative line numbers.  This fixes follow-mode "redisplay" of
its window group.

* lisp/frame.el: Add display-line-numbers to the list of variables
that should trigger redisplay of the current buffer.
2017-06-24 12:37:30 +03:00
Eli Zaretskii
77f8b86e40 Fix display of line numbers with fonts larger than the default
* src/xdisp.c (maybe_produce_line_number): Update the metrics in
IT, not in IT->glyph_row, since the latter gets overwritten in
display_line.  Fixes display of line numbers when the font used
for them is larger than that of the default face.
2017-06-24 11:34:52 +03:00
Eli Zaretskii
bbaf2f3d52 Fix background color beyond EOB and cursor display
* src/xdisp.c: 	(maybe_produce_line_number): Use the default face
for background of the blank glyphs in the line-number area which
are drawn beyond EOB.
(display_line): Reset the glyph row's displays_text_p flag only on
empty lines that don't display line numbers.  This fixes cursor
display beyond EOB.  Fix the bidi information in the glyphs
produced for line numbers.  Set the avoid_cursor_p flag of glyphs
produced for line numbers.
2017-06-23 18:13:53 +03:00
Eli Zaretskii
d4eddb08e5 Fix display of indicate-empty-lines when line numbers are displayed
* src/xdisp.c (row_text_area_empty): New function.
(display_line): Call row_text_area_empty to verify that a glyph
row's text area is devoid of any glyphs that came from a buffer or
a string.  This fixes a bug with empty-lines indication
disappearing when line numbers or line-prefix are displayed.
(display_line): Delete the argument FORCE; all callers changed.
Remove the condition for actually producing the glyphs for the
line number, as even if the number didn't change we need to
produce empty space.
2017-06-23 17:13:01 +03:00
Eli Zaretskii
7277c0fca7 Finish up native display of line numbers
* src/xdisp.c (maybe_produce_line_number): Produce a blank before
the number, for R2L rows.  Increment 'g' in the loop even if
glyph_row is NULL.  Accept 2nd argument FORCE and produce the
line-number glyphs if it is non-zero.
(move_it_in_display_line_to): Account for the space taken by the
line-number glyphs.  Call maybe_produce_line_number with 2nd
argument non-zero.
(set_cursor_from_row): Fix calculation of cursor X coordinate in
R2L rows with display-produced glyphs at the beginning.
(syms_of_xdisp) <line-number>: New face symbol.
<relative, display-line-width>: New symbols.
(maybe_produce_line_number): Use the line-number face for
displaying line numbers.  Support relative line-number display.
Support user-defined width for displaying line numbers.
(try_cursor_movement, try_window_id): Disable these optimizations
when displaying relative line numbers.
* src/dispextern.h (struct it): New member 'pt_lnum'.

* lisp/faces.el (line-number): New face.
* lisp/cus-start.el (standard): Provide customization forms for
display-line-numbers and display-line-width.
* lisp/menu-bar.el (menu-bar-showhide-menu): Add menu-bar item to
turn display-line-numbers on and off.

* etc/NEWS: Document the new feature.
2017-06-17 17:42:44 +03:00
Eli Zaretskii
daf78963ee Initial version of native display of line numbers
* src/xdisp.c (syms_of_xdisp) <display-line-numbers>: New
buffer-local variable.
Include <math.h>.
(maybe_produce_line_number): New function.
(DISP_INFINITY): Rename from INFINITY, since math.h defines INFINITY.
(try_window_reusing_current_matrix): Don't use this method when
display-line-numbers is in effect.
* src/dispextern.h (struct it): New members 'lnum'.
2017-06-16 22:44:48 +03:00
Alan Mackenzie
7a2038d7c8 Create a toggle between block and line comments in CC Mode.
Also (unrelated change) initialize the modes' keymaps at each loading.

* lisp/progmodes/cc-cmds.el (c-update-modeline): amend for the new information
on the modeline.
(c-block-comment-flag): New variable.
(c-toggle-comment-style): New function.

* lisp/progmodes/cc-langs.el (c-block-comment-starter)
(c-line-comment-starter): Make them c-lang-defvars.
(c-block-comment-is-default): New c-lang-defvar.
(comment-start, comment-end): Make the default values dependent on
c-block-comment-is-default.

* lisp/progmodes/cc-mode.el (c-mode-base-map): Define C-c C-k in this map.
(c-basic-common-init): Initialize c-block-comment-flag.
(c-mode-map, c++-mode-map, objc-mode-map, java-mode-map, idl-mode-map)
(pike-mode-map, awk-mode-map): Make entries in these key maps each time the
mode is loaded rather than just once per Emacs session.

* doc/misc/cc-mode.texi (Comment Commands): Introduce the notion of comment
style.
(Minor Modes): Define comment style.  Describe how comment style influences
the information displayed on the modeline.  Document c-toggle-comment-style.
(FAQ): Add a question about toggling the comment style.
2017-06-15 21:03:03 +00:00
Paul Eggert
21d10e59f8 Pacify clang without munging C source
* configure.ac (WARN_CFLAGS): With Clang, use
-Wno-tautological-compare regardless of --enable-gcc-warnings.
(WERROR_CFLAGS): Simplify assignments, and guarantee it’s always set.
* lib/strftime.c: Copy from gnulib, reverting Clang-specific
change which I hope is no longer needed.
* src/emacs.c (main): Revert rlim_t change, as rlim_t is signed on
some older non-POSIX hosts.
2017-06-15 13:30:30 -07:00
Paul Eggert
2b9620e6af No need to complicate make-docfile.c for Clang
* lib-src/make-docfile.c (put_filename): Undo recent change.
The Clang false alarm occurs only with CFLAGS=-save-temps and
we needn’t worry about pacifying unusual compiler configurations.
2017-06-15 12:34:30 -07:00
Paul Eggert
1ac8c9bb9b Port './configure CC=clang' to Fedora 25
* configure.ac (HAVE_IMAGEMAGICK): Disable if even a
standard function like MagickRelinquishMemory does not link.
2017-06-15 11:25:51 -07:00
Paul Eggert
ebdcfa960d Don’t worry about __STDC_VERSION__ in emacs-module
* src/emacs-module.h: Remove __STDC_VERSION__ check.  In the past
we’ve found that some compilers do not define this symbol even
when they work well enough.  If necessary features like stdbool.h
are missing the compiler will complain eventually anyway.
2017-06-15 10:33:31 -07:00
Paul Eggert
d715e6d8c6 Port cleanup check to Oracle Studio 12.5
* src/conf_post.h (__has_attribute_cleanup): Resurrect.
* src/emacs-module.c: Verify __has_attribute (cleanup), but in an
#if this time.
2017-06-14 11:01:41 -07:00
Bastien
b657de7f7a Fix misformatted changelog entry 2017-06-14 18:54:38 +02:00
Eli Zaretskii
ab4f0326b4 Avoid compiler warning in image.c on MS-Windows
* src/image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: Avoid
compilation warning under -Warray-bounds by temporarily disabling
the -Warray-bounds option.
2017-06-14 19:09:21 +03:00
Michael Albinus
164fcc6f26 Fix Bug#27315
* lisp/net/tramp-cache.el (tramp-cache-read-persistent-data):
New defvar.
(top): Use it.

* lisp/net/tramp.el (tramp-handle-file-name-case-insensitive-p):
Check for connected, not for connectable.  (Bug#27315)
(tramp-process-actions):
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
Use `tramp-cache-read-persistent-data'.

* test/lisp/net/tramp-tests.el (top): Set also
`tramp-cache-read-persistent-data'.
2017-06-14 14:17:22 +02:00
Noam Postavsky
5647c4a2c6 Give a fixed default value for icomplete-prospects-height (Bug#26939)
* lisp/icomplete.el (icomplete-prospects-height): Default to 2.
(icomplete-prospects-length): Remove.
* etc/NEWS: Announce removal.
2017-06-14 07:03:05 -04:00
Philipp Stephani
32d8dba625 Remove some tautological comparisons involving rlim_t
Clang on macOS warns about these with -Wtautological-compare.  POSIX
guarantees that rlim_t is
unsigned (cf.
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/resource.h.html),
so these resource limits can never be negative.

* src/emacs.c (main): Remove tautological comparisons.
2017-06-14 12:35:58 +02:00
Philipp Stephani
ac649dc4b4 Use --module-assertions if modules are available
Using --module-assertions helps us find bugs in the test module.  But
we can use it only if Emacs was compiled with module support.

* test/Makefile.in (MODULES_EMACSOPT): New variable.
(emacs): Use it.
2017-06-14 12:24:11 +02:00
Philipp Stephani
a2f7cc3499 Define --module-assertions only of modules are available
Fixes Bug#27352.

* src/emacs.c (usage_message, standard_args): Define
--module-assertions only if Emacs has been compiled with module
support.
2017-06-14 10:47:32 +02:00
Michael Albinus
63ec338c98 ; Fix typo in INSTALL 2017-06-14 09:08:45 +02:00
Katsumi Yamaoka
c404bc733a gnus-article-read-summary-keys: Don't move point for WDD and WDW commands
* lisp/gnus/gnus-art.el (gnus-article-read-summary-keys):
No need to restore window config for WDD and WDW commands.
2017-06-14 05:35:39 +00:00
Thomas Fitzsimmons
2a058b7ef8 lisp/net/soap-client.el: Bump version to 3.1.3
* lisp/net/soap-client.el: Bump version to 3.1.3.
(soap-name-p): Fix checkdoc issue.
2017-06-13 21:21:24 -04:00
Alex Harsanyi
afc1eec8b8 Fix an HTTP encoding error in soap-client.el
* lisp/net/soap-client.el (soap-invoke-internal): Make
SOAPAction header a UTF-8 encoded string.
2017-06-13 21:21:24 -04:00
Paul Eggert
27bb4de72b Port cleanup attribute to Oracle Studio 12.5
* INSTALL (--with-modules): List cleanup attribute as prereq.
* src/conf_post.h (__has_attribute_cleanup): Remove; no longer needed.
* src/emacs-module.c (MODULE_SETJMP_1): Don’t attempt to verify
(__has_attribute (cleanup)), as Oracle Studio 12.5 supports
__has_attribute only inside preprocessor expressions.  The C
compiler should check the cleanup attribute in the next line anyway.
(module_reset_handlerlist): Remove an unnecessary ‘const’
that causes Oracle Studio 12.5 to refuse to compile.
2017-06-13 18:20:07 -07:00
Glenn Morris
510a674280 Fix running tests in without-modules builds
* test/Makefile.in (EMACSOPT): Remove option that is only defined
with-modules.  emacs-module-tests.el passes it where needed.
2017-06-13 18:53:38 -04:00
Glenn Morris
863b333543 * test/Makefile.in (src/emacs-module-tests.log): Out-of-tree fix. 2017-06-13 15:41:56 -04:00
Philipp Stephani
58b9b098a4 Inline test module Makefile into main test Makefile
The test/data/emacs-module/Makefile only built a single target, and
inlining it into test/Makefile simplifies dependency tracking and
reduces code duplication.

* configure.ac: Don't build test/data/emacs-module/Makefile.

* Makefile.in ($(test_module)): Inline compilation.
(clean): Also clean test module outputs.
2017-06-13 20:48:15 +02:00
Michael Albinus
a63aeb64b7 * lisp/net/tramp-sh.el (tramp-set-file-uid-gid): Do not handle locally on w32. 2017-06-13 15:54:09 +02:00
Michael Albinus
4e22083bf7 Minor tweaks in Tramp manual
* doc/misc/trampver.texi: Add prefixwithspace flag.

* doc/misc/tramp.texi (Password handling): Harmonize example.
(File name completion): Use prefixwithspace flag.
(Frequently Asked Questions): Explain `tramp-histfile-override'.
2017-06-13 15:20:43 +02:00
Philipp Stephani
e408e9aa03 Silence two Clang warnings by introducing additional local variables
* lib/strftime.c (libc_hidden_def):
* lib-src/make-docfile.c (put_filename): Introduce local variables to
silence Clang warnings.
2017-06-13 13:56:46 +02:00
Noam Postavsky
cc8aa484cd Fix wrong indentation after string literal (Bug#27306)
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-state)
(lisp-indent-calc-next): Remove `depth' field, use (car ppss) instead.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-region-after-string-literal): New test.
2017-06-13 07:19:12 -04:00
Philipp Stephani
9af2ab68ca Fix version checks for emacs-module.h
We don't need C11 or C++11 because stdbool.h is in C99, and for C++ we
don't need it at all.
2017-06-13 09:53:33 +02:00
Lele Gaifax
88e0df33e0 ; Fix docstring
* lisp/bindings.el (mode-line-percent-position):
End docstring first sentence with a period (Bug#27339).

Copyright-paperwork-exempt: yes
2017-06-13 14:31:53 +09:00
Noam Postavsky
9b0f52a86e Buttonize #<bytecode> part of printed functions (Bug#25226)
* lisp/emacs-lisp/cl-print.el: Autoload `disassemble-1'.
(cl-print-compiled-button): New variable.
(help-byte-code): New button type, calls `disassemble' in its action.
(cl-print-object): Use it if `cl-print-compiled-button' is
non-nil.
2017-06-12 22:52:37 -04:00
Philipp Stephani
52c846d45d Print module structure sizes when initializing test module
* test/data/emacs-module/mod-test.c (emacs_module_init): Print
compile-time and runtime sizes of module structures to ease debugging
2017-06-12 23:46:02 +02:00
Glenn Morris
69899d4a7e Small portability fix for emacs-module.h (bug#27346)
* src/emacs-module.h (EMACS_ATTRIBUTE_NONNULL) [!__has_attribute]:
Avoid 'error: missing binary operator before token "("'.
2017-06-12 17:43:28 -04:00
Glenn Morris
73b50a1073 Give a more informative failure in module assertion test
* test/src/emacs-module-tests.el (module--test-assertions):
Rephrase final check to give a more informative failure.
2017-06-12 17:37:55 -04:00