• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching +defs:default +defs:file +defs:modes

7 ;; Keywords: file, tags, tools
16 ;; This file is part of GNU Emacs.
29 ;; along with GNU Emacs; see the file COPYING. If not, write to the
37 ;; to display that file location.
54 ;; This file requires the library package assoc (association lists)
65 ;; modes that do not display traditional file/tag data. Rmail, Info,
66 ;; and the debugger are examples. These modes can, however, benefit
98 ;; If you wish to add to the default speedbar menu for the case of
106 ;; speedbar's default bindings with low overhead.
110 ;; Unlike the specialized modes, there are no name requirements,
183 ("files" speedbar-easymenu-definition-special speedbar-file-key-map
184 speedbar-directory-buttons speedbar-default-directory-list)
187 These expansion lists are only valid for regular files. Special modes
193 called in order. These functions will always get the default
211 speedbar-update-current-file
236 "List of function tables to use for different major display modes.
250 This permits some modes to create customized contents for the speedbar
256 "*Query control for file operations.
257 The 'always flag means to always query before file operations.
258 The 'none-but-delete flag means to not query before any file
259 operations, except before a file deletion."
261 :type '(radio (const :tag "Always Query before some file operations."
263 (const :tag "Never Query before file operations, except for deletions."
271 This list is set by modes that wish to have special speedbar displays.
281 (defcustom speedbar-before-visiting-file-hook '(push-mark)
282 "*Hooks run before speedbar visits a file in the selected frame.
283 The default buffer is the buffer in the selected window in the attached frame."
287 (defcustom speedbar-visiting-file-hook nil
288 "*Hooks run when speedbar visits a file in the selected frame."
294 The default buffer is the buffer in the selected window in the attached frame."
319 A nil value means don't show the file in the list."
356 default-toolbar-visible-p nil has-modeline-p nil
358 default-gutter-visible-p nil
370 "*Non-nil means use imenu for file parsing. nil to use etags.
371 XEmacs prior to 20.4 doesn't support imenu, therefore the default is to
382 is a function which takes one parameter (the file to tag) and returns a
402 (defcustom speedbar-default-position 'left-right
483 directory for a file in the attached frame. When smart expansion is
533 "String separating file text from indicator characters.")
537 Any file checked out is marked with `speedbar-vc-indicator'."
554 "*Return non-nil if the specified file is under Version Control.
556 current file, and the FILENAME of the file being checked."
564 "*Non-nil check all files in speedbar to see if they have an object file.
565 Any file checked out is marked with `speedbar-obj-indicator', and the
574 "Text used to mark files that have a corresponding hidden object file.
585 "Alist of file extensions, and their corresponding object file type.")
616 (defvar speedbar-ignored-modes '(fundamental-mode)
617 "*List of major modes which speedbar will not switch directories for.")
667 (defvar speedbar-file-unshown-regexp
678 (defvar speedbar-file-regexp nil
690 ;; html is not supported by default, but an imenu tags package
698 `speedbar-file-regexp' for use with speedbar. You should use the
701 file.
704 file completion."
709 (set 'speedbar-file-regexp (speedbar-extension-list-to-regex val))))
711 (setq speedbar-file-regexp
716 This should start with a `.' if it is not a complete file name, and
728 (setq speedbar-file-regexp (speedbar-extension-list-to-regex
749 (setq speedbar-file-regexp (speedbar-extension-list-to-regex
828 (defvar speedbar-file-key-map nil
831 (if speedbar-file-key-map
833 (setq speedbar-file-key-map (speedbar-make-specialized-keymap))
836 (define-key speedbar-file-key-map "e" 'speedbar-edit-line)
837 (define-key speedbar-file-key-map "\C-m" 'speedbar-edit-line)
838 (define-key speedbar-file-key-map "+" 'speedbar-expand-line)
839 (define-key speedbar-file-key-map "=" 'speedbar-expand-line)
840 (define-key speedbar-file-key-map "-" 'speedbar-contract-line)
842 (define-key speedbar-file-key-map "[" 'speedbar-expand-line-descendants)
843 (define-key speedbar-file-key-map "]" 'speedbar-contract-line-descendants)
845 (define-key speedbar-file-key-map " " 'speedbar-toggle-line-expansion)
847 ;; file based commands
848 (define-key speedbar-file-key-map "U" 'speedbar-up-directory)
849 (define-key speedbar-file-key-map "I" 'speedbar-item-info)
850 (define-key speedbar-file-key-map "B" 'speedbar-item-byte-compile)
851 (define-key speedbar-file-key-map "L" 'speedbar-item-load)
852 (define-key speedbar-file-key-map "C" 'speedbar-item-copy)
853 (define-key speedbar-file-key-map "D" 'speedbar-item-delete)
854 (define-key speedbar-file-key-map "O" 'speedbar-item-object-delete)
855 (define-key speedbar-file-key-map "R" 'speedbar-item-rename)
856 (define-key speedbar-file-key-map "M" 'speedbar-create-directory)
917 "Additional menu items while in file-mode.")
940 (defvar speedbar-last-selected-file nil
941 "The last file which was selected in speedbar buffer.")
948 Each sublist was returned by `speedbar-file-lists'. This list is
1021 (setq speedbar-last-selected-file nil))
1048 speedbar-default-position))))
1082 The first line represents the default directory of the speedbar frame.
1083 Each directory segment is a button which jumps speedbar's default
1091 directory as the default.
1093 Each line starting with [+] is a file. If the variable
1096 Files are completely ignored if they match `speedbar-file-unshown-regexp'
1102 for `speedbar-this-file-in-vc' and `speedbar-vc-check-dir-p'.
1105 have an object file associated with them. The `!' indicates that the
1109 Click on the [+] to display a list of tags from that file. Click on
1110 the [-] to retract the list. Click on the file name to edit the file
1116 in the selected file.
1208 ;; file display mode version
1404 "Keyboard accelerator for moving the default directory up one.
1407 (setq default-directory (expand-file-name (concat default-directory "../")))
1411 ;;; Speedbar file activity (aka creeping featurism)
1434 "Load the item under the cursor or mouse if it is a Lisp file."
1436 (let ((f (speedbar-line-file)))
1437 (if (and (file-exists-p f) (string-match "\\.el\\'" f))
1438 (if (and (file-exists-p (concat f "c"))
1441 (load-file (concat f "c"))
1442 (load-file f))
1443 (error "Not a loadable file"))))
1446 "Byte compile the item under the cursor or mouse if it is a Lisp file."
1448 (let ((f (speedbar-line-file))
1450 (if (and (file-exists-p f) (string-match "\\.el\\'" f))
1453 (byte-compile-file f nil)
1487 (defun speedbar-item-info-file-helper (&optional filename)
1488 "Display info about a file that is on the current line.
1491 (let* ((item (or filename (speedbar-line-file)))
1492 (attr (if item (file-attributes item) nil)))
1519 (setq item (file-name-nondirectory (speedbar-line-directory)))
1560 (or (speedbar-item-info-file-helper)
1568 (let ((f (speedbar-line-file)))
1569 (if (not f) (error "Not a file"))
1570 (if (file-directory-p f)
1572 (let* ((rt (read-file-name (format "Copy %s to: "
1573 (file-name-nondirectory f))
1574 (file-name-directory f)))
1575 (refresh (member (expand-file-name (file-name-directory rt))
1577 ;; Create the right file name part
1578 (if (file-directory-p rt)
1580 (concat (expand-file-name rt)
1582 (file-name-nondirectory f))))
1583 (if (or (not (file-exists-p rt))
1587 (copy-file f rt t t)
1592 (if (not (speedbar-goto-this-file rt))
1593 (speedbar-goto-this-file f))))
1600 (let ((f (speedbar-line-file)))
1602 (let* ((rt (read-file-name (format "Rename %s to: "
1603 (file-name-nondirectory f))
1604 (file-name-directory f)))
1605 (refresh (member (expand-file-name (file-name-directory rt))
1607 ;; Create the right file name part
1608 (if (file-directory-p rt)
1610 (concat (expand-file-name rt)
1612 (file-name-nondirectory f))))
1613 (if (or (not (file-exists-p rt))
1617 (rename-file f rt t)
1622 (speedbar-goto-this-file rt)
1624 (error "Not a file"))))
1629 (let ((f (speedbar-line-file)))
1631 (let* ((basedir (file-name-directory f))
1632 (nd (read-file-name "Create directory: "
1637 (speedbar-goto-this-file nd)
1639 (error "Not a file"))))
1644 (let ((f (speedbar-line-file)))
1645 (if (not f) (error "Not a file"))
1648 (if (file-directory-p f)
1650 (delete-file f))
1660 The file is removed from disk. The object is determined from the
1663 (let* ((f (speedbar-line-file))
1666 (if (not f) (error "Not a file"))
1669 (setq obj (concat (file-name-sans-extension f) (cdr (car oa))))
1670 (if (and oa (file-exists-p obj)
1673 (delete-file obj)
1729 This is a convenience function for special modes that create their own
1783 "Return the current default expansion list.
1791 "Return the current default menu data.
1799 "Return the current default menu data.
1817 (defun speedbar-change-initial-expansion-list (new-default)
1818 "Change speedbar's default expansion list to NEW-DEFAULT."
1821 (completing-read (format "Speedbar Mode (default %s): "
1828 speedbar-initial-expansion-list-name new-default)
1907 (defun speedbar-file-lists (directory)
1908 "Create file lists for DIRECTORY.
1912 the file-system."
1913 (setq directory (expand-file-name directory))
1920 (let ((default-directory directory)
1926 (or (string-match speedbar-file-unshown-regexp (car dir))
1928 (if (file-directory-p (car dir))
1942 (let* ((tilde (expand-file-name "~/"))
1943 (dd (expand-file-name directory))
1960 (expand-file-name "~/") ;the tilde
2100 (let* ((known (string-match speedbar-file-regexp (car lst)))
2102 (fn (if known 'speedbar-tag-file nil)))
2105 (car lst) 'speedbar-find-file nil
2106 'speedbar-file-face level)))
2109 (defun speedbar-default-directory-list (directory index)
2112 (speedbar-file-lists directory) index)
2121 (list (expand-file-name default-directory)))
2124 (if (speedbar-goto-this-file (car sf))
2386 (or (speedbar-line-file)
2388 (methods (if (get-file-buffer f)
2389 (save-excursion (set-buffer (get-file-buffer f))
2421 (or (speedbar-line-file)
2425 (if (get-file-buffer f)
2426 (set-buffer (get-file-buffer f)))
2481 ;; Check for special modes
2504 (if (or (member (expand-file-name default-directory)
2509 (expand-file-name default-directory))))
2513 default-directory))
2518 default-directory)
2521 (let ((cbd (expand-file-name default-directory)))
2529 (setq default-directory cbd)
2537 (let ((cbd (expand-file-name default-directory))
2567 (setq cbd-parent (file-name-directory cbd-parent)))
2573 ;; value. Make sure to unhighlight the current file, or if we
2574 ;; come back to this directory, it might be a different file
2578 (speedbar-clear-current-file)
2587 ;; default the shown directories to this list...
2590 (if (not expand-local) (setq speedbar-last-selected-file nil))
2602 (setq default-directory
2608 (setq default-directory cbd)
2616 This should only be used by modes classified as special."
2627 (speedbar-clear-current-file)
2672 ;; Check for special modes
2695 (unless (and (or (member major-mode speedbar-ignored-modes)
2697 (not (buffer-file-name)))
2738 (defun speedbar-find-selected-file (file)
2746 (concat " \\(" (regexp-quote (file-name-nondirectory file))
2749 (not (string= file
2764 (defun speedbar-clear-current-file ()
2765 "Locate the file thought to be current, and remove its highlighting."
2768 (if speedbar-last-selected-file
2770 (if (speedbar-find-selected-file speedbar-last-selected-file)
2774 'speedbar-file-face))))))
2776 (defun speedbar-update-current-file ()
2777 "Find the current file, and update our visuals to indicate its name.
2778 This is specific to file names. If the file name doesn't show up, but
2784 (let ((rf (if (buffer-file-name)
2785 (buffer-file-name)
2796 (file-exists-p newcf)
2797 (not (string= newcf speedbar-last-selected-file)))
2803 ;; Remove the old file...
2804 (speedbar-clear-current-file)
2808 (if (speedbar-find-selected-file newcf)
2815 (if (and (string-match speedbar-file-regexp newcf)
2816 (string= (file-name-directory newcfd)
2817 (expand-file-name default-directory)))
2821 (if (speedbar-find-selected-file newcf)
2829 (setq speedbar-last-selected-file newcf))
2891 (let ((f (speedbar-line-file)))
2893 (if (not (file-writable-p f))
2917 See `speedbar-this-file-in-vc' and `speedbar-vc-check-dir-p' for how
2924 (speedbar-vc-check-dir-p default-directory)
2931 (expand-file-name default-directory)))
2939 (expand-file-name default-directory))))))
2963 "Return t if the file on this line is check of of a version control system.
2965 the file being checked."
2978 (and (file-writable-p fulln)
2979 (speedbar-this-file-in-vc f fn))))
2987 (file-exists-p (concat directory "CVS/")))
2989 (file-exists-p (concat directory "RCS/"))
2991 (file-exists-p (concat directory "SCCS/"))
2995 (file-exists-p (concat proj-dir "/SCCS"))
3002 (defun speedbar-this-file-in-vc (directory name)
3003 "Check to see if the file in DIRECTORY with NAME is in a version control system.
3017 ;; RCS file name
3018 (file-exists-p (concat directory "RCS/" name ",v"))
3019 (file-exists-p (concat directory "RCS/" name))
3020 ;; Local SCCS file name
3021 (file-exists-p (concat directory "SCCS/s." name))
3022 ;; Remote SCCS file name
3025 (file-exists-p (concat proj-dir "/SCCS/s." name))
3065 "Return t if the file on this line has an associated object.
3067 the file being checked."
3083 (if (not (and oa (file-exists-p (concat (file-name-sans-extension fulln)
3087 (let ((date1 (nth 5 (file-attributes fulln)))
3088 (date2 (nth 5 (file-attributes (concat
3089 (file-name-sans-extension fulln)
3120 From this extract the file/tag name, token, indentation level and call
3172 (defun speedbar-line-file (&optional p)
3173 "Retrieve the file or whatever from the line at point P.
3174 The return value is a string representing the file. If it is a
3183 (if (file-exists-p (concat directory f))
3188 (defun speedbar-goto-this-file (file)
3191 (let ((directory (substring (file-name-directory (expand-file-name file))
3192 (length (expand-file-name default-directory))))
3206 ;; find the file part
3207 (if (or (not directory) (string= (file-name-nondirectory file) ""))
3214 ;; find the file part
3215 (let ((nd (file-name-nondirectory file)))
3228 This may require traversing backwards from DEPTH and combining the default
3234 (if rf (funcall rf depth) default-directory))))
3238 This may require traversing backwards from DEPTH and combining the default
3264 (concat default-directory directory)))))
3272 (fname (file-name-nondirectory directory))
3273 (pname (file-name-directory directory)))
3291 "Edit whatever tag or file is on the current speedbar line."
3373 ;; hidden by default anyway. Yay! It's easy.
3376 (defun speedbar-find-file (text token indent)
3378 TEXT, the file will be displayed in the attached frame.
3382 ;; Run before visiting file hook here.
3385 (run-hooks 'speedbar-before-visiting-file-hook)
3387 (speedbar-find-file-in-frame (concat cdd text))
3389 (run-hooks 'speedbar-visiting-file-hook)
3390 ;; Reset the timer with a new timeout when cliking a file
3401 (setq default-directory
3402 (concat (expand-file-name (concat (speedbar-line-directory indent) text))
3411 (setq speedbar-last-selected-file nil)
3435 (cons (expand-file-name
3443 (speedbar-default-directory-list
3450 (td (expand-file-name
3465 "Speedbar click handler for default directory buttons.
3469 (setq default-directory (concat token "/"))
3470 (setq default-directory token))
3477 (defun speedbar-tag-file (text token indent)
3478 "The cursor is on a selected line. Expand the tags in the specified file.
3480 clicked, and TOKEN is the file to expand. INDENT is the current
3482 (cond ((string-match "+" text) ;we have to expand this file
3483 (let* ((fn (expand-file-name (concat (speedbar-line-directory indent)
3502 "For the tag TEXT in a file TOKEN, go to that position.
3504 (let ((file (speedbar-line-directory indent)))
3509 (speedbar-find-file-in-frame file)
3511 ;; Reset the timer with a new timeout when cliking a file
3525 (cond ((string-match "+" text) ;we have to expand this file
3542 "*Specify how to select a frame for displaying a file.
3549 (defun speedbar-find-file-in-frame (file)
3551 If the file is being displayed in a different frame already, then raise that
3553 (let* ((buff (find-file-noselect file))
3571 This assumes that the cursor is on a file, or tag of a file which the user is
3640 (defun speedbar-fetch-dynamic-tags (file)
3646 ;; If a file is in memory, switch to that buffer. This allows
3647 ;; us to use the local variable. If the file is on disk, we
3649 ;; opening the file.
3650 (if (get-file-buffer file)
3651 (set-buffer (get-file-buffer file)))
3659 (funcall (car (car dtf)) file)
3678 (defun speedbar-fetch-dynamic-imenu (file)
3683 (set-buffer (find-file-noselect file))
3709 "Associations of file extensions and expressions for extracting tags.
3710 To add a new file type, you would want to add a new association to the
3711 list, where the car is the file match, and the cdr is the way to
3719 "*Command used to create an etags file.
3754 (defun speedbar-fetch-dynamic-etags (file)
3767 (append speedbar-fetch-etags-arguments (list file)))
3775 (if (string-match (car (car exprlst)) file)
3788 "Sorry, no support for a file of that extension"))))
3927 (let* ((known (string-match speedbar-file-regexp
3930 (fn (if known 'speedbar-tag-file nil))
3932 (buffer-file-name))))
3934 (if fname (file-name-nondirectory fname))
3937 'speedbar-file-face 0)
3950 'speedbar-file-face 0)
3963 ;; 'speedbar-file-face 0)
3990 (or (buffer-file-name buffer) "<No file>"))))))
3993 "Fetch the full directory to the file (buffer) specified on the current line.
4008 default-directory)
4010 (buffer-file-name buffer))))))))
4099 (defface speedbar-file-face '((((class color) (background light))
4104 "Face used for file names."
4125 "Face used to underline the file in the active window."
4168 (if (boundp 'font-lock-global-modes)
4169 (if (listp font-lock-global-modes)
4170 (add-to-list 'font-lock-global-modes '(not speedbar-mode))