aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1995-07-17 23:19:51 +0000
committerKarl Heuer1995-07-17 23:19:51 +0000
commit88415bfc716efcce1f233ce2029caf5abde90e57 (patch)
tree9b1b4f12b423cb24dab4ff46d419af107cdef219
parent69adebeb51104f53801e42b8444ae747a5241620 (diff)
downloademacs-88415bfc716efcce1f233ce2029caf5abde90e57.tar.gz
emacs-88415bfc716efcce1f233ce2029caf5abde90e57.zip
(bookmark-make): Strip text properties off name.
(bookmark-make-cell): Use `buffer-substring-no-properties'. (bookmark-yank-word): Use buffer-substring-no-properties.
-rw-r--r--lisp/bookmark.el66
1 files changed, 30 insertions, 36 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 2fbd68fc337..7b79d112960 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -473,28 +473,30 @@ Optional second arg ANNOTATION gives it an annotation.
473Optional third arg OVERWRITE means replace any existing bookmarks with 473Optional third arg OVERWRITE means replace any existing bookmarks with
474this name." 474this name."
475 (bookmark-maybe-load-default-file) 475 (bookmark-maybe-load-default-file)
476 (if (and (bookmark-get-bookmark name) (not overwrite)) 476 (let ((stripped-name (copy-sequence name)))
477 ;; already existing boookmark under that name and 477 (set-text-properties 0 (length stripped-name) nil stripped-name)
478 ;; no prefix arg means just overwrite old bookmark 478 (if (and (bookmark-get-bookmark stripped-name) (not overwrite))
479 (setcdr (bookmark-get-bookmark name) 479 ;; already existing boookmark under that name and
480 (list (bookmark-make-cell annotation))) 480 ;; no prefix arg means just overwrite old bookmark
481 481 (setcdr (bookmark-get-bookmark stripped-name)
482 ;; otherwise just cons it onto the front (either the bookmark 482 (list (bookmark-make-cell annotation)))
483 ;; doesn't exist already, or there is no prefix arg. In either 483
484 ;; case, we want the new bookmark consed onto the alist...) 484 ;; otherwise just cons it onto the front (either the bookmark
485 ;; doesn't exist already, or there is no prefix arg. In either
486 ;; case, we want the new bookmark consed onto the alist...)
487
488 (setq bookmark-alist
489 (cons
490 (list stripped-name
491 (bookmark-make-cell annotation))
492 bookmark-alist)))
485 493
486 (setq bookmark-alist 494 ;; Added by db
487 (cons 495 (setq bookmark-current-bookmark stripped-name)
488 (list name 496 (setq bookmark-alist-modification-count
489 (bookmark-make-cell annotation)) 497 (1+ bookmark-alist-modification-count))
490 bookmark-alist))) 498 (if (bookmark-time-to-save-p)
491 499 (bookmark-save))))
492 ;; Added by db
493 (setq bookmark-current-bookmark name)
494 (setq bookmark-alist-modification-count
495 (1+ bookmark-alist-modification-count))
496 (if (bookmark-time-to-save-p)
497 (bookmark-save)))
498 500
499 501
500(defun bookmark-make-cell (annotation) 502(defun bookmark-make-cell (annotation)
@@ -504,23 +506,15 @@ being set. This will change soon."
504 (` ((filename . (, (bookmark-buffer-file-name))) 506 (` ((filename . (, (bookmark-buffer-file-name)))
505 (front-context-string 507 (front-context-string
506 . (, (if (>= (- (point-max) (point)) bookmark-search-size) 508 . (, (if (>= (- (point-max) (point)) bookmark-search-size)
507 ;; strip text props via `format': 509 (buffer-substring-no-properties
508 (let ((string 510 (point)
509 (buffer-substring 511 (+ (point) bookmark-search-size))
510 (point)
511 (+ (point) bookmark-search-size))))
512 (set-text-properties 0 (length string) nil string)
513 string)
514 nil))) 512 nil)))
515 (rear-context-string 513 (rear-context-string
516 . (, (if (>= (- (point) (point-min)) bookmark-search-size) 514 . (, (if (>= (- (point) (point-min)) bookmark-search-size)
517 ;; strip text props via `format': 515 (buffer-substring-no-properties
518 (let ((string 516 (point)
519 (buffer-substring 517 (- (point) bookmark-search-size))
520 (point)
521 (- (point) bookmark-search-size))))
522 (set-text-properties 0 (length string) nil string)
523 string)
524 nil))) 518 nil)))
525 (position . (, (point))) 519 (position . (, (point)))
526 (annotation . (, annotation))))) 520 (annotation . (, annotation)))))
@@ -957,7 +951,7 @@ In Info, return the current node."
957 (let ((string (save-excursion 951 (let ((string (save-excursion
958 (set-buffer bookmark-current-buffer) 952 (set-buffer bookmark-current-buffer)
959 (goto-char bookmark-yank-point) 953 (goto-char bookmark-yank-point)
960 (buffer-substring 954 (buffer-substring-no-properties
961 (point) 955 (point)
962 (save-excursion 956 (save-excursion
963 (forward-word 1) 957 (forward-word 1)