From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: some proposed tweaks to HTML mode Date: Thu, 21 Mar 2019 15:53:23 -0700 Message-ID: <87sgvfq1p8.fsf@ericabrahamsen.net> References: <875zsbri7u.fsf@ericabrahamsen.net> <87mulnyilp.fsf@igel.home> <871s2zrh8e.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="107015"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 21 23:54:54 2019 Return-path: Envelope-to: ged-emacs-devel@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 1h76aL-000Rky-Fb for ged-emacs-devel@m.gmane.org; Thu, 21 Mar 2019 23:54:53 +0100 Original-Received: from localhost ([127.0.0.1]:47836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h76aK-0000VG-Dy for ged-emacs-devel@m.gmane.org; Thu, 21 Mar 2019 18:54:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h76ZN-0000T8-CQ for emacs-devel@gnu.org; Thu, 21 Mar 2019 18:53:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h76ZF-0004Ob-N7 for emacs-devel@gnu.org; Thu, 21 Mar 2019 18:53:48 -0400 Original-Received: from [195.159.176.226] (port=54534 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h76ZD-0004JY-Lw for emacs-devel@gnu.org; Thu, 21 Mar 2019 18:53:43 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1h76ZA-000QQb-VD for emacs-devel@gnu.org; Thu, 21 Mar 2019 23:53:40 +0100 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:wJ2nwIg2OOI/gjbNxEHDNiyOHl4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:234504 Archived-At: Eric Abrahamsen writes: > Andreas Schwab writes: > >> On Mär 21 2019, Eric Abrahamsen wrote: >> >>> @@ -1743,6 +1744,8 @@ html-mode-map >>> (define-key map "\C-c1" 'html-headline-1) >>> (define-key map "\C-c\r" 'html-paragraph) >>> (define-key map "\C-c\n" 'html-line) >>> + (define-key map "\C-cd" 'html-div) >>> + (define-key map "\C-cs" 'html-span) >> >> C-c is reserved for the user, and no mode should bind them. > > Ah, thanks for that catch. And I see that's exactly what > `html-quick-keys' is for. I've regularized the keybindings accordingly. And! There was garbage in the re-search-backwards calls. Should look like this (also removed it from the span tag, which shouldn't start a newline): (define-skeleton html-list-item "HTML list item tag." nil (if (re-search-backward "^[[:blank:]]+" (point-at-bol) t) nil '\n) "
  • " _ (if sgml-xml-mode "
  • ")) (define-skeleton html-paragraph "HTML paragraph tag." nil (if (re-search-backward "^[[:blank:]]+" (point-at-bol) t) nil ?\n) "

    " > _ (if sgml-xml-mode "

    ")) (define-skeleton html-div "HTML div tag." nil (if (re-search-backward "^[[:blank:]]+" (point-at-bol) t) nil ?\n) "
    " > \n _ \n "
    " >) (define-skeleton html-span "HTML span tag." nil "" > _ "")