[elpa] externals/posframe fc46502 3/5: Merge pull request #78 from yangsheng6810/master

2021-02-03 Thread Feng Shu
branch: externals/posframe
commit fc465026765a3887891b80df2f85fa4478ce1f21
Merge: 0f2d860 ae00691
Author: tumashu 
Commit: GitHub 

Merge pull request #78 from yangsheng6810/master

Add poshandler for centering below point
---
 posframe.el | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/posframe.el b/posframe.el
index e55ead4..5adb8a7 100644
--- a/posframe.el
+++ b/posframe.el
@@ -451,6 +451,7 @@ The builtin poshandler functions are listed below:
 15. `posframe-poshandler-point-top-left-corner'
 16. `posframe-poshandler-point-bottom-left-corner'
 17. `posframe-poshandler-point-bottom-left-corner-upward'
+18. `posframe-poshandler-point-window-center'
 
 This posframe's buffer is BUFFER-OR-NAME, which can be a buffer
 or a name of a (possibly nonexistent) buffer.
@@ -965,19 +966,21 @@ of `posframe-show'."
 (cons (+ (car position) x-pixel-offset)
   (+ (cdr position) y-pixel-offset
 
-(defun posframe-poshandler-point-bottom-left-corner (info &optional 
font-height upward)
+(defun posframe-poshandler-point-bottom-left-corner (info &optional 
font-height upward centering)
   "Posframe's position hanlder.
 
 Get bottom-left-corner pixel position of a point,
 the structure of INFO can be found in docstring
 of `posframe-show'.
 
-Optional argument FONT-HEIGHT ."
+Optional argument FONT-HEIGHT, UPWARD, CENTERING ."
   (let* ((x-pixel-offset (plist-get info :x-pixel-offset))
  (y-pixel-offset (plist-get info :y-pixel-offset))
  (posframe-width (plist-get info :posframe-width))
  (posframe-height (plist-get info :posframe-height))
  (window (plist-get info :parent-window))
+ (window-left (plist-get info :parent-window-left))
+ (window-width (plist-get info :parent-window-width))
  (xmax (plist-get info :parent-frame-width))
  (ymax (plist-get info :parent-frame-height))
  (position-info (plist-get info :position-info))
@@ -997,13 +1000,24 @@ Optional argument FONT-HEIGHT ."
y-pixel-offset))
  (font-height (or font-height (plist-get info :font-height)))
  (y-bottom (+ y-top font-height)))
