texts: Matching repeating tasks in org-agenda search

texts:
I am trying to create an agenda search that matches on the DATE property of certain entries.

This works fine for one-off tasks/events; however, when I have a repeating task whose DATE is of the form <some-ancient-date +1w>, running a search like

DATE>"<now>"+DATE<"<tomorrow>"

to get my upcoming events for today doesn't capture this task because its DATE value is the date at which I first defined this task. How can I modify my query to capture the fact that this event is supposed to recur today?

Minimal Working Example

Suppose my agenda file has the following entries:

* Receive Nobel prize
  :PROPERTIES:
  :DATE: <2019-06-04 10:00>
  :END:
* Floss
  :PROPERTIES:
  :DATE: <2019-01-01 7:30 +1d>
  :END:

And I have set up my init.el with

(setq org-agenda-custom-commands
      '(("d" "Day's events"
         ((tags "DATE>=\"<now>\"+DATE<\"<tomorrow>\""
                ((org-agenda-overriding-header "Today's events")))))))

Exepcted output

When I press C-c C-a d (assuming today is June 4, 2019), I expect to see

Today's events
agenda: Receive Nobel prize
agenda: Floss

Actual output

Today's events
agenda: Receive Nobel prize

I think this is because the matcher looks at the date at which the recurring task was defined and does not actually do the math to realize that it's supposed to recur today. My question is, can I force the matcher to somehow do this math? I think this should be easy considering that the day view of the agenda has that information, I just don't know how to go about it.

Aside Please let's not quibble over the fact that "Floss" is not an event but a habit and that I shouldn't be reporting it in my agenda this way: my actual use case has a recurring event where it makes sense for me to report it like this.

A (non-ideal) workaround

One way to overcome this problem is to convert this headline to a TODO item and use the SCHEDULED property instead of the date property. This way, every time you mark the task as DONE (or any other "finished" state), your SCHEDULED property will get updated with the next date and you can match on that quite easily. The problem is, my use case is for an optional recurring event that I may or may not want to attend. I don't want it to appear as a TODO item in my agenda and get automatically carried over to the next day if I don't mark it DONE.


texts: Top-level variables, local variables, variable scoping and the difference between set and setq

texts:
I've been reading about emacs dynamic and lexical bindings. While I generally get the difference between the two types, there is one example that is not clear to me.
I've checked this question and I think I understand why the second example prints nil instead of t (I've read about set and setq when lexical-binding: t
;; -*- lexical-binding: t -*-

(let ((a nil))
  (setq a t)
  (print a))

