emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 19d681d24b 3/3: Merge from origin/emacs-28


From: Stefan Kangas
Subject: master 19d681d24b 3/3: Merge from origin/emacs-28
Date: Sun, 16 Jan 2022 00:51:18 -0500 (EST)

branch: master
commit 19d681d24bce0bcff1417c73035d1f9e34fbcc4a
Merge: 5cdee3a997 e488601849
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Merge from origin/emacs-28
    
    e488601849 Update to Org 9.5.2-9-g7ba24c
    95640360f0 * lisp/net/dictionary.el (dictionary-context-menu): Use pa...
---
 lisp/net/dictionary.el  |  2 +-
 lisp/org/ob-gnuplot.el  | 25 ++++++++++---------------
 lisp/org/org-agenda.el  |  5 ++++-
 lisp/org/org-version.el |  2 +-
 lisp/org/org.el         | 20 +++++++++++---------
 lisp/org/ox-ascii.el    |  6 +++++-
 6 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 507363cc0f..e0824f3971 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -1376,7 +1376,7 @@ any buffer where (dictionary-tooltip-mode 1) has been 
called."
     (dictionary-search word)))
 
 ;;;###autoload
-(defun context-menu-dictionary (menu click)
+(defun dictionary-context-menu (menu click)
   "Populate MENU with dictionary commands at CLICK.
 When you add this function to `context-menu-functions',
 the context menu will contain an item that searches
diff --git a/lisp/org/ob-gnuplot.el b/lisp/org/ob-gnuplot.el
index 69a5f5f91b..895738822d 100644
--- a/lisp/org/ob-gnuplot.el
+++ b/lisp/org/ob-gnuplot.el
@@ -129,6 +129,7 @@ code."
            (title (cdr (assq :title params)))
            (lines (cdr (assq :line params)))
            (sets (cdr (assq :set params)))
+           (missing (cdr (assq :missing params)))
            (x-labels (cdr (assq :xlabels params)))
            (y-labels (cdr (assq :ylabels params)))
            (timefmt (cdr (assq :timefmt params)))
@@ -138,6 +139,7 @@ code."
                           (file-name-directory (buffer-file-name))))
           (add-to-body (lambda (text) (setq body (concat text "\n" body)))))
       ;; append header argument settings to body
+      (when missing (funcall add-to-body (format "set datafile missing '%s'" 
missing)))
       (when title (funcall add-to-body (format "set title '%s'" title)))
       (when lines (mapc (lambda (el) (funcall add-to-body el)) lines))
       (when sets
@@ -288,21 +290,14 @@ Pass PARAMS through to `orgtbl-to-generic' when exporting 
TABLE."
   (with-temp-file data-file
     (insert (let ((org-babel-gnuplot-timestamp-fmt
                   (or (plist-get params :timefmt) "%Y-%m-%d-%H:%M:%S")))
-              (replace-regexp-in-string
-               ;; org export backend adds "|" at the beginning/end of
-               ;; the table lines.  Strip those.
-               "^|\\(.+\\)|$"
-               "\\1"
-              (orgtbl-to-generic
-               table
-               (org-combine-plists
-                '( :sep "\t" :fmt org-babel-gnuplot-quote-tsv-field
-                    ;; Two setting below are needed to make :fmt work.
-                    :raw t
-                    ;; Use `org', not `ascii' because `ascii' may
-                    ;; sometimes mishandle quoted strings.
-                    :backend org)
-                params))))))
+             (orgtbl-to-generic
+              table
+              (org-combine-plists
+               '( :sep "\t" :fmt org-babel-gnuplot-quote-tsv-field
+                   ;; Two setting below are needed to make :fmt work.
+                   :raw t
+                   :backend ascii)
+               params)))))
   data-file)
 
 (provide 'ob-gnuplot)
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index fed36ac9b6..94aea1b0a3 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -86,6 +86,8 @@
 (declare-function org-capture "org-capture" (&optional goto keys))
 (declare-function org-clock-modify-effort-estimate "org-clock" (&optional 
value))
 
+(declare-function org-element-type "org-element" (&optional element))
+
 (defvar calendar-mode-map)
 (defvar org-clock-current-task)
 (defvar org-current-tag-alist)
@@ -5729,7 +5731,8 @@ displayed in agenda view."
                    (org-at-planning-p)
                    (org-before-first-heading-p)
                    (and org-agenda-include-inactive-timestamps
-                        (org-at-clock-log-p)))
+                        (org-at-clock-log-p))
+                    (not (eq 'timestamp (org-element-type 
(org-element-context)))))
            (throw :skip nil))
          (org-agenda-skip))
        (let* ((pos (match-beginning 0))
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el
index 1053bbe22c..5337d9df74 100644
--- a/lisp/org/org-version.el
+++ b/lisp/org/org-version.el
@@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made."
 (defun org-git-version ()
   "The Git version of Org mode.
 Inserted by installing Org or when a release is made."
-   (let ((org-git-version "release_9.5.2-3-geb9f34"))
+   (let ((org-git-version "release_9.5.2-9-g7ba24c"))
      org-git-version))
 
 (provide 'org-version)
diff --git a/lisp/org/org.el b/lisp/org/org.el
index fba45caabe..f5d4df3d9c 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -18731,17 +18731,19 @@ With prefix arg UNCOMPILED, load the uncompiled 
versions."
   "Is S an ID created by UUIDGEN?"
   (string-match 
"\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'"
 (downcase s)))
 
-(defun org-in-src-block-p (&optional inside)
+(defun org-in-src-block-p (&optional inside element)
   "Whether point is in a code source block.
 When INSIDE is non-nil, don't consider we are within a source
-block when point is at #+BEGIN_SRC or #+END_SRC."
-  (let ((case-fold-search t))
-    (or (and (eq (get-char-property (point) 'src-block) t))
-       (and (not inside)
-            (save-match-data
-              (save-excursion
-                (beginning-of-line)
-                (looking-at ".*#\\+\\(begin\\|end\\)_src")))))))
+block when point is at #+BEGIN_SRC or #+END_SRC.
+When ELEMENT is provided, it is considered to be element at point."
+  (save-match-data (setq element (or element (org-element-at-point))))
+  (when (eq 'src-block (org-element-type element))
+    (or (not inside)
+        (not (or (= (line-beginning-position)
+                  (org-element-property :post-affiliated element))
+               (= (1+ (line-end-position))
+                  (- (org-element-property :end element)
+                     (org-element-property :post-blank element))))))))
 
 (defun org-context ()
   "Return a list of contexts of the current cursor position.
diff --git a/lisp/org/ox-ascii.el b/lisp/org/ox-ascii.el
index c22bb13b6d..38b2a5772c 100644
--- a/lisp/org/ox-ascii.el
+++ b/lisp/org/ox-ascii.el
@@ -1929,7 +1929,11 @@ a communication channel."
               (org-export-table-cell-alignment table-cell info)))))
       (setq contents
            (concat data
-                   (make-string (- width (string-width (or data ""))) ?\s))))
+                    ;; FIXME: If CONTENTS was transformed by filters,
+                    ;; the whole width calculation can be wrong.
+                    ;; At least, make sure that we do not throw error
+                    ;; when CONTENTS is larger than width.
+                   (make-string (max 0 (- width (string-width (or data "")))) 
?\s))))
     ;; Return cell.
     (concat (format " %s " contents)
            (when (memq 'right (org-export-table-cell-borders table-cell info))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]