Comments (6)
This problem seems to be the cause of the problem for this behavior in Guix
$ guix package -i emacs-ess
The following package will be installed:
emacs-ess 18.10.2-0.24da603
The following derivations will be built:
/gnu/store/fr1fp22rpdjc7k4my8b5bdvqpvf14s8y-emacs-julia-mode-0.4.drv
/gnu/store/y6gn2gkvnawzkf5n79ryswqcx6r809rn-emacs-ess-18.10.2-0.24da603.drv
building /gnu/store/fr1fp22rpdjc7k4my8b5bdvqpvf14s8y-emacs-julia-mode-0.4.drv...
| 'check' phasebuilder for `/gnu/store/fr1fp22rpdjc7k4my8b5bdvqpvf14s8y-emacs-julia-mode-0.4.drv' failed with exit code 1
build of /gnu/store/fr1fp22rpdjc7k4my8b5bdvqpvf14s8y-emacs-julia-mode-0.4.drv failed
View build log at '/var/log/guix/drvs/fr/1fp22rpdjc7k4my8b5bdvqpvf14s8y-emacs-julia-mode-0.4.drv.gz'.
guix package: error: build of `/gnu/store/fr1fp22rpdjc7k4my8b5bdvqpvf14s8y-emacs-julia-mode-0.4.drv' failed
$ echo $?
1
Here's the relevant part of the file /var/log/guix/drvs/fr/1fp22rpdjc7k4my8b5bdvqpvf14s8y-emacs-julia-mode-0.4.drv.gz'
(complete file here)
Indenting region...
Indenting region...done
Test julia--test-end-of-defun-nested-2 backtrace:
signal(ert-test-failed (((should (eq (point) (if (stringp "return fa
ert-fail(((should (eq (point) (if (stringp "return fact(x)[ \n]+end"
(if (unwind-protect (setq value-247 (apply fn-245 args-246)) (setq f
(let (form-description-249) (if (unwind-protect (setq value-247 (app
(let ((value-247 'ert-form-evaluation-aborted-248)) (let (form-descr
(let* ((fn-245 #'eq) (args-246 (condition-case err (let ((signal-hoo
(progn (julia-mode) (insert "function f(x)\nfunction fact(n)\nif n =
(unwind-protect (progn (julia-mode) (insert "function f(x)\nfunction
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current
(lambda nil (let ((temp-buffer (generate-new-buffer " *temp*" t))) (
ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
ert-run-test(#s(ert-test :name julia--test-end-of-defun-nested-2 :do
ert-run-or-rerun-test(#s(ert--stats :selector t :tests ... :test-map
ert-run-tests(t #f(compiled-function (event-type &rest event-args) #
ert-run-tests-batch(nil)
ert-run-tests-batch-and-exit()
command-line-1(("-l" "julia-mode-tests.el" "-f" "ert-run-tests-batch
command-line()
normal-top-level()
Test julia--test-end-of-defun-nested-2 condition:
(ert-test-failed
((should
(eq
(point)
(if ... ... "return fact(x)[ \n]+end")))
:form
(eq 141 163)
:value nil))
FAILED 14/43 julia--test-end-of-defun-nested-2 (0.000723 sec) at julia-mode-tests.el:584
passed 15/43 julia--test-escaped-strings-dont-terminate-string (0.000403 sec)
passed 16/43 julia--test-function-assignment-font-locking (0.000419 sec)
Indenting region...
Indenting region...done
from julia-emacs.
@simonlegrand I confim the bug appears with Emacs 29.1 and not with 28.2. What happens? Consider the Julia code used by the test:
function f(x)
function fact(n)
if n == 0
return 1
else
return n * fact(n-1)
end
end
return fact(x)
end
Now, I use the symbol [X]
to mark where the current point is.
function f(x)
function fact(n)
if n == 0[X]
return 1
else
return n * fact(n-1)
end
end
return fact(x)
end
The test julia--test-end-of-defun-nested-2
applies C-u 2 C-M-e
, it results:
function f(x)
function fact(n)
if n == 0
return 1
else
return n * fact(n-1)
end
end
[x] return fact(x)
end
which is incorrect. It should be at the end. Therefore, julia-end-of-defun
is buggy.
I guess the bug comes from this new snippet in 29.1, lisp/emacs-lisp/lisp.el
from core:
;; At this point, point either didn't move (because we started
;; in between two defun's), or is at the end of a defun
;; (because we started in the middle of a defun).
(unless (zerop arg)
(when (setq success (beginning-of-defun-raw (- arg)))
(funcall end-of-defun-function))))
that replaced this old snippet in 28.x:
(unless (zerop arg)
(beginning-of-defun-raw (- arg))
(setq beg (point))
(funcall end-of-defun-function))))
from julia-emacs.
The test
julia--test-end-of-defun-nested-2
appliesC-u 2 C-M-e
, it results:
[...]
which is incorrect. It should be at the end. Therefore,julia-end-of-defun
is buggy.
Hum, I do not know... I observe the same behavior with an equivalent Python code using python-mode
.
from julia-emacs.
Thanks for the explanations!
Hum, I do not know... I observe the same behavior with an equivalent Python code using python-mode.
Doesn't it make sens since python-mode is also using end-of-defun-function
?
from julia-emacs.
Reported to upstream Emacs: #66763.
from julia-emacs.
Related Issues (20)
- How to search for unicode characters? HOT 2
- Support julia markdown mode
- font-lock-warning-face for @inbounds and @generated
- Warning in Emacs 29
- Type a sequence of subscript/superscript characters HOT 1
- julia-mode did not run properly in emacs-28.2 HOT 3
- Update breaks autocomplete in jupyter-emacs org mode code cells HOT 11
- Identation in fresh julia-mode installation HOT 1
- Identation in fresh julia-mode installation HOT 7
- Identation in fresh julia-mode installation HOT 1
- Consider creating an option to mimic previous tab behavior HOT 18
- comment region with #= =# HOT 1
- Cannot open load file: No such file or directory, ess (exporting) HOT 3
- automatic insert end to close a function or type definition
- Consecutive super/subscript completion HOT 1
- Macro invocations not highlighted if preceded by an exclamation mark
- julia-mode.el not indenting and throwing error HOT 5
- Unicode substitution broken with helm HOT 7
- Help finding a maintainer for julia-ts-mode HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia-emacs.