(let ((a nil))
  (set 'a t)
  (print a))

From the elisp manual I've read that when lexical-binding is in effect set affects the dynamic value of a variable where as setq affects its current lexical value.
However from the following example it looks like (setq a 5) sets the dynamic value of a since later (set 'a t) changes top level a.
;;; -*- lexical-binding: t; -*-
(setq a 5)

(let ((a nil))
  (setq a t)
  (print a)) ;; prints t

(let ((a nil))
  (set 'a t)
  (print a)) ;; prints nil

a ;; prints t (I've expected this to be unchanged i.e. 5)

My question is when lexical-binding is on, what is the binding for the top level variables ?


texts: How does one change a .el file to lisp-interaction mode?

texts: I've looked at the documentation, but I can't seem to figure out how to do it.


texts:
My EMACS (26.3) thinks the line after

for i (`seq 1 10`) echo $i

should be indented.  Is this a bug?


texts:
How can I get with org-store-link relative path instead of absolute?

I tried M-x customize-variable RET org-store-link, but did not work.
Or do I have to customize it anywhere else?


texts: How to open `crontab -e` in emacs terminal editor?

texts:
I am trying to open crontab -e in emacs terminal editor, but it keeps opening it as GUI.
After running crontab -e emacs windows pops up rather than opening it as terminal editor.
$ crontab -e
no crontab for alper - using an empty one
Waiting for Emacs...

I have following setup in my ~/.zshrc, and emacs always opens as terminal editor.
export EDITOR="emacsclient -c"

The way I open files:
FILE=filepath
emacsclient -qut -e '(progn (find-file "'$FILE'"))'


texts: How prettify (newlines and indentation) an optimized HTML/JS file?

texts:
For example, I have the following bunch of characters (HTML): http://pastebin.com/pwTPp8wd

I thought everyone stumbled it upon a processed file, especially when someone would speed up the processing of large HTML/Javascript/whatever file. Then there must be a way to automate the indentation, without applying manual. However, I couldn't find anything about force indentation on a optimized file.

Any thoughts?


texts: `company-ngram` backend error on windows 10

texts:
I am getting this error on windows 10 python 3.8
Emacs 27 and prelude  configuration
Company: backend company-ngram-backend error "Process company-ngram not running" with args (prefix)
I am using this code in .emacs
    (with-eval-after-load 'company-ngram
  ; ~/data/ngram/*.txt are used as data
  (setq company-ngram-data-dir "~/data/ngram")
  ; company-ngram supports python 3 or newer
  (setq company-ngram-python "python3")
  (company-ngram-init)
  (cons 'company-ngram-backend company-backends)
  ; or use `M-x turn-on-company-ngram' and
  ; `M-x turn-off-company-ngram' on individual buffers
  ;
  ; save the cache of candidates
  (run-with-idle-timer 7200 t
                       (lambda ()
                         (company-ngram-command "save_cache")
                         ))
  )

(require 'company-ngram nil t)


texts: How to avoid scrolling with large files hanging for short periods of time? (holding page keys for example)

texts:
Even using default settings (emacs -Q) I've found large C files can be slow to scroll with Emacs.

If for example, I open a large file and hold Page-Down. It will scroll down 1-2 pages, then hang for a second or two, on releasing the document is scrolled many pages down (20 pages or so). *

I know Emacs is capable of less erratic behavior because if I quickly tap page down, it manages to keep up and doesn't hang as before.

Is it possible to have Emacs not attempt to handle multiple events at once, and instead redraw between events?

Or somehow become more responsive instead of hanging while it attempts to process many events?

* The actual slow-down in this case is caused by syntax highlighting, since if I scroll the entire document once, after that all scrolling is fast. I've looked into different options relating to font locking and concluded that the font locking defaults are reasonable and tweaking them doesn't solve the problem, mentioning this since I've already investigated that and don't think it's an important part of this question.


texts: I want to install the following package in spacemacs: https://github.com/clojure-emacs/clj-refactor.el, but when I do this: M-x package-install clj-refactor, I don't see a clj-refactor option in Melpa suggestions. Instead I see a discover-clj-refactor package. Why isn't Melpa showing the cli-refactor package? Do I have to update Melpa or something?


texts: What are the differences mark-ring and global-mark-ring?

texts:
I have just explore how to use mark rings in emacs.

There are two kind of mark type mark-ring and  global-mark-ring.

What are the differences between them and is there any option to push all marks to global to reaching from everywhere?


texts:
Today there was a bug in the package recipe for magit in MELPA. The bug has been fixed but the new package has not yet been built. In the meantime, how can I either

revert to a previous, working version of the package?
manually install the recipe from MELPA's git repo?

Also, how can I avoid being stuck without a working package in future?


texts:
I am able to read gmail in gnus, but, after several hours of trying, am still not able to send gmail via gnus.

I have searched extensively here and elsewhere, and have tried many configurations, including ports 465 and 587. I am using a ~/.authinfo file with application-specific passwords, currently with this configuration. I have gnutls-cli installed.

When I try to send gmail, Emacs reports "Sending via mail..." and then appears to hang/wait for a long time. After a while, focus returns to the draft email. The "trace of SMTP session to smtp.gmail.com" is empty.

Update: Current configuration:

~/.authinfo

machine imap.gmail.com login username@gmail.com password ApplicationSpecificPassword port imaps
machine smtp.gmail.com login username@gmail.com password ApplicationSpecificPassword port 465  ; have tried 587

~/.profile

export EMAIL="username@gmail.com"
export NAME="My Name"
export SMTPSERVER="smtp.gmail.com"

~/.gnus

(setq gnus-select-method
  '(nnimap "gmail"
           (nnimap-address "imap.gmail.com")
           (nnimap-server-port "imaps")
           (nnimap-stream ssl)))

(setq
 send-mail-function 'smtpmail-send-it
 message-send-mail-function 'smtpmail-send-it
 user-mail-address "username@gmail.com"
 smtpmail-starttls-credentials '(("smtp.gmail.com" 465 nil nil)) ; tried 587
 smtpmail-auth-credentials (expand-file-name "~/.authinfo")
 smtpmail-default-smtp-server "smtp.gmail.com"
 smtpmail-smtp-server "smtp.gmail.com"
 smtpmail-smtp-service 465 ; tried 587
 smtpmail-debug-info t ; where is this output?
 starttls-extra-arguments nil
 starttls-gnutls-program "/usr/bin/gnutls-cli" ; executable, correct path
 starttls-extra-arguments nil
 starttls-use-gnutls t
 smtpmail-local-domain "my.dotted.ip.address"
)


texts: Revert-buffer ---> Discard unsaved changes without y/n prompt

texts:
(setq revert-without-query '(".*"))

With this extra line in .emacs file, i have configured emacs to revert buffers without any prompt. It doesn't prompt for clean buffers but when the buffer has unsaved changes, it prompts for confirmation.

So, how to use revert-buffer with absolutely no prompts (no matter if buffer is clean (or) dirty)?


texts:
How to export org-mode text as Stack Exchange's formatted text?

For instance having /Xizzy/ being exported to _Xizzy_ (“Xizzy” between “_”), while exporting equation in latex syntax.

I would rather avoid using HTML.


texts: Emacs package manager shows all melpa packages as "new" each time after restart

texts:
Since some time Emacs started to show each package that comes from "MELPA" repository as "new". It happens after each restart of Emacs.
When I refresh package list in the same Emacs instance it works as expected - shows previously known packages as "available".


texts: ESS - stop move point to end when the buffer is updated

texts: Whenever the R process redirect new output to the process buffer, Emacs move the point to the end of the buffer. This is annoy when user want to check previous commands or output that are outside of the window. How to stop Emacs doing this? Could the solution applied to all the shell process, like python, shell etc?


texts:
Is there a way to make links work in comments?
# Comment with [[link]]

link

Error Message:

edmacro-parse-keys: C-M- must prefix a single character, not up

The link would work only when separated from the comment.
# Comment with
[[link]]

link

Specs:

Org mode version 9.3.1 (9.3.1-elpa @ /Users/satibodhi/.emacs.d/elpa/org-20191230/)
GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109)) of 2019-09-02


texts: "Error running timer `font-latex-jit-lock-force-redisplay'" in LaTeX mode

texts:
Since an upgrade to GNU Emacs 24.4.1, I

Error running timer `font-latex-jit-lock-force-redisplay': (wrong-number-of-arguments (2 . 2) 3) [N times]

where N in my observations ranges from single digits to 240.

C-h f font-latex-jit-lock-force-redisplay says only

Compatibility for Emacsen not offering `jit-lock-force-redisplay'.

Any pointers?


texts: Delete portion of Isearch string that does not match, or last char if complete match

texts:
I have the following

(defun isearch-del-fail-or-char ()
  "Delete failed isearch text, or if there is none, a single character."
  (interactive)
  (if (isearch-fail-pos)
      (delete-region (isearch-fail-pos) (point))
    (isearch-del-char)))

(define-key isearch-mode-map (kbd "DEL") 'isearch-del-fail-or-char)

The purpose of the code is to make delete in isearch delete the entire failed string (or if there is no failed string just a single character).

However, delete-region is deleting text from the buffer isearch is searching in, not the isearch buffer itself.

What is the proper way to do this? Critique on the rest of my emacs lisp style is also welcome :)


texts: How do I make a buffer automatically scroll to its end?

texts: I have a buffer in which the pressed keys echo, and I want the cursor in it always be at the very end. How can I accomplish this?


texts:
I'm running Elementary OS Hera and I downloaded EMACS because Mozart Programming System requires it.
When I try to open EMACS a windows pops up and then it vanishes. Y tried opening it from the Terminal and this is what I get:

$ emacs
X protocol error: BadMatch (invalid parameter attributes) on protocol request 139
When compiled with GTK, Emacs cannot recover from X disconnects.
This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715
For details, see etc/PROBLEMS.
Fatal error 6: Aborted
Backtrace:
emacs[0x50a4de]
emacs[0x4f0ad9]
emacs[0x50a583]
emacs[0x4c0920]
emacs[0x4c4c69]
emacs[0x4c4ceb]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XError+0x11a)[0x7f05f24cd8fa]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x3d82b)[0x7f05f24ca82b]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x3d8d5)[0x7f05f24ca8d5]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XEventsQueued+0x55)[0x7f05f24cb205]
/usr/lib/x86_64-linux-gnu/libX11.so.6(XPending+0x5d)[0x7f05f24bcd3d]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x6809e)[0x7f05f3ce809e]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_prepare+0x1c8)[0x7f05f2c33b28]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4c4fb)[0x7f05f2c344fb]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_pending+0x27)[0x7f05f2c34687]
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_events_pending+0xd)[0x7f05f41a5a9d]
emacs[0x4c1327]
emacs[0x4f7a01]
emacs[0x4f8095]
emacs[0x5b2740]
emacs[0x5b3d48]
emacs[0x5b40d4]
emacs[0x49299a]
emacs[0x499ce5]
emacs[0x5231b3]
emacs[0x563b59]
emacs[0x598413]
emacs[0x565ead]
emacs[0x5639fb]
emacs[0x5669d9]
emacs[0x588cd1]
emacs[0x563b59]
emacs[0x598413]
emacs[0x565ead]
emacs[0x5639fb]
emacs[0x563cfa]
emacs[0x56cf0c]
emacs[0x56d36f]
emacs[0x563b92]
emacs[0x598413]
emacs[0x565ead]
...
Aborted

The link below is a Gnome Bug that seems to be 17 years old. It is closed.
There is no a etc/PROBLEMS file or directory.

I used to run EMACS on Ubuntu 19.10 and I didn't have any problem.

Please let me know if you need any other information or if this is more a GTK error than EMACS.


texts: Is it possible to make yasnippets to expand snippets inside an org-mode babel section in the appropriate mode?

texts:
For example I have an org mode that has the following

#+BEGIN_SRC emacs-lisp

#+END_SRC

Is it possible to configure yasnippets in such a way so all emacs-lisp-mode snippets can be expanded inside that block but not outside it?


texts: How to use org-export to export from a file in emacs

texts:
I hava an input file name like /path/to/orgfiles/file.org

I have an output file name like /path/to/mdfiles/file.md

This two path have been set into two variables:

inputfile  = "/path/to/orgfiles/file.org"

outputfile = "/path/to/mdfiles/file.md"

Now I want to use org-export-to-file from ox.el to export inputfile to outputfile, how?

It seems that org-export-to-file can only export file from the current buffer, I couldn't find any function which can specified the INPUT file :(

I tried org-publish but it seems should be used when project involved, doesn't meet my need too.


texts: When using flycheck, how to permanently disable pylint?

texts:
I'm using Doom Emacs on macOS, if it matters.
Essentially, I'd like to disable the pylint checker entirely when editing Python files. I don't use pylint, and I don't have it installed in my Pyenv environments; it gives me false positives.
But I'm not a skilled Emacs user, and I can't figure out how to disable it. I have this in my config:
(use-package! flycheck
  :config
  (add-to-list 'flycheck-disabled-checkers 'python-pylint)
  (add-hook 'pyhon-mode-local-vars-hook
          (lambda ()
            (when (flycheck-may-enable-checker 'python-flake8)
              (flycheck-select-checker 'python-flake8)))))

But it doesn't seem to matter -- every time I open a Python file, it tries to start up pylint.


texts:
I have Magit installed and it used to work fine. However of late, I am running into the following error when I run magit-status.

Turning on magit-auto-revert-mode...done
run-hooks: Symbol’s function definition is void: closure

I have tried deleting elpa and reinstalling packages from scratch, new versions of Magit has also been released in the meantime, but none of those helped solve the problem. This is what I get with (setq debug-on-error t)

Debugger entered--Lisp error: (void-function closure)
  closure()
  run-hooks(magit-post-display-buffer-hook)
  magit-display-buffer(#<buffer magit: dotemacs>)
  magit-setup-buffer-internal(magit-status-mode nil ((magit-buffer-diff-args ("--no-ext-diff")) (magit-buffer-diff-files nil) (magit-buffer-log-args ("-n256" "--decorate")) (magit-buffer-log-files nil)))
  magit-status-setup-buffer("/home/swarnendu/github/dotemacs/")
  magit-status(nil ((7 . 4) (("/home/swarnendu/github/dotemacs/" . config) . #<hash-table equal 19/65 0x1558fd48cbb1>) (("/home/swarnendu/github/dotemacs/" . magit-toplevel) . "/home/swarnendu/github/dotemacs/") (("/home/swarnendu/github/dotemacs/" "rev-parse" "--show-cdup") . "") (("/home/swarnendu/github/dotemacs/" "rev-parse" "--show-toplevel") . "/home/swarnendu/github/dotemacs")))
  funcall-interactively(magit-status nil ((7 . 4) (("/home/swarnendu/github/dotemacs/" . config) . #<hash-table equal 19/65 0x1558fd48cbb1>) (("/home/swarnendu/github/dotemacs/" . magit-toplevel) . "/home/swarnendu/github/dotemacs/") (("/home/swarnendu/github/dotemacs/" "rev-parse" "--show-cdup") . "") (("/home/swarnendu/github/dotemacs/" "rev-parse" "--show-toplevel") . "/home/swarnendu/github/dotemacs")))
  call-interactively(magit-status nil nil)
  command-execute(magit-status)

I am using GNU Emacs 28.0.50 on Ubuntu 18.04. I get the same error with Emacs 26.3. Please let me know how can I resolve this problem, thanks.


texts: LaTeX pstricks pdf compilation without any specific configuration

texts:
I changed the auctex style file  pstricks.el (from lines 779-784)
(TeX-add-style-hook
"pstricks"
(lambda ()
  (unless (or (member "pst-pdf" TeX-active-styles)
       (eq TeX-engine 'xetex))
-     (TeX-PDF-mode-off)
+   (setq TeX-PDF-from-DVI "Dvips"
+   (message "TeX-PDF-mode : on, TeX-PDF-from-DVI : Dvips"))

My LaTeX files compile gently to pdf using C-c C-a (TeX-command-run-all) whether the tex file use pstricks package or not.
As I am not a real elisp wizard, I wonder if there is a side effect that I missed and that could cause me some future trouble ?


texts: How to export readable HTML links in Org mode?

texts:
When exporting an Org file to HTML all internal links of the form [[link]] are given section indicators of the form X.Y.Z.  This makes sentences in which words have been linked unreadable.

Input

* some
A some is also a [[thing]].
* thing

Output

Exporting the above to HTML (C-c C-e h o) shows the following sentence in HTML: "A some is also a 2."

Desired output

"A some is also a thing."


texts: Can I allow punctuation to run past fill-column?

texts:
In typography, there's a practice called 'protrusion' (or hanging punctuation) that allows certain symbols to hang off the end of the margin:

I'd like to do the same thing for my text documents.

Can I change fill-paragraph (and friends?) to ignore end-of-line punctuation (.?!:;,'"-) when it fills the paragraph?


texts: How can I get holding down the spacebar to work as expected

texts:
When I am editing text, if I press and release the spacebar it works as expected. However, if I hold down the spacebar I get the following message in the echo area.
<Hangul> is undefined
I saw this thread, which suggested that it may be a keyboard layout issue.
setxkbmap -query in my terminal gives me
rules:      evdev
model:      pc105
layout:     us

I'm fairly new to Emacs and not sure what to try here?
I tried this with emacs -Q and the problem persisted. I'm using Emacs 27.1 with Linux Mint 19.2.

Adding some more information based on the comments.
1.) Starting Emacs as env -u XMODIFIERS emacs did not fix the issue.
2.) xev does detect spacebars as expected. Here is an example of the output
KeyPress event, serial 34, synthetic NO, window 0x2e00001,
    root 0x6c4, subw 0x0, time 2814496416, (-585,698), root:(379,718),
    state 0x10, keycode 65 (keysym 0x20, space), same_screen YES,
    XLookupString gives 1 bytes: (20) " "
    XmbLookupString gives 1 bytes: (20) " "
    XFilterEvent returns: False

I noticed that the state goes to 0x0 after hitting numlock. I fired up Emacs and after hitting numlock the spacebar worked properly. However, it seems I need to hit numlock every time I start up Emacs.
I created the following file: xkbcomp $DISPLAY my_keymap.xkb. I found the following lines containing something Hangul related:
 <HNGL> = 130;
key <HNGL> {         [          Hangul ] };

 <HJCV> = 131;
key <HJCV> {         [    Hangul_Hanja ] };

Additionally, here are the modifier maps:
modifier_map Control { <LCTL> };
modifier_map Shift { <LFSH> };
modifier_map Shift { <RTSH> };
modifier_map Mod1 { <LALT> };
modifier_map Lock { <CAPS> };
modifier_map Mod2 { <NMLK> };
modifier_map Mod5 { <LVL3> };
modifier_map Control { <RCTL> };
modifier_map Mod1 { <RALT> };
modifier_map Mod4 { <LWIN> };
modifier_map Mod4 { <RWIN> };
modifier_map Mod5 { <MDSW> };
modifier_map Mod1 { <META> };
modifier_map Mod4 { <SUPR> };
modifier_map Mod4 { <HYPR> };

I'm still not sure why Emacs is reading Hangul anywhere, so I'm still lost. But at least I can hit numlock at the beginning.
3.) C-h k  brings up the following in Emacs:
SPC runs the command evil-forward-char (found in
evil-motion-state-map), which is an interactive compiled Lisp function
in ‘evil-commands.el’.

It is bound to <right>, SPC, l.

(evil-forward-char &optional COUNT CROSSLINES NOERROR)

Move cursor to the right by COUNT characters.
Movement is restricted to the current line unless CROSSLINES is non-nil.
If NOERROR is non-nil, don’t signal an error upon reaching the end
of the line or the buffer; just return nil.


texts: Collapse all #+RESULTS block present in the current buffer

texts:
The problem
Because the output of some commands is pretty big, I need to collapse their corresponding #+RESULTS: block in order to read the important parts (the commands).
The question
Is there any function that collapses all the #+RESULTS blocks present in the current buffer?


texts: Unable to find files with ssh and environment variables

texts:
I have installed exec-path-from-shell as well as included the following in my init.el
(when (memq window-system '(mac ns x))
  (exec-path-from-shell-initialize))

within my ~/.bash_profile I have defined an environment variable called SOLARIS which stores an IP address.
I run the command M-x exec-path-from-shell-copy-env (RET) SOLARIS (RET) to 'import' the environment variable.
But when I run C-x C-f /ssh:user@$SOLARIS: it throws out the error:
Error running timerL (error "In 'Find Files' source: 'helm-find-files-get-candidates'
(user-error \"Not a Tramp file name: \\\"/ssh:user@$SOLARIS:\\\"\")")

When I run the find-file command using the explicit IP address instead of the environment variable, it works fine


texts: Inferior Python shell slow/crash on long lines

texts:
so I've learned that emacs cannot handle multi-line strings very well, for example printing big data structures in inferior python shell (invoked with run-python) is dangerous and usually ends with massive slowdown of whole emacs or crash. To bypass this, I print datastructures by elements and I ran into this odd behaviour:

for i in [('a', 'b') for j in range(150000)]:
    print(i)

No lines involved here, still emacs behaves like they were: massive slowdown, usually crash.

This code is ok (why??):

for i in [(1, 2) for j in range(150000):
    print(i)

BTW: I run emacs with -q, I've tried using alternative python shells (ipython) and I tried buffer-disable-undo.

Thanks for help, I really love the idea of having python shell in emacs and I've invested many hours into research about this, but without any results.


texts: How to change the way org-alert gives notifications

texts:
I noticed that my org-alert and org-wild-notifier both only give notifications down in the bottom buffer which is quite small and hard to see unless I am looking for it. Though on the org-alert GitHub(linked below) they have a screenshot of a notification in the top right hand corner and I can't quite figure out how to set that up. So I was hoping someone on here might have the answer.
https://github.com/spegoraro/org-alert
EDIT:
@NickD helped lead me in the right direction with their answer. It lead me to this email chain(https://www.mail-archive.com/gnu-emacs-sources@gnu.org/msg03921.html) and to this repo(https://github.com/mplscorwin/erc-burnt-toast) which should support notifications through BurntToast on Winodws 10. That being said, the install/setup directions are a bit above my head so I reached out to the maintainer and asked for clarification. I will hopefully update when they respond.


texts: installing Emacs 24.4 from source on CentOS5 with libpng12

texts:
When trying to install the new emacs I'm getting an error about libpng15 being missing:

$ ./configure
...
$ make all
...
/usr/bin/ld: cannot find -lpng15
collect2: ld returned 1 exit status

I have libpng12 installed. How can I make emacs use that library instead?

Below is the configuration output of ./configure.

Configured for `x86_64-unknown-linux-gnu'.

  Where should the build process find the source code?    .
  What compiler should emacs be built with?               gcc -std=gnu99 -g3 -O2
  Should Emacs use the GNU version of malloc?             yes
      (Using Doug Lea's new malloc from the GNU C Library.)
  Should Emacs use a relocating allocator for buffers?    no
  Should Emacs use mmap(2) for buffer allocation?         no
  What window system should Emacs use?                    x11
  What toolkit should Emacs use?                          GTK2
  Where do we find X Windows header files?                Standard dirs
  Where do we find X Windows libraries?                   Standard dirs
  Does Emacs use -lXaw3d?                                 no
  Does Emacs use -lXpm?                                   yes
  Does Emacs use -ljpeg?                                  yes
  Does Emacs use -ltiff?                                  yes
  Does Emacs use a gif library?                           yes -lgif
  Does Emacs use a png library?                           yes -lpng15 -lz -lm
  Does Emacs use -lrsvg-2?                                no
  Does Emacs use imagemagick?                             no
  Does Emacs support sound?                               yes
  Does Emacs use -lgpm?                                   no
  Does Emacs use -ldbus?                                  yes
  Does Emacs use -lgconf?                                 yes
  Does Emacs use GSettings?                               no
  Does Emacs use a file notification library?             yes -lgio (gfile)
  Does Emacs use access control lists?                    no
  Does Emacs use -lselinux?                               yes
  Does Emacs use -lgnutls?                                yes
  Does Emacs use -lxml2?                                  yes
  Does Emacs use -lfreetype?                              yes
  Does Emacs use -lm17n-flt?                              no
  Does Emacs use -lotf?                                   no
  Does Emacs use -lxft?                                   yes
  Does Emacs directly use zlib?                           yes
  Does Emacs use toolkit scroll bars?                     yes

ImageMagick is installed, so I'm not sure why Emacs doesn't see that. But more importantly, Emacs seems to think the libpng15 is available.

And earlier...

checking png.h usability... yes
checking png.h presence... yes
checking for png.h... yes
checking for png_get_channels in -lpng... yes
checking whether png_longjmp is declared... no


texts:
If I start Spacemacs, I don't see the homescreen. I saw it for a while after my first install, so I think it might be something I've changed it my dotfile. However, the only values I found that seem to match the startup screen should be enabled:

dotspacemacs-startup-banner 'official
dotspacemacs-startup-lists '(recents projects)
dotspacemacs-startup-recent-list-size 5

Is there anything else in my dotfile that could be messing with this? I posted my dotfile for reference at https://gist.github.com/JuanCaicedo/9dd65f7c06618ca0b5409f5dcc18215f


texts: Is it possible to attach a local file to org-mode file like PDF?

texts: You can attach a local file such as picture or text file as part of a PDF or doc file, when you send it to other people or copy this file to other computer or place, the attachment will be one part of the PDF or doc file and you can open it even you don't have the attachment in your local disk, I wonder if this is possible when writing org-mode file using Emacs.


texts: Open Dired for an arbitrary set of files

texts:
There is a project with 100 files in a flat directory.
I want to navigate a subset of the files, depending on what part of the project I am working on.
Creating files with links to files of interest would do the job.  For example,
To navigate alphabet files of project, open alphabet.org:

file:fA.cpp
file:fB.cpp
file:fC.cpp

To navigate number files of project, open numbers.org:

file:f1.cpp
file:f2.cpp
file:f3.cpp

Does Dired or Ranger have a similar functionality?

This might be what Lorefnon is describing, but I don't know enough Emacs to understand it:
quote from https://lorefnon.me/2015/11/15/utilities-for-efficient-filesystem-navigation-in-emacs.html

  Dired buffers can be bookmarked just like ordinary buffers and we can
  use bookmark-jump to quickly jump to important Dired buffers opened
  before

I am using Emacs 25.2.1 with Evil Spacemacs and Ivy; but haven't learned Dired or Ranger yet.

UPDATE

I went with Drew's Dired+ and it works well.  It lets you open Dired for an arbitrary set of files.

On Spacemacs, add dired+ to your dotspacemacs-additional-packages list.

From diredp-dired-plus-help:

C-x D A      Add files to a Dired buffer.
             You are prompted for the Dired buffer name and for each file or dir to include.

Usage with Spacemacs:

SPC f c      (spacemacs/copy-file) Write the file under new name.
             Saves Dired buffer to a file.
SPC f s      (save-buffer) Save current buffer in visited file if modified.
             Does not save Dired buffer to file unless it's a visited file.


texts:
Windows 10, Emacs 25.1, Dired+.

I copy file from one folder to another.
Here screens:

After copy I get the next result:

As you can see the bottom buffer is not refresh.
So I need to go to bottom buffer and press g for refresh.

The question is: Is it possible Emacs/Dired+ to autorefresh buffer after copy file?


texts:
Trying to trim off some of the path in the filename in mode-line.
I now get /share/Projects/<project_name>/... trying to trim off the prefix /share/Projects

In my .emacs file:

(setq-default mode-line-format `(
 ,(propertize " Mode: " 'face 'bold)
 ,(propertize "%m " 'face '(:foreground "#fff"))
 ,(propertize " File: " 'face 'bold)
 ,(propertize (s-replace "/share/Projects" "" "%f") 'face '(:underline "red" :foreground "#fff" :height 1))
 ))

Not sure why it's not working, it still prints the full path, if I manually set the "%f" to "/share/Projects/<project_name>" it trims the string down as expected.


texts: How to refile while keeping a copy of the original object in org-mode? In other words refiling works as a cut&paste while I would like to have a copy&paste.


texts: Killing ansi-term says: "... has a running process"

texts:
Whenever I kill an ansi-term buffer I have to confirm due to the fact of:
"ansi-term has a running process; kill it ?", (even if nothing is running btw).

How could I have Emacs killing the term without requiring this confirmation regardless of active processes.

Thanks !


texts: Interactive 'TAGS/PROP/TODO' query limited to particular level of tree?

texts:
I want to do a search where I interactively specify a tag (ideally with counsel-org-tag-style tag completion) and get an agenda buffer listing matching items at a particular level of the hierarchy (level 2).

For example, with this tree:

* spam
** onions :yes:
** artichokes :no:
* eggs :yes:
* ham
** gruyere :yes:
*** raspberries :yes:

I want run some command which prompts me for a tag (ideally using counsel-org-tag).  Say I enter the tag yes.  Then I would like to see the following headings listed in the agenda:

onions
gruyere

How can I achieve that?


texts: Bidi support for Arabic when installing from source?

texts:
Q: how can I get get full bidi support for Arabic when
installing Emacs from source?

I compiled Emacs from source (v. 26.1) and found that
the bidi is not working correctly for Arabic.

The good: I can input Arabic characters in right-to-left form
(correct).

The bad: none of the letters connect (Arabic is a scripted language, and the letters are supposed to connect).  So, for example, the following phrase:

بسم الله الرحمن الرحيم

gets rendered in Emacs (via emacs -Q) as:

I was previously using Emacs v. 25, installed via my distro's
package manager.  I am using the same font as before, which has
good support for Arabic characters.

How can I get full bidi support when installing via source?


texts:
I'm trying to turn a string containing a question mark into the corresponding symbol but:

(intern "foobar?") returns 'foobar\?

How can i do the same thing without the backslash?

Also i'm interested about why foobarp is prefered to foobar? in elisp code


texts:
When I call commands such as helm-apropos and custom Org agendas there is often a noticeable delay between the key sequence and the results presented. How can I speed up these commands to respond instantly to being called? I'm most interested in methods that can be applied to any Emacs commands, but optimizations for helm and org-mode would also be appreciated.

Please note - I am not asking about Emacs startup time. I would be happy for my Emacs startup to take 10x longer if I could make all Emacs commands instant.


texts:
In LaTeX-mode, there is latex-close-block, bound to C-c C-e.

Is there a function to programmatically close an XML tag in nXML-mode?


texts: Scale images to fit the frame width by default?

texts:
When displaying images in Image mode the default seems to be to scale the image to fit completely within the frame.  (Or within the document area of the frame to be more precise.)  I find this inconvenient for images which are much taller than they are wide.

M-x describe-mode shows the command increase-image-size is bound, but many keystrokes may be required to scale the image appropriately. Within image-mode.el I found the command image-transform-fit-to-width which has the effect I want, but it is not bound.  It is defined as follows:

(defun image-transform-fit-to-width ()
  "Fit the current image to the width of the current window.
This command has no effect unless Emacs is compiled with
ImageMagick support."
  (interactive)
  (setq image-transform-resize 'fit-width)
  (image-toggle-display-image))

I could bind this in my init.el of course, and may still do, but I think I'd like to find a way to have the images scaled in this way by default.  Can it be done?


texts: Why did the proced of Emacs not show the process on my win10 system?

texts: My Emacs version is 26.1. The system is Microsoft Windows 10. When I run M-x proced, the buffer does not list the  proced used on the current system. What is this situation?


texts: Headlines with "children" initial visibility reveals drawer names--why?

texts: I would like to see all first-level children of my level 1 headlines when I open an org-mode file. I have assigned property values of :VISIBILITY: children to all my level 1 headlines. When I open the file, why are the :PROPERTIES: and other drawer name lines visible as well? When I use the command show-children on a folded headline, I get the results I'm looking for (i.e., children visible and drawer names hidden). What is going on, and how can I hide the drawer names on startup (initial visibility)?


texts: Cursor skips over backquotes/code blocks in markdown-mode

texts: I use markdown-mode for editing Markdown.  When I'm trying to edit code blocks defined using backquotes (`) or multiple backquotes, my cursor skips over the backquotes, making it hard for me to edit them.  It didn't always behave this way.  How do I get the old behavior back, where there's nothing special about cursor movement around backquotes?  (Or anywhere else.)


texts: Copy and paste with mouse breaks Umlaute

texts: After upgrading to emacs 24 I have strange problems with copy and paste. I managed to reinstall copy and paste with the mouse but there remains the problem with German diacritic characters. If I copy an Umalut äöü and insert it using the mouse (middle button) I get unicode stuff that cannot be saved \344\366 and so on. Is there a way to fix this?


texts:
I want to set shortcuts for the following functions: python-indent-shift-left and python-indent-shift-right. I can do the following and it works.
(bind-keys :package python :map python-mode-map
           ("C-c <" . python-indent-shift-left)
           ("C-c >" . python-indent-shift-right))

I would like to use the following to be consistent with other editors, but [ is treated as a meta character, so I am unable to use it properly.
(bind-keys :package python :map python-mode-map
           ("C-\[" . python-indent-shift-left)
           ("C-]"  . python-indent-shift-right))

Am I doing something wrong in the setup, or is this difficult to achieve?


texts:
My elpy package tells me that it can not find the command "flake8" on a Windows 10 machine.
Ok, it make a bit sense to me. By default there is no flake8 on Windows 10 installed. I was not aware that elpy uses extern commands for syntax checkig of pyton code.
However "flake8" was not automaticly installed by using melpas elpy package. What is the appropriate way to "install" flake8 on a Windows 10? There is no "flake8" on melpa.


texts: How to open all buffers in the same window and never create new one?

texts: I'm using emacs in terminal via emacs-nox and I wish to sort of disable windows functionality at all. I mean I do not want each time to add some buffer to use  display-buffer-same-window function, I wish emacs to not create windows never at all, and use only the same one window that was created at startup. How can I do that, maybe I should rewrite view-buffer-other-window?


texts: magit: The work for five tasks are mixed in my working directory

texts:
So during a hectic coding session, I forgot to do git commit as I did baby steps. Now I have fifty changes in my working directory. And these changes are related to five separate tasks. So I would like to put each change/hunk in to one of five commit messages.

I have the five commit messages noted down in my notepad.

Does magit make this easy? How do I go about doing this with magit? An ideal workflow would be, I am presented each hunk, and I choose which existing commit or new commit message it should be "filed" under.


texts: How to debug "company backend" initialization problems?

texts:
I am getting error messages initializing some company backend packages, but messages only appear in the *Messages* buffer, like:

Company backend 'company-web' could not be initialized:
Symbol's function definition is void: company-web
Company backend 'company-quickhelp' could not be initialized:
Symbol's function definition is void: company-quickhelp
Company backend 'company-php' could not be initialized:
Symbol's function definition is void: company-php

I can't find a way to spot the problem, my current .emacs relevant code is:

(use-package company-web)
(use-package company-quickhelp)
(use-package company-php)
(use-package company
  :bind (("C-?" . company-complete))
  :config
  (global-company-mode t)
  (add-to-list 'company-backends 'company-php)
  (add-to-list 'company-backends 'company-quickhelp)
  (add-to-list 'company-backends 'company-web)
  )

Notes

Using use-package)
--debug-init doesn't show anything

Update: Fixed company-php and company-web but not company-quickhelp

Fix company-php and company-web:

(use-package company-web
  :config
  (require 'company-web-html))
(use-package company
  :bind (("C-?" . company-complete))
  :config
  (global-company-mode t)
  (add-to-list 'company-backends 'company-web-html) ;; changed from company-web
  (add-to-list 'company-backends 'company-ac-php-backend)
  )

company-quickhelp still shows the error in *Messages* with:

(use-package company-quickhelp
  :config
  (company-quickhelp-mode 1))


texts: Hit a wall setting up company-irony with weird project structure/build system

texts:
Overview

I working on an OS project. It only uses header-files provided by the project code-base. The CMake meta-build, and ninja build system seems to be unrecognized by compilation and code-completion system out-of-the box. I've solved the syntax-checker, and I provide the solution for context.

For code-completion, it's working in parts. I think it's running on company-etags, which gets the function names, but not the rest of the signature. I'm after a solution that can include the arg-types in the code-completion.

Suspected cause: file structure confusing the company backend

Extract of the code-base structure. . is the repository root.
The

.
├── build
│   ├── build.ninja
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   ├── rules.ninja
│   ├── projects
│   │   ├── ...

    ...
    ...
├── CMakeLists.txt -> tools/seL4/cmake-tool/default-CMakeLists.txt
├── init-build.sh -> projects/aos/init-build.sh
├── .gitignore -> projects/aos/.gitignore
├── projects
│   ├── aos <- all development happens in here.
│   │   ├── CMakeLists.txt
│   │   ├── .gitignore
│   │   ├── compile_commands.json
│   │   ├── init-build.sh
│   │   ├── CMakeLists.txt
        ...
│   │   ├── some-aos-proj-lib
│   │   │   ├── CMakeLists.txt
│   │   │   ├── include
│   │   │   │   └── aos
│   │   │   │       ├── some-lib-file.h
│   │   │   │       ├── another-lib-file.h
│   │   │   └── src
│   │   │       ├── irq.h <- location of one func sig that completion needs
│   │   │       ├── ...
│   ├── some-lib <- the sub-dirs of libs at this level
│   │   ├── ... <- contain a bunch of .h files needed for code completion
│   ├── another-lib
│   │   ├── ...
        ...
...

initially /build is empty. To build the project:

$ cd build
$ ../init-build.sh
$ ninja

Problem

I've solved the compile-time problem of the header-file resolution of the default M-x projectile-project-compile (<.h> and ".h"), but code completion is still name only (seems to be running on an etags backend.

  ;; runs a ninja build from the path in .build-dir
  (projectile-register-project-type 'ninja '(".build-dir")
                                    :compile "ninja -C `cat .build-dir`")

NOTE: .build-dir has the single line /full/path/to/build, so ninja happens in /build

Stuck!

So now we come to where I'm stuck: code-completion.

In trying to solve this code-completion problem, this is what I've learned

company needs a backend.
The irony backend can work with a compilation database (cdb)
The ninja build system can generate the cdb for irony
There is some sort of mechanism forcompany-irony to use a cdb for completion.

referencing this question, we get to see a hint at what to do. Because this project I'm working on is structured differently, I'm not so sure about where my project root, and what paths to add to compile-command, as far as company is concerned.


texts: Flycheck and syntax tables: erroneous behavior I'm unsure how to fix

texts:
In the course of writing a Flycheck checker for ten-hundred-mode's new (and as yet inchoate) permissive mode, I noticed that the checker's overlay behavior was influenced by the currently active syntax table in a way that didn't work out well for my purposes.

Consider the following text:

  Now they've done it.

"They've" is not one of the thousand most commonly used words, and my checker will report it as an error at line 1, column 5.

In text-mode, or a major mode which uses a syntax table derived from text-mode-syntax-table, Flycheck will overlay as follows:

  Now they've done it.

This is, of course, the correct behavior.

In a mode whose syntax table doesn't derive from text-mode's, though -- notably, any programming mode -- Flycheck instead does this:

  Now they've done it.

This appears to occur because ' is a word-constituent character in text-mode-syntax-table and its derivatives, but not in the syntax tables of programming modes. I'm not certain why this affects overlay positioning, but my surmise is that Flycheck's method of inferring where a given overlay should end makes use of syntax classes. In any case, it's trivial to produce both correct and incorrect behavior by switching the syntax table or major mode.

(Since "they" is a permissible word, it's reasonable to suspect that the problem here lies with the checker's matching behavior, and not with Flycheck's overlaying behavior. Indeed, that was my initial suspicion, and I spent a couple of hours looking for a bug in my own code and not finding it, before being reluctantly forced to the conclusion that the problem lay elsewhere.)

Since my checker code only controls what problems are reported to Flycheck, and not how Flycheck chooses to overlay them, I'm somewhat at a loss for how to proceed here. In private code I could advise flycheck-error-region-for-mode to conditionally wrap it in with-syntax-table, or something like that, but this is a publicly distributed module, so advice is off the table. Unfortunately, I'm not seeing any other way to get the behavior I need.

Can someone with more knowledge of Flycheck's internals suggest a way in which I can produce correct overlay behavior regardless of the currently active syntax table?


texts: Org-babel noweb expansion when sending C-c ' buffer to python shell

texts:
I'm doing literate programming with Python. In my workflow I like to test the block with python-shell-send-buffer and ipdb debugger. However if the block contains a noweb reference then the code is not expanded when sent to the shell and causes syntax error.

Alternatively I can C-c C-c C-v (org-babel-expand-src-block) and get a read-only version of the buffer with noweb expanded and send this instead. This is not great for interactive work though.

Can I cause python-shell-send-buffer to call org-babel-expand-src-block beforehand, and maintain the noweb references in the C-c ' edit buffer?


texts:
I have the following code blocks:
Block 1 is just one line. This is a MWE. In reality, I have several lines in block 1.
#+name: block1
#+begin_src python :noweb no :exports none
print("Block 1")
#+end_src

Block 2 has also been reduced for the sake of MWE.
#+name: block2
#+begin_src python :noweb no :exports none
<<block1>>
print("Block 2")
#+end_src

This shows a skeleton of myfunc. I want to include this skeleton to give an overview of myfunc.
#+name: block3
#+begin_src python :noweb no :exports code
def myfunc(x):
    <<block2>>
#+end_src

Finally, this shows the full specification of myfunc.
#+begin_src python :noweb yes :exports code
<<block3>>
#+end_src

What I expect it to look like when exported
def myfunc(x):
    print("Block 1")
    print("Block 2")

What it actually looks like
def myfunc(x):
    <<block1>>
    print("Block 2")

How can I get the nested blocks to expand completely when I use :noweb yes?


texts:
How can I determine the width of an image of the imagemagick type?

I am inserting an image into a buffer, whose size is (initally)
completely unknown to me. I do it more or less like this:

(insert-image (create-image image-data 'imagemagick t))

However, sometimes the image is huge, so I need to limit its size like this:

(insert-image (create-image image-data 'imagemagick t :width 200))

The problem is, sometimes the image is small, and forcing it to have
width 200 is very undesirable. So I would like to check the width of
the image, and do something like this:

(let ((image (create-image image-data 'imagemagick t)))
  (if (> (image-width image) 200)
      (append image '(:width 200))
    image))

but I don't know how to get the width of an image in order to make
this check. Is there anything similar to a image-width function?


texts: I have a problem with the magit-item-highlight in different themes. With monokai, zenburn, etc., the item highlight is a background, and does not interfere with green and red diff faces. However, with the default theme, it inherits the face from secondary-selection and overrides the red and green colouring of diffs. The interim solution would be just to customise this to empty face, but how can I actually fix it?


texts:
I'm having an issue with highlighting in Org agenda:

Can't make the link and tags Gray when the item is marked as Done. I've tried to play with different properties of the font-lock definition, but nothing helped. Currently I'm using the foll

`(org-agenda-done      ((,class (:strike-through t :italic t :foreground ,comment))))
`(org-todo             ((,class (:foreground ,red))))
`(org-done             ((,class (:foreground ,green))))
`(org-link             ((,class (:underline t :foreground ,type))))
`(org-tag              ((,class (:foreground ,red))))

I'm not sure if it's the problem with my config or the way Org highlights these items?


texts: How can I simulate an arbitary key event from Elisp?

texts:
Is it possible to simulate an arbitrary key event from elisp?  I am aware of ways that I can find the binding for a given key, and then call that command interactively, but what if that key event is not bound to a command?

As one example, what if I wanted to bind C-` to behave the same as the ESC key in all contexts?


texts: SBCL and Slime do strange things when I try to use Serapeum

texts:
I'm getting very strange behaviour when I try to C-c C-k the following code into the SLIME REPL running SBCL:

(eval-when (:compile-toplevel :load-toplevel :execute)
  (ql:quickload "serapeum"))

(defpackage #:foo
  (:use #:cl #:serapeum)) ;no symbols to export currently

(in-package #:foo)

The operation fails, and SLIME spews the following into my face:

    failed AVER: (NULL CURRENT)
This is probably a bug in SBCL itself. (Alternatively, SBCL
might have been corrupted by bad user code, e.g. by an undefined
Lisp operation like (FMAKUNBOUND 'COMPILE), or by stray pointers
from alien code or from unsafe Lisp code; or there might be a
bug in the OS or hardware that SBCL is running on.) If it seems
to be a bug in SBCL itself, the maintainers would like to know
about it. Bug reports are welcome on the SBCL mailing lists,
which you can find at <http://sbcl.sourceforge.net/>.
    [Condition of type SB-INT:BUG]

Backtrace:
  0: (SB-C:COMPILER-ERROR SB-C::INPUT-ERROR-IN-LOAD :CONDITION #<SB-INT:SIMPLE-FILE-ERROR "~@<~?: ~2I~_~A~:>" {1004F4CAD3}> :POSITION 0 :STREAM #<SB-SYS:FD-STREAM for "file /home/koz/quicklisp/dists/quickl..
  1: (SB-C::READ-FOR-COMPILE-FILE #<SB-SYS:FD-STREAM for "file /home/koz/quicklisp/dists/quicklisp/software/split-sequence-1.1/split-sequence.asd" {1004EEABD3}> 0 SB-C::INPUT-ERROR-IN-LOAD)
  2: (SB-INT:LOAD-AS-SOURCE #<SB-SYS:FD-STREAM for "file /home/koz/quicklisp/dists/quicklisp/software/split-sequence-1.1/split-sequence.asd" {1004EEABD3}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
  3: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-SYS:FD-STREAM for "file /home/koz/quicklisp/dists/quicklisp/software/split-sequence-1.1/split-sequence.asd" {1004EEABD3}> NIL)
  4: (LOAD #P"/home/koz/quicklisp/dists/quicklisp/software/split-sequence-1.1/split-sequence.asd" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :UTF-8)
  5: (UIOP/UTILITY:CALL-WITH-MUFFLED-CONDITIONS #<CLOSURE (LAMBDA NIL :IN UIOP/LISP-BUILD:LOAD*) {1004EE584B}> ("Overwriting already existing readtable ~S." #(#:FINALIZERS-OFF-WARNING :ASDF-FINALIZERS)))

...and so on for ages and ages. I've checked and this does not happen if I just load it into SBCL using sbcl --load on the file that contains this code. Basically, what the actual hell is going on, and how can I make it not do that?


texts: Command that formats (prettifies) Elisp code

texts:
Let's say I have a function that looks like the following (as is often the case
when printing elisp output).

(defun my-example-function () (let ((a (do-something)) (b (do-something))) (setq someone me) (with-current-buffer b (do-that (or this (and that those))) (format "%s" a))))

I would like a command that can turn that into something a human would write, such as the following.

(defun my-example-function ()
  (let ((a (do-something))
        (b (do-something)))
    (setq someone me)
    (with-current-buffer b
      (do-that (or this (and that those)))
      (format "%s" a))))

I understand that there's more than one way to format a piece of elisp
code, and different human beings do it differently. Furthermore, I understand it's somewhat subjective. But it should be
fairly easy to come up with a set of rules that results in code that
is at least decent.

I actually tought of doing this myself a while ago, but I figured it's
better to ask before I reinvent the wheel.

Note, I'm aware of the pp function, but it doesn't quite get there:

(defun my-example-function nil
  (let
      ((a
        (do-something))
       (b
        (do-something)))
    (setq someone me)
    (with-current-buffer b
      (do-that
       (or this
           (and that those)))
      (format "%s" a))))


texts: Can emacs on Mac using native window system connect to an emacs server on a Linux system

texts:
At this point I believe I am using the emacs version on my Mac that is built by Homebrew and the "stock" emacs on Ubuntu 18.04.

I set up emacs server on the Ubuntu host as it is described in Starting Emacs Daemon with systemd and connect to it using emacsclient as described.  This all works fine.

I also use emacs on my Mac with tramp to access the file systems on the Ubuntu host.  And this works fine too.  Even magit works which is rather spectacular.

The main reason for the emacs in daemon mode on the Ubuntu host is to replace tmux so if the connection drops, the shell process continues and I can later view the *shell* buffer.

Is there a way for me to view and interact with the *shell* buffer from the emacs on my Mac?

The ultimate goal here is to have just one emacs on my Mac and the ability to start and run commands on the remote Ubuntu system in such a way that if the connection drops, the remote commands continue to run and I can later connect and view the output like tmux, screen, or emacs in daemon mode can do.


texts: How to use fringe indicators to display register positions?

texts:
I know that i can use customize register-marker-face to make position-registers location visible, - is there is a way to mark resisters position using left fringe?

Also, I am using "Mitsuharu Yamamoto's Mac port " on Mac , see emacswiki.org/emacs/EmacsForMacOS#toc3


texts:
M-x ispell works fine for English. However, when I try to change the dictionary, I run into difficulties.
I did M-x ispell-change-dictionary and selected one of the options (francais) from the list presented.
Then when I try to use M-x ispell, I get the following message:
ispell-init-process: Can't open affix or dictionary files for dictionary named "fr_FR".

I have the same problem when I select any language option other than british or american.
I am using emacs on Fedora 33. How do I get ispell to work for other languages than English?


texts:
I have a few custom bash functions that are defined is some file and are made available to me in regular terminals via the line

. "/path/Custom Bash Functions.sh"

in my ~/.bashrc. However, Emacs does not recognize them.

I don't really care whether they are available in any terminal emulator inside Emacs. I only care about them working when I hit M-!.

This answer suggests setting shell-command-switch to "-ic" (adding switch i to the default). However, all this seemingly results in is that the output of all commands I execute via M-! are preceded by:

bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

I still can't execute custom bash functions. Auto-complete for them doesn't work either.

Maybe this is because I use a newer version. I use the latest version on the master branch of Emacs' git repo (pulled the latest changes and installed them less than 2 hours ago).


texts:
Is there a way I can find what file handles emacs has open, and close these references? Or even better, find where they are being open?

Emacs is keeping handles to a large number of files (a leak) that I don't have corresponding buffers to. My standard method of closing a buffer has been using the kill-buffer command.

Context:

I am having a reoccurring issue, where after a day or two of being open I can no longer do any file operations in emacs, due to a "Too many open files" error when creating a pipe. I am on OSX 10.10.4, Emacs 25.0.50 installed with homebrew.

Here is a sample of emacs' open files according to Activity Monitor (double click on emacs and select "Open Files and Ports").

/Users/Ash/Dropbox/org
/Users/Ash/Dropbox/org
/Users/Ash/Dropbox/org
/Users/Ash/Dropbox/org
/Users/Ash/Documents/workspace/roboclub/Federation-Place
/Users/Ash/Documents/workspace/roboclub/Federation-Place
/Users/Ash/Documents/workspace/roboclub/Federation-Place
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status
/Users/Ash/Dropbox/org
/Users/Ash/Dropbox/org
/Users/Ash/Dropbox/org
/Users/Ash/Dropbox/org
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status
/Users/Ash/Documents/workspace/roboclub/Federation-Place
/Users/Ash/Documents/workspace/roboclub/Federation-Place
/Users/Ash/Documents/workspace/roboclub/Federation-Place
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript
/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript

There are actually many more files open, but you can see that they are being repeated. (Also these are folders, not sure why that is).

Update

The following are my file limits:

$ ulimit -n
4096
$ sysctl -a | grep files
kern.maxfiles: 20480
kern.maxfilesperproc: 10240
kern.num_files: 4496

And my open files:

$ lsof | awk '{print $1 "-" $2}' | sort | uniq -c | sort -nr | head -10
 728 Google-345
 508 Google-551
 430 Mail-353
 418 Skype-12098
 356 Dock-361
 350 Emacs-8847
 207 Dropbox-637
 176 Google-22455
 176 Google-21229
 165 Google-26072

Emacs is the only program having issues, yet doesn't seem to have a comparatively high file count.


texts: how to parameterize prompt for interactive/command?

texts:
background

I had elisp code (in this very small git repo) like

(defun bulk-replace-file (filepath)
  (interactive "FPath to file to bulk-replace: ")
  (bulk-replace-file-non-interactive filepath)
)

That worked. Then I decided to parameterize the prompt, producing code like

(defconst BULK-REPLACE-FILEPATH-PROMPT "Path to file to bulk-replace: ")

(defun bulk-replace-file (filepath)
;  (interactive "FPath to file to bulk-replace: ") ; should always work
  (interactive (concat "F" BULK-REPLACE-FILEPATH-PROMPT))
  (bulk-replace-file-non-interactive filepath)
)

However that fails with (in *Messages*)

command-execute: Wrong type argument: listp, "FPath to file to bulk-replace: "

Which frankly stuns me, esp since I'm positive this code formerly worked, but that's why one does regression testing :-(.

questions

How is (interactive) getting a list from "FPath to file to bulk-replace: ", given that the latter surely looks like a string? Am I missing something?
Why is (interactive) not getting a list from (concat "F" BULK-REPLACE-FILEPATH-PROMPT), given that

(concat "F" BULK-REPLACE-FILEPATH-PROMPT) returns a string (I have checked with (type-of))
(concat "F" BULK-REPLACE-FILEPATH-PROMPT) == "FPath to file to bulk-replace: " (per the error message above)
(interactive "FPath to file to bulk-replace: ") works (see first code snippet)

What's "the right way" to parameterize a prompt used for (interactive)?

über-answer

Given that, as Drew points out, (interactive) is quite demanding, an easier (and working) way to achieve the desired functionality avoids prompting via (interactive):

(defconst BULK-REPLACE-FILEPATH-PROMPT "Path to file to bulk-replace: ")

(defun bulk-replace-file ()
  (interactive) ; Purely to enable `M-x`: let `read-file-name` get the filepath
  (bulk-replace-file-non-interactive
    (read-file-name BULK-REPLACE-FILEPATH-PROMPT)))
)


texts: yasnippet: how to expand a snippet from a string and have the fields recognized?

texts:
Q: how do I get yasnippet to expand a text string correctly (recognizing snippet fields) from inside elisp code?

A very simple snippet is a just a string of characters with some control characters intermingled.  We can also use elisp forms to create richer snippets, but it's not clear to me how to expand them appropriately.

Here's a simple example that captures the problem.  I'm creating an org-mode snippet to insert a link skeleton, which looks like [[source][description]].  The following simple snippet produces the desired behavior of "start in the source field, end up in the description field":

[[$1][$0]]

We can intermingle elisp code in snippets (wrapped in `s).  I would have thought that the following would produce exactly the same behavior as the simpler version, because the if will simply evaluate to [[$1][$0]] as a string:

`(if t "[[$1][$0]]")`

It does not do so, however.  Instead, it acts as if the $0 and $1 fields are not fields, ends the snippet, and places point after the final ].  So: how does one get the desired behavior when an elisp form evaluates to a text string with yasnippet fields embedded in that string?

EDIT: as requested, here's the particular use-case that inspired the question.  If the X clipboard contains a url link, I'd like it to populate the source field in the org link ([[source][description]]) and leave me in the destination field.  It uses a helper function (dan-xclipboard-link-p) which returns the url if it exists, or else nil.  It seems to me that I should be able to do something like this:

`(let ((link (dan-xclipboard-link-p)))
   (if link
       (concat "[[" link "][$0]]")
     "[[$1][$0]]"))`

In fact, with an earlier version of yasnippet, a version of this code worked as I intended it.

EDIT 2: Interestingly enough, this snippet works when there is a link on the X clipboard, but fails when not (ie, it doesn't recognize $1 as a field:

[[`(or (dan-xclipboard-link-p) "$1")`][$0]]


texts: How to make dired-do-async-shell-command wait for all sub processes to finish

texts:
I'm trying to run the bash script, ~/bin/xlda, ...

#!/bin/sh
# ~/bin/xlda

old_filename="$1"
new_filename=`echo $old_filename | sed 's/\(.*\.\)flac/\1m4a/'`

~/bin/xld -f alac -o "$new_filename" "$old_filename"

new_md5=`~/bin/xld --stdout "$new_filename" | md5`
old_md5=`~/bin/xld --stdout "$old_filename" | md5`

if [ "$new_md5" == "$old_md5" ]
then
    echo "new file md5 $new_md5"
fi

...on files in a find-name-dired buffer using dired-do-async-shell-command in this function

(defun my-dired-files-to-alac ()
  (interactive)
    (dired-do-async-shell-command "~/bin/xlda" current-prefix-arg
     (dired-get-marked-files t current-prefix-arg)))

The xld processes all finish but the md5 is only echo'd for the first shell script to get there. If I run the shell command that emacs runs in a terminal, i.e. ~/bin/xlda folder/file.flac&~/bin/xlda folder/file2.flac then all the md5s are echo'd as expected.

Ultimately, I will rm the old file if the md5s match. Even if the script is simply...

#!/bin/sh
# ~/bin/xlda

old_filename="$1"
new_filename=`echo $old_filename | sed 's/\(.*\.\)flac/\1m4a/'`

~/bin/xld -f alac -o "$new_filename" "$old_filename" && rm "$old_filename"

...it still fails to delete all but one of the *.flac files.

The problem is that emacs seems to exit all shell sub processes when the first shell sub process to finish finishes.


texts:
If I'm in eshell I can run elisp commands cause I'm in an elisp runtime

(mapcar (lambda (x) (* x 3)) (list 1 2 3))
(3 6 9)

I can also run "shell" commands such as git status. But what if I wanted to take the output of my git status and pass it into a mapcar. How would I do that?


texts: See LaTeX code and math preview at the same time with preview-latex

texts:
With AUCTeX and preview-latex, I can see the preview of math equations with C-c C-p C-p. But I can't see its LaTeX code.

I wonder how can I see both the code and preview of math equations at the same time, for WYSIWYG editing?


texts: Unclear error message from a function call in my init file

texts:
With my Emacs 26.1 on my 10.13.6 Mac, I want Emacs to systemically open my file located at /Users/ewandelanoy/Documents/html_files/Printable/latinized_agreda2.txt  with the mac-roman-mac encoding, without changing Emacs' normal behavior on other files.

Following the advice given in this answer, I added the line (modify-coding-system-alist "/Users/ewandelanoy/Documents/html_files/Printable/latinized_agreda2.txt" 'mac-roman-mac) to my init.el file, but it seems that this is incorrect since when I restart emacs I get the following (somewhat unclear) error message :

Warning (initialization): An error occurred while loading ‘/Users/ewandelanoy/.emacs.d/init.el’:

Wrong number of arguments: #[(target-type regexp coding-system) \306>\204�\307\310"\210 ;\204 �\311=\203�   \250\204 �\307\312  "\210
9\2036�\313
!\204@�\314
!\210
\211B\202@�\314
@!\210\314
A!\210\315\267\202v�\316    "\211\203U�
\241\202\�
BB\211)\207\316
"\211\203m�
\241\202t�
B
B\211)\207\316  "\211\203\206�
\241\202\217�
BB\211)\207 [target-type regexp coding-system file-coding-system-alist slot process-coding-system-alist (file process network) error Invalid target type: %s network Invalid regular expression: %s fboundp check-coding-system #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (file 70 process 94)) assoc network-coding-system-alist] 4 2267173], 2

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

When I start Emacs with the --debug-init option as advised, I get the following error message :

Debugger entered--Lisp error: (void-function global-linum-mode)
  (global-linum-mode t)
  eval-buffer(#<buffer  *load*<2>> nil "/Users/ewandelanoy/Documents/Bash_scripts/init.el" nil t)  ; Reading at buffer posit$
  load-with-code-conversion("/Users/ewandelanoy/Documents/Bash_scripts/init.el" "/Users/ewandelanoy/Documents/Bash_scripts/i$
  load("~/Documents/Bash_scripts/init.el")
  eval-buffer(#<buffer  *load*> nil "/Users/ewandelanoy/.emacs.d/init.el" nil t)  ; Reading at buffer position 42
  load-with-code-conversion("/Users/ewandelanoy/.emacs.d/init.el" "/Users/ewandelanoy/.emacs.d/init.el" t t)
  load("/Users/ewandelanoy/.emacs.d/init" t t)
  #[nil "^H\205\276^@   \306=\203^Q^@\307^H\310Q\202A^@ \311=\2033^@\312\307\313\314#\203#^@\315\202A^@\312\307\313\316#\203$
  command-line()
  normal-top-level()

The second error message is not really any clearer than the first. What did I do wrong ?


texts: Define setupfile in emacs init for org file

texts:
I use setupfile to export org file to pdf. It basically define latex header and footer (my letterhead template).  I include it in every org document like this
 #+SETUPFILE: c:/SETUPFILE

Though there is not much issue with this practice, but is it possible to define it in init to be automatically included in all org files for export


texts: (Evil) "General" leader key (SPC) not working in some modes (dired, *Messages*)

texts:
I use Evil, and I'm using the General package to set my custom keybindings. I'm using SPC as a leader key. The trouble is, I find that SPC is not interpreted as my leader key in some modes, namely dired, and also in the *Messages* buffer. I can't seem to figure out how to get it to work.

I've defined my leader key like this:

(general-define-key
 :states 'motion
 :prefix "SPC"
 ; Bindings under the leader key defined here...

Adding keymaps: 'dired-mode-map doesn't seem to work, which is odd, because C-h k SPC in dired mode shows SPC runs the command dired-next-line (found in dired-mode-map)...

Does anyone know how to define my SPC leader key such that it will be effective in all modes?

Thanks!


texts: Evil, How do I display visual range in mode-line

texts: I'd like to see the size (number of rows and/or columns) of the visual selection in my mode-line. I use evil. How do I do that?


texts: problem when setting org-confirm-babel-evaluate to nil

texts:
apple: 10.13.4

emacs: 25.3 (9)

Org-mode version 8.2.10

python3.5

As I have a bunch of harmless python blocks in an org mode file for a report,
and did not want to keep pressing "y" every time that org mode asks if I want to execute the block. So I resorted to (setq org-confirm-babel-evaluate nil) .
I realize that (setq org-confirm-babel-evaluate nil) may not be the best
thing to do, but in some cases it can be helpful.

Anyways, this caused most of the python matplotlib plots that are made in the python blocks code to not insert in the pdf document.
I am guessing that it maybe because the pdf file did not "have the time" to update with the plots through LaTeX. However, even when slowing down my code, I could only get a few of these plots to insert.

Would any one have the same issue and have a lead on how to get around that?

Example:

* making plots using matplotlib
** set-up

#+BEGIN_SRC python :session :exports results
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from os import getcwd

'current working directory: {0}'.format(getcwd())
#+END_SRC

**  Let's see if $y = sin(x)$ plot shows

#+BEGIN_SRC python :session :exports none
x = np.arange(-2*np.pi, 2*np.pi, 0.01 )
y = np.sin(x)
plt.figure(figsize=(4, 4))
plt.plot(x, y, label='sin(x)')
plt.title('sine plot')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.savefig('/Users/cybu/Desktop/test/sine.pdf')
#+END_SRC

#+BEGIN_SRC python :session :exports results :results file
'sine.pdf'
#+END_SRC

**  Let's see if $y = cos(x)$ plot shows

#+BEGIN_SRC python :session :exports none
y = np.cos(x)
plt.figure(figsize=(4, 4))
plt.plot(x, y, label='cos(x)')
plt.title('cosine plot')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.savefig('/Users/cybu/Desktop/test/cosine.pdf')
#+END_SRC

#+BEGIN_SRC python :session :exports results :results file
'cosine.pdf'
#+END_SRC


texts:
key-translation-map allows you to globally translate keys.

For example:

(define-key key-translation-map (kbd "<f11>") (kbd "<f12>"))

But what if I want to restrict the remapping to a particular major mode?

In my case, I keep typing ` instead of ~ in org-mode and I would like to remap it so I can make my mistake without noticing. Is this possible?


texts:
I'm not sure whether anyone has ever implemented what I'm looking for, but maybe I'm just using the wrong terms to search for it.

What I want to achieve is essentially a reverse copy and paste:

I'm in Buffer A, Position X
Hit "paste" (to mark where I want to paste stuff without actually pasting stuff)
Go to Buffer B, Position Y
Hit "copy"
Emacs jumps back to Buffer A, Position X and pastes whatever I copied before

I feel like this would a much quicker workflow than traditional copy-and-paste (where I have to manually jump back to where I was, especially if I have to look through a hand full of files before finding what I want to paste).

Is there a package for that? If not, whats a good starting point for my own macro?

Bonus points if it integrates nicely with the system clipboard or if there's a generic solution for Linux.


texts:
I recently started using gnus to view my emails. Opening attachments is still the most annoying part for me and I am trying to address that.

The behaviour I would like is: If the attachment is text-based then open in an emacs buffer in the same instance I am using, otherwise open using the system's xdg-open.

According to
emacswiki, I created a file ~/.mailcap with the single line

    application/*; xdg-open %s

But then this line is just added to the application list in /etc/mailcap, which I have no control over, and I have to select xdg-open in the list that is shown to me every time I try to open an attachment. How can I prevent gnus from reading that file and instead directly open an attachment with xdg-open?

Also, how do I get text files to open in a buffer?

Finally, is there a way to open the attachment without going all the way to the file name in the email? Perhaps by showing a list of attachment and letting me choose one of them?


texts: Emacs beginner. Need basic script for copying files

texts:
if anyone can help me that would be much appreciated. I may be in the wrong place for this but it's a major roadblock for my research.

I have a folder with about 1700 folders. I have a list of numbers in excel which correlates to a subset of these folders which I am interested in (about 1300). The folder labels contain(but are not the same as) these numbers from excel. I need to copy 1 out of the 2 files in each folder(out of the 1700). The file I need to copy contains a unique ending _dc_brain_FA.nii (compared to the other file in each folder). I would like to copy these files into a single folder containing the 1300 or so _dc_brain_FA.nii* files.


texts: Keep point position between re-opening files with recentf/ido

texts:
It's hard to say what was broken in my .emacs but with new Emacs 25.1.1 after opening file from recentf point is placed at the beginning of buffer whereas with Emacs 24 it opens in last viewed location.

Any suggestion to make Emacs 25 place point in last viewed position between file re-opening?

So this: http://hg.defun.work/dot-emacs/file/tip/.emacs-my work in Emacs 24 and doesn't in Emacs 25...


texts: diff-text-hunk : Hunk text not found but patch -p0 works as intended with the same patch file

texts:
When I go to my hunk and use diff-text-hunk, I see in minibuffer and Messages :
Hunk text not found

or with another command :
diff-apply-hunk: Can’t find the text to patch

But if I try on terminal with patch -d . --verbose -p0 --dry-run < mypatch.patch
it tells me :
checking file MYFILE
Using Plan A...
Hunk #2 succeeded at 244 with fuzz 1. #the one i try with emacs

Why doesn't emacs behave as command line patch command? I do it through TRAMP if thats important.


texts: How do I configure moving by and deleting words in ansi-term?

texts:
In ansi-term's "char run" mode, I can use C-<left> and C-<right> to move around in steps of one word, but as soon as I start typing again, the point moves back to where it was. They work fine in "line run" mode (C-cC-j).

How to I get the point to stay where I moved it?

Similarly, C-w seems to use a different definition of "word" than backward-kill-word, which I have also bound to C-w for normal buffers. For Instance, hitting C-w on the end of ls /usr/local/bin gives me ls /usr/local/ in a scratch buffer, but in ansi-term it leaves me with ls.

Is there any way to configure these things more granularly?


texts: Emacs on MS Windows, typescript lsp server on wsl?

texts:
Long-time emacs user (38 years or so, not kidding).
I'm on Windows 10, running native emacs 26.1.
I'm doing some Javascript/Typescript (vue.js) development, using WSL for that world, still with the native Windows Emacs. Works great for the most part, with a few path hassles now & then (/mnt/c/foo vs. c:/foo).

I just ran across the LSP idea (https://github.com/emacs-lsp/lsp-mode) -- brilliant! I want to try that to get nice intellisense. I'll need to run the LSP server on WSL though, presumably using TCP (because all my JS/npm/tslint setup is there); has anyone done that? Will it work? Will I run into path or socket issues? Am I insane? I don't want to spend a day on a fool's errand if I can help it.

(Yeah, I could set up an X server and run WSL emacs over X but that's an extra hassle I'd like to avoid -- I'm pretty comfy with Windows emacs.)


texts:
Use case

I run my Emacs config on many machines. Most do not have a Racket installed, and I'd rather not have my Racket related packages installed by default. However, I would like to be able to edit Racket code if I need to.

This is just an example, I'm interested in doing this for a large number of modes, possibly all of the avalible major modes I can find.

Question

Is there any way I can tell Emacs to autoload a package from the package repository? racket-mode won't be installed by default, but if I ever edit a *.rkt file, the config will download, install, load, and run racket-mode?

I'm sure I can do this with ugly hacks (just shadow the functions with a helper)? Is there a cleaner way to do it?


texts: How create a function to navigate between text and header?

texts:
I tried org-mode, and I'm impressed. My org-file for notes is organized like this:

  Header 1

  Sub header 1

  Foo [ cursor here]

  Bar

  Sub header 2

Currently I use the function org-cycle a lot. It toggles (close or open) the header or the sub header.

But when the cursor is on the text foo, then when I call org-cycle with a key, the subheader will not close. Only when I move the cursor to the sub header 1.

I tried to figure out how I could come with a function, that org-cycle will also work in the text fields under a subheader/header. But I couldn't wrap my head around it...

Any suggestions? It will be appreciated!


texts: Emacs 26 line numbers are ugly in empty buffers

texts:
I like that Emacs 26's line numbers are fast, but they seem to have a problem. If you open an empty buffer, there is an empty area which is reserved for line numbers:

Once you add some text onto that line, the empty area actually fills up with a line number:

Unfortunately, when that area is empty it's pretty ugly. It's a bit confusing to open an empty buffer and see the cursor moved off to the right. It can make one think that they accidentally tabbed over there somehow.

I've tried fiddling around with display-line-numbers-width and display-line-numbers-width-start, but they seem to do no good to relieve this issue. What can I do so that this empty area is shrunken when the line is empty? Or at least, can I make a line number show up on that line even when it is empty? Some visual distinction would be nice at the very least, so that I know that I haven't mistakenly tabbed over.


texts:
I saw that bracketed paste mode is automatically enabled in Emacs 25.1 running in a terminal.

But I want to disable this mode. Because this mode adds text like 200~ 201~ to pasted text, bracketed paste mode annoys me.

I have googled But there is no information about disabling bracketed paste mode in emacs.

My development environment is macOS Sierra, and Emacs 25.1.
How can I turn off bracketed paste mode?

I frequently copy text from web browser, then paste it into Emacs running in terminal. But something text is added for copied text, e.g. 200~hello, world201~.
So these annoying characters reduce my productivity because I have to delete them after pasting text. I want to remove these characters.


texts: How can I script an emacs recording session?

texts:
Recording a GIF screencast of Emacs details a few ways we can record screencasts of Emacs sessions (e.g. to demonstrate features), but I'm really bad at not screwing things up :-)

Is there a way to script a session such that I can fake proficiency with my own package?  Essentially such a thing would be a keyboard macro, but it would not run at superhuman speeds and would be writable as a true script.

Ideally, the interface would be something like

(emacs-session-script
  "M-x"
  (insert "magit-status")
  "RET"
  (pause 1)
  "@"
  (pause 1)
  "i"
  (pause 1)
  "=l"
  (pause 0.5)
  (insert "Here is some text inserted into ")
  (insert "the minibuffer with a typewriter-like effect")
  (pause 1)
  "RET"
  ; Now emacs has switched to a new buffer
  ; (insert :speed is now 10 characters/second here)
  (insert :speed 10 "Here is a long piece of text

with many lines")
  (pause 1)
  "C-c C-c"
  (pause 2))


texts: org-latex-export: Name sections according to CUSTOM_ID rather than headline (%s)?

texts:
Problem description

In org-mode's LaTeX export configuration, the %s operator can be used as a placeholder for the headline string, as can be seen in the examples at

https://orgmode.org/worg/org-tutorials/org-latex-export.html

For reasons far too complicated to explain here, I would like to name the sections in my exported .tex file not according to the corresponding headlines in my .org file, but instead according to the respective sections' CUSTOM_ID property.

I am wondering whether it is possible to achieve this. For example, there might be an operator equivalent to %s, which is automatically replaced by a section's CUSTOM_ID rather than by its headline?

Example to illustrate

I'd like the .org code

* My section
:PROPERTIES:
:CUSTOM_ID: foo
:END:

to result in the following .tex code when exported via C-c C-e C-b l L:

\section{foo}

and not in the following:

\section{My section}


texts: Interpret terminal escape codes in generic process output

texts: I'm running a (start-process) which spits out terminal escape codes into a buffer and it looks ugly. Is there a mode that will interpret these codes into colors? Something similar to whatever ansi-term does?


texts: Change line length calculation of a certain character displayed with multiple glyphs

texts:
I am differentiating em-dashes (—) from hypens (-) in emacs using this code in my .emacs:

(let* ((glyph-em-dash (make-glyph-code ?\u002D 'font-lock-function-name-face)) )
  (aset standard-display-table 8212
    `[,glyph-em-dash ,glyph-em-dash ,glyph-em-dash]))

The issue is that emacs counts these characters as taking up three columns (which they do visually).  How can I tell emacs to count the em-dash as only one character when calculating line lengths, etc.?


texts: How to get AUCTeX to automatically generate a`TeX-engine:luatex` file-variable directive upon creating a new .tex document?

texts:
Is there a way to cause AUCTeX to automatically generate the line

%%% TeX-engine: luatex

in a new .tex document as it does with other file-variables, such as TeX-master?


texts: Is there a company backend for completion in sql-interactive-mode?

texts:
I'm using sql-interactive-mode, and I'm in need for a Company backends that will complete SQL keywords, and preferably, also column/table names of the used database.

When looking around for any completion, to my surprise, there was no backend for SQL yet. I found this snippet, but that didn't worked properly.

It's possible it doesn't exist yet, and I might to create an own backend for SQL. But I find it hard to believe there is no Company backend for one of the most common languages.


texts: org mode sort problems with (numerical) properties

texts:
I use the property "pages" for the number of pages of an article or book.

There are two problems.

First:

If I use C-c ^ to sort the items by the value of pages
org-sort seems to interpret the numbers lexicographically: 1<100<20<3.
Of course I need the natural order of numbers: 1<3<20<100.

Second:

If I use C-c a m to search for items with pages<20 I get
the correct items and the "wrong" items: where the pages property is not defined.
How to ignore the "wrong" items?


texts:
When I export something with org mode to html, with it comes a load of presets such as id, labels, classes, preambles and post ambles.

For example:

<div id="outline-container-org16cf335" class="outline-2">

I would like to remove all of this or to at least be able to edit its patterns. I know I can set it to use the :CUSTOM-ID: property instead of the normal cacophony of spontaneously generated ids, but what I would really like is to either remove this automatic id setting or to edit the pattern used by it, but I couldn't manage to find this information yet.

edit:

I have found the ox-slimhtml package which greatly satisfies this need.


texts: How the get the text value of a complete value of a variable?

texts:
here a little example to explain my problem :

How to get "marge" or ("marge") from oef-highlighted-variable ?

oef-highlighted-variable
#("marge" 0 5 (fontified nil face oef-font-variable-name-face))

With replace-regexp-in-string or Is there a better way ?

SOLVED by wasamasa

(substring-no-properties oef-highlighted-variable)
"marge"


texts: Synchronize packages between different machines

texts:
I use emacs in different places and I want to have a similar setup and packages installed everywhere. I guess I can use a version control repository for the setup files. Since I use Prelude, that would be ~/.emacs.d/personal/.

I don't know how to do with packages. Is there a file somewhere in .emacs.d/ with the list of installed packages that I can use to make emacs in other machines to also install those listed there?


texts: Possible to cache newsgroup message headers in Gnus

texts:
I'd like to start using Gnus to read mailing lists via nntp/Gmane.  Works fine so far, but each time I press RET on a group name in the *Group* buffer, Gnus seems to download a lot of data (in case of the org-mode list, some 30+M, which takes 10+ seconds).

Maybe I don't understand the workings of NNTP and Gnus properly, but shouldn't it be possible to somehow cache these data locally?  Waiting many seconds for entering a group seems to be a waste of time, especially since at this point, Gnus already knows the number of unread messages ...


texts: Can one define custom delimiters for inline formatting in org mode?

texts:
The title says it quite straight, what I am looking for is the following:

while *this* is bold, `that` should appear in a custom format

Edit: This question is no duplicate of that although the answer is hidden there in a comment. As I think it is worth to be found, I repeat it here:

It is impossible to use self-defined delimiter symbols.


texts: How to resize images when exporting to Markdown format?

texts: Is there an equivalent of #+attr_html: :width 500px for Markdown format ?


texts: Save .org file from org table edit field buffer

texts:
Is there any command to save the org file from the org table edit field buffer? If not, is there any way to check if the current buffer is an org table edit field buffer?

More details: When I am editing a cell in a org-table in a file, say tmp.org, I can edit the content of that cell in a separate buffer, called "Org Table Edit Field". I want to save the file tmp.org when I am in the buffer "Org Table Edit Field". Here is an example:

UPDATE (Oct, 2018): I am currently using the following workaround:

(defun my-org-save-file()
  (interactive)
  (if org-field-marker
      (progn
        (setq tb-field-current-pos (point))
        (org-ctrl-c-ctrl-c)
        (save-buffer)
        (org-table-edit-field (save-excursion))
        (goto-char tb-field-current-pos)
      )
    (save-buffer)
    )
  )


texts: Increase scale only for devanagari characters using dir-locals

texts:
In my .dir-locals, I have the following:
((nil . ((eval . (text-scale-set 5)))))

It blows up all characters.
But I want that rule to apply ONLY to devanagari characters.
How do I achieve that?


texts: org mode not showing all the text in my file?

texts:
I am new to Emacs and struggling to learn it.

I have a test.org file:

* Heading

** Sub-Heading

*** Third-level

When I open the file, the buffer just displays:

* Heading...

Where did all the rest of my text go?  How do I see what else is in that file?


texts:
Is there a command for recover the current file from the backup ?

I have a file ~/temp.txt and some backup files !home!djangoliv!temp.txt.~1~ ... !home!djangoliv!temp.txt.~5~, !home!djangoliv!temp.txt.~6~.

I would like to load backup files from the newer version to the older one (like git-time-machine for exemple)

Here my backup configuration

  (setq auto-save-default nil)
  (setq backup-directory-alist '(("." . "~/.emacs-backup-files/")))
  (setq version-control t
        vc-make-backup-files t
        backup-by-copying t
        delete-old-versions -1)


texts: Confused by the Emacs Lisp doc : Adjusting Point After Commands

texts:
I am on the trip of reading GNU Emacs Lisp Manual, and section 20.6 has the following text:

  It is not easy to display a value of point in the middle of a sequence
  of text that has the ‘display’, ‘composition’ or is invisible.
  Therefore, after a command finishes and returns to the command loop,
  if point is within such a sequence, the command loop normally moves
  point to the edge of the sequence.

I am not a native English speaker, and am confused by the phrase:

text that has the ‘display’, ‘composition’ or is invisible.

Does display and composition apply to text properties or something else? I have not yet started the section 31. Text so I know nothing about these. But I have searched for composition and found in 31.19.4 Properties with Special Meanings there is the following expression:

  the properties ‘composition’, ‘display’, ‘invisible’ and ‘intangible’

I am not sure those are the same things. If they are, I think they are not consistent expression, at least the former should be

  text that has the ‘display’, ‘composition’ or ‘invisible’ properties.

and should I report a bug of this?


texts:
Absolute beginner with Emacs and Emacs Lisp. I am using spacemacs and have been trying to  get autocompletion of matching delimiters commonly used in LaTeX in Org-mode. My requirements are just getting the matching delimiters autocompleted. This is different from this question but more similar to this one.

when I type \( and press TAB, it should autocomplete it to \( | \) and leave the cursor at the position where | is.
Similarly, when I type \[ and press TAB, it should autocomplete to \[ | \] and leave the cursor at the position where | is.


texts: How to defeat the fontification of colour literals in css-mode?

texts:
Emacs css-mode is fontifying my colour literals.  For example:

This makes the text harder to read.

I tried to defeat it with the following in my .emacs.
(Note: this matches on ‘hsl’ because those are the only literals I actually use.)

(font-lock-add-keywords nil
 '(
   ("color: *\\(hsla?(.*)\\)" 1 'default t) ; Colour literal
   )
 )

This fails.  I can override the fontification of other things,
but somehow these colour literals are override proof.

How can I defeat this unwanted fontification?


texts: Is it possible to have expand abbreviations when calling a skeleton-read?

texts:
I have a large set of abbreviations I defined inside an abbrev-table. Take one of them:

(define-abbrev-table 'latex-mode-abbrev-table
  '(("ff" "my abbreviation!" 0 nil)))

If I run a predefined function that calls things through skeleton-read is there a way to expand abbreviations within that query? In other words if I define a function,

   (define-skeleton myfunc  ""  "" (setq v1 (skeleton-read "put something ")))

and call it with M-x then within the bottom bar where I type in the value can I use my abbreviation (by typing ff and then hitting the space bar) while typing there (nothing happens by default)?


texts: a confirmation after C-x C-c before exiting Emacs

texts: Can I configure Emacs to ask for confirmation before exiting on C-x C-c? (Sometimes, my fingers press this by mistake.)


texts: Mu4e not saving emails sent from an alias

texts:
I use mu4e for email and have aliases on the same account. I sent a test email today from an alias and received it. But it is not showing on the Sent Items for the account with the main name.
How can I save the emails I send from an alias?


texts: elips macro that return's the current file's filename

texts:
I want to define a action that says open <config file> within the actual config file itself. However, this config file may be in a different location on different computers. How can I get the current file's filename with a macro?

In this example, I'm looking avoid typing "etude-module-lisp" or the filename of the file in this particular piece of code:

(on/mode: [::lisp   lisp-interaction-mode]
  "etude-module-lisp"
  ::eval-cursor    'eval-last-sexp
  ::eval-buffer    'eval-buffer)


texts: Emacs doesn't search inside elpa directory while loading

texts:
OS: Windows XP, Emacs: 24.5.1.

I installed bookmark+ package using Melpa. It was put into directory:

~/.emacs.d/elpa/bookmark+-20151107.847

When I put (require 'bookmark+) to the end of ~/.emacs, I get an error:

Warning (initialization): An error occurred while loading `.emacs':

File error: Cannot open load file, no such file or directory, bookmark+

But after Emacs is fully loaded, if I evaluate form (require 'bookmark+) --- it loads the appropriate module.

So, it seems, that it doesn't search for the library in ~/.emacs.d/elpa/bookmark+-20151107.847 directory while .emacs is being loaded.

How to fix?


texts:
When I start emacs, I would like to have it set up so that there is a scratch buffer on top and a terminal on the bottom. I would like the terminal to be 15 lines tall. So far I have

(defun startup-layout ()
  (interactive)
  (delete-other-windows)
  (split-window-vertically)
  (next-multiframe-window)
  (enlarge-window ( - 15 window-body-height))
  (term "/bin/bash")
  (previous-multiframe-window)
  )
(startup-layout)

How can I set the window size?


texts: question of function of helm-projectile-find-file

texts:
When using helm-projectile-find-file, if I want to find java file (end by .java). I typed java, but it could also list file of

jav/test/a.a
jav/test1/a.a
jav/test2/a.a

How to make it work only list the file name whose continuous chars form a "java" word? Also I tried to regular express, such as "java$", but it doesn't work. Any way to support regular express?


texts: highlight different regexp groups with different colors

texts:
Is there a way, that each group in regexp can be highlighted with a different color.

For example, if I am searching for

\(text_part_1\)\|\(text_part_2\)

Can the text_part_1 be highlighted in one color and text_part_2 in another color?


texts: Export Org-mode document with Biblatex-style citations and Org-ref

texts:
With org-ref and biblatex, I only get the Helm menu for further actions (with C-c C-o) on autocite citations... textcite and cite don't respond to the C-c C-o prompt. How come?
Also, to be able to export the org document to pdf, I have to manually evaluate code such as this:
  (org-ref-link-set-parameters "parencite"
    :export
    (lambda (path desc format)
      (cond
       ((eq format 'latex)
        (if (or (not desc) (equal 0 (search "parencite:" desc)))
            (format "\\parencite{%s}" path)
          (format "\\parencite[%s]{%s}" desc path)
          )))))

  (org-ref-link-set-parameters "textcite"
    :export
    (lambda (path desc format)
      (cond
       ((eq format 'latex)
        (if (or (not desc) (equal 0 (search "textcite:" desc)))
            (format "\\textcite{%s}" path)
          (format "\\textcite[%s]{%s}" desc path)
          )))))

Is there a way to automate this so that it is evaluated on start-up and so Org will pick it up when exporting to pdf?


texts: Call emacsclient from a program called by Emacs

texts:
I've run into a problem viewing pdf documentation files with AucTex. I use pdf-tools to view PDF files from within Emacs, and I've set emacsclient -n as my default pdf-viewer (via xdg-mime on Debian Linux). This works fine in most circumstances, but it breaks the (Tex-documentation-texdoc ...) function of Auctex (C-c ?).

I've narrowed the problem down to a single line of code. When I try to view the documentation for the listings package, TeX-documentation-texdoc turns this into the following sexp:

(shell-command-to-string "texdoc --view  listings")

texdoc in turn calls emacsclient to actually open the file (based on how I've configured my desktop via xdg). However, at this point, the Emacs hangs and I need to quit (C-g) to get control back. After that, no new pdf is opened. The same thing happens if I try to call emacsclient directly:

(shell-command-to-string "emacsclient -n tmp.pdf")

Both commands work at the command line (i.e., emacsclient -n tmp.pdf and texdoc --view listings.

My question is, in an instance like this, how do I call emacsclient from within Emacs? (and I know I could just open the pdf file with find-file; that's not an option here as I need to call an external process (texdoc) to find the file, and that process then invokes emacsclient).


texts: Spacemacs, Lisp, Pasting and the missing Space

texts:
When editing Lisp or Clojure in Spacemacs (Emacs with Evil) I find the pasting behavior anoying. Say I have yanked bar and want to paste it as a parameter to (foo) so I get (foo bar). The problem is, I have to insert a space between o and ) before pasting or afterwards.
Is there a way to tell Spacemacs to automatically insert the space in Lisp/Clojure mode (with paredit) when pasting?