1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-14 09:39:42 +00:00
Commit Graph

40301 Commits

Author SHA1 Message Date
Paul Eggert
3d3923b79f Tweak mark_object to avoid a conditional branch
* src/alloc.c (LAST_MARKED_SIZE): Now an enum.  Make it a power of 2.
(mark_object): Take advantage of the power of 2.
2018-04-18 13:15:26 -07:00
Paul Eggert
403f3d2c85 Tell user about read-integer-overflow-as-float
* src/lread.c (string_to_number): Suggest
read-integer-overflow-as-float in signal message.
Suggested by Stefan Monnier (Bug#31118#58).
2018-04-18 12:48:48 -07:00
Paul Eggert
5dff4905d7 Fix signal for large integers with valid syntax
* src/lread.c (read_integer): If a radixed integer has valid syntax
but is waayyy too large, signal overflow instead of invalid syntax.
* test/src/lread-tests.el (lread-long-hex-integer): New test.
2018-04-17 16:23:48 -07:00
Philipp Stephani
9f2d21ca53 Avoid undefined behavior in 'defvar' (Bug#31072)
* src/eval.c (Fdefvar): Check that first argument is a symbol.
* test/src/eval-tests.el (defvar/bug31072): New unit test.
2018-04-15 23:50:06 -07:00
Lars Ingebrigtsen
7cbe9628d1 * src/lread.c (openp): Add a comment before the now-obscure loop. 2018-04-15 18:14:49 +02:00
Lars Ingebrigtsen
56c4ce266d Indent after transforming for loop into do/while 2018-04-14 21:55:39 +02:00
Lars Ingebrigtsen
f939cd0255 Make call-process work if exec-path is nil
* src/lread.c (openp): If exec-path is nil, no files would be
found to execute (bug#30564).

Test cases:

 (let ((exec-path ()))
   (call-process "/bin/ls" nil (current-buffer)))

This would previously fail, but now works.

 (let ((exec-path '("/bin/")))
   (call-process "ls" nil (current-buffer)))

This worked, and still works.
2018-04-14 21:55:08 +02:00
Lars Ingebrigtsen
369cb30d8c (libxml-parse-html-region): Make DISCARD-COMMENTS obsolete
* lisp/subr.el (libxml-parse-xml-region)
(libxml-parse-html-region): Make DISCARD-COMMENTS obsolete.

* src/xml.c (Flibxml_parse_html_region)
(Flibxml_parse_xml_region): Don't mention DISCARD-COMMENTS, since
it's now no longer part of the advertised signature (bug#27178).
2018-04-14 19:06:51 +02:00
Lars Ingebrigtsen
e20d7381ee Make DISCARD-COMMENTS in `libxml-parse-{html,xml}-region' obsolete
* doc/lispref/text.texi (Parsing HTML/XML): Mention that
discard-comments is obsolete.

* lisp/xml.el (xml-remove-comments): New function (bug#27178).

* src/xml.c (Flibxml_parse_html_region): Clarify what
DISCARD-COMMENTS actually does, and say that the parameter is
obsolete.
(Flibxml_parse_xml_region): Ditto.
2018-04-14 17:14:01 +02:00
Glenn Morris
db71b31827 Merge from origin/emacs-26
5a6bb01 (origin/emacs-26) Fix building etc/DOC in the MSDOS port
274c979 * lisp/select.el (gui-get-selection): Doc fix.
ad731b0 ; * doc/lispref/display.texi (Temporary Displays): Fix typos.
f1450e9 Complete documentation of syntax flags by adding `c'
6bdcaec Fix typos and minor wording issues in ELisp manual
febac27 Merge branch 'emacs-26' of git.savannah.gnu.org:/srv/git/emac...
6c2e21e Avoid segfault in processes of type 'pipe'
60e10c5 Remove repetitions in documentation strings
208e752 * lisp/image.el (image-load-path): Doc fix.
92e0fd8 ; * etc/NEWS: Remove a FIXME.  (Bug#31122)

Conflicts:
	etc/NEWS
2018-04-14 07:50:45 -07:00
Eli Zaretskii
6c2e21e1ca Avoid segfault in processes of type 'pipe'
* src/process.c (Fmake_pipe_process): Set up the decoding and
encoding buffers.  For the details, see
http://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00295.html.
2018-04-13 15:48:04 +03:00
Glenn Morris
587f12281a Merge from origin/emacs-26
c267421 (tag: emacs-26.1-rc1, origin/emacs-26) ; * ChangeLog.3: Update.
aa77415 * etc/AUTHORS: Regenerate.
c8ffca5 * lisp/files.el (kept-new-versions): Improve documentation st...
3a798f6 Fix a minor mistake in the ELisp manual
6afa868 ; * src/dispextern.h (struct it): Fix a typo in a comment.
5659b2f * lisp/files.el (find-file-literally): Doc fix.
9b24a79 Fix typos in doc strings
2018-04-10 07:50:48 -07:00
Philipp Stephani
8df23a8204 Document that 'make-process' mixes the output streams
* doc/lispref/processes.texi (Asynchronous Processes):
* src/process.c (Fmake_process): Document that standard error is mixed
with standard output if STDERR is nil.

* test/src/process-tests.el (make-process/mix-stderr): New unit test.
2018-04-07 22:15:42 +02:00
Eli Zaretskii
6afa8682e9 ; * src/dispextern.h (struct it): Fix a typo in a comment. 2018-04-07 17:24:01 +03:00
Paul Eggert
d02fd482fb Improve GC+Cairo workaround
Suggested by Eli Zaretskii (Bug#20890#31).
* src/font.h (font_data_structures_may_be_ill_formed): New function.
* src/ftfont.c (ftfont_close):
* src/ftcrfont.c (ftcrfont_close): Use it.
2018-04-04 10:59:53 -07:00
Paul Eggert
9b0e8a4c6b Pacify GCC when --enable-profiling
* src/conf_post.h (PROFILING): Undef if not on a platform that
supports it.  Simplify uses accordingly.
* src/emacs.c (etext) [PROFILING]:
Declare at top level to avoid GCC warning.
2018-04-03 17:32:16 -07:00
Eli Zaretskii
3deaac1bd9 ; * src/ftfont.c (ftfont_spec_pattern): Fix whitespace. 2018-04-03 19:59:40 +03:00
Paul Eggert
1233bcb0a7 Work around GC+Cairo bug
Workaround suggested by Robert Pluim (Bug#20890#13).
* src/ftfont.c (ftfont_close) [USE_CAIRO]:
Do nothing if GC is in progress.
2018-04-03 08:24:38 -07:00
Paul Eggert
95b77b0451 Port FC_COLOR change to older fontconfig
Problem reported by John ff in:
https://lists.gnu.org/r/emacs-devel/2018-04/msg00058.html
* src/ftfont.c (ftfont_spec_pattern) [!FC_COLOR]:
Don’t use FC_COLOR on older fontconfigs that don’t have it.
2018-04-03 08:13:17 -07:00
Robert Pluim
408bf21a8c Ignore color fonts when using Xft
* src/font.c (syms_of_font): New configuration variable
xft-ignore-color-fonts, default t.
* src/ftfont.c (ftfont_spec_pattern): Tell fontconfig to ignore
color fonts if xft-ignore-color-fonts is t.  (Bug#30874, Bug#30045)
* etc/NEWS: Document xft-ignore-color-fonts.
2018-04-03 14:42:16 +02:00
Charles A. Roelli
d06c2e7a66 Add a history variable for `read-variable'
* src/minibuf.c (Fread_variable): Use the history variable when
calling Fcompleting_read.
(syms_of_minibuf): New history variable, custom-variable-history.
2018-04-02 16:19:59 +02:00
Paul Eggert
6c48146f46 Do not assume --with-file-notification
* src/fileio.c (report_file_notify_error) [!USE_FILE_NOTIFY]: Omit.
2018-03-30 14:26:26 -07:00
Paul Eggert
6f66a43d7a Centralize Bug#30931 fix
* src/marker.c (detach_marker): New function.
* src/editfns.c (save_restriction_restore):
* src/insdel.c (signal_before_change): Use it.
2018-03-30 14:26:26 -07:00
Noam Postavsky
96b8747d5c Fix another case of freed markers in the undo-list (Bug#30931)
* src/alloc.c (free_marker): Remove.
* src/editfns.c (save_restriction_restore):
* src/insdel.c (signal_before_change): Detach the markers from the
buffer when we're done with them instead of calling free_marker on
them.
* test/src/editfns-tests.el (delete-region-undo-markers-1)
(delete-region-undo-markers-2): New tests.
2018-03-30 14:26:25 -07:00
Eli Zaretskii
842b3d7412 Fix C-p and C-n when wrap-prefix is too wide
* src/xdisp.c (move_it_in_display_line_to): Avoid looping in
previous/next-line when wrap-prefix is set to a too-wide
stretch of whitespace.  (Bug#30432)
2018-03-30 15:57:57 +03:00
Alan Third
733279abed Simplify represented filename handling (bug#30800)
* src/nsfns.m (ns_set_represented_filename): Move function from
nsterm.m and set represented filename directly.
* src/nsterm.h (ns_set_represented_filename): Remove definition.
* src/nsterm.m (ns_set_represented_filename): Move function to
nsfns.m.
(x_free_frame_resources): Remove references to represented_frame.
(sendEvent): Don't set represented filename.
2018-03-30 12:33:42 +01:00
Paul Eggert
670f2ffae7 Fix CHECK_ALLOCATED_AND_LIVE abort during GC
* src/editfns.c (save_restriction_restore):
Wait for the GC to free the temporary markers (Bug#30931).
2018-03-29 23:00:56 -07:00
Noam Postavsky
00c1f771f2 * src/xterm.c (x_make_frame_visible): Fix typo in previous change. 2018-03-29 19:17:34 -04:00
Noam Postavsky
2a192e21cf Don't wait for visible frames to become visible
For discussion, see thread starting at
https://lists.gnu.org/archive/html/emacs-devel/2018-03/msg00807.html.
* src/xterm.c (x_make_frame_visible): Check FRAME_VISIBLE_P before
calling x_wait_for_event.
2018-03-29 19:11:47 -04:00
Paul Eggert
c213f465ba New experimental variable read-integer-overflow-as-float.
Following a suggestion by Eli Zaretskii (Bug#30408#46).
* etc/NEWS: Mention it.
* src/lread.c (syms_of_lread): Add it.
(read1): Treat out-of-range integers as floats if
read-integer-overflow-as-float is non-nil.
2018-03-29 11:03:07 -07:00
Paul Eggert
6b3d01dad4 Lisp reader now checks for integer overflow
* doc/lispref/numbers.texi (Integer Basics), etc/NEWS:
Document this.
* src/lisp.h (S2N_IGNORE_TRAILING, S2N_OVERFLOW_TO_FLOAT):
New constants.
* src/lread.c (string_to_number): Change trailing bool arg to
integer argument with flags, to support S2N_OVERFLOW_TO_FLOAT.
All uses changed.
* test/src/editfns-tests.el (read-large-integer): New test.
2018-03-29 11:03:07 -07:00
Stefan Monnier
9ad3560db6 * src/keyboard.c (record_char, read_key_sequence): Copy raw events 2018-03-29 09:11:22 -04:00
Glenn Morris
7d8234c0cb Merge from origin/emacs-26
9bff405 (origin/emacs-26) * doc/misc/org.texi (Installation): Fix clo...
613c9a5 Update Org to v9.1.9
1b075a9 ; Fix some tiny doc typos
441fe20 De-obsolete `if-let' and `when-let'
8696038 * lisp/htmlfontify.el (hfy-begin-span-handler): Doc fix.
930f7b1 * doc/lispref/functions.texi (Defining Functions): Improve in...
95ccf50 Fix crash after frame is freed on macOS (bug#30800)
45d0475 More manual editing
2acb9f0 Minor manual changes changes
d481cba * lisp/calculator.el (calculator-paste-decimals): Add version.
7d6c7d0 ; Use GNU not Gnu in docs
1bc4def More proofreading of the Emacs manual

Conflicts:
	doc/misc/org.texi
	etc/NEWS
	lisp/org/org-clock.el
2018-03-28 09:38:22 -07:00
Stefan Monnier
c13cd74322 (read_key_sewuence): Use POSN in second event when needed (bug#30955)
* src/keyboard.c (active_maps): Add arg 'second_event'.
(read_key_sequence): Pass it.

* lisp/mouse.el (mouse--click-1-maybe-follows-link): Modify event in place.
2018-03-27 15:26:02 -04:00
Stefan Monnier
c23f2b5d9e Trivial fixes for last changes to package.el and marker.c
* lisp/emacs-lisp/package.el (package-quickstart): Add missing version.
* src/marker.c (verify_bytepos): Fix typo.
2018-03-26 14:29:49 -04:00
Paul Eggert
6247a904e6 ; Spelling fix 2018-03-26 09:30:01 -07:00
Stefan Monnier
b300052fb4 * src/marker.c: Try and speed up byte<->char conversion with many markers.
When considering markers (to find a starting point for the conversion),
typically one of the two bounds is nearby (coming from
cached_(byte|char)pos) but the other is far (point-min or point-max),
so change the exit condition so we stop as soon as *one* of the bounds
is near.

(BYTECHAR_DISTANCE_INITIAL, BYTECHAR_DISTANCE_INCREMENT): New constants.
(buf_charpos_to_bytepos, buf_bytepos_to_charpos): Use them to try and
reduce the number of markers we consider.
2018-03-26 09:01:30 -04:00
Aaron Jensen
95ccf50e37 Fix crash after frame is freed on macOS (bug#30800)
* src/nsterm.m (x_free_frame_resources): Clear represented_frame.
(bug#30800)
2018-03-25 20:13:05 +01:00
Noam Postavsky
1d47d777ef Allow &rest' or &optional' without following variable (Bug#29165)
This is sometimes convenient when writing macros, so that the empty
variable case doesn't need to be handled specially.  Older versions of
Emacs accepted this in some cases (especially the interpreter in Emacs
25 and below was very accepting).

                            |   interpreted/compiled   |
| arglist                   | 25 & earlier | 26  | 27  |
|---------------------------+--------------+-----+-----|
| (&rest)                   | y/n          | n/n | y/y |
| (&rest &rest)             | y/n          | n/n | n/n |
| (&rest &rest x)           | y/n          | n/n | n/n |
| (&rest x &rest)           | y/n          | n/n | n/n |
| (&rest x &rest y)         | y/n          | n/n | n/n |
|---------------------------+--------------+-----+-----|
| (&optional)               | y/n          | n/n | y/y |
| (&optional &optional)     | y/n          | n/n | n/n |
| (&optional x &optional)   | y/n          | n/n | n/n |
| (&optional x &optional y) | y/y          | n/n | n/n |
|---------------------------+--------------+-----+-----|
| (&optional &rest)         | y/n          | n/n | y/y |
| (&optional x &rest)       | y/n          | n/n | y/y |
| (&optional &rest y)       | y/y          | n/n | y/y |
|---------------------------+--------------+-----+-----|
| (&rest &optional)         | y/n          | n/n | n/n |
| (&rest &optional y)       | y/n          | n/n | n/n |
| (&rest x &optional y)     | y/n          | n/n | n/n |

The values in the table above can be produced with the following code:

(with-current-buffer (get-buffer-create "*ck-args*")
  (erase-buffer)
  (dolist (arglist '((&rest)
                     (&rest &rest)
                     (&rest &rest x)
                     (&rest x &rest)
                     (&rest x &rest y)
                     (&optional)
                     (&optional &optional)
                     (&optional x &optional)
                     (&optional x &optional y)
                     (&optional &rest)
                     (&optional x &rest)
                     (&optional &rest y)
                     (&rest &optional)
                     (&rest &optional y)
                     (&rest x &optional y)))
    (insert
     (format "%c/%c\n"
             (condition-case err
                 (progn (funcall `(lambda ,arglist 'ok))
                        ?y)
               (error ?n))
             (condition-case err
                 (progn (byte-compile-check-lambda-list arglist)
                        ?y)
               (error ?n))))
    (display-buffer (current-buffer))))

* src/eval.c (funcall_lambda):
* lisp/emacs-lisp/bytecomp.el (byte-compile-check-lambda-list): Don't
check for missing variables after `&rest' and `&optional'.
* test/src/eval-tests.el (eval-tests--bugs-24912-and-24913)
(eval-tests-accept-empty-optional-rest): Update tests accordingly.
* etc/NEWS: Update announcement accordingly.
* doc/lispref/functions.texi (Argument List): Update manual to
indicate that variable names are optional.
2018-03-25 07:56:35 -04:00
Paul Eggert
901f13122f * src/process.c (Fsignal_process): Simplify. 2018-03-23 13:14:23 -07:00
Stefan Monnier
3ddff08034 Fix bug#30846, along with misc cleanups found along the way
* test/src/data-tests.el (data-tests-kill-all-local-variables): New test.

* src/buffer.c (swap_out_buffer_local_variables): Remove.
Fuse the body of its loop into that of reset_buffer_local_variables.
(Fkill_buffer, Fkill_all_local_variables): Don't call it any more.
(reset_buffer_local_variables): Make sure the buffer's local binding
is swapped out before removing it from the alist (bug#30846).
Call watchers before actually killing the var.

* src/data.c (Fmake_local_variable): Simplify.
Use swap_in_global_binding to swap out any local binding, instead of
a mix of find_symbol_value followed by messing with where&found.
Don't call swap_in_symval_forwarding since the currently swapped
binding is never one we've modified.
(Fkill_local_variable): Use swap_in_global_binding rather than messing
with where&found to try and trick find_symbol_value into doing the same.

* src/alloc.c (mark_localized_symbol): 'where' can't be a frame any more.
2018-03-23 11:29:06 -04:00
Stefan Monnier
cf3164523b * src/alloc.c: Avoid O(N²) complexity when unchaining markers (bug#24548).
Unchain all dead markers with a single scan of the markers list,
instead of calling the O(N) 'unchain_marker' N times.

(unchain_dead_markers): New function.
(sweep_buffers): Use it.
(gc_sweep): Sweep buffers before markers.
(sweep_misc): Check that markers have been unchained when reclaiming them.
2018-03-23 11:09:54 -04:00
Stefan Monnier
6695c1be51 Merge from origin/emacs-26
b8ebf5fb64 * src/lisp.h (struct Lisp_Buffer_Local_Value): Update comm...
8c92a37cb4 * doc/emacs/trouble.texi: Fix location of `emacs-version' ...
10b1f2fdd5 Explain more about (defvar foo) form (Bug#18059)
68c2f336b1 * doc/lispref/buffers.texi (Buffer List): Fix grammar.
7e720c6851 * doc/lispref/anti.texi (Antinews): Fix grammar.
a6a821d29b * lisp/org/ob-lisp.el (org-babel-lisp-eval-fn): Tweak type.
2018-03-23 11:01:31 -04:00
Noam Postavsky
b8ebf5fb64 * src/lisp.h (struct Lisp_Buffer_Local_Value): Update commentary. 2018-03-23 08:19:42 -04:00
Paul Eggert
d09c488cb5 Port to 32-bit sparc64
Backport from master.
Problem reported by Ulrich Mueller; fix suggested by Eli Zaretskii
and Andreas Schwab (Bug#30855).
* src/alloc.c (mark_memory): Call mark_maybe_object only on
pointers that are properly aligned for Lisp_Object.
2018-03-20 14:39:12 -07:00
Eli Zaretskii
2a1fe08307 Avoid redisplay problems with too wide wrap-prefix
* src/xdisp.c (display_line): Avoid looping in redisplay when
wrap-prefix is set to a too-wide stretch of whitespace.
(Bug#30432)
2018-03-20 19:05:21 +02:00
Paul Eggert
db64a866f6 Port to 32-bit sparc64
Problem reported by Ulrich Mueller; fix suggested by Eli Zaretskii
and Andreas Schwab (Bug#30855).
* src/alloc.c (mark_memory): Call mark_maybe_object only on
pointers that are properly aligned for Lisp_Object.
2018-03-20 09:55:01 -07:00
Paul Eggert
a5f190dd65 Merge from origin/emacs-26
23527013c7 ; Rewrap doc string
4328d5f744 Correct Info link markup
2fb52abd9e Improve documentation of 'with-help-window'
ec08c62f03 Minor improvements in building.texi
663aafe1ff * lisp/textmodes/bibtex.el (bibtex-mark-entry): activate mark
05781b2e88 ; Spelling fix
aa40014ba3 * doc/emacs/building.texi (Starting GUD): Mention 'guiler'.
23072e468f Yet more proofreading of the Emacs manual
ba5a372540 * doc/emacs/rmail.texi: Fix broken link.
6b2210cc29 ; Spelling fix
067c8c4f5b Fix recently-added POP doc glitch
fb3dc0e8aa More proofreading of the Emacs manual
a776ce7be6 Fix typo in the Emacs manual's VC chapter
7f27d42f0b Pass json-readtable-error data as a list (bug#30489)
10bd3b3af8 Improve word motion docs (Bug#30815)
2b8507fbdc Replace "carriage-return" by "carriage return" in manuals
2616cd94f1 Minor copyedits in mule.texi
36a1d52814 Fix problems caused by fontconfig-2.13.0
2018-03-20 08:59:39 -07:00
Paul Eggert
23527013c7 ; Rewrap doc string 2018-03-20 08:58:02 -07:00
Robert Pluim
4328d5f744 Correct Info link markup
* lisp/gnus/gnus-agent.el (gnus-agent-auto-agentize-methods):
Correct markup for Info link.
* src/minibuf.c (Fcompleting_read): Likewise.
2018-03-20 14:30:37 +02:00