Paul Eggert [Thu, 28 Apr 2022 20:40:13 +0000 (13:40 -0700)]
Pacify byte compiler etc. on org-compat, org-macs
Byte-compiler problem reported by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg01256.html
* lisp/org/org-compat.el (org-at-table.el-p):
Now declared in org-table, not org.
(org-string-collate-lessp): Define the ersatz
org-string-collate-lessp with the same API as the primary form, to
pacify check-declare-file when run on org-macs.
* lisp/org/org-macs.el (org-time-convert-to-integer): Declare.
Paul Eggert [Thu, 28 Apr 2022 19:50:39 +0000 (12:50 -0700)]
Change current-time back to list form
Change current-time and related functions back to using the
traditional list form. Also, add a new boolean variable
current-time-list that lets people try out (TICKS . HZ) form,
with the goal of smoothing the transition.
* src/timefns.c (CURRENT_TIME_LIST): Change default back to true.
(current-time-list): New boolean Lisp variable, which defaults to
CURRENT_TIME_LIST. All uses of CURRENT_TIME_LIST changed to
use current_time_list, and all documentation changed.
Eli Zaretskii [Thu, 28 Apr 2022 14:53:36 +0000 (17:53 +0300)]
Improve documentation of font- and face-related attribute functions
* lisp/faces.el (face-attribute):
* src/xfaces.c (Fx_family_fonts):
* src/font.c (Ffont_get, Ffont_put): Improve and clarify the doc
strings.
* doc/lispref/display.texi (Low-Level Font): Document the :type
attribute of a font. Improve documentation of 'font-get' and
'font-put'.
(Attribute Functions): Add cross-reference to the description of
face attributes.
Po Lu [Thu, 28 Apr 2022 12:50:47 +0000 (12:50 +0000)]
Simplify buffer flipping code on Haiku
* src/haikuterm.c (flush_dirty_back_buffers): Delete function.
(haiku_flush_dirty_back_buffer_on): New function.
(haiku_read_socket): Use that instead of looping over each frame
at the end.
Po Lu [Thu, 28 Apr 2022 02:50:18 +0000 (10:50 +0800)]
Stop overriding default Motif colors with our own
* src/xrdb.c (x_load_resources): Instead of specifying the Motif
defaults manually, let Motif set them itself. This makes
palettes provided by color servers work again.
Po Lu [Thu, 28 Apr 2022 01:31:29 +0000 (09:31 +0800)]
Handle display disconnects during DND
* src/xterm.c (handle_one_xevent): Keep track of the display the
drop target is on during DND finish.
(x_connection_closed, x_delete_terminal): Handle display
disconnects during DND correctly.
Stefan Monnier [Wed, 27 Apr 2022 22:14:56 +0000 (18:14 -0400)]
src/xdisp.c: Use same test in `redisplay_window` and `prepare_menu_bars`
This consolidates the test made in those two functions so as to make
sure they agree whether a window needs to be redisplayed.
At the same time, change this test so it uses the window's point
rather than the buffer's point when comparing to `w->last_point`.
* src/xdisp.c (needs_no_redisplay): New function, extracted from
`redisplay_window`.
(redisplay_window, prepare_menu_bars): Use it.
* src/window.c (window_point): New function, extracted from `Fwindow_point`.
(Fwindow_point): Use it.
* src/window.h (window_point): Declare it.
Sean Whitton [Tue, 26 Apr 2022 18:39:38 +0000 (11:39 -0700)]
New user option 'calc-kill-line-numbering'
* lisp/calc/calc.el (calc-kill-line-numbering): New defcustom.
* lisp/calc/calc-yank.el (calc-kill): Unless calc-kill-line-numbering
is non-nil, do not include line numbering in copied text (bug#55133).
* etc/NEWS:
* doc/misc/calc.texi (Killing from the Stack): Document the change.
Ken Brown [Wed, 27 Apr 2022 14:46:57 +0000 (10:46 -0400)]
Implement system_process_attributes on Cygwin
* src/sysdep.c (system_process_attributes) [CYGWIN]: Implement,
using the /proc filesystem. The code is identical to the
GNU/Linux code except for the 'ttname' attribute. (Bug#55153)
* lisp/textmodes/string-edit.el (string-edit)
(read-string-from-buffer): Rework the function arguments so that
they're more similar to `read-string'. Rename symbols throughout
the file from help-text to prompt.
* doc/emacs/killing.texi (Secondary Selection): Document it.
* lisp/isearch.el (isearch-mouse-2): Make isearch respond to
mouse-yank-at-point (bug#7787).
* lisp/mouse.el (mouse-yank-at-point): Mention it.
Po Lu [Wed, 27 Apr 2022 11:19:01 +0000 (19:19 +0800)]
Cleanups to PGTK code
* src/pgtkfns.c (pgtk_explicitly_set_name, pgtk_set_tab_bar_lines)
(pgtk_change_tab_bar_height, pgtk_set_child_frame_border_width)
(pgtk_set_internal_border_width, pgtk_set_cursor_type)
(pgtk_set_mouse_color, pgtk_set_override_redirect, xg_set_icon)
(pgtk_frame_parm_handlers, Fpgtk_set_monitor_scale_factor)
(pgtk_set_scroll_bar_default_width, pgtk_get_focus_frame)
(pgtk_hide_tip, Fx_show_tip, Fx_hide_tip, frame_geometry)
(syms_of_pgtkfns): Clean up coding style and delete incorrect
comments that mostly duplicate what is in xfns.c, and fix
comment coding style. Also rename functions from `x_' to
`pgtk_'.
Po Lu [Wed, 27 Apr 2022 01:10:18 +0000 (09:10 +0800)]
Clean up pointer blanking code
* src/xterm.c (XTtoggle_invisible_pointer): Dispatch to correct
function directly.
(x_probe_xfixes_extension): Return directly based on dpyinfo.
(xfixes_toggle_visible_pointer): Make conditional on
`HAVE_XFIXES'.
(make_invisible_cursor): Initialize `c' correctly.
(x_toggle_visible_pointer): Handle cursor allocation failures.
(x_free_frame_resources): Dispatch with
XTtoggle_visible_pointer.
(x_setup_pointer_blanking): Delete function.
(x_term_init): Initialize blank cursor here instead.
* src/xterm.h (struct x_display_info): New field
`fixes_pointer_blanking'.
Stefan Monnier [Tue, 26 Apr 2022 21:09:03 +0000 (17:09 -0400)]
nadvice.el: Auto-generate the doc describing the "how" arg
* lisp/emacs-lisp/nadvice.el (advice--make-how-alist): New macro.
(advice--how-alist): Use it.
(nadvice--make-docstring): New function.
(add-function, advice-add): Use it to auto-generate the table
describing the accepted values for `how`.
Stefan Monnier [Tue, 26 Apr 2022 20:39:41 +0000 (16:39 -0400)]
nadvice.el: Use OClosures
* lisp/emacs-lisp/nadvice.el (advice): New OClosure type.
(advice--how-alist): Make it hold prototype OClosures rather
than bytecode strings.
(advice--bytecodes): Delete var.
(advice--where): Make it an obsolete alias of new `advice--how`.
(oclosure-interactive-form, cl-print-object) <advice>: New methods.
(advice--make-1): Delete function.
(advice--make): Use `advice-copy` and `advice-cons`.
(advice--tweak): Use `advice-cons`.
(add-function, advice-add): Rename `where` arg to `how`.
Stefan Monnier [Tue, 26 Apr 2022 21:30:29 +0000 (17:30 -0400)]
Pretty print OClosure slot accessors
* lisp/emacs-lisp/oclosure.el (oclosure--accessor-cl-print): New function.
* lisp/emacs-lisp/cl-print.el (cl-print-object) <accessor>: New method.
* test/lisp/emacs-lisp/nadvice-tests.el (advice-test-call-interactively):
Avoid `defun` within a function.
Alex Schroeder [Sun, 24 Apr 2022 11:33:09 +0000 (13:33 +0200)]
Fix error in rcirc for IRC tags without values
* src/lisp/net/rcirc.el (rcirc-process-server-response-1): If the
optional value for a tag is not present, do not call
replace-regexp-in-string on it. If (match-string 2 tag) is
nil, the STRING argument for the replace-regexp-in-string is nil,
which results in an error.
Stefan Monnier [Tue, 26 Apr 2022 14:36:52 +0000 (10:36 -0400)]
New generic function `oclosure-interactive-form`
It's used by `interactive-form` when it encounters an OClosure.
This lets one compute the `interactive-form` of OClosures
dynamically by adding appropriate methods.
This does not include support for `command-modes` for Oclosures.
* lisp/simple.el (oclosure-interactive-form): New generic function.
* src/data.c (Finteractive_form): Delegate to
`oclosure-interactive-form` if the arg is an OClosure.
(syms_of_data): New symbol `Qoclosure_interactive_form`.
* src/eval.c (Fcommandp): Delegate to `interactive-form` if the arg is
an OClosure.
* src/lisp.h (VALID_DOCSTRING_P): New function, extracted from
`store_function_docstring`.
* src/doc.c (store_function_docstring): Use it.
* lisp/kmacro.el (kmacro): Don't carry any interactive form.
(oclosure-interactive-form) <kmacro>: New method, instead.
* test/lisp/emacs-lisp/oclosure-tests.el (oclosure-interactive-form)
<oclosure-test>: New method.
(oclosure-test-interactive-form): New test.
* lisp/help-fns.el (help-fns--insert-menu-bindings): Only insert
the heading if it turns out that we actually find the menu.
(help-fns--insert-bindings): Tweak calling convention.
Po Lu [Tue, 26 Apr 2022 04:38:52 +0000 (12:38 +0800)]
Fix event mask of activation client message
* src/xterm.c (x_alloc_lighter_color):
(x_get_scale_factor): Minor formatting fixes.
(x_ewmh_activate_frame): Fix event mask used to send message to
the root window.
Fix Ruby indentation with double splat as first block param
* lisp/progmodes/ruby-mode.el (ruby-smie--forward-token)
(ruby-smie--backward-token): Tokenize "**" separately from "|".
Problem reported at https://github.com/dgutov/robe/issues/136.
Po Lu [Tue, 26 Apr 2022 01:19:56 +0000 (01:19 +0000)]
Cache relief colors on Haiku since their computation is expensive
* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame):
Clear `relief_background'.
* src/haikuterm.c (haiku_calculate_relief_colors): Cache relief
colors for each frame.
* src/haikuterm.h (struct haiku_output): New fields for caching
the last relief color.
Paul Eggert [Mon, 25 Apr 2022 18:56:48 +0000 (11:56 -0700)]
Support (encode-time (list s m h D M Y))
* src/timefns.c (Fencode_time): Add support for a 6-elt list arg.
Requested by Max Nikulin for Org (bug#54764).
* test/src/timefns-tests.el (encode-time-alternate-apis): New test.
Alan Third [Tue, 19 Apr 2022 04:05:17 +0000 (05:05 +0100)]
Fix nsmenu compilation under macOS 10.6
* src/nsmenu.m ([EmacsMenu fillWithWidgetValue:]): Replace modern
shorthand dictionary and array definitions.
* src/nsterm.h (NSTextAlignmentRight): Redefine if necessary.
* src/macfont.m (mac_font_create_preferred_family_for_attributes):
isOperatingSystemAtLeastVersion is new in macOS 10.10, so it's
probably wrong to use it to check whether we're below 10.9.
(mac_font_copy_default_descriptors_for_language):
(mac_font_copy_default_name_for_charset_and_languages): It seems these
functions are only used on macOS 10.8 and below.
* src/nsterm.m ([NSColor colorUsingDefaultColorSpace]): Use the
generic colorspace.
(ns_parent_window_rect):
(ns_frame_scale_factor):
([EmacsWindow setParentChildRelationships]): Fix macOS version stuff.
Michael Albinus [Mon, 25 Apr 2022 10:57:01 +0000 (12:57 +0200)]
Add test for Tramp password handling
* lisp/net/tramp.el (tramp-error-show-message-timeout): New defvar.
(tramp-error-with-buffer, tramp-user-error): Use it.
* test/lisp/net/tramp-tests.el (tramp-error-show-message-timeout):
Set it to nil.
(tramp-test46-read-password): New test.
(tramp-test47-auto-load, tramp-test47-delay-load)
(tramp-test47-recursive-load, tramp-test47-remote-load-path)
(tramp-test48-unload):
* test/lisp/net/tramp-archive-tests.el (tramp-archive-test47-auto-load)
(tramp-archive-test47-delay-load): Rename.
* lisp/textmodes/string-edit.el (string-edit)
(read-string-from-buffer): Make doc strings use dynamic key
bindings.
(string-edit): Fix message at the end.