all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lin Sun <sunlin7.mail@gmail.com>
To: 70230@debbugs.gnu.org
Subject: bug#70230: 30.0.50; [PATCH] * lisp/master.el (master-says): check nil parameter
Date: Sat, 6 Apr 2024 00:05:29 +0000	[thread overview]
Message-ID: <CABCREdq2KCBk5U8BiY+4=ah4+bXfAwQsbsC9DfXvnQih6qU9eQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

Hi,

The `(master-says)' will trigger an unexpected error message with follow code:

(require 'master)
(master-says)

> Wrong type argument: stringp, nil

The patch tries checking the nil parameter before calling `get-buffer'
to avoid the unexpected err message.

Please help check it. Thanks.

Best regards
Lin

[-- Attachment #2: 0001-lisp-master.el-master-says-check-nil-parameter.patch --]
[-- Type: text/x-patch, Size: 890 bytes --]

From 7a0dcde5fec2b7b7fdd1c74db1440183c11cfca6 Mon Sep 17 00:00:00 2001
From: Lin Sun <sunlin7@hotmail.com>
Date: Fri, 5 Apr 2024 06:58:07 +0000
Subject: [PATCH] * lisp/master.el (master-says): check nil parameter

---
 lisp/master.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/master.el b/lisp/master.el
index 0caf4d7963..4bdf686111 100644
--- a/lisp/master.el
+++ b/lisp/master.el
@@ -136,7 +136,8 @@ master-says-recenter
 (defun master-says (&optional command arg)
   "Display slave buffer and execute COMMAND with ARG in its window."
   (interactive)
-  (if (null (buffer-live-p (get-buffer master-of)))
+  (if (not (and master-of
+                (buffer-live-p (get-buffer master-of))))
       (error "Slave buffer has disappeared")
     (let ((window  (selected-window)))
       (if (not (eq (window-buffer window) (get-buffer master-of)))
-- 
2.20.5


             reply	other threads:[~2024-04-06  0:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06  0:05 Lin Sun [this message]
2024-04-06  8:06 ` bug#70230: 30.0.50; [PATCH] * lisp/master.el (master-says): check nil parameter Eli Zaretskii
2024-04-06 15:25   ` Lin Sun
2024-04-06 15:30     ` Eli Zaretskii
2024-04-06 21:26       ` Lin Sun
2024-04-07  6:17         ` Eli Zaretskii
2024-04-07 14:03           ` Lin Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABCREdq2KCBk5U8BiY+4=ah4+bXfAwQsbsC9DfXvnQih6qU9eQ@mail.gmail.com' \
    --to=sunlin7.mail@gmail.com \
    --cc=70230@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.