Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
1198b03e
Commit
1198b03e
authored
Jul 10, 2020
by
João Távora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix placement of Eldoc docs during eval-expression (bug#42309)
* lisp/emacs-lisp/eldoc.el (eldoc--handle-docs): Rework.
parent
c2599632
Pipeline
#6026
passed with stage
in 56 minutes and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
36 deletions
+40
-36
lisp/emacs-lisp/eldoc.el
lisp/emacs-lisp/eldoc.el
+40
-36
No files found.
lisp/emacs-lisp/eldoc.el
View file @
1198b03e
...
...
@@ -459,42 +459,46 @@ Honor most of `eldoc-echo-area-use-multiline-p'."
;; top-section of the `*eldoc' buffer. I'm pretty sure nicer
;; strategies can be used here, probably by splitting this
;; function into some `eldoc-display-functions' special hook.
(
if
(
and
(
eq
'truncate-sym-name-if-fit
eldoc-echo-area-use-multiline-p
)
(
null
(
cdr
docs
))
(
setq
single-sym-name
(
format
"%s"
(
plist-get
(
cdar
docs
)
:thing
)))
(
>
(
+
(
length
(
caar
docs
))
(
length
single-sym-name
)
2
)
width
))
(
eldoc--message
(
caar
docs
))
(
with-current-buffer
(
eldoc-doc-buffer
)
(
goto-char
(
point-min
))
(
cond
;; Potentially truncate a long message into less lines,
;; then display it in the echo area;
((
>
available
1
)
(
cl-loop
initially
(
goto-char
(
line-end-position
(
1+
available
)))
for
truncated
=
nil
then
t
for
needed
=
(
let
((
truncate-lines
message-truncate-lines
))
(
count-screen-lines
(
point-min
)
(
point
)
t
(
minibuffer-window
)))
while
(
>
needed
(
if
truncated
(
1-
available
)
available
))
do
(
goto-char
(
line-end-position
(
if
truncated
0
-1
)))
(
while
(
and
(
not
(
bobp
))
(
bolp
))
(
goto-char
(
line-end-position
0
)))
finally
(
unless
(
and
truncated
eldoc-prefer-doc-buffer
(
get-buffer-window
eldoc--doc-buffer
))
(
eldoc--message
(
concat
(
buffer-substring
(
point-min
)
(
point
))
(
and
truncated
(
format
"\n(Documentation truncated. Use `%s' to see rest)"
(
substitute-command-keys
"\\[eldoc-doc-buffer]"
))))))))
((
=
available
1
)
;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' too?
(
eldoc--message
(
truncate-string-to-width
(
buffer-substring
(
point-min
)
(
line-end-position
1
))
width
)))))))))
(
let
((
echo-area-message
(
cond
((
and
(
eq
'truncate-sym-name-if-fit
eldoc-echo-area-use-multiline-p
)
(
null
(
cdr
docs
))
(
setq
single-sym-name
(
format
"%s"
(
plist-get
(
cdar
docs
)
:thing
)))
(
>
(
+
(
length
(
caar
docs
))
(
length
single-sym-name
)
2
)
width
))
(
caar
docs
))
((
>
available
1
)
(
with-current-buffer
(
eldoc-doc-buffer
)
(
cl-loop
initially
(
goto-char
(
point-min
))
(
goto-char
(
line-end-position
(
1+
available
)))
for
truncated
=
nil
then
t
for
needed
=
(
let
((
truncate-lines
message-truncate-lines
))
(
count-screen-lines
(
point-min
)
(
point
)
t
(
minibuffer-window
)))
while
(
>
needed
(
if
truncated
(
1-
available
)
available
))
do
(
goto-char
(
line-end-position
(
if
truncated
0
-1
)))
(
while
(
and
(
not
(
bobp
))
(
bolp
))
(
goto-char
(
line-end-position
0
)))
finally
(
unless
(
and
truncated
eldoc-prefer-doc-buffer
(
get-buffer-window
eldoc--doc-buffer
))
(
cl-return
(
concat
(
buffer-substring
(
point-min
)
(
point
))
(
and
truncated
(
format
"\n(Documentation truncated. Use `%s' to see rest)"
(
substitute-command-keys
"\\[eldoc-doc-buffer]"
)))))))))
((
=
available
1
)
;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' too?
(
truncate-string-to-width
(
buffer-substring
(
point-min
)
(
line-end-position
1
))
width
)))))
(
when
echo-area-message
(
eldoc--message
echo-area-message
))))))
(
defun
eldoc-documentation-default
()
"Show first doc string for item at point.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment