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: Sun, 21 Apr 2019 12:33:56 -0400 Message-ID: <20190421163356.GA8276@holos.localdomain> References: <20170212173200.GA12419@holos.localdomain> <20190404175321.GA2455@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="229167"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.11.4 (2019-03-13) To: 35148@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 21 18:35: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 1hIFQt-000xP5-DO for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Apr 2019 18:35:11 +0200 Original-Received: from localhost ([127.0.0.1]:54986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIFQs-0002M7-El for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Apr 2019 12:35:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIFQl-0002Lx-Px for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 12:35:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIFQj-00050M-VP for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 12:35:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35456) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIFQj-000506-Qk for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 12:35:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIFQj-0000Up-Lc for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 12:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Apr 2019 16:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 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.15558644511835 (code B ref -1); Sun, 21 Apr 2019 16:35:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Apr 2019 16:34:11 +0000 Original-Received: from localhost ([127.0.0.1]:49000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIFPu-0000TW-Q0 for submit@debbugs.gnu.org; Sun, 21 Apr 2019 12:34:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43275) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIFPs-0000TG-5L for submit@debbugs.gnu.org; Sun, 21 Apr 2019 12:34:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:51044) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIFPn-0004Nu-0v for submit@debbugs.gnu.org; Sun, 21 Apr 2019 12:34:03 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIFPl-0002Ie-Pz for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 12:34:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIFPk-0004Mh-J7 for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 12:34:01 -0400 Original-Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:44056) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIFPk-0004MF-81 for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 12:34:00 -0400 Original-Received: by mail-qt1-x844.google.com with SMTP id w5so9949292qtb.11 for ; Sun, 21 Apr 2019 09:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JF/oxFRbS8v4x0EZBcIk7r/M5B5ITvft7LZGDotqo+s=; b=YjWuNekkq1Live4Rrq6/6z/FQhExvbHM4IlKDJEW364s5uxyB/aw+6YEhMQNjAVDsA jzQYZyxQl9mHqC8WkKQ032oldzP7RPXHWk0sWhb04jVkBvh7Q4ZCXChCV47eX0ogr3c9 v4lcRGnP0wX3ekYat34tafqjDnA79zRWhNtbtUsMHQFPo7dKl2IiRJZGV+hWtggVPyH8 SMRjvVeLjQKk+1yp5jORKDExneTL+VrvN6Susgg5pFmT5IKELKljfu/x1OKe16Vu8MMc GBeUTCKcA7gsNke7DYeFZnnbuoNKwPk1gsower5MBel8q24NOBmtCHQI1h1Jdcfm5+e6 SgOQ== 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:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JF/oxFRbS8v4x0EZBcIk7r/M5B5ITvft7LZGDotqo+s=; b=TLIRJFZLiokMY7oQNl3eJDwUmzmCzqeD86CH1l/+xfCOFgHnT02CvWg5Hek7vMcu/V 0xlCvSwvQ7ruu5OmxNeUvkdngKvO5w+0ipcmjjzHyzcYW4pvjLXkwt3vd02KCPCDH6Uy XgoCkJMEDpPRQCq1lhd2Z1yl954tSYl/UYHoLZxvLLRNIAQ6Mnl13EwFgpw3Us9xigVF LXtFcEDSxawBjDH63KUibkMmQd7F0vo/5nOc9z8stHZibZ0RfUNuqIofMS/X+1FLJIiC ZqE3mCvGV33CheDCBotXyED41WkcwaCHCKSLFmaHwSihFq4AMRCocwJrZeU3g/ftVUJM c4iA== X-Gm-Message-State: APjAAAUkaXO1rjdhV4tMtbvE0P724s/986uFDTqovMj1/FJyI85epdFh yDf5ms7J+QTRq/YCxdQX/G5com6EFY8= X-Google-Smtp-Source: APXvYqwb7/Nbfg+GJIe5Ds7WahP0+q/ogRRwla07lQtzHZmPkpWpJNUm007OHUo51jjwaNi1CaCsvg== X-Received: by 2002:a0c:c990:: with SMTP id b16mr12038457qvk.93.1555864438639; Sun, 21 Apr 2019 09:33:58 -0700 (PDT) Original-Received: from holos.localdomain (ip72-205-21-130.dc.dc.cox.net. [72.205.21.130]) by smtp.gmail.com with ESMTPSA id e4sm941768qkl.80.2019.04.21.09.33.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 21 Apr 2019 09:33:57 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20190404175321.GA2455@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:157955 Archived-At: Bumping for attention. I'll push this in a few days or so otherwise. On 04/04/19 at 01:53pm, Mark Oteiza wrote: > 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.