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

41845 commits

Author SHA1 Message Date
Paul Eggert
5ab29400a4 Don’t signal overflow for (expt 1 bignum)
Similarly for (expt 0 bignum) and (expt -1 bignum).
The result is always a -1, 0 or 1, so do not signal overflow.
* src/data.c (expt_integer): Do not signal an overflow if
-1 <= X <= 1.  Be clearer about when overflow is signaled.
* test/src/floatfns-tests.el (bignum-expt): Test this.
2019-11-04 23:39:54 -08:00
Eli Zaretskii
a256e03bd9 Fix last change in dired.c
* src/dired.c (file_name_completion): Fix arguments to
Fcompare_strings.  (Bug#38056)
2019-11-04 17:39:12 +02:00
Stephen Gildea
1d4862e8c1 Fix English grammar in some doc strings and comments
(files.el subr.el): Fix some grammar errors in doc strings and comments.
(frame.c fringe.c image.c xfns.c xterm.c): Fix some English grammar
errors in doc strings.
2019-11-03 18:36:45 -08:00
Eli Zaretskii
0b21ecdb5e Fix case-insensitive completion of non-ASCII file names
* src/dired.c (scmp): Comment on (non)applicability to
comparisons of  non-ASCII strings case-insensitively.
(file_name_completion): Decode early the file names read from
the directory, and use the decoded names for comparison when
letter-case should be ignored.  (Bug#11339)
2019-11-03 18:08:45 +02:00
Eli Zaretskii
3c86424a18 ; * src/font.c (Ffont_info): Minor fix of doc string. 2019-11-03 17:58:31 +02:00
Lars Ingebrigtsen
5c8375bd68 describe-font/font-info works with unloaded fonts
* lisp/international/mule-diag.el (describe-font): This function
can be used on unloaded fonts, so remove that restriction from the
doc string (bug#16815).  Also allow completion over all fonts on
the system.

* src/font.c (Ffont_info): Ditto for the doc string.
2019-11-03 16:33:15 +01:00
Óscar Fuentes
e6b806f29e Fix data-directory when executing from an out-of-source build
Fixes #36828.

* src/callproc.c (init_callproc): detect out-of-source build.
2019-11-02 18:04:00 +01:00
Paul Eggert
3a1e7624ed Fix insert-file-contents file error regression
Problem reported for dired-view-file (Bug#37950).
* src/fileio.c (Finsert_file_contents): When visiting,
signal an error if the file could not be opened for any reason,
rather than signaling an error only for nonexistent files, fixing
a bug introduced in 2019-09-16T03:17:43!eggert@cs.ucla.edu.
2019-10-31 23:32:05 -07:00
Alan Third
fd1b720028 Prevent text flicker with macOS input methods (bug#23412)
* src/nsterm.m ([EmacsView setMarkedText:selectedRange:]): Don't
always delete the working text as ns-put-working-text does that.
2019-10-31 20:40:56 +00:00
Paul Eggert
e65be8cc5b Fix bug with lock file on nonstandard filesystem
* src/filelock.c (create_lock_file):
Don’t disable user write access to the lock file (Bug#37884).
2019-10-30 18:15:53 -07:00
Paul Eggert
f2a72bb8ed Fix print.c infloop on circular lists
Fix infinite loops in print.c when a circular list is passed
to command-error-default-function or to error-message-string.
* src/print.c (print_error_message):
Use FOR_EACH_TAIL to avoid infloop on circular lists.
(print_object): Use FOR_EACH_TAIL_SAFE, as it uses
Brent’s teleporting tortoise-hare algorithm which is
asymptotically better than the classic tortoise-hare
algorithm that the code wsas using.
* test/src/print-tests.el (print-circle-2): When print-circle
is nil, do not insist on a particular cycle-detection heuristic.
(error-message-string-circular): New test.
2019-10-30 14:43:14 -07:00
Paul Eggert
581601e650 Fix keyboard.c infloops on circular lists
Fix infinite loops in keyboard.c when a circular list is
found in a hook, or in help-event-list, or in the argument
of event-convert-list, or in a keymap where a Lucid event
type list is expected, or in a menu or tab spec.
* src/keyboard.c (safe_run_hooks_error, menu_bar_items)
(parse_menu_item, parse_tab_bar_item, parse_tool_bar_item):
Use FOR_EACH_TAIL to avoid infloop on circular lists.
(help_char_p, Fevent_convert_list, lucid_event_type_list_p):
Use FOR_EACH_TAIL_SAFE to avoid infloop on circular lists,
when the action is idempotent so a circular list can be
treated as a noncircular one.
2019-10-30 14:43:14 -07:00
Paul Eggert
40ae02ff50 Fix fileio.c infloops on circular lists
Fix infinite loops in fileio.c when a circular list is the
value of after_insert_file_functions,
buffer-auto-save-file-format, buffer-file-format, or
write-region-annotate-functions.
* src/fileio.c (Finsert_file_contents, build_annotations):
Use FOR_EACH_TAIL to avoid infloop on circular lists.
(build_annotations): Use an EMACS_INT, not an int, to count
nesting level.
* test/src/fileio-tests.el:
(fileio-tests--circular-after-insert-file-functions): New test.
2019-10-30 14:43:14 -07:00
Lars Ingebrigtsen
77d4491391 Revert "Move description of value to syntax-ppss function."
This reverts commit 305dbc7e2b.

Both of the functions in question are used a lot in the sources, so move it back to the more basic function.
2019-10-30 21:26:22 +01:00
Lars Ingebrigtsen
305dbc7e2b Move description of value to syntax-ppss function.
* lisp/emacs-lisp/syntax.el (syntax-ppss): Move the description of
the return value from...

* src/syntax.c (Fparse_partial_sexp): ... here because
`syntax-ppss' is what's called over the place, and jumping through
an indirection to get to the value description is inconvenient.
2019-10-30 13:16:44 +01:00
Jimmy Aguilar Mena
dafc87efd0 Optimize conditional recursive merge face.
* src/xfaces.c (merge_face_vectors) : Pass ATTR_FILTER to
merge_face_ref to stop recursion merging in advance when possible.
(merge_named_face) : add more conditions to potentially reduce calls to
merge_face_vectors in more unneeded situations.
2019-10-29 14:34:00 +01:00
Jimmy Aguilar Mena
e0bcc25f64 Fix extend face in gui interfaces.
* src/xdisp.c (extend_face_to_end_of_line) : Change call to
PRODUCE_GLYPHS with append_stretch_glyph to fill until the windows
border.
2019-10-29 14:34:00 +01:00
Jimmy Aguilar Mena
8ae2a3a46b Fix inherited :extend attribute in faces.
* src/xfaces.c (merge_face_vectors) : Add extra parameter ATTR_FILTER
with the same functionality than in merge_named_face.  Update all
occurrences.
(merge_named_face): Remove condition to avoid call
`merge_face_vectors`.
2019-10-29 14:34:00 +01:00
memeplex
e3cebbb839 Replay key if kboard is interrupted while initializing (Bug#37782)
The problem with the original fix for bug#5095 is that it drops
the current event, which is a valid character event and not -2.
Thus, the first ESC character sent by the terminal after turning
on focus tracking is lost and we get '[' and 'I' events separately
inserted into the buffer afterwards.

* src/keyboard.c (read_key_sequence): Add key as mock_input and replay
sequence using new keyboard, when the key is not -2.
2019-10-26 13:29:29 +03:00
memeplex
16372a5a04 Remove redundant initialization of fringe bitmap (Bug#37756)
* src/fringe.c (Fdefine-fringe-bitmap): Remove redundant zeroing
of fb.bits that only zeroed half of the array anyway.
2019-10-26 13:16:46 +03:00
Eli Zaretskii
b1be40c468 Fix recent changes in documentation
* doc/lispref/edebug.texi (Edebug Eval, Eval List): Reword
recently added text to follow conventions.

* src/textprop.c (Ftext_properties_at): Don't use passive tense
in doc string.
2019-10-22 19:28:58 +03:00
Lars Ingebrigtsen
38021e5559 Make text-properties-at mention describe-text-properties
* src/textprop.c (Ftext_properties_at): Mention
describe-text-properties in the doc string.
2019-10-22 16:54:50 +02:00
Eli Zaretskii
03921902b2 ; Add commentary to w32inevt.c
* src/w32inevt.c (do_mouse_event): Comment on mouse
coordinates in console mouse-wheel events.
2019-10-21 13:32:40 +03:00
Clément Pit-Claudel
435eb82e7b Add a way to disable substitution of command keys in help strings
* src/keyboard.c (help_echo_substitute_command_keys): New function.
(help_echo_echo, parse_menu_item): Use it.
(syms_of_keyboard): Define Qhelp_echo_inhibit_substitution.

* doc/lispref/text.texi (Special Properties), etc/NEWS: Document
the effect of 'help-echo-inhibit-substitution'.
2019-10-20 21:48:38 -04:00
Paul Eggert
9e15df208c Avoid fixnum round trip in prefix-numeric-value
* src/callint.c (Fprefix_numeric_value): Simplify.
2019-10-20 17:41:07 -07:00
Juanma Barranquero
41ba8231ef lisp/*.el: Fix typos and improve some docstrings
* lisp/auth-source.el (auth-source-backend-parse-parameters)
(auth-source-search-collection)
(auth-source-secrets-listify-pattern)
(auth-source--decode-octal-string, auth-source-plstore-search):
* lisp/registry.el (registry-lookup)
(registry-lookup-breaks-before-lexbind)
(registry-lookup-secondary, registry-lookup-secondary-value)
(registry-search, registry-delete, registry-size, registry-full)
(registry-insert, registry-reindex, registry-prune)
(registry-collect-prune-candidates):
* lisp/subr.el (nbutlast, process-live-p):
* lisp/tab-bar.el (tab-bar-list):
* lisp/cedet/ede/linux.el (ede-linux--get-archs)
(ede-linux--include-path, ede-linux-load):
* lisp/erc/erc-log.el (erc-log-all-but-server-buffers):
* lisp/erc/erc-pcomplete.el (pcomplete-erc-commands)
(pcomplete-erc-ops, pcomplete-erc-not-ops, pcomplete-erc-nicks)
(pcomplete-erc-all-nicks, pcomplete-erc-channels)
(pcomplete-erc-command-name, pcomplete-erc-parse-arguments):
* lisp/eshell/em-term.el (eshell-visual-command-p):
* lisp/gnus/gnus-cache.el (gnus-cache-fully-p):
* lisp/gnus/nnmail.el (nnmail-get-active)
(nnmail-fancy-expiry-target):
* lisp/mail/mail-utils.el (mail-string-delete):
* lisp/mail/supercite.el (sc-hdr, sc-valid-index-p):
* lisp/net/ange-ftp.el (ange-ftp-use-smart-gateway-p):
* lisp/net/nsm.el (nsm-save-fingerprint-maybe)
(nsm-network-same-subnet, nsm-should-check):
* lisp/net/rcirc.el (rcirc-looking-at-input):
* lisp/net/tramp-cache.el (tramp-get-hash-table):
* lisp/net/tramp-compat.el (tramp-compat-process-running-p):
* lisp/net/tramp-smb.el (tramp-smb-get-share)
(tramp-smb-get-localname, tramp-smb-read-file-entry)
(tramp-smb-get-cifs-capabilities, tramp-smb-get-stat-capability):
* lisp/net/zeroconf.el (zeroconf-list-service-names)
(zeroconf-list-service-types, zeroconf-list-services)
(zeroconf-get-host, zeroconf-get-domain)
(zeroconf-get-host-domain):
* lisp/nxml/rng-xsd.el (rng-xsd-compile)
(rng-xsd-make-date-time-regexp, rng-xsd-convert-date-time):
* lisp/obsolete/erc-hecomplete.el (erc-hecomplete)
(erc-command-list, erc-complete-at-prompt):
* lisp/org/ob-scheme.el (org-babel-scheme-get-buffer-impl):
* lisp/org/ob-shell.el (org-babel--variable-assignments:sh-generic)
(org-babel--variable-assignments:bash_array)
(org-babel--variable-assignments:bash_assoc)
(org-babel--variable-assignments:bash):
* lisp/org/org-clock.el (org-day-of-week):
* lisp/progmodes/cperl-mode.el (cperl-char-ends-sub-keyword-p):
* lisp/progmodes/gud.el (gud-find-c-expr, gud-innermost-expr)
(gud-prev-expr, gud-next-expr):
* lisp/textmodes/table.el (table--at-cell-p, table--probe-cell)
(table--get-cell-justify-property)
(table--get-cell-valign-property)
(table--put-cell-justify-property)
(table--put-cell-valign-property): Fix typos.

* lisp/so-long.el (fboundp): Doc fix.
(so-long-mode-line-info, so-long-mode)
(so-long--check-header-modes): Fix typos.

* lisp/emulation/viper-mous.el (viper-surrounding-word)
(viper-mouse-click-get-word): Fix typos.
(viper-mouse-click-search-word): Doc fix.

* lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p)
(erc-bounds-of-word-at-point): Fix typos.
(erc-decode-string-from-target, define-erc-response-handler):
Refill docstring.

* lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Fix typo.
(erc-dcc-get-host, erc-dcc-auto-mask-p, erc-dcc-get-file):
Doc fixes.

* lisp/erc/erc-networks.el (erc-network-name): Fix typo.
(erc-determine-network): Refill docstring.

* lisp/net/dbus.el (dbus-list-hash-table)
(dbus-string-to-byte-array, dbus-byte-array-to-string)
(dbus-check-event): Fix typos.
(dbus-introspect-get-property): Doc fix.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler):
Rename ARGS to ARGUMENTS.  Doc fix.
(tramp-adb-sh-fix-ls-output, tramp-adb-execute-adb-command)
(tramp-adb-find-test-command): Fix typos.

* lisp/net/tramp.el (tramp-set-completion-function)
(tramp-get-completion-function)
(tramp-completion-dissect-file-name)
(tramp-completion-dissect-file-name1)
(tramp-get-completion-methods, tramp-get-completion-user-host)
(tramp-get-inode, tramp-get-device, tramp-mode-string-to-int)
(tramp-call-process, tramp-call-process-region)
(tramp-process-lines): Fix typos.
(tramp-interrupt-process): Doc fix.

* lisp/org/ob-core.el (org-babel-named-src-block-regexp-for-name)
(org-babel-named-data-regexp-for-name): Doc fix.
(org-babel-src-block-names, org-babel-result-names): Fix typos.

* lisp/progmodes/inf-lisp.el (lisp-input-filter): Doc fix.
(lisp-fn-called-at-pt): Fix typo.

* lisp/progmodes/xref.el (xref-backend-identifier-at-point):
Doc fix.
(xref-backend-identifier-completion-table): Fix typo.
2019-10-20 12:12:27 +02:00
Eli Zaretskii
2a3577ba11 A better fix for tab-line mouse highlight on TTY frames
* src/dispnew.c (mode_line_string):
* src/xdisp.c (note_mode_line_or_margin_highlight): Remove
recently-added workarounds for incorrect TTY mouse highlight:
they are no longer needed.
(mark_window_display_accurate_1): Set the header_line_p and
tab_line_p flags of the window's current_matrix if the window
displays these.
(display_mode_line): Set the header_line_p and tab_line_p
flags of the window's desired_matrix if the window displays
these.  (Bug#37807)
2019-10-19 10:42:14 +03:00
Paul Eggert
f9744a5f09 Pacify x86 GCC 9 in tab bar code
* src/xdisp.c (tty_get_tab_bar_item): Simplify a bit.  This
pacifies --enable-gcc-warnings with x86 GCC 9.2.1 20190827
(Red Hat 9.2.1-1) when combined with -fsanitize=undefined.
2019-10-18 15:35:15 -07:00
Paul Eggert
f3aa05b1aa Generalize list1i etc. to all signed integer types
* src/lisp.h (list1i, list2i, list3i, list4i):
Accept intmax_t instead of EMACS_INT, and use make_int instead
of make_fixnum.  This should help avoid integer-overflow
problems akin to the Time bug (Bug#37795).
2019-10-18 13:23:11 -07:00
Paul Eggert
b72ff3667a Fix integer-overflow bug in Time conversion
Problem reported by Stefan Monnier (Bug#37795).
* src/keyboard.c (make_lispy_position)
(make_scroll_bar_position, make_lispy_event):
* src/xterm.c (x_ewmh_activate_frame):
Use INT_TO_INTEGER to convert Time to a Lisp integer,
since the value might not be a fixnum.
2019-10-18 13:23:11 -07:00
Eli Zaretskii
2c9128ce13 Fix mouse highlight with tab-line on TTY frames
* src/xdisp.c (note_mode_line_or_margin_highlight):
* src/dispnew.c (mode_line_string): Fix mouse highlight on TTY
frames when both header line and tab-line are displayed.
(Bug#37807)
2019-10-18 18:48:31 +03:00
Eli Zaretskii
5fd1c086e7 Fix handling of mouse events on header line with tab-line
* src/window.c (coordinates_in_window): Fix conditions for
coordinates being on the window's header line when that
window also displays a tab-line.  (Bug#37807)
2019-10-18 17:55:21 +03:00
Juanma Barranquero
3ad407005b lisp/*.el, src/*.c: Doc fixes related to returning t vs non-nil
* lisp/progmodes/flymake-proc.el (flymake-proc--find-buffer-for-file):
Doc fix; return value is a buffer, not t.

* lisp/progmodes/ebrowse.el (ebrowse-member-display-p):
Doc fix; return value is the MEMBER argument, not nil.

* lisp/files.el (hack-one-local-variable-eval-safep):
* lisp/play/doctor.el (doctor-nounp, doctor-pronounp):
* lisp/progmodes/flymake-proc.el (flymake-proc--check-include):
* lisp/progmodes/js.el (js--broken-arrow-terminates-line-p):
Doc fix; a non-nil return value is not always t.

* lisp/image.el (image-type-available-p):
* lisp/simple.el (region-active-p):
* lisp/window.el (frame-root-window-p):
* src/buffer.c (Fbuffer_live_p):
* src/image.c (Finit_image_library):
* src/window.c (Fwindow_minibuffer_p):
Doc fix; a non-nil return value is always t.

* doc/lispref/minibuf.texi (Minibuffer Windows): Doc fix.
2019-10-17 02:45:06 +02:00
Juanma Barranquero
4d65821bf0 Add/fix documentation for widget-apply
* doc/misc/widget.texi (Widget Properties): Document `widget-apply'.

* src/fns.c (Fwidget_apply): Document return value (used in many
places).
2019-10-16 15:39:42 +02:00
Martin Rudalics
d68e8495e0 Handle top margin change in adjust_frame_size
* src/frame.c (adjust_frame_size): Handle case where only
pseudo windows changed height so the top margin has to be
adjusted.
* src/window.c (Fset_window_configuration): Call
adjust_frame_size with inhibit 4.
2019-10-16 11:02:56 +02:00
Juri Linkov
4509aaa5b0 New variable tab-bar-position
* lisp/cus-start.el: Add customization for tab-bar-position.
* src/dispnew.c (syms_of_display): New variable Vtab_bar_position.
(adjust_frame_glyphs_for_window_redisplay): Use it.
2019-10-15 22:41:40 +03:00
Robert Pluim
eda385266e Fix duplicated words in comments
* src/coding.c (encode_string_utf_8):
* src/keyboard.c (syms_of_keyboard):
* src/mini-gmp.c (gmp_lucas_mod, mpz_export):
* src/pdumper.c (dump_set_referrer, dump_queue_compute_score):
* src/timefns.c (Ftime_convert): Remove duplicated words.
2019-10-15 14:28:59 +02:00
Juri Linkov
561570475e Fix initial value of frame-inhibit-implied-resize
* src/frame.c (syms_of_frame): Update doc string and default value of
frame-inhibit-implied-resize in NS to include 'tab-bar-lines.
2019-10-14 22:14:15 +03:00
Jimmy Aguilar Mena
7a10082093 Fix issue calling face_at_pos.
*src/xdisp.c (extend_face_to_end_of_line): Add extra condition when
producing glyphs from a C string to not call face_at_pos.
2019-10-14 14:18:42 +02:00
Jimmy Aguilar Mena
501846c859 Modify face_at_pos to not modify change IT.
src/xdisp.c (face_at_pos): Removed code to that modified
it->start_of_box_run_p and it->face_box_p.  This function should not
modify it.
(handle_face_prop): Added code to update it->start_of_box_run_p and
it->face_box_p.
(underlying_face_id): Input IT made CONST.
2019-10-14 14:18:42 +02:00
Jimmy Aguilar Mena
cc47cd4202 ; extend_face_id and fill_column_indicator corrections
*etc/NEWS: Correction for extend face and add some comments in the
code.
2019-10-14 14:18:42 +02:00
Jimmy Aguilar Mena
424e6f54e5 Document new :extend face attribute in manuals.
Some stylistic corrections in src/xdisp.c and src/xfaces.c.
2019-10-14 14:18:42 +02:00
Jimmy Aguilar Mena
38ee12d5a2 Fixed merge_face_ref recursive calls.
* src/xfaces.c (merge_face_ref): Fixed recursive calls to consider
filter when CONSP (face_ref).
2019-10-14 14:18:41 +02:00
Jimmy Aguilar Mena
92445de0a4 Optimization in extend_face
* src/xdisp.c (extend_face_to_end_of_line): Optimization to void
calls to face_at_pos.
2019-10-14 14:18:41 +02:00
Jimmy Aguilar Mena
acc7209884 Extend_face simplify.
* src/dispextern.h (struct it): Removed extend_face unneeded members.
* src/xdisp.c (handle_face_prop_general): renamed to face_at_pos and
removed input parameter initial_face_id. Updated all occurrences.
2019-10-14 14:18:41 +02:00
Jimmy Aguilar Mena
2b80b4dc46 Added parameter attr_filter to face_at_string_position.
Update all the occurrences in src/xdisp.c and src/xfaces.c
2019-10-14 14:18:41 +02:00
Jimmy Aguilar Mena
ab22720651 Fix last change in append_space_for_newline.
* src/xdisp.c (append_space_for_newline): Code refactor and
 simplification.
2019-10-14 14:18:41 +02:00
Jimmy Aguilar Mena
95d1c3b23e Add space for cursor to work also in terminal.
* src/xdisp.c (append_space_for_newline): Modified to add the space
with the last face also in terminal interface.
(fill_column_indicator_column): Modified to group more conditions.
(extend_face_to_end_of_line): Simplified code in
fill_column_indicator to use the new function.
2019-10-14 14:18:40 +02:00
Jimmy Aguilar Mena
eb259473db Changed handle_face_prop_general prototype.
* src/xdisp.h (handle_face_prop_general): Changed function prototype
to receive different arguments.
2019-10-14 14:18:40 +02:00
Jimmy Aguilar Mena
b5cd6871c0 Fixed extend face filtered for prop.
* src/xfaces.c (face_at_buffer_position): Pass ATTR_FILTER to
merge_face_ref in when !NILP (prop).
2019-10-14 14:18:40 +02:00