diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2025-01-19 04:59:22 +0100 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2025-01-19 14:29:41 +0100 |
commit | 251e3d2654ae8e5fdee4624d9af93fb9c0e1b698 (patch) | |
tree | 5058c941d114e9b194310856b5351514e1b09bb5 /src/buffer.c | |
parent | 7362f9f75d5aca1c97f920531dd62763918ba5fe (diff) | |
download | emacs-251e3d2654ae8e5fdee4624d9af93fb9c0e1b698.tar.gz emacs-251e3d2654ae8e5fdee4624d9af93fb9c0e1b698.tar.bz2 emacs-251e3d2654ae8e5fdee4624d9af93fb9c0e1b698.zip |
Replace call[1-8] with calln
Since the introduction of the 'calln' macro, the 'call1', 'call2', ...,
'call8' macros are just aliases for the former. This is slightly
misleading and potentially unhelpful. The number of arguments N can
also easily go out-of-synch with the used alias callN. There is no
reason not to replace these aliases with using 'calln' directly.
To reduce the risk for mistakes, the tool Coccinelle was used to make
these changes. See <https://coccinelle.gitlabpages.inria.fr/website/>.
* src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c:
* src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c:
* src/chartab.c, src/cmds.c, src/coding.c, src/composite.c:
* src/data.c, src/dbusbind.c, src/dired.c, src/doc.c:
* src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c:
* src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c:
* src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c:
* src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c:
* src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c:
* src/pgtkselect.c, src/print.c, src/process.c, src/sort.c:
* src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c:
* src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c:
* src/xmenu.c, src/xselect.c, src/xterm.c:
Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/buffer.c b/src/buffer.c index 158ebbe0c30..1b9092b107b 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -503,7 +503,7 @@ See also `find-buffer-visiting'. */) handler = Ffind_file_name_handler (filename, Qget_file_buffer); if (!NILP (handler)) { - Lisp_Object handled_buf = call2 (handler, Qget_file_buffer, + Lisp_Object handled_buf = calln (handler, Qget_file_buffer, filename); return BUFFERP (handled_buf) ? handled_buf : Qnil; } @@ -558,7 +558,7 @@ run_buffer_list_update_hook (struct buffer *buf) { eassert (buf); if (! (NILP (Vrun_hooks) || buf->inhibit_buffer_hooks)) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + calln (Vrun_hooks, Qbuffer_list_update_hook); } DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 2, 0, @@ -1707,8 +1707,7 @@ This does not change the name of the visited file (if any). */) run_buffer_list_update_hook (current_buffer); - call2 (Quniquify__rename_buffer_advice, - requestedname, unique); + calln (Quniquify__rename_buffer_advice, requestedname, unique); /* Refetch since that last call may have done GC. */ return BVAR (current_buffer, name); @@ -1748,7 +1747,7 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) if (candidate_buffer (buf, buffer) /* If the frame has a buffer_predicate, disregard buffers that don't fit the predicate. */ - && (NILP (pred) || !NILP (call1 (pred, buf)))) + && (NILP (pred) || !NILP (calln (pred, buf)))) { if (!NILP (visible_ok) || NILP (Fget_buffer_window (buf, Qvisible))) @@ -1764,7 +1763,7 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) if (candidate_buffer (buf, buffer) /* If the frame has a buffer_predicate, disregard buffers that don't fit the predicate. */ - && (NILP (pred) || !NILP (call1 (pred, buf)))) + && (NILP (pred) || !NILP (calln (pred, buf)))) { if (!NILP (visible_ok) || NILP (Fget_buffer_window (buf, Qvisible))) @@ -1935,7 +1934,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) { /* Ask whether to kill the buffer, and exit if the user says "no". */ - if (NILP (call1 (Qkill_buffer__possibly_save, buffer))) + if (NILP (calln (Qkill_buffer__possibly_save, buffer))) return unbind_to (count, Qnil); /* Recheck modified. */ modified = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b); @@ -4180,9 +4179,9 @@ call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, while (CONSP (list)) { if (NILP (arg3)) - call4 (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2); + calln (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2); else - call5 (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2, arg3); + calln (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2, arg3); list = XCDR (list); } } |