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

Lines Matching +defs:set +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
94 ;; The variable `speedbar-power-click' is set to t in your functions
110 ;; Unlike the specialized modes, there are no name requirements,
125 ;; Lastly, `speedbar-mode-functions-list' allows you to set special
183 ("files" speedbar-easymenu-definition-special speedbar-file-key-map
187 These expansion lists are only valid for regular files. Special modes
211 speedbar-update-current-file
236 "List of function tables to use for different major display modes.
242 is a set of dotted pairs of the form FUNCTIONSYMBOL, which is the name
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.
287 (defcustom speedbar-visiting-file-hook nil
288 "*Hooks run when speedbar visits a file in the selected frame."
319 A nil value means don't show the file in the list."
370 "*Non-nil means use imenu for file parsing. nil to use etags.
382 is a function which takes one parameter (the file to tag) and returns a
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.")
655 :set (lambda (sym val)
667 (defvar speedbar-file-unshown-regexp
678 (defvar speedbar-file-regexp nil
698 `speedbar-file-regexp' for use with speedbar. You should use the
700 runtime, or use the configuration dialog to set it in your .emacs
701 file.
704 file completion."
707 :set (lambda (sym val)
708 (set 'speedbar-supported-extension-expressions val)
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
747 ;; If we don't have custom, then we set it here by hand.
749 (setq speedbar-file-regexp (speedbar-extension-list-to-regex
825 (set-keymap-parent k speedbar-key-map)
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
953 "Never set this by hand. Value is t when S-mouse activity occurs.")
963 (if (featurep 'xemacs) 'set-extent-property 'overlay-put))
990 (set-buffer speedbar-buffer)
1010 (speedbar-set-timer nil)
1013 (speedbar-set-timer dframe-update-speed)
1016 (set (make-local-variable 'dframe-delete-frame-function)
1019 (set (make-local-variable 'automatic-hscrolling) nil) ; Emacs 21
1021 (setq speedbar-last-selected-file nil))
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.
1124 (set-syntax-table speedbar-syntax-table)
1131 (speedbar-set-mode-line-format)
1164 (defun speedbar-set-mode-line-format ()
1174 (set-buffer speedbar-buffer)
1208 ;; file display mode version
1247 (set-buffer speedbar-buffer)
1262 (if (fboundp 'set-buffer-menubar)
1263 (set-buffer-menubar (list md)))))
1288 (mouse-set-point event)
1301 (apply 'set-mouse-position pos)
1407 (setq default-directory (expand-file-name (concat default-directory "../")))
1411 ;;; Speedbar file activity (aka creeping featurism)
1429 (speedbar-set-timer dframe-update-speed)
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)
1462 (mouse-set-point event)
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)))
1514 (set-buffer (semantic-tag-buffer attr)))
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)
1680 (speedbar-set-mode-line-format)
1681 (speedbar-set-timer dframe-update-speed))
1687 (speedbar-set-mode-line-format)
1688 (speedbar-set-timer nil))
1729 This is a convenience function for special modes that create their own
1865 (set-buffer buffer)
1899 (set-buffer buffer)
1907 (defun speedbar-file-lists (directory)
1908 "Create file lists for DIRECTORY.
1912 the file-system."
1913 (setq directory (expand-file-name 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)))
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))
2419 ;; Get, and set up variables that define how we treat these tags.
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))))
2521 (let ((cbd (expand-file-name default-directory)))
2522 (set-buffer speedbar-buffer)
2532 (set-window-point window p)
2533 (set-window-start window start)))))))
2537 (let ((cbd (expand-file-name default-directory))
2547 (set-buffer speedbar-buffer)
2567 (setq cbd-parent (file-name-directory cbd-parent)))
2572 ;; directorys, then use the cache, and set the cache to our new
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)
2590 (if (not expand-local) (setq speedbar-last-selected-file nil))
2610 (set-window-point window p)
2611 (set-window-start window start)))))
2616 This should only be used by modes classified as special."
2621 (set-buffer speedbar-buffer)
2627 (speedbar-clear-current-file)
2639 (defun speedbar-set-timer (timeout)
2641 Uses `dframe-set-timer'.
2643 (dframe-set-timer timeout 'speedbar-timer-fn 'speedbar-update-flag)
2651 (speedbar-set-mode-line-format))
2657 (speedbar-set-timer nil)
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)
2741 (set-buffer speedbar-buffer)
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."
2767 ;;(set-buffer speedbar-buffer)
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)
2806 ;; (set-buffer speedbar-buffer)
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))
2841 (set-buffer lastb)
2879 ;; then set to nil (do nothing) otherwise, start at the beginning
2881 (if speedbar-buffer (set-buffer speedbar-buffer))
2891 (let ((f (speedbar-line-file)))
2893 (if (not (file-writable-p f))
2903 ;; we are done, set to-do to nil
2917 See `speedbar-this-file-in-vc' and `speedbar-vc-check-dir-p' for how
2920 ;; then set to nil (do nothing) otherwise, start at the beginning
2922 (if speedbar-buffer (set-buffer speedbar-buffer))
2931 (expand-file-name default-directory)))
2939 (expand-file-name default-directory))))))
2956 ;; we are done, set to-do to nil
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))
3037 ;; then set to nil (do nothing) otherwise, start at the beginning
3039 (if speedbar-buffer (set-buffer speedbar-buffer))
3058 ;; we are done, set to-do to nil
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)))
3272 (fname (file-name-nondirectory directory))
3273 (pname (file-name-directory directory)))
3291 "Edit whatever tag or file is on the current speedbar line."
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
3393 (speedbar-set-timer dframe-update-speed))
3402 (concat (expand-file-name (concat (speedbar-line-directory indent) text))
3410 (speedbar-set-timer speedbar-navigating-speed)
3411 (setq speedbar-last-selected-file nil)
3435 (cons (expand-file-name
3450 (td (expand-file-name
3475 (speedbar-set-timer speedbar-navigating-speed))
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
3514 (speedbar-set-timer dframe-update-speed)
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
3578 (set-buffer speedbar-buffer)
3623 ;; we are all set!
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)
3764 (set-buffer (get-buffer-create "*etags tmp*"))
3767 (append speedbar-fetch-etags-arguments (list file)))
3775 (if (string-match (car (car exprlst)) file)
3781 (set-buffer (get-buffer-create "*etags tmp*"))
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))
3931 (fname (save-excursion (set-buffer (car bl))
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)
3973 (set-buffer buffer)
3987 (save-excursion (set-buffer buffer) major-mode)
3988 (save-excursion (set-buffer buffer)
3990 (or (buffer-file-name buffer) "<No file>"))))))
3993 "Fetch the full directory to the file (buffer) specified on the current line.
4007 (or (save-excursion (set-buffer buffer)
4010 (buffer-file-name buffer))))))))
4049 (set-buffer text)
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))