From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#2375: 23.0.90; ^ in gnus summary buffer does not work in the nextstep build Date: Thu, 19 Feb 2009 13:29:55 -0500 Message-ID: References: <20090218182725.7F0B564571F@ate.maierh> Reply-To: Stefan Monnier , 2375@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1235069157 19658 80.91.229.12 (19 Feb 2009 18:45:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2009 18:45:57 +0000 (UTC) Cc: Harald Maier To: 2375@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 19 19:47:12 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LaDvM-0007Yd-O3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Feb 2009 19:47:05 +0100 Original-Received: from localhost ([127.0.0.1]:60485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaDu2-0000hY-8o for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Feb 2009 13:45:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LaDs8-0008Sy-P8 for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2009 13:43:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LaDs5-0008RS-FD for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2009 13:43:44 -0500 Original-Received: from [199.232.76.173] (port=33734 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaDs5-0008RL-6Q for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2009 13:43:41 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:50568) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LaDs4-0005rt-Et for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2009 13:43:40 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1JIhZeP018784; Thu, 19 Feb 2009 10:43:36 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n1JIZ3GO015969; Thu, 19 Feb 2009 10:35:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 19 Feb 2009 18:35:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2375 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 2375-submit@emacsbugs.donarmstrong.com id=B2375.123506820514618 (code B ref 2375); Thu, 19 Feb 2009 18:35:03 +0000 Original-Received: (at 2375) by emacsbugs.donarmstrong.com; 19 Feb 2009 18:30:05 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1JIU0Pi014432 for <2375@emacsbugs.donarmstrong.com>; Thu, 19 Feb 2009 10:30:01 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqQEAPcznUlMCpTK/2dsb2JhbACBbtIEhA4Ggz0 X-IronPort-AV: E=Sophos;i="4.38,236,1233550800"; d="scan'208";a="34098179" Original-Received: from 76-10-148-202.dsl.teksavvy.com (HELO ceviche.home) ([76.10.148.202]) by ironport2-out.teksavvy.com with ESMTP; 19 Feb 2009 13:29:54 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 0B9C8B419A; Thu, 19 Feb 2009 13:29:56 -0500 (EST) In-Reply-To: (David Engster's message of "Thu, 19 Feb 2009 13:35:17 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 19 Feb 2009 13:43:43 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:25474 Archived-At: >> I think the bug is in the definition of ns-unput-working-text (or in >> the way ns-unput-working-text and ns-unput-working-text (both events >> and functions) interact). >> >> Not sure why ns-working-overlay was nil in your case, so either >> ns-unput-working-text should be careful to handle the case where that >> variable is nil, or some other code should make sure that it can't be >> nil when we reach ns-unput-working-text. > It seems this is a bug in ns-insert-working-text, and it's already > mentioned there in a FIXME comment: > ;; FIXME: if buffer is read-only, don't try to insert anything > ;; and if text is bound to a command, execute that instead (Bug#1453) > The Gnus group and summary buffers are read only, so what we're dealing > here seems to be a duplicate of Bug #1453. What happens after the patch below? It's not intended to fix #1453. Stefan --- ns-win.el.~1.36.~ 2009-02-07 11:23:03.000000000 -0500 +++ ns-win.el 2009-02-19 13:21:57.000000000 -0500 @@ -779,11 +779,11 @@ -;;;; Composed key sequence handling for Nextstep system input methods. -;;;; (On Nextstep systems, input methods are provided for CJK -;;;; characters, etc. which require multiple keystrokes, and during -;;;; entry a partial ("working") result is typically shown in the -;;;; editing window.) +;; Composed key sequence handling for Nextstep system input methods. +;; (On Nextstep systems, input methods are provided for CJK +;; characters, etc. which require multiple keystrokes, and during +;; entry a partial ("working") result is typically shown in the +;; editing window.) (defface ns-working-text-face '((t :underline t)) @@ -791,11 +791,8 @@ :group 'ns) (defvar ns-working-overlay nil - "Overlay used to highlight working text during compose sequence insert.") -(make-variable-buffer-local 'ns-working-overlay) -(defvar ns-working-overlay-len 0 - "Length of working text during compose sequence insert.") -(make-variable-buffer-local 'ns-working-overlay-len) + "Overlay used to highlight working text during compose sequence insert. +When text is in th echo area, this just stores the length of the working text.") (defvar ns-working-text) ; nsterm.m @@ -825,52 +822,52 @@ (if (ns-in-echo-area) (ns-echo-working-text) (ns-insert-working-text))) (defun ns-unput-working-text () (interactive) - (if (ns-in-echo-area) (ns-unecho-working-text) (ns-delete-working-text))) + (ns-delete-working-text)) (defun ns-insert-working-text () - "Insert contents of ns-working-text as UTF8 string and mark with -ns-working-overlay. Any previously existing working text is cleared first. -The overlay is assigned the face ns-working-text-face." -;; FIXME: if buffer is read-only, don't try to insert anything -;; and if text is bound to a command, execute that instead (Bug#1453) + "Insert contents of `ns-working-text' as UTF8 string and mark with +`ns-working-overlay'. Any previously existing working text is cleared first. +The overlay is assigned the face `ns-working-text-face'." + ;; FIXME: if buffer is read-only, don't try to insert anything + ;; and if text is bound to a command, execute that instead (Bug#1453) (interactive) - (if ns-working-overlay (ns-delete-working-text)) + (ns-delete-working-text) (let ((start (point))) (insert ns-working-text) (overlay-put (setq ns-working-overlay (make-overlay start (point) (current-buffer) nil t)) - 'face 'ns-working-text-face) - (setq ns-working-overlay-len (+ ns-working-overlay-len (- (point) start))))) + 'face 'ns-working-text-face))) (defun ns-echo-working-text () "Echo contents of ns-working-text in message display area. -See ns-insert-working-text." - (if ns-working-overlay (ns-unecho-working-text)) +See `ns-insert-working-text'." + (ns-delete-working-text) (let* ((msg (current-message)) (msglen (length msg)) message-log-max) - (setq ns-working-overlay-len (length ns-working-text)) + (setq ns-working-overlay (length ns-working-text)) (setq msg (concat msg ns-working-text)) - (put-text-property msglen (+ msglen ns-working-overlay-len) + (put-text-property msglen (+ msglen ns-working-overlay) 'face 'ns-working-text-face msg) - (message "%s" msg) - (setq ns-working-overlay t))) + (message "%s" msg))) (defun ns-delete-working-text() - "Delete working text and clear ns-working-overlay." + "Delete working text and clear `ns-working-overlay'." (interactive) - (delete-backward-char ns-working-overlay-len) - (setq ns-working-overlay-len 0) - (delete-overlay ns-working-overlay)) - -(defun ns-unecho-working-text() - "Delete working text from echo area and clear ns-working-overlay." + (cond + ((and (overlayp ns-working-overlay) + ;; Still alive? + (overlay-buffer ns-working-overlay)) + (with-current-buffer (overlay-buffer ns-working-overlay) + (delete-region (overlay-start ns-working-overlay) + (overlay-end ns-working-overlay)) + (delete-overlay ns-working-overlay))) + ((integerp ns-working-overlay) (let ((msg (current-message)) message-log-max) - (setq msg (substring msg 0 (- (length msg) ns-working-overlay-len))) - (message "%s" msg) - (setq ns-working-overlay-len 0) - (setq ns-working-overlay nil))) + (setq msg (substring msg 0 (- (length msg) ns-working-overlay))) + (message "%s" msg)))) + (setq ns-working-overlay nil)) (declare-function ns-convert-utf8-nfd-to-nfc "nsfns.m" (str))