On Sat, Oct 22, 2016 at 06:42:08PM -0700, GitHub wrote:
>   Branch: refs/heads/ta/reluctant-news
>   Home:   https://github.com/fvwmorg/fvwm
>   Commit: 58d1a64671c12e93554dd48e6112f6c6e0d921ed
>       
> https://github.com/fvwmorg/fvwm/commit/58d1a64671c12e93554dd48e6112f6c6e0d921ed
>   Author: Thomas Adam <tho...@xteddy.org>
>   Date:   2016-10-23 (Sun, 23 Oct 2016)
> 
>   Changed paths:
>     M NEWS
> 
>   Log Message:
>   -----------
>   NEWS: formatting tweaks

I had always used an Xemacs highlighting mode for the NEWS file
(to highlight formatting inconsistencies).  If we make format
changes, it needs to be adapted.  Anyway, it may be useful to
others, and it might even be put in the git repo.  (attached)

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
;; NEWS file Major Mode for XEmacs (draft)
;
; (C) 2004 Dominik Vogt  <dominik.v...@gmx.de>

; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

; Note: The major mode was designed for xemacs and may or may not work with
; plain emacs.
;
; Copy this file to a lisp library directory, for example
; /usr/share/xemacs/site-lisp or $HOME/share/xemacs/site-lisp
; To acticate put this line in your xemacs configuration file:
;
;   (load-library "news-file.el")
;
; or
;
;   (load-library "<path>/news-file.el")

;; basic mode setup
; option group
(defgroup news-file nil
  "NEWS file mode."
  :tag "NEWS file"
  :group 'wp)

; mode hook
(defcustom news-file-mode-hook
  nil
  "Hook to be run when `news-file-mode' is entered."
  :type 'hook
  :group 'news-file)
;!!!how do you do this the right way?
(add-hook 'news-file-mode-hook (lambda () (setq fill-column 66)))
(add-hook 'news-file-mode-hook 'auto-fill-mode)

; mode map
(defvar news-file-mode-map ()
  "Keymap used in `news-file-mode' buffers.")
(if news-file-mode-map
    ()
  (setq myws-mode-map (make-sparse-keymap))
  ;; So far there aren't any news-file-mode specific functions
  )

; auto mode definition
(add-to-list 'auto-mode-alist '("O*NEWS$" . news-file-mode))

;; syntax highlighting
(defconst news-file-font-lock-keywords
  (list
   ; complain about tabs
   '("  " . highlight)
   ; separator
   '("^--*$" . font-lock-keyword-face)
   ; title + date
   '("^\\(Changes in \\)\\(.*\\)$" (1 font-lock-keyword-face t) (2 highlight t 
t))
   '("^Changes in \\(alpha\\|beta\\|official\\|stable\\|development\\).*$" 1 
font-lock-variable-name-face t)
   '("^Changes in [a-z]*\\( release \\).*$" 1 font-lock-keyword-face t)
   '("^Changes in [a-z]* release \\([0-9]+\\(\\.[0-9]+\\)*\\).*$" (1 
font-lock-variable-name-face t t))
   '("^Changes in [a-z]* release [0-9.]*\\( (\\).*$" 1 font-lock-keyword-face t)
   '("^Changes in [a-z]* release [0-9.]*\\( 
(\\)\\(\\([0-9][0-9]?-\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)-[1-9][0-9][0-9][0-9][0-9]*\\)\\|\\(not
 released yet\\)\\)).*$" (1 font-lock-keyword-face t) (2 
font-lock-variable-name-face t t))
   '("^Changes in [a-z]* release [0-9.]* ([-a-z0-9 ]*\\()\\).*$" 1 
font-lock-keyword-face t)
   ; section
   '("^\\(\\* \\)?[a-z][ a-z]*[a-z]:$" . font-lock-preprocessor-face)
   ; bullets
   '("^\\(\\* \\).*$" 1 font-lock-keyword-face)
   '("^\\( +- \\).*$" 1 font-lock-keyword-face)
   ; faulty lines
   '("^[^ \n].*[^:]$" . highlight)
   '("^.$" . highlight)
   )
  "Minimal highlighting expressions for NEWS file mode")

(defun news-file-mode ()
  "Major mode for editing NEWS files"
  (interactive)
  (kill-all-local-variables)
  (use-local-map news-file-mode-map)
  (setq major-mode 'news-file-mode)
  (setq mode-name "NEWS file")
  (set (make-local-variable 'font-lock-defaults)
       '(news-file-font-lock-keywords nil t))
  (run-hooks 'news-file-mode-hook)
)

(provide 'news-file-mode)

Reply via email to