all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jeremy Bryant via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 67355@debbugs.gnu.org
Subject: bug#67355: [PATCH] Add doc string to simple.el
Date: Wed, 22 Nov 2023 22:23:37 +0000	[thread overview]
Message-ID: <87msv5e89n.fsf@jeremybryant.net> (raw)
In-Reply-To: <83o7flhnem.fsf@gnu.org>

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

>
>>  (defun kill-buffer--possibly-save (buffer)
>> +  "Prompt user whether to kill BUFFER, possibly saving it first.
>> +
>> +This assumes the buffer is known to be modified."
>
> This prefers the description of what function does to describing its
> role.  I think it is better to do the opposite:
>
>     Ask the user to confirm killing of a modified BUFFER.
>
>   If the user confirms, optionally save BUFFER that is about to be
>   killed.

Style noted, revised patch attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-doc-string-to-simple.el.patch --]
[-- Type: text/x-diff, Size: 810 bytes --]

From 66175becbcd074333b1cd72e033b54a2c3ca061c Mon Sep 17 00:00:00 2001
From: Jeremy Bryant <jb@jeremybryant.net>
Date: Tue, 21 Nov 2023 23:27:44 +0000
Subject: [PATCH] Add doc string to simple.el

* lisp/simple.el (kill-buffer--possibly-save): Add doc string.
---
 lisp/simple.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/simple.el b/lisp/simple.el
index b770d9d7d33..9ef348f74dc 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10863,6 +10863,10 @@ scratch-buffer
   (pop-to-buffer-same-window (get-scratch-buffer-create)))
 
 (defun kill-buffer--possibly-save (buffer)
+  "Ask the user to confirm killing of a modified BUFFER.
+
+If the user confirms, optionally save BUFFER that is about to be
+killed."
   (let ((response
          (cadr
           (read-multiple-choice
-- 
2.40.1


  reply	other threads:[~2023-11-22 22:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 23:33 bug#67355: [PATCH] Add doc string to simple.el Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-22 14:29 ` Eli Zaretskii
2023-11-22 22:23   ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-11-23 15:29     ` Eli Zaretskii
2023-11-22 22:33   ` bug#67355: Maybe update manual - " Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-23 15:27     ` Eli Zaretskii

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=87msv5e89n.fsf@jeremybryant.net \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67355@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jb@jeremybryant.net \
    /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.