Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some deprecated things on emacs-29 #8879

Open
wants to merge 1 commit into
base: maint
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tools/emacs/erlang-flymake.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/tools/emacs/erlang-skels-old.el
Original file line number Diff line number Diff line change
Expand Up @@ -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'.")

Expand Down Expand Up @@ -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'.")

Expand Down
6 changes: 3 additions & 3 deletions lib/tools/emacs/erlang-skels.el
Original file line number Diff line number Diff line change
Expand Up @@ -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'.")

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/tools/emacs/erlang-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,21 @@ 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
(erlang-mode)
(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 ()
Expand Down
59 changes: 31 additions & 28 deletions lib/tools/emacs/erlang.el
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
(require 'align)
(require 'comint)
(require 'tempo)
(require 'cl-lib)

;;; `caddr' is builtin since Emacs 26.
(eval-and-compile
Expand All @@ -91,7 +92,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
Expand All @@ -108,7 +109,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)

"
Expand Down Expand Up @@ -180,7 +181,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)))
Expand Down Expand Up @@ -252,15 +253,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
Expand All @@ -285,7 +286,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\"))")
Expand All @@ -302,8 +303,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
Expand Down Expand Up @@ -366,7 +369,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,
Expand All @@ -387,7 +390,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,
Expand All @@ -405,7 +408,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,
Expand All @@ -426,7 +429,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,
Expand Down Expand Up @@ -560,7 +563,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)
Expand Down Expand Up @@ -1765,9 +1768,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
Expand Down Expand Up @@ -1946,8 +1949,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))


Expand All @@ -1965,8 +1968,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.
Expand Down Expand Up @@ -2423,7 +2426,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 "")
Expand Down Expand Up @@ -2589,7 +2591,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
Expand Down Expand Up @@ -5765,7 +5767,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)
Expand Down Expand Up @@ -5823,7 +5825,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.
Expand Down Expand Up @@ -5938,7 +5940,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
Expand Down Expand Up @@ -6136,9 +6138,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.
Expand Down
Loading