profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/monnier/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

joaotavora/sly 841

Sylvester the Cat's Common Lisp IDE

ltp-lab/ltp-lab.github.io 0

Web page for the LTP lab of Université de Montréal

issue commentocaml/tuareg

Time for a new release in opam?

Christophe Troestler [2021-09-14 14:26:06] wrote:

My mistake: I bumped the version and NonGNU ELPA took it as a new version.

If you want to bump the Version: without making a release (yet), then you can make it something like Version: 2.4-dev (other than -dev you can use -git or -snapshot or beta or alpha or pre).

pmetzger

comment created time in 4 days

pull request commentocaml/tuareg

Comment delimiters matching

Christophe Troestler [2021-09-13 07:13:27] wrote:

prefer bracket matching inside string literals to be made entirely as if it were plain text, I agree but for the Emacs functions I have tried (e.g. backward-list), (* and *) seem still to be considered comments inside strings.

Those functions presum the starting point is outside of comment/strings. You can try and get "better" behavior by checking first if the starting point is within a string and if so use with-syntax-table to switch the syntax table to one more appropriate for prose.

I'm not sure it's worth the trouble, tho.

Chris00

comment created time in 6 days

pull request commentocaml/tuareg

Comment delimiters matching

I've tried to propose a more robust solution to comment delimiter matching... It's a bit frustrating that, in strings, sometimes braces are matched "()", mismatched "))", or do not trigger any error ")".

And almost every bug in this area can be construed as a feature. [ E.g. in ELisp I frequently find it convenient to have paren matching work on "parens inside strings" in cases like (concat "(" foo bar ")"), even though it relies fundamentally on a bug that treats the " foo bar " as if it were a string placed between the two parentheses. ]

Not sure there is a “right way” though.

There are various local maxima and you get to choose which one you try to provide.

Chris00

comment created time in 7 days

PullRequestReviewEvent

issue commentocaml/tuareg

Unbind `C-c ?` and `C-c C-h` (maybe)

BTW, we could treat the doc as a kind of "definition", and thus add the doc as a possible choice in M-.. Yes, and I had a brief chat with Dmitry about it. It doesn't really looks like it fits with the framework or the concept.

Yeah, it's indeed not quite right.

mattiase

comment created time in 9 days

issue commentocaml/tuareg

Unbind `C-c ?` and `C-c C-h` (maybe)

