From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Finding packages to enable by default Date: Wed, 11 Dec 2013 05:50:49 +0200 Message-ID: <87k3fcoxk6.fsf@yandex.ru> References: <87mwkgb74k.fsf@yandex.ru> <52A02473.8090005@gmx.at> <87d2laq3e5.fsf@yandex.ru> <52A1890A.2010500@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1386733868 32218 80.91.229.3 (11 Dec 2013 03:51:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Dec 2013 03:51:08 +0000 (UTC) Cc: martin rudalics , Andrew Hyatt , Tom , Bozhidar Batsov , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 11 04:51:13 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VqapN-0006px-1h for ged-emacs-devel@m.gmane.org; Wed, 11 Dec 2013 04:51:13 +0100 Original-Received: from localhost ([::1]:52542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqapM-0006X5-Ly for ged-emacs-devel@m.gmane.org; Tue, 10 Dec 2013 22:51:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqapF-0006Wl-Bo for emacs-devel@gnu.org; Tue, 10 Dec 2013 22:51:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqapA-00046A-BQ for emacs-devel@gnu.org; Tue, 10 Dec 2013 22:51:05 -0500 Original-Received: from mail-ee0-x232.google.com ([2a00:1450:4013:c00::232]:52156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqapA-000461-4Z for emacs-devel@gnu.org; Tue, 10 Dec 2013 22:51:00 -0500 Original-Received: by mail-ee0-f50.google.com with SMTP id c41so2670142eek.9 for ; Tue, 10 Dec 2013 19:50:59 -0800 (PST) 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=o0Uf65vxznFSd5Muf2MDvmlHeBAD/MhvQR7bGAieiSo=; b=OK/zaPrVVaY4lqOii+/bL2IWommLv8nhaCYmfdTQBZCxadOyStmV92aHF50NOFny/c OejyPelBm2ILLEMTF8MkxcQ6Gb1VuyTOdttfeC+BjJhhbx60K9dtc/c5ZUn24CmrUVuk S1QSfJor+sp61OIg7rhJSg1I1LBKu+a3O5xQxn3VmEAkIJFadJfzDxjOTVXEINOghfLv V7cLV7gtFjnXwyO9Nqoao/bRIXHFl11NyFR4t9Z745CtB1yLqZMvJh9TIb5dz4N0KEne hs9RYfsztLnitCA0hhAyM3YxbvwMac6yxXk3bdVOtVvC7xAz6GFp1t4ik8z9KqjW3J2h i7ow== X-Received: by 10.14.3.130 with SMTP id 2mr21265420eeh.36.1386733859298; Tue, 10 Dec 2013 19:50:59 -0800 (PST) Original-Received: from axl ([62.228.136.233]) by mx.google.com with ESMTPSA id n1sm48579038eep.20.2013.12.10.19.50.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 10 Dec 2013 19:50:58 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Fri, 06 Dec 2013 12:30:42 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166274 Archived-At: Stefan Monnier writes: >>> Indeed, we could definitely make it so the cursor stays put while we >>> highlight the other end. >> Good idea. > > Patch welcome. Comments? === modified file 'lisp/simple.el' --- lisp/simple.el 2013-12-03 01:19:24 +0000 +++ lisp/simple.el 2013-12-11 03:40:09 +0000 @@ -6308,8 +6308,15 @@ START can be nil, if it was not found. The function should return non-nil if the two tokens do not match.") +(defvar blink-matching--overlay + (let ((ol (make-overlay (point) (point) nil t))) + (overlay-put ol 'face 'show-paren-match) + (delete-overlay ol) + ol) + "Overlay used to highlight the matching paren.") + (defun blink-matching-open () - "Move cursor momentarily to the beginning of the sexp before point." + "Momentarily highlight the beginning of the sexp before point." (interactive) (when (and (not (bobp)) blink-matching-paren) @@ -6351,13 +6358,18 @@ (message "No matching parenthesis found")))) ((not blinkpos) nil) ((pos-visible-in-window-p blinkpos) - ;; Matching open within window, temporarily move to blinkpos but only - ;; if `blink-matching-paren-on-screen' is non-nil. + ;; Matching open within window, temporarily highlight char + ;; after blinkpos but only if `blink-matching-paren-on-screen' + ;; is non-nil. (and blink-matching-paren-on-screen (not show-paren-mode) (save-excursion - (goto-char blinkpos) - (sit-for blink-matching-delay)))) + (move-overlay blink-matching--overlay blinkpos (1+ blinkpos) + (current-buffer)) + (overlay-put blink-matching--overlay + 'priority show-paren-priority) + (sit-for blink-matching-delay) + (delete-overlay blink-matching--overlay)))) (t (save-excursion (goto-char blinkpos)