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
Open sidebar
emacs
emacs
Commits
dbf8402b
Commit
dbf8402b
authored
Feb 10, 2010
by
Stefan Monnier
Browse files
(bookmark-handle-bookmark): Catch the right error.
(bookmark-default-handler): Accept new bookmark field `buffer'.
parent
2b23acde
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
+25
-16
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/bookmark.el
lisp/bookmark.el
+20
-16
No files found.
lisp/ChangeLog
View file @
dbf8402b
2010-02-10 Thierry Volpiatto <thierry.volpiatto@gmail.com>
* bookmark.el (bookmark-handle-bookmark): Catch the right error.
(bookmark-default-handler): Accept new bookmark field `buffer'.
2010-02-10 Chong Yidong <cyd@stupidchicken.com>
* iswitchb.el (iswitchb-completions): Revert last change.
...
...
lisp/bookmark.el
View file @
dbf8402b
...
...
@@ -1068,7 +1068,7 @@ that file no longer exists, then offer interactively to relocate BOOKMARK."
(
funcall
(
or
(
bookmark-get-handler
bookmark
)
'bookmark-default-handler
)
(
bookmark-get-bookmark
bookmark
))
(
file-error
(
bookmark-error-no-filename
;
file-error
;; We were unable to find the marked file, so ask if user wants to
;; relocate the bookmark, else remind them to consider deletion.
(
when
(
stringp
bookmark
)
...
...
@@ -1116,24 +1116,28 @@ that file no longer exists, then offer interactively to relocate BOOKMARK."
BMK-RECORD is a bookmark record, not a bookmark name (i.e., not a string).
Changes current buffer and point and returns nil, or signals a `file-error'."
(
let
((
file
(
bookmark-get-filename
bmk-record
))
(
buf
(
bookmark-prop-get
bmk-record
'buffer
))
(
forward-str
(
bookmark-get-front-context-string
bmk-record
))
(
behind-str
(
bookmark-get-rear-context-string
bmk-record
))
(
place
(
bookmark-get-position
bmk-record
)))
(
if
(
not
file
)
(
signal
'bookmark-error-no-filename
(
list
'stringp
file
))
(
set-buffer
(
find-file-noselect
file
))
(
if
place
(
goto-char
place
))
;; Go searching forward first. Then, if forward-str exists and
;; was found in the file, we can search backward for behind-str.
;; Rationale is that if text was inserted between the two in the
;; file, it's better to be put before it so you can read it,
;; rather than after and remain perhaps unaware of the changes.
(
if
forward-str
(
if
(
search-forward
forward-str
(
point-max
)
t
)
(
goto-char
(
match-beginning
0
))))
(
if
behind-str
(
if
(
search-backward
behind-str
(
point-min
)
t
)
(
goto-char
(
match-end
0
)))))
(
set-buffer
(
cond
((
and
file
(
file-readable-p
file
)
(
not
(
buffer-live-p
buf
)))
(
find-file-noselect
file
))
;; No file found. See if buffer BUF have been created.
((
and
buf
(
get-buffer
buf
)))
(
t
;; If not, raise error.
(
signal
'bookmark-error-no-filename
(
list
'stringp
file
)))))
(
if
place
(
goto-char
place
))
;; Go searching forward first. Then, if forward-str exists and
;; was found in the file, we can search backward for behind-str.
;; Rationale is that if text was inserted between the two in the
;; file, it's better to be put before it so you can read it,
;; rather than after and remain perhaps unaware of the changes.
(
when
(
and
forward-str
(
search-forward
forward-str
(
point-max
)
t
))
(
goto-char
(
match-beginning
0
)))
(
when
(
and
behind-str
(
search-backward
behind-str
(
point-min
)
t
))
(
goto-char
(
match-end
0
)))
nil
))
;;;###autoload
...
...
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