From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] set-temporary-overlay-map improvement and make windresize exit on other commands Date: Sun, 09 Jun 2013 19:12:16 +0200 Organization: EUR Message-ID: <87d2rvnr7z.fsf@gmail.com> References: <87txlts7so.fsf@mail.jurta.org> <87mwqzo5cb.fsf_-_@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1370797950 10236 80.91.229.3 (9 Jun 2013 17:12:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Jun 2013 17:12:30 +0000 (UTC) Cc: Juri Linkov , bzg@altern.org, Gauthier =?utf-8?Q?=C3=96stervall?= , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 09 19:12:29 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 1UljAK-0008GX-9R for ged-emacs-devel@m.gmane.org; Sun, 09 Jun 2013 19:12:28 +0200 Original-Received: from localhost ([::1]:60714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UljAJ-0006WH-RC for ged-emacs-devel@m.gmane.org; Sun, 09 Jun 2013 13:12:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UljAE-0006W8-Qf for emacs-devel@gnu.org; Sun, 09 Jun 2013 13:12:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UljAB-0003QP-Tu for emacs-devel@gnu.org; Sun, 09 Jun 2013 13:12:22 -0400 Original-Received: from mail-we0-x22b.google.com ([2a00:1450:400c:c03::22b]:33297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UljAB-0003Pt-IM for emacs-devel@gnu.org; Sun, 09 Jun 2013 13:12:19 -0400 Original-Received: by mail-we0-f171.google.com with SMTP id m46so4231481wev.2 for ; Sun, 09 Jun 2013 10:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=W2nIeyKgIcD+UCmPfaxIP87HkhOX6pInm/eKYkQvmnk=; b=ik7fzMiMJCsAMLZnNnvhi/B04w25DwMm63ZSa1VrFJnCAsreDr46b6N6+zK3dbGeyZ gtBjbcY0xmBiRXGoFDehM3ty4VWMQDu49ZY7Nx4WnEqA7clBUL8zDGvOl7d+XygXUGIj qBLw04FVpDdbAhFqMKFXskJ0ESsI+lzS+033FwgXhiJBWZUrisEXVlishl9nFwouGGpO iCdVPwP3bv4m/3LSCbLRKSbdfVeFE9nE8DkiC8EMmfAXmJ8PNvB7yg94vDSpnxcKqud3 oRHoCRPDr0+le24b4f5R2EhEnv2WwUpTjhuGwgNpFlSie0uw0mPumXEf9/EVk9n0ywx8 R7iA== X-Received: by 10.180.184.83 with SMTP id es19mr2907967wic.54.1370797938857; Sun, 09 Jun 2013 10:12:18 -0700 (PDT) Original-Received: from localhost (dhcp-077-249-018-128.chello.nl. [77.249.18.128]) by mx.google.com with ESMTPSA id d10sm7208075wik.0.2013.06.09.10.12.17 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 09 Jun 2013 10:12:17 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 09 Jun 2013 12:03:55 -0400") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::22b 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:160291 Archived-At: --=-=-= Content-Type: text/plain >> Stefan Monnier >> on Sun, 09 Jun 2013 12:03:55 -0400 wrote: [...] >> Second patch is to windresize. Depending on the value of >> windresize-exit-on-other-command, windresize will exit on any other >> command than those defined in windresize-map. I set it to t by >> default. It seems like a nicer default given the discussion on current >> thread. > I don't think it's worth the trouble to keep the > "windresize-exit-on-other-command==nil" option. I agree. It also leads to a simpler code, so here it is. The patch is against elpa branch. It does rely on 'on-exit argument for set-temporary-overlay-map in my other patch. So it makes sense only if windresize becomes part of emacs proper (thing that I infer conceivable from your previous posts). Otherwise an explicit check for versions should be introduced and also windresize-exit-on-other-command probably kept. Vitalie --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-windresize-exit-on-other-commands.patch >From e2784f98c2c7e2a34d03e6b81553c902573854f8 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 9 Jun 2013 18:55:19 +0200 Subject: [PATCH] windresize: exit on other commands * packages/windresize/windresize.el: remove `windresize-other-char' (windresize): use `set-temporary-overlay-map' instead of `overriding-local-map' (windresize-map): Don't bind M-x and C-h in `windresize-map' --- packages/windresize/windresize.el | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/packages/windresize/windresize.el b/packages/windresize/windresize.el index e13dd3f..7378b46 100755 --- a/packages/windresize/windresize.el +++ b/packages/windresize/windresize.el @@ -156,9 +156,6 @@ conflicts between keybindings." (defvar windresize-map (let ((map (make-sparse-keymap))) - (define-key map [remap self-insert-command] 'windresize-other-char) - (define-key map (kbd "M-x") 'windresize-other-char) - (define-key map (kbd "C-h") 'windresize-other-char) ;; move borders outwards or shrink/enlarge (define-key map [left] 'windresize-left) (define-key map [right] 'windresize-right) @@ -240,19 +237,6 @@ conflicts between keybindings." map) "Keymap for `windresize'.") -(defun windresize-other-char () - "Show a message instead of processing `self-insert-command'." - (interactive) - (let* ((key (if current-prefix-arg - (substring (this-command-keys) - universal-argument-num-events) - (this-command-keys)))) - (cond ((vectorp key) (ding)) - ((stringp key) - ;; send warning for only no warning for complex keys and - ;; mouse events - (setq windresize-msg - (cons (format "[`%s' not bound]" key) 1)))))) ;;; Aliases: @@ -364,8 +348,7 @@ will set the new window configuration and exit. (current-window-configuration)) (setq windresize-buffer (current-buffer)) ;; set overriding map and pre/post-command hooks - (setq overriding-terminal-local-map windresize-map) - (setq overriding-local-map-menu-flag t) + (set-temporary-overlay-map windresize-map t 'windresize-exit) (windresize-add-command-hooks) ;; set the initial message (setq windresize-msg -- 1.8.1.2 --=-=-=--