From cdc1ebb9413fb4db15aa5a3175bcb6db3ce02609 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 7 Aug 2013 19:37:04 +0300 Subject: [PATCH] Minor fixes in lisp/progmodes/dos.el. lisp/progmodes/dos.el (dos-font-lock-keywords): Rename LINUX to UNIX and add a few popular commands found in batch files. (dos, dos-label-face, dos-cmd-help, dos-run, dos-run-args) (dos-mode): Doc fixes. --- lisp/ChangeLog | 7 +++++++ lisp/progmodes/dos.el | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6ccb8d61836..4b670eb2f8b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-08-07 Eli Zaretskii + + * progmodes/dos.el (dos-font-lock-keywords): Rename LINUX to UNIX + and add a few popular commands found in batch files. + (dos, dos-label-face, dos-cmd-help, dos-run, dos-run-args) + (dos-mode): Doc fixes. + 2013-08-07 Stefan Monnier * progmodes/dos.el (auto-mode-alist): Add entries for dos-mode. diff --git a/lisp/progmodes/dos.el b/lisp/progmodes/dos.el index adc94f201a6..593b5e9fc92 100644 --- a/lisp/progmodes/dos.el +++ b/lisp/progmodes/dos.el @@ -53,14 +53,14 @@ ;; 1 Preamble (defgroup dos nil - "Major mode for editing Dos scripts." + "Major mode for editing DOS/Windows batch files." :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) :group 'languages) ;; 2 User variables (defface dos-label-face '((t :weight bold)) - "Font Lock mode face used to highlight Dos labels." + "Font Lock mode face used to highlight labels in batch files." :group 'dos) ;; 3 Internal variables @@ -77,8 +77,8 @@ (CONTROLFLOW '("call" "cmd" "defined" "do" "else" "equ" "exist" "exit" "for" "geq" "goto" "gtr" "if" "in" "leq" "lss" "neq" "not" "start")) - (LINUX - '("cat" "cp" "ls" "mv" "rm"))) + (UNIX + '("bash" "cat" "cp" "fgrep" "grep" "ls" "sed" "sh" "mv" "rm"))) `(("\\<_\\(call\\|goto\\)\\_>[ \t]+%?\\([A-Za-z0-9-_\\:.]+\\)%?" (2 font-lock-constant-face t)) ("^[ \t]*\\(@?rem\\_>\\|::\\).*" @@ -96,7 +96,7 @@ (,(concat "\\_<" (regexp-opt COMMANDS) "\\_>") . font-lock-builtin-face) (,(concat "\\_<" (regexp-opt CONTROLFLOW) "\\_>") . font-lock-keyword-face) - (,(concat "\\_<" (regexp-opt LINUX) "\\_>") + (,(concat "\\_<" (regexp-opt UNIX) "\\_>") . font-lock-warning-face))))) (defvar dos-menu @@ -138,7 +138,7 @@ ;; 4 User functions (defun dos-cmd-help (cmd) - "Show help for Dos command CMD." + "Show help for batch file command CMD." (interactive "sHelp: ") (if (string-equal cmd "net") ;; FIXME: liable to quoting nightmare. Use call-process? @@ -151,19 +151,19 @@ (switch-to-buffer "*Help*") (delete-other-windows) (message nil)) (defun dos-run () - "Run Dos script." + "Run a batch file." (interactive) ;; FIXME: liable to quoting nightmare. Use call/start-process? (save-buffer) (shell-command buffer-file-name)) (defun dos-run-args (args) - "Run Dos script with ARGS." + "Run a batch file with ARGS." (interactive "sArgs: ") ;; FIXME: Use `compile'? (shell-command (concat buffer-file-name " " args))) (defun dos-template () - "Insert minimal Dos template." + "Insert minimal batch file template." (interactive) (goto-char (point-min)) (insert "@echo off\nsetlocal\n\n")) @@ -174,11 +174,11 @@ ;;;###autoload (define-derived-mode dos-mode prog-mode "Dos" - "Major mode for editing Dos scripts.\n + "Major mode for editing DOS/Windows batch files.\n The `dos-mode-help' command shows this page.\n -Start a new script from `dos-template'. Read help pages for Dos commands with -`dos-cmd-help'. Navigate between sections using `imenu'. Run script using -`dos-run' and `dos-run-args'.\n +Start a new script from `dos-template'. Read help pages for Dos commands +with `dos-cmd-help'. Navigate between sections using `imenu'. +Run script using `dos-run' and `dos-run-args'.\n \\{dos-mode-map}" (setq-local comment-start "rem ") (setq-local font-lock-defaults -- 2.11.4.GIT