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

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

9 ;; This file is part of GNU Emacs.
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
43 (defcustom change-log-default-name nil
44 "*Name of a change log file for \\[add-change-log-entry]."
45 :type '(choice (const :tag "default" nil)
48 (put 'change-log-default-name 'safe-local-variable 'string-or-null-p)
55 ;; Many modes set this variable, so avoid warnings.
97 "If non-nil, normally keep day's log entries for one file together.
99 Log entries for a given file made with \\[add-change-log-entry] or
101 for that file made
102 today if this variable is non-nil or that file comes first in today's
103 entries. Otherwise another entry for that file will be started. An
134 (defcustom add-log-buffer-file-name-function nil
136 This function is called with no argument. If this is nil, the default is to
137 use `buffer-file-name'."
141 (defcustom add-log-file-name-function nil
144 `buffer-file-name' in that buffer. If this is nil, the default is to
145 use the file's name relative to the directory of the change log file."
165 Note: The search is conducted only within 10%, at the beginning of the file."
194 (defface change-log-file
196 "Face for highlighting file names."
200 (put 'change-log-file-face 'face-alias 'change-log-file)
250 (2 'change-log-file)
252 ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 'change-log-file))
322 "Return (system-dependent) default name for a change log file."
323 (or change-log-default-name
356 (let* ((default (change-log-name))
357 (name (expand-file-name
358 (read-file-name (format "Log file (default %s): " default)
359 nil default))))
362 (if (string= (file-name-nondirectory name) "")
363 (expand-file-name (file-name-nondirectory default)
365 ;; Handle specifying a file that is a directory.
366 (if (file-directory-p name)
367 (expand-file-name (file-name-nondirectory default)
368 (file-name-as-directory name))
372 "Return version number of current buffer's file.
377 ;; The version number can be anywhere in the file, but
378 ;; restrict search to the file beginning: 10% should be
384 (or (and buffer-file-name (vc-workfile-version buffer-file-name))
399 (defun find-change-log (&optional file-name buffer-file)
400 "Find a change log file for \\[add-change-log-entry] and return the name.
402 Optional arg FILE-NAME specifies the file to use.
403 If FILE-NAME is nil, use the value of `change-log-default-name'.
404 If `change-log-default-name' is nil, behave as though it were 'ChangeLog'
407 If `change-log-default-name' contains a leading directory component, then
409 directory and its successive parents for a file so named.
411 Once a file is found, `change-log-default-name' is set locally in the
412 current buffer to the complete file name.
413 Optional arg BUFFER-FILE overrides `buffer-file-name'."
414 ;; If user specified a file name or if this buffer knows which one to use,
416 (or file-name
417 (setq file-name (and change-log-default-name
418 (file-name-directory change-log-default-name)
419 change-log-default-name))
421 ;; Chase links in the source file
423 (setq file-name (or (and (or buffer-file buffer-file-name)
424 (file-name-directory
425 (file-chase-links
426 (or buffer-file buffer-file-name))))
427 default-directory))
428 (if (file-directory-p file-name)
429 (setq file-name (expand-file-name (change-log-name) file-name)))
430 ;; Chase links before visiting the file.
431 ;; This makes it easier to use a single change log file
433 (setq file-name (file-chase-links file-name))
434 (setq file-name (expand-file-name file-name))
435 ;; Move up in the dir hierarchy till we find a change log file.
436 (let ((file1 file-name)
438 (while (and (not (or (get-file-buffer file1) (file-exists-p file1)))
440 (file-name-directory
441 (directory-file-name
442 (file-name-directory file1))))
444 (not (string= (file-name-directory file1)
447 (setq file1 (expand-file-name
448 (file-name-nondirectory (change-log-name))
451 (if (or (get-file-buffer file1) (file-exists-p file1))
452 (setq file-name file1)))))
454 (set (make-local-variable 'change-log-default-name) file-name)
455 file-name)
457 (defun add-log-file-name (buffer-file log-file)
458 ;; Never want to add a change log entry for the ChangeLog file itself.
459 (unless (or (null buffer-file) (string= buffer-file log-file))
460 (if add-log-file-name-function
461 (funcall add-log-file-name-function buffer-file)
462 (setq buffer-file
464 (concat "^" (regexp-quote (file-name-directory log-file)))
465 buffer-file)
466 (substring buffer-file (match-end 0))
467 (file-name-nondirectory buffer-file)))
468 ;; If we have a backup file, it's presumably because we're
471 (if (backup-file-name-p buffer-file)
472 (file-name-sans-versions buffer-file)
473 buffer-file))))
476 (defun add-change-log-entry (&optional whoami file-name other-window new-entry)
477 "Find change log file, and add an entry for today and an item for this file.
481 Second arg FILE-NAME is file name of the change log.
482 If nil, use the value of `change-log-default-name'.
494 The change log file can start with a copyright notice and a copying
505 (buf-file-name (if add-log-buffer-file-name-function
506 (funcall add-log-buffer-file-name-function)
507 buffer-file-name))
508 (buffer-file (if buf-file-name (expand-file-name buf-file-name)))
509 (file-name (expand-file-name (find-change-log file-name buffer-file)))
510 ;; Set ITEM to the file name to use in the new item.
511 (item (add-log-file-name buffer-file file-name))
526 (unless (equal file-name buffer-file-name)
528 (find-file-other-window file-name)
529 (find-file file-name)))
535 ;; If file starts with a copyright and permission notice, skip them.
578 (forward-paragraph))) ; paragraph delimits entries for file
583 ;; Put this file name into the existing empty item.
594 ;; Add to the existing item for the same file.
618 ;; Point is at the item for this file,
655 (defun add-change-log-entry-other-window (&optional whoami file-name)
656 "Find change log file in other window and add entry and item.
658 the change log file in another window."
662 (add-change-log-entry whoami file-name t))
736 "Heuristic regexp used by `add-log-current-defun' for unknown major modes."
741 (defvar add-log-lisp-like-modes
746 (defvar add-log-c-like-modes
751 (defvar add-log-tex-like-modes
762 Other modes are handled by a heuristic that looks in the 10K before
774 ((memq major-mode add-log-lisp-like-modes)
798 ((and (memq major-mode add-log-c-like-modes)
816 ((memq major-mode add-log-c-like-modes)
874 ;; DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory, ...) ==> Ffile_name_directory
958 ((memq major-mode add-log-tex-like-modes)
1059 "Merge the contents of change log file OTHER-LOG with this buffer.
1061 the appropriate motion commands). OTHER-LOG can be either a file name
1066 (interactive "*fLog file name to merge: ")
1070 (find-file-noselect other-log)))
1092 ;; separate entries and then the rest of the file being
1106 "Fix any old-style date entries in the current log file to default format."