From unknown Sun Jun 22 11:33:15 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#65877 <65877@debbugs.gnu.org> To: bug#65877 <65877@debbugs.gnu.org> Subject: Status: 29.1; line-number-at-pos crashes with args-out-of-range when ran using emacsclient Reply-To: bug#65877 <65877@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:33:15 +0000 retitle 65877 29.1; line-number-at-pos crashes with args-out-of-range when = ran using emacsclient reassign 65877 emacs submitter 65877 Micha=C3=ABl Cadilhac severity 65877 normal tag 65877 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 11 17:08:43 2023 Received: (at submit) by debbugs.gnu.org; 11 Sep 2023 21:08:43 +0000 Received: from localhost ([127.0.0.1]:54951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfo9C-0005Cm-Ox for submit@debbugs.gnu.org; Mon, 11 Sep 2023 17:08:43 -0400 Received: from lists.gnu.org ([2001:470:142::17]:40758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfo97-0005CV-KB for submit@debbugs.gnu.org; Mon, 11 Sep 2023 17:08:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfo8x-0001KN-ND for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 17:08:27 -0400 Received: from cadilhac.name ([163.172.56.42]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfo8u-00046s-62 for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 17:08:27 -0400 Received: from cadilhac.name (localhost [127.0.0.1]) by cadilhac.name (OpenSMTPD) with ESMTP id f6b806c2 for ; Mon, 11 Sep 2023 21:08:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cadilhac.name; h= mime-version:from:date:message-id:subject:to:content-type; s= default; bh=cfig0wle2Cb0JFKZRRckiU5aJHs=; b=j26bYB+lyEXFkOBgW3iF 06jpeptipEeG5y9TjqU59H3/YaspQSxp5hTJyF8GXSzUJAB4cqmg/f9zlmEGDU1e 4q3gmxzZm8HraNPwJyBnOCo5UMHUQwkElr5RmHlAEcYzWL6MR9r0oStNNDtTv8lJ UJKezJDutNxIgfiWmjLiKJKKHFnE3NmJ3bvjAjcIMZSV/07piElqwBdR2fQ7waBQ E66aeHGDKr136+xQvj/qps/Q/Oi5P/MdbYzeBfEQ7lk0VOmgqgCW9S+k8t2UM8kg TXwBDUifY2vz/PHhpuHzHVzLSIUNIyDEODU3F9GBkzDyDBFdTGvIifgnWl1V0RoS ug== DomainKey-Signature: a=rsa-sha1; c=nofws; d=cadilhac.name; h= mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=M2EdMFSlbCOZq5IAuPamYz1kBCXA5cUjbzb1P643w5bRus zp6z26YUMAcjikaDFQuV/73fbcbVtez281m/qNSB89843lsgRy1Pf7aqryyKwQm5 HpowY1K2AHN+BKJSPjkC35gX8KmuxHrVC+WmqHjPgnRJT/dK5dU/H8G4w327BObv 3KuSz9M38lWKanji2i2q8pvCfkr57n/I8InUPL/Zzkz0Gfneb9nYr0KM7KPBjha2 SdcBaYXn3o04CkM4W49eiu8nPmPEkrypo31hchlOUsEz3Hj4/6ZbROIsLQ9VOM1L d0PfcWgQXPjP6OICQZJ0hhDC3ZnEW2VAfK8+McFw== Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by cadilhac.name (OpenSMTPD) with ESMTPSA id 8bf0e601 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Mon, 11 Sep 2023 21:08:19 +0000 (UTC) Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6bf04263dc8so3647725a34.3 for ; Mon, 11 Sep 2023 14:08:19 -0700 (PDT) X-Gm-Message-State: AOJu0YxhL9+WSFCXL3pVrEan9fTZ73qqzACE+yWGHSb1bBS/tpr6/kmb O3KWdBN06H+kRDjCBLOwthVdMipNb9k5bVllvyM= X-Google-Smtp-Source: AGHT+IH6vEiNrFcskhSXjPb3KdeonO6zYGpp09SU1a2y2FzZ2Pm3LyIrCtpRim20V6ooh1JJXCwHzU7JSQtd3F300Ec= X-Received: by 2002:a05:6358:6f86:b0:134:d128:9f5f with SMTP id s6-20020a0563586f8600b00134d1289f5fmr8553461rwn.9.1694466498583; Mon, 11 Sep 2023 14:08:18 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Micha=C3=ABl_Cadilhac?= Date: Mon, 11 Sep 2023 16:07:42 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: 29.1; line-number-at-pos crashes with args-out-of-range when ran using emacsclient To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=163.172.56.42; envelope-from=michael@cadilhac.name; helo=cadilhac.name X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) How to reproduce: start with $ emacs -Q M-x server-start Open a file with say 200 lines, scroll at the bottom, so that the first line of the file is not at the top of the window. Then in a shell, run: $ emacsclient -e '(line-number-at-pos (window-start))' *ERROR*: Args out of range: 146, 1, 1 This error is unexpected. If the top of the window is visible in the main emacs, this command returns 1. If it isn't, it crashes. Configuration details follow----------------------------------------- In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 System Description: Arch Linux Configured using: 'configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib --with-tree-sitter --localstatedir=/var --with-cairo --disable-build-details --with-harfbuzz --with-libsystemd --with-modules --with-x-toolkit=gtk3 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/emacs/src=/usr/src/debug/emacs -flto=auto' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: server-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils server rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 37743 8089) (symbols 48 5363 0) (strings 32 13739 2164) (string-bytes 1 390492) (vectors 16 9609) (vector-slots 8 155004 11315) (floats 8 22 19) (intervals 56 233 0) (buffers 984 12)) From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 12 07:29:27 2023 Received: (at 65877) by debbugs.gnu.org; 12 Sep 2023 11:29:27 +0000 Received: from localhost ([127.0.0.1]:56298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg1aA-0004Za-T3 for submit@debbugs.gnu.org; Tue, 12 Sep 2023 07:29:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg1a8-0004ZK-VQ; Tue, 12 Sep 2023 07:29:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qg1Zy-0008Fp-Eo; Tue, 12 Sep 2023 07:29:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=a91a41XjaYiQa62pDxgVtGmTX3zX6Eh8Uz6c64ApoUk=; b=lZUcAOWx/+7fMzH5FnOj gcCkYcr3v0kkMaPnszKkNr1kSLXe4uCkEZTDkaFORYjjsbYMp4RLGqffh1Gelw4Me1LFfBC1DsXeK FY6nYsNuTcWOUjcMbkHhp/L7RI3clIYEpKz2vxPn0SFm/BcXNENkN5zAB5qsks3cgxouVgoPd4EDg arwPYXzNWb3w5sNVjFtnGGXZPUrQVnQY/EbdiWjzwkxSm9JSjiRKLlTZWvZNmPVZLGRr1GRxjzd0x 2BY8vBkY0ovzNSU7/VG1H8fkqrc5NEIglJOXrMK/XdF7LamgE4iUf9hPT880pYX1h9MZ5j3Mnf4a7 K7N682trXuFRZg==; Date: Tue, 12 Sep 2023 14:28:59 +0300 Message-Id: <83o7i7pr44.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?Micha=C3=ABl?= Cadilhac In-Reply-To: (message from =?utf-8?Q?Micha=C3=ABl?= Cadilhac on Mon, 11 Sep 2023 16:07:42 -0500) Subject: Re: bug#65877: 29.1; line-number-at-pos crashes with args-out-of-range when ran using emacsclient References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65877 Cc: 65877@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 65877 notabug thanks > From: Michaël Cadilhac > Date: Mon, 11 Sep 2023 16:07:42 -0500 > > How to reproduce: start with > > $ emacs -Q > > M-x server-start > > Open a file with say 200 lines, scroll at the bottom, so that the > first line of the file is not at the top of the window. > > Then in a shell, run: > > $ emacsclient -e '(line-number-at-pos (window-start))' > *ERROR*: Args out of range: 146, 1, 1 This is a cockpit error, not a bug. The doc string of line-number-at-pos says: line-number-at-pos is a built-in function in ‘src/fns.c’. (line-number-at-pos &optional POSITION ABSOLUTE) Return the line number at POSITION in the current buffer. ^^^^^^^^^^^^^^^^^^^^^ So the correct form to evaluate is this: $ emacsclient -e "(with-current-buffer (window-buffer) (line-number-at-pos (window-start)))" IOW, you must make sure the buffer of the selected window is current when the server evaluates the expression. It is not guaranteed by default: $ emacsclient -e "(message \"%s\" (current-buffer))" " *server*" From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 12 11:59:55 2023 Received: (at 65877) by debbugs.gnu.org; 12 Sep 2023 15:59:55 +0000 Received: from localhost ([127.0.0.1]:59848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg5nu-0004EV-O9 for submit@debbugs.gnu.org; Tue, 12 Sep 2023 11:59:54 -0400 Received: from cadilhac.name ([163.172.56.42]:39426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg5ns-0004EM-76 for 65877@debbugs.gnu.org; Tue, 12 Sep 2023 11:59:53 -0400 Received: from cadilhac.name (localhost [127.0.0.1]) by cadilhac.name (OpenSMTPD) with ESMTP id 7bb58512 for <65877@debbugs.gnu.org>; Tue, 12 Sep 2023 15:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cadilhac.name; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:cc:content-type:content-transfer-encoding; s=default; bh=rXd 7g4hNHSV0l5oP5WeyfxQH/b4=; b=YAzX/Q8ifoqxblbFf99GPHJZwKuQVl78Kls m3EuTD1KLJTLLIMllJzAj9KjrjMry5cIdVGUa1++Udvs/oRREdq87qMBQys63THc qfLnnWSQPWLxpYSoxkzSw6PHgmPNAQEcDCblfXRNE5cYJDdl3K2kl5C0db/Cp5N3 nIkvb/OmxoZ6VIYAzqReEg2B4vNisEcEeqHXp1Y9aDFigitS9QliTnzl0RoKSdo5 H9gtOQeUpQ66m+3RgpdfHlfHGxrpPgnkpMTZzF0agAipyqzGzbciIIyj1iUnX9jQ mXFe4zSZQLFdGQ5+zqpIqf78Qm9yAAInMetY5A/hlCIyXPGEX4g== DomainKey-Signature: a=rsa-sha1; c=nofws; d=cadilhac.name; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:cc:content-type:content-transfer-encoding; q=dns; s=default; b= FRw8LxcNEecwxOcs3W2PctkA4eUzrccJLj7h1FbEDdsoZlF+E2eGvAwlxpoUcimb t3GiTEwPv2Mpa81AJvG423jLHyIX/b5UWdyNO5gB72aSMqGlrK36/g0DoYqKO1u4 FctuuGiFiAc73xpWVrK8/d8gnwbDY8NQ/cCQZv3Rr3/wIcUz76au0iPQi6NSg3+w 6yYJ2siy8BQIhxPN5YukNs4Kh3SSKsCHEEgXliCjIGuinY54O5NcCoHYwe8l6h77 DB5Dz6lh4vHYUZlcMPrR1L0HrScvDQ1dSMlXf7QRNFA1uMYpIrz8QqmZuNq8ADMM 7bfb3VfZsFXT0mZj07fF9A== Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by cadilhac.name (OpenSMTPD) with ESMTPSA id 19658555 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <65877@debbugs.gnu.org>; Tue, 12 Sep 2023 15:59:45 +0000 (UTC) Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-76dbe263c68so262227585a.0 for <65877@debbugs.gnu.org>; Tue, 12 Sep 2023 08:59:45 -0700 (PDT) X-Gm-Message-State: AOJu0YzrQEF/m9i0s/C/CB6VK4nl0HUrtuwJyM4ujOD9aS4kLv2Dl4y+ iUsR7gjon1/3gLohn3Jj0ssLNb5gehIwcXxzDIY= X-Google-Smtp-Source: AGHT+IElx7KMWgTbKvm7SevEiQMOYD6R/kZYF5lpXr/Ma5b7GBsrAW6sD/neyW3GHy5cFfI+V/zFwmksjdqdOf//czQ= X-Received: by 2002:a05:620a:4590:b0:76f:b00:4e66 with SMTP id bp16-20020a05620a459000b0076f0b004e66mr3902494qkb.9.1694534384529; Tue, 12 Sep 2023 08:59:44 -0700 (PDT) MIME-Version: 1.0 References: <83o7i7pr44.fsf@gnu.org> In-Reply-To: <83o7i7pr44.fsf@gnu.org> From: =?UTF-8?Q?Micha=C3=ABl_Cadilhac?= Date: Tue, 12 Sep 2023 10:59:08 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: bug#65877: 29.1; line-number-at-pos crashes with args-out-of-range when ran using emacsclient To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 65877 Cc: 65877@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Sep 12, 2023 at 6:29=E2=80=AFAM Eli Zaretskii wrote: > This is a cockpit error, not a bug. The doc string of > line-number-at-pos says: > > line-number-at-pos is a built-in function in =E2=80=98src/fns.c=E2=80= =99. > > (line-number-at-pos &optional POSITION ABSOLUTE) > > Return the line number at POSITION in the current buffer. > ^^^^^^^^^^^^^^^^^^^^^ > > So the correct form to evaluate is this: > > $ emacsclient -e "(with-current-buffer (window-buffer) (line-number-at-= pos (window-start)))" Fantastic, thanks for your help, and apologies for the noise. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 12 12:43:34 2023 Received: (at 65877-done) by debbugs.gnu.org; 12 Sep 2023 16:43:34 +0000 Received: from localhost ([127.0.0.1]:59869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg6UA-0005KA-BC for submit@debbugs.gnu.org; Tue, 12 Sep 2023 12:43:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg6U5-0005Jt-IR for 65877-done@debbugs.gnu.org; Tue, 12 Sep 2023 12:43:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qg6Tv-0005V9-6Y; Tue, 12 Sep 2023 12:43:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=AqXaxa5RC8qG4IZts86o3quKW7FhqSwVX4hdwfiIAsU=; b=Iy4LJfCuoto86Yh53+ZT EM3jD/NH3h3UnZVCMrix0CwH8aMdmtKgZN3+hbCAUg0cERcOn9uV6Udia7GeOe9I1SbV8oivGiRjR w7Xju4m7n+ehdHHRVQ5pOrGjhCbRBVWfIhUUSWpJ2kZHSsqrbj3U9aCo+3cODB93webpYoTpvEWcC d3OJHBH8hP+AdiDxfm5pAoSKuIsAI4sO+lcYvCJZcwhfkatCqoRaQDxTGJkjZmCTdRMFP+RYbx1Qp i2Eun9lg/8llVzRL3Q8QAg3SQUAGtqnT0MxV0KMEOI8wrHZbBtIGZGX6LtfD+V2dQqKfF2XMs64Di cgyYr+vkUFgTLQ==; Date: Tue, 12 Sep 2023 19:43:03 +0300 Message-Id: <83zg1rny08.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?Micha=C3=ABl?= Cadilhac In-Reply-To: (message from =?utf-8?Q?Micha=C3=ABl?= Cadilhac on Tue, 12 Sep 2023 10:59:08 -0500) Subject: Re: bug#65877: 29.1; line-number-at-pos crashes with args-out-of-range when ran using emacsclient References: <83o7i7pr44.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 65877-done Cc: 65877-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michaël Cadilhac > Date: Tue, 12 Sep 2023 10:59:08 -0500 > Cc: 65877@debbugs.gnu.org > > On Tue, Sep 12, 2023 at 6:29 AM Eli Zaretskii wrote: > > > This is a cockpit error, not a bug. The doc string of > > line-number-at-pos says: > > > > line-number-at-pos is a built-in function in ‘src/fns.c’. > > > > (line-number-at-pos &optional POSITION ABSOLUTE) > > > > Return the line number at POSITION in the current buffer. > > ^^^^^^^^^^^^^^^^^^^^^ > > > > So the correct form to evaluate is this: > > > > $ emacsclient -e "(with-current-buffer (window-buffer) (line-number-at-pos (window-start)))" > > Fantastic, thanks for your help, and apologies for the noise. No sweat; I'm therefore closing this bug. From unknown Sun Jun 22 11:33:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 11 Oct 2023 11:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator