Now on revision 111900. ------------------------------------------------------------ revno: 111900 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13844 author: Dale Sedivec committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-02-28 22:43:57 -0500 message: * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-function): Return valid syntax-table property value when converting quotes within text from string syntax to punctuation syntax. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-28 21:51:11 +0000 +++ lisp/ChangeLog 2013-03-01 03:43:57 +0000 @@ -1,3 +1,9 @@ +2013-02-28 Dale Sedivec + + * textmodes/sgml-mode.el (sgml-syntax-propertize-function): + Return valid syntax-table property value when converting + quotes within text from string syntax to punctuation syntax (bug#13844). + 2013-02-28 Juri Linkov * dired-aux.el (dired-diff): If file at point is a backup file, === modified file 'lisp/textmodes/sgml-mode.el' --- lisp/textmodes/sgml-mode.el 2013-02-22 02:33:42 +0000 +++ lisp/textmodes/sgml-mode.el 2013-03-01 03:43:57 +0000 @@ -312,8 +312,8 @@ (defconst sgml-syntax-propertize-function (syntax-propertize-rules - ;; Use the `b' style of comments to avoid interference with the -- ... -- - ;; comments recognized when `sgml-specials' includes ?-. + ;; Use the `b' style of comments to avoid interference with the -- ... -- + ;; comments recognized when `sgml-specials' includes ?-. ;; FIXME: beware of blabla !! ("\\(<\\)!--" (1 "< b")) ("--[ \t\n]*\\(>\\)" (1 "> b")) @@ -322,7 +322,7 @@ ;; going to change, so as not to need to flush the data we just computed. ("\"" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) (goto-char (match-end 0))) - ".")))) + (string-to-syntax "."))))) "Syntactic keywords for `sgml-mode'.") ;; internal ------------------------------------------------------------ revno: 111899 fixes bug: http://debbugs.gnu.org/13772 committer: Juri Linkov branch nick: trunk timestamp: Thu 2013-02-28 23:51:11 +0200 message: * lisp/dired-aux.el (dired-diff): If file at point is a backup file, use its original as the default value, and reverse the order of arguments to the `diff' call. Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-28 19:33:03 +0000 +++ lisp/ChangeLog 2013-02-28 21:51:11 +0000 @@ -1,3 +1,9 @@ +2013-02-28 Juri Linkov + + * dired-aux.el (dired-diff): If file at point is a backup file, + use its original as the default value, and reverse the order + of arguments to the `diff' call. Doc fix. (Bug#13772) + 2013-02-28 Michael Albinus * net/tramp-adb.el (tramp-adb-sdk-dir): Remove. Replaced by ... === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2013-01-01 09:11:05 +0000 +++ lisp/dired-aux.el 2013-02-28 21:51:11 +0000 @@ -55,7 +55,8 @@ (defun dired-diff (file &optional switches) "Compare file at point with file FILE using `diff'. If called interactively, prompt for FILE. If the file at point -has a backup file, use that as the default. If the mark is active +has a backup file, use that as the default. If the file at point +is a backup file, use its original. If the mark is active in Transient Mark mode, use the file at the mark as the default. \(That's the mark set by \\[set-mark-command], not by Dired's \\[dired-mark] command.) @@ -67,8 +68,10 @@ the string of command switches for the third argument of `diff'." (interactive (let* ((current (dired-get-filename t)) - ;; Get the latest existing backup file. - (oldf (diff-latest-backup-file current)) + ;; Get the latest existing backup file or its original. + (oldf (if (backup-file-name-p current) + (file-name-sans-versions current) + (diff-latest-backup-file current))) ;; Get the file at the mark. (file-at-mark (if (and transient-mark-mode mark-active) (save-excursion (goto-char (mark t)) @@ -107,7 +110,10 @@ (equal (expand-file-name current file) (expand-file-name current)))) (error "Attempt to compare the file to itself")) - (diff file current switches))) + (if (and (backup-file-name-p current) + (equal file (file-name-sans-versions current))) + (diff current file switches) + (diff file current switches)))) ;;;###autoload (defun dired-backup-diff (&optional switches) === modified file 'lisp/dired.el' --- lisp/dired.el 2013-02-13 09:42:31 +0000 +++ lisp/dired.el 2013-02-28 21:51:11 +0000 @@ -3864,13 +3864,14 @@ ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "066bb17769887a7fbc0490003f59e4b3") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "d6a694b6d13fa948465fde52a9ffb3ba") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ Compare file at point with file FILE using `diff'. If called interactively, prompt for FILE. If the file at point -has a backup file, use that as the default. If the mark is active +has a backup file, use that as the default. If the file at point +is a backup file, use its original. If the mark is active in Transient Mark mode, use the file at the mark as the default. \(That's the mark set by \\[set-mark-command], not by Dired's \\[dired-mark] command.) ------------------------------------------------------------ revno: 111898 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-02-28 20:33:03 +0100 message: * net/tramp-adb.el (tramp-adb-sdk-dir): Remove. Replaced by ... (tramp-adb-program): New defcustom. Remove function. Adapt calls. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-28 19:01:34 +0000 +++ lisp/ChangeLog 2013-02-28 19:33:03 +0000 @@ -1,3 +1,8 @@ +2013-02-28 Michael Albinus + + * net/tramp-adb.el (tramp-adb-sdk-dir): Remove. Replaced by ... + (tramp-adb-program): New defcustom. Remove function. Adapt calls. + 2013-02-28 Agustín Martín Domingo Initial support for hunspell dictionaries auto-detection (Bug#13639) === modified file 'lisp/net/tramp-adb.el' --- lisp/net/tramp-adb.el 2013-02-27 09:20:13 +0000 +++ lisp/net/tramp-adb.el 2013-02-28 19:33:03 +0000 @@ -23,10 +23,11 @@ ;;; Commentary: -;; The Android Debug Bridge must be installed on your local machine. -;; Add the following form into your .emacs: +;; The Android Debug Bridge "adb" must be installed on your local +;; machine. If it is not in your $PATH, add the following form into +;; your .emacs: ;; -;; (setq tramp-adb-sdk-dir "/path/to/android/sdk") +;; (setq tramp-adb-program "/path/to/adb") ;; ;; Due to security it is not possible to access non-root devices. @@ -37,11 +38,11 @@ (defvar dired-move-to-filename-regexp) -(defcustom tramp-adb-sdk-dir "~/Android/sdk" - "Set to the directory containing the Android SDK." - :type 'string +(defcustom tramp-adb-program "adb" + "Name of the Android Debug Bridge program." + :group 'tramp :version "24.4" - :group 'tramp) + :type 'string) ;;;###tramp-autoload (defconst tramp-adb-method "adb" @@ -149,17 +150,12 @@ (save-match-data (apply (cdr fn) args)) (tramp-run-real-handler operation args)))) -;; This cannot be a constant, because `tramp-adb-sdk-dir' is customizable. -(defun tramp-adb-program () - "The Android Debug Bridge." - (expand-file-name "platform-tools/adb" tramp-adb-sdk-dir)) - ;;;###tramp-autoload (defun tramp-adb-parse-device-names (ignore) "Return a list of (nil host) tuples allowed to access." (with-timeout (10) (with-temp-buffer - (when (zerop (call-process (tramp-adb-program) nil t nil "devices")) + (when (zerop (call-process tramp-adb-program nil t nil "devices")) (let (result) (goto-char (point-min)) (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t) @@ -982,11 +978,11 @@ (setq args (append (list "-s" (tramp-file-name-host vec)) args))) (with-temp-buffer (prog1 - (unless (zerop (apply 'call-process (tramp-adb-program) nil t nil args)) + (unless (zerop (apply 'call-process tramp-adb-program nil t nil args)) (buffer-string)) (tramp-message vec 6 "%s %s\n%s" - (tramp-adb-program) (mapconcat 'identity args " ") (buffer-string))))) + tramp-adb-program (mapconcat 'identity args " ") (buffer-string))))) (defun tramp-adb-find-test-command (vec) "Checks, whether the ash has a builtin \"test\" command. @@ -1103,7 +1099,7 @@ (p (let ((default-directory (tramp-compat-temporary-file-directory))) (apply 'start-process (tramp-get-connection-name vec) buf - (tramp-adb-program) args)))) + tramp-adb-program args)))) (tramp-message vec 6 "%s" (mapconcat 'identity (process-command p) " ")) ;; Wait for initial prompt. ------------------------------------------------------------ revno: 111897 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-02-28 20:29:41 +0100 message: * tramp.texi (External methods): Mention `tramp-adb-program'. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-02-28 06:30:48 +0000 +++ doc/misc/ChangeLog 2013-02-28 19:29:41 +0000 @@ -1,3 +1,7 @@ +2013-02-28 Michael Albinus + + * tramp.texi (External methods): Mention `tramp-adb-program'. + 2013-02-28 Bastien Guerry * org.texi (Visibility cycling): Suggest to set === modified file 'doc/misc/tramp.texi' --- doc/misc/tramp.texi 2013-02-28 06:30:48 +0000 +++ doc/misc/tramp.texi 2013-02-28 19:29:41 +0000 @@ -1023,9 +1023,11 @@ @cindex adb method This special method uses the Android Debug Bridge for connecting -Android devices. The Android Debug Bridge, part of the Android SDK, -must be installed locally. The variable @var{tramp-adb-sdk-dir} must -be set to its installation directory. +Android devices. The Android Debug Bridge must be installed locally. +Some GNU/Linux distributions offer it for installation, otherwise it +can be installed as part of the Android SDK. If @command{adb} is not +found via the @code{$PATH} environment variable, the variable +@var{tramp-adb-program} must point to its absolute path. @end table ------------------------------------------------------------ revno: 111896 fixes bug: http://debbugs.gnu.org/13639 committer: Agustin Martin branch nick: trunk timestamp: Thu 2013-02-28 20:01:34 +0100 message: Initial support for hunspell dictionaries auto-detection (Bug#13639) * textmodes/ispell.el (ispell-find-hunspell-dictionaries): Ask hunspell about available and default dictionaries. (ispell-parse-hunspell-affix-file): Extract relevant info from hunspell affix file. (ispell-hunspell-fill-dictionary-entry): Fill non-initialized `ispell-dictionary-alist' entry for given dictionary after info provided by `ispell-parse-hunspell-affix-file'. (ispell-hunspell-dict-paths-alist): New defvar to contain an alist of parsed hunspell dicts and associated affix files. (ispell-hunspell-dictionary-alist): New defvar to contain an alist of parsed hunspell dicts and associated parameters. (ispell-set-spellchecker-params): Call `ispell-find-hunspell-dictionaries' if hunspell and not previously done. (ispell-start-process): Call `ispell-hunspell-fill-dictionary-entry' for current dictionary if it is not initialized. Some additional details about the implementation: (ispell-hunspell-dict-paths-alist): Alist that contains a list of parsed hunspell dicts and associated affix files. (ispell-hunspell-dictionary-alist): Alist of parsed hunspell dicts and associated parameters. It is initially just a list of found dictionaries except for the default dictionary where is filled with proper parameters. When spellchecker is initialized by (ispell-set-spellchecker-params) if the conditions: is hunspell, communication can be set to UTF-8 and Emacs flavor supports [:alpha:] are matched installed hunspell dictionaries are parsed and info passed to `ispell-hunspell-dictionary-alist', either full for default dictionary or just name for other dictionaries. These entries are used for `ispell-dictionary-alist' if not overriden. Before starting hunspell process in (ispell-start-process), if `ispell-dictionary-alist' entry is not yet initialized (ispell-hunspell-fill-dictionary-entry) is called to fill that entry (and all pending entries using the same affix file) after info extracted by (ispell-parse-hunspell-affix-file) from the associated affix file. hunspell process will then be started as usual. This delayed procedure is used to avoid that in systems containing many hunspell dictionaries all affix files are parsed (if there are many, time may be noticeable) for just one used dictionary. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-28 17:15:08 +0000 +++ lisp/ChangeLog 2013-02-28 19:01:34 +0000 @@ -1,3 +1,25 @@ +2013-02-28 Agustín Martín Domingo + + Initial support for hunspell dictionaries auto-detection (Bug#13639) + + * textmodes/ispell.el (ispell-find-hunspell-dictionaries): + Ask hunspell about available and default dictionaries. + (ispell-parse-hunspell-affix-file): Extract relevant info from + hunspell affix file. + (ispell-hunspell-fill-dictionary-entry): Fill non-initialized + `ispell-dictionary-alist' entry for given dictionary after info + provided by `ispell-parse-hunspell-affix-file'. + (ispell-hunspell-dict-paths-alist): New defvar to contain an alist + of parsed hunspell dicts and associated affix files. + (ispell-hunspell-dictionary-alist): New defvar to contain an alist + of parsed hunspell dicts and associated parameters. + (ispell-set-spellchecker-params): + Call `ispell-find-hunspell-dictionaries' if hunspell and not + previously done. + (ispell-start-process): + Call `ispell-hunspell-fill-dictionary-entry' for current + dictionary if it is not initialized. + 2013-02-28 Stefan Monnier * imenu.el: Comment nitpicks. === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2013-02-22 17:13:05 +0000 +++ lisp/textmodes/ispell.el 2013-02-28 19:01:34 +0000 @@ -1129,6 +1129,170 @@ (push (cons aliasname (cdr realdict)) alist)))))) alist)) +;; Make ispell.el work better with hunspell. + +(defvar ispell-hunspell-dict-paths-alist nil + "Alist of parsed hunspell dicts and associated affix files. +Will be used to parse corresponding .aff file and create associated +parameters to be inserted into `ispell-hunspell-dictionary-alist'. +Internal use.") + +(defvar ispell-hunspell-dictionary-alist nil + "Alist of parsed hunspell dicts and associated parameters. +This alist will initially contain names of found dicts. Associated +parameters will be added when dict is used for the first time. +Internal use.") + +(defun ispell-hunspell-fill-dictionary-entry (dict) + "Fill `ispell-dictionary-alist' uninitialized entries for `DICT' and aliases. +Value will be extracted from hunspell affix file and used for +all uninitialized dicts using that affix file." + (if (cadr (assoc dict ispell-dictionary-alist)) + (message "ispell-hfde: Non void entry for %s. Skipping.\n" dict) + (let ((dict-alias (cadr (assoc dict ispell-hunspell-dictionary-equivs-alist))) + (use-for-dicts (list dict)) + (dict-args-cdr (cdr (ispell-parse-hunspell-affix-file dict))) + newlist) + ;; Get a list of unitialized dicts using the same affix file. + (dolist (dict-equiv-alist-entry ispell-hunspell-dictionary-equivs-alist) + (let ((dict-equiv-key (car dict-equiv-alist-entry)) + (dict-equiv-value (cadr dict-equiv-alist-entry))) + (if (or (member dict dict-equiv-alist-entry) + (member dict-alias dict-equiv-alist-entry)) + (dolist ( tmp-dict (list dict-equiv-key dict-equiv-value)) + (if (cadr (assoc tmp-dict ispell-dictionary-alist)) + (ispell-print-if-debug (format "ispell-hfde: %s already expanded. Skipping.\n" tmp-dict)) + (add-to-list 'use-for-dicts tmp-dict)))))) + (ispell-print-if-debug (format "ispell-hfde: Filling %s entry. Use for %s.\n" dict use-for-dicts)) + ;; The final loop + (dolist (entry ispell-dictionary-alist) + (if (member (car entry) use-for-dicts) + (add-to-list 'newlist + (append (list (car entry)) dict-args-cdr)) + (add-to-list 'newlist entry))) + (setq ispell-dictionary-alist newlist)))) + +(defun ispell-parse-hunspell-affix-file (dict-key) + "Parse hunspell affix file to extract parameters for `DICT-KEY'. +Return a list in `ispell-dictionary-alist' format." + (let ((affix-file (cadr (assoc dict-key ispell-hunspell-dict-paths-alist)))) + (unless affix-file + (error "ispell-phaf: No matching entry for %s.\n" dict-name)) + (if (file-exists-p affix-file) + (let ((dict-name (file-name-sans-extension (file-name-nondirectory affix-file))) + otherchars-string otherchars-list) + (with-temp-buffer + (insert-file-contents affix-file) + (setq otherchars-string + (save-excursion + (beginning-of-buffer) + (if (search-forward-regexp "^WORDCHARS +" nil t ) + (buffer-substring (point) + (progn (end-of-line) (point)))))) + ;; Remove trailing whitespace and extra stuff. Make list if non-nil. + (setq otherchars-list + (if otherchars-string + (split-string + (if (string-match " +.*$" otherchars-string) + (replace-match "" nil nil otherchars-string) + otherchars-string) + "" t))) + + ;; Fill dict entry + (list dict-key + "[[:alpha:]]" + "[^[:alpha:]]" + (if otherchars-list + (regexp-opt otherchars-list) + "") + t ;; many-otherchars-p: We can't tell, set to t + (list "-d" dict-name) + nil ;; extended-char-mode: not supported by hunspell + 'utf-8))) + (error "ispell-phaf: File \"%s\" not found.\n" affix-file)))) + +(defun ispell-find-hunspell-dictionaries () + "Look for installed hunspell dictionaries. +Will initialize `ispell-hunspell-dictionary-alist' and +`ispell-hunspell-dictionary-alist' after values found +and remove `ispell-hunspell-dictionary-equivs-alist' +entries if a specific dict was found." + (let ((hunspell-found-dicts + (split-string + (with-temp-buffer + (ispell-call-process ispell-program-name + null-device + t + nil + "-D") + (buffer-string)) + "[\n\r]+" + t)) + hunspell-default-dict + hunspell-default-dict-entry) + (dolist (dict hunspell-found-dicts) + (let* ((full-name (file-name-nondirectory dict)) + (basename (file-name-sans-extension full-name)) + (affix-file (concat dict ".aff"))) + (if (string-match "\\.aff$" dict) + ;; Found default dictionary + (if hunspell-default-dict + (error "ispell-fhd: Default dict already defined as %s. Not using %s.\n" + hunspell-default-dict dict) + (setq affix-file dict) + (setq hunspell-default-dict (list basename affix-file))) + (if (and (not (assoc basename ispell-hunspell-dict-paths-alist)) + (file-exists-p affix-file)) + ;; Entry has an associated .aff file and no previous value. + (progn + (ispell-print-if-debug + (format "++ ispell-fhd: dict-entry:%s name:%s basename:%s affix-file:%s\n" + dict full-name basename affix-file)) + (add-to-list 'ispell-hunspell-dict-paths-alist + (list basename affix-file))) + (ispell-print-if-debug + (format "-- ispell-fhd: Skipping entry: %s\n" dict)))))) + ;; Remove entry from aliases alist if explicit dict was found. + (let (newlist) + (dolist (dict ispell-hunspell-dictionary-equivs-alist) + (if (assoc (car dict) ispell-hunspell-dict-paths-alist) + (ispell-print-if-debug + (format "-- ispell-fhd: Excluding %s alias. Standalone dict found.\n" + (car dict))) + (add-to-list 'newlist dict))) + (setq ispell-hunspell-dictionary-equivs-alist newlist)) + ;; Add known hunspell aliases + (dolist (dict-equiv ispell-hunspell-dictionary-equivs-alist) + (let ((dict-equiv-key (car dict-equiv)) + (dict-equiv-value (cadr dict-equiv)) + (exclude-aliases (list ;; Exclude TeX aliases + "esperanto-tex" + "francais7" + "francais-tex" + "norsk7-tex"))) + (if (and (assoc dict-equiv-value ispell-hunspell-dict-paths-alist) + (not (assoc dict-equiv-key ispell-hunspell-dict-paths-alist)) + (not (member dict-equiv-key exclude-aliases))) + (let ((affix-file (cadr (assoc dict-equiv-value ispell-hunspell-dict-paths-alist)))) + (ispell-print-if-debug (format "++ ispell-fhd: Adding alias %s -> %s.\n" + dict-equiv-key affix-file)) + (add-to-list + 'ispell-hunspell-dict-paths-alist + (list dict-equiv-key affix-file)))))) + ;; Parse and set values for default dictionary. + (setq hunspell-default-dict (car hunspell-default-dict)) + (setq hunspell-default-dict-entry + (ispell-parse-hunspell-affix-file hunspell-default-dict)) + ;; Create an alist of found dicts with only names, except for default dict. + (setq ispell-hunspell-dictionary-alist + (list (append (list nil) (cdr hunspell-default-dict-entry)))) + (dolist (dict (mapcar 'car ispell-hunspell-dict-paths-alist)) + (if (string= dict hunspell-default-dict) + (add-to-list 'ispell-hunspell-dictionary-alist + hunspell-default-dict-entry) + (add-to-list 'ispell-hunspell-dictionary-alist + (list dict)))))) + ;; Set params according to the selected spellchecker (defvar ispell-last-program-name nil @@ -1154,20 +1318,30 @@ (setq ispell-library-directory (ispell-check-version)) t) (error nil)) - ispell-really-aspell ispell-encoding8-command ispell-emacs-alpha-regexp) - (unless ispell-aspell-dictionary-alist - (ispell-find-aspell-dictionaries))) + ;; auto-detection will only be used if spellchecker is not + ;; ispell, supports a way to set communication to UTF-8 and + ;; Emacs flavor supports [:alpha:] + (if ispell-really-aspell + (or ispell-aspell-dictionary-alist + (ispell-find-aspell-dictionaries)) + (if ispell-really-hunspell + (or ispell-hunspell-dictionary-alist + (ispell-find-hunspell-dictionaries))))) - ;; Substitute ispell-dictionary-alist with the list of dictionaries - ;; corresponding to the given spellchecker. If a recent aspell, use - ;; the list of really installed dictionaries and add to it elements - ;; of the original list that are not present there. Allow distro info. + ;; Substitute ispell-dictionary-alist with the list of + ;; dictionaries corresponding to the given spellchecker. + ;; If a recent aspell or hunspell, use the list of really + ;; installed dictionaries and add to it elements of the original + ;; list that are not present there. Allow distro info. (let ((found-dicts-alist - (if (and ispell-really-aspell - ispell-encoding8-command) - ispell-aspell-dictionary-alist + (if (and ispell-encoding8-command + ispell-emacs-alpha-regexp) + (if ispell-really-aspell + ispell-aspell-dictionary-alist + (if ispell-really-hunspell + ispell-hunspell-dictionary-alist)) nil)) (ispell-dictionary-base-alist ispell-dictionary-base-alist) ispell-base-dicts-override-alist ; Override only base-dicts-alist @@ -1237,19 +1411,21 @@ (if ispell-emacs-alpha-regexp (let (tmp-dicts-alist) (dolist (adict ispell-dictionary-alist) - (add-to-list 'tmp-dicts-alist - (list - (nth 0 adict) ; dict name - "[[:alpha:]]" ; casechars - "[^[:alpha:]]" ; not-casechars - (nth 3 adict) ; otherchars - (nth 4 adict) ; many-otherchars-p - (nth 5 adict) ; ispell-args - (nth 6 adict) ; extended-character-mode - (if ispell-encoding8-command - 'utf-8 - (nth 7 adict))))) - (setq ispell-dictionary-alist tmp-dicts-alist))))) + (if (cadr adict) ;; Do not touch hunspell uninitialized entries + (add-to-list 'tmp-dicts-alist + (list + (nth 0 adict) ; dict name + "[[:alpha:]]" ; casechars + "[^[:alpha:]]" ; not-casechars + (nth 3 adict) ; otherchars + (nth 4 adict) ; many-otherchars-p + (nth 5 adict) ; ispell-args + (nth 6 adict) ; extended-character-mode + (if ispell-encoding8-command + 'utf-8 + (nth 7 adict)))) + (add-to-list 'tmp-dicts-alist adict))) + (setq ispell-dictionary-alist tmp-dicts-alist))))) (defun ispell-valid-dictionary-list () "Return a list of valid dictionaries. @@ -2737,6 +2913,12 @@ Keeps argument list for future Ispell invocations for no async support." ;; `ispell-current-dictionary' and `ispell-current-personal-dictionary' ;; are properly set in `ispell-internal-change-dictionary'. + + ;; Parse hunspell affix file if using hunspell and entry is uninitialized. + (if ispell-really-hunspell + (or (cadr (assoc ispell-current-dictionary ispell-dictionary-alist)) + (ispell-hunspell-fill-dictionary-entry ispell-current-dictionary))) + (let* ((default-directory (if (and (file-directory-p default-directory) (file-readable-p default-directory)) ------------------------------------------------------------ revno: 111895 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-02-28 12:15:08 -0500 message: * lisp/imenu.el: Comment nitpicks. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-28 16:34:51 +0000 +++ lisp/ChangeLog 2013-02-28 17:15:08 +0000 @@ -1,3 +1,7 @@ +2013-02-28 Stefan Monnier + + * imenu.el: Comment nitpicks. + 2013-02-28 Sam Steingold * vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces. === modified file 'lisp/imenu.el' --- lisp/imenu.el 2013-02-01 08:23:47 +0000 +++ lisp/imenu.el 2013-02-28 17:15:08 +0000 @@ -405,11 +405,11 @@ ;; Regular expression to find C functions (defvar imenu-example--function-name-regexp-c (concat - "^[a-zA-Z0-9]+[ \t]?" ; type specs; there can be no + "^[a-zA-Z0-9]+[ \t]?" ; Type specs; there can be no "\\([a-zA-Z0-9_*]+[ \t]+\\)?" ; more than 3 tokens, right? "\\([a-zA-Z0-9_*]+[ \t]+\\)?" - "\\([*&]+[ \t]*\\)?" ; pointer - "\\([a-zA-Z0-9_*]+\\)[ \t]*(" ; name + "\\([*&]+[ \t]*\\)?" ; Pointer. + "\\([a-zA-Z0-9_*]+\\)[ \t]*(" ; Name. )) (defun imenu-example--create-c-index (&optional regexp) @@ -556,7 +556,7 @@ (defun imenu--truncate-items (menulist) "Truncate all strings in MENULIST to `imenu-max-item-length'." (mapc (lambda (item) - ;; truncate if necessary + ;; Truncate if necessary. (when (and (numberp imenu-max-item-length) (> (length (car item)) imenu-max-item-length)) (setcar item (substring (car item) 0 imenu-max-item-length))) @@ -575,7 +575,7 @@ (or (not imenu-auto-rescan) (and imenu-auto-rescan (> (buffer-size) imenu-auto-rescan-maxout)))) - ;; Get the index; truncate if necessary + ;; Get the index; truncate if necessary. (progn (setq imenu--index-alist (save-excursion @@ -687,8 +687,9 @@ (save-excursion (setq name (funcall imenu-extract-index-name-function))) (and (stringp name) - ;; [ydi] updated for imenu-use-markers - (push (cons name (if imenu-use-markers (point-marker) (point))) + ;; [ydi] Updated for imenu-use-markers. + (push (cons name + (if imenu-use-markers (point-marker) (point))) index-alist))) index-alist)) ;; Use generic expression if possible. @@ -741,12 +742,12 @@ (modify-syntax-entry c (cdr syn) table)) (car syn)))) (goto-char (point-max)) - (unwind-protect ; for syntax table + (unwind-protect ; For syntax table. (save-match-data (set-syntax-table table) - ;; map over the elements of imenu-generic-expression - ;; (typically functions, variables ...) + ;; Map over the elements of imenu-generic-expression + ;; (typically functions, variables ...). (dolist (pat patterns) (let ((menu-title (car pat)) (regexp (nth 1 pat)) @@ -1002,7 +1003,7 @@ function placed in a special index-item." (if (or (< position (point-min)) (> position (point-max))) - ;; widen if outside narrowing + ;; Widen if outside narrowing. (widen)) (goto-char position)) ------------------------------------------------------------ revno: 111894 committer: Sam Steingold branch nick: trunk timestamp: Thu 2013-02-28 11:34:51 -0500 message: * lisp/vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces. See . diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-28 14:51:03 +0000 +++ lisp/ChangeLog 2013-02-28 16:34:51 +0000 @@ -1,3 +1,8 @@ +2013-02-28 Sam Steingold + + * vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces. + See . + 2013-02-28 Thierry Volpiatto * net/net-utils.el (net-utils--revert-function): New fun (bug#13831). === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2013-01-02 16:13:04 +0000 +++ lisp/vc/diff-mode.el 2013-02-28 16:34:51 +0000 @@ -821,9 +821,11 @@ (progn (diff-hunk-prev) (point)) (error (point-min))))) (header-files - (if (looking-at "[-*][-*][-*] \\(\\S-+\\)\\(\\s-.*\\)?\n[-+][-+][-+] \\(\\S-+\\)") - (list (if old (match-string 1) (match-string 3)) - (if old (match-string 3) (match-string 1))) + ;; handle filenames with spaces; + ;; cf. diff-font-lock-keywords / diff-file-header-face + (if (looking-at "[-*][-*][-*] \\([^\t]+\\)\t.*\n[-+][-+][-+] \\([^\t]+\\)") + (list (if old (match-string 1) (match-string 2)) + (if old (match-string 2) (match-string 1))) (forward-line 1) nil))) (delq nil (append @@ -832,6 +834,7 @@ (re-search-backward "^Index: \\(.+\\)" limit t))) (list (match-string 1))) header-files + ;; this assumes that there are no spaces in filenames (when (re-search-backward "^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?" nil t) ------------------------------------------------------------ revno: 111893 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13831 author: Thierry Volpiatto committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-02-28 09:51:03 -0500 message: * lisp/net/net-utils.el (net-utils--revert-function): New fun. (net-utils-mode): Use it. (net-utils--revert-cmd): New var. (net-utils-run-simple): Set it, and remove bogus interactive spec. (traceroute): Use net-utils-run-simple. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-28 06:30:48 +0000 +++ lisp/ChangeLog 2013-02-28 14:51:03 +0000 @@ -1,3 +1,11 @@ +2013-02-28 Thierry Volpiatto + + * net/net-utils.el (net-utils--revert-function): New fun (bug#13831). + (net-utils-mode): Use it. + (net-utils--revert-cmd): New var. + (net-utils-run-simple): Set it, and remove bogus interactive spec. + (traceroute): Use net-utils-run-simple. + 2013-02-28 Glenn Morris * textmodes/paragraphs.el (mark-paragraph): Doc fix. === modified file 'lisp/net/net-utils.el' --- lisp/net/net-utils.el 2013-01-01 09:11:05 +0000 +++ lisp/net/net-utils.el 2013-02-28 14:51:03 +0000 @@ -285,7 +285,8 @@ (define-derived-mode net-utils-mode special-mode "NetworkUtil" "Major mode for interacting with an external network utility." (set (make-local-variable 'font-lock-defaults) - '((net-utils-font-lock-keywords)))) + '((net-utils-font-lock-keywords))) + (setq-local revert-buffer-function #'net-utils--revert-function)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Utility functions @@ -354,20 +355,38 @@ ;; General network utilities (diagnostic) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun net-utils-run-simple (buffer-name program-name args) +;; Todo: This data could be saved in a bookmark. +(defvar net-utils--revert-cmd nil) + +(defun net-utils-run-simple (buffer program-name args) "Run a network utility for diagnostic output only." - (interactive) - (when (get-buffer buffer-name) - (kill-buffer buffer-name)) - (get-buffer-create buffer-name) - (with-current-buffer buffer-name + (with-current-buffer (if (stringp buffer) (get-buffer-create buffer) buffer) + (let ((proc (get-buffer-process (current-buffer)))) + (when proc + (set-process-filter proc nil) + (delete-process proc))) + (let ((inhibit-read-only t)) + (erase-buffer)) (net-utils-mode) + (setq-local net-utils--revert-cmd + `(net-utils-run-simple ,(current-buffer) ,program-name ,args)) (set-process-filter - (apply 'start-process (format "%s" program-name) - buffer-name program-name args) - 'net-utils-remove-ctrl-m-filter) - (goto-char (point-min))) - (display-buffer buffer-name)) + (apply 'start-process program-name + (current-buffer) program-name args) + 'net-utils-remove-ctrl-m-filter) + (goto-char (point-min)) + (display-buffer (current-buffer)))) + +(defun net-utils--revert-function (&optional ignore-auto noconfirm) + (message "Reverting `%s'..." (buffer-name)) + (apply (car net-utils--revert-cmd) (cdr net-utils--revert-cmd)) + (let ((proc (get-buffer-process (current-buffer)))) + (when proc + (set-process-sentinel + proc + (lambda (process event) + (when (string= event "finished\n") + (message "Reverting `%s' done" (process-buffer process)))))))) ;;;###autoload (defun ifconfig () @@ -428,9 +447,8 @@ (if traceroute-program-options (append traceroute-program-options (list target)) (list target)))) - (net-utils-run-program + (net-utils-run-simple (concat "Traceroute" " " target) - (concat "** Traceroute ** " traceroute-program " ** " target) traceroute-program options))) ------------------------------------------------------------ revno: 111892 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-02-28 06:17:37 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2013-02-25 11:17:36 +0000 +++ autogen/configure 2013-02-28 11:17:37 +0000 @@ -10032,7 +10032,7 @@ int main () { -return data_start == &ch; +return data_start < &ch; ; return 0; } ------------------------------------------------------------ revno: 111891 [merge] committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-02-27 22:30:48 -0800 message: Merge from emacs-24; up to r111307 diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-02-25 17:36:03 +0000 +++ doc/emacs/ChangeLog 2013-02-28 06:30:48 +0000 @@ -1,3 +1,7 @@ +2013-02-28 Bastien Guerry + + * xresources.texi (GTK resources): Fix broken link. + 2013-02-25 Eli Zaretskii * files.texi (Interlocking): Don't refer to symlinks as the === modified file 'doc/emacs/xresources.texi' --- doc/emacs/xresources.texi 2013-01-01 09:11:05 +0000 +++ doc/emacs/xresources.texi 2013-02-27 07:32:16 +0000 @@ -507,7 +507,7 @@ The following sections describe how to customize GTK+ resources for Emacs. For details about GTK+ resources, see the GTK+ API document at -@uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}. +@uref{http://developer.gnome.org/gtk2/stable/gtk2-Resource-Files.html}. In GTK+ version 3, GTK+ resources have been replaced by a completely different system. The appearance of GTK+ widgets is now determined by === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-02-24 19:45:17 +0000 +++ doc/lispref/ChangeLog 2013-02-28 06:30:48 +0000 @@ -1,3 +1,7 @@ +2013-02-28 Bastien Guerry + + * variables.texi (File Local Variables): Fix reference. + 2013-02-24 Eli Zaretskii * files.texi (Magic File Names): Improve wording and indexing. === modified file 'doc/lispref/variables.texi' --- doc/lispref/variables.texi 2013-01-01 09:11:05 +0000 +++ doc/lispref/variables.texi 2013-02-27 12:12:20 +0000 @@ -1556,7 +1556,7 @@ A file can specify local variable values; Emacs uses these to create buffer-local bindings for those variables in the buffer visiting that -file. @xref{File variables, , Local Variables in Files, emacs, The +file. @xref{File Variables, , Local Variables in Files, emacs, The GNU Emacs Manual}, for basic information about file-local variables. This section describes the functions and variables that affect how file-local variables are processed. === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-02-24 19:45:17 +0000 +++ doc/misc/ChangeLog 2013-02-28 06:30:48 +0000 @@ -1,3 +1,15 @@ +2013-02-28 Bastien Guerry + + * org.texi (Visibility cycling): Suggest to set + `org-agenda-inhibit-startup' to nil if user wants the startup + visibility settings to be honored in any circumstances. + (Progress logging, Checkboxes): Fix typos. + +2013-02-28 Michael Albinus + + * tramp.texi (top) [xxx, yyy, trampfn]: Provide two versions of + the macros, for Texinfo 4.13 and 5.0. + 2013-02-24 Michael Albinus Port Tramp documentation to Texinfo 5.0. === modified file 'doc/misc/org.texi' --- doc/misc/org.texi 2013-02-13 04:31:09 +0000 +++ doc/misc/org.texi 2013-02-28 06:30:48 +0000 @@ -2,7 +2,7 @@ @c %**start of header @setfilename ../../info/org @settitle The Org Manual -@set VERSION 7.9.3e (GNU Emacs 24.3) +@set VERSION 7.9.3f (GNU Emacs 24.3) @c Use proper quote and backtick for code sections in PDF output @c Cf. Texinfo manual 14.2 @@ -1296,6 +1296,7 @@ @end table @vindex org-startup-folded +@vindex org-agenda-inhibit-startup @cindex @code{overview}, STARTUP keyword @cindex @code{content}, STARTUP keyword @cindex @code{showall}, STARTUP keyword @@ -1314,6 +1315,10 @@ #+STARTUP: showeverything @end example +The startup visibility options are ignored when the file is open for the +first time during the agenda generation: if you want the agenda to honor +the startup visibility, set @code{org-agenda-inhibit-startup} to nil. + @cindex property, VISIBILITY @noindent Furthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties @@ -2439,7 +2444,7 @@ references connected by two dots @samp{..}. If both fields are in the current row, you may simply use @samp{$2..$7}, but if at least one field is in a different row, you need to use the general @code{@@row$column} -format at least for the first field (i.e., the reference must start with +format at least for the first field (i.e the reference must start with @samp{@@} in order to be interpreted correctly). Examples: @example @@ -4075,7 +4080,7 @@ Org mode can automatically record a timestamp and possibly a note when you mark a TODO item as DONE, or even each time you change the state of -a TODO item. This system is highly configurable, settings can be on a +a TODO item. This system is highly configurable; settings can be on a per-keyword basis and can be localized to a file or even a subtree. For information on how to clock working time for a task, see @ref{Clocking work time}. @@ -4431,7 +4436,7 @@ accordingly.} (@pxref{Plain lists}) can be made into a checkbox by starting it with the string @samp{[ ]}. This feature is similar to TODO items (@pxref{TODO Items}), but is more lightweight. Checkboxes are not included -into the global TODO list, so they are often great to split a task into a +in the global TODO list, so they are often great to split a task into a number of simple steps. Or you can use them in a shopping list. To toggle a checkbox, use @kbd{C-c C-c}, or use the mouse (thanks to Piotr Zielinski's @file{org-mouse.el}). === modified file 'doc/misc/tramp.texi' --- doc/misc/tramp.texi 2013-02-24 19:45:17 +0000 +++ doc/misc/tramp.texi 2013-02-28 06:30:48 +0000 @@ -20,6 +20,11 @@ @c xxx and yyy are auxiliary macros in order to omit leading and @c trailing whitespace. Not very elegant, but I don't know it better. +@c There are subtle differences between texinfo 4.13 and 5.0. We must +@c declare two versions of the macro. This will be improved, hopefully. + +@c Texinfo 5.0. +@ifset txicommandconditionals @macro xxx {one} @set \one\ @end macro @@ -38,6 +43,26 @@ @yyy{\user\,@@}@c \host\@value{postfix}\localname\ @end macro +@end ifset + +@c Texinfo 4.13. +@ifclear txicommandconditionals +@macro xxx {one}@c +@set \one\@c +@end macro + +@macro yyy {one, two}@c +@xxx{x\one\}@c +@ifclear x@c +\one\@w{}\two\@c +@end ifclear +@clear x\one\@c +@end macro + +@macro trampfn {method, user, host, localname}@c +@value{prefix}@yyy{\method\,@value{postfixhop}}@yyy{\user\,@@}\host\@value{postfix}\localname\@c +@end macro +@end ifclear @copying Copyright @copyright{} 1999--2013 Free Software Foundation, Inc. @@ -3892,3 +3917,4 @@ @c * Use `filename' resp. `file name' consistently. @c * Use `host' resp. `machine' consistently. @c * Consistent small or capitalized words especially in menus. +@c * Make a unique declaration of @trampfn. === modified file 'etc/NEWS' --- etc/NEWS 2013-02-25 17:36:03 +0000 +++ etc/NEWS 2013-02-28 06:30:48 +0000 @@ -829,6 +829,63 @@ *** The calendars produced by cal-html include holidays. Customize `cal-html-holidays' to change this. +** CEDET + +*** The major modes from the parser generators "Bovine" and "Wisent" +are now properly integrated in Emacs. The file suffixes ".by" and ".wy" +are in `auto-mode-alist', and the corresponding manuals are included. + +*** EDE + +**** Menu support for the "Configuration" feature. This allows users to +choose the active configuration (such as debug or install) from the menu. + +**** New command `ede-set' to interactively set project-local variables. + +**** Support for compiling, debugging, and running in "generic" projects. + +**** Autoconf editing support for M4 macros with complex arguments. + +**** Compilation support for the "linux" project type. + +**** "simple" projects have been removed; use "generic" projects instead. + +*** Semantic + +**** Support for parsing #include statements inside a namespace in C/C++. + +**** Improved support for 'extern "C"' declarations in C/C++. + +**** The ability to ignore more common special C/C++ preprocessor symbols, +such as '__nonnull' and '__asm'. Add '__cplusplus' macro when parsing C++. +If available, include cdefs.h as an additional source of preprocessor symbols. + +**** Improved C/C++ function pointer parsing. + +**** In Python, support for converting imports to include file names. + +**** Ability to dynamically determine the Python load path. + +**** Support for the Python 'WITH' and 'AT' keywords. + +**** Improved tooltip completion. + +*** SRecode + +**** The SRecode manual is now included. + +**** Tag generation supports constructor/destructor settings and system +include differentiation. + +**** Addition of 'Framework' support: Frameworks are specified when a +particular kind of library (such as Android) is needed in a common language +mode (like Java). + +**** Support for nested templates and let variables override based on priority. + +**** Support for merging tables from multiple related modes, such as +default -> c++ -> arduino. + ** Compile has a new option `compilation-always-kill'. ** Customize @@ -1168,6 +1225,25 @@ *** Last-modified time stamps in undo lists now are of the form (t HI-SECS LO-SECS USECS PSECS) instead of (t HI-SECS . LO-SECS). +** EIEIO + +*** Improved security when handling persistent objects: + +**** `eieio-persistent-read' now features optional arguments for specifying +the class to load, as well as a flag stating whether subclasses are allowed; +if provided, other classes will be rejected by the reader. For +compatibility with existing code, if the class is omitted only a +warning is issued. + +**** New specialized reader for pulling in classes and signaling errors +without evaluation of suspicious code. + +**** All slots that contain objects must have a :type. Slots with lists +of objects must use a new type predicate for a list of an object type. + +*** Support for `find-function' and similar utilities, through the addition +of filename support to generated symbols. + ** Floating point functions now always return special values like NaN, instead of signaling errors, if given invalid args; e.g., (log -1.0). Previously, they returned NaNs on some platforms but signaled errors === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-28 04:02:36 +0000 +++ lisp/ChangeLog 2013-02-28 06:30:48 +0000 @@ -1,3 +1,7 @@ +2013-02-28 Glenn Morris + + * textmodes/paragraphs.el (mark-paragraph): Doc fix. + 2013-02-28 Stefan Monnier * doc-view.el: Preserve h&v scroll across C-c C-c C-c C-c. === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2013-02-07 08:31:21 +0000 +++ lisp/org/ChangeLog 2013-02-28 06:30:48 +0000 @@ -1,3 +1,73 @@ +2013-02-28 Achim Gratz + + * org.el (org-org-menu): Use correct key "C-u C-c C-x !" to do + org-reload uncompiled in the menu. + +2013-02-28 Bastien Guerry + + * org-indent.el (org-indent-add-properties): Bugfix: prevent + negative value for `added-ind-per-lvl'. + + * org.el (org-mode): Add `org-fix-ellipsis-at-bol' to + `isearch-mode-end-hook' so that any isearch fixes the problem with + ellipsis on the first line. + (org-fix-ellipsis-at-bol): New defsubst. + (org-show-context, org-isearch-end): Use it. + + * org.el (org-show-context): Remove useless catch. + Make sure the top of the window is a visible headline. + (org-activate-plain-links): Remove unused catch. + + * org-macs.el (org-get-alist-option): Return nil, not (nil), + so that `org-show-context' DTRT. + + * org.el (org-imenu-get-tree): Fix bug when matching against empty + headlines. + + * org.el (org-overview): Stay on current line. + (org-map-entries): Fix docstring. + (org-at-clock-log-p): Delete. + * org-clock.el (org-at-clock-log-p): Move here. + + * org.el (org-tsr-regexp-both): Don't activate dates in links. + (org-activate-dates): Change match boundaries according to the new + value of `org-tsr-regexp-both'. + + * org-agenda.el (org-agenda-to-appt): Fix typos. + + * org-agenda.el (org-agenda-local-vars): Don't include + `org-agenda-show-window' as it needs to be checked outside of the + agenda window. + + * org.el (org-set-tags-command): Fix bug when setting tags for + multiple headlines in an active region. + + * org-mobile.el (org-mobile-edit): DTRT when inserting a heading + in an invisible region. + + * org.el (org-insert-heading-respect-content): Add docstring. + New `invisible-ok' parameter. + (org-insert-todo-heading-respect-content): Add docstring. + + * ob-tangle.el (org-babel-tangle-collect-blocks): + Bugfix: remove code references from blocks. + + * org-agenda.el (org-agenda-schedule, org-agenda-deadline): + Cosmetic changes. + (org-agenda-show-new-time): Fix bug when displaying a temporary + overlay with the scheduled/deadline information. + + * org.el (org-fill-paragraph-with-timestamp-nobreak-p): New function. + (org-setup-filling): Use it to prevent breaking a timestamp when + filling a paragraph. + + * org-id.el (org-id-get-with-outline-path-completion): Fix docstring. + +2013-02-28 Tim Burt (tiny change) + + * org-datetree.el (org-datetree-find-year-create): + Match headlines with tags. + 2013-02-07 Bastien Guerry * org-agenda.el (org-agenda-get-deadlines) === modified file 'lisp/org/ob-tangle.el' --- lisp/org/ob-tangle.el 2013-01-01 09:11:05 +0000 +++ lisp/org/ob-tangle.el 2013-02-28 00:31:26 +0000 @@ -371,6 +371,10 @@ (unless (and language (not (string= language src-lang))) (let* ((info (org-babel-get-src-block-info)) (params (nth 2 info)) + (extra (nth 3 info)) + (cref-fmt (or (and (string-match "-l \"\\(.+\\)\"" extra) + (match-string 1 extra)) + org-coderef-label-format)) (link ((lambda (link) (and (string-match org-bracket-link-regexp link) (match-string 1 link))) @@ -388,6 +392,11 @@ ((lambda (body) ;; run the tangle-body-hook (with-temp-buffer (insert body) + (when (string-match "-r" extra) + (goto-char (point-min)) + (while (re-search-forward + (replace-regexp-in-string "%s" ".+" cref-fmt) nil t) + (replace-match ""))) (run-hooks 'org-babel-tangle-body-hook) (buffer-string))) ((lambda (body) ;; expand the body in language specific manner === modified file 'lisp/org/org-agenda.el' --- lisp/org/org-agenda.el 2013-02-07 07:11:59 +0000 +++ lisp/org/org-agenda.el 2013-02-28 00:31:26 +0000 @@ -1934,11 +1934,6 @@ (message "Sticky agenda was %s" (if org-agenda-sticky "enabled" "disabled")))))) -(autoload 'org-toggle-sticky-agenda "org-agenda" "\ -Toggle `org-agenda-sticky'. - -\(fn &optional ARG)" t nil) - (defvar org-agenda-buffer nil "Agenda buffer currently being generated.") @@ -1971,7 +1966,6 @@ org-agenda-last-search-view-search-was-boolean org-agenda-filtered-by-category org-agenda-filter-form - org-agenda-show-window org-agenda-cycle-counter org-agenda-last-prefix-arg) "Variables that must be local in agenda buffers to allow multiple buffers.") @@ -2615,43 +2609,6 @@ ((equal org-keys "!") (customize-variable 'org-stuck-projects)) (t (error "Invalid agenda key")))))) -(autoload 'org-agenda "org-agenda" "\ -Dispatch agenda commands to collect entries to the agenda buffer. -Prompts for a command to execute. Any prefix arg will be passed -on to the selected command. The default selections are: - -a Call `org-agenda-list' to display the agenda for current day or week. -t Call `org-todo-list' to display the global todo list. -T Call `org-todo-list' to display the global todo list, select only - entries with a specific TODO keyword (the user gets a prompt). -m Call `org-tags-view' to display headlines with tags matching - a condition (the user is prompted for the condition). -M Like `m', but select only TODO entries, no ordinary headlines. -L Create a timeline for the current buffer. -e Export views to associated files. -s Search entries for keywords. -S Search entries for keywords, only with TODO keywords. -/ Multi occur across all agenda files and also files listed - in `org-agenda-text-search-extra-files'. -< Restrict agenda commands to buffer, subtree, or region. - Press several times to get the desired effect. -> Remove a previous restriction. -# List \"stuck\" projects. -! Configure what \"stuck\" means. -C Configure custom agenda commands. - -More commands can be added by configuring the variable -`org-agenda-custom-commands'. In particular, specific tags and TODO keyword -searches can be pre-defined in this way. - -If the current buffer is in Org-mode and visiting a file, you can also -first press `<' once to indicate that the agenda should be temporarily -\(until the next use of \\[org-agenda]) restricted to the current file. -Pressing `<' twice means to restrict to the current subtree or region -\(if active). - -\(fn &optional ARG ORG-KEYS RESTRICTION)" t nil) - (defun org-agenda-append-agenda () "Append another agenda view to the current one. This function allows interactive building of block agendas. @@ -2947,17 +2904,6 @@ (set-buffer org-agenda-buffer-name) (princ (buffer-string))) -(autoload 'org-batch-agenda "org-agenda" "\ -Run an agenda command in batch mode and send the result to STDOUT. -If CMD-KEY is a string of length 1, it is used as a key in -`org-agenda-custom-commands' and triggers this command. If it is a -longer string it is used as a tags/todo match string. -Parameters are alternating variable names and values that will be bound -before running the agenda command. - -\(fn CMD-KEY &rest PARAMETERS)" nil t) -(def-edebug-spec org-batch-agenda (form &rest sexp)) - (defvar org-agenda-info nil) ;;;###autoload @@ -3015,44 +2961,6 @@ ",")) (princ "\n"))))) -(autoload 'org-batch-agenda-csv "org-agenda" "\ -Run an agenda command in batch mode and send the result to STDOUT. -If CMD-KEY is a string of length 1, it is used as a key in -`org-agenda-custom-commands' and triggers this command. If it is a -longer string it is used as a tags/todo match string. -Parameters are alternating variable names and values that will be bound -before running the agenda command. - -The output gives a line for each selected agenda item. Each -item is a list of comma-separated values, like this: - -category,head,type,todo,tags,date,time,extra,priority-l,priority-n - -category The category of the item -head The headline, without TODO kwd, TAGS and PRIORITY -type The type of the agenda entry, can be - todo selected in TODO match - tagsmatch selected in tags match - diary imported from diary - deadline a deadline on given date - scheduled scheduled on given date - timestamp entry has timestamp on given date - closed entry was closed on given date - upcoming-deadline warning about deadline - past-scheduled forwarded scheduled item - block entry has date block including g. date -todo The todo keyword, if any -tags All tags including inherited ones, separated by colons -date The relevant date, like 2007-2-14 -time The time, like 15:00-16:50 -extra Sting with extra planning info -priority-l The priority letter if any was given -priority-n The computed numerical priority -agenda-day The day in the agenda where this is listed - -\(fn CMD-KEY &rest PARAMETERS)" nil t) -(def-edebug-spec org-batch-agenda-csv (form &rest sexp)) - (defun org-fix-agenda-info (props) "Make sure all properties on an agenda item have a canonical form. This ensures the export commands can easily use it." @@ -3100,11 +3008,6 @@ (interactive) (eval (list 'org-batch-store-agenda-views))) -(autoload 'org-store-agenda-views "org-agenda" "\ - - -\(fn &rest PARAMETERS)" t nil) - ;;;###autoload (defmacro org-batch-store-agenda-views (&rest parameters) "Run all custom agenda commands that have a file argument." @@ -3140,12 +3043,6 @@ (and (get-buffer bufname) (kill-buffer bufname))))))) -(autoload 'org-batch-store-agenda-views "org-agenda" "\ -Run all custom agenda commands that have a file argument. - -\(fn &rest PARAMETERS)" nil t) -(def-edebug-spec org-batch-store-agenda-views (&rest sexp)) - (defvar org-agenda-current-span nil "The current span used in the agenda view.") ; local variable in the agenda buffer (defun org-agenda-mark-header-line (pos) @@ -4204,20 +4101,6 @@ (setq buffer-read-only t) (message "")))) -(autoload 'org-agenda-list "org-agenda" "\ -Produce a daily/weekly view from all files in variable `org-agenda-files'. -The view will be for the current day or week, but from the overview buffer -you will be able to go to other days/weeks. - -With a numeric prefix argument in an interactive call, the agenda will -span ARG days. Lisp programs should instead specify SPAN to change -the number of days. SPAN defaults to `org-agenda-span'. - -START-DAY defaults to TODAY, or to the most recent match for the weekday -given in `org-agenda-start-on-weekday'. - -\(fn &optional ARG START-DAY SPAN)" t nil) - (defun org-agenda-ndays-to-span (n) "Return a span symbol for a span of N days, or N if none matches." (cond ((symbolp n) n) @@ -4527,52 +4410,6 @@ (org-agenda-finalize) (setq buffer-read-only t)))) -(autoload 'org-search-view "org-agenda" "\ -Show all entries that contain a phrase or words or regular expressions. - -With optional prefix argument TODO-ONLY, only consider entries that are -TODO entries. The argument STRING can be used to pass a default search -string into this function. If EDIT-AT is non-nil, it means that the -user should get a chance to edit this string, with cursor at position -EDIT-AT. - -The search string can be viewed either as a phrase that should be found as -is, or it can be broken into a number of snippets, each of which must match -in a Boolean way to select an entry. The default depends on the variable -`org-agenda-search-view-always-boolean'. -Even if this is turned off (the default) you can always switch to -Boolean search dynamically by preceding the first word with \"+\" or \"-\". - -The default is a direct search of the whole phrase, where each space in -the search string can expand to an arbitrary amount of whitespace, -including newlines. - -If using a Boolean search, the search string is split on whitespace and -each snippet is searched separately, with logical AND to select an entry. -Words prefixed with a minus must *not* occur in the entry. Words without -a prefix or prefixed with a plus must occur in the entry. Matching is -case-insensitive. Words are enclosed by word delimiters (i.e. they must -match whole words, not parts of a word) if -`org-agenda-search-view-force-full-words' is set (default is nil). - -Boolean search snippets enclosed by curly braces are interpreted as -regular expressions that must or (when preceded with \"-\") must not -match in the entry. Snippets enclosed into double quotes will be taken -as a whole, to include whitespace. - -- If the search string starts with an asterisk, search only in headlines. -- If (possibly after the leading star) the search string starts with an - exclamation mark, this also means to look at TODO entries only, an effect - that can also be achieved with a prefix argument. -- If (possibly after star and exclamation mark) the search string starts - with a colon, this will mean that the (non-regexp) snippets of the - Boolean search must match as full words. - -This command searches the agenda files, and in addition the files listed -in `org-agenda-text-search-extra-files'. - -\(fn &optional TODO-ONLY STRING EDIT-AT)" t nil) - ;;; Agenda TODO list (defvar org-select-this-todo-keyword nil) @@ -4663,15 +4500,6 @@ (org-agenda-finalize) (setq buffer-read-only t)))) -(autoload 'org-todo-list "org-agenda" "\ -Show all (not done) TODO entries from all agenda file in a single list. -The prefix arg can be used to select a specific TODO keyword and limit -the list to these. When using \\[universal-argument], you will be prompted -for a keyword. A numeric prefix directly selects the Nth keyword in -`org-todo-keywords-1'. - -\(fn &optional ARG)" t nil) - ;;; Agenda tags match ;;;###autoload @@ -4757,12 +4585,6 @@ (org-agenda-finalize) (setq buffer-read-only t)))) -(autoload 'org-tags-view "org-agenda" "\ -Show all headlines for all `org-agenda-files' matching a TAGS criterion. -The prefix arg TODO-ONLY limits the search to TODO entries. - -\(fn &optional TODO-ONLY MATCH)" t nil) - ;;; Agenda Finding stuck projects (defvar org-agenda-skip-regexp nil @@ -4991,14 +4813,6 @@ (setq org-agenda-redo-command `(org-agenda-list-stuck-projects ,current-prefix-arg))))) -(autoload 'org-agenda-list-stuck-projects "org-agenda" "\ -Create agenda view for projects that are stuck. -Stuck projects are project that have no next actions. For the definitions -of what a project is and how to check if it stuck, customize the variable -`org-stuck-projects'. - -\(fn &rest IGNORE)" t nil) - ;;; Diary integration (defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param. @@ -5177,35 +4991,6 @@ (if results (concat (org-agenda-finalize-entries results) "\n")))) -(autoload 'org-diary "org-agenda" "\ -Return diary information from org files. -This function can be used in a \"sexp\" diary entry in the Emacs calendar. -It accesses org files and extracts information from those files to be -listed in the diary. The function accepts arguments specifying what -items should be listed. For a list of arguments allowed here, see the -variable `org-agenda-entry-types'. - -The call in the diary file should look like this: - - &%%(org-diary) ~/path/to/some/orgfile.org - -Use a separate line for each org file to check. Or, if you omit the file name, -all files listed in `org-agenda-files' will be checked automatically: - - &%%(org-diary) - -If you don't give any arguments (as in the example above), the default -arguments (:deadline :scheduled :timestamp :sexp) are used. -So the example above may also be written as - - &%%(org-diary :deadline :timestamp :sexp :scheduled) - -The function expects the lisp variables `entry' and `date' to be provided -by the caller, because this is how the calendar works. Don't use this -function from a program - use `org-agenda-get-day-entries' instead. - -\(fn &rest ARGS)" nil nil) - ;;; Agenda entry finders (defun org-agenda-get-day-entries (file date &rest args) @@ -5401,11 +5186,6 @@ (match-string 1) org-agenda-todo-ignore-timestamp)) (t)))))))))) -(autoload 'org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item "org-agenda" "\ -Do we have a reason to ignore this TODO entry because it has a time stamp? - -\(fn &optional END)" nil nil) - (defun org-agenda-get-timestamps (&optional deadline-results) "Return the date stamp information for agenda display." (let* ((props (list 'face 'org-agenda-calendar-event @@ -8686,9 +8466,8 @@ (defun org-agenda-show-new-time (marker stamp &optional prefix) "Show new date stamp via text properties." ;; We use text properties to make this undoable - (let ((inhibit-read-only t) - (buffer-invisibility-spec)) - (setq stamp (concat " " prefix " => " stamp)) + (let ((inhibit-read-only t)) + (setq stamp (concat prefix " => " stamp " ")) (save-excursion (goto-char (point-max)) (while (not (bobp)) @@ -8750,7 +8529,7 @@ (widen) (goto-char pos) (setq ts (org-schedule arg time))) - (org-agenda-show-new-time marker ts "S")) + (org-agenda-show-new-time marker ts " S")) (message "%s" ts))) (defun org-agenda-deadline (arg &optional time) @@ -8770,7 +8549,7 @@ (widen) (goto-char pos) (setq ts (org-deadline arg time))) - (org-agenda-show-new-time marker ts "D")) + (org-agenda-show-new-time marker ts " D")) (message "%s" ts))) (defun org-agenda-clock-in (&optional arg) @@ -9131,12 +8910,6 @@ (calendar-cursor-to-date)) nil)) -(autoload 'org-calendar-goto-agenda "org-agenda" "\ -Compute the Org-mode agenda for the calendar date displayed at the cursor. -This is a command that has to be installed in `calendar-mode-map'. - -\(fn)" t nil) - (defun org-agenda-convert-date () (interactive) (org-agenda-check-type t 'agenda 'timeline) @@ -9519,7 +9292,7 @@ and :timestamp entries. See the docstring of `org-diary' for details and examples. -If an entry as a APPT_WARNTIME property, its value will be used +If an entry has a APPT_WARNTIME property, its value will be used to override `appt-message-warning-time'." (interactive "P") (if refresh (setq appt-time-msg-list nil)) @@ -9579,40 +9352,6 @@ (message "No event to add") (message "Added %d event%s for today" cnt (if (> cnt 1) "s" ""))))) -(autoload 'org-agenda-to-appt "org-agenda" "\ -Activate appointments found in `org-agenda-files'. -With a \\[universal-argument] prefix, refresh the list of -appointments. - -If FILTER is t, interactively prompt the user for a regular -expression, and filter out entries that don't match it. - -If FILTER is a string, use this string as a regular expression -for filtering entries out. - -If FILTER is a function, filter out entries against which -calling the function returns nil. This function takes one -argument: an entry from `org-agenda-get-day-entries'. - -FILTER can also be an alist with the car of each cell being -either 'headline or 'category. For example: - - '((headline \"IMPORTANT\") - (category \"Work\")) - -will only add headlines containing IMPORTANT or headlines -belonging to the \"Work\" category. - -ARGS are symbols indicating what kind of entries to consider. -By default `org-agenda-to-appt' will use :deadline, :scheduled -and :timestamp entries. See the docstring of `org-diary' for -details and examples. - -If an entry as a APPT_WARNTIME property, its value will be used -to override `appt-message-warning-time'. - -\(fn &optional REFRESH FILTER &rest ARGS)" t nil) - (defun org-agenda-todayp (date) "Does DATE mean today, when considering `org-extend-today-until'?" (let ((today (org-today)) === modified file 'lisp/org/org-clock.el' --- lisp/org/org-clock.el 2013-02-07 07:11:59 +0000 +++ lisp/org/org-clock.el 2013-02-28 00:31:26 +0000 @@ -1545,12 +1545,6 @@ (org-remove-empty-drawer-at clock-drawer (point)) (forward-line 1)))))) -(defun org-at-clock-log-p nil - "Is the cursor on the clock log line?" - (save-excursion - (move-beginning-of-line 1) - (looking-at "^[ \t]*CLOCK:"))) - (defun org-clock-timestamps-up nil "Increase CLOCK timestamps at cursor." (interactive) === modified file 'lisp/org/org-datetree.el' --- lisp/org/org-datetree.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-datetree.el 2013-02-28 00:31:26 +0000 @@ -72,7 +72,7 @@ (goto-char (prog1 (point) (widen)))))) (defun org-datetree-find-year-create (year) - (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)\\s-*$") + (let ((re "^\\*+[ \t]+\\([12][0-9]\\{3\\}\\)\\(.*?\\([ \t]:[[:alnum:]:_@#%]+:\\)?\\s-*$\\)") match) (goto-char (point-min)) (while (and (setq match (re-search-forward re nil t)) === modified file 'lisp/org/org-docview.el' --- lisp/org/org-docview.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-docview.el 2013-02-28 00:31:26 +0000 @@ -49,7 +49,7 @@ (declare-function image-mode-window-get "ext:image-mode" (prop &optional winprops)) -(autoload 'doc-view-goto-page "doc-view") +(org-autoload "doc-view" '(doc-view-goto-page)) (org-add-link-type "docview" 'org-docview-open) (add-hook 'org-store-link-functions 'org-docview-store-link) === modified file 'lisp/org/org-id.el' --- lisp/org/org-id.el 2013-01-13 10:33:16 +0000 +++ lisp/org/org-id.el 2013-02-28 00:31:26 +0000 @@ -259,11 +259,11 @@ id))))) (defun org-id-get-with-outline-path-completion (&optional targets) - "Use outline-path-completion to retrieve the ID of an entry. -TARGETS may be a setting for `org-refile-targets' to define the eligible -headlines. When omitted, all headlines in all agenda files are -eligible. -It returns the ID of the entry. If necessary, the ID is created." + "Use `outline-path-completion' to retrieve the ID of an entry. +TARGETS may be a setting for `org-refile-targets' to define +eligible headlines. When omitted, all headlines in the current +file are eligible. This function returns the ID of the entry. +If necessary, the ID is created." (let* ((org-refile-targets (or targets '((nil . (:maxlevel . 10))))) (org-refile-use-outline-path (if (caar org-refile-targets) 'file t)) === modified file 'lisp/org/org-indent.el' --- lisp/org/org-indent.el 2013-02-07 07:11:59 +0000 +++ lisp/org/org-indent.el 2013-02-28 00:31:26 +0000 @@ -328,7 +328,7 @@ ;; inline task or not. (let* ((case-fold-search t) (limited-re (org-get-limited-outline-regexp)) - (added-ind-per-lvl (1- org-indent-indentation-per-level)) + (added-ind-per-lvl (abs (1- org-indent-indentation-per-level))) (pf (save-excursion (and (ignore-errors (let ((outline-regexp limited-re)) (org-back-to-heading t))) === modified file 'lisp/org/org-macs.el' --- lisp/org/org-macs.el 2013-02-07 07:11:59 +0000 +++ lisp/org/org-macs.el 2013-02-28 00:31:26 +0000 @@ -263,7 +263,8 @@ (cond ((eq key t) t) ((eq option t) t) ((assoc key option) (cdr (assoc key option))) - (t (cdr (assq 'default option))))) + (t (let ((r (cdr (assq 'default option)))) + (if (listp r) (delq nil r) r))))) (defsubst org-check-external-command (cmd &optional use no-error) "Check if external program CMD for USE exists, error if not. === modified file 'lisp/org/org-mobile.el' --- lisp/org/org-mobile.el 2013-01-13 10:33:16 +0000 +++ lisp/org/org-mobile.el 2013-02-28 00:31:26 +0000 @@ -1064,7 +1064,7 @@ (if (org-on-heading-p) ; if false we are in top-level of file (progn (end-of-line 1) - (org-insert-heading-respect-content) + (org-insert-heading-respect-content t) (org-demote)) (beginning-of-line) (insert "* ")) === modified file 'lisp/org/org-version.el' --- lisp/org/org-version.el 2013-02-07 07:11:59 +0000 +++ lisp/org/org-version.el 2013-02-28 00:31:26 +0000 @@ -5,13 +5,13 @@ (defun org-release () "The release version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-release "7.9.3e")) + (let ((org-release "7.9.3f")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-git-version "7.9.3e-3-gb07a9b")) + (let ((org-git-version "release_7.9.3f-17-g7524ef")) org-git-version)) ;;;###autoload (defvar org-odt-data-dir "/usr/share/emacs/etc/org" === modified file 'lisp/org/org.el' --- lisp/org/org.el 2013-02-12 17:36:54 +0000 +++ lisp/org/org.el 2013-02-28 00:31:26 +0000 @@ -114,7 +114,6 @@ (declare-function org-inlinetask-outline-regexp "org-inlinetask" ()) (declare-function org-inlinetask-toggle-visibility "org-inlinetask" ()) (declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label)) -(declare-function org-at-clock-log-p "org-clock" ()) (declare-function org-clock-timestamps-up "org-clock" ()) (declare-function org-clock-timestamps-down "org-clock" ()) (declare-function org-clock-sum-current-item "org-clock" (&optional tstart)) @@ -467,7 +466,11 @@ #+STARTUP: fold (or `overview', this is equivalent) #+STARTUP: nofold (or `showall', this is equivalent) #+STARTUP: content - #+STARTUP: showeverything" + #+STARTUP: showeverything + +By default, this option is ignored when Org opens agenda files +for the first time. If you want the agenda to honor the startup +option, set `org-agenda-inhibit-startup' to nil." :group 'org-startup :type '(choice (const :tag "nofold: show all" nil) @@ -3913,6 +3916,7 @@ (save-excursion (goto-char (org-table-begin 'any)) (looking-at org-table1-hline-regexp)))) + (defun org-table-recognize-table.el () "If there is a table.el table nearby, recognize it and move into it." (if org-table-tab-recognizes-table.el @@ -3948,7 +3952,6 @@ nil)) (defvar org-table-clean-did-remove-column nil) - (defun org-table-map-tables (function &optional quietly) "Apply FUNCTION to the start of all tables in the buffer." (save-excursion @@ -4969,7 +4972,8 @@ (org-add-hook 'isearch-mode-end-hook 'org-isearch-end 'append 'local) ;; Emacs 22 deals with this through a special variable (org-set-local 'outline-isearch-open-invisible-function - (lambda (&rest ignore) (org-show-context 'isearch)))) + (lambda (&rest ignore) (org-show-context 'isearch))) + (org-add-hook 'isearch-mode-end-hook 'org-fix-ellipsis-at-bol 'append 'local)) ;; Setup the pcomplete hooks (set (make-local-variable 'pcomplete-command-completion-function) @@ -5008,6 +5012,8 @@ (put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify) +(defsubst org-fix-ellipsis-at-bol () + (save-excursion (goto-char (window-start)) (recenter 0))) (defun org-find-invisible-foreground () (let ((candidates (remove @@ -5205,8 +5211,9 @@ (defconst org-tsr-regexp (concat org-ts-regexp "\\(--?-?" org-ts-regexp "\\)?") "Regular expression matching a time stamp or time stamp range.") -(defconst org-tsr-regexp-both (concat org-ts-regexp-both "\\(--?-?" - org-ts-regexp-both "\\)?") +(defconst org-tsr-regexp-both + (concat org-ts-regexp-both "\\(--?-?" + org-ts-regexp-both "\\)?") "Regular expression matching a time stamp or time stamp range. The time stamps may be either active or inactive.") @@ -5298,21 +5305,20 @@ (defun org-activate-plain-links (limit) "Run through the buffer and add overlays to links." - (catch 'exit - (let (f) - (when (and (re-search-forward (concat org-plain-link-re) limit t) - (not (org-in-src-block-p))) - (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) - (setq f (get-text-property (match-beginning 0) 'face)) - (unless (or (org-in-src-block-p) - (eq f 'org-tag) - (and (listp f) (memq 'org-tag f))) - (add-text-properties (match-beginning 0) (match-end 0) - (list 'mouse-face 'highlight - 'face 'org-link - 'keymap org-mouse-map)) - (org-rear-nonsticky-at (match-end 0))) - t)))) + (let (f) + (when (and (re-search-forward (concat org-plain-link-re) limit t) + (not (org-in-src-block-p))) + (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) + (setq f (get-text-property (match-beginning 0) 'face)) + (unless (or (org-in-src-block-p) + (eq f 'org-tag) + (and (listp f) (memq 'org-tag f))) + (add-text-properties (match-beginning 0) (match-end 0) + (list 'mouse-face 'highlight + 'face 'org-link + 'keymap org-mouse-map)) + (org-rear-nonsticky-at (match-end 0))) + t))) (defun org-activate-code (limit) (if (re-search-forward "^[ \t]*\\(:\\(?: .*\\|$\\)\n?\\)" limit t) @@ -5510,7 +5516,8 @@ (defun org-activate-dates (limit) "Run through the buffer and add overlays to dates." - (if (re-search-forward org-tsr-regexp-both limit t) + (if (and (re-search-forward org-tsr-regexp-both limit t) + (not (equal (char-before (match-beginning 0)) 91))) (progn (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) (add-text-properties (match-beginning 0) (match-end 0) @@ -6431,13 +6438,16 @@ first headline is not level one, then (hide-sublevels 1) gives confusing results." (interactive) - (let ((level (save-excursion + (let ((l (org-current-line)) + (level (save-excursion (goto-char (point-min)) (if (re-search-forward (concat "^" outline-regexp) nil t) (progn (goto-char (match-beginning 0)) (funcall outline-level)))))) - (and level (hide-sublevels level)))) + (and level (hide-sublevels level)) + (recenter '(4)) + (org-goto-line l))) (defun org-content (&optional arg) "Show all headlines in the buffer, like a table of contents. @@ -7231,12 +7241,14 @@ (org-move-subtree-down) (end-of-line 1)) -(defun org-insert-heading-respect-content () - (interactive) +(defun org-insert-heading-respect-content (invisible-ok) + "Insert heading with `org-insert-heading-respect-content' set to t." + (interactive "P") (let ((org-insert-heading-respect-content t)) - (org-insert-heading t))) + (org-insert-heading t invisible-ok))) (defun org-insert-todo-heading-respect-content (&optional force-state) + "Insert TODO heading with `org-insert-heading-respect-content' set to t." (interactive "P") (let ((org-insert-heading-respect-content t)) (org-insert-todo-heading force-state t))) @@ -12835,27 +12847,27 @@ (following-p (org-get-alist-option org-show-following-heading key)) (entry-p (org-get-alist-option org-show-entry-below key)) (siblings-p (org-get-alist-option org-show-siblings key))) - (catch 'exit - ;; Show heading or entry text - (if (and heading-p (not entry-p)) - (org-flag-heading nil) ; only show the heading - (and (or entry-p (outline-invisible-p) (org-invisible-p2)) - (org-show-hidden-entry))) ; show entire entry - (when following-p - ;; Show next sibling, or heading below text - (save-excursion - (and (if heading-p (org-goto-sibling) (outline-next-heading)) - (org-flag-heading nil)))) - (when siblings-p (org-show-siblings)) - (when hierarchy-p - ;; show all higher headings, possibly with siblings - (save-excursion - (while (and (condition-case nil - (progn (org-up-heading-all 1) t) - (error nil)) - (not (bobp))) - (org-flag-heading nil) - (when siblings-p (org-show-siblings)))))))) + ;; Show heading or entry text + (if (and heading-p (not entry-p)) + (org-flag-heading nil) ; only show the heading + (and (or entry-p (outline-invisible-p) (org-invisible-p2)) + (org-show-hidden-entry))) ; show entire entry + (when following-p + ;; Show next sibling, or heading below text + (save-excursion + (and (if heading-p (org-goto-sibling) (outline-next-heading)) + (org-flag-heading nil)))) + (when siblings-p (org-show-siblings)) + (when hierarchy-p + ;; show all higher headings, possibly with siblings + (save-excursion + (while (and (condition-case nil + (progn (org-up-heading-all 1) t) + (error nil)) + (not (bobp))) + (org-flag-heading nil) + (when siblings-p (org-show-siblings))))) + (org-fix-ellipsis-at-bol))) (defvar org-reveal-start-hook nil "Hook run before revealing a location.") @@ -13597,7 +13609,9 @@ (if (or (org-at-heading-p) (and arg (org-before-first-heading-p))) (org-set-tags arg just-align) (save-excursion - (org-back-to-heading t) + (unless (and (org-region-active-p) + org-loop-over-headlines-in-active-region) + (org-back-to-heading t)) (org-set-tags arg just-align)))) (defun org-set-tags-to (data) @@ -14101,13 +14115,13 @@ The remaining args are treated as settings for the skipping facilities of the scanner. The following items can be given here: - archive skip trees with the archive tag. + archive skip trees with the archive tag comment skip trees with the COMMENT keyword function or Emacs Lisp form: - will be used as value for `org-agenda-skip-function', so whenever - the function returns t, FUNC will not be called for that - entry and search will continue from the point where the - function leaves it. + will be used as value for `org-agenda-skip-function', so + whenever the function returns a position, FUNC will not be + called for that entry and search will continue from the + position returned If your function needs to retrieve the tags including inherited tags at the *current* entry, you can use the value of the variable @@ -16401,6 +16415,12 @@ (message "Timestamp is now %sactive" (if (equal (char-after beg) ?<) "" "in"))))) +(defun org-at-clock-log-p nil + "Is the cursor on the clock log line?" + (save-excursion + (move-beginning-of-line 1) + (looking-at "^[ \t]*CLOCK:"))) + (defvar org-clock-history) ; defined in org-clock.el (defvar org-clock-adjust-closest nil) ; defined in org-clock.el (defun org-timestamp-change (n &optional what updown) @@ -18737,8 +18757,7 @@ (throw 'exit t)))) nil)))) -(autoload 'org-element-at-point "org-element") -(autoload 'org-element-type "org-element") +(org-autoload "org-element" '(org-element-at-point org-element-type)) (declare-function org-element-at-point "org-element" (&optional keep-trail)) (declare-function org-element-type "org-element" (element)) @@ -19840,7 +19859,7 @@ ("Refresh/Reload" ["Refresh setup current buffer" org-mode-restart t] ["Reload Org (after update)" org-reload t] - ["Reload Org uncompiled" (org-reload t) :active t :keys "C-u C-c C-x r"]) + ["Reload Org uncompiled" (org-reload t) :active t :keys "C-u C-c C-x !"]) )) (defun org-info (&optional node) @@ -20970,7 +20989,8 @@ (org-uniquify (append fill-nobreak-predicate '(org-fill-paragraph-separate-nobreak-p - org-fill-line-break-nobreak-p))))) + org-fill-line-break-nobreak-p + org-fill-paragraph-with-timestamp-nobreak-p))))) (org-set-local 'fill-paragraph-function 'org-fill-paragraph) (org-set-local 'auto-fill-inhibit-regexp nil) (org-set-local 'adaptive-fill-function 'org-adaptive-fill-function) @@ -20989,6 +21009,11 @@ (skip-chars-backward "\\\\") (looking-at "\\\\\\\\\\($\\|[^\\\\]\\)"))) +(defun org-fill-paragraph-with-timestamp-nobreak-p () + "Non-nil when a line break at point would insert a new item." + (and (org-at-timestamp-p t) + (not (looking-at org-ts-regexp-both)))) + (declare-function message-in-body-p "message" ()) (defvar org-element--affiliated-re) ; From org-element.el (defvar orgtbl-line-start-regexp) ; From org-table.el @@ -22159,7 +22184,8 @@ isearch-mode-end-hook-quit) ;; Only when the isearch was not quitted. (org-add-hook 'post-command-hook 'org-isearch-post-command - 'append 'local))))) + 'append 'local))) + (org-fix-ellipsis-at-bol))) (defun org-isearch-post-command () "Remove self from hook, and show context." @@ -22190,7 +22216,7 @@ (re (concat "^" (org-get-limited-outline-regexp))) (subs (make-vector (1+ n) nil)) (last-level 0) - m level head) + m level head0 head) (save-excursion (save-restriction (widen) @@ -22198,9 +22224,9 @@ (while (re-search-backward re nil t) (setq level (org-reduced-level (funcall outline-level))) (when (and (<= level n) - (looking-at org-complex-heading-regexp)) - (setq head (org-link-display-format - (org-match-string-no-properties 4)) + (looking-at org-complex-heading-regexp) + (setq head0 (org-match-string-no-properties 4))) + (setq head (org-link-display-format head0) m (org-imenu-new-marker)) (org-add-props head nil 'org-imenu-marker m 'org-imenu t) (if (>= level last-level) === modified file 'lisp/textmodes/paragraphs.el' --- lisp/textmodes/paragraphs.el 2013-01-01 09:11:05 +0000 +++ lisp/textmodes/paragraphs.el 2013-02-25 19:43:44 +0000 @@ -379,8 +379,8 @@ If ARG is negative, point is put at end of this paragraph, mark is put at beginning of this or a previous paragraph. -Interactively, if this command is repeated -or (in Transient Mark mode) if the mark is active, +Interactively (or if ALLOW-EXTEND is non-nil), if this command is +repeated or (in Transient Mark mode) if the mark is active, it marks the next ARG paragraphs after the ones already marked." (interactive "p\np") (unless arg (setq arg 1)) === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-27 18:37:31 +0000 +++ src/ChangeLog 2013-02-28 06:30:48 +0000 @@ -1,3 +1,8 @@ +2013-02-28 Eli Zaretskii + + * w32.c (sys_open): Don't reset the flags for FD in fd_info[]. + (Bug#13546). + 2013-02-27 Eli Zaretskii * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with === modified file 'src/w32.c' --- src/w32.c 2013-02-25 17:36:03 +0000 +++ src/w32.c 2013-02-28 06:30:48 +0000 @@ -3411,8 +3411,6 @@ res = _open (mpath, (oflag & ~_O_CREAT) | _O_NOINHERIT, mode); if (res < 0) res = _open (mpath, oflag | _O_NOINHERIT, mode); - if (res >= 0 && res < MAXDESC) - fd_info[res].flags = 0; return res; } === modified file 'test/ChangeLog' --- test/ChangeLog 2013-02-21 16:56:49 +0000 +++ test/ChangeLog 2013-02-28 06:30:48 +0000 @@ -1,3 +1,22 @@ +2013-02-28 Fabián Ezequiel Gallina + + * automated/python-tests.el (python-tests-with-temp-buffer): Doc fix. + (python-tests-with-temp-file): New macro. + (python-tests-shell-interpreter): New var. + (python-shell-get-process-name-1) + (python-shell-internal-get-process-name-1) + (python-shell-parse-command-1) + (python-shell-calculate-process-environment-1) + (python-shell-calculate-process-environment-2) + (python-shell-calculate-process-environment-3) + (python-shell-calculate-exec-path-1) + (python-shell-calculate-exec-path-2) + (python-shell-make-comint-1) + (python-shell-make-comint-2) + (python-shell-get-process-1) + (python-shell-get-or-create-process-1) + (python-shell-internal-get-or-create-process-1): New tests. + 2013-02-21 Fabián Ezequiel Gallina * automated/python-tests.el: New file. === modified file 'test/automated/python-tests.el' --- test/automated/python-tests.el 2013-02-25 07:49:40 +0000 +++ test/automated/python-tests.el 2013-02-28 06:30:48 +0000 @@ -34,6 +34,21 @@ (goto-char (point-min)) ,@body)) +(defmacro python-tests-with-temp-file (contents &rest body) + "Create a `python-mode' enabled file with CONTENTS. +BODY is code to be executed within the temp buffer. Point is +always located at the beginning of buffer." + (declare (indent 1) (debug t)) + `(let* ((temp-file (concat (make-temp-file "python-tests") ".py")) + (buffer (find-file-noselect temp-file))) + (unwind-protect + (with-current-buffer buffer + (python-mode) + (insert ,contents) + (goto-char (point-min)) + ,@body) + (and buffer (kill-buffer buffer))))) + (defun python-tests-look-at (string &optional num restore-point) "Move point at beginning of STRING in the current buffer. Optional argument NUM defaults to 1 and is an integer indicating @@ -1161,6 +1176,260 @@ ;;; Shell integration +(defvar python-tests-shell-interpreter "python") + +(ert-deftest python-shell-get-process-name-1 () + "Check process name calculation on different scenarios." + (python-tests-with-temp-buffer + "" + (should (string= (python-shell-get-process-name nil) + python-shell-buffer-name)) + ;; When the `current-buffer' doesn't have `buffer-file-name', even + ;; if dedicated flag is non-nil should not include its name. + (should (string= (python-shell-get-process-name t) + python-shell-buffer-name))) + (python-tests-with-temp-file + "" + ;; `buffer-file-name' is non-nil but the dedicated flag is nil and + ;; should be respected. + (should (string= (python-shell-get-process-name nil) + python-shell-buffer-name)) + (should (string= + (python-shell-get-process-name t) + (format "%s[%s]" python-shell-buffer-name buffer-file-name))))) + +(ert-deftest python-shell-internal-get-process-name-1 () + "Check the internal process name is config-unique." + (let* ((python-shell-interpreter python-tests-shell-interpreter) + (python-shell-interpreter-args "") + (python-shell-prompt-regexp ">>> ") + (python-shell-prompt-block-regexp "[.][.][.] ") + (python-shell-setup-codes "") + (python-shell-process-environment "") + (python-shell-extra-pythonpaths "") + (python-shell-exec-path "") + (python-shell-virtualenv-path "") + (expected (python-tests-with-temp-buffer + "" (python-shell-internal-get-process-name)))) + ;; Same configurations should match. + (should + (string= expected + (python-tests-with-temp-buffer + "" (python-shell-internal-get-process-name)))) + (let ((python-shell-interpreter-args "-B")) + ;; A minimal change should generate different names. + (should + (not (string= + expected + (python-tests-with-temp-buffer + "" (python-shell-internal-get-process-name)))))))) + +(ert-deftest python-shell-parse-command-1 () + "Check the command to execute is calculated correctly. +Using `python-shell-interpreter' and +`python-shell-interpreter-args'." + :expected-result (if (executable-find python-tests-shell-interpreter) + :passed + :failed) + (let ((python-shell-interpreter (executable-find + python-tests-shell-interpreter)) + (python-shell-interpreter-args "-B")) + (should (string= + (format "%s %s" + python-shell-interpreter + python-shell-interpreter-args) + (python-shell-parse-command))))) + +(ert-deftest python-shell-calculate-process-environment-1 () + "Test `python-shell-process-environment' modification." + (let* ((original-process-environment process-environment) + (python-shell-process-environment + '("TESTVAR1=value1" "TESTVAR2=value2")) + (process-environment + (python-shell-calculate-process-environment))) + (should (equal (getenv "TESTVAR1") "value1")) + (should (equal (getenv "TESTVAR2") "value2")))) + +(ert-deftest python-shell-calculate-process-environment-2 () + "Test `python-shell-extra-pythonpaths' modification." + (let* ((original-process-environment process-environment) + (original-pythonpath (getenv "PYTHONPATH")) + (paths '("path1" "path2")) + (python-shell-extra-pythonpaths paths) + (process-environment + (python-shell-calculate-process-environment))) + (should (equal (getenv "PYTHONPATH") + (concat + (mapconcat 'identity paths path-separator) + path-separator original-pythonpath))))) + +(ert-deftest python-shell-calculate-process-environment-3 () + "Test `python-shell-virtualenv-path' modification." + (let* ((original-process-environment process-environment) + (original-path (or (getenv "PATH") "")) + (python-shell-virtualenv-path + (directory-file-name user-emacs-directory)) + (process-environment + (python-shell-calculate-process-environment))) + (should (not (getenv "PYTHONHOME"))) + (should (string= (getenv "VIRTUAL_ENV") python-shell-virtualenv-path)) + (should (equal (getenv "PATH") + (format "%s/bin%s%s" + python-shell-virtualenv-path + path-separator original-path))))) + +(ert-deftest python-shell-calculate-exec-path-1 () + "Test `python-shell-exec-path' modification." + (let* ((original-exec-path exec-path) + (python-shell-exec-path '("path1" "path2")) + (exec-path (python-shell-calculate-exec-path))) + (should (equal + exec-path + (append python-shell-exec-path + original-exec-path))))) + +(ert-deftest python-shell-calculate-exec-path-2 () + "Test `python-shell-exec-path' modification." + (let* ((original-exec-path exec-path) + (python-shell-virtualenv-path + (directory-file-name user-emacs-directory)) + (exec-path (python-shell-calculate-exec-path))) + (should (equal + exec-path + (append (cons + (format "%s/bin" python-shell-virtualenv-path) + original-exec-path)))))) + +(ert-deftest python-shell-make-comint-1 () + "Check comint creation for global shell buffer." + :expected-result (if (executable-find python-tests-shell-interpreter) + :passed + :failed) + (let* ((python-shell-interpreter + (executable-find python-tests-shell-interpreter)) + (proc-name (python-shell-get-process-name nil)) + (shell-buffer + (python-tests-with-temp-buffer + "" (python-shell-make-comint + (python-shell-parse-command) proc-name))) + (process (get-buffer-process shell-buffer))) + (unwind-protect + (progn + (set-process-query-on-exit-flag process nil) + (should (process-live-p process)) + (with-current-buffer shell-buffer + (should (eq major-mode 'inferior-python-mode)) + (should (string= (buffer-name) (format "*%s*" proc-name))))) + (kill-buffer shell-buffer)))) + +(ert-deftest python-shell-make-comint-2 () + "Check comint creation for internal shell buffer." + :expected-result (if (executable-find python-tests-shell-interpreter) + :passed + :failed) + (let* ((python-shell-interpreter + (executable-find python-tests-shell-interpreter)) + (proc-name (python-shell-internal-get-process-name)) + (shell-buffer + (python-tests-with-temp-buffer + "" (python-shell-make-comint + (python-shell-parse-command) proc-name nil t))) + (process (get-buffer-process shell-buffer))) + (unwind-protect + (progn + (set-process-query-on-exit-flag process nil) + (should (process-live-p process)) + (with-current-buffer shell-buffer + (should (eq major-mode 'inferior-python-mode)) + (should (string= (buffer-name) (format " *%s*" proc-name))))) + (kill-buffer shell-buffer)))) + +(ert-deftest python-shell-get-process-1 () + "Check dedicated shell process preference over global." + :expected-result (if (executable-find python-tests-shell-interpreter) + :passed + :failed) + (python-tests-with-temp-file + "" + (let* ((python-shell-interpreter + (executable-find python-tests-shell-interpreter)) + (global-proc-name (python-shell-get-process-name nil)) + (dedicated-proc-name (python-shell-get-process-name t)) + (global-shell-buffer + (python-shell-make-comint + (python-shell-parse-command) global-proc-name)) + (dedicated-shell-buffer + (python-shell-make-comint + (python-shell-parse-command) dedicated-proc-name)) + (global-process (get-buffer-process global-shell-buffer)) + (dedicated-process (get-buffer-process dedicated-shell-buffer))) + (unwind-protect + (progn + (set-process-query-on-exit-flag global-process nil) + (set-process-query-on-exit-flag dedicated-process nil) + ;; Prefer dedicated if global also exists. + (should (equal (python-shell-get-process) dedicated-process)) + (kill-buffer dedicated-shell-buffer) + ;; If there's only global, use it. + (should (equal (python-shell-get-process) global-process)) + (kill-buffer global-shell-buffer) + ;; No buffer available. + (should (not (python-shell-get-process)))) + (ignore-errors (kill-buffer global-shell-buffer)) + (ignore-errors (kill-buffer dedicated-shell-buffer)))))) + +(ert-deftest python-shell-get-or-create-process-1 () + "Check shell process creation fallback." + :expected-result :failed + (python-tests-with-temp-file + "" + ;; XXX: Break early until we can skip stuff. We need to mimic + ;; user interaction because `python-shell-get-or-create-process' + ;; asks for all arguments interactively when a shell process + ;; doesn't exist. + (should nil) + (let* ((python-shell-interpreter + (executable-find python-tests-shell-interpreter)) + (use-dialog-box) + (dedicated-process-name (python-shell-get-process-name t)) + (dedicated-process (python-shell-get-or-create-process)) + (dedicated-shell-buffer (process-buffer dedicated-process))) + (unwind-protect + (progn + (set-process-query-on-exit-flag dedicated-process nil) + ;; Prefer dedicated if not buffer exist. + (should (equal (process-name dedicated-process) + dedicated-process-name)) + (kill-buffer dedicated-shell-buffer) + ;; No buffer available. + (should (not (python-shell-get-process)))) + (ignore-errors (kill-buffer dedicated-shell-buffer)))))) + +(ert-deftest python-shell-internal-get-or-create-process-1 () + "Check internal shell process creation fallback." + :expected-result (if (executable-find python-tests-shell-interpreter) + :passed + :failed) + (python-tests-with-temp-file + "" + (should (not (process-live-p (python-shell-internal-get-process-name)))) + (let* ((python-shell-interpreter + (executable-find python-tests-shell-interpreter)) + (internal-process-name (python-shell-internal-get-process-name)) + (internal-process (python-shell-internal-get-or-create-process)) + (internal-shell-buffer (process-buffer internal-process))) + (unwind-protect + (progn + (set-process-query-on-exit-flag internal-process nil) + (should (equal (process-name internal-process) + internal-process-name)) + (should (equal internal-process + (python-shell-internal-get-or-create-process))) + ;; No user buffer available. + (should (not (python-shell-get-process))) + (kill-buffer internal-shell-buffer)) + (ignore-errors (kill-buffer internal-shell-buffer)))))) + ;;; Shell completion ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.