Well, failing the introduction of a standard Emacs key binding (don't hold your breath) I'd favour C-c C-d and asking the Merlin maintainers very politely if they can think of an alternative key for merlin-destruct.

BTW, we could treat the doc as a kind of "definition", and thus add the doc as a possible choice in M-..

    Stefan
mattiase

comment created time in 9 days

pull request commentocaml/tuareg

Fix `tuareg-interactive-error-range-regexp`

  •  ;; Move before the comment, if we are in one.
    
  •  (let ((ppss (syntax-ppss)))
    
  •    (if (nth 4 ppss) (goto-char (- (nth 8 ppss) 1))))
    

Use (1- (nth 8 ppss)) (I know it wasn't done in the code you replace, here we get the chance! 😀)

Actually, I was wondering: why decrement by 1? I think we should either not decrement by 1 or add a comment explaining why we decrement.

  • ((region-active-p)
    
  •  (setq start (min (point) (mark)))
    
  •  (setq end (max (point) (mark)))
    
  •  ;; Extend the region at the endpoints if they are in a phrase.
    
  •  (dolist (pos (list start end))
    

You could just do (dolist (pos (list (point) (mark))) right? — they do not need to be ordered. One can initialize start and end with (point).

There's also region-beginning and region-end if you want them in-order.

mattiase

comment created time in 10 days

pull request commentocaml/tuareg

Suppress bogus "Mismatched parentheses" at end of comment

Christophe Troestler [2021-09-09 03:24:27] wrote:

@monnier I've applied your patch.

Thanks.

mattiase

comment created time in 10 days

pull request commentocaml/tuareg

Suppress bogus "Mismatched parentheses" at end of comment

Fair enough. I do understand what add-function does, but just wondered if it weren't overkill for this particular usage (as well as being somewhat opaque for the reader).

The more it's used, the less opaque it becomes ;-)

The point about nesting is correct and interesting, but Tuareg isn't going to remove the wrapping so it's a bit moot.

Using add-function allows me to stop worrying about when that might be a problem and when not.

E.g. if a buffer-local minor mode needs to use this hook but needs to operate between tuareg's function and the original function, add-function lets it do just that (by specifying the desired "depth"), but if tuareg doesn't use add-function that minor mode will either not be able to do what it wants, or will have to do dig into the details of how tuareg-mode sets up that function, breaking modularity.

Similarly if some global minor mode redefines the global definition of the blink paren function your manual code will fail to notice such a change, so it will sometimes keep calling the original definition because the minor mode was enabled later, or it will sometimes keep calling the redefined function even though the minor has been disabled.

Most of the benefits in the use of add-function compared to the kind of "manual" code you suggest are "special cases" that most authors fail to foresee (no surprise: they're special cases) and which are painful to handle correctly with manual code: the only way to handle it correctly is to use a "protocol" that the various parties obey.

add-function is this protocol. Use it and everyone benefits in those rare cases where they hit the corner case.

    Stefan
mattiase

comment created time in 14 days

pull request commentocaml/tuareg

Suppress bogus "Mismatched parentheses" at end of comment

Am I a bad programmer for thinking that it would be clearer to use something like

  (let ((orig-fn blink-matching-check-function))
    (setq-local blink-matching-check-function
                (lambda (start end)
                  (tuareg--blink-matching-check orig-fn start end))))

instead?

I think it's a normal reaction if you're not yet familiar with add-function.

add-function does indeed basically the same, but with bells and whistles.

E.g. using the above for show-paren-function will burp if paren.el is not yet loaded, whereas add-function should handle it correctly (because it delays looking up the default value until the function is called).

Or if you also use a minor mode which also fiddles with blink-matching-check-function (whether buffer-locally or not), the adds and removes don't need to nest properly to get the correct result.

    Stefan
mattiase

comment created time in 14 days

push eventmikesperber/hopl-4-emacs-lisp

Stefan Monnier

commit sha c0dce81bf719e39af200eaed6251130ddd617672

Put the actual initial caption file

view details

push time in 15 days

pull request commentocaml/tuareg

Suppress bogus "Mismatched parentheses" at end of comment

BTW, rather than hard code other package's internal functions, we should probably be using add-function as in the patch below. Any objection?

diff --git a/Makefile b/Makefile
index 3313665d1..7993c72f8 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@ check:
 indent-test: indent-test.ml.test
 
 tuareg-site-file.el: $(SOURCES)
-	(echo ";;; $@ --- Automatically extracted autoloads.";\
+	(echo ";;; $@ --- Automatically extracted autoloads.  -*- lexical-binding: t; -*-";\
 	 echo ";;; Code:";\
 	 echo "(add-to-list 'load-path";\
 	 echo "             (or (file-name-directory load-file-name) (car load-path)))";\
diff --git a/tuareg.el b/tuareg.el
index d041c5b6d..a7217f0bc 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3087,19 +3087,19 @@ expansion at run-time, if the run-time version of Emacs does know this macro."
                 (forward-comment 1)
                 (eq (point) pt))))))
 
-(defun tuareg--blink-matching-check (start end)
+(defun tuareg--blink-matching-check (orig-fun &rest args)
+  ;; FIXME: Should we merge this with `tuareg--show-paren'?
   (if (tuareg--point-after-comment-p)
       ;; Immediately after a comment-ending "*)" -- no mismatch error.
       nil
-    (smie-blink-matching-check start end)))
+    (apply orig-fun args)))
 
 (defvar show-paren-data-function); Silence the byte-compiler
-(declare-function show-paren--default "paren" ())
 
-(defun tuareg--show-paren ()
+(defun tuareg--show-paren (orig-fun)
   (if (or (tuareg--point-before-comment-p) (tuareg--point-after-comment-p))
       nil
-    (show-paren--default)))
+    (funcall orig-fun)))
 
 (defun tuareg--common-mode-setup ()
   (setq-local syntax-propertize-function #'tuareg-syntax-propertize)
@@ -3107,7 +3107,8 @@ expansion at run-time, if the run-time version of Emacs does know this macro."
   (smie-setup tuareg-smie-grammar #'tuareg-smie-rules
               :forward-token #'tuareg-smie-forward-token
               :backward-token #'tuareg-smie-backward-token)
-  (setq-local blink-matching-check-function #'tuareg--blink-matching-check)
+  (add-function :around (local 'blink-matching-check-function)
+                #'tuareg--blink-matching-check)
   (tuareg--eval-when-macrop add-function
     (when (boundp 'smie--hanging-eolp-function)
       ;; FIXME: As its name implies, smie--hanging-eolp-function
@@ -3118,7 +3119,8 @@ expansion at run-time, if the run-time version of Emacs does know this macro."
   (add-hook 'smie-indent-functions #'tuareg-smie--args nil t)
   (add-hook 'smie-indent-functions #'tuareg-smie--inside-string nil t)
   (setq-local add-log-current-defun-function #'tuareg-current-fun-name)
-  (setq-local show-paren-data-function #'tuareg--show-paren)
+  (add-function :around (local 'show-paren-data-function)
+                #'tuareg--show-paren)
   (setq prettify-symbols-alist
         (if tuareg-prettify-symbols-full
             (append tuareg-prettify-symbols-basic-alist
@@ -3202,7 +3204,7 @@ Short cuts for interactions with the REPL:
     (setq indent-tabs-mode nil)
     (setq ff-search-directories '(".")
           ff-other-file-alist tuareg-other-file-alist)
-    (add-hook 'ff-file-created-hook #'tuareg--ff-file-created-hook)
+    (add-hook 'ff-file-created-hook #'tuareg--ff-file-created-hook nil t)
     (tuareg--common-mode-setup)
     (tuareg--install-font-lock)
     (setq-local beginning-of-defun-function #'tuareg-beginning-of-defun)
mattiase

comment created time in 15 days

issue commentocaml/tuareg

Unbind `C-c ?` and `C-c C-h` (maybe)

indeed inherited from caml-mode. I'm not too keen on <kbd>C-cM-h</kbd> as I find it cumbersome to type. Maybe <kbd>C-cC-y</kbd> — although it is less mnemonic or <kbd>C-cC-?</kbd>? What are other modes using?

ELisp mode uses C-h o, then there's C-h S but I don't think it offers any way for caml-help.el to hook itself into it, and arguably this kind of functionality could be part of Xref but it's missing there. Oh and there's also Company-mode which makes it available in its list of completions, whee it's bound to F1 and C-h.

    Stefan
mattiase

comment created time in 15 days

push eventmikesperber/hopl-4-emacs-lisp

Stefan Monnier

commit sha 2ca44695eb1acbf5f3e0dad40518b28f04a0da9c

Add caption file

view details

push time in 16 days

issue commentocaml/tuareg

Un-git `tuareg-site-file.el`

Christophe Troestler [2021-09-03 12:33:00] wrote:

I guess there was a reason in including it. @monnier?

Hmm... indeed it seems I'm to blame. Can I invoke an insanity defense? Or should I plead the fifth?

More seriously, I think I included it in commit 14ccd9d432d13cea6b because that "just" renamed dot-emacs.el to tuareg-site-lisp.el and I didn't want to rock the boat any further.

I'd be very happy to remove this file, especially since it is not used when Tuareg is distributed/installed via ELPA.

mattiase

comment created time in 16 days

issue commentProofGeneral/PG

quality-of-live improvements and default config for EasyCrypt

  • [ ] electric-indent-mode is enabled by default and IMHO less than useless, because the indentation it creates does not match the (mathcomp-inspired) proof layout used in the libraries and gets even worse when indenting modules and their procedures. So one basically has to undo everything it does.

The easycrypt major mode should set electric-indent-inhibit then until the auto-indentation code is improved.

Note that proof-query-identifier does default to the identifier at point, but requires one to erase the proposed identifier if one wants to query something else.

Looks like a UI bug, which the patch below should address:

diff --git a/generic/pg-user.el b/generic/pg-user.el
index 005d919e8..a485ae257 100644
--- a/generic/pg-user.el
+++ b/generic/pg-user.el
@@ -3,7 +3,7 @@
 ;; This file is part of Proof General.
 
 ;; Portions © Copyright 1994-2012  David Aspinall and University of Edinburgh
-;; Portions © Copyright 2003-2019  Free Software Foundation, Inc.
+;; Portions © Copyright 2003-2021  Free Software Foundation, Inc.
 ;; Portions © Copyright 2001-2017  Pierre Courtieu
 ;; Portions © Copyright 2010, 2016  Erik Martin-Dorel
 ;; Portions © Copyright 2011-2013, 2016-2017  Hendrik Tews
@@ -915,10 +915,10 @@ a popup with the information in it."
 If called interactively, STRING defaults to the current word near point."
   (interactive
    (list
-    (completing-read "Query identifier: "
-		     nil nil nil
-		     (current-word)
-		     'proof-query-identifier-history)))
+    (let ((def (current-word)))
+      (read-string (if def (format "Query identifier (default %s): " def)
+		     "Query identifier: ")
+		     nil 'proof-query-identifier-history def))))
   (if string (pg-identifier-query string)))
 
 (defun pg-identifier-query (identifier &optional ctxt callback)

-- Stefan

chdoc

comment created time in 16 days

pull request commentProofGeneral/PG

Minor tweaks encountered while trying to run the CI tests

I don't have much opinion about what make tests should do exactly, I added it because that's the place where looked to find the tests (I actually tried make check first, then ended up searching through the .github files, since I know nothing about those files but I had a vague inkling that this is where the rules should be found). I don't know what are the tradeoffs involved in making the github actions use make tests either.

monnier

comment created time in 18 days

PR opened ProofGeneral/PG

Minor tweaks encountered while trying to run the CI tests
  • ci/coq-tests.el (070_coq-test-regression-wholefile-no-proof): Clarify the intention of the test.

  • Makefile (check): Fix comment. (tests): New target.

  • .gitignore: Add ci/.lia.cache, apparently generated by ci/test.sh

+11 -6

0 comment

3 changed files

pr created time in 20 days

create barnchProofGeneral/PG

branch : stefan

created branch time in 20 days

issue commentocaml/caml-mode

Compilation mode regexps

@monnier this is a bit tangential to the question but do you know if there's any work to update these standards to be made to work with Unicode text ? With Unicode, asking cli tools to compute columns without having knowledge of the rendering layer is totally doomed (wcwidth included).

I don't think this is being worked on, sadly. I think the current spec is indeed making a bad choice (my own favorite is to count what you call Unicode scalar values, tho bytes would be OK as well).

This said, the current bad choice is not completely doomed, if you consider wcwidth as the definition of the width (both in the reporting tool and in the tool interpreting the report): it doesn't give the same column position as a rendering layer but it does correctly convey the info about the actual position in the text (plus or minus a few zero-width unicode values, admittedly).

It's just more cumbersome and less precise than counting unicode values :-(

In any case, it's offtopic here. I'd encourage you to bring it up to the GNU folks at @***. (and feel free to put me in Cc: if you want my support).

dbuenzli

comment created time in 21 days

pull request commentocaml/tuareg

Autoload compilation error regexp

@monnier This looks OK to me but, as this issue is common to other Emacs packages, there ought to be a “recommended” way of proceeding. I'd like to have your take on this.

The recommended way is ... that the format of the error messages should be changed to be one of the standard ones, e.g. the one recommended by the GNU coding standards ;-)

mattiase

comment created time in 22 days

issue commentocaml/tuareg

How to change comment style?

I submitted a patch to Emacs.

Excellent! Even before I got a chance to look into it! Should I send you the rest of my todo list? ;-)

rgrinberg

comment created time in 23 days

issue commentocaml/caml-mode

Compilation mode regexps

No dispute from me, but I assumed that there were reasons good and bad for the current message format...

No doubt. IIRC it's been requested and rejected in the past already. I just mentioned this to give some context to my position.

What does the community think – should those extra locations be of Error or Info? (Warnings rarely have them so I'm conveniently ignoring them here.)

I vote for "info" because I think it's the only choice which makes sense: they are not errors.

@dbuenzli made a good point – wouldn't it be nice if the compilation rules could be extracted into autoloads, so that the tuareg or caml-mode packages don't need to be loaded for the compilation errors to be parsed correctly?

We could do that, indeed. I don't forsee any particular issue except for the need to wrap the add-to-list code into a with-eval-after-load.

dbuenzli

comment created time in 24 days

issue commentocaml/caml-mode

Compilation mode regexps

I don't have a strong opinion on this. Your analysis sounds fine to me.

The only opinion I have in this area is that the better answer is to fix OCaml to give messages in the standard GNU convention format so that it "just works".

dbuenzli

comment created time in 25 days

issue commentocaml/tuareg

feature wish: propose to auto-require packages when doing C-c C-s?

As mentioned in the discussion to which Chris linked, Dune currently works better if you structure your project into a (set of) libraries together with an almost empty top-level executable.

So I think it would make sense to start by supporting only the case where the Dune project is a library rather than an executable.

erikmd

comment created time in a month

issue commentocaml/tuareg

How to change comment style?

@monnier See at the commit above — seems to me to be a good way to fix this for the time being.

The workaround for Emacs<28 is ugly but to the extent that it's deactivated with Emacs≥28 I can live with it [ BTW, the test can be simplified to (< emacs-major-version 28) and the if can be sunk into the (apply ...). ]

OTOH I don't understand why we'd set comment-multi-line and comment-continue in tuareg-mode. Shouldn't that be a user's choice?

    Stefan
rgrinberg

comment created time in a month

push eventProofGeneral/PG

Stefan Monnier

commit sha 3d361fa6915df412c3ecf707f219316ccb894e62

* doc/PG-adapting.texi: Refresh with `make -C doc magic` * lib/texi-docstring-magic.el: Use lexical-binding. Fix regexps to avoid ineffective backslashes. (texi-docstring--args, texi-docstring--in-quoted-region): Rename dynamically scoped vars. (texi-docstring-magic-munge-table): Use functions rather than quoted expressions. (texi-docstring--funcall): New function. (texi-docstring-magic-munge-docstring): Use it instead of `eval`.

view details

Stefan Monnier

commit sha e2ee96b209e740afd9349bfaab8410d98e1eaccd

* Makefile (BYTECOMP): Add the root dir to match to ELPA setup Also don't remove the `cl-functions` warning any more.

view details

push time in a month

push eventProofGeneral/PG

Stefan Monnier

commit sha 063d066cb77dc2ec628c42f2d8e35fc24be341e4

* ci/compile-tests/*/runtest.el: Use lexical-binding and find `cct-lib` This removes the presumption that `ci/compile-tests` has somehow been added to `load-path` which is not always justified.

view details

Stefan Monnier

commit sha ad2f811883106995005d2d396b48451c46f27861

* lib/*.el: Use lexical-binding plus other minor changes E.g. prefer #' to quote function names. * lib/unicode-tokens.el: Use lexical-binding. (unicode-tokens-toggle-add-help-echo, unicode-tokens-show-symbols) (unicode-tokens-highlight-unicode, unicode-tokens-mode): Avoid deprecated `font-lock-fontify-buffer`. (unicode-tokens-quail-define-rules): Simplify with a more functional style. (unicode-tokens-set-font-var): Avoid needless `setq`. (unicode-tokens-customize-submenu, unicode-tokens-define-menu): Prefer closures over `(lambda..). * lib/maths-menu.el (maths-menu-build-menu): Prefer closure over `(lambda..). (maths-menu-mode): Avoid ancient position-based calling convention of `define-minor-mode`. * lib/holes.el (holes-mode): Avoid ancient position-based calling convention of `define-minor-mode`. * lib/bufhist.el: Use lexical-binding. (bufhist-mode-map): Rename from `bufhist-minor-mode-map` to follow the usual conventions. (bufhist-mode): Avoid ancient position-based calling convention of `define-minor-mode`.

view details

Stefan Monnier

commit sha 91ce5cdec5ae4f4a00ea7411aea67d347895bef4

* coq/*.el: Use lexical-binding plus various minor changes Fit docstrings within 80 columns. Prefer #' to quote function names. * coq/coq.el: Use lexical-binding. (proof-shell-process-urgent-message-default): Remove deadcode. (coq-set-auto-adapt-printing-width): Fix longstanding confusion between `set` and `setq`. (coq--show-proof-stepwise-cmds): New function. (coq-empty-action-list-command): Use it. Avoid `add-to-list` on local variables. (coq-guess-goal-buffer-at-next-command): Fix longstanding paren typo. (coq-proof-tree-get-new-subgoals): Use `push`. (coq-shell-theorem-dependency-list-regexp): Use `defconst`. (coq-dependency-menu-system-specific): Prefer closures over `(lambda..). * coq/coq-unicode-tokens.el: Use lexical-binding. (coq-control-region-format-regexp): Remove ineffective backslashes. * coq/coq-system.el (coq-autodetect-help): Simplify. * coq/coq-syntax.el (coq-queries-commands-db): Fix docstring within 80 columns. * coq/coq-smie.el (coq-smie-search-token-backward): Remove longstanding deadcode and optimize a bit. (coq-smie-backward-token-aux): Re-layout a bit to fit within 80 columns. (coq-show-smie--parent): Simplify. (coq-smie-rules): Pass second arg to `looking-back` to avoid pathological performance. * coq/coq-seq-compile.el: Use lexical-binding. (coq-seq-auto-compile-externally): Rename arg `qualified-id` to avoid dynbound name. Mark as dynbound those vars passed to `coq-compile-substitution-list`. (coq-seq-preprocess-require-commands): Declare `coq-object-hash-symbol` as dynbound. * coq/coq-par-compile.el: Use lexical-binding. (coq-par-coqdep-arguments, coq-par-coqc-arguments, coq-par-job-init-common) (coq-par-create-require-job, coq-par-create-file-job): Rename arg `coq-load-path` to avoid dynbound name. (coq-par-retire-top-level-job, coq-par-kickoff-queue-maybe) (coq-par-handle-require-list): Prefer closures over `(lambda...). * coq/coq-diffs.el: Use lexical-binding. * coq/coq-compile-common.el: Use lexical-binding. Remove redundant `:group`. (coq-display-compile-response-buffer): Avoid deprecated `font-lock-fontify-buffer`.

view details

Stefan Monnier

commit sha d64f5a10bc4747f04b4ae908f88c21ae7f452495

* generic/*.el: Use lexical-binding in proof-(tree|splash|pg-pamacs) Plus various minor changes found along the way. * generic/proof-tree.el: Use lexical-binding. (proof-tree-insert-script, proof-tree-make-show-goal-callback): Prefer closures over `(lambda...). (proof-tree-handle-proof-command): Remove unused var `proof-state`. * generic/proof-splash.el: Use lexical-binding. (proof-splash-message): Prefer closures over `(lambda...). * generic/proof-site.el (proof-assistants): Use `mapconcat` and quote symbols using the ELisp docstring convention. * generic/proof-script.el (pg-add-element): Prefer closures over `(lambda...). (proof-config-done): Remove calls to `easy-menu-add` since we don't support XEmacs any more. * generic/proof-depends.el (proof-dependency-in-span-context-menu): Simplify by eta-reduction. (proof-dep-make-submenu): Prefer closures over `(lambda...). * generic/pg-pamacs.el: Use lexical-binding. (proof-defpgcustom-fn): Remove unused var `newargs`. Simplify a bit using `push` and `memq`.

view details

push time in a month

issue openedsml-nj/sml-mode

This is outdated

The latest sml-mode is at https://elpa.gnu.org/packages/sml-mode.html (this has been the case for almost 9 years now).

created time in a month

issue commentocaml/tuareg

"tuareg-eval-phrase" and the double-semicolon ;;

Double-semis are also used a lot by students learning the language and we should be nice to them once in a while.

I'm not arguing in favor of Tuareg misbehaving in the presence of double-semis; I was just pointing out that I never use them so I don't have a reliable intuition for what Tuareg should do with them.

Fourchaux

comment created time in 2 months