aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2023-06-17 10:49:45 +0300
committerEli Zaretskii2023-06-17 10:49:45 +0300
commit84d2da003e1c2acc2dddd7b6bc271cb6e1af9755 (patch)
tree80dcb0fe3756fc33f04953385c922129ab174a85
parent0a1459f1d9bcff32d11026a5b20ab6416020c0ae (diff)
downloademacs-84d2da003e1c2acc2dddd7b6bc271cb6e1af9755.tar.gz
emacs-84d2da003e1c2acc2dddd7b6bc271cb6e1af9755.zip
; Fix example in the Flymake manual
* doc/misc/flymake.texi (An annotated example backend): Fix the example. (Bug#64070)
-rw-r--r--doc/misc/flymake.texi9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index c7c46896709..66dba8a1d3c 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -738,9 +738,13 @@ The following code needs lexical binding (@pxref{Using Lexical
738Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active. 738Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active.
739 739
740@example 740@example
741@group
741;;; ruby-flymake.el --- A ruby Flymake backend -*- lexical-binding: t; -*- 742;;; ruby-flymake.el --- A ruby Flymake backend -*- lexical-binding: t; -*-
743(require 'cl-lib)
742(defvar-local ruby--flymake-proc nil) 744(defvar-local ruby--flymake-proc nil)
745@end group
743 746
747@group
744(defun ruby-flymake (report-fn &rest _args) 748(defun ruby-flymake (report-fn &rest _args)
745 ;; Not having a ruby interpreter is a serious problem which should cause 749 ;; Not having a ruby interpreter is a serious problem which should cause
746 ;; the backend to disable itself, so an @code{error} is signaled. 750 ;; the backend to disable itself, so an @code{error} is signaled.
@@ -754,7 +758,9 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active.
754 ;; 758 ;;
755 (when (process-live-p ruby--flymake-proc) 759 (when (process-live-p ruby--flymake-proc)
756 (kill-process ruby--flymake-proc)) 760 (kill-process ruby--flymake-proc))
761@end group
757 762
763@group
758 ;; Save the current buffer, the narrowing restriction, remove any 764 ;; Save the current buffer, the narrowing restriction, remove any
759 ;; narrowing restriction. 765 ;; narrowing restriction.
760 ;; 766 ;;
@@ -820,11 +826,14 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active.
820 ;; 826 ;;
821 (process-send-region ruby--flymake-proc (point-min) (point-max)) 827 (process-send-region ruby--flymake-proc (point-min) (point-max))
822 (process-send-eof ruby--flymake-proc)))) 828 (process-send-eof ruby--flymake-proc))))
829@end group
823 830
831@group
824(defun ruby-setup-flymake-backend () 832(defun ruby-setup-flymake-backend ()
825 (add-hook 'flymake-diagnostic-functions 'ruby-flymake nil t)) 833 (add-hook 'flymake-diagnostic-functions 'ruby-flymake nil t))
826 834
827(add-hook 'ruby-mode-hook 'ruby-setup-flymake-backend) 835(add-hook 'ruby-mode-hook 'ruby-setup-flymake-backend)
836@end group
828@end example 837@end example
829 838
830@node The legacy Proc backend 839@node The legacy Proc backend