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
4
Issues
4
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
5d71cc6b
Commit
5d71cc6b
authored
Jul 09, 2014
by
Stefan Monnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* lisp/vc/log-edit.el (log-edit-changelog-entries): Don't both visiting
a non-existing file. Fixes: debbugs:17970
parent
f972be09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
38 deletions
+42
-38
lisp/ChangeLog
lisp/ChangeLog
+3
-0
lisp/vc/log-edit.el
lisp/vc/log-edit.el
+39
-38
No files found.
lisp/ChangeLog
View file @
5d71cc6b
2014-07-09 Stefan Monnier <monnier@iro.umontreal.ca>
* vc/log-edit.el (log-edit-changelog-entries): Don't both visiting
a non-existing file (bug#17970).
* faces.el (face-name): Undo last change.
(x-resolve-font-name): Don't call face-name (bug#17956).
...
...
lisp/vc/log-edit.el
View file @
5d71cc6b
...
...
@@ -905,44 +905,45 @@ where LOGBUFFER is the name of the ChangeLog buffer, and each
;; that memoizing which is undesired here.
(
setq
change-log-default-name
nil
)
(
find-change-log
)))))
(
with-current-buffer
(
find-file-noselect
changelog-file-name
)
(
unless
(
eq
major-mode
'change-log-mode
)
(
change-log-mode
))
(
goto-char
(
point-min
))
(
if
(
looking-at
"\\s-*\n"
)
(
goto-char
(
match-end
0
)))
(
if
(
not
(
log-edit-changelog-ours-p
))
(
list
(
current-buffer
))
(
save-restriction
(
log-edit-narrow-changelog
)
(
goto-char
(
point-min
))
;; Search for the name of FILE relative to the ChangeLog. If that
;; doesn't occur anywhere, they're not using full relative
;; filenames in the ChangeLog, so just look for FILE; we'll accept
;; some false positives.
(
let
((
pattern
(
file-relative-name
file
(
file-name-directory
changelog-file-name
))))
(
if
(
or
(
string=
pattern
""
)
(
not
(
save-excursion
(
search-forward
pattern
nil
t
))))
(
setq
pattern
(
file-name-nondirectory
file
)))
(
setq
pattern
(
concat
"\\(^\\|[^[:alnum:]]\\)"
(
regexp-quote
pattern
)
"\\($\\|[^[:alnum:]]\\)"
))
(
let
(
texts
(
pos
(
point
)))
(
while
(
and
(
not
(
eobp
))
(
re-search-forward
pattern
nil
t
))
(
let
((
entry
(
log-edit-changelog-entry
)))
(
if
(
<
(
elt
entry
1
)
(
max
(
1+
pos
)
(
point
)))
;; This is not relevant, actually.
nil
(
push
entry
texts
))
;; Make sure we make progress.
(
setq
pos
(
max
(
1+
pos
)
(
elt
entry
1
)))
(
goto-char
pos
)))
(
cons
(
current-buffer
)
texts
))))))))
(
when
(
file-exists-p
changelog-file-name
)
(
with-current-buffer
(
find-file-noselect
changelog-file-name
)
(
unless
(
eq
major-mode
'change-log-mode
)
(
change-log-mode
))
(
goto-char
(
point-min
))
(
if
(
looking-at
"\\s-*\n"
)
(
goto-char
(
match-end
0
)))
(
if
(
not
(
log-edit-changelog-ours-p
))
(
list
(
current-buffer
))
(
save-restriction
(
log-edit-narrow-changelog
)
(
goto-char
(
point-min
))
;; Search for the name of FILE relative to the ChangeLog. If that
;; doesn't occur anywhere, they're not using full relative
;; filenames in the ChangeLog, so just look for FILE; we'll accept
;; some false positives.
(
let
((
pattern
(
file-relative-name
file
(
file-name-directory
changelog-file-name
))))
(
if
(
or
(
string=
pattern
""
)
(
not
(
save-excursion
(
search-forward
pattern
nil
t
))))
(
setq
pattern
(
file-name-nondirectory
file
)))
(
setq
pattern
(
concat
"\\(^\\|[^[:alnum:]]\\)"
(
regexp-quote
pattern
)
"\\($\\|[^[:alnum:]]\\)"
))
(
let
(
texts
(
pos
(
point
)))
(
while
(
and
(
not
(
eobp
))
(
re-search-forward
pattern
nil
t
))
(
let
((
entry
(
log-edit-changelog-entry
)))
(
if
(
<
(
elt
entry
1
)
(
max
(
1+
pos
)
(
point
)))
;; This is not relevant, actually.
nil
(
push
entry
texts
))
;; Make sure we make progress.
(
setq
pos
(
max
(
1+
pos
)
(
elt
entry
1
)))
(
goto-char
pos
)))
(
cons
(
current-buffer
)
texts
)))))))))
(
defun
log-edit-changelog-insert-entries
(
buffer
beg
end
&rest
files
)
"Insert the text from BUFFER between BEG and END.
...
...
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