Closed Ambrevar closed 6 years ago
I don't reproduce: it uses the full symbol for me (with the +
character). Maybe the point was placed before emacs-image+
definition
(on the first open parenthesis?) I guess the previous definition has
emacs-image
name.
Could you check M-: (guix-guile-current-definition)
on that
emacs-image+
definition? Note, the point should be placed somewhere
inside this expression:
(define-public emacs-image+
;;...
)
(Not on the first open parenthesis!)
I can reproduce with the point inside the definition:
(guix-guile-current-definition)
returns emacs-image
.
Hm, strange, perhaps, the buffer you call it from have an unusual syntax
table, so guix-guile-definition-regexp
variable can't handle it. Do
you run this command from scheme-mode
buffer? Did you maybe modify
`scheme-mode-syntax-table'?
I did not. Here is the list of the active modes in my emacs.scm
buffer:
Enabled minor modes: Async-Bytecomp-Package Auto-Composition Auto-Compression
Auto-Encryption Auto-Revert Cl-Old-Struct-Compat Column-Number Company
Desktop-Save Diff-Auto-Refine Dired-Async Display-Line-Numbers Eldoc
Electric-Indent Evil Evil-Local File-Name-Shadow Fish-Completion Font-Lock
Geiser Geiser-Autodoc Global-Eldoc Global-Fish-Completion Global-Font-Lock
Global-Git-Commit Global-Magit-File Global-Undo-Tree Guix-Devel Helm
Helm-Descbinds Helm-Top-Poll Lispyville Magit-Auto-Revert Magit-File Mouse-Wheel
Pdf-Occur-Global Rainbow-Delimiters Recentf Save-Place Savehist Shell-Dirtrack
Show-Paren Size-Indication Tooltip Transient-Mark Undo-Tree Which-Key
Window-Divider
And here is the full definition, in case that matters:
(define-public emacs-image+
(package
(name "emacs-image+")
(version "20150707.916")
(source
(origin
(method url-fetch)
(uri (string-append
"https://melpa.org/packages/image+-"
version
".el"))
(sha256
(base32
"0lbgqc9n2ard9nrsk9ri2jazk8l6dv2hrmi83dvsm14kfnnajdil"))))
(build-system emacs-build-system)
(propagated-inputs `(("imagemagick" ,imagemagick)))
(home-page
"https://github.com/mhayashi1120/Emacs-imagex")
(synopsis
"Image manipulate extensions for Emacs")
(description
"Type @code{C-x C-l +} to zoom-in the current image.
You can zoom-out with type @code{-}.
To manipulate a image under cursor: @code{M-x imagex-sticky-mode}.
Or to activate globally: @code{M-x imagex-global-sticky-mode}.
Or in .emacs: @code{(eval-after-load 'image+ '(imagex-global-sticky-mode 1))}.
- @code{C-c +} / `C-c -`: Zoom in/out image.
- @code{C-c M-m}: Adjust image to current frame size.
- @code{C-c C-x C-s}: Save current image.
- @code{C-c M-r} / @code{C-c M-l}: Rotate image.
- @code{C-c M-o}: Show image @code{image+} have not modified.
Adjusted image when open image file: @code{M-x imagex-auto-adjust-mode}.
Or in .emacs: @code{(eval-after-load 'image+ '(imagex-auto-adjust-mode 1))}.
If you do not want error message in minibuffer: @code{(setq imagex-quiet-error t)}.")
(license license:gpl3+)))
Could you evaluate (with M-:
for example) the following expression:
(re-search-forward "\\(?:[[:word:]]\\|\\s_\\)+" nil t)
Does it stop after or before +
character?
When the point is anywhere before the +
, the above search stops at the +
.
OK, this is the culprit: for me, the point stops right after +
.
Could you also check (when the point is on image+
word):
(re-search-forward "\\s_" nil t)
For me, it also stops after +
.
With the point on the i
in (define-public emacs-image+
, your last search moves on to
the i
in `(name "emacs-image+").
Could you test it when the point is on i
in image+
word?
Which image+
word? You mean if I remove the emacs-
prefix? Then same thing.
No, I mean when my point is placed on i
letter in emacs-image+
and I
eval (re-search-forward "\\s_" nil t)
, the point is moved right
after +
. Is it the same for you?
No, that's the test I mentioned before (I meant the i
in emacs-image+
, not in define-public
, sorry for the confusion).
OK, it means that +
is not counted as a "symbol" syntax character for
you. I have just found M-x describe-syntax
command. When I call it
from .scm buffer, I see the following line there:
* .. + _ which means: symbol
I.e. +
sign is counted as "symbol" on my side.
Maybe there is some difference in our Emacs versions (I use 25.3.1), or
some third-party package modifies syntax table. Oh, btw could you make
a test with "emacs -Q"? I mean just open some buffer in scheme-mode
,
write foo+
there, and check if M-: (re-search-forward "\\s_" nil t)
moves the point after +
or not.
You are right, my syntax table has changed:
+ .. , ' which means: prefix
I use Emacs 26 and there is no issue with emacs -Q
.
I suspect lispy to be the culprit. I'll investigate further.
OK, please let me know if you find out what "evil" package does it :-)
I am closing this issue.
I found the root of the issue: it's in guix/.dir-locals.el
(official file):
;; This notably allows '(' in Paredit to not insert a space when the
;; preceding symbol is one of these.
(eval . (modify-syntax-entry ?~ "'"))
(eval . (modify-syntax-entry ?$ "'"))
(eval . (modify-syntax-entry ?+ "'"))
I'm not sure to understand the comment. What do you think? Should emacs-guix adapt to this or should we discuss this behaviour upstream?
I found the root of the issue: it's in guix/.dir-locals.el (official file):
Good to know, thank you for investigating!
I'm not sure to understand the comment. What do you think?
I have no idea how it effects Paredit behaviour.
Should emacs-guix adapt to this or should we discuss this behaviour upstream?
It's not a problem to adjust the regexp in Emacs-Guix, but I think .dir-locals
shouldn't do it. I believe (re-search-forward "\\s_" nil t)
should find +
character in lisp/scheme modes. Even elisp manual mentions that $&*+-_<>
characters may be part of a symbol name in Lisp mode:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html#Syntax-Class-Table
So my opinion is that this should be fixed on the Guix side.
I've reported the issue on guix-devel.
I see, thanks!
On
emacs-image+
,C-c . b
tries to runThe
+
is missing. The command works if I add the+
manually.