From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Is there any local variable to avoid asking me to save buffer on kill-buffer? Date: Mon, 16 Dec 2024 09:25:25 -0300 Message-ID: References: <7f8a548d35d21c6436045ce11af22088.support1@rcdrun.com> <874j33bzrd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35090"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help GNU Emacs To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 16 13:26:07 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tNAAo-0008zk-V7 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 16 Dec 2024 13:26:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNAAR-0000hX-8z; Mon, 16 Dec 2024 07:25:43 -0500 Original-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 1tNAAO-0000h5-My for help-gnu-emacs@gnu.org; Mon, 16 Dec 2024 07:25:41 -0500 Original-Received: from mail-yb1-xb2c.google.com ([2607:f8b0:4864:20::b2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNAAM-0000xq-VG; Mon, 16 Dec 2024 07:25:40 -0500 Original-Received: by mail-yb1-xb2c.google.com with SMTP id 3f1490d57ef6-e3988fdb580so3035869276.2; Mon, 16 Dec 2024 04:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734351936; x=1734956736; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kJnqOHYYD5jeiyoVXkQdFTLnvHaMkYFsTxEPKG9bVrE=; b=K025m9AfZg9wueAuhPTGIpLuUIjbY42iA5BE3Y4g6I6cgrGbj69eKS1GvwFDYsXARW a+aI6mKcmxdtip3JhHMTC1kvdU3xMsD6Ph+8Yw5BnAbSDt4DH1N8iH8LjTdXT3bVgC6i RVigyiKsOjKCj1+nLi7VFLeEGOl+dFpxzjzRLMXbu6xhAfRU7Xxy38HoI53Kp9L6oNFm gt7yTGQlotRDi86Sd4JKDssvwmrRxKC/+F91JYfWMgAYNQ/LuQG6zz6ZlXoGI5u8q+qT 7ymeRX7vsHtMZzjxaDjMnLHWXP/vQRorQa4/iGoMDg6ZR4zh2764ZMzk2jfeaZdwPEgv wr9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734351936; x=1734956736; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kJnqOHYYD5jeiyoVXkQdFTLnvHaMkYFsTxEPKG9bVrE=; b=MVCuEL+HiEFXMVxUju7Kz25JntOoe32ooBGQJSgyJbmE3HniAsI+EZ1Fe7CYuF/QKx uh0kCR1rkFzbjF3Qxms0GHzfbQv//FRWsublp/SmMV5g9g8JDGUSNkyr29A6YD7qnwci bm7MYXCGtGRrIFGX1XxMYP90aUHrzbDjMyqrfhEK2QbmKhnK8Z/BsmPu7WsCnr+yaUHZ udHxyzeZ2ag4RM6HKy4r3awR7XtWTOea+XDL0UrKGJ+UEr3orbKyZcqaJ4nIl5x5TbgK /NnTcARgogcrPuj2T6iLOhBDDD2rjZ+UUzbg0ZYTvVe4U1G/WWpECf/ZkvC1ebpJW3BX bIEg== X-Gm-Message-State: AOJu0YxOAT4pY1GT62sxwtN6D9QPuNEJ//hLz+YNJLdOxERdRgJMPg/5 tLFJiNzGprsFQXZc9TZUB5cZxthXubNowXMlPz6flzfLD5u45Wdh7ZjSraf49wTfOBaWB+Gx/bC 8MQiL5L0wCj1dElPFx6gYotPOGfNB/y6C X-Gm-Gg: ASbGncsrdXhbtiWBwGP359rYre9sY+J64fGLao+JM6gZjKiyiG+i+MyOuMh33iHQ8fM ZSjHdN2YP5pbHZR1i9A7eTIf+3xQx6ba0OcfoF+0= X-Google-Smtp-Source: AGHT+IHdapOUyjmAlcpuKQ/53CYGyS5Z0WqpXA4VbivCvHNMNlTfXDvTJbgaHwBzOOOe7+bTw7C0tueX+M2U5ihjru0= X-Received: by 2002:a25:1102:0:b0:e47:4bf7:b3 with SMTP id 3f1490d57ef6-e474bf70824mr4247400276.28.1734351936624; Mon, 16 Dec 2024 04:25:36 -0800 (PST) In-Reply-To: <874j33bzrd.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::b2c; envelope-from=eduardoochs@gmail.com; helo=mail-yb1-xb2c.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148830 Archived-At: On Mon, 16 Dec 2024 at 09:04, Tassilo Horn wrote: > > Jean Louis writes: > > > (defun rcd-temp-buffer-kill-current () > > "Kill current buffer without asking." > > (interactive) > > (let ((buffer-name (buffer-name (current-buffer)))) > > (kill-matching-buffers-no-ask (regexp-quote buffer-name)) > > (message "Killed: " buffer-name))) > > > > I see that above attempt is again asking me, but function is called > > "no-ask". Is that a bug? > > Not really, but a bit strange maybe. kill-matching-buffers-no-ask calls > kill-matching-buffers with no-ask arg set to t. That results in buffers > being killed with kill-buffer instead of kill-buffer-ask. The latter > would require confirmation for any buffer to be killed. > > However, kill-buffer itself will query anyhow in certain cases, > especially when you have unsaved changes in the buffer which you > probably have. > > So it depends on how one interprets "no-ask". The current > interpretation seems to be "don't ask unless you might lose data" in > contrast to "never" which you seem to expect. > > HTH, > Tassilo Hi Jean, I use this in eev, bound to `M-k': (defun ee-kill-this-buffer () "Kill the current buffer with fewer warnings than `kill-this-buffer'. See: (find-eev-quick-intro \"3. Elisp hyperlinks\" \"go back\" \"`M-k'\") and: (find-eval-intro \"`M-k'\")" (interactive) (let ((kill-buffer-query-functions nil)) (kill-this-buffer))) it is simple and IIRC it only asks for confirmation when a buffer has a file associated to it and it is marked as modified... Cheers, Eduardo Ochs http://anggtwu.net/emacsconf2024.html