From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#35148: [PATCH] change wordstar-mode into a minor mode Date: Thu, 4 Apr 2019 13:53:21 -0400 Message-ID: <20190404175321.GA2455@holos.localdomain> References: <20170212173200.GA12419@holos.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="218399"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.11.4 (2019-03-13) Cc: Douglas Quagliana To: 35148@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 04 19:54:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hC6Z1-000ub7-N7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Apr 2019 19:54:11 +0200 Original-Received: from localhost ([127.0.0.1]:58092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hC6Z0-0003HJ-HJ for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Apr 2019 13:54:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hC6Yu-0003FF-2o for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2019 13:54:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hC6Ys-00018e-MS for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2019 13:54:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59351) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hC6Ys-00018I-Db for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2019 13:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hC6Ys-0006QY-B1 for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2019 13:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Apr 2019 17:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35148 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155440042324682 (code B ref -1); Thu, 04 Apr 2019 17:54:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Apr 2019 17:53:43 +0000 Original-Received: from localhost ([127.0.0.1]:44662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hC6YY-0006Q1-Mi for submit@debbugs.gnu.org; Thu, 04 Apr 2019 13:53:43 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hC6YV-0006Pn-Rx for submit@debbugs.gnu.org; Thu, 04 Apr 2019 13:53:41 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:47408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hC6YQ-0007zT-Jq for submit@debbugs.gnu.org; Thu, 04 Apr 2019 13:53:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hC6YP-0003E1-6k for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2019 13:53:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hC6YN-0007ia-Qp for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2019 13:53:33 -0400 Original-Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:40266) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hC6YL-00073K-QR for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2019 13:53:30 -0400 Original-Received: by mail-qt1-x844.google.com with SMTP id x12so4282133qts.7 for ; Thu, 04 Apr 2019 10:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=e7fiaKIlUXw/Xx9IS6Qy10do6cpXNiA7bz4AfiGdJP4=; b=rj1EX69Do8xTUTDrp+gbAQ06ot4XYXpEK9JXypBRCqzSEktZUaQtiXmUFRHPgBgydt 8R4m2Q02fNathyodE5urlyDMpke9BqozVIdHWcvZ0hntuHI0gMDGpFE9k4YlsrEHV4uJ rnR6eFHHOR+w58exL1JRkxVAXQjGn/KmGZJ6BIzKc+amToWy9vZiU+UjDlMkKXGbkG1t 8a9axVoKBqpSiV+wflI8k1ov4bkaLGPka45pHvsrEEijSZvxhaFWVvh5LWKPefc3w+h1 GTx9VpjVnvbUZD4cu1t+vj9CgPCdZNO4JCQRo6zEpu/UbbsfVSQTUF11XizLWZKKTb8F UUbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=e7fiaKIlUXw/Xx9IS6Qy10do6cpXNiA7bz4AfiGdJP4=; b=M8+loZXwH/q38rSwmj+gP6bs6txl7Znxv+VFB5UfG1eeUX3H4jlLIubAyWMidX5U3n HahUPBi0mG2qi/o/4oIUYr5aeqPpW9/UP0TKvpB3tjdKyM7V6kdLHWlVK4wrcU1Ik+C5 11lXsyc1sfGXZEm74wB5nFrPCEdntHB3JFZnW0uAqoF3Cpw+zjdBYi412mFV9R9JzeZD A5G6B1J40KStq5GaAdjibsovWPAnZtbVFs7nx1L1Axoz6nuwCQNkhjHnOiIUXfpKNI1E Tb6ZGynigxhPdsmToFOllbkk5xqjZRRdwnx2Ye+aWKBsgmKosRiIFdpdTzKfo5lmKZnj bhKA== X-Gm-Message-State: APjAAAXcp8BHl6vKDX42TB5jFU1wZ2S+mnDqfz2fuk7A0euyayQBYEa7 4yOkjXdn0TDquaQSuznva7QrWL1UO6mYMw== X-Google-Smtp-Source: APXvYqwELTefo4OUGJYMW26c9T0uW7Qdo4dlL+il2t3qsT/kQFeR4CX7QWJDi1crabniZDkFeGWZqg== X-Received: by 2002:ac8:33dd:: with SMTP id d29mr6616825qtb.320.1554400402976; Thu, 04 Apr 2019 10:53:22 -0700 (PDT) Original-Received: from holos.localdomain (c-24-35-104-121.customer.broadstripe.net. [24.35.104.121]) by smtp.gmail.com with ESMTPSA id j25sm13470521qtc.24.2019.04.04.10.53.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 10:53:22 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20170212173200.GA12419@holos.localdomain> 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.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157173 Archived-At: Hi, I recently got some testing/confirmation that this does work as expected, so pinging the list again to ask what I should do here. I don't have strong feelings over whether this gets nudged out of obsolete/ or gets moved over to ELPA. The original thread is here: https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00467.html On 12/02/17 at 12:32pm, Mark Oteiza wrote: > I was poking through obsolete/ the other day and happened upon > ws-mode.el and subsequently the thread > > https://lists.gnu.org/archive/html/emacs-devel/2015-05/msg00127.html > > The following changes `wordstar-mode' into a minor mode, and also > adds a global minor mode `global-wordstar-mode', which will turn on > wordstar-mode in all buffers except the minibuffer. > > diff --git a/lisp/obsolete/ws-mode.el b/lisp/obsolete/ws-mode.el > index 62cccf725a..f977bc089e 100644 > --- a/lisp/obsolete/ws-mode.el > +++ b/lisp/obsolete/ws-mode.el > @@ -1,4 +1,4 @@ > -;;; ws-mode.el --- WordStar emulation mode for GNU Emacs > +;;; ws-mode.el --- WordStar emulation mode for GNU Emacs -*- lexical-binding: t -*- > > ;; Copyright (C) 1991, 2001-2017 Free Software Foundation, Inc. > > @@ -24,9 +24,20 @@ > > ;;; Commentary: > > -;; This emulates WordStar, with a major mode. > +;; This provides emulation of WordStar with a minor mode. > > ;;; Code: > + > +(defgroup wordstar nil > + "WordStar emulation within Emacs." > + :prefix "wordstar-" > + :prefix "ws-" > + :group 'emulations) > + > +(defcustom wordstar-mode-lighter " WordStar" > + "Lighter shown in the modeline for `wordstar' mode." > + :type 'string) > + > (defvar wordstar-C-k-map > (let ((map (make-keymap))) > (define-key map " " ()) > @@ -98,8 +109,7 @@ wordstar-C-o-map > (define-key map "wh" 'split-window-right) > (define-key map "wo" 'other-window) > (define-key map "wv" 'split-window-below) > - map) > - "") > + map)) > > (defvar wordstar-C-q-map > (let ((map (make-keymap))) > @@ -174,12 +184,9 @@ wordstar-mode-map > ;; wordstar-C-j-map not yet implemented > (defvar wordstar-C-j-map nil) > > - > -(put 'wordstar-mode 'mode-class 'special) > - > ;;;###autoload > -(define-derived-mode wordstar-mode fundamental-mode "WordStar" > - "Major mode with WordStar-like key bindings. > +(define-minor-mode wordstar-mode > + "Minor mode with WordStar-like key bindings. > > BUGS: > - Help menus with WordStar commands (C-j just calls help-for-help) > @@ -189,8 +196,18 @@ wordstar-mode > - Search and replace (C-q a) is only available in forward direction > > No key bindings beginning with ESC are installed, they will work > -Emacs-like.") > - > +Emacs-like." > + :group 'wordstar > + :lighter wordstar-mode-lighter > + :keymap wordstar-mode-map) > + > +(defun turn-on-wordstar-mode () > + (when (and (not (minibufferp)) > + (not wordstar-mode)) > + (wordstar-mode 1))) > + > +(define-globalized-minor-mode global-wordstar-mode wordstar-mode > + turn-on-wordstar-mode) > > (defun wordstar-center-paragraph () > "Center each line in the paragraph at or after point.