From 7c609bf6c144619b029a606f107ff42f97183e46 Mon Sep 17 00:00:00 2001 From: David Christiansen Date: Mon, 1 Aug 2016 09:04:14 -0400 Subject: [PATCH] Remove redundant comment command from Emacs mode It is sufficient to set a couple of variables to make the built-in commenting command work for cubical. --- cubicaltt.el | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cubicaltt.el b/cubicaltt.el index 83778d7..3d2023f 100644 --- a/cubicaltt.el +++ b/cubicaltt.el @@ -84,14 +84,6 @@ (,cubicaltt-def-regexp . font-lock-function-name-face)) "Font-lock information, assigning each class of keyword a face.") -(defun cubicaltt-comment-dwim (arg) - "Comment or uncomment current line or region in a smart way, or kill with ARG. - -For details, see `comment-dwim'." - (interactive "*P") - (let ((comment-start "--") (comment-end "")) - (comment-dwim arg))) - (defvar cubicaltt-syntax-table (let ((st (make-syntax-table))) (modify-syntax-entry ?\{ "(}1nb" st) @@ -191,11 +183,14 @@ suggestions for completion rather than too few.") :syntax-table cubicaltt-syntax-table + ;; Make comment-dwim do the right thing for Cubical + (set (make-local-variable 'comment-start) "--") + (set (make-local-variable 'comment-end) "") + ;; Code for syntax highlighting (setq font-lock-defaults '(cubicaltt-font-lock-keywords)) - ;; Modify the keymap - (define-key cubicaltt-mode-map [remap comment-dwim] 'cubicaltt-comment-dwim) + ;; Bind mode-specific commands to keys (define-key cubicaltt-mode-map (kbd "C-c C-l") 'cubicaltt-load) ;; Install the completion handler -- 2.34.1