[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog 031c07ac93 076/166: DOC: document the Prolog me
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog 031c07ac93 076/166: DOC: document the Prolog messages buffer |
Date: |
Fri, 30 Sep 2022 04:59:27 -0400 (EDT) |
branch: elpa/sweeprolog
commit 031c07ac939348e3ec9403f3b2611e8e31278422
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
DOC: document the Prolog messages buffer
---
README.org | 47 +++++++++++++++++++++++++++++++++++------------
sweep.el | 25 +++++++++++++++++++------
2 files changed, 54 insertions(+), 18 deletions(-)
diff --git a/README.org b/README.org
index e9d9cea09b..7d98fd940a 100644
--- a/README.org
+++ b/README.org
@@ -409,17 +409,6 @@ For example, typing =C-x C-f library(pldoc/doc_man)= will
open the
source of the =pldoc_man= module from the Prolog library, and likewise
=C-x C-f pack(.)= will open the Prolog packages directory.
-* Installing Prolog packages
-:PROPERTIES:
-:CUSTOM_ID: prolog-packages
-:END:
-
-#+FINDEX: sweep-pack-install
-The command =M-x sweep-pack-install= can be used to install
-or upgrade a SWI-Prolog =pack=. When selecting a =pack= to install, the
-completion candidates are annotated with description and the version
-of each package.
-
* Quick access to =sweep= commands
:PROPERTIES:
:CUSTOM_ID: quick-command-access
@@ -436,7 +425,41 @@ to a prefix key, e.g. =C-c p=, use:
#+end_src
As an example, with the above binding the =sweep= top-level can be
-access from anywhere with =C-c p t=.
+accessed from anywhere with =C-c p t=, which invokes the command
+=sweep-top-level=.
+
+* Examining Prolog messages
+
+#+CINDEX: messages
+#+VINDEX: sweep-messages-buffer-name
+Messages emitted by the embedded Prolog are redirected by =sweep= to a
+dedicated Emacs buffer. By default, the =sweep= messages buffer is
+named =*sweep Messages*=. To instruct =sweep= to use another buffer name
+instead, type =M-x customize-option RET sweep-messages-buffer-name RET=
+and set the option to a suitable value.
+
+The =sweep= messages buffer uses the minor mode =compilation-minor-mode=,
+which allows for jumping to source locations indicated in errors and
+warning directly from the corresponding message in the =sweep= messages
+buffer. For more information about the features enabled by
+=compilation-minor-mode=, see [[info:emacs#Compilation Mode][Compilation Mode
in the Emacs manual]].
+
+#+FINDEX: sweep-view-messages
+=sweep= includes the command =sweep-view-messages= for quickly switching
+to the =sweep= messages buffer. This command is bound by default in
+=sweep-prefix-map= to the =e= key (see [[Quick access to =sweep= commands]]).
+
+* Installing Prolog packages
+:PROPERTIES:
+:CUSTOM_ID: prolog-packages
+:END:
+
+#+FINDEX: sweep-pack-install
+The command =M-x sweep-pack-install= can be used to install
+or upgrade a SWI-Prolog =pack=. When selecting a =pack= to install, the
+completion candidates are annotated with description and the version
+of each package.
+
#+html: <!--
diff --git a/sweep.el b/sweep.el
index 1fa56f7970..0c54a88c54 100644
--- a/sweep.el
+++ b/sweep.el
@@ -32,6 +32,12 @@
"SWI-Prolog Embedded in Emacs."
:group 'prolog)
+(defcustom sweep-messages-buffer-name "*sweep Messages*"
+ "The name of the buffer to use for logging Prolog messages."
+ :package-version '((sweep . "0.1.1"))
+ :type 'string
+ :group 'sweep)
+
(defcustom sweep-read-module-prompt "Module: "
"Prompt used for reading a Prolog module name from the minibuffer."
:package-version '((sweep . "0.1.0"))
@@ -107,13 +113,19 @@
(require 'sweep-module))
(error "Sweep will not work until `sweep-module' is compiled!"))))
-
-(defvar sweep-messages-buffer nil)
+(defun sweep-view-messages ()
+ "View the log of recent Prolog messages."
+ (interactive)
+ (with-current-buffer (get-buffer-create sweep-messages-buffer-name)
+ (goto-char (point-max))
+ (let ((win (display-buffer (current-buffer))))
+ (set-window-point win (point))
+ win)))
(defun sweep-setup-message-hook ()
- (with-current-buffer
- (setq sweep-messages-buffer (get-buffer-create "*sweep-messages*"))
- (compilation-minor-mode))
+ (with-current-buffer (get-buffer-create sweep-messages-buffer-name)
+ (setq-local window-point-insertion-type t)
+ (compilation-minor-mode 1))
(sweep-open-query "user"
"sweep"
"sweep_setup_message_hook"
@@ -123,7 +135,7 @@
sol))
(defun sweep-message (message)
- (with-current-buffer sweep-messages-buffer
+ (with-current-buffer (get-buffer-create sweep-messages-buffer-name)
(save-excursion
(goto-char (point-max))
(insert message)
@@ -807,6 +819,7 @@ Interactively, a prefix arg means to prompt for BUFFER."
(define-key map "p" #'sweep-find-predicate)
(define-key map "t" #'sweep-top-level)
(define-key map "P" #'sweep-pack-install)
+ (define-key map "e" #'sweep-view-messages)
map)
"Keymap for `sweep' global commands.")
- [nongnu] elpa/sweeprolog 8f1275f113 044/166: Remove the swipl-devel git submodule, (continued)
- [nongnu] elpa/sweeprolog 8f1275f113 044/166: Remove the swipl-devel git submodule, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5dcdec144d 052/166: PORT: use swipl --dump-runtime-variables to locate SWI-Prolog.h, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog b24f66da61 051/166: Add licensing information, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 43e5cdaf91 054/166: ADDED: global keymap sweep-prefix-map, not bound by default, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 239e205add 059/166: ADDED: sweep-mode, a major mode for editing Prolog code, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog d226bbb70c 063/166: ENHANCED: set per buffer module name in sweep-mode, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog d974b0fe0a 071/166: ADDED: prepare xref backend, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 27c441ab49 068/166: PORT: don't rely on defvar-keymap available only since Emacs 29, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0b054bac88 072/166: ENHANCED: better detection of the identifier at point, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c59ead20f7 075/166: ENHANCED: redirect Prolog messages to Emacs message function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 031c07ac93 076/166: DOC: document the Prolog messages buffer,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog 8ac0e7afb9 065/166: ENHANCED: also complete predicate names from xref, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 85ca3a5dc2 067/166: FIXED: bind SourceId in xref based completions, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 21a4475306 112/166: Makefile: Allow specifying the path to emacs, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog ec01154a41 102/166: PORT: sweep.el: require Emacs version 28 for RTLD_GLOBAL, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog e991b1a92c 097/166: ENHANCED: (sweep-load-buffer): use read-buffer to choose a buffer, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c69c6bad3c 084/166: FIXED: correctly identify the predicate defined at start of clause, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 586521712e 110/166: DOC: README.org: add ^:{} option, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0b545cc192 114/166: ADDED: (sweep-indent-line-ends-with-prefix-operator): New function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c60df8e7e3 101/166: DOC: Loading buffers: new section, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 4c1e510bbf 125/166: FIXED: handle some more color terms, ELPA Syncer, 2022/09/30