Function: bookmark-make-record-default

bookmark-make-record-default is a byte-compiled function defined in bookmark.el.gz.

Signature

(bookmark-make-record-default &optional NO-FILE NO-CONTEXT POSN)

Documentation

Return the record describing the location of a new bookmark.

Point should be at the buffer in which the bookmark is being set, and normally should be at the position where the bookmark is desired, but see the optional arguments for other possibilities.

If NO-FILE is non-nil, then only return the subset of the record that pertains to the location within the buffer, leaving off the part that records the filename.

If NO-CONTEXT is non-nil, do not include the front- and rear-context strings in the record -- the position is enough.

If POSN is non-nil, record POSN as the point instead of (point).

Source Code

;; Defined in /usr/src/emacs/lisp/bookmark.el.gz
(defun bookmark-make-record-default (&optional no-file no-context posn)
  "Return the record describing the location of a new bookmark.
Point should be at the buffer in which the bookmark is being set,
and normally should be at the position where the bookmark is desired,
but see the optional arguments for other possibilities.

If NO-FILE is non-nil, then only return the subset of the
record that pertains to the location within the buffer, leaving off
the part that records the filename.

If NO-CONTEXT is non-nil, do not include the front- and rear-context
strings in the record -- the position is enough.

If POSN is non-nil, record POSN as the point instead of `(point)'."
  `(,@(unless no-file `((filename . ,(bookmark-buffer-file-name))))
    ,@(unless no-context `((front-context-string
                           . ,(if (>= (- (point-max) (point))
                                      bookmark-search-size)
                                  (buffer-substring-no-properties
                                   (point)
                                   (+ (point) bookmark-search-size))
                                  nil))))
    ,@(unless no-context `((rear-context-string
                           . ,(if (>= (- (point) (point-min))
                                      bookmark-search-size)
                                  (buffer-substring-no-properties
                                   (point)
                                   (- (point) bookmark-search-size))
                                  nil))))
    (position . ,(or posn (point)))
    (last-modified . ,(current-time))))