[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/caml f49a296 164/197: caml-types.el: Extract the feed
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/caml f49a296 164/197: caml-types.el: Extract the feedback logic to a separate function. |
Date: |
Sat, 21 Nov 2020 01:19:59 -0500 (EST) |
branch: externals/caml
commit f49a296e24327b7f3d992c1072ff8a88f2e80e92
Author: nathan moreau <nathan.moreau@m4x.org>
Commit: Gabriel Scherer <gabriel.scherer@gmail.com>
caml-types.el: Extract the feedback logic to a separate function.
This allows customization. The user just has to redefine the
caml-types-feedback.
---
caml-types.el | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/caml-types.el b/caml-types.el
index 47d840a..306fa5c 100644
--- a/caml-types.el
+++ b/caml-types.el
@@ -21,6 +21,12 @@
(require 'caml-xemacs)
(require 'caml-emacs)))
+(defun caml-types-feedback (info format)
+ "Displays INFO using the given FORMAT."
+ (message (format format info))
+ (with-current-buffer caml-types-buffer
+ (erase-buffer)
+ (insert info)))
(defvar caml-types-build-dirs '("_build" "_obuild")
"List of possible compilation directories created by build systems.
@@ -174,10 +180,7 @@ See `caml-types-location-re' for annotation file format."
(right (caml-types-get-pos target-buf (elt node 1)))
(type (cdr (assoc "type" (elt node 2)))))
(move-overlay caml-types-expr-ovl left right target-buf)
- (with-current-buffer caml-types-buffer
- (erase-buffer)
- (insert type)
- (message (format "type: %s" type)))))))
+ (caml-types-feedback type "type: %s")))))
(if (and (= arg 4)
(not (window-live-p (get-buffer-window caml-types-buffer))))
(display-buffer caml-types-buffer))
@@ -218,10 +221,7 @@ See `caml-types-location-re' for annotation file format."
(right (caml-types-get-pos target-buf (elt node 1)))
(kind (cdr (assoc "call" (elt node 2)))))
(move-overlay caml-types-expr-ovl left right target-buf)
- (with-current-buffer caml-types-buffer
- (erase-buffer)
- (insert kind)
- (message (format "%s call" kind)))))))
+ (caml-types-feedback kind)))))
(if (and (= arg 4)
(not (window-live-p (get-buffer-window caml-types-buffer))))
(display-buffer caml-types-buffer))
@@ -316,10 +316,7 @@ See `caml-types-location-re' for annotation file format."
var-name l-line (- l-cnum l-bol))))))
((string-match external-re kind)
(let ((fullname (match-string 1 kind)))
- (with-current-buffer caml-types-buffer
- (erase-buffer)
- (insert fullname)
- (message (format "external ident: %s" fullname)))))))))))
+ (caml-types-feedback fullname "external ident: %s")))))))))
(if (and (= arg 4)
(not (window-live-p (get-buffer-window caml-types-buffer))))
(display-buffer caml-types-buffer))
- [nongnu] externals/caml a7770e1 141/197: clean up TABs and whitespace, (continued)
- [nongnu] externals/caml a7770e1 141/197: clean up TABs and whitespace, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 16dba2b 150/197: Merge short-paths into a fresh branch of trunk., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml f5ba233 152/197: PR#5954 fix 'defface' use in emacs/caml-help.el (patched by 'zakkak'), Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 22ff4ef 153/197: fix undeclared variable, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d9bc450 156/197: merge branch 4.02 from release 4.02.0 to release 4.02.1, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 633a39e 161/197: Update headers for the new license., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml b499b25 171/197: MPR#7610: caml.el: avoid using deprecated last-command-char variable, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml b2088ca 158/197: GPR#243: Faster test suite, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml a913400 175/197: elisp: cosmetic docstring tweaks, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml c0bf206 169/197: Follow Emacs Lisp conventions for caml.el (#1346), Stefan Monnier, 2020/11/21
- [nongnu] externals/caml f49a296 164/197: caml-types.el: Extract the feedback logic to a separate function.,
Stefan Monnier <=
- [nongnu] externals/caml 4c414a0 180/197: Emacs: Improve colors on dark themes, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 07d301a 174/197: elisp: fixed grammar in docstrings and comments, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 2964c4d 162/197: Add another format to parse compiler output., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 02f8809 184/197: Emacs: use symbol boundaries in regular expressions, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 4c8c8d3 176/197: makefiles: use 'install' instead of 'cp' in 'make install' targets, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml c9e7f57 186/197: Fix most CheckDoc errors., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 78ec6be 185/197: Transform the README to Markdown, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 333d2f4 191/197: Improve syntax highlighting, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml adafe8a 190/197: Add OPAM file, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 466d703 194/197: Minor improvements to the README, Stefan Monnier, 2020/11/21