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
d7c64071
Commit
d7c64071
authored
Mar 29, 1993
by
Eric S. Raymond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
418b4f05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
lisp/simple.el
lisp/simple.el
+28
-0
No files found.
lisp/simple.el
View file @
d7c64071
...
...
@@ -1675,6 +1675,34 @@ With argument, do this that many times."
With argument, do this that many times."
(
interactive
"p"
)
(
kill-word
(
-
arg
)))
(
defun
current-word
()
"Return the word point is on as a string, if it's between two
word-constituent characters. If not, but it immediately follows one,
move back first. Otherwise, if point precedes a word constituent,
move forward first. Otherwise, move backwards until a word constituent
is found and get that word; if you reach a newline first, move forward
instead."
(
interactive
)
(
save-excursion
(
let
((
oldpoint
(
point
))
(
start
(
point
))
(
end
(
point
)))
(
skip-syntax-backward
"w_"
)
(
setq
start
(
point
))
(
goto-char
oldpoint
)
(
skip-syntax-forward
"w_"
)
(
setq
end
(
point
))
(
if
(
and
(
eq
start
oldpoint
)
(
eq
end
oldpoint
))
(
progn
(
skip-syntax-backward
"^w_"
(
save-excursion
(
beginning-of-line
)
(
point
)))
(
if
(
eq
(
preceding-char
)
?\n
)
(
progn
(
skip-syntax-forward
"^w_"
)
(
setq
start
(
point
))
(
skip-syntax-forward
"w_"
)
(
setq
end
(
point
)))
(
setq
end
(
point
))
(
skip-syntax-backward
"w_"
)
(
setq
start
(
point
)))))
(
buffer-substring
start
end
))))
(
defconst
fill-prefix
nil
"*String for filling to insert at front of new line, or nil for none.
...
...
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