-(cons (max 0 (min x (- xmax (or posframe-width 0
+(cons (if centering
+  (+ window-left (/ (- window-width posframe-width) 2))
+(max 0 (min x (- xmax (or posframe-width 0)
   (max 0 (if (if upward
  (> (- y-bottom (or posframe-height 0)) 0)
(> (+ y-bottom (or posframe-height 0)) ymax))
  (- y-top (or posframe-height 0))
y-bottom)
 
+(defun posframe-poshandler-point-window-center (info)
+  "Posframe's position hanlder.
+
+Get a position of a point, by which a window-centered posframe
+can be put below it, the structure of INFO can be found in
+docstring of `posframe-show'. "
+
+  (posframe-poshandler-point-bottom-left-corner info nil nil t))
+
 (defun posframe-poshandler-point-bottom-left-corner-upward (info)
   "Posframe's position hanlder.
 



[elpa] externals/posframe ae00691 1/5: Add poshandler for centering below point

2021-02-03 Thread Feng Shu
branch: externals/posframe
commit ae00691e35d52fc059e80c5fea798f005985ec1c
Author: Sheng Yang 
Commit: Sheng Yang 

Add poshandler for centering below point

Add poshandler posframe-poshandler-point-window-center
---
 posframe.el | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/posframe.el b/posframe.el
index c220223..980b635 100644
--- a/posframe.el
+++ b/posframe.el
@@ -456,6 +456,7 @@ The builtin poshandler functions are listed below:
 15. `posframe-poshandler-point-top-left-corner'
 16. `posframe-poshandler-point-bottom-left-corner'
 17. `posframe-poshandler-point-bottom-left-corner-upward'
+18. `posframe-poshandler-point-window-center'
 
 This posframe's buffer is BUFFER-OR-NAME, which can be a buffer
 or a name of a (possibly nonexistent) buffer.
@@ -965,19 +966,21 @@ of `posframe-show'."
 (cons (+ (car position) x-pixel-offset)
   (+ (cdr position) y-pixel-offset
 
-(defun posframe-poshandler-point-bottom-left-corner (info &optional 
font-height upward)
+(defun posframe-poshandler-point-bottom-left-corner (info &optional 
font-height upward centering)
   "Posframe's position hanlder.
 
 Get bottom-left-corner pixel position of a point,
 the structure of INFO can be found in docstring
 of `posframe-show'.
 
-Optional argument FONT-HEIGHT ."
+Optional argument FONT-HEIGHT, UPWARD, CENTERING ."
   (let* ((x-pixel-offset (plist-get info :x-pixel-offset))
  (y-pixel-offset (plist-get info :y-pixel-offset))
  (posframe-width (plist-get info :posframe-width))
  (posframe-height (plist-get info :posframe-height))
  (window (plist-get info :parent-window))
+ (window-left (plist-get info :parent-window-left))
+ (window-width (plist-get info :parent-window-width))
  (xmax (plist-get info :parent-frame-width))
  (ymax (plist-get info :parent-frame-height))
  (position-info (plist-get info :position-info))
@@ -997,13 +1000,24 @@ Optional argument FONT-HEIGHT ."
y-pixel-offset))
  (font-height (or font-height (plist-get info :font-height)))
  (y-bottom (+ y-top font-height)))
-(cons (max 0 (min x (- xmax (or posframe-width 0
+(cons (if centering
+  (+ window-left (/ (- window-width posframe-width) 2))
+(max 0 (min x (- xmax (or posframe-width 0)
   (max 0 (if (if upward
  (> (- y-bottom (or posframe-height 0)) 0)
(> (+ y-bottom (or posframe-height 0)) ymax))
  (- y-top (or posframe-height 0))
y-bottom)
 
+(defun posframe-poshandler-point-window-center (info)
+  "Posframe's position hanlder.
+
+Get a position of a point, by which a window-centered posframe
+can be put below it, the structure of INFO can be found in
+docstring of `posframe-show'. "
+
+  (posframe-poshandler-point-bottom-left-corner info nil nil t))
+
 (defun posframe-poshandler-point-bottom-left-corner-upward (info)
   "Posframe's position hanlder.
 



[elpa] externals/posframe 0f2d860 2/5: * posframe.el (posframe--fit-frame-to-buffer): use functionp to test fit-frame-to-buffer-1 exist.

2021-02-03 Thread Feng Shu
branch: externals/posframe
commit 0f2d8603662a3a868bced5f158305e609fbb6081
Author: Feng Shu 
Commit: Feng Shu 

* posframe.el (posframe--fit-frame-to-buffer): use functionp to test 
fit-frame-to-buffer-1 exist.
---
 posframe.el | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/posframe.el b/posframe.el
index bd50ed5..e55ead4 100644
--- a/posframe.el
+++ b/posframe.el
@@ -722,11 +722,11 @@ will be removed."
   (let ((x-gtk-resize-child-frames posframe-gtk-resize-child-frames))
 ;; More info: Don't skip empty lines when fitting mini frame to buffer 
(Bug#44080)
 ;; 
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e0de9f3295b4c46cb7198ec0b9634809d7b7a36d
-(if (version< emacs-version "27.2")
-(fit-frame-to-buffer
- posframe height min-height width min-width)
-  (fit-frame-to-buffer-1
-   posframe height min-height width min-width nil nil nil
+(if (functionp 'fit-frame-to-buffer-1)
+(fit-frame-to-buffer-1
+ posframe height min-height width min-width nil nil nil)
+  (fit-frame-to-buffer
+   posframe height min-height width min-width
 
 (defun posframe--set-frame-size (posframe height min-height width min-width)
   "Set POSFRAME's size.



[elpa] externals/posframe 5e654b0 5/5: Merge pull request #90 from tumashu/border

2021-02-03 Thread Feng Shu
branch: externals/posframe
commit 5e654b0f7023055a0acae82eb4e68904819c3529
Merge: fc46502 d593036
Author: tumashu 
Commit: GitHub 

Merge pull request #90 from tumashu/border

Fix: Emacs 28 is bringing border breaking changes #89
---
 posframe.el | 35 +++
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/posframe.el b/posframe.el
index 5adb8a7..b8284a0 100644
--- a/posframe.el
+++ b/posframe.el
@@ -245,6 +245,8 @@ effect.")
  background-color
  left-fringe
  right-fringe
+ border-width
+ border-color
  internal-border-width
  internal-border-color
  font
@@ -258,7 +260,10 @@ effect.")
 This posframe's buffer is BUFFER-OR-NAME."
   (let ((left-fringe (or left-fringe 0))
 (right-fringe (or right-fringe 0))
-(internal-border-width (or internal-border-width 0))
+;; See emacs.git:  Add distinct controls for child frames' borders 
(Bug#45620)
+;; 
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ff7b1a133bfa7f2614650f8551824ffaef13fadc
+(border-width (or border-width internal-border-width 0))
+(border-color (or border-color internal-border-color))
 (buffer (get-buffer-create buffer-or-name))
 (after-make-frame-functions nil)
 (x-gtk-resize-child-frames posframe-gtk-resize-child-frames)
@@ -267,6 +272,7 @@ This posframe's buffer is BUFFER-OR-NAME."
 background-color
 right-fringe
 left-fringe
+border-width
 internal-border-width
 font
 keep-ratio
@@ -326,7 +332,8 @@ This posframe's buffer is BUFFER-OR-NAME."
(min-width  . 0)
(min-height . 0)
(border-width . 0)
-   (internal-border-width . ,internal-border-width)
+   (internal-border-width . ,border-width)
+   (child-frame-border-width . ,border-width)
(vertical-scroll-bars . nil)
(horizontal-scroll-bars . nil)
(left-fringe . ,left-fringe)
@@ -347,9 +354,9 @@ This posframe's buffer is BUFFER-OR-NAME."
(inhibit-double-buffering . 
,posframe-inhibit-double-buffering)
;; Do not save child-frame when use desktop.el
(desktop-dont-save . t
-(when internal-border-color
-  (set-face-background 'internal-border
-   internal-border-color posframe--frame))
+(when border-color
+  (set-face-background 'internal-border border-color posframe--frame)
+  (set-face-background 'child-frame-border border-color 
posframe--frame))
 (let ((posframe-window (frame-root-window posframe--frame)))
   ;; This method is more stable than 'setq mode/header-line-format nil'
   (unless respect-mode-line
@@ -378,6 +385,8 @@ This posframe's buffer is BUFFER-OR-NAME."
  y-pixel-offset
  left-fringe
  right-fringe
+ border-width
+ border-color
  internal-border-width
  internal-border-color
  font
@@ -469,9 +478,15 @@ If LEFT-FRINGE or RIGHT-FRINGE is a number, left fringe or
 right fringe with be shown with the specified width.
 
 By default, posframe shows no borders, but users can specify
-borders by setting INTERNAL-BORDER-WIDTH to a positive number.
-Border color can be specified by INTERNAL-BORDER-COLOR
-or via the ‘internal-border’ face.
+borders by setting BORDER-WIDTH to a positive number.  Border
+color can be specified by BORDER-COLOR.
+
+INTERNAL-BORDER-WIDTH and INTERNAL-BORDER-COLOR are same as
+BORDER-WIDTH and INTERNAL-BORDER-COLOR, but do not suggest to use
+for the reason:
+
+   Add distinct controls for child frames' borders (Bug#45620)
+   
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ff7b1a133bfa7f2614650f8551824ffaef13fadc
 
 Posframe's font as well as foreground and background colors are
 derived from the current frame by default, but can be overridden
@@ -525,6 +540,8 @@ You can use `posframe-delete-all' to delete all posframes."
  (y-pixel-offset (or (funcall posframe-arghandler buffer-or-name 
:y-pixel-offset y-pixel-offset) 0))
  (left-fringe (funcall posframe-arghandler buffer-or-name :left-fringe 
left-fringe))
  (right-fringe (funcall posframe-arghandler buffer-or-name 
:right-fringe right-fringe))
+ (border-width (funcall pos

[elpa] externals/posframe updated (efd7ea4 -> 5e654b0)

2021-02-03 Thread Feng Shu
tumashu pushed a change to branch externals/posframe.

  from  efd7ea4   v0.8.4
   new  0f2d860   * posframe.el (posframe--fit-frame-to-buffer): use 
functionp to test fit-frame-to-buffer-1 exist.
   new  ae00691   Add poshandler for centering below point
   new  fc46502   Merge pull request #78 from yangsheng6810/master
   new  d593036   Fix: Emacs 28 is bringing border breaking changes #89
   new  5e654b0   Merge pull request #90 from tumashu/border


Summary of changes:
 posframe.el | 65 ++---
 1 file changed, 49 insertions(+), 16 deletions(-)



[elpa] externals/posframe d593036 4/5: Fix: Emacs 28 is bringing border breaking changes #89

2021-02-03 Thread Feng Shu
branch: externals/posframe
commit d5930367993cfe62ba9d06e2667976fb3a127b3f
Author: Feng Shu 
Commit: Feng Shu 

Fix: Emacs 28 is bringing border breaking changes #89
---
 posframe.el | 35 +++
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/posframe.el b/posframe.el
index e55ead4..d121ca5 100644
--- a/posframe.el
+++ b/posframe.el
@@ -245,6 +245,8 @@ effect.")
  background-color
  left-fringe
  right-fringe
+ border-width
+ border-color
  internal-border-width
  internal-border-color
  font
@@ -258,7 +260,10 @@ effect.")
 This posframe's buffer is BUFFER-OR-NAME."
   (let ((left-fringe (or left-fringe 0))
 (right-fringe (or right-fringe 0))
-(internal-border-width (or internal-border-width 0))
+;; See emacs.git:  Add distinct controls for child frames' borders 
(Bug#45620)
+;; 
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ff7b1a133bfa7f2614650f8551824ffaef13fadc
+(border-width (or border-width internal-border-width 0))
+(border-color (or border-color internal-border-color))
 (buffer (get-buffer-create buffer-or-name))
 (after-make-frame-functions nil)
 (x-gtk-resize-child-frames posframe-gtk-resize-child-frames)
@@ -267,6 +272,7 @@ This posframe's buffer is BUFFER-OR-NAME."
 background-color
 right-fringe
 left-fringe
+border-width
 internal-border-width
 font
 keep-ratio
@@ -326,7 +332,8 @@ This posframe's buffer is BUFFER-OR-NAME."
(min-width  . 0)
(min-height . 0)
(border-width . 0)
-   (internal-border-width . ,internal-border-width)
+   (internal-border-width . ,border-width)
+   (child-frame-border-width . ,border-width)
(vertical-scroll-bars . nil)
(horizontal-scroll-bars . nil)
(left-fringe . ,left-fringe)
@@ -347,9 +354,9 @@ This posframe's buffer is BUFFER-OR-NAME."
(inhibit-double-buffering . 
,posframe-inhibit-double-buffering)
;; Do not save child-frame when use desktop.el
(desktop-dont-save . t
-(when internal-border-color
-  (set-face-background 'internal-border
-   internal-border-color posframe--frame))
+(when border-color
+  (set-face-background 'internal-border border-color posframe--frame)
+  (set-face-background 'child-frame-border border-color 
posframe--frame))
 (let ((posframe-window (frame-root-window posframe--frame)))
   ;; This method is more stable than 'setq mode/header-line-format nil'
   (unless respect-mode-line
@@ -378,6 +385,8 @@ This posframe's buffer is BUFFER-OR-NAME."
  y-pixel-offset
  left-fringe
  right-fringe
+ border-width
+ border-color
  internal-border-width
  internal-border-color
  font
@@ -468,9 +477,15 @@ If LEFT-FRINGE or RIGHT-FRINGE is a number, left fringe or
 right fringe with be shown with the specified width.
 
 By default, posframe shows no borders, but users can specify
-borders by setting INTERNAL-BORDER-WIDTH to a positive number.
-Border color can be specified by INTERNAL-BORDER-COLOR
-or via the ‘internal-border’ face.
+borders by setting BORDER-WIDTH to a positive number.  Border
+color can be specified by BORDER-COLOR.
+
+INTERNAL-BORDER-WIDTH and INTERNAL-BORDER-COLOR are same as
+BORDER-WIDTH and INTERNAL-BORDER-COLOR, but do not suggest to use
+for the reason:
+
+   Add distinct controls for child frames' borders (Bug#45620)
+   
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ff7b1a133bfa7f2614650f8551824ffaef13fadc
 
 Posframe's font as well as foreground and background colors are
 derived from the current frame by default, but can be overridden
@@ -524,6 +539,8 @@ You can use `posframe-delete-all' to delete all posframes."
  (y-pixel-offset (or (funcall posframe-arghandler buffer-or-name 
:y-pixel-offset y-pixel-offset) 0))
  (left-fringe (funcall posframe-arghandler buffer-or-name :left-fringe 
left-fringe))
  (right-fringe (funcall posframe-arghandler buffer-or-name 
:right-fringe right-fringe))
+ (border-width (funcall posframe-arghandler buffer-or-name 
:border-width border-width))
+ 

[elpa] externals-release/org e879596 1/2: footnote: Silence byte-compiler under 'make single'

2021-02-03 Thread ELPA Syncer
branch: externals-release/org
commit e87959615904c1de7616fc0d2b33b8b32bd0a766
Author: Kyle Meyer 
Commit: Kyle Meyer 

footnote: Silence byte-compiler under 'make single'
---
 lisp/org-footnote.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 47ad4aa..6769663 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -37,6 +37,7 @@
 (declare-function org-at-comment-p "org" ())
 (declare-function org-at-heading-p "org" (&optional ignored))
 (declare-function org-back-over-empty-lines "org" ())
+(declare-function org-end-of-meta-data "org" (&optional full))
 (declare-function org-edit-footnote-reference "org-src" ())
 (declare-function org-element-at-point "org-element" ())
 (declare-function org-element-class "org-element" (datum &optional parent))



[elpa] externals/org 369eb27: Merge branch 'maint'

2021-02-03 Thread ELPA Syncer
branch: externals/org
commit 369eb2739787b9b24399c803be31e4e793113dd1
Merge: 26773a4 862048d
Author: Kyle Meyer 
Commit: Kyle Meyer 

Merge branch 'maint'
---
 lisp/ob-sql.el   | 5 -
 lisp/org-footnote.el | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 902194a..b9dd72b 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -245,11 +245,14 @@ This function is called by `org-babel-execute-src-block'."
   (org-babel-process-file-name in-file)
   (org-babel-process-file-name out-file)))
((postgresql postgres) (format
-   "%spsql --set=\"ON_ERROR_STOP=1\" 
%s -A -P \
+   "%s%s --set=\"ON_ERROR_STOP=1\" %s 
-A -P \
 footer=off -F \"\t\"  %s -f %s -o %s %s"
(if dbpassword
(format "PGPASSWORD=%s " 
dbpassword)
  "")
+(or (bound-and-true-p
+ sql-postgres-program)
+"psql")
(if colnames-p "" "-t")
(org-babel-sql-dbstring-postgresql
 dbhost dbport dbuser database)
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 47ad4aa..6769663 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -37,6 +37,7 @@
 (declare-function org-at-comment-p "org" ())
 (declare-function org-at-heading-p "org" (&optional ignored))
 (declare-function org-back-over-empty-lines "org" ())
+(declare-function org-end-of-meta-data "org" (&optional full))
 (declare-function org-edit-footnote-reference "org-src" ())
 (declare-function org-element-at-point "org-element" ())
 (declare-function org-element-class "org-element" (datum &optional parent))



[elpa] externals-release/org 862048d 2/2: ob-sql.el: Respect the value of sql-postgres-program

2021-02-03 Thread ELPA Syncer
branch: externals-release/org
commit 862048d4cb3bf93fb74832ed490c41faebb7d5b5
Author: Alan Light 
Commit: Kyle Meyer 

ob-sql.el: Respect the value of sql-postgres-program

* ob-sql.el (org-babel-execute:sql): Use `sql-postgres-program' as
postgresql executable (instead of psql) when defined.  psql will be
the default.

[km: tweaked commit message, added bound-and-true-p guard]

TINYCHANGE
---
 lisp/ob-sql.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 902194a..b9dd72b 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -245,11 +245,14 @@ This function is called by `org-babel-execute-src-block'."
   (org-babel-process-file-name in-file)
   (org-babel-process-file-name out-file)))
((postgresql postgres) (format
-   "%spsql --set=\"ON_ERROR_STOP=1\" 
%s -A -P \
+   "%s%s --set=\"ON_ERROR_STOP=1\" %s 
-A -P \
 footer=off -F \"\t\"  %s -f %s -o %s %s"
(if dbpassword
(format "PGPASSWORD=%s " 
dbpassword)
  "")
+(or (bound-and-true-p
+ sql-postgres-program)
+"psql")
(if colnames-p "" "-t")
(org-babel-sql-dbstring-postgresql
 dbhost dbport dbuser database)



[elpa] externals-release/org updated (2ed1c20 -> 862048d)

2021-02-03 Thread ELPA Syncer
elpasync pushed a change to branch externals-release/org.

  from  2ed1c20   Remove Emacs 21 compat code for bookmark-after-jump-hook
   new  e879596   footnote: Silence byte-compiler under 'make single'
   new  862048d   ob-sql.el: Respect the value of sql-postgres-program


Summary of changes:
 lisp/ob-sql.el   | 5 -
 lisp/org-footnote.el | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)



[elpa] externals/org updated (26773a4 -> 369eb27)

2021-02-03 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  26773a4   Merge branch 'maint'
   new  e879596   footnote: Silence byte-compiler under 'make single'
   new  862048d   ob-sql.el: Respect the value of sql-postgres-program
   new  369eb27   Merge branch 'maint'


Summary of changes:
 lisp/ob-sql.el   | 5 -
 lisp/org-footnote.el | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)