• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/

Lines Matching +defs:file +defs:word

11 ;; This file is part of GNU Emacs.
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
31 ;; associates a string with a location in a certain file. Thus, you
110 "*Controls when Emacs saves bookmarks to a file.
124 To specify the file in which to save them, modify the variable
125 `bookmark-default-file', which is `~/.emacs.bmk' by default."
130 (defconst bookmark-old-default-file "~/.emacs-bkmrks"
131 "*The `.emacs.bmk' file used to be called this name.")
135 (defvar bookmark-file nil
136 "Old name for `bookmark-default-file'.")
138 (defcustom bookmark-default-file
139 (if bookmark-file
140 ;; In case user set `bookmark-file' in her .emacs:
141 bookmark-file
144 :type 'file
149 "*Whether or not to make numbered backups of the bookmark file.
179 (defcustom bookmark-bmenu-file-column 30
189 following in your `.emacs' file:
298 "Name of bookmark most recently used in the current file.
300 through a file easier.")
323 ;; Only functions on this page and the next one (file formats) need to
334 (bookmark-maybe-load-default-file)
465 (bookmark-maybe-load-default-file) ; paranoia
499 (bookmark-maybe-load-default-file)
536 `((filename . ,(bookmark-buffer-file-name))
600 ;; FILENAME is the location of the file in which the bookmark is set.
607 ;; The context strings exist so that modifications to a file don't
610 ;; case the file has changed since the bookmark was set. It will
617 (defconst bookmark-file-format-version 1
624 "This string marks the end of the version stamp in a bookmark file.")
666 (defun bookmark-upgrade-file-format-from-0 ()
667 "Upgrade a bookmark file of format 0 (the original format) to format 1.
668 This expects to be called from `point-min' in a bookmark file."
670 bookmark-file-format-version)
674 (bookmark-insert-file-format-version-stamp)
679 bookmark-file-format-version)
683 (defun bookmark-grok-file-format-version ()
684 "Return an integer which is the file-format version of this bookmark file.
685 This expects to be called from `point-min' in a bookmark file."
697 (defun bookmark-maybe-upgrade-file-format ()
698 "Check the file-format version of this bookmark file.
700 This expects to be called from `point-min' in a bookmark file."
701 (let ((version (bookmark-grok-file-format-version)))
703 ((= version bookmark-file-format-version)
706 (bookmark-upgrade-file-format-from-0))
708 (error "Bookmark file format version strangeness")))))
711 (defun bookmark-insert-file-format-version-stamp ()
712 "Insert text indicating current version of bookmark file format."
715 bookmark-file-format-version))
722 ;;; end file-format stuff
739 "Set a bookmark named NAME inside a file.
754 through a large file\). If no bookmark was used, then C-u inserts the
755 name of the file being visited.
762 (bookmark-buffer-file-name)
763 (error "Buffer not visiting a file or directory"))
765 (bookmark-maybe-load-default-file)
779 (define-key now-map "\C-w" 'bookmark-yank-word)
813 (defvar bookmark-annotation-file nil)
821 the bookmark (and file, and point) specified in buffer local variables."
876 (make-local-variable 'bookmark-annotation-file)
881 (setq bookmark-annotation-file (buffer-file-name buf))
953 Default to file name if it's nil."
963 "Insert the current file name into the bookmark name being set.
964 The directory part of the file name is not used."
974 "Return the name of the current buffer's file, non-directory.
979 ;; Or are we a file?
980 (buffer-file-name (file-name-nondirectory buffer-file-name))
989 (file-name-nondirectory (substring dirname 0 idx))
997 (defun bookmark-yank-word ()
999 ;; get the next word from the buffer and append it to the name of
1007 (forward-word 1)
1012 (defvar Info-current-file)
1014 (defun bookmark-buffer-file-name ()
1015 "Return the current buffer's file in a way useful for bookmarks.
1016 For example, if this is a Info buffer, return the Info file's name."
1019 Info-current-file)
1020 (buffer-file-name
1024 (abbreviate-file-name buffer-file-name))
1031 (defun bookmark-maybe-load-default-file ()
1036 ;; Possibly the old bookmark file, "~/.emacs-bkmrks", needs
1038 (file-exists-p (expand-file-name bookmark-old-default-file))
1039 (not (file-exists-p (expand-file-name bookmark-default-file)))
1040 (rename-file (expand-file-name bookmark-old-default-file)
1041 (expand-file-name bookmark-default-file)))
1045 (file-readable-p (expand-file-name bookmark-default-file))
1046 (bookmark-load bookmark-default-file t t)
1066 "Jump to bookmark BOOKMARK (a point in some file).
1072 If the file pointed to by BOOKMARK no longer exists, you will be asked
1093 (defun bookmark-file-or-variation-thereof (file)
1099 (if (file-exists-p file)
1100 file
1105 (let ((suffixed-file (concat file (car elt))))
1106 (if (file-exists-p suffixed-file)
1107 (throw 'found suffixed-file))))
1111 (if (vc-backend file) file))))
1117 (bookmark-maybe-load-default-file)
1118 (let* ((file (expand-file-name (bookmark-get-filename str)))
1123 (orig-file file)
1125 (if (setq file (bookmark-file-or-variation-thereof file))
1133 (Info-find-node file info-node)))
1134 ;; Else no Info. Can do an ordinary find-file:
1135 (set-buffer (find-file-noselect file))
1139 ;; was found in the file, we can search backward for behind-str.
1141 ;; file, it's better to be put before it so you can read it,
1153 ;; Else unable to find the marked file, so ask if user wants to
1156 (if (y-or-n-p (concat (file-name-nondirectory orig-file)
1171 "Relocate BOOKMARK to another file (reading file name with minibuffer).
1172 This makes an already existing bookmark point to that file, instead of
1173 the one it used to point at. Useful when a file has been renamed
1177 (bookmark-maybe-load-default-file)
1179 (newloc (expand-file-name
1180 (read-file-name
1182 (file-name-directory bmrk-filename)))))
1189 "Insert the name of the file associated with BOOKMARK.
1211 "Return the name of the file associated with BOOKMARK."
1212 (bookmark-maybe-load-default-file)
1231 (bookmark-maybe-load-default-file)
1242 (define-key now-map "\C-w" 'bookmark-yank-word)
1257 "Insert the text of the file pointed to by bookmark BOOKMARK.
1264 (bookmark-maybe-load-default-file)
1281 one most recently used in this file, if any\).
1288 (bookmark-maybe-load-default-file)
1307 ;; finds out whether it's time to save bookmarks to a file, by
1323 "Write bookmarks to a file (reading the file name with the minibuffer).
1326 (bookmark-maybe-load-default-file)
1331 (defun bookmark-save (&optional parg file)
1333 Saves by default in the file defined by the variable
1334 `bookmark-default-file'. With a prefix arg, save it in file FILE
1338 FILE, and if you just want it to write to the default file, then
1341 user will be interactively queried for a file to save in.
1343 When you want to load in the bookmarks from a file, use
1345 for a file, defaulting to the file defined by variable
1346 `bookmark-default-file'."
1348 (bookmark-maybe-load-default-file)
1350 ((and (null parg) (null file))
1351 ;;whether interactive or not, write to default file
1352 (bookmark-write-file bookmark-default-file))
1353 ((and (null parg) file)
1354 ;;whether interactive or not, write to given file
1355 (bookmark-write-file file))
1356 ((and parg (not file))
1358 (let ((file (read-file-name "File to save bookmarks in: ")))
1359 (bookmark-write-file file)))
1360 (t ; someone called us with prefix-arg *and* a file, so just write to file
1361 (bookmark-write-file file)))
1362 ;; signal that we have synced the bookmark file by setting this to
1370 (defun bookmark-write-file (file)
1373 (bookmark-maybe-message "Saving bookmarks to file %s..." file)
1379 (bookmark-insert-file-format-version-stamp)
1389 (write-region (point-min) (point-max) file)
1390 (file-error (message "Can't write %s" file)))
1393 "Saving bookmarks to file %s...done" file))))))
1429 (defun bookmark-load (file &optional overwrite no-msg)
1436 If you load a file that doesn't contain a proper bookmark alist, you
1439 place. Your own personal bookmark file, `~/.emacs.bmk', is
1443 If you load a file containing bookmarks with the same names as
1448 (list (read-file-name
1450 bookmark-default-file)
1454 "~/" bookmark-default-file 'confirm)))
1455 (setq file (expand-file-name file))
1456 (if (file-readable-p file)
1460 (bookmark-maybe-message "Loading bookmarks from %s..." file))
1462 (find-file-noselect file)))
1464 (bookmark-maybe-upgrade-file-format)
1477 (expand-file-name bookmark-default-file)
1478 file)
1481 (error "Invalid bookmark list in %s" file)))
1484 (bookmark-maybe-message "Loading bookmarks from %s...done" file)))
1485 (error "Cannot read bookmark file %s" file)))
1571 (bookmark-maybe-load-default-file)
1636 \\[bookmark-bmenu-relocate] -- relocate this bookmark's file \(prompts for new file\).
1640 \\[bookmark-bmenu-save] -- save the current bookmark list in the default file.
1641 With a prefix arg, prompts for a file to save in.
1642 \\[bookmark-bmenu-load] -- load in a file of bookmarks (prompts for file.)
1690 (move-to-column bookmark-bmenu-file-column t)
1714 (backward-word 1)
1760 (backward-word 1)
1862 "Save the current list into a bookmark file.
1863 With a prefix arg, prompts for a file to save them in."
1871 "Load the bookmark file and rebuild the bookmark menu-buffer."
2092 "Change the file path of the bookmark on the current line,