Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore(cleanup): remove Emacs 24 hack not supported anymore #490

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

Merged
merged 1 commit into from
Mar 14, 2022
Merged
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
39 changes: 0 additions & 39 deletions elixir-smie.el
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,6 @@
(require 'smie) ; Simple minded indentation engine
(require 'cl-lib) ; `cl-flet'

;; HACK: Patch for Emacs 24.3 smie that fix
;; https://github.com/elixir-editors/emacs-elixir/issues/107.
;;
;; defadvice is used to change the behavior only for elixir-mode.
;; Definition of advice is a definition of corresponding function
;; in Emacs 24.4.
(when (and (= 24 emacs-major-version)
(= 3 emacs-minor-version))
(defadvice smie-rule-parent (around elixir-mode-patch activate)
(if (not (eq major-mode 'elixir-mode))
(progn ad-do-it)
(setq ad-return-value
(save-excursion
(goto-char (cadr (smie-indent--parent)))
(cons 'column
(+ (or offset 0)
(smie-indent-virtual)))))))

(defadvice smie-indent-comment (around elixir-mode-patch activate)
(if (not (eq major-mode 'elixir-mode))
(progn ad-do-it)
(setq ad-return-value
(and (smie-indent--bolp)
(let ((pos (point)))
(save-excursion
(beginning-of-line)
(and (re-search-forward comment-start-skip (line-end-position) t)
(eq pos (or (match-end 1) (match-beginning 0))))))
(save-excursion
(forward-comment (point-max))
(skip-chars-forward " \t\r\n")
(unless
(save-excursion
(let ((next (funcall smie-forward-token-function)))
(or (if (zerop (length next))
(or (eobp) (eq (car (syntax-after (point))) 5)))
(rassoc next smie-closer-alist))))
(smie-indent-calculate))))))))

;; In Emacs 27, ppss became a structure and has proper accessors.

(defalias 'elixir-ppss-depth
Expand Down