From unknown Sat Sep 13 08:57: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#12586 <12586@debbugs.gnu.org> To: bug#12586 <12586@debbugs.gnu.org> Subject: Status: 24.2.50; "q" in empty vc-diff buffer causes error Reply-To: bug#12586 <12586@debbugs.gnu.org> Date: Sat, 13 Sep 2025 15:57:15 +0000 retitle 12586 24.2.50; "q" in empty vc-diff buffer causes error reassign 12586 emacs submitter 12586 Eric Hanchrow severity 12586 minor tag 12586 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 06 12:45:06 2012 Received: (at submit) by debbugs.gnu.org; 6 Oct 2012 16:45:06 +0000 Received: from localhost ([127.0.0.1]:58394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TKXUv-0000dD-VO for submit@debbugs.gnu.org; Sat, 06 Oct 2012 12:45:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49835) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TKXUr-0000cU-V6 for submit@debbugs.gnu.org; Sat, 06 Oct 2012 12:45:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKXUU-0008OD-H7 for submit@debbugs.gnu.org; Sat, 06 Oct 2012 12:44:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:58612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKXUU-0008O9-EG for submit@debbugs.gnu.org; Sat, 06 Oct 2012 12:44:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKXUR-00083B-IS for bug-gnu-emacs@gnu.org; Sat, 06 Oct 2012 12:44:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKXUP-0008Lt-UQ for bug-gnu-emacs@gnu.org; Sat, 06 Oct 2012 12:44:35 -0400 Received: from mail-qa0-f48.google.com ([209.85.216.48]:48283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKXUP-0008Kh-Og for bug-gnu-emacs@gnu.org; Sat, 06 Oct 2012 12:44:33 -0400 Received: by mail-qa0-f48.google.com with SMTP id c11so1323755qad.0 for ; Sat, 06 Oct 2012 09:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=OpSI+s34PND4m5i43xiHhQnHhALa2sz94attJd3LWdk=; b=ZZY7S0Fk/c5OTdZOJjwUwpfpAD+JBf8AA8Ocq0iSrLOrBahejYj+uzerSbvGfWPTY6 2v2oix58bMMYsXne5XiVS4rSXy2pP+7/CypSKQXfr2C1Prqq+ioibPMGKZq+aL6FrdcN 9n+Lq8jWUFeUgaTfF24zc0JFfwskBwdMOsEZ5iFNbEDvRL+zWmLy9kEMsiWhwoFqPqne rWOkhf5jfeWqszRW3N/zl7aEzRzZkdru+xVklKD+/ECVhURJLt/k1YAHgPETAkhzqGIc LdBhhZ0gyq/f6ewdn7PlkdWJhlD49rYhus0nW19XfF+Qxa6A3qKKNcpRKbens8JgBy6J mQ1w== Received: by 10.49.48.43 with SMTP id i11mr18607509qen.10.1349541872844; Sat, 06 Oct 2012 09:44:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.49.105.195 with HTTP; Sat, 6 Oct 2012 09:44:12 -0700 (PDT) From: Eric Hanchrow Date: Sat, 6 Oct 2012 09:44:12 -0700 Message-ID: Subject: 24.2.50; "q" in empty vc-diff buffer causes error To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) This bug report will be sent to the Bug-GNU-Emacs mailing list and the GNU bug tracker at debbugs.gnu.org. Please check that the From: line contains a valid email address. After a delay of up to one day, you should receive an acknowledgment at that address. Please write in English if possible, as the Emacs maintainers usually do not have translators for other languages. Please describe exactly what actions triggered the bug, and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': * Prepare a version-controlled file These instructions use git, but I've found that the analagous steps using RCS also reproduce the problem. At your shell: #+BEGIN_EXAMPLE $ cd /tmp $ rm -rf x $ mkdir x $ cd x $ git init $ echo Hey baby > frotz $ git add . $ git commit -m "A commit" #+END_EXAMPLE Now we have a git repo that contains a single file. Now visit the file with emacs - C-x C-f /tmp/frotz RET Change the file: - w a s s u p RET C-x C-s Create a *vc-diff* buffer that shows the changes: - C-x v = Restore the file to its checked-in state - C-x v u y e s RET Refresh the *vc-diff* buffer - g At this point, everything is as it should be: we're looking at the file in the upper window, and a (now-empty) *vc-diff* buffer in the lower window. Now try to quit the *vc-diff* buffer: - q I hear the bell ring, and see a message in the echo area: Buffer is read-only: # I was expecting the *vc-diff* window to close, and the *vc-diff* buffer to get buried, which is what _normally_ happens when I type "q". If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /Applications/Emacs.app/Contents/Resources/etc/DEBUG. In GNU Emacs 24.2.50.1 (x86_64-apple-darwin12.1.0, NS apple-appkit-1187.00) of 2012-09-20 on Eric-Hanchrows-MacBook-Air.local Windowing system distributor `Apple', version 10.3.1187 Configured using: `configure '--with-ns' 'CFLAGS=-O2 -arch x86_64' 'LDFLAGS=-L/opt/local/lib' 'CPPFLAGS=-I/opt/local/include'' Important settings: locale-coding-system: nil default enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: diff-auto-refine-mode: t tooltip-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 auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x C-f / t m p / f r t o z / / t m p / f r x f C-M-o W a s s u p C-x C-s C-x v = q C-x v u y e s C-x v = C-M-o C-w W a s s u p C-x C-s C-x v = C-x o C-x v u y e s C-x o g q C-x 0 C-x C-f C-u C-n C-u C-n C-n C-n a y C-x C-f w h e e C-j W a s s u p C-x C-s C-x v v r c R C-x v = H e y C-x C-q H e y SPC b a b y C-x C-s C-x y e y e s C-x v = C-x o C-x v u y e s y e s C-x o g q C-x 0 C-x k C-x k M-> Y o SPC m o m m a C-x C-s C-x v = C-x o C-x o C-x v u y e s g q C-x 1 C-x b m e s s * m e M e C-p M-f M-f M-f M-b C-SPC C-e M-w C-x k C-x k H e y SPC c u z C-x C-s C-x v = q M-x r e p o r t - e m Recent messages: Saving file /tmp/x/frotz... Wrote /tmp/x/frotz Finding changes in /tmp/x/frotz...done Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils vc-arch vc-mtn vc-hg vc-bzr vc-sccs vc-svn vc-cvs vc-rcs help-mode novice dired diff-mode easymenu easy-mmode vc vc-dispatcher vc-git time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind ns multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 06 13:06:18 2012 Received: (at 12586) by debbugs.gnu.org; 6 Oct 2012 17:06:18 +0000 Received: from localhost ([127.0.0.1]:58425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TKXpS-000180-DH for submit@debbugs.gnu.org; Sat, 06 Oct 2012 13:06:18 -0400 Received: from mail-qc0-f172.google.com ([209.85.216.172]:55664) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TKXpQ-00017p-Vp for 12586@debbugs.gnu.org; Sat, 06 Oct 2012 13:06:17 -0400 Received: by mail-qc0-f172.google.com with SMTP id c10so2164115qca.3 for <12586@debbugs.gnu.org>; Sat, 06 Oct 2012 10:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Ic3wRijLASQIHrZjWJCz+jZMbeLhumBvbyIBNx+2WjQ=; b=rJ5X2x3OKfiHU5Yjzsu72THAVQdEYodzUuRswSRnBgHC8pk86SNtamp8ab3wMsja4L McYdM/fUFxz4nEN3RjciBt4CdXRMzmgif1NCa2lqJmx6a0vM4aELKrmY/8Ra2OJVbG8T WB+f36pUmFDeplCwVBHc/7zQy8JgDbYqIjluomGSRDl8tOyHd8OZL3rmC0LJjnt4DZBc 5a+PefuvVjjH/o/Pbe+W/4twVZ8qWywjJMP5kM1WlgWEKg7S3Rzso3p5dG82JwRmuBIH 5WwEpalhJTkqieDCydR2Eg+BWpIda/fQ3h+XjlehV06OzgZiksnSB5DqtXr5AAUuzkvH JS2w== Received: by 10.224.180.132 with SMTP id bu4mr22077012qab.62.1349543154235; Sat, 06 Oct 2012 10:05:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.49.105.195 with HTTP; Sat, 6 Oct 2012 10:05:34 -0700 (PDT) In-Reply-To: References: From: Eric Hanchrow Date: Sat, 6 Oct 2012 10:05:34 -0700 Message-ID: Subject: Re: bug#12586: Acknowledgement (24.2.50; "q" in empty vc-diff buffer causes error) To: 12586@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 12586 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) This patch seems to fix the problem. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 47800bd..c66c4db 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1590,21 +1590,22 @@ Return t if the buffer had changes, nil otherwise." (let ((vc-disable-async-diff (not async))) (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer)) (set-buffer buffer) - (if (and (zerop (buffer-size)) - (not (get-buffer-process (current-buffer)))) + (let ((pop (not + ;; Treat this case specially so as not to pop the buffer. - (progn - (message "%s" (cdr messages)) - nil) - (diff-mode) + (and (zerop (buffer-size)) + (not (get-buffer-process (current-buffer))))))) + (set (make-local-variable 'diff-vc-backend) (car vc-fileset)) (set (make-local-variable 'revert-buffer-function) `(lambda (ignore-auto noconfirm) (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose))) - ;; Make the *vc-diff* buffer read only, the diff-mode key - ;; bindings are nicer for read only buffers. pcl-cvs does the - ;; same thing. - (setq buffer-read-only t) + + (let ((result (if (not pop) + (progn + (message "%s" (cdr messages)) + nil) + ;; Display the buffer, but at the end because it can change point. (pop-to-buffer (current-buffer)) ;; The diff process may finish early, so call `vc-diff-finish' @@ -1616,6 +1617,14 @@ Return t if the buffer had changes, nil otherwise." ;; because we don't know that yet. t))) + ;; Make the *vc-diff* buffer read only, the diff-mode key + ;; bindings are nicer for read only buffers. pcl-cvs does the + ;; same thing. + (diff-mode) + (setq buffer-read-only t) + + result)))) + (defun vc-read-revision (prompt &optional files backend default initial-input) (cond ((null files) From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 20 08:09:29 2012 Received: (at 12586) by debbugs.gnu.org; 20 Oct 2012 12:09:29 +0000 Received: from localhost ([127.0.0.1]:52755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPXrs-0005XU-U3 for submit@debbugs.gnu.org; Sat, 20 Oct 2012 08:09:29 -0400 Received: from mail-vb0-f44.google.com ([209.85.212.44]:35959) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPXrr-0005XJ-07 for 12586@debbugs.gnu.org; Sat, 20 Oct 2012 08:09:27 -0400 Received: by mail-vb0-f44.google.com with SMTP id fc26so1722910vbb.3 for <12586@debbugs.gnu.org>; Sat, 20 Oct 2012 05:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=955TTp4mUKJqmawf+UoLaxESsra09ZzBcLmBoghj/Po=; b=TJ9twC8alr7HWJCEw8pTQ5qbCW+T/DdTCsi9thIfNOyayl0JhLlSrRmsxLxhvagvyj IdGi7F+V53R5XXQ3v8nuxRS6bq6vj9U400PJZf1ezUBOx+sURcFzxrHI82DiWC7HJO7t kOVSUf7cPxkqCKNfSs8vc69vs3Vl0Bon45m6xYpf3a4RNMkTEh+OaiNhF2LMPyVYyzNV ZwHJ7JPkzUdZyJ5iIVW+NppBxaCRG1AKHKpWT8NnOq0rZSbnJRW3GdlurQ+115UINMA7 5Rmcwa9uWdPV0XuNPo8eGJx++42NY9tAukhmORiyYD9+1gHQq4THPVvKsx9nQ6tw/LHG G1Uw== Received: by 10.52.33.165 with SMTP id s5mr4334050vdi.55.1350734866650; Sat, 20 Oct 2012 05:07:46 -0700 (PDT) Received: from ulysses (rrcs-184-75-32-88.nyc.biz.rr.com. [184.75.32.88]) by mx.google.com with ESMTPS id u2sm4134551vdt.11.2012.10.20.05.07.45 (version=SSLv3 cipher=OTHER); Sat, 20 Oct 2012 05:07:45 -0700 (PDT) From: Chong Yidong To: Eric Hanchrow Subject: Re: bug#12586: Acknowledgement (24.2.50; "q" in empty vc-diff buffer causes error) References: Date: Sat, 20 Oct 2012 20:07:44 +0800 In-Reply-To: (Eric Hanchrow's message of "Sat, 6 Oct 2012 10:05:34 -0700") Message-ID: <87happ5otr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 12586 Cc: 12586@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) Eric Hanchrow writes: > This patch seems to fix the problem. Thanks. I committed a slightly simpler one to trunk. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 20 08:09:41 2012 Received: (at control) by debbugs.gnu.org; 20 Oct 2012 12:09:42 +0000 Received: from localhost ([127.0.0.1]:52758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPXs4-0005Xr-Df for submit@debbugs.gnu.org; Sat, 20 Oct 2012 08:09:41 -0400 Received: from mail-vc0-f172.google.com ([209.85.220.172]:53928) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPXs2-0005Xf-IS for control@debbugs.gnu.org; Sat, 20 Oct 2012 08:09:38 -0400 Received: by mail-vc0-f172.google.com with SMTP id fl11so1691337vcb.3 for ; Sat, 20 Oct 2012 05:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=/m8mFFQYzBPK/ACwjiSFerT1lGjibyPTEscjSL+UZgw=; b=E50HqzSuw5MFSUFynltDo5eGQ7CjP2rTS9/+MAabO22RJ2Agfp6i9sMJgtOXprEoaD BBTWhaZt8RwZCvYuWshrFe0lLgRmnJYKZ/19Hieo5IBrTvb0DZp9CgNVZ5uOzgl+NMUY Uxo2rtmVn/seDyJL4vrHT8xu1PPrq0esbe9ofczSCMgI6zx1S9r4bpV9zI3UKrhAjxwa i7iKcWrG8WBRBfOV1k1jz19hssVTWnumJK76FgjwVdLxFpz8lK0I6JDICdZDRak5aLSd cV5jE4t5ImZz+WHISBlgvuCKirxVvjGWyQ54tbJ7pcdusO4xwU2YUF0RbDmt2Fhn+E1o U4uQ== Received: by 10.221.10.81 with SMTP id oz17mr5271816vcb.67.1350734878050; Sat, 20 Oct 2012 05:07:58 -0700 (PDT) Received: from ulysses (rrcs-184-75-32-88.nyc.biz.rr.com. [184.75.32.88]) by mx.google.com with ESMTPS id cz16sm4127281vdb.15.2012.10.20.05.07.56 (version=SSLv3 cipher=OTHER); Sat, 20 Oct 2012 05:07:57 -0700 (PDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 12586 Date: Sat, 20 Oct 2012 20:07:55 +0800 Message-ID: <87k3ull52c.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) close 12586 thanks From unknown Sat Sep 13 08:57: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: Sat, 17 Nov 2012 12:24:04 +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