From 9e7a7e1a81de2b6dbdce7f6251da9f3993882c8d Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sun, 22 Dec 2024 12:56:10 +0100 Subject: [PATCH] update erlang Signed-off-by: Andreas Gerler --- elpa/erlang-20230628.1002/erlang-pkg.el | 11 - .../erlang-autoloads.el | 98 ++--- .../erlang-edoc.el | 0 .../erlang-eunit.el | 0 .../erlang-flymake.el | 2 +- elpa/erlang-20241217.813/erlang-pkg.el | 8 + .../erlang-skels-old.el | 6 +- .../erlang-skels.el | 8 +- .../erlang-start.el | 1 - .../erlang-test.el | 10 +- .../erlang.el | 411 +++++++++++------- .../erldoc.el | 0 12 files changed, 307 insertions(+), 248 deletions(-) delete mode 100644 elpa/erlang-20230628.1002/erlang-pkg.el rename elpa/{erlang-20230628.1002 => erlang-20241217.813}/erlang-autoloads.el (77%) rename elpa/{erlang-20230628.1002 => erlang-20241217.813}/erlang-edoc.el (100%) rename elpa/{erlang-20230628.1002 => erlang-20241217.813}/erlang-eunit.el (100%) rename elpa/{erlang-20230628.1002 => erlang-20241217.813}/erlang-flymake.el (98%) create mode 100644 elpa/erlang-20241217.813/erlang-pkg.el rename elpa/{erlang-20230628.1002 => erlang-20241217.813}/erlang-skels-old.el (99%) rename elpa/{erlang-20230628.1002 => erlang-20241217.813}/erlang-skels.el (99%) rename elpa/{erlang-20230628.1002 => erlang-20241217.813}/erlang-start.el (99%) rename elpa/{erlang-20230628.1002 => erlang-20241217.813}/erlang-test.el (96%) rename elpa/{erlang-20230628.1002 => erlang-20241217.813}/erlang.el (95%) rename elpa/{erlang-20230628.1002 => erlang-20241217.813}/erldoc.el (100%) diff --git a/elpa/erlang-20230628.1002/erlang-pkg.el b/elpa/erlang-20230628.1002/erlang-pkg.el deleted file mode 100644 index 0bf14474..00000000 --- a/elpa/erlang-20230628.1002/erlang-pkg.el +++ /dev/null @@ -1,11 +0,0 @@ -(define-package "erlang" "20230628.1002" "Erlang major mode" - '((emacs "24.1")) - :commit "d051172925a5c84b2f21850a188a533f885f201c" :authors - '(("Anders Lindgren")) - :maintainer - '("Anders Lindgren") - :keywords - '("erlang" "languages" "processes")) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/erlang-20230628.1002/erlang-autoloads.el b/elpa/erlang-20241217.813/erlang-autoloads.el similarity index 77% rename from elpa/erlang-20230628.1002/erlang-autoloads.el rename to elpa/erlang-20241217.813/erlang-autoloads.el index 99fafb38..f925f0b6 100644 --- a/elpa/erlang-20230628.1002/erlang-autoloads.el +++ b/elpa/erlang-20241217.813/erlang-autoloads.el @@ -1,12 +1,14 @@ -;;; erlang-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- -;; +;;; erlang-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + ;;; Code: -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + -;;;### (autoloads nil "erlang" "erlang.el" (0 0 0 0)) ;;; Generated autoloads from erlang.el (autoload 'erlang-mode "erlang" "\ @@ -69,33 +71,27 @@ and examples of hooks. Other commands: \\{erlang-mode-map} -\(fn)" t nil) - +(fn)" t) (dolist (r '("\\.erl$" "\\.app\\.src$" "\\.escript" "\\.hrl$" "\\.xrl$" "\\.yrl" "/ebin/.+\\.app")) (add-to-list 'auto-mode-alist (cons r 'erlang-mode))) - (autoload 'erlang-find-tag "erlang" "\ Like `find-tag'. Capable of retrieving Erlang modules. Tags can be given on the forms `tag', `module:', `module:tag'. -\(fn MODTAGNAME &optional NEXT-P REGEXP-P)" t nil) - +(fn MODTAGNAME &optional NEXT-P REGEXP-P)" t) (autoload 'erlang-find-tag-other-window "erlang" "\ Like `find-tag-other-window' but aware of Erlang modules. -\(fn TAGNAME &optional NEXT-P REGEXP-P)" t nil) - +(fn TAGNAME &optional NEXT-P REGEXP-P)" t) (autoload 'erlang-shell "erlang" "\ Start a new Erlang shell. The variable `erlang-shell-function' decides which method to use, default is to start a new Erlang host. It is possible that, in the -future, a new shell on an already running host will be started." t nil) +future, a new shell on an already running host will be started." t) (autoload 'run-erlang "erlang" "Start a new Erlang shell." t) - (autoload 'erlang-compile "erlang" "\ -Compile Erlang module in current buffer." t nil) - +Compile Erlang module in current buffer." t) (autoload 'inferior-erlang "erlang" "\ Run an inferior Erlang. With prefix command, prompt for command to start Erlang with. @@ -113,121 +109,93 @@ The following commands imitate the usual Unix interrupt and editing control characters: \\{erlang-shell-mode-map} -\(fn &optional COMMAND)" t nil) - +(fn &optional COMMAND)" t) (register-definition-prefixes "erlang" '("erlang-" "inferior-erlang-" "run-erlang")) -;;;*** -;;;### (autoloads nil "erlang-edoc" "erlang-edoc.el" (0 0 0 0)) ;;; Generated autoloads from erlang-edoc.el (autoload 'erlang-edoc-mode "erlang-edoc" "\ Toggle Erlang-EDoc mode on or off. -This is a minor mode. If called interactively, toggle the -`Erlang-EDoc mode' mode. If the prefix argument is positive, -enable the mode, and if it is zero or negative, disable the mode. +This is a minor mode. If called interactively, toggle the `Erlang-EDoc +mode' mode. If the prefix argument is positive, enable the mode, and if +it is zero or negative, disable the mode. -If called from Lisp, toggle the mode if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. -Disable the mode if ARG is a negative number. +If called from Lisp, toggle the mode if ARG is `toggle'. Enable the +mode if ARG is nil, omitted, or is a positive number. Disable the mode +if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, -evaluate `erlang-edoc-mode'. - -The mode's hook is called both when the mode is enabled and when -it is disabled. +evaluate the variable `erlang-edoc-mode'. -\\{erlang-edoc-mode-map} - -\(fn &optional ARG)" t nil) +The mode's hook is called both when the mode is enabled and when it is +disabled. +(fn &optional ARG)" t) (register-definition-prefixes "erlang-edoc" '("erlang-edoc-")) -;;;*** -;;;### (autoloads nil "erlang-eunit" "erlang-eunit.el" (0 0 0 0)) ;;; Generated autoloads from erlang-eunit.el (register-definition-prefixes "erlang-eunit" '("erlang-e" "filename-join")) -;;;*** -;;;### (autoloads nil "erlang-flymake" "erlang-flymake.el" (0 0 0 -;;;;;; 0)) ;;; Generated autoloads from erlang-flymake.el (register-definition-prefixes "erlang-flymake" '("erlang-flymake-")) -;;;*** -;;;### (autoloads nil "erlang-skels" "erlang-skels.el" (0 0 0 0)) ;;; Generated autoloads from erlang-skels.el (register-definition-prefixes "erlang-skels" '("erlang-")) -;;;*** -;;;### (autoloads nil "erlang-skels-old" "erlang-skels-old.el" (0 -;;;;;; 0 0 0)) ;;; Generated autoloads from erlang-skels-old.el (register-definition-prefixes "erlang-skels-old" '("erlang-")) -;;;*** -;;;### (autoloads nil "erlang-start" "erlang-start.el" (0 0 0 0)) ;;; Generated autoloads from erlang-start.el (let ((a '("\\.erl\\'" . erlang-mode)) (b '("\\.hrl\\'" . erlang-mode))) (or (assoc (car a) auto-mode-alist) (setq auto-mode-alist (cons a auto-mode-alist))) (or (assoc (car b) auto-mode-alist) (setq auto-mode-alist (cons b auto-mode-alist)))) - (add-to-list 'interpreter-mode-alist (cons "escript" 'erlang-mode)) - (let ((erl-ext '(".jam" ".vee" ".beam"))) (while erl-ext (add-to-list 'completion-ignored-extensions (car erl-ext)) (when (boundp 'dired-omit-extensions) (add-to-list 'dired-omit-extensions (car erl-ext))) (setq erl-ext (cdr erl-ext)))) -;;;*** -;;;### (autoloads nil "erlang-test" "erlang-test.el" (0 0 0 0)) ;;; Generated autoloads from erlang-test.el (register-definition-prefixes "erlang-test" '("erlang-")) -;;;*** -;;;### (autoloads nil "erldoc" "erldoc.el" (0 0 0 0)) ;;; Generated autoloads from erldoc.el (autoload 'erldoc-browse "erldoc" "\ -\(fn MFA)" t nil) - +(fn MFA)" t) (autoload 'erldoc-apropos "erldoc" "\ -\(fn PATTERN)" t nil) - +(fn PATTERN)" t) (autoload 'erldoc-eldoc-function "erldoc" "\ -A function suitable for `eldoc-documentation-function'." nil nil) - +A function suitable for `eldoc-documentation-function'.") (autoload 'erldoc-browse-topic "erldoc" "\ -\(fn TOPIC)" t nil) - +(fn TOPIC)" t) (register-definition-prefixes "erldoc" '("erldoc-")) - -;;;*** -;;;### (autoloads nil nil ("erlang-pkg.el") (0 0 0 0)) +;;; End of scraped data + +(provide 'erlang-autoloads) -;;;*** - ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 +;; no-native-compile: t +;; coding: utf-8-emacs-unix ;; End: + ;;; erlang-autoloads.el ends here diff --git a/elpa/erlang-20230628.1002/erlang-edoc.el b/elpa/erlang-20241217.813/erlang-edoc.el similarity index 100% rename from elpa/erlang-20230628.1002/erlang-edoc.el rename to elpa/erlang-20241217.813/erlang-edoc.el diff --git a/elpa/erlang-20230628.1002/erlang-eunit.el b/elpa/erlang-20241217.813/erlang-eunit.el similarity index 100% rename from elpa/erlang-20230628.1002/erlang-eunit.el rename to elpa/erlang-20241217.813/erlang-eunit.el diff --git a/elpa/erlang-20230628.1002/erlang-flymake.el b/elpa/erlang-20241217.813/erlang-flymake.el similarity index 98% rename from elpa/erlang-20230628.1002/erlang-flymake.el rename to elpa/erlang-20241217.813/erlang-flymake.el index 4e4da51e..9a5e7f0e 100644 --- a/elpa/erlang-20230628.1002/erlang-flymake.el +++ b/elpa/erlang-20241217.813/erlang-flymake.el @@ -69,7 +69,7 @@ check on newline and when there are no changes)." (defun erlang-flymake-init () (let* ((temp-file (cl-letf (((symbol-function 'flymake-get-temp-dir) #'erlang-flymake-temp-dir)) - (flymake-init-create-temp-buffer-copy + (flymake-proc-init-create-temp-buffer-copy 'flymake-create-temp-with-folder-structure))) (code-dir-opts (erlang-flymake-flatten diff --git a/elpa/erlang-20241217.813/erlang-pkg.el b/elpa/erlang-20241217.813/erlang-pkg.el new file mode 100644 index 00000000..721193cc --- /dev/null +++ b/elpa/erlang-20241217.813/erlang-pkg.el @@ -0,0 +1,8 @@ +;; -*- no-byte-compile: t; lexical-binding: nil -*- +(define-package "erlang" "20241217.813" + "Erlang major mode." + '((emacs "24.1")) + :url "https://github.com/erlang/otp" + :commit "11e5e81a95795b3c17dedc94d20297e20d994f03" + :revdesc "11e5e81a9579" + :keywords '("erlang" "languages" "processes")) diff --git a/elpa/erlang-20230628.1002/erlang-skels-old.el b/elpa/erlang-20241217.813/erlang-skels-old.el similarity index 99% rename from elpa/erlang-20230628.1002/erlang-skels-old.el rename to elpa/erlang-20241217.813/erlang-skels-old.el index 7d503c4b..b048803d 100644 --- a/elpa/erlang-20230628.1002/erlang-skels-old.el +++ b/elpa/erlang-20241217.813/erlang-skels-old.el @@ -1,7 +1,7 @@ ;; ;; %CopyrightBegin% ;; -;; Copyright Ericsson AB 2010-2022. All Rights Reserved. +;; Copyright Ericsson AB 2010-2024. All Rights Reserved. ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -150,7 +150,7 @@ Please see the function `tempo-define-template'.") "*The skeleton template to generate a version control attribute. The default is to insert nothing. Example of usage: - (setq erlang-skel-vc '(& \"-rcs(\\\"$\Id: $ \\\").\") n) + (setq erlang-skel-vc \\='(& \"-rcs(\\\"$\Id: $ \\\").\") n) Please see the function `tempo-define-template'.") @@ -179,7 +179,7 @@ Look in the module `time-stamp' for a battery of functions.") (defvar erlang-skel-copyright-comment '() "*The template for a copyright line in the header, normally empty. This variable should be bound to a `tempo' template, for example: - '(& \"%%% Copyright (C) 2000, Yoyodyne, Inc.\" n) + \\='(& \"%%% Copyright (C) 2000, Yoyodyne, Inc.\" n) Please see the function `tempo-define-template'.") diff --git a/elpa/erlang-20230628.1002/erlang-skels.el b/elpa/erlang-20241217.813/erlang-skels.el similarity index 99% rename from elpa/erlang-20230628.1002/erlang-skels.el rename to elpa/erlang-20241217.813/erlang-skels.el index f61f156f..50d98463 100644 --- a/elpa/erlang-20230628.1002/erlang-skels.el +++ b/elpa/erlang-20241217.813/erlang-skels.el @@ -1,7 +1,7 @@ ;; ;; %CopyrightBegin% ;; -;; Copyright Ericsson AB 2010-2023. All Rights Reserved. +;; Copyright Ericsson AB 2010-2024. All Rights Reserved. ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -180,7 +180,7 @@ Please see the function `tempo-define-template'.") "*The skeleton template to generate a version control attribute. The default is to insert nothing. Example of usage: - (setq erlang-skel-vc '(& \"-rcs(\\\"$\Id: $ \\\").\") n) + (setq erlang-skel-vc \\='(& \"-rcs(\\\"$\Id: $ \\\").\") n) Please see the function `tempo-define-template'.") @@ -214,7 +214,7 @@ Look in the module `time-stamp' for a battery of functions.") (user-full-name) n)) "*The template for a copyright line in the header, normally empty. This variable should be bound to a `tempo' template, for example: - '(& \"%%% Copyright (C) 2000, Yoyodyne, Inc.\" n) + \\='(& \"%%% Copyright (C) 2000, Yoyodyne, Inc.\" n) Please see the function `tempo-define-template'.") (defvar erlang-skel-created-comment @@ -2026,7 +2026,7 @@ package not be present, this function does nothing." Example of use, assuming that `erlang-skel-func' is defined: - (defvar foo-skeleton '(\"%%% New function:\" + (defvar foo-skeleton \\='(\"%%% New function:\" (erlang-skel-include erlang-skel-func))) Technically, this function returns the `tempo' attribute`(l ...)' which diff --git a/elpa/erlang-20230628.1002/erlang-start.el b/elpa/erlang-20241217.813/erlang-start.el similarity index 99% rename from elpa/erlang-20230628.1002/erlang-start.el rename to elpa/erlang-20241217.813/erlang-start.el index a19f72e2..19ab2cce 100644 --- a/elpa/erlang-20230628.1002/erlang-start.el +++ b/elpa/erlang-20241217.813/erlang-start.el @@ -3,7 +3,6 @@ ;; Copyright (C) 1998 Ericsson Telecom AB ;; Author: Anders Lindgren -;; Version: 2.3 ;; Keywords: erlang, languages, processes ;; Created: 1996-09-18 ;; Date: 1998-03-16 diff --git a/elpa/erlang-20230628.1002/erlang-test.el b/elpa/erlang-20241217.813/erlang-test.el similarity index 96% rename from elpa/erlang-20230628.1002/erlang-test.el rename to elpa/erlang-20241217.813/erlang-test.el index 49d6ea42..a1a5ea8a 100644 --- a/elpa/erlang-20230628.1002/erlang-test.el +++ b/elpa/erlang-20241217.813/erlang-test.el @@ -8,7 +8,7 @@ ;; %CopyrightBegin% ;; -;; Copyright Ericsson AB 2016-2021. All Rights Reserved. +;; Copyright Ericsson AB 2016-2024. All Rights Reserved. ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -171,7 +171,7 @@ concatenated to form an erlang file to test on.") (should (string-equal (file-truename expected-file) (file-truename (buffer-file-name)))) (should (eq expected-line (line-number-at-pos))) - (should (= (point-at-bol) (point)))) + (should (= (line-beginning-position) (point)))) (defun erlang-test-complete-at-point (tags-file) (with-temp-buffer @@ -179,13 +179,13 @@ concatenated to form an erlang file to test on.") (setq-local tags-file-name tags-file) (insert "\nerlang_test:fun") (erlang-complete-tag) - (should (looking-back "erlang_test:function" (point-at-bol))) + (should (looking-back "erlang_test:function" (line-beginning-position))) (insert "\nfun") (erlang-complete-tag) - (should (looking-back "function" (point-at-bol))) + (should (looking-back "function" (line-beginning-position))) (insert "\nerlang_") (erlang-complete-tag) - (should (looking-back "erlang_test:" (point-at-bol))))) + (should (looking-back "erlang_test:" (line-beginning-position))))) (ert-deftest erlang-test-compile-options () diff --git a/elpa/erlang-20230628.1002/erlang.el b/elpa/erlang-20241217.813/erlang.el similarity index 95% rename from elpa/erlang-20230628.1002/erlang.el rename to elpa/erlang-20241217.813/erlang.el index a21f1df2..0562d5a1 100644 --- a/elpa/erlang-20230628.1002/erlang.el +++ b/elpa/erlang-20241217.813/erlang.el @@ -4,12 +4,13 @@ ;; Author: Anders Lindgren ;; Keywords: erlang, languages, processes ;; Date: 2011-12-11 -;; Version: 2.8.4 +;; Package-Version: 20241217.813 +;; Package-Revision: 11e5e81a9579 ;; Package-Requires: ((emacs "24.3")) ;; %CopyrightBegin% ;; -;; Copyright Ericsson AB 1996-2023. All Rights Reserved. +;; Copyright Ericsson AB 1996-2024. All Rights Reserved. ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -79,6 +80,7 @@ (require 'align) (require 'comint) (require 'tempo) +(require 'cl-lib) ;;; `caddr' is builtin since Emacs 26. (eval-and-compile @@ -91,7 +93,7 @@ "The Erlang programming language." :group 'languages) -(defconst erlang-version "2.8.4" +(defconst erlang-version "2.8.5" "The version number of Erlang mode.") (defcustom erlang-root-dir nil @@ -108,7 +110,7 @@ Emacs command `M-x erlang-man-download-ask RET' (the download URL can be customized with the Emacs variable erlang-man-download-url): - (require 'erlang) + (require \='erlang) (erlang-man-download) " @@ -155,7 +157,8 @@ variable.") ("New Clause" erlang-generate-new-clause) ("Clone Arguments" erlang-clone-arguments) nil - ("Align Arrows" erlang-align-arrows))) + ("Align Region" align) + ("Align Current" align-current))) ("Syntax Highlighting" (("Level 4" erlang-font-lock-level-4) ("Level 3" erlang-font-lock-level-3) @@ -179,7 +182,7 @@ is an expression which is evaluated every time the menu is displayed. Should the expression evaluate to nil the menu item is ghosted. Example: - '((\"Func1\" function-one) + \='((\"Func1\" function-one) (\"SubItem\" ((\"Yellow\" function-yellow) (\"Blue\" function-blue))) @@ -251,15 +254,15 @@ containing all functions defined in the current buffer. To use the example, copy the following lines to your `~/.emacs' file: - (add-hook 'erlang-mode-hook 'my-erlang-mode-hook) + (add-hook \='erlang-mode-hook \='my-erlang-mode-hook) (defun my-erlang-mode-hook () - (local-set-key \"\\C-c\\C-c\" 'erlang-compile) + (local-set-key \"\\C-c\\C-c\" \='erlang-compile) (if window-system (progn (setq font-lock-maximum-decoration t) (font-lock-mode 1))) - (if (and window-system (fboundp 'imenu-add-to-menubar)) + (if (and window-system (fboundp \='imenu-add-to-menubar)) (imenu-add-to-menubar \"Imenu\")))") (defvar erlang-load-hook nil @@ -284,7 +287,7 @@ The following example sets the variable `erlang-root-dir' so that the manual pages can be retrieved (note that you must set the value of `erlang-root-dir' to match the location of Erlang on your system): - (add-hook 'erlang-load-hook 'my-erlang-load-hook) + (add-hook \='erlang-load-hook \='my-erlang-load-hook) (defun my-erlang-load-hook () (setq erlang-root-dir \"/usr/local/erlang\"))") @@ -301,8 +304,10 @@ A useful function is `tempo-template-erlang-normal-header'. If the value of this variable is the symbol `ask', the user is prompted. If the value is t the source is silently changed." :group 'erlang - :type '(choice (const :tag "Check on save" 'ask) - (const :tag "Don't check on save" t))) + :type '(choice + (const :tag "Prompt" ask) + (const :tag "Silently change" t) + (const :tag "Don't check on save" nil))) (defvar erlang-electric-commands '(erlang-electric-comma @@ -365,7 +370,7 @@ is typed. Each function in the list is called with no arguments, and should return one of the following values: nil -- no determination made, continue checking - 'stop -- do not create prototype for next line + \='stop -- do not create prototype for next line (anything else) -- insert prototype, and stop checking If every function in the list is called with no determination made, @@ -386,7 +391,7 @@ is typed. Each function in the list is called with no arguments, and should return one of the following values: nil -- no determination made, continue checking - 'stop -- do not create prototype for next line + \='stop -- do not create prototype for next line (anything else) -- insert prototype, and stop checking If every function in the list is called with no determination made, @@ -404,7 +409,7 @@ is typed. Each function in the list is called with no arguments, and should return one of the following values: nil -- no determination made, continue checking - 'stop -- do not create prototype for next line + \='stop -- do not create prototype for next line (anything else) -- insert prototype, and stop checking If every function in the list is called with no determination made, @@ -425,7 +430,7 @@ is typed. Each function in the list is called with no arguments, and should return one of the following values: nil -- no determination made, continue checking - 'stop -- do not create prototype for next line + \='stop -- do not create prototype for next line (anything else) -- trigger the electric command. If every function in the list is called with no determination made, @@ -559,7 +564,7 @@ This is an elisp list of options. Each option can be either: - an atom - a dotted pair - a string -Example: '(bin_opt_info (i . \"/path1/include\") (i . \"/path2/include\"))") +Example: \='(bin_opt_info (i . \"/path1/include\") (i . \"/path2/include\"))") (defvar erlang-compile-command-function-alist '((".erl\\'" . inferior-erlang-compute-erl-compile-command) @@ -989,6 +994,8 @@ resulting regexp is surrounded by \\_< and \\_>." "posixtime_to_universaltime" "prepare_loading" "process_display" + "processes_iterator" + "processes_next" "raise" "read_timer" "resume_process" @@ -1051,32 +1058,32 @@ behaviour.") (defvar erlang-mode-map (let ((map (make-sparse-keymap))) - (define-key map ";" 'erlang-electric-semicolon) - (define-key map "," 'erlang-electric-comma) - (define-key map "<" 'erlang-electric-lt) - (define-key map ">" 'erlang-electric-gt) - (define-key map "\C-m" 'erlang-electric-newline) - (define-key map (kbd "DEL") 'backward-delete-char-untabify) - (define-key map "\M-q" 'erlang-fill-paragraph) - (define-key map "\M-\t" 'erlang-complete-tag) - (define-key map "\C-c\M-\t" 'tempo-complete-tag) - (define-key map "\M-+" 'erlang-find-next-tag) - (define-key map "\C-c\M-a" 'erlang-beginning-of-clause) - (define-key map "\C-c\M-b" 'tempo-backward-mark) - (define-key map "\C-c\M-e" 'erlang-end-of-clause) - (define-key map "\C-c\M-f" 'tempo-forward-mark) - (define-key map "\C-c\M-h" 'erlang-mark-clause) - (define-key map "\C-c\C-c" 'comment-region) - (define-key map "\C-c\C-j" 'erlang-generate-new-clause) - (define-key map "\C-c\C-k" 'erlang-compile) - (define-key map "\C-c\C-l" 'erlang-compile-display) - (define-key map "\C-c\C-s" 'erlang-show-syntactic-information) - (define-key map "\C-c\C-q" 'erlang-indent-function) - (define-key map "\C-c\C-u" 'uncomment-region) - (define-key map "\C-c\C-y" 'erlang-clone-arguments) - (define-key map "\C-c\C-a" 'erlang-align-arrows) - (define-key map "\C-c\C-z" 'erlang-shell-display) - (define-key map "\C-c\C-d" 'erlang-man-function-no-prompt) + (define-key map (kbd ";") 'erlang-electric-semicolon) + (define-key map (kbd ",") 'erlang-electric-comma) + (define-key map (kbd "<") 'erlang-electric-lt) + (define-key map (kbd ">") 'erlang-electric-gt) + (define-key map (kbd "C-m") 'erlang-electric-newline) + (define-key map (kbd "DEL") 'backward-delete-char-untabify) + (define-key map (kbd "M-q") 'erlang-fill-paragraph) + (define-key map (kbd "M-") 'erlang-complete-tag) + (define-key map (kbd "M-+") 'erlang-find-next-tag) + (define-key map (kbd "C-c M-") 'tempo-complete-tag) + (define-key map (kbd "C-c M-a") 'erlang-beginning-of-clause) + (define-key map (kbd "C-c M-b") 'tempo-backward-mark) + (define-key map (kbd "C-c M-e") 'erlang-end-of-clause) + (define-key map (kbd "C-c M-f") 'tempo-forward-mark) + (define-key map (kbd "C-c M-h") 'erlang-mark-clause) + (define-key map (kbd "C-c C-c") 'comment-region) + (define-key map (kbd "C-c C-j") 'erlang-generate-new-clause) + (define-key map (kbd "C-c C-k") 'erlang-compile) + (define-key map (kbd "C-c C-l") 'erlang-compile-display) + (define-key map (kbd "C-c C-s") 'erlang-show-syntactic-information) + (define-key map (kbd "C-c C-q") 'erlang-indent-function) + (define-key map (kbd "C-c C-u") 'uncomment-region) + (define-key map (kbd "C-c C-y") 'erlang-clone-arguments) + (define-key map (kbd "C-c C-a") 'align-current) + (define-key map (kbd "C-c C-z") 'erlang-shell-display) + (define-key map (kbd "C-c C-d") 'erlang-man-function-no-prompt) map) "Keymap used in Erlang mode.") (defvar erlang-mode-abbrev-table nil @@ -1182,7 +1189,7 @@ behaviour.") (defvar erlang-font-lock-keywords-lc (list - (list "\\(<-\\|<=\\|||\\)\\(\\s \\|$\\)" 1 'font-lock-keyword-face)) + (list "\\(<-\\|<:-\\|<=\\|<:=\\|||\\|&&\\)\\(\\s \\|$\\)" 1 'font-lock-keyword-face)) "Font lock keyword highlighting list comprehension operators.") (defvar erlang-font-lock-keywords-keywords @@ -1437,18 +1444,109 @@ Other commands: (add-function :before-until (local 'eldoc-documentation-function) #'erldoc-eldoc-function)) - ;; Align maps. - (add-to-list 'align-rules-list - '(erlang-maps - (regexp . "\\(\\s-*\\)\\(=>\\)\\s-*") - (modes . '(erlang-mode)) - (repeat . t))) - ;; Align records and :: specs - (add-to-list 'align-rules-list - '(erlang-record-specs - (regexp . "\\(\\s-*\\)\\(=\\).*\\(::\\)*\\s-*") - (modes . '(erlang-mode)) - (repeat . t))) + ;; Some definitions (wrapped in "shy groups" which do not get a number) + (let* ((space-group "\\([[:space:]]*\\)") + (erl-keywords "\\(?:end\\|begin\\|case\\|of\\|if\\|receive\\|after\\|try\\|catch\\|fun\\)") + (erl-sep-symbols (concat "\\(?:\\_<" erl-keywords "\\_>\\)")) + (erl-sep-forms "\\(?:[.][[:space:]]\\|[.]$\\)") + (erl-just-eq ; sets whitespace groups 1 and 2 + ;; NOTE: '...> = <...' may occur in Erlang, so no easy way here + (concat + "\\(?:" ; outer wrapper + "\\(?:" ; shy group for whitespace-before (subgroups get index 1) + "\\(?1:[[:space:]]+\\|^\\)\\|" ; some whitespace, or... + "[^=<>/:?[:space:]]\\(?1:\\)" ; no whitespace but not == <= >= /= := ?= + "\\)" ; end first shy group + "=" + "\\(?:" ; shy group for whitespace-after (subgroups get index 2) + "\\(?2:[[:space:]]+\\|$\\)\\|" ; some whitespace, or... + "\\(?2:\\)[^=<>/:[:space:]]" ; no whitespace but not == =< => =/ =: + "\\)" ; end second shy group + "\\)" ; end outer wrapper + )) ) + + ;; The default Erlang separator is whole forms (dot-terminated) + (setq align-region-separate erl-sep-forms) + + ;; Exclusion rules + ;; (the exc-open-comment rule in align.el seems broken) + (add-to-list 'align-exclude-rules-list + '(erlang-exc-open-comment + (regexp . "^[^%\n]*\\(%.*\\)$") + (modes . '(erlang-mode)))) + ;; (the exc-dq-string and exc-sq-string rules in align.el have a bug) + (add-to-list 'align-exclude-rules-list + '(erlang-exc-dq-string + (regexp . "\\(\"[^\"\n]+\"\\)") + (repeat . t) + (modes . '(erlang-mode)) + )) + (add-to-list 'align-exclude-rules-list + '(erlang-exc-sq-string + (regexp . "\\('[^'\n]+'\\)") + (repeat . t) + (modes . '(erlang-mode)) + )) + + ;; Alignment rules + ;; (Do not try to align things that are the first nonspace character on + ;; its line, such as comments, |, etc. - this is handled by indentation.) + ;; NOTE: Rules that get added later end up earlier in the list. Things + ;; that tend to occur further to the left on a line should be listed + ;; before things that occur further to the right, so a single invokation + ;; of align will clean up most things in one go. + + ;; The align.el 'open-comment' rule doesn't seem to work, so we use our + ;; own rule instead of enabling open-comment for erlang-mode. + ;; (This rule should be added first since comments are rightmost.) + (add-to-list 'align-rules-list + `(erlang-open-comment + (regexp . ,(concat "[^%\n[:space:]]" space-group "%.*$")) + (separate . group) + (modes . '(erlang-mode)) + )) + (add-to-list 'align-rules-list + `(erlang-maps + ;; must not match =:= here + (regexp . ,(concat "[^=]" space-group "\\(=>\\|:=\\)" space-group)) + (group . (1 3)) + (separate . ,(concat "\\(#{\\|" erl-sep-forms "\\|" erl-sep-symbols "\\)")) + (repeat . t) + (modes . '(erlang-mode)) + )) + (add-to-list 'align-rules-list + `(erlang-generator-arrows + (regexp . ,(concat space-group "\\(<-\\|<:-\\|<=\\|<:=\\|&&\\)" space-group)) + (group . (1 3)) + (separate . ,(concat "\\(||\\|" erl-sep-forms "\\|" erl-sep-symbols "\\)")) + (repeat . t) + (modes . '(erlang-mode)) + )) + (add-to-list 'align-rules-list + `(erlang-type-annotation + (regexp . ,(concat space-group "::" space-group)) + (group . (1 2)) + (repeat . t) + (modes . '(erlang-mode)) + )) + ;; erlang-assignment should precede erlang-type-annotation in the rules list + (add-to-list 'align-rules-list + `(erlang-assignment + (regexp . ,erl-just-eq) + (group . (1 2)) + (separate . ,(concat "\\(" erl-sep-forms "\\|" erl-sep-symbols "\\)")) + (repeat . t) + (modes . '(erlang-mode)) + )) + ;; erlang-case-arrow should come first in the rules list + (add-to-list 'align-rules-list + `(erlang-case-arrow + (regexp . ,(concat space-group "->")) + (separate . ,(concat "\\(" erl-sep-forms "\\|" erl-sep-symbols "\\)")) + (modes . '(erlang-mode)) + )) + ) + (if (zerop (buffer-size)) (run-hooks 'erlang-new-file-hook))) @@ -1485,6 +1583,7 @@ Other commands: (modify-syntax-entry ?> "." table) (modify-syntax-entry ?\\ "\\" table) (modify-syntax-entry ?_ "_" table) + (modify-syntax-entry ?~ "_" table) (modify-syntax-entry ?| "." table) (modify-syntax-entry ?^ "'" table) @@ -1513,7 +1612,9 @@ Other commands: (put 'bitsyntax-close-outer 'syntax-table '(5 . ?<)) (put 'bitsyntax-close-outer 'rear-nonsticky '(category)) (make-local-variable 'parse-sexp-lookup-properties) - (setq parse-sexp-lookup-properties 't)) + (setq parse-sexp-lookup-properties 't) + (add-hook 'post-self-insert-hook + #'erlang-electric-pair-string-delimiter 'append t)) (defun erlang-mode-variables () @@ -1620,7 +1721,26 @@ Other commands: ("\\(?:^\\|[^$]\\)'\\(?:[^'\n]\\|\\\\'\\)*\\(\\$\\)'" 1 "w") ;; And the dollar sign in $\" or $\' escapes two ;; characters, not just one. - ("\\(\\$\\)\\\\[\"']" 1 "'")))))) + ("\\(\\$\\)\\\\[\"']" 1 "'") + ;; To highlight triple-or-more quoted strings decently: + ;; mark the second to last character in a sequence + ;; containing an even number of " characters + ;; as an expression prefix character. + ;; This makes an opening even number of (4 or above) + ;; " characters one or more empty strings + ;; followed by one prefixed single opening ", + ;; so effectively just a single ". + ;; A closing even number of " becomes a single closing " + ;; followed by zero or more empty strings, + ;; and then one string containing just a prefix ". + ;; An odd number of opening or closing " works without + ;; any tricks since they become empty strings and + ;; an opening or closing single " last or first. + ;; " chars within a triple-or-more quoted string really + ;; does not work, but a single "-quoted string on one line + ;; only looses the string highlighting. + ("\\(?:\"\"\\)+\\(\"?\\)\"" 1 "'") + ))))) @@ -1653,9 +1773,9 @@ This could be used when defining your own special font-lock setup, e.g: (append erlang-font-lock-keywords-function-header erlang-font-lock-keywords-dollar (erlang-font-lock-set-face - erlang-font-lock-keywords-macros 'my-neon-green-face) + erlang-font-lock-keywords-macros \='my-neon-green-face) (erlang-font-lock-set-face - erlang-font-lock-keywords-lc 'my-deep-red 'my-light-red) + erlang-font-lock-keywords-lc \='my-deep-red \='my-light-red) erlang-font-lock-keywords-attr)) For a more elaborate example, please see the beginning of the file @@ -1834,8 +1954,8 @@ menu is left unchanged. The equality test is performed by `eq'. -Example: (erlang-menu-add-above 'my-erlang-menu-items - 'erlang-menu-man-items)" +Example: (erlang-menu-add-above \='my-erlang-menu-items + \='erlang-menu-man-items)" (erlang-menu-add-below entry above items t)) @@ -1853,8 +1973,8 @@ The equality test is performed by `eq'. Example: \(setq erlang-menu-items - (erlang-menu-add-below 'my-erlang-menu-items - 'erlang-menu-base-items + (erlang-menu-add-below \='my-erlang-menu-items + \='erlang-menu-base-items erlang-menu-items))" (if (memq entry items) items ; Return the original menu. @@ -2311,7 +2431,6 @@ the search for the buffer more accurate." (let ((buffer (or buf (progn ; find buffer containing man page - (require 'cl-lib) (car (cl-remove-if-not (lambda (buf) (string-match (or module-name "") @@ -2477,7 +2596,7 @@ package not be present, this function does nothing." Example of use, assuming that `erlang-skel-func' is defined: - (defvar foo-skeleton '(\"%%% New function:\" + (defvar foo-skeleton \='(\"%%% New function:\" (erlang-skel-include erlang-skel-func))) Technically, this function returns the `tempo' attribute`(l ...)' which @@ -2599,6 +2718,7 @@ This is automagically called by the user level function `indent-region'." (goto-char beg) (beginning-of-line) (setq indent-point (point)) + (erlang-string-start) (erlang-beginning-of-clause) ;; Parse the Erlang code from the beginning of the clause to ;; the beginning of the region. @@ -2679,7 +2799,6 @@ This is automagically called by the user level function `indent-region'." (defmacro erlang-push (x stack) (list 'setq stack (list 'cons x stack))) (defmacro erlang-pop (stack) (list 'setq stack (list 'cdr stack))) - (defun erlang-calculate-indent (&optional parse-start) "Compute appropriate indentation for current line as Erlang code. Return nil if line starts inside string, t if in a comment." @@ -2688,7 +2807,8 @@ Return nil if line starts inside string, t if in a comment." (case-fold-search nil) (state nil)) (if parse-start - (goto-char parse-start) + (goto-char parse-start) + (erlang-string-start) (erlang-beginning-of-clause)) (while (< (point) indent-point) (let ((pt (point))) @@ -2705,7 +2825,8 @@ Return nil if line starts inside string, t if in a comment." (save-excursion (let ((starting-point (point)) (case-fold-search nil) - (state nil)) + (state nil)) + (erlang-string-start) (erlang-beginning-of-clause) (while (< (point) starting-point) (setq state (erlang-partial-parse (point) starting-point state))) @@ -2718,12 +2839,24 @@ Value is list (stack token-start token-type in-what)." (goto-char from) ; Start at the beginning (erlang-skip-blank to) (let ((cs (char-syntax (following-char))) - (stack (car state)) - (token (point)) - in-what) + (stack (car state)) + (token (point)) + in-what) (cond - - ;; Done: Return previous state. + ((and stack (eq (car (car stack)) 'string)) + (goto-char (car (cdr (car stack)))) ;; String start + (condition-case nil + (progn + (forward-sexp 1) + (if (<= (point) to) + (erlang-pop stack) + (setq in-what 'string) + )) + (error + (setq in-what 'string) + (goto-char to)))) + + ;; Done: Return previous state. ((>= token to) (setq token (nth 1 state)) (setq cs (nth 2 state)) @@ -2806,16 +2939,18 @@ Value is list (stack token-start token-type in-what)." (forward-sexp 1)) ;; String: Try to skip over it. (Catch error if not complete.) ((= cs ?\") - (condition-case nil - (progn - (forward-sexp 1) - (if (> (point) to) - (progn - (setq in-what 'string) - (goto-char to)))) - (error - (setq in-what 'string) - (goto-char to)))) + (condition-case nil + (progn + (forward-sexp 1) + (if (> (point) to) + (progn + (erlang-push (list 'string token (current-column)) stack) + (setq in-what 'string) + (goto-char to)) + )) + (error + (setq in-what 'string) + (goto-char to)))) ;; Expression prefix e.i. $ or ^ (Note ^ can be in the character ;; literal $^ or part of string and $ outside of a string denotes @@ -3376,6 +3511,18 @@ commands." ;; The current implementation makes it hopeless to use the functions as ;; subroutines in more complex commands. /andersl +(defun erlang-string-start () + "If inside a string (or comment), move to the beginning of the string" + + ;; This is not perfect because of erlang.el handling of multiline strings but better than before + (beginning-of-line) + (let ((string-start-pos (nth 8 (syntax-ppss)))) + (while string-start-pos + (goto-char string-start-pos) + (beginning-of-line) ;; Hack to handle "" inside """ """ + (setq string-start-pos (nth 8 (syntax-ppss))) + ))) + (defun erlang-beginning-of-clause (&optional arg) "Move backward to previous start of clause. With argument, do this that many times. @@ -3392,11 +3539,11 @@ Return t unless search stops due to end of buffer." (forward-char 1)) (forward-char -1) (if (looking-at "\\`\n") - (forward-char 1)))) + (forward-char 1)))) ;; The regexp matches a function header that isn't ;; included in a string. (and (re-search-forward "\\(\\`\\|\\`\n\\|[^\\]\n\\)\\(-?[a-z]\\|'\\|-\\)" - nil 'move (- arg)) + nil 'move (- arg)) (let ((beg (match-beginning 2))) (and beg (goto-char beg)) t))) @@ -4277,6 +4424,18 @@ non-whitespace characters following the point on the current line." '(category nil)) (forward-char 1)))))) +(defun erlang-electric-pair-string-delimiter () + "Check if a third double-quote was just inserted, and if so, insert three more." + (when (and electric-pair-mode + (eq last-command-event ?\") + (let ((count 0)) + (while (eq (char-before (- (point) count)) last-command-event) + (cl-incf count)) + (= count 3)) + (eq (char-after) last-command-event)) + (insert ?\n) + (save-excursion (insert "\n\"\"")))) + (defun erlang-after-bitsyntax-close () "Return t if point is immediately after a bit-syntax close parenthesis (`>>')." (and (>= (point) 3) @@ -5653,7 +5812,7 @@ The following special commands are available: \\{erlang-shell-mode-map}" (erlang-mode-variables) ;; Needed when compiling directly from the Erlang shell. - (setq compilation-last-buffer (current-buffer)) + (setq next-error-last-buffer (current-buffer)) (setq comint-prompt-regexp "^[^>=]*> *") (make-local-variable 'comint-prompt-read-only) (setq comint-prompt-read-only erlang-shell-prompt-read-only) @@ -5711,7 +5870,7 @@ Selects Comint or Compilation mode command as appropriate." (defvar inferior-erlang-display-buffer-any-frame nil "When nil, `inferior-erlang-display-buffer' use only selected frame. -When t, all frames are searched. When 'raise, the frame is raised.") +When t, all frames are searched. When \='raise, the frame is raised.") (defvar inferior-erlang-shell-type 'newshell "The type of Erlang shell to use. @@ -5826,7 +5985,7 @@ The window is returned. Should `inferior-erlang-display-buffer-any-frame' be nil the buffer is displayed in the current frame. Should it be non-nil, and the buffer already is visible in any other frame, no new window will be created. -Should it be the atom 'raise, the frame containing the window will +Should it be the atom \='raise, the frame containing the window will be raised. Should the optional argument SELECT be non-nil, the window is @@ -6024,9 +6183,10 @@ There exists two workarounds for this bug: (sit-for 0) (inferior-erlang-wait-prompt) (with-current-buffer inferior-erlang-buffer - (setq compilation-error-list nil) - (set-marker compilation-parsing-end end)) - (setq compilation-last-buffer inferior-erlang-buffer))) + (when (and (boundp 'compilation-error-list) (boundp 'compilation-parsing-end)) + (setq compilation-error-list nil) + (set-marker compilation-parsing-end end))) + (setq next-error-last-buffer inferior-erlang-buffer))) (defun inferior-erlang-prepare-for-input (&optional no-display) "Create an inferior erlang buffer if needed and ready it for input. @@ -6240,72 +6400,6 @@ The default is to go to the directory of the current buffer." (inferior-erlang-wait-prompt) (inferior-erlang-send-command (format "cd('%s')." dir) nil)) -(defun erlang-align-arrows (start end) - "Align arrows (\"->\") in function clauses from START to END. -When called interactively, aligns arrows after function clauses inside -the region. - -With a prefix argument, aligns all arrows, not just those in function -clauses. - -Example: - -sum(L) -> sum(L, 0). -sum([H|T], Sum) -> sum(T, Sum + H); -sum([], Sum) -> Sum. - -becomes: - -sum(L) -> sum(L, 0). -sum([H|T], Sum) -> sum(T, Sum + H); -sum([], Sum) -> Sum." - (interactive "r") - (save-excursion - (let (;; regexp for matching arrows. without a prefix argument, - ;; the regexp matches function heads. With a prefix, it - ;; matches any arrow. - (re (if current-prefix-arg - "^.*\\(\\)->" - (eval-when-compile - (concat "^" erlang-atom-regexp ".*\\(\\)->")))) - ;; part of regexp matching directly before the arrow - (arrow-match-pos (if current-prefix-arg - 1 - (1+ erlang-atom-regexp-matches))) - ;; accumulator for positions where arrows are found, ordered - ;; by buffer position (from greatest to smallest) - (arrow-positions '()) - ;; accumulator for longest distance from start of line to arrow - (most-indent 0) - ;; marker to track the end of the region we're aligning - (end-marker (progn (goto-char end) - (point-marker)))) - ;; Pass 1: Find the arrow positions, adjust the whitespace - ;; before each arrow to one space, and find the greatest - ;; indentation level. - (goto-char start) - (while (re-search-forward re end-marker t) - (goto-char (match-beginning arrow-match-pos)) - (just-one-space) ; adjust whitespace - (setq arrow-positions (cons (point) arrow-positions)) - (setq most-indent (max most-indent (erlang-column-number)))) - (set-marker end-marker nil) ; free the marker - ;; Pass 2: Insert extra padding so that all arrow indentation is - ;; equal. This is done last-to-first by buffer position, so that - ;; inserting spaces before one arrow doesn't change the - ;; positions of the next ones. - (mapc (lambda (arrow-pos) - (goto-char arrow-pos) - (let* ((pad (- most-indent (erlang-column-number)))) - (when (> pad 0) - (insert-char ?\ pad)))) - arrow-positions)))) - -(defun erlang-column-number () - "Return the column number of the current position in the buffer. -Tab characters are counted by their visual width." - (string-width (buffer-substring (line-beginning-position) (point)))) - (defun erlang-current-defun () "`add-log-current-defun-function' for Erlang." (save-excursion @@ -6326,6 +6420,7 @@ Tab characters are counted by their visual width." ;; Local variables: ;; coding: utf-8 +;; lisp-indent-offset: 2 ;; indent-tabs-mode: nil ;; End: diff --git a/elpa/erlang-20230628.1002/erldoc.el b/elpa/erlang-20241217.813/erldoc.el similarity index 100% rename from elpa/erlang-20230628.1002/erldoc.el rename to elpa/erlang-20241217.813/erldoc.el -- 2.47.3